@eclipse-glsp/vscode-integration-webview 1.1.0-next.ef526c6.51 → 2.0.0

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.
Files changed (89) hide show
  1. package/README.md +1 -1
  2. package/lib/default-modules.d.ts +19 -0
  3. package/lib/default-modules.d.ts.map +1 -0
  4. package/lib/default-modules.js +34 -0
  5. package/lib/default-modules.js.map +1 -0
  6. package/lib/diagram-identifier.d.ts +14 -0
  7. package/lib/diagram-identifier.d.ts.map +1 -0
  8. package/lib/{diagram-identifer.js → diagram-identifier.js} +11 -5
  9. package/lib/diagram-identifier.js.map +1 -0
  10. package/lib/{copy-paste-handler-provider.js → features/copyPaste/copy-paste-module.d.ts} +4 -6
  11. package/lib/features/copyPaste/copy-paste-module.d.ts.map +1 -0
  12. package/lib/features/copyPaste/copy-paste-module.js +28 -0
  13. package/lib/features/copyPaste/copy-paste-module.js.map +1 -0
  14. package/lib/{copy-paste-handler-provider.d.ts → features/copyPaste/copy-paste-startup.d.ts} +10 -3
  15. package/lib/features/copyPaste/copy-paste-startup.d.ts.map +1 -0
  16. package/lib/{glsp-vscode-diagram-widget.js → features/copyPaste/copy-paste-startup.js} +37 -32
  17. package/lib/features/copyPaste/copy-paste-startup.js.map +1 -0
  18. package/lib/{diagram-identifer.d.ts → features/default/default-module.d.ts} +4 -11
  19. package/lib/features/default/default-module.d.ts.map +1 -0
  20. package/lib/features/default/default-module.js +31 -0
  21. package/lib/features/default/default-module.js.map +1 -0
  22. package/lib/{extension-action-handler.d.ts → features/default/extension-action-handler.d.ts} +18 -11
  23. package/lib/features/default/extension-action-handler.d.ts.map +1 -0
  24. package/lib/features/default/extension-action-handler.js +85 -0
  25. package/lib/features/default/extension-action-handler.js.map +1 -0
  26. package/lib/features/default/vscode-glsp-modelsource.d.ts +40 -0
  27. package/lib/features/default/vscode-glsp-modelsource.d.ts.map +1 -0
  28. package/lib/features/default/vscode-glsp-modelsource.js +68 -0
  29. package/lib/features/default/vscode-glsp-modelsource.js.map +1 -0
  30. package/lib/features/export/export-module.d.ts +18 -0
  31. package/lib/features/export/export-module.d.ts.map +1 -0
  32. package/lib/features/export/export-module.js +24 -0
  33. package/lib/features/export/export-module.js.map +1 -0
  34. package/lib/features/navigation/navigation-module.d.ts +18 -0
  35. package/lib/features/navigation/navigation-module.d.ts.map +1 -0
  36. package/lib/features/navigation/navigation-module.js +24 -0
  37. package/lib/features/navigation/navigation-module.js.map +1 -0
  38. package/lib/features/notification/notification-module.d.ts +18 -0
  39. package/lib/features/notification/notification-module.d.ts.map +1 -0
  40. package/lib/features/notification/notification-module.js +27 -0
  41. package/lib/features/notification/notification-module.js.map +1 -0
  42. package/lib/glsp-diagram-widget.d.ts +32 -0
  43. package/lib/glsp-diagram-widget.d.ts.map +1 -0
  44. package/lib/glsp-diagram-widget.js +89 -0
  45. package/lib/glsp-diagram-widget.js.map +1 -0
  46. package/lib/glsp-starter.d.ts +43 -9
  47. package/lib/glsp-starter.d.ts.map +1 -1
  48. package/lib/glsp-starter.js +53 -66
  49. package/lib/glsp-starter.js.map +1 -1
  50. package/lib/index.d.ts +12 -2
  51. package/lib/index.d.ts.map +1 -1
  52. package/lib/index.js +26 -16
  53. package/lib/index.js.map +1 -1
  54. package/lib/webview-glsp-client.d.ts +56 -0
  55. package/lib/webview-glsp-client.d.ts.map +1 -0
  56. package/lib/webview-glsp-client.js +103 -0
  57. package/lib/webview-glsp-client.js.map +1 -0
  58. package/package.json +15 -15
  59. package/src/default-modules.ts +34 -0
  60. package/src/{diagram-identifer.ts → diagram-identifier.ts} +16 -5
  61. package/src/features/copyPaste/copy-paste-module.ts +39 -0
  62. package/src/features/copyPaste/copy-paste-startup.ts +50 -0
  63. package/src/features/default/default-module.ts +32 -0
  64. package/src/features/default/extension-action-handler.ts +73 -0
  65. package/src/features/default/vscode-glsp-modelsource.ts +63 -0
  66. package/src/{copy-paste-handler-provider.ts → features/export/export-module.ts} +6 -8
  67. package/src/features/navigation/navigation-module.ts +22 -0
  68. package/src/features/notification/notification-module.ts +25 -0
  69. package/src/glsp-diagram-widget.ts +79 -0
  70. package/src/glsp-starter.ts +69 -85
  71. package/src/index.ts +13 -2
  72. package/src/webview-glsp-client.ts +132 -0
  73. package/lib/copy-paste-handler-provider.d.ts.map +0 -1
  74. package/lib/copy-paste-handler-provider.js.map +0 -1
  75. package/lib/diagram-identifer.d.ts.map +0 -1
  76. package/lib/diagram-identifer.js.map +0 -1
  77. package/lib/extension-action-handler.d.ts.map +0 -1
  78. package/lib/extension-action-handler.js +0 -30
  79. package/lib/extension-action-handler.js.map +0 -1
  80. package/lib/glsp-vscode-diagram-widget.d.ts +0 -6
  81. package/lib/glsp-vscode-diagram-widget.d.ts.map +0 -1
  82. package/lib/glsp-vscode-diagram-widget.js.map +0 -1
  83. package/lib/glsp-vscode-diagramserver.d.ts +0 -33
  84. package/lib/glsp-vscode-diagramserver.d.ts.map +0 -1
  85. package/lib/glsp-vscode-diagramserver.js +0 -108
  86. package/lib/glsp-vscode-diagramserver.js.map +0 -1
  87. package/src/extension-action-handler.ts +0 -46
  88. package/src/glsp-vscode-diagram-widget.ts +0 -42
  89. package/src/glsp-vscode-diagramserver.ts +0 -111
package/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Eclipse GLSP VSCode Integration
2
2
 
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
- 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
4
 
6
5
  ## Where to find the sources?
7
6
 
8
7
  In addition to this repository, the related source code can be found here:
9
8
 
10
9
  - <https://github.com/eclipse-glsp/glsp-server>
10
+ - <https://github.com/eclipse-glsp/glsp-server-node>
11
11
  - <https://github.com/eclipse-glsp/glsp-client>
12
12
 
13
13
  ## More information
@@ -0,0 +1,19 @@
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 { ModuleConfiguration } from '@eclipse-glsp/client';
17
+ export declare const VSCODE_DEFAULT_MODULES: readonly [import("@eclipse-glsp/client").FeatureModule, import("@eclipse-glsp/client").FeatureModule, import("@eclipse-glsp/client").FeatureModule, import("@eclipse-glsp/client").FeatureModule, import("@eclipse-glsp/client").FeatureModule];
18
+ export declare const VSCODE_DEFAULT_MODULE_CONFIG: ModuleConfiguration;
19
+ //# sourceMappingURL=default-modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-modules.d.ts","sourceRoot":"","sources":["../src/default-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAO3D,eAAO,MAAM,sBAAsB,iPAMzB,CAAC;AAEX,eAAO,MAAM,4BAA4B,EAAE,mBAE1C,CAAC"}
@@ -0,0 +1,34 @@
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.VSCODE_DEFAULT_MODULE_CONFIG = exports.VSCODE_DEFAULT_MODULES = void 0;
19
+ const copy_paste_module_1 = require("./features/copyPaste/copy-paste-module");
20
+ const default_module_1 = require("./features/default/default-module");
21
+ const export_module_1 = require("./features/export/export-module");
22
+ const navigation_module_1 = require("./features/navigation/navigation-module");
23
+ const notification_module_1 = require("./features/notification/notification-module");
24
+ exports.VSCODE_DEFAULT_MODULES = [
25
+ default_module_1.vscodeDefaultModule,
26
+ copy_paste_module_1.vscodeCopyPasteModule,
27
+ export_module_1.vscodeExportModule,
28
+ navigation_module_1.vscodeNavigationModule,
29
+ notification_module_1.vscodeNotificationModule
30
+ ];
31
+ exports.VSCODE_DEFAULT_MODULE_CONFIG = {
32
+ add: [...exports.VSCODE_DEFAULT_MODULES]
33
+ };
34
+ //# sourceMappingURL=default-modules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-modules.js","sourceRoot":"","sources":["../src/default-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAGlF,8EAA+E;AAC/E,sEAAwE;AACxE,mEAAqE;AACrE,+EAAiF;AACjF,qFAAuF;AAE1E,QAAA,sBAAsB,GAAG;IAClC,oCAAmB;IACnB,yCAAqB;IACrB,kCAAkB;IAClB,0CAAsB;IACtB,8CAAwB;CAClB,CAAC;AAEE,QAAA,4BAA4B,GAAwB;IAC7D,GAAG,EAAE,CAAC,GAAG,8BAAsB,CAAC;CACnC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare const GLSPDiagramIdentifier: unique symbol;
2
+ export interface GLSPDiagramIdentifier {
3
+ clientId: string;
4
+ diagramType: string;
5
+ uri: string;
6
+ }
7
+ export declare function isDiagramIdentifier(object: any): object is GLSPDiagramIdentifier;
8
+ export interface WebviewReadyMessage {
9
+ readyMessage: string;
10
+ }
11
+ export declare namespace WebviewReadyMessage {
12
+ function is(object: unknown): object is WebviewReadyMessage;
13
+ }
14
+ //# sourceMappingURL=diagram-identifier.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagram-identifier.d.ts","sourceRoot":"","sources":["../src/diagram-identifier.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,qBAAqB,CAOhF;AAKD,MAAM,WAAW,mBAAmB;IAChC,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,yBAAiB,mBAAmB,CAAC;IACjC,SAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,mBAAmB,CAEjE;CACJ"}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isDiagramIdentifier = exports.GLSPDiagramIdentifier = void 0;
3
+ exports.WebviewReadyMessage = exports.isDiagramIdentifier = exports.GLSPDiagramIdentifier = void 0;
4
4
  /********************************************************************************
5
- * Copyright (c) 2021-2022 EclipseSource and others.
5
+ * Copyright (c) 2021-2023 EclipseSource and others.
6
6
  *
7
7
  * This program and the accompanying materials are made available under the
8
8
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -19,11 +19,17 @@ exports.isDiagramIdentifier = exports.GLSPDiagramIdentifier = void 0;
19
19
  const client_1 = require("@eclipse-glsp/client");
20
20
  exports.GLSPDiagramIdentifier = Symbol('GLSPDiagramIdentifier');
21
21
  function isDiagramIdentifier(object) {
22
- return (object !== undefined &&
23
- typeof object === 'object' &&
22
+ return (client_1.AnyObject.is(object) && //
24
23
  (0, client_1.hasStringProp)(object, 'clientId') &&
25
24
  (0, client_1.hasStringProp)(object, 'diagramType') &&
26
25
  (0, client_1.hasStringProp)(object, 'uri'));
27
26
  }
28
27
  exports.isDiagramIdentifier = isDiagramIdentifier;
29
- //# sourceMappingURL=diagram-identifer.js.map
28
+ var WebviewReadyMessage;
29
+ (function (WebviewReadyMessage) {
30
+ function is(object) {
31
+ return client_1.AnyObject.is(object) && (0, client_1.hasStringProp)(object, 'readyMessage');
32
+ }
33
+ WebviewReadyMessage.is = is;
34
+ })(WebviewReadyMessage || (exports.WebviewReadyMessage = WebviewReadyMessage = {}));
35
+ //# sourceMappingURL=diagram-identifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagram-identifier.js","sourceRoot":"","sources":["../src/diagram-identifier.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAAgE;AAEnD,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAQrE,SAAgB,mBAAmB,CAAC,MAAW;IAC3C,OAAO,CACH,kBAAS,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE;QAC1B,IAAA,sBAAa,EAAC,MAAM,EAAE,UAAU,CAAC;QACjC,IAAA,sBAAa,EAAC,MAAM,EAAE,aAAa,CAAC;QACpC,IAAA,sBAAa,EAAC,MAAM,EAAE,KAAK,CAAC,CAC/B,CAAC;AACN,CAAC;AAPD,kDAOC;AASD,IAAiB,mBAAmB,CAInC;AAJD,WAAiB,mBAAmB;IAChC,SAAgB,EAAE,CAAC,MAAe;QAC9B,OAAO,kBAAS,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAA,sBAAa,EAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACzE,CAAC;IAFe,sBAAE,KAEjB,CAAA;AACL,CAAC,EAJgB,mBAAmB,mCAAnB,mBAAmB,QAInC"}
@@ -1,6 +1,5 @@
1
- "use strict";
2
1
  /********************************************************************************
3
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2023 EclipseSource and others.
4
3
  *
5
4
  * This program and the accompanying materials are made available under the
6
5
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -14,7 +13,6 @@
14
13
  *
15
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
15
  ********************************************************************************/
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.CopyPasteHandlerProvider = void 0;
19
- exports.CopyPasteHandlerProvider = Symbol('CopyPasteHandlerProvider');
20
- //# sourceMappingURL=copy-paste-handler-provider.js.map
16
+ import { FeatureModule } from '@eclipse-glsp/client';
17
+ export declare const vscodeCopyPasteModule: FeatureModule;
18
+ //# sourceMappingURL=copy-paste-module.d.ts.map
@@ -0,0 +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,EACH,aAAa,EAOhB,MAAM,sBAAsB,CAAC;AAI9B,eAAO,MAAM,qBAAqB,eAUjC,CAAC"}
@@ -0,0 +1,28 @@
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.vscodeCopyPasteModule = void 0;
19
+ const client_1 = require("@eclipse-glsp/client");
20
+ const extension_action_handler_1 = require("../default/extension-action-handler");
21
+ const copy_paste_startup_1 = require("./copy-paste-startup");
22
+ exports.vscodeCopyPasteModule = new client_1.FeatureModule(bind => {
23
+ bind(copy_paste_startup_1.CopyPasteHandlerProvider).toProvider(ctx => () => new Promise(resolve => resolve(ctx.container.get(client_1.TYPES.ICopyPasteHandler))));
24
+ (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
+ }, { requires: client_1.copyPasteModule });
28
+ //# sourceMappingURL=copy-paste-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-paste-module.js","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAQ8B;AAC9B,kFAA0E;AAC1E,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;IAC7D,IAAI,CAAC,8CAAmB,CAAC,CAAC,eAAe,CAAC,mCAA0B,CAAC,IAAI,CAAC,CAAC;IAC3E,IAAI,CAAC,8CAAmB,CAAC,CAAC,eAAe,CAAC,+BAAsB,CAAC,IAAI,CAAC,CAAC;AAC3E,CAAC,EACD,EAAE,QAAQ,EAAE,wBAAe,EAAE,CAChC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2022 EclipseSource and others.
2
+ * Copyright (c) 2023 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
@@ -13,11 +13,18 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { ICopyPasteHandler } from '@eclipse-glsp/client/lib/features/copy-paste/copy-paste-handler';
16
+ import { ICopyPasteHandler, IDiagramStartup, MaybePromise } from '@eclipse-glsp/client';
17
17
  export declare const CopyPasteHandlerProvider: unique symbol;
18
18
  /**
19
19
  * Service identifier and type definition to bind the {@link ICopyPasteHandler} to an provider.
20
20
  * This enables asynchronous injections and can be used to bypass circular dependency issues.
21
21
  */
22
22
  export type CopyPasteHandlerProvider = () => Promise<ICopyPasteHandler>;
23
- //# sourceMappingURL=copy-paste-handler-provider.d.ts.map
23
+ /**
24
+ * Startup service to hook up the copy&paste event handler
25
+ */
26
+ export declare class CopyPasteStartup implements IDiagramStartup {
27
+ protected copyPasteHandlerProvider: CopyPasteHandlerProvider;
28
+ preInitialize(): MaybePromise<void>;
29
+ }
30
+ //# sourceMappingURL=copy-paste-startup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-paste-startup.d.ts","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-startup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGxF,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAC3E;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAExE;;GAEG;AACH,qBACa,gBAAiB,YAAW,eAAe;IAEpD,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAE7D,aAAa,IAAI,YAAY,CAAC,IAAI,CAAC;CAetC"}
@@ -1,14 +1,6 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.decodeURI = exports.GLSPVscodeDiagramWidget = void 0;
10
2
  /********************************************************************************
11
- * Copyright (c) 2020-2022 EclipseSource and others.
3
+ * Copyright (c) 2023 EclipseSource and others.
12
4
  *
13
5
  * This program and the accompanying materials are made available under the
14
6
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -22,30 +14,43 @@ exports.decodeURI = exports.GLSPVscodeDiagramWidget = void 0;
22
14
  *
23
15
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
24
16
  ********************************************************************************/
25
- const client_1 = require("@eclipse-glsp/client");
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.CopyPasteStartup = exports.CopyPasteHandlerProvider = void 0;
26
28
  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() {
30
- if (this.modelSource instanceof client_1.DiagramServerProxy) {
31
- this.modelSource.clientId = this.diagramIdentifier.clientId;
32
- }
33
- this.actionDispatcher.dispatch(client_1.RequestModelAction.create({
34
- options: {
35
- sourceUri: decodeURI(this.diagramIdentifier.uri),
36
- diagramType: this.diagramIdentifier.diagramType
37
- }
38
- }));
39
- this.actionDispatcher.dispatch(client_1.RequestTypeHintsAction.create());
40
- this.actionDispatcher.dispatch(client_1.EnableToolPaletteAction.create());
29
+ exports.CopyPasteHandlerProvider = Symbol('CopyPasteHandlerProvider');
30
+ /**
31
+ * Startup service to hook up the copy&paste event handler
32
+ */
33
+ let CopyPasteStartup = class CopyPasteStartup {
34
+ preInitialize() {
35
+ this.copyPasteHandlerProvider().then(copyPasteHandler => {
36
+ document.addEventListener('copy', (e) => {
37
+ copyPasteHandler.handleCopy(e);
38
+ });
39
+ document.addEventListener('cut', (e) => {
40
+ copyPasteHandler.handleCut(e);
41
+ });
42
+ document.addEventListener('paste', (e) => {
43
+ copyPasteHandler.handlePaste(e);
44
+ });
45
+ });
41
46
  }
42
47
  };
43
- GLSPVscodeDiagramWidget = __decorate([
48
+ exports.CopyPasteStartup = CopyPasteStartup;
49
+ __decorate([
50
+ (0, inversify_1.inject)(exports.CopyPasteHandlerProvider),
51
+ __metadata("design:type", Function)
52
+ ], CopyPasteStartup.prototype, "copyPasteHandlerProvider", void 0);
53
+ exports.CopyPasteStartup = CopyPasteStartup = __decorate([
44
54
  (0, inversify_1.injectable)()
45
- ], GLSPVscodeDiagramWidget);
46
- exports.GLSPVscodeDiagramWidget = GLSPVscodeDiagramWidget;
47
- function decodeURI(uri) {
48
- return decodeURIComponent(uri.replace(/\+/g, ' '));
49
- }
50
- exports.decodeURI = decodeURI;
51
- //# sourceMappingURL=glsp-vscode-diagram-widget.js.map
55
+ ], CopyPasteStartup);
56
+ //# sourceMappingURL=copy-paste-startup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-paste-startup.js","sourceRoot":"","sources":["../../../src/features/copyPaste/copy-paste-startup.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAGlF,yCAA+C;AAElC,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAO3E;;GAEG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAIzB,aAAa;QACT,IAAI,CAAC,wBAAwB,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE;YACpD,QAAQ,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAiB,EAAE,EAAE;gBACpD,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAiB,EAAE,EAAE;gBACnD,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAiB,EAAE,EAAE;gBACrD,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AAnBY,4CAAgB;AAEf;IADT,IAAA,kBAAM,EAAC,gCAAwB,CAAC;;kEAC4B;2BAFpD,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAmB5B"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2023 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
@@ -13,13 +13,6 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
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
16
+ import { FeatureModule } from '@eclipse-glsp/client';
17
+ export declare const vscodeDefaultModule: FeatureModule;
18
+ //# sourceMappingURL=default-module.d.ts.map
@@ -0,0 +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,EAAsE,MAAM,sBAAsB,CAAC;AAKzH,eAAO,MAAM,mBAAmB,eAU/B,CAAC"}
@@ -0,0 +1,31 @@
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.vscodeDefaultModule = void 0;
19
+ const client_1 = require("@eclipse-glsp/client");
20
+ const glsp_diagram_widget_1 = require("../../glsp-diagram-widget");
21
+ const extension_action_handler_1 = require("./extension-action-handler");
22
+ const vscode_glsp_modelsource_1 = require("./vscode-glsp-modelsource");
23
+ exports.vscodeDefaultModule = new client_1.FeatureModule((bind, _unbind, _isBound, rebind) => {
24
+ bind(glsp_diagram_widget_1.GLSPDiagramWidget).toSelf().inSingletonScope();
25
+ 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
+ (0, client_1.bindAsService)(bind, client_1.TYPES.IActionHandlerInitializer, extension_action_handler_1.HostExtensionActionHandler);
29
+ bind(extension_action_handler_1.ExtensionActionKind).toConstantValue(client_1.SelectAction.KIND);
30
+ }, { requires: client_1.defaultModule });
31
+ //# sourceMappingURL=default-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default-module.js","sourceRoot":"","sources":["../../../src/features/default/default-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,iDAAyH;AACzH,mEAAwF;AACxF,yEAA6F;AAC7F,uEAAkE;AAErD,QAAA,mBAAmB,GAAG,IAAI,sBAAa,CAChD,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;IAChC,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,IAAI,CAAC,+CAAqB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACxD,MAAM,CAAC,wBAAe,CAAC,CAAC,SAAS,CAAC,+CAAqB,CAAC,CAAC;IACzD,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,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021-2022 EclipseSource and others.
2
+ * Copyright (c) 2021-2023 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
@@ -13,19 +13,26 @@
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, IActionHandler, IActionHandlerInitializer, ICommand } from '@eclipse-glsp/client';
17
- import { SprottyDiagramIdentifier } from 'sprotty-vscode-webview';
18
- import { VsCodeApi } from 'sprotty-vscode-webview/lib/services';
16
+ import { Action, ActionHandlerRegistry, GLSPClient, IActionHandler, IActionHandlerInitializer, ICommand, IDiagramOptions } from '@eclipse-glsp/client';
19
17
  /**
20
- * Delegates actions that should be handled inside of the glsp vscode extension instead
18
+ * Service identifier to define action kinds that should be delegated to the vscode extension (when locally dispatched)
19
+ *
20
+ * Usage:
21
+ * ```ts
22
+ * bind(ExtensionActionKind).toConstantValue(SomeAction.KIND)
23
+ * ```
24
+ */
25
+ export declare const ExtensionActionKind: unique symbol;
26
+ /**
27
+ * Delegates actions that should be handled inside of the host extension instead
21
28
  * of the webview. This enables the implementation of action handlers that require access
22
- * to the vscode API and/or node backend.
29
+ * to the vscode API.
23
30
  */
24
- export declare class GLSPVscodeExtensionActionHandler implements IActionHandler, IActionHandlerInitializer {
25
- protected readonly actionKinds: string[];
26
- protected readonly diagramIdentifier: SprottyDiagramIdentifier;
27
- protected vscodeApi: VsCodeApi;
28
- constructor(actionKinds: string[], diagramIdentifier: SprottyDiagramIdentifier, vscodeApi: VsCodeApi);
31
+ export declare class HostExtensionActionHandler implements IActionHandler, IActionHandlerInitializer {
32
+ protected actionKinds: string[];
33
+ protected diagramOptions: IDiagramOptions;
34
+ protected glspClient?: GLSPClient;
35
+ protected postConstruct(): void;
29
36
  initialize(registry: ActionHandlerRegistry): void;
30
37
  handle(action: Action): void | Action | ICommand;
31
38
  }
@@ -0,0 +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;CAUnD"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.HostExtensionActionHandler = exports.ExtensionActionKind = void 0;
13
+ /********************************************************************************
14
+ * Copyright (c) 2021-2023 EclipseSource and others.
15
+ *
16
+ * This program and the accompanying materials are made available under the
17
+ * terms of the Eclipse Public License v. 2.0 which is available at
18
+ * http://www.eclipse.org/legal/epl-2.0.
19
+ *
20
+ * This Source Code may also be made available under the following Secondary
21
+ * Licenses when the conditions for such availability set forth in the Eclipse
22
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
+ * with the GNU Classpath Exception which is available at
24
+ * https://www.gnu.org/software/classpath/license.html.
25
+ *
26
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
+ ********************************************************************************/
28
+ const client_1 = require("@eclipse-glsp/client");
29
+ const inversify_1 = require("inversify");
30
+ /**
31
+ * Service identifier to define action kinds that should be delegated to the vscode extension (when locally dispatched)
32
+ *
33
+ * Usage:
34
+ * ```ts
35
+ * bind(ExtensionActionKind).toConstantValue(SomeAction.KIND)
36
+ * ```
37
+ */
38
+ exports.ExtensionActionKind = Symbol('ExtensionActionKind');
39
+ /**
40
+ * Delegates actions that should be handled inside of the host extension instead
41
+ * of the webview. This enables the implementation of action handlers that require access
42
+ * to the vscode API.
43
+ */
44
+ let HostExtensionActionHandler = class HostExtensionActionHandler {
45
+ constructor() {
46
+ this.actionKinds = [];
47
+ }
48
+ postConstruct() {
49
+ this.diagramOptions.glspClientProvider().then(glspClient => (this.glspClient = glspClient));
50
+ }
51
+ initialize(registry) {
52
+ this.actionKinds.forEach(kind => registry.register(kind, this));
53
+ }
54
+ handle(action) {
55
+ var _a;
56
+ if (this.actionKinds.includes(action.kind)) {
57
+ const message = {
58
+ clientId: this.diagramOptions.clientId,
59
+ action,
60
+ __localDispatch: true
61
+ };
62
+ (_a = this.glspClient) === null || _a === void 0 ? void 0 : _a.sendActionMessage(message);
63
+ }
64
+ }
65
+ };
66
+ exports.HostExtensionActionHandler = HostExtensionActionHandler;
67
+ __decorate([
68
+ (0, inversify_1.multiInject)(exports.ExtensionActionKind),
69
+ (0, inversify_1.optional)(),
70
+ __metadata("design:type", Array)
71
+ ], HostExtensionActionHandler.prototype, "actionKinds", void 0);
72
+ __decorate([
73
+ (0, inversify_1.inject)(client_1.TYPES.IDiagramOptions),
74
+ __metadata("design:type", Object)
75
+ ], HostExtensionActionHandler.prototype, "diagramOptions", void 0);
76
+ __decorate([
77
+ (0, inversify_1.postConstruct)(),
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", []),
80
+ __metadata("design:returntype", void 0)
81
+ ], HostExtensionActionHandler.prototype, "postConstruct", null);
82
+ exports.HostExtensionActionHandler = HostExtensionActionHandler = __decorate([
83
+ (0, inversify_1.injectable)()
84
+ ], HostExtensionActionHandler);
85
+ //# sourceMappingURL=extension-action-handler.js.map
@@ -0,0 +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;IA0BzC,CAAC;IAlBa,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;gBACN,eAAe,EAAE,IAAI;aACxB,CAAC;YACF,MAAA,IAAI,CAAC,UAAU,0CAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;SAC/C;IACL,CAAC;CACJ,CAAA;AA7BY,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,CA6BtC"}
@@ -0,0 +1,40 @@
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, GLSPModelSource } from '@eclipse-glsp/client';
17
+ /**
18
+ * A helper interface that allows the webview to mark actions that have been received directly from the vscode extension
19
+ * (i.e. they are not forwarded to the GLSP Server).
20
+ */
21
+ export interface ExtensionAction extends Action {
22
+ __localDispatch: true;
23
+ }
24
+ export declare namespace ExtensionAction {
25
+ function is(object: unknown): object is ExtensionAction;
26
+ /**
27
+ * Mark the given action as {@link ServerAction} by attaching the "_receivedFromServer" property
28
+ * @param action The action that should be marked as server action
29
+ */
30
+ function mark(action: Action): void;
31
+ }
32
+ /**
33
+ * Customization of the default {@link GLSPModelSource} for the vscode integration.
34
+ * Also takes locally dispatched actions (i.e. actions that are originating from or intended for the host extension) into consideration.
35
+ */
36
+ export declare class VsCodeGLSPModelSource extends GLSPModelSource {
37
+ protected messageReceived(message: ActionMessage): void;
38
+ protected checkMessageOrigin(message: ActionMessage): void;
39
+ }
40
+ //# sourceMappingURL=vscode-glsp-modelsource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vscode-glsp-modelsource.d.ts","sourceRoot":"","sources":["../../../src/features/default/vscode-glsp-modelsource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,eAAe,EAAgB,MAAM,sBAAsB,CAAC;AAG5F;;;GAGG;AACH,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC3C,eAAe,EAAE,IAAI,CAAC;CACzB;AAED,yBAAiB,eAAe,CAAC;IAC7B,SAAgB,EAAE,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,eAAe,CAE7D;IAED;;;OAGG;IACH,SAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEzC;CACJ;AAED;;;GAGG;AACH,qBACa,qBAAsB,SAAQ,eAAe;cACnC,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAUhE,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAM7D"}