@eclipse-glsp/client 2.2.0-next.368 → 2.2.0-next.369
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/features/accessibility/view-key-tools/deselect-key-tool.d.ts +3 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +7 -7
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
- package/package.json +3 -3
- package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +6 -19
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { Action, GModelElement, KeyListener, KeyTool } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { Tool } from '../../../base/tool-manager/tool';
|
|
18
|
+
import { IToolManager } from '../../../base/tool-manager/tool-manager';
|
|
18
19
|
/**
|
|
19
|
-
* Deselects
|
|
20
|
+
* Deselects currently selected elements on Escape if the default tools are currently active.
|
|
20
21
|
*/
|
|
21
22
|
export declare class DeselectKeyTool implements Tool {
|
|
22
23
|
static ID: string;
|
|
23
24
|
isEditTool: boolean;
|
|
24
25
|
protected readonly deselectKeyListener: DeselectKeyListener;
|
|
25
26
|
protected readonly keytool: KeyTool;
|
|
27
|
+
protected toolManager: IToolManager;
|
|
26
28
|
get id(): string;
|
|
27
29
|
enable(): void;
|
|
28
30
|
disable(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deselect-key-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/deselect-key-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,
|
|
1
|
+
{"version":3,"file":"deselect-key-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/deselect-key-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,aAAa,EAAoB,WAAW,EAAE,OAAO,EAAqC,MAAM,uBAAuB,CAAC;AAIzI,OAAO,EAAE,IAAI,EAAE,MAAM,iCAAiC,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE;;GAEG;AACH,qBACa,eAAgB,YAAW,IAAI;IACxC,MAAM,CAAC,EAAE,SAA4B;IAErC,UAAU,UAAQ;IAElB,SAAS,CAAC,QAAQ,CAAC,mBAAmB,sBAA6B;IAElD,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC;IAEhE,IAAI,EAAE,IAAI,MAAM,CAEf;IAED,MAAM,IAAI,IAAI;IAId,OAAO,IAAI,IAAI;CAGlB;AAED,qBAAa,mBAAoB,SAAQ,WAAW;IACvC,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE;IAmBvE,SAAS,CAAC,wBAAwB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;CAGpE"}
|
|
@@ -30,9 +30,9 @@ const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
|
30
30
|
const inversify_1 = require("inversify");
|
|
31
31
|
const iterable_1 = require("sprotty/lib/utils/iterable");
|
|
32
32
|
const keyboard_1 = require("sprotty/lib/utils/keyboard");
|
|
33
|
-
const
|
|
33
|
+
const edge_edit_tool_feedback_1 = require("../../tools/edge-edit/edge-edit-tool-feedback");
|
|
34
34
|
/**
|
|
35
|
-
* Deselects
|
|
35
|
+
* Deselects currently selected elements on Escape if the default tools are currently active.
|
|
36
36
|
*/
|
|
37
37
|
let DeselectKeyTool = DeselectKeyTool_1 = class DeselectKeyTool {
|
|
38
38
|
constructor() {
|
|
@@ -55,16 +55,16 @@ __decorate([
|
|
|
55
55
|
(0, inversify_1.inject)(sprotty_1.KeyTool),
|
|
56
56
|
__metadata("design:type", sprotty_1.KeyTool)
|
|
57
57
|
], DeselectKeyTool.prototype, "keytool", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, inversify_1.inject)(sprotty_1.TYPES.IToolManager),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], DeselectKeyTool.prototype, "toolManager", void 0);
|
|
58
62
|
exports.DeselectKeyTool = DeselectKeyTool = DeselectKeyTool_1 = __decorate([
|
|
59
63
|
(0, inversify_1.injectable)()
|
|
60
64
|
], DeselectKeyTool);
|
|
61
65
|
class DeselectKeyListener extends sprotty_1.KeyListener {
|
|
62
66
|
keyDown(target, event) {
|
|
63
67
|
if (this.matchesDeselectKeystroke(event)) {
|
|
64
|
-
const isResizeHandleActive = (0, iterable_1.toArray)(target.root.index.all().filter(el => el instanceof model_1.GResizeHandle)).length > 0;
|
|
65
|
-
if (isResizeHandleActive) {
|
|
66
|
-
return [];
|
|
67
|
-
}
|
|
68
68
|
const deselect = (0, iterable_1.toArray)(target.root.index.all().filter(element => (0, sprotty_1.isSelectable)(element) && element.selected));
|
|
69
69
|
const actions = [];
|
|
70
70
|
if (deselect.length > 0) {
|
|
@@ -72,7 +72,7 @@ class DeselectKeyListener extends sprotty_1.KeyListener {
|
|
|
72
72
|
}
|
|
73
73
|
const routableDeselect = deselect.filter(e => e instanceof sprotty_1.GRoutableElement).map(e => e.id);
|
|
74
74
|
if (routableDeselect.length > 0) {
|
|
75
|
-
actions.push(
|
|
75
|
+
actions.push(edge_edit_tool_feedback_1.SwitchRoutingModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
76
76
|
}
|
|
77
77
|
return actions;
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deselect-key-tool.js","sourceRoot":"","sources":["../../../../src/features/accessibility/view-key-tools/deselect-key-tool.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"deselect-key-tool.js","sourceRoot":"","sources":["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AAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,sBAAY,CAAC,MAAM,CAAC,EAAE,qBAAqB,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC1F,CAAC;YAED,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,0BAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5F,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9B,OAAO,CAAC,IAAI,CAAC,iDAAuB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;YAC7F,CAAC;YAED,OAAO,OAAO,CAAC;QACnB,CAAC;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,wBAAwB,CAAC,KAAoB;QACnD,OAAO,IAAA,2BAAgB,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;CACJ;AAvBD,kDAuBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.2.0-next.
|
|
3
|
+
"version": "2.2.0-next.369+9b95d68",
|
|
4
4
|
"description": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"watch": "tsc -w"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@eclipse-glsp/sprotty": "2.2.0-next.
|
|
49
|
+
"@eclipse-glsp/sprotty": "2.2.0-next.369+9b95d68",
|
|
50
50
|
"autocompleter": "^9.1.2",
|
|
51
51
|
"file-saver": "^2.0.5",
|
|
52
52
|
"lodash": "4.17.21",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "9b95d6897bc8fede34e27bc3cc52f4da7cbd2577"
|
|
67
67
|
}
|
|
@@ -14,24 +14,16 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
Action,
|
|
19
|
-
GModelElement,
|
|
20
|
-
GRoutableElement,
|
|
21
|
-
KeyListener,
|
|
22
|
-
KeyTool,
|
|
23
|
-
SelectAction,
|
|
24
|
-
SwitchEditModeAction,
|
|
25
|
-
isSelectable
|
|
26
|
-
} from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { Action, GModelElement, GRoutableElement, KeyListener, KeyTool, SelectAction, TYPES, isSelectable } from '@eclipse-glsp/sprotty';
|
|
27
18
|
import { inject, injectable } from 'inversify';
|
|
28
19
|
import { toArray } from 'sprotty/lib/utils/iterable';
|
|
29
20
|
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
30
21
|
import { Tool } from '../../../base/tool-manager/tool';
|
|
31
|
-
import {
|
|
22
|
+
import { IToolManager } from '../../../base/tool-manager/tool-manager';
|
|
23
|
+
import { SwitchRoutingModeAction } from '../../tools/edge-edit/edge-edit-tool-feedback';
|
|
32
24
|
|
|
33
25
|
/**
|
|
34
|
-
* Deselects
|
|
26
|
+
* Deselects currently selected elements on Escape if the default tools are currently active.
|
|
35
27
|
*/
|
|
36
28
|
@injectable()
|
|
37
29
|
export class DeselectKeyTool implements Tool {
|
|
@@ -42,6 +34,7 @@ export class DeselectKeyTool implements Tool {
|
|
|
42
34
|
protected readonly deselectKeyListener = new DeselectKeyListener();
|
|
43
35
|
|
|
44
36
|
@inject(KeyTool) protected readonly keytool: KeyTool;
|
|
37
|
+
@inject(TYPES.IToolManager) protected toolManager: IToolManager;
|
|
45
38
|
|
|
46
39
|
get id(): string {
|
|
47
40
|
return DeselectKeyTool.ID;
|
|
@@ -59,12 +52,6 @@ export class DeselectKeyTool implements Tool {
|
|
|
59
52
|
export class DeselectKeyListener extends KeyListener {
|
|
60
53
|
override keyDown(target: GModelElement, event: KeyboardEvent): Action[] {
|
|
61
54
|
if (this.matchesDeselectKeystroke(event)) {
|
|
62
|
-
const isResizeHandleActive = toArray(target.root.index.all().filter(el => el instanceof GResizeHandle)).length > 0;
|
|
63
|
-
|
|
64
|
-
if (isResizeHandleActive) {
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
|
|
68
55
|
const deselect = toArray(target.root.index.all().filter(element => isSelectable(element) && element.selected));
|
|
69
56
|
const actions: Action[] = [];
|
|
70
57
|
|
|
@@ -74,7 +61,7 @@ export class DeselectKeyListener extends KeyListener {
|
|
|
74
61
|
|
|
75
62
|
const routableDeselect = deselect.filter(e => e instanceof GRoutableElement).map(e => e.id);
|
|
76
63
|
if (routableDeselect.length > 0) {
|
|
77
|
-
actions.push(
|
|
64
|
+
actions.push(SwitchRoutingModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
78
65
|
}
|
|
79
66
|
|
|
80
67
|
return actions;
|