@eclipse-glsp/vscode-integration-webview 0.9.0-next.ecc539e1 → 0.10.0-next.4484750.44

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 CHANGED
@@ -3,13 +3,14 @@
3
3
  This package helps you to implement a [VS Code Webview](https://code.visualstudio.com/api/extension-guides/webview) that renders a [GLSP](https://www.eclipse.org/glsp/) diagram.
4
4
  Since GLSP is based on sprotty(https://github.com/eclipse/sprotty) this glue code is built on top of [sprotty-vscode-webview](https://www.npmjs.com/package/sprotty-vscode-webview).
5
5
 
6
- ### Where to find the sources?
6
+ ## Where to find the sources?
7
7
 
8
8
  In addition to this repository, the related source code can be found here:
9
9
 
10
- - https://github.com/eclipse-glsp/glsp-server
11
- - https://github.com/eclipse-glsp/glsp-client
10
+ - <https://github.com/eclipse-glsp/glsp-server>
11
+ - <https://github.com/eclipse-glsp/glsp-client>
12
12
 
13
13
  ## More information
14
14
 
15
- For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/). If you have questions, contact us on our [spectrum chat](https://spectrum.chat/glsp/) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).
15
+ For more information, please visit the [Eclipse GLSP Umbrella repository](https://github.com/eclipse-glsp/glsp) and the [Eclipse GLSP Website](https://www.eclipse.org/glsp/).
16
+ If you have questions, please raise them in the [discussions](https://github.com/eclipse-glsp/glsp/discussions) and have a look at our [communication and support options](https://www.eclipse.org/glsp/contact/).
package/css/diagram.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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
@@ -52,10 +52,51 @@ body {
52
52
  stroke: var(--vscode-editor-foreground);
53
53
  }
54
54
 
55
- .sprotty-edge.arrow {
55
+ .sprotty-edge .arrow {
56
56
  fill: var(--vscode-editor-foreground);
57
57
  }
58
58
 
59
- .sprotty-node.selected {
60
- stroke: var(--vscode-menu-selectionBackground);
59
+ .sprotty-node.selected,
60
+ .sprotty-edge.selected {
61
+ stroke: var(--vscode-focusBorder);
62
+ }
63
+
64
+ .sprotty-edge.selected .arrow {
65
+ fill: var(--vscode-focusBorder);
66
+ stroke: var(--vscode-focusBorder);
67
+ }
68
+
69
+ .inactive .sprotty-node.selected {
70
+ stroke: var(--vscode-editor-inactiveSelectionBackground);
71
+ }
72
+
73
+ .sprotty-resize-handle.selected,
74
+ .sprotty-resize-handle.active,
75
+ .sprotty-edge > .sprotty-routing-handle.selected,
76
+ .sprotty-edge > .sprotty-routing-handle.mouseover {
77
+ fill: var(--vscode-focusBorder);
78
+ }
79
+
80
+ .inactive .sprotty-resize-handle,
81
+ .inactive .sprotty-routing-handle {
82
+ fill: var(--vscode-tab-unfocusedInactiveForeground);
83
+ }
84
+
85
+ .sprotty-node.mouseover:not(.selected),
86
+ .sprotty-edge.mouseover:not(.selected) {
87
+ stroke: var(--vscode-editor-foreground);
88
+ }
89
+
90
+ .sprotty-edge.mouseover:not(.selected) .arrow {
91
+ fill: var(--vscode-editor-foreground);
92
+ stroke: var(--vscode-editor-foreground);
93
+ }
94
+
95
+ .sprotty-popup {
96
+ padding: 0px;
97
+ border-radius: 2px;
98
+ box-shadow: 0px 1px 6px var(--vscode-widget-shadow);
99
+ background-color: var(--vscode-editorHoverWidget-background);
100
+ color: var(--vscode-editorHoverWidget-foreground);
101
+ border: 1px solid var(--vscode-editorHoverWidget-border);
61
102
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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
@@ -18,8 +18,16 @@
18
18
  box-shadow: 0px 1px 6px var(--vscode-widget-shadow);
19
19
  }
20
20
 
21
+ .tool-palette :focus-visible {
22
+ outline: none;
23
+ }
24
+
25
+ .tool-group {
26
+ background: var(--vscode-settings-dropdownBackground);
27
+ }
28
+
21
29
  .tool-palette .palette-header {
22
- background: var(--vscode-titleBar-activeBackground);
30
+ background: var(--vscode-settings-dropdownBackground);
23
31
  color: var(--vscode-titleBar-activeForeground);
24
32
  border: 0;
25
33
  font-weight: normal;
@@ -31,20 +39,23 @@
31
39
  }
32
40
 
33
41
  .tool-palette .palette-header .header-icon {
34
- font-size: var(--vscode-ui-font-size1);
35
42
  float: left;
36
43
  padding: 0.2em;
44
+ font-size: 11px;
45
+ text-transform: uppercase;
46
+ font-weight: 400;
37
47
  }
38
48
 
39
49
  .tool-palette .palette-header .header-tools {
40
- font-size: var(--vscode-ui-font-size3);
41
50
  float: right;
51
+ font-size: 11px;
42
52
  }
43
53
 
44
54
  .tool-palette .palette-header .header-tools i {
45
55
  border: none;
46
56
  width: 1em;
47
57
  text-align: center;
58
+ border-radius: 5px;
48
59
  }
49
60
 
50
61
  .tool-palette .palette-header .header-tools i:hover:not(.clicked) {
@@ -58,35 +69,34 @@
58
69
  .tool-palette .palette-body {
59
70
  border: 0;
60
71
  box-shadow: none;
72
+ background: var(--vscode-list-focusBackground);
73
+ color: var(--vscode-titleBar-activeForeground);
61
74
  }
62
75
 
63
76
  .tool-palette .palette-body .group-header {
64
77
  font-size: var(--vscode-ui-font-size1);
65
- font-weight: normal;
66
- background: var(--vscode-settings-dropdownBackground);
78
+ text-transform: uppercase;
79
+ font-weight: bold;
80
+ background: var(--vscode-editorHoverWidget-statusBarBackground);
67
81
  color: var(--vscode-titleBar-activeForeground);
68
82
  border: 0;
69
83
  }
70
84
 
71
- .tool-palette .palette-body .tool-button {
72
- background: var(--vscode-menu-background);
85
+ .tool-button {
86
+ background: var(--vscode-settings-dropdownBackground);
73
87
  color: var(--vscode-titleBar-activeForeground);
74
88
  }
75
89
 
76
90
  .tool-palette .palette-body .tool-button:hover:not(.clicked) {
77
- background: var(--vscode-list-hoverBackground);
91
+ background: var(--vscode-menubar-selectionBackground);
78
92
  }
79
93
 
80
94
  .tool-palette .tool-button.clicked {
81
- background: var(--vscode-menu-selectionBackground);
82
- color: var(--vscode-menu-selectionForeground);
95
+ background: var(--vscode-inputOption-activeBackground);
83
96
  }
84
97
 
85
98
  .search-input {
86
99
  background: var(--vscode-input-background);
87
100
  color: var(--vscode-input-foreground);
88
101
  border: var(--vscode-border-width) solid var(--vscode-input-border);
89
- font-family: var(--vscode-ui-font-family);
90
- font-size: var(--vscode-ui-font-size1);
91
- line-height: var(--vscode-content-line-height);
92
102
  }
@@ -0,0 +1,23 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 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 { ICopyPasteHandler } from '@eclipse-glsp/client/lib/features/copy-paste/copy-paste-handler';
17
+ export declare const CopyPasteHandlerProvider: unique symbol;
18
+ /**
19
+ * Service identifier and type definition to bind the {@link ICopyPasteHandler} to an provider.
20
+ * This enables asynchronous injections and can be used to bypass circular dependency issues.
21
+ */
22
+ export declare type CopyPasteHandlerProvider = () => Promise<ICopyPasteHandler>;
23
+ //# sourceMappingURL=copy-paste-handler-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-paste-handler-provider.d.ts","sourceRoot":"","sources":["../src/copy-paste-handler-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iEAAiE,CAAC;AAEpG,eAAO,MAAM,wBAAwB,eAAqC,CAAC;AAC3E;;;GAGG;AACH,oBAAY,wBAAwB,GAAG,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2022 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.CopyPasteHandlerProvider = void 0;
19
+ exports.CopyPasteHandlerProvider = Symbol('CopyPasteHandlerProvider');
20
+ //# sourceMappingURL=copy-paste-handler-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy-paste-handler-provider.js","sourceRoot":"","sources":["../src/copy-paste-handler-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAIrE,QAAA,wBAAwB,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021 EclipseSource and others.
2
+ * Copyright (c) 2021-2022 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
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-identifer.d.ts","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAGxD,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,qBAAqB,CAQhF"}
1
+ {"version":3,"file":"diagram-identifer.d.ts","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAiB,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAEvE,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,qBAAqB,CAQhF"}
@@ -1,14 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isDiagramIdentifier = exports.GLSPDiagramIdentifier = void 0;
4
- const protocol_1 = require("@eclipse-glsp/protocol");
4
+ /********************************************************************************
5
+ * Copyright (c) 2021-2022 EclipseSource and others.
6
+ *
7
+ * This program and the accompanying materials are made available under the
8
+ * terms of the Eclipse Public License v. 2.0 which is available at
9
+ * http://www.eclipse.org/legal/epl-2.0.
10
+ *
11
+ * This Source Code may also be made available under the following Secondary
12
+ * Licenses when the conditions for such availability set forth in the Eclipse
13
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
14
+ * with the GNU Classpath Exception which is available at
15
+ * https://www.gnu.org/software/classpath/license.html.
16
+ *
17
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
18
+ ********************************************************************************/
19
+ const client_1 = require("@eclipse-glsp/client");
5
20
  exports.GLSPDiagramIdentifier = Symbol('GLSPDiagramIdentifier');
6
21
  function isDiagramIdentifier(object) {
7
22
  return (object !== undefined &&
8
23
  typeof object === 'object' &&
9
- (0, protocol_1.isString)(object, 'clientId') &&
10
- (0, protocol_1.isString)(object, 'diagramType') &&
11
- (0, protocol_1.isString)(object, 'uri'));
24
+ (0, client_1.hasStringProp)(object, 'clientId') &&
25
+ (0, client_1.hasStringProp)(object, 'diagramType') &&
26
+ (0, client_1.hasStringProp)(object, 'uri'));
12
27
  }
13
28
  exports.isDiagramIdentifier = isDiagramIdentifier;
14
29
  //# sourceMappingURL=diagram-identifer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-identifer.js","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":";;;AAgBA,qDAAkD;AAErC,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AASrE,SAAgB,mBAAmB,CAAC,MAAW;IAC3C,OAAO,CACH,MAAM,KAAK,SAAS;QACpB,OAAO,MAAM,KAAK,QAAQ;QAC1B,IAAA,mBAAQ,EAAC,MAAM,EAAE,UAAU,CAAC;QAC5B,IAAA,mBAAQ,EAAC,MAAM,EAAE,aAAa,CAAC;QAC/B,IAAA,mBAAQ,EAAC,MAAM,EAAE,KAAK,CAAC,CAC1B,CAAC;AACN,CAAC;AARD,kDAQC"}
1
+ {"version":3,"file":"diagram-identifer.js","sourceRoot":"","sources":["../src/diagram-identifer.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAAuE;AAE1D,QAAA,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AASrE,SAAgB,mBAAmB,CAAC,MAAW;IAC3C,OAAO,CACH,MAAM,KAAK,SAAS;QACpB,OAAO,MAAM,KAAK,QAAQ;QAC1B,IAAA,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;AARD,kDAQC"}
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021 EclipseSource and others.
2
+ * Copyright (c) 2021-2022 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,7 +13,7 @@
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 'sprotty';
16
+ import { Action, ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer, ICommand } from '@eclipse-glsp/client';
17
17
  import { SprottyDiagramIdentifier } from 'sprotty-vscode-webview';
18
18
  /**
19
19
  * Delegates actions that should be handled inside of the glsp vscode extension instead
@@ -1 +1 @@
1
- {"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7G,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc,EAAE,yBAAyB;IAClF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB;gBAArF,WAAW,EAAE,MAAM,EAAE,EAAqB,iBAAiB,EAAE,wBAAwB;IAEpH,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;CAUnD"}
1
+ {"version":3,"file":"extension-action-handler.d.ts","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1H,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAGlE;;;;GAIG;AACH,qBAAa,gCAAiC,YAAW,cAAc,EAAE,yBAAyB;IAClF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE;IAAE,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,wBAAwB;gBAArF,WAAW,EAAE,MAAM,EAAE,EAAqB,iBAAiB,EAAE,wBAAwB;IAEpH,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAIjD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;CAUnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-starter.d.ts","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACH,wBAAwB,EACxB,cAAc,EAIjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qBAAqB,EAAuB,MAAM,qBAAqB,CAAC;AAKjF,8BAAsB,WAAY,SAAQ,cAAc;IACpD,SAAS,CAAC,uBAAuB,IAAI,IAAI;IA2BzC,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,GAAG,IAAI;IAgBjG,SAAS,CAAC,+BAA+B,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,IAAI;IAMlH;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,MAAM,EAAE,CAQ7C;CACJ"}
1
+ {"version":3,"file":"glsp-starter.d.ts","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACH,wBAAwB,EACxB,cAAc,EAIjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAuB,MAAM,qBAAqB,CAAC;AAKjF,8BAAsB,WAAY,SAAQ,cAAc;cACjC,uBAAuB,IAAI,IAAI;cA2B/B,iBAAiB,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,qBAAqB,GAAG,IAAI;IAsB1G,SAAS,CAAC,+BAA+B,CAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,EAAE,wBAAwB,GAAG,IAAI;IAMlH;;OAEG;IACH,SAAS,KAAK,oBAAoB,IAAI,MAAM,EAAE,CAQ7C;CACJ"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GLSPStarter = void 0;
4
4
  /********************************************************************************
5
- * Copyright (c) 2020-2021 EclipseSource and others.
5
+ * Copyright (c) 2020-2022 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
@@ -18,6 +18,7 @@ exports.GLSPStarter = void 0;
18
18
  ********************************************************************************/
19
19
  const client_1 = require("@eclipse-glsp/client");
20
20
  const sprotty_vscode_webview_1 = require("sprotty-vscode-webview");
21
+ const copy_paste_handler_provider_1 = require("./copy-paste-handler-provider");
21
22
  const diagram_identifer_1 = require("./diagram-identifer");
22
23
  const extension_action_handler_1 = require("./extension-action-handler");
23
24
  const glsp_vscode_diagram_widget_1 = require("./glsp-vscode-diagram-widget");
@@ -57,11 +58,14 @@ class GLSPStarter extends sprotty_vscode_webview_1.SprottyStarter {
57
58
  .bind(sprotty_vscode_webview_1.VscodeDiagramWidgetFactory)
58
59
  .toFactory(context => () => context.container.get(glsp_vscode_diagram_widget_1.GLSPVscodeDiagramWidget));
59
60
  container.bind(diagram_identifer_1.GLSPDiagramIdentifier).toConstantValue(diagramIdentifier);
60
- container.bind(sprotty_vscode_webview_1.SprottyDiagramIdentifier).toConstantValue(diagramIdentifier);
61
+ container
62
+ .bind(copy_paste_handler_provider_1.CopyPasteHandlerProvider)
63
+ .toProvider(ctx => () => new Promise(resolve => resolve(ctx.container.get(client_1.TYPES.ICopyPasteHandler))));
64
+ container.bind(sprotty_vscode_webview_1.SprottyDiagramIdentifier).toService(diagram_identifer_1.GLSPDiagramIdentifier);
61
65
  container.bind(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer).toSelf().inSingletonScope();
62
66
  container.bind(sprotty_vscode_webview_1.VscodeDiagramServer).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
63
67
  container.bind(client_1.TYPES.ModelSource).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
64
- container.bind(client_1.DiagramServer).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
68
+ container.bind(client_1.DiagramServerProxy).toService(glsp_vscode_diagramserver_1.GLSPVscodeDiagramServer);
65
69
  this.configureExtensionActionHandler(container, diagramIdentifier);
66
70
  }
67
71
  configureExtensionActionHandler(container, diagramIdentifier) {
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-starter.js","sourceRoot":"","sources":["../src/glsp-starter.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAS8B;AAE9B,mEAMgC;AAChC,2DAAiF;AACjF,yEAA8E;AAC9E,6EAAuE;AACvE,2EAAsE;AAEtE,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":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,8BACsB,uBAAwB,SAAQ,mBAAmB;IACrE,SAAS,CAAC,iBAAiB,IAAI,IAAI;CActC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
1
+ {"version":3,"file":"glsp-vscode-diagram-widget.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,8BACsB,uBAAwB,SAAQ,mBAAmB;cAClD,iBAAiB,IAAI,IAAI;CAgB/C;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE7C"}
@@ -8,7 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.decodeURI = exports.GLSPVscodeDiagramWidget = void 0;
10
10
  /********************************************************************************
11
- * Copyright (c) 2020-2021 EclipseSource and others.
11
+ * Copyright (c) 2020-2022 EclipseSource and others.
12
12
  *
13
13
  * This program and the accompanying materials are made available under the
14
14
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -27,15 +27,17 @@ const inversify_1 = require("inversify");
27
27
  const sprotty_vscode_webview_1 = require("sprotty-vscode-webview");
28
28
  let GLSPVscodeDiagramWidget = class GLSPVscodeDiagramWidget extends sprotty_vscode_webview_1.VscodeDiagramWidget {
29
29
  initializeSprotty() {
30
- if (this.modelSource instanceof client_1.DiagramServer) {
30
+ if (this.modelSource instanceof client_1.DiagramServerProxy) {
31
31
  this.modelSource.clientId = this.diagramIdentifier.clientId;
32
32
  }
33
- this.actionDispatcher.dispatch(new client_1.RequestModelAction({
34
- sourceUri: decodeURI(this.diagramIdentifier.uri),
35
- diagramType: this.diagramIdentifier.diagramType
33
+ this.actionDispatcher.dispatch(client_1.RequestModelAction.create({
34
+ options: {
35
+ sourceUri: decodeURI(this.diagramIdentifier.uri),
36
+ diagramType: this.diagramIdentifier.diagramType
37
+ }
36
38
  }));
37
- this.actionDispatcher.dispatch(new client_1.RequestTypeHintsAction(this.diagramIdentifier.diagramType));
38
- this.actionDispatcher.dispatch(new client_1.EnableToolPaletteAction());
39
+ this.actionDispatcher.dispatch(client_1.RequestTypeHintsAction.create());
40
+ this.actionDispatcher.dispatch(client_1.EnableToolPaletteAction.create());
39
41
  }
40
42
  };
41
43
  GLSPVscodeDiagramWidget = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-vscode-diagram-widget.js","sourceRoot":"","sources":["../src/glsp-vscode-diagram-widget.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA0H;AAC1H,yCAAuC;AACvC,mEAA6D;AAG7D,IAAsB,uBAAuB,GAA7C,MAAsB,uBAAwB,SAAQ,4CAAmB;IAC3D,iBAAiB;QACvB,IAAI,IAAI,CAAC,WAAW,YAAY,sBAAa,EAAE;YAC3C,IAAI,CAAC,WAAW,CAAC,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC;SAC/D;QACD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAC1B,IAAI,2BAAkB,CAAC;YACnB,SAAS,EAAE,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC;YAChD,WAAW,EAAE,IAAI,CAAC,iBAAiB,CAAC,WAAW;SAClD,CAAC,CACL,CAAC;QAEF,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,+BAAsB,CAAC,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;QAC/F,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,gCAAuB,EAAE,CAAC,CAAC;IAClE,CAAC;CACJ,CAAA;AAfqB,uBAAuB;IAD5C,IAAA,sBAAU,GAAE;GACS,uBAAuB,CAe5C;A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@@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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,14 +13,15 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { Action, ActionHandlerRegistry, ActionMessage, ComputedBoundsAction, DeleteElementOperation, ICopyPasteHandler, SetEditModeAction } from '@eclipse-glsp/client';
16
+ import { Action, ActionHandlerRegistry, ActionMessage, ComputedBoundsAction, DeleteElementOperation, SetEditModeAction } from '@eclipse-glsp/client';
17
17
  import { SelectionService } from '@eclipse-glsp/client/lib/features/select/selection-service';
18
- import { VscodeDiagramServer } from 'sprotty-vscode-webview';
18
+ import { VscodeDiagramServer } from 'sprotty-vscode-webview/lib/vscode-diagram-server';
19
+ import { CopyPasteHandlerProvider } from './copy-paste-handler-provider';
19
20
  export declare const receivedFromServerProperty = "__receivedFromServer";
20
21
  export declare const localDispatchProperty = "__localDispatch";
21
22
  export declare class GLSPVscodeDiagramServer extends VscodeDiagramServer {
22
23
  protected selectionService: SelectionService;
23
- protected copyPasteHandler: ICopyPasteHandler;
24
+ protected copyPasteHandlerProvider: CopyPasteHandlerProvider;
24
25
  initialize(registry: ActionHandlerRegistry): void;
25
26
  handleLocally(action: Action): boolean;
26
27
  protected messageReceived(data: any): void;
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-vscode-diagramserver.d.ts","sourceRoot":"","sources":["../src/glsp-vscode-diagramserver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACpB,sBAAsB,EAEtB,iBAAiB,EAIjB,iBAAiB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE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AAwB,SAAQ,mBAAmB;IAE5D,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAG7C,SAAS,CAAC,wBAAwB,EAAE,wBAAwB,CAAC;IAEpD,UAAU,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAyBjD,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;cAU5B,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAenD,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;cAOvC,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO;IAI9E,SAAS,CAAC,4BAA4B,CAAC,SAAS,EAAE,sBAAsB,GAAG,OAAO;IAOlF,SAAS,CAAC,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO;CAGxE"}
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GLSPVscodeDiagramServer = exports.localDispatchProperty = exports.receivedFromServerProperty = void 0;
13
13
  /********************************************************************************
14
- * Copyright (c) 2020-2021 EclipseSource and others.
14
+ * Copyright (c) 2020-2022 EclipseSource and others.
15
15
  *
16
16
  * This program and the accompanying materials are made available under the
17
17
  * terms of the Eclipse Public License v. 2.0 which is available at
@@ -28,40 +28,43 @@ exports.GLSPVscodeDiagramServer = exports.localDispatchProperty = exports.receiv
28
28
  const client_1 = require("@eclipse-glsp/client");
29
29
  const selection_service_1 = require("@eclipse-glsp/client/lib/features/select/selection-service");
30
30
  const inversify_1 = require("inversify");
31
- const sprotty_vscode_webview_1 = require("sprotty-vscode-webview");
31
+ const vscode_diagram_server_1 = require("sprotty-vscode-webview/lib/vscode-diagram-server");
32
+ const copy_paste_handler_provider_1 = require("./copy-paste-handler-provider");
32
33
  exports.receivedFromServerProperty = '__receivedFromServer';
33
34
  exports.localDispatchProperty = '__localDispatch';
34
- class GLSPVscodeDiagramServer extends sprotty_vscode_webview_1.VscodeDiagramServer {
35
+ class GLSPVscodeDiagramServer extends vscode_diagram_server_1.VscodeDiagramServer {
35
36
  initialize(registry) {
36
37
  (0, client_1.registerDefaultGLSPServerActions)(registry, this);
37
38
  this.clientId = this.viewerOptions.baseDiv;
38
39
  window.addEventListener('message', message => {
39
- if ('data' in message && (0, sprotty_vscode_webview_1.isActionMessage)(message.data)) {
40
+ if ('data' in message && client_1.ActionMessage.is(message.data)) {
40
41
  this.messageReceived(message.data);
41
42
  }
42
43
  });
43
- window.addEventListener('copy', (e) => {
44
- this.copyPasteHandler.handleCopy(e);
45
- });
46
- window.addEventListener('cut', (e) => {
47
- this.copyPasteHandler.handleCut(e);
48
- });
49
- window.addEventListener('paste', (e) => {
50
- this.copyPasteHandler.handlePaste(e);
44
+ this.copyPasteHandlerProvider().then(copyPasteHandler => {
45
+ document.addEventListener('copy', (e) => {
46
+ copyPasteHandler.handleCopy(e);
47
+ });
48
+ document.addEventListener('cut', (e) => {
49
+ copyPasteHandler.handleCut(e);
50
+ });
51
+ document.addEventListener('paste', (e) => {
52
+ copyPasteHandler.handlePaste(e);
53
+ });
51
54
  });
52
55
  }
53
56
  handleLocally(action) {
54
- if ((0, client_1.isSetEditModeAction)(action)) {
57
+ if (client_1.SetEditModeAction.is(action)) {
55
58
  return this.handleSetEditModeAction(action);
56
59
  }
57
- if ((0, client_1.isDeleteElementOperation)(action)) {
60
+ if (client_1.DeleteElementOperation.is(action)) {
58
61
  return this.handleDeleteElementOperation(action);
59
62
  }
60
63
  return super.handleLocally(action);
61
64
  }
62
65
  messageReceived(data) {
63
66
  const object = typeof data === 'string' ? JSON.parse(data) : data;
64
- if ((0, sprotty_vscode_webview_1.isActionMessage)(object) && object.action) {
67
+ if (client_1.ActionMessage.is(object) && object.action) {
65
68
  if (!object.clientId || object.clientId === this.clientId) {
66
69
  this.checkMessageOrigin(object);
67
70
  this.logger.log(this, 'receiving', object);
@@ -94,12 +97,12 @@ class GLSPVscodeDiagramServer extends sprotty_vscode_webview_1.VscodeDiagramServ
94
97
  }
95
98
  }
96
99
  __decorate([
97
- (0, inversify_1.inject)(client_1.GLSP_TYPES.SelectionService),
100
+ (0, inversify_1.inject)(client_1.TYPES.SelectionService),
98
101
  __metadata("design:type", selection_service_1.SelectionService)
99
102
  ], GLSPVscodeDiagramServer.prototype, "selectionService", void 0);
100
103
  __decorate([
101
- (0, inversify_1.inject)(client_1.GLSP_TYPES.ICopyPasteHandler),
102
- __metadata("design:type", Object)
103
- ], GLSPVscodeDiagramServer.prototype, "copyPasteHandler", void 0);
104
+ (0, inversify_1.inject)(copy_paste_handler_provider_1.CopyPasteHandlerProvider),
105
+ __metadata("design:type", Function)
106
+ ], GLSPVscodeDiagramServer.prototype, "copyPasteHandlerProvider", void 0);
104
107
  exports.GLSPVscodeDiagramServer = GLSPVscodeDiagramServer;
105
108
  //# sourceMappingURL=glsp-vscode-diagramserver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-vscode-diagramserver.js","sourceRoot":"","sources":["../src/glsp-vscode-diagramserver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAY8B;AAC9B,kGAA8F;AAC9F,yCAAmC;AACnC,mEAA8E;AAEjE,QAAA,0BAA0B,GAAG,sBAAsB,CAAC;AACpD,QAAA,qBAAqB,GAAG,iBAAiB,CAAC;AAEvD,MAAa,uBAAwB,SAAQ,4CAAmB;IAI5D,UAAU,CAAC,QAA+B;QACtC,IAAA,yCAAgC,EAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC;QAC3C,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE;YACzC,IAAI,MAAM,IAAI,OAAO,IAAI,IAAA,wCAAe,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACpD,IAAI,CAAC,eAAe,CAA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MAAc,CAAC,kCAA0B,CAAC,GAAG,IAAI,CAAC;SAC9D;IACL,CAAC;IAEkB,oBAAoB,CAAC,MAA4B;QAChE,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,4BAA4B,CAAC,SAAiC;QACpE,IAAI,SAAS,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;YACnC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,CAAC,CAAC;SAC/E;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAES,uBAAuB,CAAC,MAAyB;QACvD,OAAQ,MAAc,CAAC,kCAA0B,CAAC,KAAK,IAAI,CAAC;IAChE,CAAC;CACJ;AA5EG;IADC,IAAA,kBAAM,EAAC,cAAK,CAAC,gBAAgB,CAAC;8BACH,oCAAgB;iEAAC;AAG7C;IADC,IAAA,kBAAM,EAAC,sDAAwB,CAAC;;yEAC4B;AALjE,0DA8EC"}
package/lib/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[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);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA+B;AAC/B,8DAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,iDAA+B;AAC/B,8DAA4C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp/vscode-integration-webview",
3
- "version": "0.9.0-next.ecc539e1",
3
+ "version": "0.10.0-next.4484750.44+4484750",
4
4
  "description": "Integration of a GLSP diagram in a VS Code extensions (WebView part)",
5
5
  "license": "(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)",
6
6
  "keywords": [
@@ -33,16 +33,14 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@eclipse-glsp/client": "next",
36
- "sprotty-vscode-webview": "0.1.2"
36
+ "sprotty-vscode-webview": "0.2.0"
37
37
  },
38
38
  "devDependencies": {
39
- "reflect-metadata": "^0.1.13",
40
- "rimraf": "latest",
41
- "typescript": "^4.4.3"
39
+ "reflect-metadata": "^0.1.13"
42
40
  },
43
41
  "scripts": {
44
42
  "prepare": "yarn clean && yarn build && yarn lint",
45
- "clean": "rimraf lib",
43
+ "clean": "rimraf lib tsconfig.tsbuildinfo",
46
44
  "build": "tsc",
47
45
  "watch": "tsc -w",
48
46
  "lint": "eslint -c ./.eslintrc.js --ext .ts ./src"
@@ -51,5 +49,6 @@
51
49
  "access": "public"
52
50
  },
53
51
  "main": "lib/index",
54
- "types": "lib/index"
52
+ "types": "lib/index",
53
+ "gitHead": "4484750c642ccfb0143da69b868237771b1764c6"
55
54
  }
@@ -0,0 +1,24 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2022 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
+
17
+ import { ICopyPasteHandler } from '@eclipse-glsp/client/lib/features/copy-paste/copy-paste-handler';
18
+
19
+ export const CopyPasteHandlerProvider = Symbol('CopyPasteHandlerProvider');
20
+ /**
21
+ * Service identifier and type definition to bind the {@link ICopyPasteHandler} to an provider.
22
+ * This enables asynchronous injections and can be used to bypass circular dependency issues.
23
+ */
24
+ export type CopyPasteHandlerProvider = () => Promise<ICopyPasteHandler>;
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021 EclipseSource and others.
2
+ * Copyright (c) 2021-2022 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,8 +13,7 @@
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
- import { isString } from '@eclipse-glsp/protocol';
16
+ import { hasStringProp, InitializeResult } from '@eclipse-glsp/client';
18
17
 
19
18
  export const GLSPDiagramIdentifier = Symbol('GLSPDiagramIdentifier');
20
19
 
@@ -29,8 +28,8 @@ export function isDiagramIdentifier(object: any): object is GLSPDiagramIdentifie
29
28
  return (
30
29
  object !== undefined &&
31
30
  typeof object === 'object' &&
32
- isString(object, 'clientId') &&
33
- isString(object, 'diagramType') &&
34
- isString(object, 'uri')
31
+ hasStringProp(object, 'clientId') &&
32
+ hasStringProp(object, 'diagramType') &&
33
+ hasStringProp(object, 'uri')
35
34
  );
36
35
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2021 EclipseSource and others.
2
+ * Copyright (c) 2021-2022 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,7 +13,7 @@
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 'sprotty';
16
+ import { Action, ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer, ICommand } from '@eclipse-glsp/client';
17
17
  import { SprottyDiagramIdentifier } from 'sprotty-vscode-webview';
18
18
  import { vscodeApi } from 'sprotty-vscode-webview/lib/vscode-api';
19
19
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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
@@ -15,8 +15,9 @@
15
15
  ********************************************************************************/
16
16
  import {
17
17
  configureServerActions,
18
- DiagramServer,
18
+ DiagramServerProxy,
19
19
  ExportSvgAction,
20
+ ICopyPasteHandler,
20
21
  NavigateToExternalTargetAction,
21
22
  RequestClipboardDataAction,
22
23
  SelectAction,
@@ -31,13 +32,14 @@ import {
31
32
  VscodeDiagramWidget,
32
33
  VscodeDiagramWidgetFactory
33
34
  } from 'sprotty-vscode-webview';
35
+ import { CopyPasteHandlerProvider } from './copy-paste-handler-provider';
34
36
  import { GLSPDiagramIdentifier, isDiagramIdentifier } from './diagram-identifer';
35
37
  import { GLSPVscodeExtensionActionHandler } from './extension-action-handler';
36
38
  import { GLSPVscodeDiagramWidget } from './glsp-vscode-diagram-widget';
37
39
  import { GLSPVscodeDiagramServer } from './glsp-vscode-diagramserver';
38
40
 
39
41
  export abstract class GLSPStarter extends SprottyStarter {
40
- protected acceptDiagramIdentifier(): void {
42
+ protected override acceptDiagramIdentifier(): void {
41
43
  console.log('Waiting for diagram identifier...');
42
44
  const eventListener = (message: any): void => {
43
45
  if (isDiagramIdentifier(message.data)) {
@@ -64,18 +66,24 @@ export abstract class GLSPStarter extends SprottyStarter {
64
66
  window.addEventListener('message', eventListener);
65
67
  }
66
68
 
67
- protected addVscodeBindings(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void {
69
+ protected override addVscodeBindings(container: Container, diagramIdentifier: GLSPDiagramIdentifier): void {
68
70
  container.bind(GLSPVscodeDiagramWidget).toSelf().inSingletonScope();
69
71
  container.bind(VscodeDiagramWidget).toService(GLSPVscodeDiagramWidget);
70
72
  container
71
73
  .bind(VscodeDiagramWidgetFactory)
72
74
  .toFactory(context => () => context.container.get<GLSPVscodeDiagramWidget>(GLSPVscodeDiagramWidget));
73
75
  container.bind(GLSPDiagramIdentifier).toConstantValue(diagramIdentifier);
74
- container.bind(SprottyDiagramIdentifier).toConstantValue(diagramIdentifier);
76
+ container
77
+ .bind(CopyPasteHandlerProvider)
78
+ .toProvider(
79
+ ctx => () =>
80
+ new Promise<ICopyPasteHandler>(resolve => resolve(ctx.container.get<ICopyPasteHandler>(TYPES.ICopyPasteHandler)))
81
+ );
82
+ container.bind(SprottyDiagramIdentifier).toService(GLSPDiagramIdentifier);
75
83
  container.bind(GLSPVscodeDiagramServer).toSelf().inSingletonScope();
76
84
  container.bind(VscodeDiagramServer).toService(GLSPVscodeDiagramServer);
77
85
  container.bind(TYPES.ModelSource).toService(GLSPVscodeDiagramServer);
78
- container.bind(DiagramServer).toService(GLSPVscodeDiagramServer);
86
+ container.bind(DiagramServerProxy).toService(GLSPVscodeDiagramServer);
79
87
 
80
88
  this.configureExtensionActionHandler(container, diagramIdentifier);
81
89
  }
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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,25 +13,27 @@
13
13
  *
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
  ********************************************************************************/
16
- import { DiagramServer, EnableToolPaletteAction, RequestModelAction, RequestTypeHintsAction } from '@eclipse-glsp/client';
16
+ import { DiagramServerProxy, EnableToolPaletteAction, RequestModelAction, RequestTypeHintsAction } from '@eclipse-glsp/client';
17
17
  import { injectable } from 'inversify';
18
18
  import { VscodeDiagramWidget } from 'sprotty-vscode-webview';
19
19
 
20
20
  @injectable()
21
21
  export abstract class GLSPVscodeDiagramWidget extends VscodeDiagramWidget {
22
- protected initializeSprotty(): void {
23
- if (this.modelSource instanceof DiagramServer) {
22
+ protected override initializeSprotty(): void {
23
+ if (this.modelSource instanceof DiagramServerProxy) {
24
24
  this.modelSource.clientId = this.diagramIdentifier.clientId;
25
25
  }
26
26
  this.actionDispatcher.dispatch(
27
- new RequestModelAction({
28
- sourceUri: decodeURI(this.diagramIdentifier.uri),
29
- diagramType: this.diagramIdentifier.diagramType
27
+ RequestModelAction.create({
28
+ options: {
29
+ sourceUri: decodeURI(this.diagramIdentifier.uri),
30
+ diagramType: this.diagramIdentifier.diagramType
31
+ }
30
32
  })
31
33
  );
32
34
 
33
- this.actionDispatcher.dispatch(new RequestTypeHintsAction(this.diagramIdentifier.diagramType));
34
- this.actionDispatcher.dispatch(new EnableToolPaletteAction());
35
+ this.actionDispatcher.dispatch(RequestTypeHintsAction.create());
36
+ this.actionDispatcher.dispatch(EnableToolPaletteAction.create());
35
37
  }
36
38
  }
37
39
 
@@ -1,5 +1,5 @@
1
1
  /********************************************************************************
2
- * Copyright (c) 2020-2021 EclipseSource and others.
2
+ * Copyright (c) 2020-2022 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
@@ -19,59 +19,62 @@ import {
19
19
  ActionMessage,
20
20
  ComputedBoundsAction,
21
21
  DeleteElementOperation,
22
- GLSP_TYPES,
23
- ICopyPasteHandler,
24
- isDeleteElementOperation,
25
- isSetEditModeAction,
26
22
  registerDefaultGLSPServerActions,
27
- SetEditModeAction
23
+ SetEditModeAction,
24
+ TYPES
28
25
  } from '@eclipse-glsp/client';
29
26
  import { SelectionService } from '@eclipse-glsp/client/lib/features/select/selection-service';
30
27
  import { inject } from 'inversify';
31
- import { isActionMessage, VscodeDiagramServer } from 'sprotty-vscode-webview';
32
-
28
+ import { VscodeDiagramServer } from 'sprotty-vscode-webview/lib/vscode-diagram-server';
29
+ import { CopyPasteHandlerProvider } from './copy-paste-handler-provider';
33
30
  export const receivedFromServerProperty = '__receivedFromServer';
34
31
  export const localDispatchProperty = '__localDispatch';
35
32
 
36
33
  export class GLSPVscodeDiagramServer extends VscodeDiagramServer {
37
- @inject(GLSP_TYPES.SelectionService) protected selectionService: SelectionService;
38
- @inject(GLSP_TYPES.ICopyPasteHandler) protected copyPasteHandler: ICopyPasteHandler;
34
+ @inject(TYPES.SelectionService)
35
+ protected selectionService: SelectionService;
36
+
37
+ @inject(CopyPasteHandlerProvider)
38
+ protected copyPasteHandlerProvider: CopyPasteHandlerProvider;
39
39
 
40
- initialize(registry: ActionHandlerRegistry): void {
40
+ override initialize(registry: ActionHandlerRegistry): void {
41
41
  registerDefaultGLSPServerActions(registry, this);
42
42
  this.clientId = this.viewerOptions.baseDiv;
43
+
43
44
  window.addEventListener('message', message => {
44
- if ('data' in message && isActionMessage(message.data)) {
45
+ if ('data' in message && ActionMessage.is(message.data)) {
45
46
  this.messageReceived(message.data);
46
47
  }
47
48
  });
48
49
 
49
- window.addEventListener('copy', (e: ClipboardEvent) => {
50
- this.copyPasteHandler.handleCopy(e);
51
- });
50
+ this.copyPasteHandlerProvider().then(copyPasteHandler => {
51
+ document.addEventListener('copy', (e: ClipboardEvent) => {
52
+ copyPasteHandler.handleCopy(e);
53
+ });
52
54
 
53
- window.addEventListener('cut', (e: ClipboardEvent) => {
54
- this.copyPasteHandler.handleCut(e);
55
- });
55
+ document.addEventListener('cut', (e: ClipboardEvent) => {
56
+ copyPasteHandler.handleCut(e);
57
+ });
56
58
 
57
- window.addEventListener('paste', (e: ClipboardEvent) => {
58
- this.copyPasteHandler.handlePaste(e);
59
+ document.addEventListener('paste', (e: ClipboardEvent) => {
60
+ copyPasteHandler.handlePaste(e);
61
+ });
59
62
  });
60
63
  }
61
64
 
62
- handleLocally(action: Action): boolean {
63
- if (isSetEditModeAction(action)) {
65
+ override handleLocally(action: Action): boolean {
66
+ if (SetEditModeAction.is(action)) {
64
67
  return this.handleSetEditModeAction(action);
65
68
  }
66
- if (isDeleteElementOperation(action)) {
69
+ if (DeleteElementOperation.is(action)) {
67
70
  return this.handleDeleteElementOperation(action);
68
71
  }
69
72
  return super.handleLocally(action);
70
73
  }
71
74
 
72
- protected messageReceived(data: any): void {
75
+ protected override messageReceived(data: any): void {
73
76
  const object = typeof data === 'string' ? JSON.parse(data) : data;
74
- if (isActionMessage(object) && object.action) {
77
+ if (ActionMessage.is(object) && object.action) {
75
78
  if (!object.clientId || object.clientId === this.clientId) {
76
79
  this.checkMessageOrigin(object);
77
80
  this.logger.log(this, 'receiving', object);
@@ -91,7 +94,7 @@ export class GLSPVscodeDiagramServer extends VscodeDiagramServer {
91
94
  }
92
95
  }
93
96
 
94
- protected handleComputedBounds(action: ComputedBoundsAction): boolean {
97
+ protected override handleComputedBounds(action: ComputedBoundsAction): boolean {
95
98
  return true;
96
99
  }
97
100