@eclipse-glsp/client 2.2.0-next.344 → 2.2.0-next.346
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/model/model-registry.d.ts.map +1 -1
- package/lib/base/model/model-registry.js +3 -1
- package/lib/base/model/model-registry.js.map +1 -1
- package/lib/features/accessibility/accessibility-module.d.ts +1 -1
- package/lib/features/accessibility/accessibility-module.js +3 -3
- package/lib/features/accessibility/accessibility-module.js.map +1 -1
- package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts +6 -4
- package/lib/features/accessibility/element-navigation/element-navigation-module.d.ts.map +1 -1
- package/lib/features/accessibility/element-navigation/element-navigation-module.js +8 -8
- package/lib/features/accessibility/element-navigation/element-navigation-module.js.map +1 -1
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts +6 -4
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.d.ts.map +1 -1
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.js +6 -6
- package/lib/features/accessibility/focus-tracker/focus-tracker-module.js.map +1 -1
- package/lib/features/accessibility/key-shortcut/{di.config.d.ts → shortcut-help-module.d.ts} +7 -5
- package/lib/features/accessibility/key-shortcut/shortcut-help-module.d.ts.map +1 -0
- package/lib/features/accessibility/key-shortcut/{di.config.js → shortcut-help-module.js} +6 -6
- package/lib/features/accessibility/key-shortcut/shortcut-help-module.js.map +1 -0
- package/lib/features/accessibility/toast/toast-module.d.ts +6 -4
- package/lib/features/accessibility/toast/toast-module.d.ts.map +1 -1
- package/lib/features/accessibility/toast/toast-module.js +5 -5
- package/lib/features/accessibility/toast/toast-module.js.map +1 -1
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts +2 -2
- 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 +3 -3
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -1
- package/lib/features/change-bounds/model.d.ts +7 -4
- package/lib/features/change-bounds/model.d.ts.map +1 -1
- package/lib/features/change-bounds/model.js +12 -11
- package/lib/features/change-bounds/model.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +2 -2
- package/lib/features/helper-lines/helper-line-manager-default.js +1 -1
- package/lib/features/select/select-mouse-listener.js +1 -1
- package/lib/features/tools/change-bounds/change-bounds-manager.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-manager.js +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-module.js +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +2 -2
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +3 -3
- package/lib/features/tools/change-bounds/change-bounds-tool.js +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts +6 -6
- package/lib/features/tools/change-bounds/change-bounds-tracker.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tracker.js +2 -2
- package/lib/features/tools/change-bounds/view.d.ts +8 -5
- package/lib/features/tools/change-bounds/view.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/view.js +8 -7
- package/lib/features/tools/change-bounds/view.js.map +1 -1
- package/lib/features/undo-redo/undo-redo-module.d.ts +3 -3
- package/lib/features/undo-redo/undo-redo-module.d.ts.map +1 -1
- package/lib/features/undo-redo/undo-redo-module.js +3 -4
- package/lib/features/undo-redo/undo-redo-module.js.map +1 -1
- package/lib/features/validation/issue-marker.d.ts +2 -2
- package/lib/features/validation/issue-marker.d.ts.map +1 -1
- package/lib/features/validation/issue-marker.js +5 -3
- package/lib/features/validation/issue-marker.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/standalone-modules.d.ts +1 -1
- package/lib/standalone-modules.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/base/model/model-registry.ts +5 -1
- package/src/features/accessibility/accessibility-module.ts +2 -2
- package/src/features/accessibility/element-navigation/element-navigation-module.ts +17 -10
- package/src/features/accessibility/focus-tracker/focus-tracker-module.ts +14 -7
- package/src/features/accessibility/key-shortcut/{di.config.ts → shortcut-help-module.ts} +14 -7
- package/src/features/accessibility/toast/toast-module.ts +14 -7
- package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +8 -8
- package/src/features/change-bounds/model.ts +17 -12
- package/src/features/change-bounds/movement-restrictor.ts +3 -3
- package/src/features/helper-lines/helper-line-manager-default.ts +2 -2
- package/src/features/select/select-mouse-listener.ts +2 -2
- package/src/features/tools/change-bounds/change-bounds-manager.ts +2 -2
- package/src/features/tools/change-bounds/change-bounds-tool-module.ts +3 -3
- package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +3 -3
- package/src/features/tools/change-bounds/change-bounds-tool.ts +4 -4
- package/src/features/tools/change-bounds/change-bounds-tracker.ts +6 -6
- package/src/features/tools/change-bounds/view.tsx +11 -6
- package/src/features/undo-redo/undo-redo-module.ts +8 -6
- package/src/features/validation/issue-marker.ts +6 -5
- package/src/index.ts +1 -1
- package/lib/features/accessibility/key-shortcut/di.config.d.ts.map +0 -1
- package/lib/features/accessibility/key-shortcut/di.config.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) 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
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import { bindAsService, BindingContext, configureActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { bindAsService, BindingContext, configureActionHandler, FeatureModule, TYPES } from '@eclipse-glsp/sprotty';
|
|
19
18
|
import '../../../../css/key-shortcut.css';
|
|
20
19
|
import { KeyShortcutUIExtension, SetAccessibleKeyShortcutAction } from './accessible-key-shortcut';
|
|
21
20
|
import { AccessibleKeyShortcutTool } from './accessible-key-shortcut-tool';
|
|
@@ -23,13 +22,21 @@ import { AccessibleKeyShortcutTool } from './accessible-key-shortcut-tool';
|
|
|
23
22
|
/**
|
|
24
23
|
* Handles actions for displaying help/information about keyboard shortcuts.
|
|
25
24
|
*/
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export const shortcutHelpModule = new FeatureModule(
|
|
26
|
+
(bind, unbind, isBound, rebind) => {
|
|
27
|
+
const context = { bind, unbind, isBound, rebind };
|
|
28
|
+
configureShortcutHelpTool(context);
|
|
29
|
+
},
|
|
30
|
+
{ featureId: Symbol('shortcutHelp') }
|
|
31
|
+
);
|
|
30
32
|
|
|
31
33
|
export function configureShortcutHelpTool(context: BindingContext): void {
|
|
32
34
|
bindAsService(context, TYPES.IDefaultTool, AccessibleKeyShortcutTool);
|
|
33
35
|
bindAsService(context, TYPES.IUIExtension, KeyShortcutUIExtension);
|
|
34
36
|
configureActionHandler(context, SetAccessibleKeyShortcutAction.KIND, KeyShortcutUIExtension);
|
|
35
37
|
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
/** Deprecated use {@link shortcutHelpModule} instead */
|
|
41
|
+
shortcutHelpModule as glspShortcutHelpModule
|
|
42
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
17
|
-
import { bindAsService, BindingContext, configureActionHandler, TYPES } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { bindAsService, BindingContext, configureActionHandler, FeatureModule, TYPES } from '@eclipse-glsp/sprotty';
|
|
18
17
|
import '../../../../css/toast.css';
|
|
19
18
|
import { HideToastAction, ShowToastMessageAction } from './toast-handler';
|
|
20
19
|
import { Toast } from './toast-tool';
|
|
@@ -23,10 +22,13 @@ import { Toast } from './toast-tool';
|
|
|
23
22
|
* Handles toast/user notification actions.
|
|
24
23
|
*/
|
|
25
24
|
|
|
26
|
-
export const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export const toastModule = new FeatureModule(
|
|
26
|
+
(bind, unbind, isBound, rebind) => {
|
|
27
|
+
const context = { bind, unbind, isBound, rebind };
|
|
28
|
+
configureToastTool(context);
|
|
29
|
+
},
|
|
30
|
+
{ featureId: Symbol('toast') }
|
|
31
|
+
);
|
|
30
32
|
|
|
31
33
|
export function configureToastTool(context: BindingContext): void {
|
|
32
34
|
bindAsService(context, TYPES.IUIExtension, Toast);
|
|
@@ -34,3 +36,8 @@ export function configureToastTool(context: BindingContext): void {
|
|
|
34
36
|
configureActionHandler(context, ShowToastMessageAction.KIND, Toast);
|
|
35
37
|
configureActionHandler(context, HideToastAction.KIND, Toast);
|
|
36
38
|
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
/** Deprecated use {@link toastModule} instead */
|
|
42
|
+
toastModule as glspToastModule
|
|
43
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) 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
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { inject, injectable } from 'inversify';
|
|
18
|
-
import { toArray } from 'sprotty/lib/utils/iterable';
|
|
19
|
-
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
20
17
|
import {
|
|
21
18
|
Action,
|
|
22
|
-
KeyListener,
|
|
23
|
-
KeyTool,
|
|
24
19
|
GModelElement,
|
|
25
20
|
GRoutableElement,
|
|
21
|
+
KeyListener,
|
|
22
|
+
KeyTool,
|
|
26
23
|
SelectAction,
|
|
27
24
|
SwitchEditModeAction,
|
|
28
25
|
isSelectable
|
|
29
26
|
} from '@eclipse-glsp/sprotty';
|
|
27
|
+
import { inject, injectable } from 'inversify';
|
|
28
|
+
import { toArray } from 'sprotty/lib/utils/iterable';
|
|
29
|
+
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
|
|
30
30
|
import { Tool } from '../../../base/tool-manager/tool';
|
|
31
|
-
import {
|
|
31
|
+
import { GResizeHandle } from '../../change-bounds/model';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Deselects the element if there is no interaction possible with element.
|
|
@@ -59,7 +59,7 @@ export class DeselectKeyTool implements Tool {
|
|
|
59
59
|
export class DeselectKeyListener extends KeyListener {
|
|
60
60
|
override keyDown(target: GModelElement, event: KeyboardEvent): Action[] {
|
|
61
61
|
if (this.matchesDeselectKeystroke(event)) {
|
|
62
|
-
const isResizeHandleActive = toArray(target.root.index.all().filter(el => el instanceof
|
|
62
|
+
const isResizeHandleActive = toArray(target.root.index.all().filter(el => el instanceof GResizeHandle)).length > 0;
|
|
63
63
|
|
|
64
64
|
if (isResizeHandleActive) {
|
|
65
65
|
return [];
|
|
@@ -109,14 +109,14 @@ export function isBoundsAwareMoveable(element: GModelElement): element is Bounds
|
|
|
109
109
|
return isMoveable(element) && isBoundsAware(element);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export class
|
|
112
|
+
export class GResizeHandle extends GChildElement implements Hoverable {
|
|
113
113
|
static readonly TYPE = 'resize-handle';
|
|
114
114
|
|
|
115
115
|
override readonly parent: ResizableModelElement;
|
|
116
116
|
|
|
117
117
|
constructor(
|
|
118
118
|
readonly location: ResizeHandleLocation,
|
|
119
|
-
override readonly type: string =
|
|
119
|
+
override readonly type: string = GResizeHandle.TYPE,
|
|
120
120
|
readonly hoverFeedback: boolean = false
|
|
121
121
|
) {
|
|
122
122
|
super();
|
|
@@ -166,12 +166,12 @@ export class SResizeHandle extends GChildElement implements Hoverable {
|
|
|
166
166
|
return this.isNeResize() || this.isSwResize();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
static getHandlePosition(handle:
|
|
169
|
+
static getHandlePosition(handle: GResizeHandle): Point;
|
|
170
170
|
static getHandlePosition(parent: ResizableModelElement, location: ResizeHandleLocation): Point;
|
|
171
171
|
static getHandlePosition(bounds: Bounds, location: ResizeHandleLocation): Point;
|
|
172
|
-
static getHandlePosition(first: ResizableModelElement |
|
|
173
|
-
const bounds =
|
|
174
|
-
const location =
|
|
172
|
+
static getHandlePosition(first: ResizableModelElement | GResizeHandle | Bounds, second?: ResizeHandleLocation): Point {
|
|
173
|
+
const bounds = GResizeHandle.is(first) ? first.parent.bounds : first instanceof GModelElement ? first.bounds : first;
|
|
174
|
+
const location = GResizeHandle.is(first) ? first.location : second!;
|
|
175
175
|
switch (location) {
|
|
176
176
|
case ResizeHandleLocation.TopLeft:
|
|
177
177
|
return Bounds.topLeft(bounds);
|
|
@@ -192,7 +192,7 @@ export class SResizeHandle extends GChildElement implements Hoverable {
|
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
static getCursorCss(handle:
|
|
195
|
+
static getCursorCss(handle: GResizeHandle): string {
|
|
196
196
|
switch (handle.location) {
|
|
197
197
|
case ResizeHandleLocation.TopLeft:
|
|
198
198
|
return CursorCSS.RESIZE_NW;
|
|
@@ -213,17 +213,17 @@ export class SResizeHandle extends GChildElement implements Hoverable {
|
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
static is(handle: unknown): handle is
|
|
217
|
-
return typeof handle === 'object' && !!handle && 'type' in handle && handle.type ===
|
|
216
|
+
static is(handle: unknown): handle is GResizeHandle {
|
|
217
|
+
return typeof handle === 'object' && !!handle && 'type' in handle && handle.type === GResizeHandle.TYPE;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
export function addResizeHandles(element: ResizableModelElement, locations: ResizeHandleLocation[] = ResizeHandleLocation.CORNERS): void {
|
|
222
222
|
for (const location of ResizeHandleLocation.ALL) {
|
|
223
|
-
const existing = element.children.find(child => child instanceof
|
|
223
|
+
const existing = element.children.find(child => child instanceof GResizeHandle && child.location === location);
|
|
224
224
|
if (locations.includes(location) && !existing) {
|
|
225
225
|
// add missing handle
|
|
226
|
-
element.add(new
|
|
226
|
+
element.add(new GResizeHandle(location));
|
|
227
227
|
} else if (!locations.includes(location) && existing) {
|
|
228
228
|
// remove existing handle
|
|
229
229
|
element.remove(existing);
|
|
@@ -232,5 +232,10 @@ export function addResizeHandles(element: ResizableModelElement, locations: Resi
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
export function removeResizeHandles(element: GParentElement): void {
|
|
235
|
-
element.removeAll(child => child instanceof
|
|
235
|
+
element.removeAll(child => child instanceof GResizeHandle);
|
|
236
236
|
}
|
|
237
|
+
|
|
238
|
+
export {
|
|
239
|
+
/** @deprecated Use {@link GResizeHandle} instead */
|
|
240
|
+
GResizeHandle as SResizeHandle
|
|
241
|
+
};
|
|
@@ -18,7 +18,7 @@ import { injectable } from 'inversify';
|
|
|
18
18
|
import { ModifyCSSFeedbackAction } from '../../base/feedback/css-feedback';
|
|
19
19
|
import { BoundsAwareModelElement } from '../../utils/gmodel-util';
|
|
20
20
|
import { toAbsoluteBounds } from '../../utils/viewpoint-util';
|
|
21
|
-
import {
|
|
21
|
+
import { GResizeHandle } from './model';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* A `MovementRestrictor` is an optional service that can be used by tools to validate
|
|
@@ -86,7 +86,7 @@ export function createMovementRestrictionFeedback(
|
|
|
86
86
|
): ModifyCSSFeedbackAction {
|
|
87
87
|
const elements: GModelElement[] = [element];
|
|
88
88
|
if (element instanceof GParentElement) {
|
|
89
|
-
element.children.filter(child => child instanceof
|
|
89
|
+
element.children.filter(child => child instanceof GResizeHandle).forEach(e => elements.push(e));
|
|
90
90
|
}
|
|
91
91
|
return ModifyCSSFeedbackAction.create({ elements, add: movementRestrictor.cssClasses });
|
|
92
92
|
}
|
|
@@ -103,7 +103,7 @@ export function removeMovementRestrictionFeedback(
|
|
|
103
103
|
): ModifyCSSFeedbackAction {
|
|
104
104
|
const elements: GModelElement[] = [element];
|
|
105
105
|
if (element instanceof GParentElement) {
|
|
106
|
-
element.children.filter(child => child instanceof
|
|
106
|
+
element.children.filter(child => child instanceof GResizeHandle).forEach(e => elements.push(e));
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
return ModifyCSSFeedbackAction.create({ elements, remove: movementRestrictor.cssClasses });
|
|
@@ -30,7 +30,7 @@ import { IFeedbackActionDispatcher } from '../../base/feedback/feedback-action-d
|
|
|
30
30
|
import { FeedbackEmitter } from '../../base/feedback/feedback-emitter';
|
|
31
31
|
import { ISelectionListener, SelectionService } from '../../base/selection-service';
|
|
32
32
|
import { SetBoundsFeedbackAction } from '../bounds/set-bounds-feedback-command';
|
|
33
|
-
import {
|
|
33
|
+
import { GResizeHandle, ResizeHandleLocation } from '../change-bounds/model';
|
|
34
34
|
import { Grid } from '../grid/grid';
|
|
35
35
|
import { MoveFinishedEventAction, MoveInitializedEventAction } from '../tools/change-bounds/change-bounds-tool-feedback';
|
|
36
36
|
import {
|
|
@@ -182,7 +182,7 @@ export class HelperLineManager implements IActionHandler, ISelectionListener, IH
|
|
|
182
182
|
|
|
183
183
|
const minimum: Writable<Vector> = { ...Vector.ZERO };
|
|
184
184
|
const resize =
|
|
185
|
-
element instanceof
|
|
185
|
+
element instanceof GResizeHandle
|
|
186
186
|
? ResizeHandleLocation.direction(element.location)
|
|
187
187
|
: [Direction.Left, Direction.Right, Direction.Up, Direction.Down];
|
|
188
188
|
|
|
@@ -17,7 +17,7 @@ import { Action, BringToFrontAction, GModelElement, SelectAction, SelectMouseLis
|
|
|
17
17
|
import { inject, injectable, optional } from 'inversify';
|
|
18
18
|
import { Ranked } from '../../base/ranked';
|
|
19
19
|
import { SelectableElement } from '../../utils/gmodel-util';
|
|
20
|
-
import {
|
|
20
|
+
import { GResizeHandle } from '../change-bounds/model';
|
|
21
21
|
import { ChangeBoundsManager } from '../tools/change-bounds/change-bounds-manager';
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -60,7 +60,7 @@ export class RankedSelectMouseListener extends SelectMouseListener implements Ra
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
protected override handleButton(target: GModelElement, event: MouseEvent): (Action | Promise<Action>)[] | undefined {
|
|
63
|
-
if (target instanceof
|
|
63
|
+
if (target instanceof GResizeHandle && this.changeBoundsManager?.useSymmetricResize(event)) {
|
|
64
64
|
// avoid de-selecting elements when resizing with a modifier key
|
|
65
65
|
return [];
|
|
66
66
|
}
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
41
41
|
import { isValidMove, minDimensions } from '../../../utils/layout-utils';
|
|
42
42
|
import { LayoutAware } from '../../bounds/layout-data';
|
|
43
|
-
import {
|
|
43
|
+
import { GResizeHandle, ResizeHandleLocation } from '../../change-bounds/model';
|
|
44
44
|
import {
|
|
45
45
|
IMovementRestrictor,
|
|
46
46
|
movementRestrictionFeedback,
|
|
@@ -154,7 +154,7 @@ export class ChangeBoundsManager {
|
|
|
154
154
|
);
|
|
155
155
|
|
|
156
156
|
// cursor feedback on graph
|
|
157
|
-
const cursorClass =
|
|
157
|
+
const cursorClass = GResizeHandle.getCursorCss(resize.handleMove.element);
|
|
158
158
|
feedback.add(cursorFeedbackAction(cursorClass), cursorFeedbackAction(CursorCSS.DEFAULT));
|
|
159
159
|
|
|
160
160
|
// handle feedback
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { FeatureModule, TYPES, bindAsService, configureCommand, configureView } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import '../../../../css/change-bounds.css';
|
|
18
|
-
import {
|
|
18
|
+
import { GResizeHandle } from '../../change-bounds/model';
|
|
19
19
|
import { ChangeBoundsManager } from './change-bounds-manager';
|
|
20
20
|
import { ChangeBoundsTool } from './change-bounds-tool';
|
|
21
21
|
import { HideChangeBoundsToolResizeFeedbackCommand, ShowChangeBoundsToolResizeFeedbackCommand } from './change-bounds-tool-feedback';
|
|
22
|
-
import {
|
|
22
|
+
import { GResizeHandleView } from './view';
|
|
23
23
|
|
|
24
24
|
export const changeBoundsToolModule = new FeatureModule(
|
|
25
25
|
(bind, unbind, isBound, rebind) => {
|
|
@@ -28,7 +28,7 @@ export const changeBoundsToolModule = new FeatureModule(
|
|
|
28
28
|
bindAsService(context, TYPES.IDefaultTool, ChangeBoundsTool);
|
|
29
29
|
configureCommand(context, ShowChangeBoundsToolResizeFeedbackCommand);
|
|
30
30
|
configureCommand(context, HideChangeBoundsToolResizeFeedbackCommand);
|
|
31
|
-
configureView(context,
|
|
31
|
+
configureView(context, GResizeHandle.TYPE, GResizeHandleView);
|
|
32
32
|
},
|
|
33
33
|
{ featureId: Symbol('changeBoundsTool') }
|
|
34
34
|
);
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
isNonRoutableSelectedMovableBoundsAware,
|
|
27
27
|
removeDescendants
|
|
28
28
|
} from '../../../utils/gmodel-util';
|
|
29
|
-
import {
|
|
29
|
+
import { GResizeHandle } from '../../change-bounds/model';
|
|
30
30
|
import { ChangeBoundsTool } from './change-bounds-tool';
|
|
31
31
|
import { MoveFinishedEventAction, MoveInitializedEventAction } from './change-bounds-tool-feedback';
|
|
32
32
|
import { ChangeBoundsTracker, TrackedMove } from './change-bounds-tracker';
|
|
@@ -66,7 +66,7 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
protected initializeMove(target: GModelElement, event: MouseEvent): void {
|
|
69
|
-
if (target instanceof
|
|
69
|
+
if (target instanceof GResizeHandle) {
|
|
70
70
|
// avoid conflict with resize tool
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
@@ -102,7 +102,7 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
protected isValidMoveable(element?: GModelElement): element is MoveableElement {
|
|
105
|
-
return !!element && isNonRoutableSelectedMovableBoundsAware(element) && !(element instanceof
|
|
105
|
+
return !!element && isNonRoutableSelectedMovableBoundsAware(element) && !(element instanceof GResizeHandle);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
override nonDraggingMouseUp(element: GModelElement, event: MouseEvent): Action[] {
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from '../../../utils/gmodel-util';
|
|
52
52
|
import { LocalRequestBoundsAction } from '../../bounds/local-bounds';
|
|
53
53
|
import { SetBoundsFeedbackAction } from '../../bounds/set-bounds-feedback-command';
|
|
54
|
-
import {
|
|
54
|
+
import { GResizeHandle, isResizable } from '../../change-bounds/model';
|
|
55
55
|
import { IMovementRestrictor } from '../../change-bounds/movement-restrictor';
|
|
56
56
|
import { BaseEditTool } from '../base-tools';
|
|
57
57
|
import { CSS_ACTIVE_HANDLE, ChangeBoundsManager } from './change-bounds-manager';
|
|
@@ -131,7 +131,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
|
|
|
131
131
|
|
|
132
132
|
// members for resize mode
|
|
133
133
|
protected activeResizeElement?: ResizableModelElement;
|
|
134
|
-
protected activeResizeHandle?:
|
|
134
|
+
protected activeResizeHandle?: GResizeHandle;
|
|
135
135
|
protected handleFeedback: FeedbackEmitter;
|
|
136
136
|
protected resizeFeedback: FeedbackEmitter;
|
|
137
137
|
|
|
@@ -155,7 +155,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
protected updateResizeElement(target: GModelElement, event?: MouseEvent): boolean {
|
|
158
|
-
this.activeResizeHandle = target instanceof
|
|
158
|
+
this.activeResizeHandle = target instanceof GResizeHandle ? target : undefined;
|
|
159
159
|
this.activeResizeElement = this.activeResizeHandle?.parent ?? this.findResizeElement(target);
|
|
160
160
|
if (this.activeResizeElement) {
|
|
161
161
|
if (event) {
|
|
@@ -301,7 +301,7 @@ export class ChangeBoundsListener extends DragAwareMouseListener implements ISel
|
|
|
301
301
|
return newRoutingPoints.length > 0 ? [ChangeRoutingPointsOperation.create(newRoutingPoints)] : [];
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
protected handleResizeOnServer(activeResizeHandle:
|
|
304
|
+
protected handleResizeOnServer(activeResizeHandle: GResizeHandle): Action[] {
|
|
305
305
|
if (this.initialBounds && this.isValidResize(activeResizeHandle.parent)) {
|
|
306
306
|
const elementAndBounds = toElementAndBounds(activeResizeHandle.parent);
|
|
307
307
|
if (!this.initialBounds.newPosition || !elementAndBounds.newPosition) {
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
isMoveable
|
|
33
33
|
} from '@eclipse-glsp/sprotty';
|
|
34
34
|
import { BoundsAwareModelElement, MoveableElement, ResizableModelElement, getElements } from '../../../utils/gmodel-util';
|
|
35
|
-
import {
|
|
35
|
+
import { GResizeHandle, ResizeHandleLocation } from '../../change-bounds/model';
|
|
36
36
|
import { DiagramMovementCalculator } from '../../change-bounds/tracker';
|
|
37
37
|
import { ChangeBoundsManager } from './change-bounds-manager';
|
|
38
38
|
|
|
@@ -277,7 +277,7 @@ export class ChangeBoundsTracker {
|
|
|
277
277
|
// RESIZE
|
|
278
278
|
//
|
|
279
279
|
|
|
280
|
-
resizeElements(handle:
|
|
280
|
+
resizeElements(handle: GResizeHandle, opts?: Partial<ResizeOptions>): TrackedResize {
|
|
281
281
|
const options = this.resolveResizeOptions(opts);
|
|
282
282
|
const update = this.calculateDiagramMovement();
|
|
283
283
|
const handleMove = this.calculateHandleMove(new MoveableResizeHandle(handle), update.vector, options);
|
|
@@ -315,7 +315,7 @@ export class ChangeBoundsTracker {
|
|
|
315
315
|
return this.calculateElementMove(handle, diagramMovement, moveOptions);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
protected getResizableElements(handle:
|
|
318
|
+
protected getResizableElements(handle: GResizeHandle, options: ResizeOptions): ResizableModelElement[] {
|
|
319
319
|
return [handle.parent];
|
|
320
320
|
}
|
|
321
321
|
|
|
@@ -447,11 +447,11 @@ export class ChangeBoundsTracker {
|
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
|
|
450
|
-
export class MoveableResizeHandle extends
|
|
450
|
+
export class MoveableResizeHandle extends GResizeHandle implements Locateable {
|
|
451
451
|
constructor(
|
|
452
|
-
protected handle:
|
|
452
|
+
protected handle: GResizeHandle,
|
|
453
453
|
override location: ResizeHandleLocation = handle.location,
|
|
454
|
-
readonly position =
|
|
454
|
+
readonly position = GResizeHandle.getHandlePosition(handle.parent, location)
|
|
455
455
|
) {
|
|
456
456
|
super(location, handle.type, handle.hoverFeedback);
|
|
457
457
|
this.id = handle.id;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2024 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
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
import { IView, Point, RenderingContext, setAttr, svg } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { injectable } from 'inversify';
|
|
18
18
|
import { VNode } from 'snabbdom';
|
|
19
|
-
import {
|
|
19
|
+
import { GResizeHandle } from '../../change-bounds/model';
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
22
|
const JSX = { createElement: svg };
|
|
23
23
|
|
|
24
24
|
@injectable()
|
|
25
|
-
export class
|
|
26
|
-
render(handle:
|
|
25
|
+
export class GResizeHandleView implements IView {
|
|
26
|
+
render(handle: GResizeHandle, context: RenderingContext): VNode | undefined {
|
|
27
27
|
if (context.targetKind === 'hidden') {
|
|
28
28
|
return undefined;
|
|
29
29
|
}
|
|
@@ -45,11 +45,16 @@ export class SResizeHandleView implements IView {
|
|
|
45
45
|
return <g />;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
protected getPosition(handle:
|
|
49
|
-
return Point.subtract(
|
|
48
|
+
protected getPosition(handle: GResizeHandle): Point | undefined {
|
|
49
|
+
return Point.subtract(GResizeHandle.getHandlePosition(handle), handle.parent.bounds);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
getRadius(): number {
|
|
53
53
|
return 7;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
/** @deprecated Use {@link GResizeHandleView} instead */
|
|
59
|
+
GResizeHandleView as SResizeHandleView
|
|
60
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2023-2024 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
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import { bindAsService, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { bindAsService, FeatureModule, TYPES } from '@eclipse-glsp/sprotty';
|
|
19
18
|
import { GLSPUndoRedoKeyListener } from './undo-redo-key-listener';
|
|
20
19
|
|
|
21
20
|
/**
|
|
@@ -23,6 +22,9 @@ import { GLSPUndoRedoKeyListener } from './undo-redo-key-listener';
|
|
|
23
22
|
* When integrated into an application frame (e.g Theia/VS Code) this module is typically omitted and/or replaced
|
|
24
23
|
* with an application native module.
|
|
25
24
|
*/
|
|
26
|
-
export const undoRedoModule = new
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
export const undoRedoModule = new FeatureModule(
|
|
26
|
+
(bind, unbind, isBound, rebind) => {
|
|
27
|
+
bindAsService(bind, TYPES.KeyListener, GLSPUndoRedoKeyListener);
|
|
28
|
+
},
|
|
29
|
+
{ featureId: Symbol('undoRedo') }
|
|
30
|
+
);
|
|
@@ -22,11 +22,11 @@ import {
|
|
|
22
22
|
Marker,
|
|
23
23
|
MarkerKind,
|
|
24
24
|
Projectable,
|
|
25
|
-
|
|
25
|
+
SIssueMarkerImpl,
|
|
26
26
|
isBoundsAware
|
|
27
27
|
} from '@eclipse-glsp/sprotty';
|
|
28
28
|
|
|
29
|
-
export class GIssueMarker extends
|
|
29
|
+
export class GIssueMarker extends SIssueMarkerImpl implements Projectable {
|
|
30
30
|
constructor() {
|
|
31
31
|
super();
|
|
32
32
|
this.features = new Set<symbol>(GDecoration.DEFAULT_FEATURES);
|
|
@@ -90,9 +90,10 @@ export function getGIssueMarker(modelElement: GParentElement): GIssueMarker | un
|
|
|
90
90
|
* @returns the created `GIssue`.
|
|
91
91
|
*/
|
|
92
92
|
export function createGIssue(marker: Marker, parent?: GParentElement): GIssue {
|
|
93
|
-
const issue =
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
const issue: GIssue = {
|
|
94
|
+
message: marker.description,
|
|
95
|
+
severity: 'info'
|
|
96
|
+
};
|
|
96
97
|
switch (marker.kind) {
|
|
97
98
|
case MarkerKind.ERROR: {
|
|
98
99
|
issue.severity = 'error';
|
package/src/index.ts
CHANGED
|
@@ -67,7 +67,7 @@ export * from './features/accessibility/focus-tracker/focus-tracker-tool';
|
|
|
67
67
|
export * from './features/accessibility/global-keylistener-tool';
|
|
68
68
|
export * from './features/accessibility/key-shortcut/accessible-key-shortcut';
|
|
69
69
|
export * from './features/accessibility/key-shortcut/accessible-key-shortcut-tool';
|
|
70
|
-
export * from './features/accessibility/key-shortcut/
|
|
70
|
+
export * from './features/accessibility/key-shortcut/shortcut-help-module';
|
|
71
71
|
export * from './features/accessibility/keyboard-grid/action';
|
|
72
72
|
export * from './features/accessibility/keyboard-grid/constants';
|
|
73
73
|
export * from './features/accessibility/keyboard-grid/keyboard-grid';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/key-shortcut/di.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAiB,cAAc,EAAiC,MAAM,uBAAuB,CAAC;AACrG,OAAO,kCAAkC,CAAC;AAI1C;;GAEG;AACH,eAAO,MAAM,sBAAsB,iBAGjC,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAIvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../../../src/features/accessibility/key-shortcut/di.config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAA4C;AAC5C,mDAAqG;AACrG,4CAA0C;AAC1C,uEAAmG;AACnG,iFAA2E;AAE3E;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACxF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC,CAAC,CAAC;AAEH,SAAgB,yBAAyB,CAAC,OAAuB;IAC7D,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,wDAAyB,CAAC,CAAC;IACtE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,YAAY,EAAE,gDAAsB,CAAC,CAAC;IACnE,IAAA,gCAAsB,EAAC,OAAO,EAAE,wDAA8B,CAAC,IAAI,EAAE,gDAAsB,CAAC,CAAC;AACjG,CAAC;AAJD,8DAIC"}
|