@eclipse-glsp/client 1.1.0-next.e193103.187 → 1.1.0-next.ee71b2a.218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/css/glsp-sprotty.css +18 -18
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/command-stack.js +2 -2
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/container-modules.d.ts +32 -2
- package/lib/base/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +78 -39
- package/lib/base/container-modules.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +1 -1
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/model-initialization-constraint.js.map +1 -1
- package/lib/base/selection-clearing-mouse-listener.js +1 -1
- package/lib/base/selection-clearing-mouse-listener.js.map +1 -1
- package/lib/base/tool-manager/glsp-tool-manager.js.map +1 -1
- package/lib/base/types.d.ts +2 -0
- package/lib/base/types.d.ts.map +1 -1
- package/lib/base/view/view-registry.js.map +1 -1
- package/lib/features/bounds/di.config.d.ts +20 -0
- package/lib/features/bounds/di.config.d.ts.map +1 -0
- package/lib/features/bounds/di.config.js +36 -0
- package/lib/features/bounds/di.config.js.map +1 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +34 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +98 -0
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -0
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/command-palette/command-palette-tool.js +1 -1
- package/lib/features/command-palette/command-palette-tool.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/delete-element-context-menu.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts +2 -2
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +2 -3
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/edit-label-tool.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/export/di.config.d.ts +19 -0
- package/lib/features/export/di.config.d.ts.map +1 -0
- package/lib/features/export/di.config.js +29 -0
- package/lib/features/export/di.config.js.map +1 -0
- package/lib/features/export/glsp-svg-exporter.d.ts +22 -0
- package/lib/features/export/glsp-svg-exporter.d.ts.map +1 -0
- package/lib/features/export/glsp-svg-exporter.js +45 -0
- package/lib/features/export/glsp-svg-exporter.js.map +1 -0
- package/lib/features/hints/type-hints.js.map +1 -1
- package/lib/features/hover/hover.d.ts.map +1 -1
- package/lib/features/hover/hover.js +2 -1
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/freeform-layout.js.map +1 -1
- package/lib/features/layout/hbox-layout.js.map +1 -1
- package/lib/features/layout/layout-elements-action.d.ts +4 -4
- package/lib/features/layout/layout-elements-action.d.ts.map +1 -1
- package/lib/features/layout/layout-elements-action.js +2 -2
- package/lib/features/layout/layout-elements-action.js.map +1 -1
- package/lib/features/layout/layouter.js.map +1 -1
- package/lib/features/layout/tests/layouter-test-util.d.ts +1 -1
- package/lib/features/layout/tests/layouter-test-util.js +2 -2
- package/lib/features/layout/tests/layouter-test-util.js.map +1 -1
- package/lib/features/layout/vbox-layout.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/save/model.d.ts +1 -1
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +1 -1
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +2 -1
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/source-model-watcher/di.config.js +1 -1
- package/lib/features/source-model-watcher/source-model-changed-action-handler.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts +2 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +2 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +3 -2
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +4 -3
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/base-glsp-tool.js.map +1 -1
- package/lib/features/tools/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds-tool.js +13 -10
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/di.config.d.ts.map +1 -1
- package/lib/features/tools/di.config.js +5 -2
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts +2 -2
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +3 -2
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -1
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts +20 -0
- package/lib/features/tools/glsp-manhattan-edge-router.d.ts.map +1 -0
- package/lib/features/tools/glsp-manhattan-edge-router.js +69 -0
- package/lib/features/tools/glsp-manhattan-edge-router.js.map +1 -0
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/validation/issue-marker.d.ts +1 -1
- package/lib/features/validation/issue-marker.js +1 -1
- package/lib/features/validation/marker-navigator.d.ts +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/lib/model.d.ts +7 -3
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +48 -1
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/sprotty-reexport.d.ts +6 -6
- package/lib/sprotty-reexport.d.ts.map +1 -1
- package/lib/sprotty-reexport.js +19 -8
- package/lib/sprotty-reexport.js.map +1 -1
- package/lib/utils/html-utils.d.ts +1 -1
- package/lib/utils/html-utils.js +1 -1
- package/lib/utils/smodel-util.d.ts +35 -5
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +50 -2
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/views/base-view-module.js +1 -1
- package/lib/views/compartments.js.map +1 -1
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +1 -1
- package/lib/views/glsp-projection-view.d.ts.map +1 -1
- package/lib/views/glsp-projection-view.js +9 -3
- package/lib/views/glsp-projection-view.js.map +1 -1
- package/lib/views/index.d.ts +1 -1
- package/lib/views/index.js +1 -1
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/package.json +23 -23
- package/src/base/command-stack.ts +3 -3
- package/src/base/container-modules.ts +53 -9
- package/src/base/selection-clearing-mouse-listener.ts +1 -1
- package/src/features/bounds/di.config.ts +39 -0
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +88 -0
- package/src/features/command-palette/command-palette-tool.ts +1 -1
- package/src/features/copy-paste/copy-paste-handler.ts +4 -8
- package/src/features/export/di.config.ts +28 -0
- package/src/features/export/glsp-svg-exporter.ts +50 -0
- package/src/features/hover/hover.ts +2 -1
- package/src/features/layout/layout-elements-action.ts +2 -1
- package/src/features/layout/tests/layouter-test-util.ts +3 -3
- package/src/features/save/model.ts +1 -1
- package/src/features/select/select-mouse-listener.ts +2 -2
- package/src/features/source-model-watcher/di.config.ts +1 -1
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +1 -1
- package/src/features/tool-feedback/creation-tool-feedback.ts +1 -1
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +1 -1
- package/src/features/tools/change-bounds-tool.ts +16 -13
- package/src/features/tools/di.config.ts +7 -3
- package/src/features/tools/edge-edit-tool.ts +5 -6
- package/src/features/tools/glsp-manhattan-edge-router.ts +57 -0
- package/src/features/validation/issue-marker.ts +1 -1
- package/src/lib/model.ts +35 -3
- package/src/sprotty-reexport.ts +17 -6
- package/src/utils/html-utils.ts +1 -1
- package/src/utils/smodel-util.ts +60 -4
- package/src/views/base-view-module.ts +1 -1
- package/src/views/glsp-projection-view.tsx +11 -4
- package/src/views/index.ts +1 -1
package/src/sprotty-reexport.ts
CHANGED
|
@@ -22,7 +22,10 @@
|
|
|
22
22
|
|
|
23
23
|
export * from '@eclipse-glsp/protocol';
|
|
24
24
|
// sprotty-protocol
|
|
25
|
-
export {
|
|
25
|
+
export {
|
|
26
|
+
BringToFrontAction, CollapseExpandAction, CollapseExpandAllAction,
|
|
27
|
+
ElementAndAlignment, HoverFeedbackAction, MoveAction, SetBoundsAction
|
|
28
|
+
} from 'sprotty-protocol/lib/actions';
|
|
26
29
|
export { Viewport } from 'sprotty-protocol/lib/model';
|
|
27
30
|
// ------------------ Base ------------------
|
|
28
31
|
export * from 'sprotty/lib/base/actions/action-dispatcher';
|
|
@@ -104,7 +107,12 @@ export {
|
|
|
104
107
|
export * from 'sprotty/lib/features/bounds/stack-layout';
|
|
105
108
|
export * from 'sprotty/lib/features/bounds/vbox-layout';
|
|
106
109
|
export * from 'sprotty/lib/features/bounds/views';
|
|
107
|
-
export
|
|
110
|
+
export {
|
|
111
|
+
ButtonHandlerRegistry,
|
|
112
|
+
configureButtonHandler,
|
|
113
|
+
IButtonHandler,
|
|
114
|
+
IButtonHandlerRegistration
|
|
115
|
+
} from 'sprotty/lib/features/button/button-handler';
|
|
108
116
|
export * from 'sprotty/lib/features/button/model';
|
|
109
117
|
export * from 'sprotty/lib/features/command-palette/action-providers';
|
|
110
118
|
export * from 'sprotty/lib/features/command-palette/command-palette';
|
|
@@ -139,7 +147,6 @@ export * from 'sprotty/lib/features/fade/model';
|
|
|
139
147
|
export {
|
|
140
148
|
AbstractHoverMouseListener,
|
|
141
149
|
ClosePopupActionHandler,
|
|
142
|
-
HoverFeedbackAction,
|
|
143
150
|
HoverFeedbackCommand,
|
|
144
151
|
HoverKeyListener,
|
|
145
152
|
HoverMouseListener,
|
|
@@ -149,7 +156,10 @@ export {
|
|
|
149
156
|
} from 'sprotty/lib/features/hover/hover';
|
|
150
157
|
export * from 'sprotty/lib/features/hover/model';
|
|
151
158
|
export * from 'sprotty/lib/features/move/model';
|
|
152
|
-
export
|
|
159
|
+
export {
|
|
160
|
+
ElementMove, LocationPostprocessor, MorphEdgesAnimation, MoveAnimation,
|
|
161
|
+
MoveCommand, MoveMouseListener, ResolvedElementMove, ResolvedHandleMove
|
|
162
|
+
} from 'sprotty/lib/features/move/move';
|
|
153
163
|
export * from 'sprotty/lib/features/move/snap';
|
|
154
164
|
export * from 'sprotty/lib/features/nameable/model';
|
|
155
165
|
export * from 'sprotty/lib/features/open/model';
|
|
@@ -177,7 +187,7 @@ export {
|
|
|
177
187
|
SelectKeyboardListener,
|
|
178
188
|
SelectMouseListener
|
|
179
189
|
} from 'sprotty/lib/features/select/select';
|
|
180
|
-
export
|
|
190
|
+
export { UndoRedoKeyListener } from 'sprotty/lib/features/undo-redo/undo-redo';
|
|
181
191
|
export * from 'sprotty/lib/features/update/model-matching';
|
|
182
192
|
export { UpdateAnimationData, UpdateModelCommand } from 'sprotty/lib/features/update/update-model';
|
|
183
193
|
export {
|
|
@@ -197,7 +207,7 @@ export {
|
|
|
197
207
|
} from 'sprotty/lib/features/viewport/viewport';
|
|
198
208
|
export * from 'sprotty/lib/features/viewport/viewport-root';
|
|
199
209
|
export * from 'sprotty/lib/features/viewport/zoom';
|
|
200
|
-
export
|
|
210
|
+
export { BringToFrontCommand, ZOrderElement } from 'sprotty/lib/features/zorder/zorder';
|
|
201
211
|
export { SCompartment, SEdge, SGraph, SGraphIndex, SLabel, SNode, SPort } from 'sprotty/lib/graph/sgraph';
|
|
202
212
|
// ------------------ Graph ------------------
|
|
203
213
|
export * from 'sprotty/lib/graph/sgraph-factory';
|
|
@@ -281,3 +291,4 @@ import viewportModule from 'sprotty/lib/features/viewport/di.config';
|
|
|
281
291
|
import zorderModule from 'sprotty/lib/features/zorder/di.config';
|
|
282
292
|
import graphModule from 'sprotty/lib/graph/di.config';
|
|
283
293
|
import modelSourceModule from 'sprotty/lib/model-source/di.config';
|
|
294
|
+
|
package/src/utils/html-utils.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2020 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
|
package/src/utils/smodel-util.ts
CHANGED
|
@@ -13,14 +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 {
|
|
16
|
+
import {
|
|
17
|
+
distinctAdd, ElementAndBounds, ElementAndRoutingPoints, Point, remove, SModelElementSchema,
|
|
18
|
+
TypeGuard
|
|
19
|
+
} from '@eclipse-glsp/protocol';
|
|
17
20
|
import {
|
|
18
21
|
BoundsAware,
|
|
22
|
+
EdgeRouterRegistry,
|
|
19
23
|
isBoundsAware,
|
|
20
24
|
isMoveable,
|
|
21
25
|
isSelectable,
|
|
22
|
-
isSelected,
|
|
23
|
-
|
|
26
|
+
isSelected, ModelIndexImpl,
|
|
27
|
+
RoutedPoint,
|
|
24
28
|
Selectable,
|
|
25
29
|
SModelElement,
|
|
26
30
|
SRoutableElement,
|
|
@@ -214,7 +218,7 @@ export function toElementAndBounds(element: BoundsAwareModelElement): ElementAnd
|
|
|
214
218
|
|
|
215
219
|
/**
|
|
216
220
|
* Helper function to translate a given {@link SRoutableElement} into its corresponding
|
|
217
|
-
* {@ElementAndRoutingPoints
|
|
221
|
+
* {@link ElementAndRoutingPoints} representation.
|
|
218
222
|
* @param element The element to translate.
|
|
219
223
|
* @returns The corresponding {@link ElementAndRoutingPoints} for the given element.
|
|
220
224
|
*/
|
|
@@ -225,6 +229,57 @@ export function toElementAndRoutingPoints(element: SRoutableElement): ElementAnd
|
|
|
225
229
|
};
|
|
226
230
|
}
|
|
227
231
|
|
|
232
|
+
/** Pure routing point data kinds. */
|
|
233
|
+
export const ROUTING_POINT_KINDS = ['linear', 'bezier-junction'];
|
|
234
|
+
|
|
235
|
+
/** Pure route data kinds. */
|
|
236
|
+
export const ROUTE_KINDS = [...ROUTING_POINT_KINDS, 'source', 'target'];
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Helper function to calculate the {@link ElementAndRoutingPoints} for a given {@link SRoutableElement}.
|
|
240
|
+
* If client layout is activated, i.e., the edge routing registry is given and has a router for the element, then the routing
|
|
241
|
+
* points from the calculated route are used, otherwise we use the already specified routing points of the {@link SRoutableElement}.
|
|
242
|
+
* @param element The element to translate.
|
|
243
|
+
* @param routerRegistry the edge router registry.
|
|
244
|
+
* @returns The corresponding {@link ElementAndRoutingPoints} for the given element.
|
|
245
|
+
*/
|
|
246
|
+
export function calcElementAndRoutingPoints(element: SRoutableElement, routerRegistry?: EdgeRouterRegistry): ElementAndRoutingPoints {
|
|
247
|
+
const newRoutingPoints = routerRegistry ? calcRoute(element, routerRegistry, ROUTING_POINT_KINDS) : element.routingPoints;
|
|
248
|
+
return { elementId: element.id, newRoutingPoints };
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Helper function to calculate the route for a given {@link SRoutableElement}.
|
|
253
|
+
* If client layout is activated, i.e., the edge routing registry is given and has a router for the element, then the points
|
|
254
|
+
* from the calculated route are used, otherwise we use the already specified routing points of the {@link SRoutableElement}.
|
|
255
|
+
* @param element The element to translate.
|
|
256
|
+
* @param routerRegistry the edge router registry.
|
|
257
|
+
* @returns The corresponding route for the given element.
|
|
258
|
+
*/
|
|
259
|
+
export function calcElementAndRoute(element: SRoutableElement, routerRegistry?: EdgeRouterRegistry): ElementAndRoutingPoints {
|
|
260
|
+
let route: Point[] | undefined = routerRegistry ? calcRoute(element, routerRegistry, ROUTE_KINDS) : undefined;
|
|
261
|
+
if (!route) {
|
|
262
|
+
// add source and target to the routing points
|
|
263
|
+
route = [...element.routingPoints];
|
|
264
|
+
route.splice(0, 0, element.source?.position || Point.ORIGIN);
|
|
265
|
+
route.push(element.target?.position || Point.ORIGIN);
|
|
266
|
+
}
|
|
267
|
+
return { elementId: element.id, newRoutingPoints: route };
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Helper function to calculate the route for a given {@link SRoutableElement}.
|
|
272
|
+
* @param element The element to translate.
|
|
273
|
+
* @param routerRegistry the edge router registry.
|
|
274
|
+
* @param pointKinds the routing point kinds that should be considered.
|
|
275
|
+
* @returns The corresponding route for the given element.
|
|
276
|
+
*/
|
|
277
|
+
export function calcRoute(element: SRoutableElement, routerRegistry: EdgeRouterRegistry, pointKinds?: string[]): RoutedPoint[] | undefined {
|
|
278
|
+
return routerRegistry?.get(element.routerKind).route(element)
|
|
279
|
+
.filter((point, idx, fullRoute) => idx === fullRoute.findIndex(otherPoint => otherPoint.x === point.x && otherPoint.y === point.y))
|
|
280
|
+
.filter(point => !pointKinds || pointKinds.includes(point.kind));
|
|
281
|
+
}
|
|
282
|
+
|
|
228
283
|
/**
|
|
229
284
|
* Checks if the model is compatible with the passed type string.
|
|
230
285
|
* (either has the same type or a subtype of this type)
|
|
@@ -247,3 +302,4 @@ export function getElementTypeId(input: SModelElement | SModelElementSchema | st
|
|
|
247
302
|
return (input as any)['type'] as string;
|
|
248
303
|
}
|
|
249
304
|
}
|
|
305
|
+
|
|
@@ -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,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2017-
|
|
2
|
+
* Copyright (c) 2017-2022 TypeFox 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
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
ProjectedViewportView,
|
|
26
26
|
ProjectionParams,
|
|
27
27
|
RenderingContext,
|
|
28
|
+
setAttr,
|
|
28
29
|
setClass,
|
|
29
30
|
ViewportRootElement,
|
|
30
31
|
ViewProjection
|
|
@@ -36,12 +37,18 @@ import {
|
|
|
36
37
|
@injectable()
|
|
37
38
|
export class GLSPProjectionView extends ProjectedViewportView {
|
|
38
39
|
override render(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const svgElem = this.renderSvg(model, context, args);
|
|
41
|
+
if (svgElem.data) {
|
|
42
|
+
svgElem.data!.class = { 'sprotty-graph': true };
|
|
43
|
+
}
|
|
44
|
+
const rootNode: VNode = (
|
|
45
|
+
<div class-sprotty-graph={false} style={{ width: '100%', height: '100%' }}>
|
|
46
|
+
{svgElem}
|
|
42
47
|
{this.renderProjections(model, context, args)}
|
|
43
48
|
</div>
|
|
44
49
|
);
|
|
50
|
+
setAttr(rootNode, 'tabindex', 0);
|
|
51
|
+
return rootNode;
|
|
45
52
|
}
|
|
46
53
|
|
|
47
54
|
protected override renderSvg(model: Readonly<ViewportRootElement>, context: RenderingContext, args?: IViewArgs): VNode {
|
package/src/views/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c)
|
|
2
|
+
* Copyright (c) 2019-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
|