@eclipse-glsp/client 0.9.0-next.c5944e10 → 0.9.0-next.fd1a8bb6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +1 -1
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/actions/context-actions.d.ts +1 -1
- package/lib/base/actions/context-actions.d.ts.map +1 -1
- package/lib/base/actions/context-actions.js +2 -3
- package/lib/base/actions/context-actions.js.map +1 -1
- package/lib/base/actions/edit-mode-action.d.ts.map +1 -1
- package/lib/base/actions/edit-mode-action.js +2 -3
- package/lib/base/actions/edit-mode-action.js.map +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts +1 -1
- package/lib/base/actions/edit-validation-actions.d.ts.map +1 -1
- package/lib/base/actions/edit-validation-actions.js +13 -10
- package/lib/base/actions/edit-validation-actions.js.map +1 -1
- package/lib/base/actions/focus-change-action.js.map +1 -1
- package/lib/base/args.d.ts +1 -1
- package/lib/base/args.d.ts.map +1 -1
- package/lib/base/args.js.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +1 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +4 -5
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/auto-complete/validation-decorator.d.ts +1 -1
- package/lib/base/auto-complete/validation-decorator.js +1 -1
- package/lib/base/auto-complete/validation-decorator.js.map +1 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +1 -1
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/di.config.d.ts.map +1 -1
- package/lib/base/di.config.js.map +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts +1 -1
- package/lib/base/drag-aware-mouse-listener.d.ts.map +1 -1
- package/lib/base/drag-aware-mouse-listener.js +1 -1
- package/lib/base/drag-aware-mouse-listener.js.map +1 -1
- package/lib/base/editor-context.d.ts.map +1 -1
- package/lib/base/editor-context.js +1 -1
- package/lib/base/editor-context.js.map +1 -1
- package/lib/base/focus-tracker.d.ts.map +1 -1
- package/lib/base/focus-tracker.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +4 -5
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/operations/operation.d.ts +1 -1
- package/lib/base/operations/operation.d.ts.map +1 -1
- package/lib/base/operations/operation.js +19 -10
- package/lib/base/operations/operation.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +1 -1
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +2 -1
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +4 -2
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.d.ts.map +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js +1 -1
- package/lib/features/command-palette/server-command-palette-provider.js.map +1 -1
- package/lib/features/context-menu/di.config.d.ts +1 -1
- package/lib/features/context-menu/di.config.d.ts.map +1 -1
- package/lib/features/context-menu/di.config.js +1 -1
- package/lib/features/context-menu/di.config.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +2 -3
- 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.d.ts.map +1 -1
- package/lib/features/context-menu/server-context-menu-provider.js +5 -2
- package/lib/features/context-menu/server-context-menu-provider.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts +1 -1
- package/lib/features/copy-paste/copy-paste-actions.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-actions.js +1 -1
- package/lib/features/copy-paste/copy-paste-actions.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-context-menu.js +17 -8
- package/lib/features/copy-paste/copy-paste-context-menu.js.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.d.ts.map +1 -1
- package/lib/features/copy-paste/copy-paste-handler.js +4 -4
- package/lib/features/copy-paste/copy-paste-handler.js.map +1 -1
- package/lib/features/decoration/decoration-placer.d.ts.map +1 -1
- package/lib/features/decoration/decoration-placer.js +1 -1
- package/lib/features/decoration/decoration-placer.js.map +1 -1
- package/lib/features/edit-label/edit-label-validator.d.ts.map +1 -1
- package/lib/features/edit-label/edit-label-validator.js +1 -1
- package/lib/features/edit-label/edit-label-validator.js.map +1 -1
- package/lib/features/hints/model.d.ts +1 -1
- package/lib/features/hints/model.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts +1 -1
- package/lib/features/hints/request-type-hints-action.d.ts.map +1 -1
- package/lib/features/hints/request-type-hints-action.js +4 -2
- package/lib/features/hints/request-type-hints-action.js.map +1 -1
- package/lib/features/hints/type-hints.d.ts +4 -4
- package/lib/features/hints/type-hints.d.ts.map +1 -1
- package/lib/features/hints/type-hints.js +6 -11
- 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 +1 -1
- package/lib/features/hover/hover.js.map +1 -1
- package/lib/features/layout/layout-commands.d.ts +2 -2
- package/lib/features/layout/layout-commands.d.ts.map +1 -1
- package/lib/features/layout/layout-commands.js +9 -8
- package/lib/features/layout/layout-commands.js.map +1 -1
- package/lib/features/layout/layout-commands.spec.d.ts +1 -1
- package/lib/features/layout/layout-commands.spec.js +15 -6
- package/lib/features/layout/layout-commands.spec.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.d.ts.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action-handler.js.map +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.d.ts +1 -1
- package/lib/features/model-source-watcher/model-source-changed-action.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +1 -1
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +13 -13
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.d.ts.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.js +6 -6
- package/lib/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +1 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +1 -1
- package/lib/features/rank/model.d.ts +1 -1
- package/lib/features/rank/model.js +2 -2
- package/lib/features/rank/model.js.map +1 -1
- package/lib/features/reconnect/model.d.ts +1 -1
- package/lib/features/reconnect/model.d.ts.map +1 -1
- package/lib/features/reconnect/model.js +1 -1
- package/lib/features/reconnect/model.js.map +1 -1
- package/lib/features/save/di.config.d.ts +1 -1
- package/lib/features/save/di.config.d.ts.map +1 -1
- package/lib/features/save/di.config.js +1 -1
- package/lib/features/save/di.config.js.map +1 -1
- package/lib/features/save/save.d.ts +1 -1
- package/lib/features/save/save.js +1 -1
- package/lib/features/save/save.js.map +1 -1
- package/lib/features/select/select-feedback-action.d.ts.map +1 -1
- package/lib/features/select/select-feedback-action.js +1 -1
- package/lib/features/select/select-feedback-action.js.map +1 -1
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +11 -6
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +2 -2
- package/lib/features/select/selection-service.spec.js.map +1 -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 +3 -9
- 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 +1 -2
- package/lib/features/tool-feedback/creation-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/css-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/css-feedback.js +2 -1
- package/lib/features/tool-feedback/css-feedback.js.map +1 -1
- package/lib/features/tool-feedback/di.config.d.ts +1 -1
- package/lib/features/tool-feedback/di.config.d.ts.map +1 -1
- package/lib/features/tool-feedback/di.config.js +1 -1
- package/lib/features/tool-feedback/di.config.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 +3 -3
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts +2 -2
- package/lib/features/tool-feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/features/tool-feedback/feedback-action-dispatcher.js +2 -2
- package/lib/features/tool-feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/marquee-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/model.d.ts +1 -1
- package/lib/features/tool-feedback/model.js +1 -1
- package/lib/features/tool-feedback/view.d.ts +3 -3
- package/lib/features/tool-feedback/view.d.ts.map +1 -1
- package/lib/features/tool-feedback/view.js +5 -5
- package/lib/features/tool-feedback/view.js.map +1 -1
- package/lib/features/tool-palette/palette-item.d.ts +1 -1
- package/lib/features/tool-palette/palette-item.d.ts.map +1 -1
- package/lib/features/tool-palette/palette-item.js +3 -2
- package/lib/features/tool-palette/palette-item.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +4 -6
- package/lib/features/tool-palette/tool-palette.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 -7
- package/lib/features/tools/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/delete-tool.d.ts.map +1 -1
- package/lib/features/tools/delete-tool.js +6 -3
- package/lib/features/tools/delete-tool.js.map +1 -1
- package/lib/features/tools/edge-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-creation-tool.js +4 -3
- package/lib/features/tools/edge-creation-tool.js.map +1 -1
- package/lib/features/tools/edge-edit-tool.d.ts.map +1 -1
- package/lib/features/tools/edge-edit-tool.js +2 -6
- package/lib/features/tools/edge-edit-tool.js.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-mouse-tool.js +35 -25
- package/lib/features/tools/marquee-mouse-tool.js.map +1 -1
- package/lib/features/tools/marquee-tool.d.ts.map +1 -1
- package/lib/features/tools/marquee-tool.js.map +1 -1
- package/lib/features/tools/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation-tool.js +3 -3
- package/lib/features/tools/node-creation-tool.js.map +1 -1
- package/lib/features/tools/view.d.ts.map +1 -1
- package/lib/features/tools/view.js +2 -2
- package/lib/features/tools/view.js.map +1 -1
- package/lib/features/undo-redo/model.d.ts +1 -1
- package/lib/features/undo-redo/model.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +11 -4
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +1 -1
- package/lib/features/validation/marker-navigator.spec.js +13 -7
- package/lib/features/validation/marker-navigator.spec.js.map +1 -1
- package/lib/features/validation/validate.d.ts +2 -2
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +4 -4
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.d.ts.map +1 -1
- package/lib/features/viewport/glsp-scroll-mouse-listener.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/argument-utils.d.ts +3 -3
- package/lib/utils/argument-utils.d.ts.map +1 -1
- package/lib/utils/argument-utils.js +1 -3
- package/lib/utils/argument-utils.js.map +1 -1
- package/lib/utils/array-utils.d.ts +1 -1
- package/lib/utils/array-utils.d.ts.map +1 -1
- package/lib/utils/array-utils.js +1 -1
- package/lib/utils/array-utils.js.map +1 -1
- package/lib/utils/layout-utils.d.ts +1 -1
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/utils/smodel-util.d.ts +3 -3
- package/lib/utils/smodel-util.d.ts.map +1 -1
- package/lib/utils/smodel-util.js +5 -6
- package/lib/utils/smodel-util.js.map +1 -1
- package/lib/utils/viewpoint-util.d.ts +1 -1
- package/lib/utils/viewpoint-util.d.ts.map +1 -1
- package/lib/utils/viewpoint-util.js +1 -1
- package/lib/utils/viewpoint-util.js.map +1 -1
- package/lib/views/glsp-edge-view.d.ts.map +1 -1
- package/lib/views/glsp-edge-view.js +3 -3
- package/lib/views/glsp-edge-view.js.map +1 -1
- package/lib/views/issue-marker-view.d.ts.map +1 -1
- package/lib/views/issue-marker-view.js +3 -3
- package/lib/views/issue-marker-view.js.map +1 -1
- package/lib/views/rounded-corner-view.d.ts.map +1 -1
- package/lib/views/rounded-corner-view.js +3 -3
- package/lib/views/rounded-corner-view.js.map +1 -1
- package/lib/views/rounded-corner.d.ts.map +1 -1
- package/lib/views/rounded-corner.js +2 -2
- package/lib/views/rounded-corner.js.map +1 -1
- package/package.json +3 -3
- package/src/base/action-dispatcher.ts +1 -2
- package/src/base/actions/context-actions.ts +6 -6
- package/src/base/actions/edit-mode-action.ts +3 -4
- package/src/base/actions/edit-validation-actions.ts +26 -14
- package/src/base/actions/focus-change-action.ts +1 -1
- package/src/base/args.ts +4 -2
- package/src/base/auto-complete/auto-complete-widget.ts +34 -21
- package/src/base/auto-complete/validation-decorator.ts +5 -5
- package/src/base/command-stack.ts +1 -3
- package/src/base/di.config.ts +11 -16
- package/src/base/drag-aware-mouse-listener.ts +1 -3
- package/src/base/editor-context.ts +2 -4
- package/src/base/focus-tracker.ts +0 -2
- package/src/base/model/update-model-command.ts +4 -5
- package/src/base/operations/operation.ts +54 -27
- package/src/features/change-bounds/model.ts +7 -5
- package/src/features/change-bounds/movement-restrictor.ts +15 -7
- package/src/features/command-palette/server-command-palette-provider.ts +8 -5
- package/src/features/context-menu/di.config.ts +11 -8
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +4 -3
- package/src/features/context-menu/server-context-menu-provider.ts +7 -3
- package/src/features/copy-paste/copy-paste-actions.ts +11 -8
- package/src/features/copy-paste/copy-paste-context-menu.ts +20 -11
- package/src/features/copy-paste/copy-paste-handler.ts +6 -5
- package/src/features/decoration/decoration-placer.ts +2 -13
- package/src/features/edit-label/edit-label-validator.ts +11 -12
- package/src/features/hints/model.ts +2 -2
- package/src/features/hints/request-type-hints-action.ts +10 -5
- package/src/features/hints/type-hints.ts +26 -30
- package/src/features/hover/hover.ts +1 -2
- package/src/features/layout/layout-commands.spec.ts +79 -56
- package/src/features/layout/layout-commands.ts +42 -31
- package/src/features/model-source-watcher/model-source-changed-action-handler.ts +3 -3
- package/src/features/model-source-watcher/model-source-changed-action.ts +2 -2
- package/src/features/mouse-tool/mouse-tool.ts +15 -8
- package/src/features/navigation/navigation-action-handler.ts +32 -22
- package/src/features/navigation/navigation-target-resolver.spec.ts +1 -3
- package/src/features/navigation/navigation-target-resolver.ts +14 -12
- package/src/features/rank/model.ts +2 -2
- package/src/features/reconnect/model.ts +2 -3
- package/src/features/save/di.config.ts +1 -2
- package/src/features/save/save.ts +2 -2
- package/src/features/select/select-feedback-action.ts +4 -6
- package/src/features/select/selection-service.spec.ts +9 -4
- package/src/features/select/selection-service.ts +13 -5
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +5 -12
- package/src/features/tool-feedback/creation-tool-feedback.ts +16 -7
- package/src/features/tool-feedback/css-feedback.ts +4 -3
- package/src/features/tool-feedback/di.config.ts +2 -5
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +17 -14
- package/src/features/tool-feedback/feedback-action-dispatcher.ts +6 -8
- package/src/features/tool-feedback/marquee-tool-feedback.ts +3 -2
- package/src/features/tool-feedback/model.ts +1 -2
- package/src/features/tool-feedback/view.tsx +13 -6
- package/src/features/tool-palette/palette-item.ts +3 -3
- package/src/features/tool-palette/tool-palette.ts +12 -14
- package/src/features/tools/change-bounds-tool.ts +29 -17
- package/src/features/tools/delete-tool.ts +8 -3
- package/src/features/tools/edge-creation-tool.ts +5 -8
- package/src/features/tools/edge-edit-tool.ts +7 -16
- package/src/features/tools/marquee-mouse-tool.ts +57 -37
- package/src/features/tools/marquee-tool.ts +0 -1
- package/src/features/tools/node-creation-tool.ts +4 -9
- package/src/features/tools/view.tsx +14 -8
- package/src/features/undo-redo/model.ts +3 -3
- package/src/features/validation/marker-navigator.spec.ts +15 -9
- package/src/features/validation/marker-navigator.ts +23 -8
- package/src/features/validation/validate.ts +9 -13
- package/src/features/viewport/glsp-scroll-mouse-listener.ts +1 -10
- package/src/index.ts +21 -4
- package/src/utils/argument-utils.ts +13 -9
- package/src/utils/array-utils.ts +4 -2
- package/src/utils/layout-utils.ts +11 -5
- package/src/utils/smodel-util.ts +14 -10
- package/src/utils/viewpoint-util.ts +3 -2
- package/src/views/glsp-edge-view.tsx +17 -8
- package/src/views/issue-marker-view.tsx +8 -8
- package/src/views/rounded-corner-view.tsx +35 -20
- package/src/views/rounded-corner.ts +3 -4
package/src/utils/smodel-util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -27,21 +27,24 @@ import {
|
|
|
27
27
|
SRoutableElement,
|
|
28
28
|
SRoutingHandle
|
|
29
29
|
} from 'sprotty';
|
|
30
|
-
|
|
31
30
|
import { ElementAndRoutingPoints } from '../base/operations/operation';
|
|
32
31
|
|
|
33
32
|
export function getIndex(element: SModelElement): SModelIndex<SModelElement> {
|
|
34
33
|
return element.root.index;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
export function forEachElement<T>(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
export function forEachElement<T>(
|
|
37
|
+
element: SModelElement,
|
|
38
|
+
predicate: (modelElement: SModelElement) => modelElement is SModelElement & T,
|
|
39
|
+
runnable: (modelElement: SModelElement & T) => void
|
|
40
|
+
): void {
|
|
41
|
+
getIndex(element).all().filter(predicate).forEach(runnable);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function getMatchingElements<T>(
|
|
44
|
+
export function getMatchingElements<T>(
|
|
45
|
+
element: SModelElement,
|
|
46
|
+
predicate: (modelElement: SModelElement) => modelElement is SModelElement & T
|
|
47
|
+
): (SModelElement & T)[] {
|
|
45
48
|
const matching: (SModelElement & T)[] = [];
|
|
46
49
|
forEachElement(element, predicate, item => matching.push(item));
|
|
47
50
|
return matching;
|
|
@@ -53,9 +56,10 @@ export function hasSelectedElements(element: SModelElement): boolean {
|
|
|
53
56
|
|
|
54
57
|
export function getSelectedElementCount(element: SModelElement): number {
|
|
55
58
|
let selected = 0;
|
|
56
|
-
getIndex(element)
|
|
59
|
+
getIndex(element)
|
|
60
|
+
.all()
|
|
57
61
|
.filter(isSelected)
|
|
58
|
-
.forEach(e => selected = selected + 1);
|
|
62
|
+
.forEach(e => (selected = selected + 1));
|
|
59
63
|
return selected;
|
|
60
64
|
}
|
|
61
65
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2019-2021 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
|
|
@@ -41,7 +41,8 @@ import {
|
|
|
41
41
|
* A mouseEvent
|
|
42
42
|
*/
|
|
43
43
|
export function getAbsolutePosition(target: SModelElement, mouseEvent: MouseEvent): Point {
|
|
44
|
-
let xPos = mouseEvent.pageX;
|
|
44
|
+
let xPos = mouseEvent.pageX;
|
|
45
|
+
let yPos = mouseEvent.pageY;
|
|
45
46
|
const canvasBounds = target.root.canvasBounds;
|
|
46
47
|
xPos -= canvasBounds.x;
|
|
47
48
|
yPos -= canvasBounds.y;
|
|
@@ -31,11 +31,13 @@ export class GEdgeView extends PolylineEdgeView {
|
|
|
31
31
|
return this.renderDanglingEdge('Cannot compute route', edge, context);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
return
|
|
35
|
-
{this.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
return (
|
|
35
|
+
<g class-sprotty-edge={true} class-mouseover={edge.hoverFeedback} {...this.addtionalClasses(edge, context)}>
|
|
36
|
+
{this.renderLine(edge, route, context)}
|
|
37
|
+
{this.renderAdditionals(edge, route, context)}
|
|
38
|
+
{context.renderChildren(edge, { route })}
|
|
39
|
+
</g>
|
|
40
|
+
);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
protected addtionalClasses(_edge: Readonly<SEdge>, _context: RenderingContext): Classes {
|
|
@@ -53,8 +55,16 @@ export class GEdgeView extends PolylineEdgeView {
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
protected renderMouseHandle(segments: Point[], padding: number): VNode {
|
|
56
|
-
return
|
|
57
|
-
|
|
58
|
+
return (
|
|
59
|
+
<path
|
|
60
|
+
class-mouse-handle
|
|
61
|
+
d={this.createPathForSegments(segments)}
|
|
62
|
+
style-stroke-width={padding * 2}
|
|
63
|
+
style-stroke='transparent'
|
|
64
|
+
style-stroke-dasharray='none'
|
|
65
|
+
style-stroke-dashoffset='0'
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
58
68
|
}
|
|
59
69
|
|
|
60
70
|
protected createPathForSegments(segments: Point[]): string {
|
|
@@ -66,5 +76,4 @@ export class GEdgeView extends PolylineEdgeView {
|
|
|
66
76
|
}
|
|
67
77
|
return path;
|
|
68
78
|
}
|
|
69
|
-
|
|
70
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2020-2021 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
|
|
@@ -23,15 +23,16 @@ const JSX = { createElement: svg };
|
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
25
|
export class GIssueMarkerView extends IssueMarkerView {
|
|
26
|
-
|
|
27
26
|
render(marker: SIssueMarker, _context: RenderingContext): VNode {
|
|
28
27
|
const maxSeverity = super.getMaxSeverity(marker);
|
|
29
|
-
const group =
|
|
30
|
-
<g>
|
|
31
|
-
<
|
|
32
|
-
|
|
28
|
+
const group = (
|
|
29
|
+
<g class-sprotty-issue={true}>
|
|
30
|
+
<g>
|
|
31
|
+
<circle class-sprotty-issue-background={true} r={this.radius} cx={this.radius} cy={this.radius} />
|
|
32
|
+
<path d={this.getGlspIssueMarkerPath(maxSeverity)} />
|
|
33
|
+
</g>
|
|
33
34
|
</g>
|
|
34
|
-
|
|
35
|
+
);
|
|
35
36
|
setClass(group, 'sprotty-' + maxSeverity, true);
|
|
36
37
|
return group;
|
|
37
38
|
}
|
|
@@ -51,5 +52,4 @@ export class GIssueMarkerView extends IssueMarkerView {
|
|
|
51
52
|
return 'M 8.0000004,0 C 3.5820324,0 0,3.58332 0,8 0,12.41926 3.5820324,16 8.0000004,16 12.417968,16 16,12.41926 16,8 16,3.58332 12.417968,0 8.0000004,0 Z m 0,3.54839 c 0.748258,0 1.354839,0.60658 1.354839,1.35484 0,0.74825 -0.606581,1.35483 -1.354839,1.35483 -0.748258,0 -1.354839,-0.60658 -1.354839,-1.35483 0,-0.74826 0.606581,-1.35484 1.354839,-1.35484 z m 1.806452,8.19355 c 0,0.21377 -0.173323,0.38709 -0.387097,0.38709 h -2.83871 c -0.213774,0 -0.387097,-0.17332 -0.387097,-0.38709 v -0.7742 c 0,-0.21377 0.173323,-0.38709 0.387097,-0.38709 h 0.387097 V 8.51613 h -0.387097 c -0.213774,0 -0.387097,-0.17332 -0.387097,-0.3871 V 7.35484 c 0,-0.21378 0.173323,-0.3871 0.387097,-0.3871 h 2.064516 c 0.213774,0 0.387097,0.17332 0.387097,0.3871 v 3.22581 h 0.387097 c 0.213774,0 0.387097,0.17332 0.387097,0.38709 z';
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
|
-
|
|
55
55
|
}
|
|
@@ -32,15 +32,17 @@ export class RoundedCornerNodeView extends RectangularNodeView {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const wrapper = new RoundedCornerWrapper(node, cornerRadius);
|
|
35
|
-
return
|
|
36
|
-
<
|
|
37
|
-
<
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
return (
|
|
36
|
+
<g class-node={true}>
|
|
37
|
+
<defs>
|
|
38
|
+
<clipPath id={toClipPathId(node)}>
|
|
39
|
+
<path d={this.renderPath(wrapper, context, this.getClipPathInsets() || 0)}></path>
|
|
40
|
+
</clipPath>
|
|
41
|
+
</defs>
|
|
42
|
+
{this.renderPathNode(wrapper, context)}
|
|
43
|
+
{context.renderChildren(node)}
|
|
44
|
+
</g>
|
|
45
|
+
);
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
protected renderWithoutRadius(node: Readonly<SShapeElement & Hoverable & Selectable>, context: RenderingContext): VNode | undefined {
|
|
@@ -52,12 +54,16 @@ export class RoundedCornerNodeView extends RectangularNodeView {
|
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
protected renderPathNode(wrapper: Readonly<RoundedCornerWrapper>, context: RenderingContext): VNode {
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
return (
|
|
58
|
+
<path
|
|
59
|
+
d={this.renderPath(wrapper, context, 0)}
|
|
60
|
+
class-sprotty-node={wrapper.element instanceof SNode}
|
|
61
|
+
class-sprotty-port={wrapper.element instanceof SPort}
|
|
62
|
+
class-mouseover={wrapper.element.hoverFeedback}
|
|
63
|
+
class-selected={wrapper.element.selected}
|
|
64
|
+
{...this.additionalClasses(wrapper.element, context)}
|
|
65
|
+
/>
|
|
66
|
+
);
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
protected additionalClasses(_node: Readonly<SShapeElement & Hoverable & Selectable>, _context: RenderingContext): Classes {
|
|
@@ -70,14 +76,23 @@ export class RoundedCornerNodeView extends RectangularNodeView {
|
|
|
70
76
|
const rightLineLength = Math.max(0, wrapper.size.height - wrapper.cornerRadius.topRight - wrapper.cornerRadius.bottomRight);
|
|
71
77
|
const bottomLineLength = Math.max(0, wrapper.size.width - wrapper.cornerRadius.bottomLeft - wrapper.cornerRadius.bottomRight);
|
|
72
78
|
|
|
73
|
-
const path =
|
|
74
|
-
`
|
|
79
|
+
const path =
|
|
80
|
+
`M${0 + inset},${0 + wrapper.topLeftCorner.radiusY}` +
|
|
81
|
+
`q${0},${-(wrapper.topLeftCorner.radiusY - inset)} ${wrapper.topLeftCorner.radiusX - inset},${-(
|
|
82
|
+
wrapper.topLeftCorner.radiusY - inset
|
|
83
|
+
)}` +
|
|
75
84
|
`h${topLineLength}` +
|
|
76
|
-
`q${wrapper.topRightCorner.radiusX - inset},0 ${wrapper.topRightCorner.radiusX - inset},${
|
|
85
|
+
`q${wrapper.topRightCorner.radiusX - inset},0 ${wrapper.topRightCorner.radiusX - inset},${
|
|
86
|
+
wrapper.topRightCorner.radiusY - inset
|
|
87
|
+
}` +
|
|
77
88
|
`v${rightLineLength}` +
|
|
78
|
-
`q0,${wrapper.bottomRightCorner.radiusY - inset} ${-(wrapper.bottomRightCorner.radiusX - inset)},${
|
|
89
|
+
`q0,${wrapper.bottomRightCorner.radiusY - inset} ${-(wrapper.bottomRightCorner.radiusX - inset)},${
|
|
90
|
+
wrapper.bottomRightCorner.radiusY - inset
|
|
91
|
+
}` +
|
|
79
92
|
`h${-bottomLineLength}` +
|
|
80
|
-
`q${-(wrapper.bottomLeftCorner.radiusX - inset)},0 ${-(wrapper.bottomLeftCorner.radiusX - inset)},${-(
|
|
93
|
+
`q${-(wrapper.bottomLeftCorner.radiusX - inset)},0 ${-(wrapper.bottomLeftCorner.radiusX - inset)},${-(
|
|
94
|
+
wrapper.bottomLeftCorner.radiusY - inset
|
|
95
|
+
)}` +
|
|
81
96
|
'z ';
|
|
82
97
|
return path;
|
|
83
98
|
}
|
|
@@ -28,8 +28,7 @@ export class RoundedCornerWrapper {
|
|
|
28
28
|
protected _bottomRightCorner: RoundedCorner;
|
|
29
29
|
protected _bottomLeftCorner: RoundedCorner;
|
|
30
30
|
|
|
31
|
-
constructor(public readonly element: SShapeElement & Hoverable & Selectable, public readonly cornerRadius: CornerRadius) {
|
|
32
|
-
}
|
|
31
|
+
constructor(public readonly element: SShapeElement & Hoverable & Selectable, public readonly cornerRadius: CornerRadius) {}
|
|
33
32
|
|
|
34
33
|
get size(): Dimension {
|
|
35
34
|
return this.element.size;
|
|
@@ -77,8 +76,8 @@ export class RoundedCornerWrapper {
|
|
|
77
76
|
}
|
|
78
77
|
|
|
79
78
|
/*
|
|
80
|
-
* Scales the radius if necessary. (Percentual downscaling if the radius is bigger then the maximal allowed length)
|
|
81
|
-
*/
|
|
79
|
+
* Scales the radius if necessary. (Percentual downscaling if the radius is bigger then the maximal allowed length)
|
|
80
|
+
*/
|
|
82
81
|
export function scaledRadius(radius: number, maximalLength: number): number {
|
|
83
82
|
if (radius <= maximalLength) {
|
|
84
83
|
return radius;
|