@eclipse-glsp/vscode-integration-webview 0.9.0-next.11de3de8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,276 @@
1
+ Eclipse Public License - v 2.0
2
+
3
+ THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
4
+ PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
5
+ OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6
+
7
+ 1. DEFINITIONS
8
+
9
+ "Contribution" means:
10
+
11
+ a) in the case of the initial Contributor, the initial content
12
+ Distributed under this Agreement, and
13
+
14
+ b) in the case of each subsequent Contributor:
15
+ i) changes to the Program, and
16
+ ii) additions to the Program;
17
+ where such changes and/or additions to the Program originate from
18
+ and are Distributed by that particular Contributor. A Contribution
19
+ "originates" from a Contributor if it was added to the Program by
20
+ such Contributor itself or anyone acting on such Contributor's behalf.
21
+ Contributions do not include changes or additions to the Program that
22
+ are not Modified Works.
23
+
24
+ "Contributor" means any person or entity that Distributes the Program.
25
+
26
+ "Licensed Patents" mean patent claims licensable by a Contributor which
27
+ are necessarily infringed by the use or sale of its Contribution alone
28
+ or when combined with the Program.
29
+
30
+ "Program" means the Contributions Distributed in accordance with this
31
+ Agreement.
32
+
33
+ "Recipient" means anyone who receives the Program under this Agreement
34
+ or any Secondary License (as applicable), including Contributors.
35
+
36
+ "Derivative Works" shall mean any work, whether in Source Code or other
37
+ form, that is based on (or derived from) the Program and for which the
38
+ editorial revisions, annotations, elaborations, or other modifications
39
+ represent, as a whole, an original work of authorship.
40
+
41
+ "Modified Works" shall mean any work in Source Code or other form that
42
+ results from an addition to, deletion from, or modification of the
43
+ contents of the Program, including, for purposes of clarity any new file
44
+ in Source Code form that contains any contents of the Program. Modified
45
+ Works shall not include works that contain only declarations,
46
+ interfaces, types, classes, structures, or files of the Program solely
47
+ in each case in order to link to, bind by name, or subclass the Program
48
+ or Modified Works thereof.
49
+
50
+ "Distribute" means the acts of a) distributing or b) making available
51
+ in any manner that enables the transfer of a copy.
52
+
53
+ "Source Code" means the form of a Program preferred for making
54
+ modifications, including but not limited to software source code,
55
+ documentation source, and configuration files.
56
+
57
+ "Secondary License" means either the MIT License or any
58
+ exceptions or additional permissions as identified by the initial
59
+ Contributor.
60
+
61
+ 2. GRANT OF RIGHTS
62
+
63
+ a) Subject to the terms of this Agreement, each Contributor hereby
64
+ grants Recipient a non-exclusive, worldwide, royalty-free copyright
65
+ license to reproduce, prepare Derivative Works of, publicly display,
66
+ publicly perform, Distribute and sublicense the Contribution of such
67
+ Contributor, if any, and such Derivative Works.
68
+
69
+ b) Subject to the terms of this Agreement, each Contributor hereby
70
+ grants Recipient a non-exclusive, worldwide, royalty-free patent
71
+ license under Licensed Patents to make, use, sell, offer to sell,
72
+ import and otherwise transfer the Contribution of such Contributor,
73
+ if any, in Source Code or other form. This patent license shall
74
+ apply to the combination of the Contribution and the Program if, at
75
+ the time the Contribution is added by the Contributor, such addition
76
+ of the Contribution causes such combination to be covered by the
77
+ Licensed Patents. The patent license shall not apply to any other
78
+ combinations which include the Contribution. No hardware per se is
79
+ licensed hereunder.
80
+
81
+ c) Recipient understands that although each Contributor grants the
82
+ licenses to its Contributions set forth herein, no assurances are
83
+ provided by any Contributor that the Program does not infringe the
84
+ patent or other intellectual property rights of any other entity.
85
+ Each Contributor disclaims any liability to Recipient for claims
86
+ brought by any other entity based on infringement of intellectual
87
+ property rights or otherwise. As a condition to exercising the
88
+ rights and licenses granted hereunder, each Recipient hereby
89
+ assumes sole responsibility to secure any other intellectual
90
+ property rights needed, if any. For example, if a third party
91
+ patent license is required to allow Recipient to Distribute the
92
+ Program, it is Recipient's responsibility to acquire that license
93
+ before distributing the Program.
94
+
95
+ d) Each Contributor represents that to its knowledge it has
96
+ sufficient copyright rights in its Contribution, if any, to grant
97
+ the copyright license set forth in this Agreement.
98
+
99
+ e) Notwithstanding the terms of any Secondary License, no
100
+ Contributor makes additional grants to any Recipient (other than
101
+ those set forth in this Agreement) as a result of such Recipient's
102
+ receipt of the Program under the terms of a Secondary License
103
+ (if permitted under the terms of Section 3).
104
+
105
+ 3. REQUIREMENTS
106
+
107
+ 3.1 If a Contributor Distributes the Program in any form, then:
108
+
109
+ a) the Program must also be made available as Source Code, in
110
+ accordance with section 3.2, and the Contributor must accompany
111
+ the Program with a statement that the Source Code for the Program
112
+ is available under this Agreement, and informs Recipients how to
113
+ obtain it in a reasonable manner on or through a medium customarily
114
+ used for software exchange; and
115
+
116
+ b) the Contributor may Distribute the Program under a license
117
+ different than this Agreement, provided that such license:
118
+ i) effectively disclaims on behalf of all other Contributors all
119
+ warranties and conditions, express and implied, including
120
+ warranties or conditions of title and non-infringement, and
121
+ implied warranties or conditions of merchantability and fitness
122
+ for a particular purpose;
123
+
124
+ ii) effectively excludes on behalf of all other Contributors all
125
+ liability for damages, including direct, indirect, special,
126
+ incidental and consequential damages, such as lost profits;
127
+
128
+ iii) does not attempt to limit or alter the recipients' rights
129
+ in the Source Code under section 3.2; and
130
+
131
+ iv) requires any subsequent distribution of the Program by any
132
+ party to be under a license that satisfies the requirements
133
+ of this section 3.
134
+
135
+ 3.2 When the Program is Distributed as Source Code:
136
+
137
+ a) it must be made available under this Agreement, or if the
138
+ Program (i) is combined with other material in a separate file or
139
+ files made available under a Secondary License, and (ii) the initial
140
+ Contributor attached to the Source Code the notice described in
141
+ Exhibit A of this Agreement, then the Program may be made available
142
+ under the terms of such Secondary Licenses, and
143
+
144
+ b) a copy of this Agreement must be included with each copy of
145
+ the Program.
146
+
147
+ 3.3 Contributors may not remove or alter any copyright, patent,
148
+ trademark, attribution notices, disclaimers of warranty, or limitations
149
+ of liability ("notices") contained within the Program from any copy of
150
+ the Program which they Distribute, provided that Contributors may add
151
+ their own appropriate notices.
152
+
153
+ 4. COMMERCIAL DISTRIBUTION
154
+
155
+ Commercial distributors of software may accept certain responsibilities
156
+ with respect to end users, business partners and the like. While this
157
+ license is intended to facilitate the commercial use of the Program,
158
+ the Contributor who includes the Program in a commercial product
159
+ offering should do so in a manner which does not create potential
160
+ liability for other Contributors. Therefore, if a Contributor includes
161
+ the Program in a commercial product offering, such Contributor
162
+ ("Commercial Contributor") hereby agrees to defend and indemnify every
163
+ other Contributor ("Indemnified Contributor") against any losses,
164
+ damages and costs (collectively "Losses") arising from claims, lawsuits
165
+ and other legal actions brought by a third party against the Indemnified
166
+ Contributor to the extent caused by the acts or omissions of such
167
+ Commercial Contributor in connection with its distribution of the Program
168
+ in a commercial product offering. The obligations in this section do not
169
+ apply to any claims or Losses relating to any actual or alleged
170
+ intellectual property infringement. In order to qualify, an Indemnified
171
+ Contributor must: a) promptly notify the Commercial Contributor in
172
+ writing of such claim, and b) allow the Commercial Contributor to control,
173
+ and cooperate with the Commercial Contributor in, the defense and any
174
+ related settlement negotiations. The Indemnified Contributor may
175
+ participate in any such claim at its own expense.
176
+
177
+ For example, a Contributor might include the Program in a commercial
178
+ product offering, Product X. That Contributor is then a Commercial
179
+ Contributor. If that Commercial Contributor then makes performance
180
+ claims, or offers warranties related to Product X, those performance
181
+ claims and warranties are such Commercial Contributor's responsibility
182
+ alone. Under this section, the Commercial Contributor would have to
183
+ defend claims against the other Contributors related to those performance
184
+ claims and warranties, and if a court requires any other Contributor to
185
+ pay any damages as a result, the Commercial Contributor must pay
186
+ those damages.
187
+
188
+ 5. NO WARRANTY
189
+
190
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
191
+ PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
192
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
193
+ IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
194
+ TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
195
+ PURPOSE. Each Recipient is solely responsible for determining the
196
+ appropriateness of using and distributing the Program and assumes all
197
+ risks associated with its exercise of rights under this Agreement,
198
+ including but not limited to the risks and costs of program errors,
199
+ compliance with applicable laws, damage to or loss of data, programs
200
+ or equipment, and unavailability or interruption of operations.
201
+
202
+ 6. DISCLAIMER OF LIABILITY
203
+
204
+ EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
205
+ PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
206
+ SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
207
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
208
+ PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
209
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
210
+ ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
211
+ EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
212
+ POSSIBILITY OF SUCH DAMAGES.
213
+
214
+ 7. GENERAL
215
+
216
+ If any provision of this Agreement is invalid or unenforceable under
217
+ applicable law, it shall not affect the validity or enforceability of
218
+ the remainder of the terms of this Agreement, and without further
219
+ action by the parties hereto, such provision shall be reformed to the
220
+ minimum extent necessary to make such provision valid and enforceable.
221
+
222
+ If Recipient institutes patent litigation against any entity
223
+ (including a cross-claim or counterclaim in a lawsuit) alleging that the
224
+ Program itself (excluding combinations of the Program with other software
225
+ or hardware) infringes such Recipient's patent(s), then such Recipient's
226
+ rights granted under Section 2(b) shall terminate as of the date such
227
+ litigation is filed.
228
+
229
+ All Recipient's rights under this Agreement shall terminate if it
230
+ fails to comply with any of the material terms or conditions of this
231
+ Agreement and does not cure such failure in a reasonable period of
232
+ time after becoming aware of such noncompliance. If all Recipient's
233
+ rights under this Agreement terminate, Recipient agrees to cease use
234
+ and distribution of the Program as soon as reasonably practicable.
235
+ However, Recipient's obligations under this Agreement and any licenses
236
+ granted by Recipient relating to the Program shall continue and survive.
237
+
238
+ Everyone is permitted to copy and distribute copies of this Agreement,
239
+ but in order to avoid inconsistency the Agreement is copyrighted and
240
+ may only be modified in the following manner. The Agreement Steward
241
+ reserves the right to publish new versions (including revisions) of
242
+ this Agreement from time to time. No one other than the Agreement
243
+ Steward has the right to modify this Agreement. The Eclipse Foundation
244
+ is the initial Agreement Steward. The Eclipse Foundation may assign the
245
+ responsibility to serve as the Agreement Steward to a suitable separate
246
+ entity. Each new version of the Agreement will be given a distinguishing
247
+ version number. The Program (including Contributions) may always be
248
+ Distributed subject to the version of the Agreement under which it was
249
+ received. In addition, after a new version of the Agreement is published,
250
+ Contributor may elect to Distribute the Program (including its
251
+ Contributions) under the new version.
252
+
253
+ Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
254
+ receives no rights or licenses to the intellectual property of any
255
+ Contributor under this Agreement, whether expressly, by implication,
256
+ estoppel or otherwise. All rights in the Program not expressly granted
257
+ under this Agreement are reserved. Nothing in this Agreement is intended
258
+ to be enforceable by any entity that is not a Contributor or Recipient.
259
+ No third-party beneficiary rights are created under this Agreement.
260
+
261
+ Exhibit A - Form of Secondary Licenses Notice
262
+
263
+ "This Source Code may also be made available under the following
264
+ Secondary Licenses when the conditions for such availability set forth
265
+ in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
266
+ version(s), and exceptions or additional permissions here}."
267
+
268
+ Simply including a copy of this Agreement, including this Exhibit A
269
+ is not sufficient to license the Source Code under Secondary Licenses.
270
+
271
+ If it is not possible or desirable to put the notice in a particular
272
+ file, then You may include the notice in a location (such as a LICENSE
273
+ file in a relevant directory) where a recipient would be likely to
274
+ look for such a notice.
275
+
276
+ You may add additional accurate notices of copyright ownership.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Eclipse GLSP VSCode Integration
2
+
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
+
6
+ ### Where to find the sources?
7
+
8
+ In addition to this repository, the related source code can be found here:
9
+
10
+ - https://github.com/eclipse-glsp/glsp-server
11
+ - https://github.com/eclipse-glsp/glsp-client
12
+
13
+ ## More information
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/).
@@ -0,0 +1,100 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2019 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
+ .command-palette {
18
+ z-index: var(--vscode-menu-z-index);
19
+ -webkit-animation: fadein 0.3s;
20
+ -moz-animation: fadein 0.3s;
21
+ -ms-animation: fadein 0.3s;
22
+ -o-animation: fadein 0.3s;
23
+ animation: fadein 0.3s;
24
+ }
25
+
26
+ .command-palette.validation .validation-decorator {
27
+ position: absolute;
28
+ padding-left: 5px;
29
+ padding-top: 5px;
30
+ padding-bottom: 5px;
31
+ border-radius: 5px 5px 0px 0px;
32
+ color: white;
33
+ /* indent second line for icon */
34
+ padding-left: 25px;
35
+ text-indent: -10px;
36
+ /* let error decoration fade in */
37
+ -webkit-animation: fadein 0.3s;
38
+ -moz-animation: fadein 0.3s;
39
+ -ms-animation: fadein 0.3s;
40
+ -o-animation: fadein 0.3s;
41
+ animation: fadein 0.3s;
42
+ }
43
+
44
+ .command-palette.validation.error input,
45
+ .command-palette.validation.error input:focus {
46
+ color: var(--vscode-inputValidation-errorForeground);
47
+ outline-color: var(--vscode-inputValidation-errorBorder);
48
+ }
49
+
50
+ .command-palette.validation.error .validation-decorator.error {
51
+ border: 1px solid var(--vscode-inputValidation-errorBorder);
52
+ background-color: var(--vscode-inputValidation-errorBorder);
53
+ }
54
+
55
+ .command-palette.validation.warning input,
56
+ .command-palette.validation.warning input:focus {
57
+ color: var(--vscode-inputValidation-warningForeground);
58
+ outline-color: var(--vscode-inputValidation-warningBorder);
59
+ }
60
+
61
+ .command-palette.validation.warning .validation-decorator.warning {
62
+ border: 1px solid var(--vscode-inputValidation-warningBorder);
63
+ background-color: var(--vscode-inputValidation-warningBorder);
64
+ }
65
+
66
+ .command-palette {
67
+ box-shadow: var(--vscode-border-width) var(--vscode-border-width) var(--vscode-widget-shadow);
68
+ background-color: var(--vscode-menu-background);
69
+ }
70
+
71
+ .command-palette input {
72
+ background: var(--vscode-input-background);
73
+ color: var(--vscode-input-foreground);
74
+ border: var(--vscode-border-width) solid var(--vscode-input-border);
75
+ font-family: var(--vscode-ui-font-family);
76
+ font-size: var(--vscode-ui-font-size1);
77
+ line-height: var(--vscode-content-line-height);
78
+ padding-left: 5px;
79
+ }
80
+
81
+ .command-palette .command-palette-suggestions {
82
+ background: inherit;
83
+ line-height: var(--vscode-content-line-height);
84
+ }
85
+
86
+ .command-palette .command-palette-suggestions > div:hover:not(.group) {
87
+ background: var(--vscode-menubar-selectionBackground);
88
+ }
89
+
90
+ .command-palette .command-palette-suggestions > div.selected {
91
+ background: var(--vscode-menu-selectionBackground);
92
+ color: var(--vscode-menu-selectionForeground);
93
+ }
94
+
95
+ .command-palette .loading {
96
+ position: absolute;
97
+ font-size: inherit;
98
+ top: 5px;
99
+ right: 0;
100
+ }
@@ -0,0 +1,25 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2020-2021 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ :root {
18
+ --glsp-error-foreground: var(--vscode-inputValidation-errorBorder);
19
+ --glsp-warning-foreground: var(--vscode-inputValidation-warningBorderd);
20
+ --glsp-info-foreground: var(--vscode-inputValidation-infoBorder);
21
+ }
22
+
23
+ .sprotty-issue-background {
24
+ fill: var(--vscode-editor-background);
25
+ }
@@ -0,0 +1,61 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2020-2021 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ html,
18
+ body {
19
+ width: 100%;
20
+ height: 100%;
21
+ padding: 0px;
22
+ }
23
+
24
+ .sprotty {
25
+ display: flex;
26
+ height: 100%;
27
+ }
28
+
29
+ .sprotty svg {
30
+ width: 100%;
31
+ flex: 1;
32
+ border-style: solid;
33
+ border-width: 0px;
34
+ }
35
+
36
+ .sprotty svg:focus {
37
+ border-width: 0;
38
+ outline: none;
39
+ }
40
+
41
+ .sprotty-graph {
42
+ background: var(--vscode-editor-background);
43
+ }
44
+
45
+ .sprotty-node {
46
+ stroke: var(--vscode-editor-foreground);
47
+ fill: var(--vscode-editor-foreground);
48
+ }
49
+
50
+ .sprotty-edge {
51
+ fill: none;
52
+ stroke: var(--vscode-editor-foreground);
53
+ }
54
+
55
+ .sprotty-edge.arrow {
56
+ fill: var(--vscode-editor-foreground);
57
+ }
58
+
59
+ .sprotty-node.selected {
60
+ stroke: var(--vscode-menu-selectionBackground);
61
+ }
@@ -0,0 +1,23 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2020-2021 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ @import 'command-palette.css';
18
+ @import 'diagram.css';
19
+ @import 'tool-palette.css';
20
+ @import 'decoration.css';
21
+ .sprotty-resize-handle.active {
22
+ fill: #0074e8 !important;
23
+ }
@@ -0,0 +1,92 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2020-2021 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ .tool-palette {
18
+ box-shadow: 0px 1px 6px var(--vscode-widget-shadow);
19
+ }
20
+
21
+ .tool-palette .palette-header {
22
+ background: var(--vscode-titleBar-activeBackground);
23
+ color: var(--vscode-titleBar-activeForeground);
24
+ border: 0;
25
+ font-weight: normal;
26
+ overflow: hidden;
27
+ padding: 0.2em;
28
+ line-height: 1.5em;
29
+ box-shadow: none;
30
+ border-top: 2px solid var(--vscode-focusBorder);
31
+ }
32
+
33
+ .tool-palette .palette-header .header-icon {
34
+ font-size: var(--vscode-ui-font-size1);
35
+ float: left;
36
+ padding: 0.2em;
37
+ }
38
+
39
+ .tool-palette .palette-header .header-tools {
40
+ font-size: var(--vscode-ui-font-size3);
41
+ float: right;
42
+ }
43
+
44
+ .tool-palette .palette-header .header-tools i {
45
+ border: none;
46
+ width: 1em;
47
+ text-align: center;
48
+ }
49
+
50
+ .tool-palette .palette-header .header-tools i:hover:not(.clicked) {
51
+ background: var(--vscode-menubar-selectionBackground);
52
+ }
53
+
54
+ .tool-palette .palette-header .header-tools .clicked {
55
+ background: var(--vscode-inputOption-activeBackground);
56
+ }
57
+
58
+ .tool-palette .palette-body {
59
+ border: 0;
60
+ box-shadow: none;
61
+ }
62
+
63
+ .tool-palette .palette-body .group-header {
64
+ font-size: var(--vscode-ui-font-size1);
65
+ font-weight: normal;
66
+ background: var(--vscode-settings-dropdownBackground);
67
+ color: var(--vscode-titleBar-activeForeground);
68
+ border: 0;
69
+ }
70
+
71
+ .tool-palette .palette-body .tool-button {
72
+ background: var(--vscode-menu-background);
73
+ color: var(--vscode-titleBar-activeForeground);
74
+ }
75
+
76
+ .tool-palette .palette-body .tool-button:hover:not(.clicked) {
77
+ background: var(--vscode-list-hoverBackground);
78
+ }
79
+
80
+ .tool-palette .tool-button.clicked {
81
+ background: var(--vscode-menu-selectionBackground);
82
+ color: var(--vscode-menu-selectionForeground);
83
+ }
84
+
85
+ .search-input {
86
+ background: var(--vscode-input-background);
87
+ color: var(--vscode-input-foreground);
88
+ 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
+ }
@@ -0,0 +1,30 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2021 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { Action, ActionHandlerRegistry, IActionHandler, IActionHandlerInitializer, ICommand } from 'sprotty';
17
+ import { SprottyDiagramIdentifier } from 'sprotty-vscode-webview';
18
+ /**
19
+ * Delegates actions that should be handled inside of the glsp vscode extension instead
20
+ * of the webview. This enables the implementation of action handlers that require access
21
+ * to the vscode API and/or node backend.
22
+ */
23
+ export declare class GLSPVscodeExtensionActionHandler implements IActionHandler, IActionHandlerInitializer {
24
+ protected readonly actionKinds: string[];
25
+ protected readonly diagramIdentifier: SprottyDiagramIdentifier;
26
+ constructor(actionKinds: string[], diagramIdentifier: SprottyDiagramIdentifier);
27
+ initialize(registry: ActionHandlerRegistry): void;
28
+ handle(action: Action): void | Action | ICommand;
29
+ }
30
+ //# sourceMappingURL=extension-action-handler.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GLSPVscodeExtensionActionHandler = void 0;
4
+ const vscode_api_1 = require("sprotty-vscode-webview/lib/vscode-api");
5
+ /**
6
+ * Delegates actions that should be handled inside of the glsp vscode extension instead
7
+ * of the webview. This enables the implementation of action handlers that require access
8
+ * to the vscode API and/or node backend.
9
+ */
10
+ class GLSPVscodeExtensionActionHandler {
11
+ constructor(actionKinds, diagramIdentifier) {
12
+ this.actionKinds = actionKinds;
13
+ this.diagramIdentifier = diagramIdentifier;
14
+ }
15
+ initialize(registry) {
16
+ this.actionKinds.forEach(kind => registry.register(kind, this));
17
+ }
18
+ handle(action) {
19
+ if (this.actionKinds.includes(action.kind)) {
20
+ const message = {
21
+ clientId: this.diagramIdentifier.clientId,
22
+ action,
23
+ __localDispatch: true
24
+ };
25
+ vscode_api_1.vscodeApi.postMessage(message);
26
+ }
27
+ }
28
+ }
29
+ exports.GLSPVscodeExtensionActionHandler = GLSPVscodeExtensionActionHandler;
30
+ //# sourceMappingURL=extension-action-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extension-action-handler.js","sourceRoot":"","sources":["../src/extension-action-handler.ts"],"names":[],"mappings":";;;AAiBA,sEAAkE;AAElE;;;;GAIG;AACH,MAAa,gCAAgC;IACzC,YAA+B,WAAqB,EAAqB,iBAA2C;QAArF,gBAAW,GAAX,WAAW,CAAU;QAAqB,sBAAiB,GAAjB,iBAAiB,CAA0B;IAAG,CAAC;IAExH,UAAU,CAAC,QAA+B;QACtC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,MAAc;QACjB,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACxC,MAAM,OAAO,GAAG;gBACZ,QAAQ,EAAE,IAAI,CAAC,iBAAiB,CAAC,QAAQ;gBACzC,MAAM;gBACN,eAAe,EAAE,IAAI;aACxB,CAAC;YACF,sBAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;SAClC;IACL,CAAC;CACJ;AAjBD,4EAiBC"}
@@ -0,0 +1,11 @@
1
+ import { Container } from 'inversify';
2
+ import { SprottyDiagramIdentifier, SprottyStarter } from 'sprotty-vscode-webview';
3
+ export declare abstract class GLSPStarter extends SprottyStarter {
4
+ protected addVscodeBindings(container: Container, diagramIdentifier: SprottyDiagramIdentifier): void;
5
+ protected configureExtensionActionHandler(container: Container, diagramIdentifier: SprottyDiagramIdentifier): void;
6
+ /**
7
+ * All kinds of actions that should (also) be delegated to and handled by the vscode extension
8
+ */
9
+ protected get extensionActionKinds(): string[];
10
+ }
11
+ //# sourceMappingURL=glsp-starter.d.ts.map