@eclipse-glsp/client 2.3.0-next.388 → 2.3.0-next.390
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/command-stack.d.ts +21 -1
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +26 -3
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher-default.d.ts +5 -3
- package/lib/base/feedback/feedback-action-dispatcher-default.d.ts.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher-default.js +18 -5
- package/lib/base/feedback/feedback-action-dispatcher-default.js.map +1 -1
- package/lib/base/model/diagram-loader.d.ts +9 -6
- package/lib/base/model/diagram-loader.d.ts.map +1 -1
- package/lib/base/model/diagram-loader.js +6 -6
- package/lib/base/model/diagram-loader.js.map +1 -1
- package/lib/base/selection-service.d.ts +4 -0
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js +12 -4
- package/lib/base/selection-service.js.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.d.ts.map +1 -1
- package/lib/features/accessibility/toast/toast-tool.js +1 -1
- package/lib/features/accessibility/toast/toast-tool.js.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.d.ts.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.js +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.js.map +1 -1
- package/lib/features/status/status-overlay.d.ts +1 -3
- package/lib/features/status/status-overlay.d.ts.map +1 -1
- package/lib/features/status/status-overlay.js +1 -6
- package/lib/features/status/status-overlay.js.map +1 -1
- package/lib/features/tool-palette/tool-palette.d.ts +6 -0
- package/lib/features/tool-palette/tool-palette.d.ts.map +1 -1
- package/lib/features/tool-palette/tool-palette.js +9 -5
- package/lib/features/tool-palette/tool-palette.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts +6 -3
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js +15 -4
- package/lib/features/tools/change-bounds/change-bounds-tool-move-feedback.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.d.ts.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js +8 -1
- package/lib/features/tools/change-bounds/change-bounds-tool.js.map +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js +1 -1
- package/lib/features/tools/edge-edit/edge-edit-tool.js.map +1 -1
- package/lib/utils/gmodel-util.d.ts +8 -0
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +16 -2
- package/lib/utils/gmodel-util.js.map +1 -1
- package/package.json +3 -3
- package/src/base/command-stack.ts +28 -4
- package/src/base/feedback/feedback-action-dispatcher-default.ts +17 -6
- package/src/base/model/diagram-loader.ts +23 -16
- package/src/base/selection-service.ts +15 -7
- package/src/features/accessibility/toast/toast-tool.ts +2 -2
- package/src/features/helper-lines/helper-line-manager-default.ts +1 -3
- package/src/features/status/status-overlay.ts +10 -7
- package/src/features/tool-palette/tool-palette.ts +10 -6
- package/src/features/tools/change-bounds/change-bounds-tool-move-feedback.ts +21 -6
- package/src/features/tools/change-bounds/change-bounds-tool.ts +9 -7
- package/src/features/tools/edge-edit/edge-edit-tool.ts +1 -1
- package/src/utils/gmodel-util.ts +15 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmodel-util.js","sourceRoot":"","sources":["../../src/utils/gmodel-util.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDA0B+B;AAU/B;;;;;;GAMG;AACH,SAAgB,MAAM,CAAI,KAAqB,EAAE,SAAkC;IAC/E,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAsC,CAAC;AAC9E,CAAC;AAFD,wBAEC;AAED;;;;;;GAMG;A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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/client",
|
|
3
|
-
"version": "2.3.0-next.
|
|
3
|
+
"version": "2.3.0-next.390+accf3f9",
|
|
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.3.0-next.
|
|
49
|
+
"@eclipse-glsp/sprotty": "2.3.0-next.390+accf3f9",
|
|
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": "accf3f92b6b1691c4be6414f4f49525c6572d6af"
|
|
67
67
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
|
+
CommandExecutionContext,
|
|
17
18
|
CommandStack,
|
|
18
19
|
Disposable,
|
|
19
20
|
DisposableCollection,
|
|
@@ -51,6 +52,10 @@ export class GLSPCommandStack extends CommandStack implements Disposable {
|
|
|
51
52
|
return this.editorContext.onModelRootChanged;
|
|
52
53
|
}
|
|
53
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Client-side undo/redo is not supported in GLSP. The server is responsible for handling undo/redo requests.
|
|
57
|
+
* If this method get called it's probably a mistake and a warning is logged
|
|
58
|
+
*/
|
|
54
59
|
override undo(): Promise<GModelRoot> {
|
|
55
60
|
this.logger.warn(
|
|
56
61
|
this,
|
|
@@ -59,6 +64,10 @@ export class GLSPCommandStack extends CommandStack implements Disposable {
|
|
|
59
64
|
return this.currentModel;
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
/**
|
|
68
|
+
* Client-side undo/redo is not supported in GLSP. The server is responsible for handling undo/redo requests.
|
|
69
|
+
* If this method get called it's probably a mistake and a warning is logged
|
|
70
|
+
*/
|
|
62
71
|
override redo(): Promise<GModelRoot> {
|
|
63
72
|
this.logger.warn(
|
|
64
73
|
this,
|
|
@@ -67,14 +76,29 @@ export class GLSPCommandStack extends CommandStack implements Disposable {
|
|
|
67
76
|
return this.currentModel;
|
|
68
77
|
}
|
|
69
78
|
|
|
79
|
+
/**
|
|
80
|
+
* Client-side undo/redo is not supported in GLSP.
|
|
81
|
+
* To avoid unnecessary infraction with the command stack (pushing/merging/popping commands)
|
|
82
|
+
* related methods are overridden to no-ops.
|
|
83
|
+
*/
|
|
84
|
+
protected override pushToUndoStack(command: ICommand): void {
|
|
85
|
+
// no-op
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Client-side undo/redo is not supported in GLSP.
|
|
90
|
+
* To avoid unnecessary infraction with the command stack (pushing/merging/popping commands)
|
|
91
|
+
* related methods are overridden to no-ops.
|
|
92
|
+
*/
|
|
93
|
+
protected override mergeOrPush(command: ICommand, context: CommandExecutionContext): void {
|
|
94
|
+
// no-op
|
|
95
|
+
}
|
|
70
96
|
override async execute(command: ICommand): Promise<GModelRoot> {
|
|
97
|
+
const result = await super.execute(command);
|
|
71
98
|
if (command instanceof SetModelCommand || command instanceof UpdateModelCommand) {
|
|
72
|
-
const result = await super.execute(command);
|
|
73
99
|
this.notifyListeners(result);
|
|
74
|
-
return result;
|
|
75
100
|
}
|
|
76
|
-
|
|
77
|
-
return super.execute(command);
|
|
101
|
+
return result;
|
|
78
102
|
}
|
|
79
103
|
|
|
80
104
|
protected notifyListeners(root: Readonly<GModelRoot>): void {
|
|
@@ -27,20 +27,23 @@ import {
|
|
|
27
27
|
TYPES,
|
|
28
28
|
toTypeGuard
|
|
29
29
|
} from '@eclipse-glsp/sprotty';
|
|
30
|
-
import { inject, injectable } from 'inversify';
|
|
30
|
+
import { inject, injectable, preDestroy } from 'inversify';
|
|
31
|
+
import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from './feedback-action-dispatcher';
|
|
31
32
|
import { getFeedbackRank } from './feedback-command';
|
|
32
33
|
import { FeedbackEmitter } from './feedback-emitter';
|
|
33
|
-
import { IFeedbackActionDispatcher, IFeedbackEmitter, MaybeActions } from './feedback-action-dispatcher';
|
|
34
34
|
|
|
35
35
|
@injectable()
|
|
36
|
-
export class FeedbackActionDispatcher implements IFeedbackActionDispatcher {
|
|
36
|
+
export class FeedbackActionDispatcher implements IFeedbackActionDispatcher, Disposable {
|
|
37
37
|
protected registeredFeedback: Map<IFeedbackEmitter, Action[]> = new Map();
|
|
38
38
|
|
|
39
|
-
@inject(TYPES.
|
|
39
|
+
@inject(TYPES.IActionDispatcher) protected actionDispatcher: IActionDispatcher;
|
|
40
|
+
|
|
40
41
|
@inject(TYPES.ILogger) protected logger: ILogger;
|
|
41
42
|
|
|
42
43
|
@inject(ActionHandlerRegistry) protected actionHandlerRegistry: ActionHandlerRegistry;
|
|
43
44
|
|
|
45
|
+
protected isDisposed = false;
|
|
46
|
+
|
|
44
47
|
registerFeedback(feedbackEmitter: IFeedbackEmitter, feedbackActions: Action[], cleanupActions?: MaybeActions): Disposable {
|
|
45
48
|
if (feedbackEmitter instanceof GModelElement) {
|
|
46
49
|
this.logger.log(
|
|
@@ -109,11 +112,19 @@ export class FeedbackActionDispatcher implements IFeedbackActionDispatcher {
|
|
|
109
112
|
|
|
110
113
|
protected async dispatchFeedback(actions: Action[], feedbackEmitter: IFeedbackEmitter): Promise<void> {
|
|
111
114
|
try {
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
if (this.isDisposed) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
await this.actionDispatcher.dispatchAll(actions);
|
|
114
119
|
this.logger.info(this, `Dispatched feedback actions for ${feedbackEmitter}`);
|
|
115
120
|
} catch (reason) {
|
|
116
121
|
this.logger.error(this, 'Failed to dispatch feedback actions', reason);
|
|
117
122
|
}
|
|
118
123
|
}
|
|
124
|
+
|
|
125
|
+
@preDestroy()
|
|
126
|
+
dispose(): void {
|
|
127
|
+
this.registeredFeedback.clear();
|
|
128
|
+
this.isDisposed = true;
|
|
129
|
+
}
|
|
119
130
|
}
|
|
@@ -18,14 +18,13 @@ import {
|
|
|
18
18
|
AnyObject,
|
|
19
19
|
ApplicationIdProvider,
|
|
20
20
|
Args,
|
|
21
|
-
EMPTY_ROOT,
|
|
22
21
|
GLSPClient,
|
|
23
22
|
IActionDispatcher,
|
|
24
23
|
InitializeParameters,
|
|
25
24
|
LazyInjector,
|
|
26
25
|
MaybePromise,
|
|
26
|
+
RequestAction,
|
|
27
27
|
RequestModelAction,
|
|
28
|
-
SetModelAction,
|
|
29
28
|
StatusAction,
|
|
30
29
|
TYPES,
|
|
31
30
|
hasNumberProp
|
|
@@ -44,19 +43,23 @@ export interface IDiagramOptions {
|
|
|
44
43
|
* corresponding client session.
|
|
45
44
|
*/
|
|
46
45
|
clientId: string;
|
|
46
|
+
|
|
47
47
|
/**
|
|
48
48
|
* The diagram type i.e. diagram language this diagram is associated with.
|
|
49
49
|
*/
|
|
50
50
|
diagramType: string;
|
|
51
|
+
|
|
51
52
|
/**
|
|
52
53
|
* The provider function to retrieve the GLSP client used by this diagram to communicate with the server.
|
|
53
|
-
* Multiple invocations of the
|
|
54
|
+
* Multiple invocations of the provider function should always return the same {@link GLSPClient} instance.
|
|
54
55
|
*/
|
|
55
56
|
glspClientProvider: () => Promise<GLSPClient>;
|
|
57
|
+
|
|
56
58
|
/**
|
|
57
59
|
* The file source URI associated with this diagram.
|
|
58
60
|
*/
|
|
59
61
|
sourceUri?: string;
|
|
62
|
+
|
|
60
63
|
/**
|
|
61
64
|
* The initial edit mode of diagram. Defaults to `editable`.
|
|
62
65
|
*/
|
|
@@ -74,24 +77,28 @@ export interface IDiagramStartup extends Partial<Ranked> {
|
|
|
74
77
|
* first hook that is invoked directly after {@link DiagramLoader.load} is called.
|
|
75
78
|
*/
|
|
76
79
|
preLoadDiagram?(): MaybePromise<void>;
|
|
80
|
+
|
|
77
81
|
/**
|
|
78
|
-
* Hook for services that want to execute code before the underlying
|
|
82
|
+
* Hook for services that want to execute code before the underlying {@link GLSPClient} is configured and the server is initialized.
|
|
79
83
|
*/
|
|
80
84
|
preInitialize?(): MaybePromise<void>;
|
|
85
|
+
|
|
81
86
|
/**
|
|
82
|
-
* Hook for services that want to execute code before the initial model loading request (i.e.
|
|
87
|
+
* Hook for services that want to execute code before the initial model loading request (i.e. {@link RequestModelAction}) but
|
|
83
88
|
* after the underlying GLSP client has been configured and the server is initialized.
|
|
84
89
|
*/
|
|
85
90
|
preRequestModel?(): MaybePromise<void>;
|
|
91
|
+
|
|
86
92
|
/**
|
|
87
|
-
* Hook for services that want to execute code after the initial model loading request (i.e.
|
|
88
|
-
* Note that this hook is invoked directly after the
|
|
93
|
+
* Hook for services that want to execute code after the initial model loading request (i.e. {@link RequestModelAction}).
|
|
94
|
+
* Note that this hook is invoked directly after the {@link RequestModelAction} has been dispatched. It does not necessarily wait
|
|
89
95
|
* until the client-server update roundtrip is completed. If you need to wait until the diagram is fully initialized use the
|
|
90
96
|
* {@link postModelInitialization} hook.
|
|
91
97
|
*/
|
|
98
|
+
|
|
92
99
|
postRequestModel?(): MaybePromise<void>;
|
|
93
|
-
|
|
94
|
-
* (i.e.
|
|
100
|
+
/** Hook for services that want to execute code after the diagram model is fully initialized
|
|
101
|
+
* (i.e. {@link ModelInitializationConstraint} is completed).
|
|
95
102
|
*/
|
|
96
103
|
postModelInitialization?(): MaybePromise<void>;
|
|
97
104
|
}
|
|
@@ -119,7 +126,7 @@ export interface DiagramLoadingOptions {
|
|
|
119
126
|
requestModelOptions?: Args;
|
|
120
127
|
|
|
121
128
|
/**
|
|
122
|
-
* Optional partial {@link InitializeParameters} that should be used for
|
|
129
|
+
* Optional partial {@link InitializeParameters} that should be used for {@link GLSPClient.initializeServer} request if the underlying
|
|
123
130
|
* {@link GLSPClient} has not been initialized yet.
|
|
124
131
|
*/
|
|
125
132
|
initializeParameters?: Partial<InitializeParameters>;
|
|
@@ -180,14 +187,15 @@ export class DiagramLoader {
|
|
|
180
187
|
},
|
|
181
188
|
enableNotifications: options.enableNotifications ?? true
|
|
182
189
|
};
|
|
183
|
-
//
|
|
184
|
-
await this.actionDispatcher.
|
|
190
|
+
// Ensure that the action dispatcher is initialized before starting the diagram loading process
|
|
191
|
+
await this.actionDispatcher.initialize?.();
|
|
185
192
|
await this.invokeStartupHook('preInitialize');
|
|
186
193
|
await this.initialize(resolvedOptions);
|
|
187
194
|
await this.invokeStartupHook('preRequestModel');
|
|
188
195
|
await this.requestModel(resolvedOptions);
|
|
189
196
|
await this.invokeStartupHook('postRequestModel');
|
|
190
|
-
this.modelInitializationConstraint.onInitialized(
|
|
197
|
+
await this.modelInitializationConstraint.onInitialized();
|
|
198
|
+
await this.invokeStartupHook('postModelInitialization');
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
protected async invokeStartupHook(hook: keyof Omit<IDiagramStartup, 'rank'>): Promise<void> {
|
|
@@ -201,10 +209,9 @@ export class DiagramLoader {
|
|
|
201
209
|
}
|
|
202
210
|
|
|
203
211
|
protected async requestModel(options: ResolvedDiagramLoadingOptions): Promise<void> {
|
|
204
|
-
|
|
205
|
-
RequestModelAction.create({ options: options.requestModelOptions })
|
|
212
|
+
await this.actionDispatcher.dispatch(
|
|
213
|
+
RequestModelAction.create({ options: options.requestModelOptions, requestId: RequestAction.generateRequestId() })
|
|
206
214
|
);
|
|
207
|
-
return this.actionDispatcher.dispatch(response);
|
|
208
215
|
}
|
|
209
216
|
|
|
210
217
|
protected async initialize(options: ResolvedDiagramLoadingOptions): Promise<void> {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import {
|
|
17
17
|
Action,
|
|
18
|
+
AnyObject,
|
|
18
19
|
Command,
|
|
19
20
|
CommandExecutionContext,
|
|
20
21
|
Disposable,
|
|
@@ -32,6 +33,7 @@ import {
|
|
|
32
33
|
SprottySelectCommand,
|
|
33
34
|
TYPES,
|
|
34
35
|
hasArrayProp,
|
|
36
|
+
hasFunctionProp,
|
|
35
37
|
isSelectable,
|
|
36
38
|
pluck
|
|
37
39
|
} from '@eclipse-glsp/sprotty';
|
|
@@ -45,6 +47,12 @@ export interface ISelectionListener {
|
|
|
45
47
|
selectionChanged(root: Readonly<GModelRoot>, selectedElements: string[], deselectedElements?: string[]): void;
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
export namespace ISelectionListener {
|
|
51
|
+
export function is(object: unknown): object is ISelectionListener {
|
|
52
|
+
return AnyObject.is(object) && hasFunctionProp(object, 'selectionChanged');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
48
56
|
export interface SelectionChange {
|
|
49
57
|
root: Readonly<GModelRoot>;
|
|
50
58
|
selectedElements: string[];
|
|
@@ -73,13 +81,7 @@ export class SelectionService implements IGModelRootListener, Disposable, IDiagr
|
|
|
73
81
|
}
|
|
74
82
|
|
|
75
83
|
preLoadDiagram(): void {
|
|
76
|
-
this.lazyInjector
|
|
77
|
-
.getAll<ISelectionListener>(TYPES.ISelectionListener)
|
|
78
|
-
.forEach(listener =>
|
|
79
|
-
this.onSelectionChanged(change =>
|
|
80
|
-
listener.selectionChanged(change.root, change.selectedElements, change.deselectedElements)
|
|
81
|
-
)
|
|
82
|
-
);
|
|
84
|
+
this.lazyInjector.getAll<ISelectionListener>(TYPES.ISelectionListener).forEach(listener => this.addListener(listener));
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
@preDestroy()
|
|
@@ -92,6 +94,12 @@ export class SelectionService implements IGModelRootListener, Disposable, IDiagr
|
|
|
92
94
|
return this.onSelectionChangedEmitter.event;
|
|
93
95
|
}
|
|
94
96
|
|
|
97
|
+
addListener(listener: ISelectionListener): Disposable {
|
|
98
|
+
return this.onSelectionChanged(change =>
|
|
99
|
+
listener.selectionChanged(change.root, change.selectedElements, change.deselectedElements)
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
95
103
|
modelRootChanged(root: Readonly<GModelRoot>): void {
|
|
96
104
|
this.updateSelection(root, [], []);
|
|
97
105
|
}
|
|
@@ -14,7 +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 { Action, IActionDispatcher, IActionHandler, ICommand, TYPES } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { Action, IActionDispatcher, IActionHandler, ICommand, SetUIExtensionVisibilityAction, TYPES } from '@eclipse-glsp/sprotty';
|
|
18
18
|
import { inject, injectable } from 'inversify';
|
|
19
19
|
import { EditorContextService } from '../../../base/editor-context-service';
|
|
20
20
|
import { IDiagramStartup } from '../../../base/model/diagram-loader';
|
|
@@ -99,7 +99,7 @@ export class Toast extends GLSPAbstractUIExtension implements IActionHandler, ID
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
preInitialize(): void {
|
|
102
|
-
this.
|
|
102
|
+
this.actionDispatcher.dispatch(SetUIExtensionVisibilityAction.create({ extensionId: Toast.ID, visible: true }));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
values(obj: { [key: symbol]: ToastOptions }): ToastOptions[] {
|
|
@@ -112,9 +112,7 @@ export class HelperLineManager implements IActionHandler, ISelectionListener, IH
|
|
|
112
112
|
dynamicOptions.minimumMoveDelta = Point.multiplyScalar(this.grid, 2);
|
|
113
113
|
}
|
|
114
114
|
this.options = { ...DEFAULT_HELPER_LINE_OPTIONS, ...dynamicOptions, ...this.userOptions };
|
|
115
|
-
this.selectionService.
|
|
116
|
-
this.selectionChanged(change.root, change.selectedElements, change.deselectedElements)
|
|
117
|
-
);
|
|
115
|
+
this.selectionService.addListener(this);
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
handle(action: Action): void {
|
|
@@ -13,9 +13,15 @@
|
|
|
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
|
+
IActionDispatcher,
|
|
18
|
+
IActionHandler,
|
|
19
|
+
SetUIExtensionVisibilityAction,
|
|
20
|
+
StatusAction,
|
|
21
|
+
TYPES,
|
|
22
|
+
codiconCSSClasses
|
|
23
|
+
} from '@eclipse-glsp/sprotty';
|
|
17
24
|
import { inject, injectable } from 'inversify';
|
|
18
|
-
import { EditorContextService } from '../../base/editor-context-service';
|
|
19
25
|
import { IDiagramStartup } from '../../base/model/diagram-loader';
|
|
20
26
|
import { GLSPAbstractUIExtension } from '../../base/ui-extension/ui-extension';
|
|
21
27
|
|
|
@@ -29,9 +35,6 @@ export class StatusOverlay extends GLSPAbstractUIExtension implements IActionHan
|
|
|
29
35
|
@inject(TYPES.IActionDispatcher)
|
|
30
36
|
protected actionDispatcher: IActionDispatcher;
|
|
31
37
|
|
|
32
|
-
@inject(EditorContextService)
|
|
33
|
-
protected editorContext: EditorContextService;
|
|
34
|
-
|
|
35
38
|
protected statusIconDiv?: HTMLDivElement;
|
|
36
39
|
protected statusMessageDiv?: HTMLDivElement;
|
|
37
40
|
protected pendingTimeout?: number;
|
|
@@ -115,7 +118,7 @@ export class StatusOverlay extends GLSPAbstractUIExtension implements IActionHan
|
|
|
115
118
|
}
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
preInitialize(): void {
|
|
119
|
-
this.
|
|
121
|
+
preInitialize(): Promise<void> {
|
|
122
|
+
return this.actionDispatcher.dispatch(SetUIExtensionVisibilityAction.create({ extensionId: this.id(), visible: true }));
|
|
120
123
|
}
|
|
121
124
|
}
|
|
@@ -474,17 +474,21 @@ export class ToolPalette extends GLSPAbstractUIExtension implements IActionHandl
|
|
|
474
474
|
this.createBody();
|
|
475
475
|
}
|
|
476
476
|
|
|
477
|
-
|
|
477
|
+
/**
|
|
478
|
+
* @deprecated This hook is no longer used by the ToolPalette.
|
|
479
|
+
* It is kept for compatibility reasons and will be removed in the future.
|
|
480
|
+
* Move initialization logic to the `postRequestModel` method.
|
|
481
|
+
* This ensures that tool palette initialization does not block the diagram loading process.
|
|
482
|
+
*/
|
|
483
|
+
async preRequestModel(): Promise<void> {}
|
|
484
|
+
|
|
485
|
+
async postRequestModel(): Promise<void> {
|
|
478
486
|
await this.setPaletteItems();
|
|
479
487
|
if (!this.editorContext.isReadonly) {
|
|
480
488
|
this.show(this.editorContext.modelRoot);
|
|
481
489
|
}
|
|
482
490
|
}
|
|
483
491
|
|
|
484
|
-
async postRequestModel(): Promise<void> {
|
|
485
|
-
this.reloadPaletteBody();
|
|
486
|
-
}
|
|
487
|
-
|
|
488
492
|
protected async setPaletteItems(): Promise<void> {
|
|
489
493
|
const requestAction = RequestContextActions.create({
|
|
490
494
|
contextId: ToolPalette.ID,
|
|
@@ -506,7 +510,7 @@ export class ToolPalette extends GLSPAbstractUIExtension implements IActionHandl
|
|
|
506
510
|
}
|
|
507
511
|
|
|
508
512
|
protected async reloadPaletteBody(): Promise<void> {
|
|
509
|
-
if (this.dynamic) {
|
|
513
|
+
if (!this.editorContext.isReadonly && this.dynamic) {
|
|
510
514
|
await this.setPaletteItems();
|
|
511
515
|
this.paletteItemsCopy = [];
|
|
512
516
|
this.requestFilterUpdate(this.searchField.value);
|
|
@@ -13,16 +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 { Action, ElementMove, GModelElement, GModelRoot, MoveAction, Point, findParentByFeature } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { Action, ElementMove, GModelElement, GModelRoot, MoveAction, Point, TypeGuard, findParentByFeature } from '@eclipse-glsp/sprotty';
|
|
17
17
|
|
|
18
18
|
import { DebouncedFunc, debounce } from 'lodash';
|
|
19
19
|
import { DragAwareMouseListener } from '../../../base/drag-aware-mouse-listener';
|
|
20
20
|
import { CursorCSS, cursorFeedbackAction } from '../../../base/feedback/css-feedback';
|
|
21
21
|
import { FeedbackEmitter } from '../../../base/feedback/feedback-emitter';
|
|
22
|
+
import { ISelectionListener } from '../../../base/selection-service';
|
|
22
23
|
import {
|
|
23
24
|
MoveableElement,
|
|
24
25
|
filter,
|
|
25
26
|
getElements,
|
|
27
|
+
isNonRoutableMovableBoundsAware,
|
|
26
28
|
isNonRoutableSelectedMovableBoundsAware,
|
|
27
29
|
removeDescendants
|
|
28
30
|
} from '../../../utils/gmodel-util';
|
|
@@ -38,7 +40,7 @@ import { ChangeBoundsTracker, TrackedMove } from './change-bounds-tracker';
|
|
|
38
40
|
* the visual feedback but also the basis for sending the change to the server
|
|
39
41
|
* (see also `tools/MoveTool`).
|
|
40
42
|
*/
|
|
41
|
-
export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
43
|
+
export class FeedbackMoveMouseListener extends DragAwareMouseListener implements ISelectionListener {
|
|
42
44
|
protected rootElement?: GModelRoot;
|
|
43
45
|
protected tracker: ChangeBoundsTracker;
|
|
44
46
|
protected elementId2startPos = new Map<string, Point>();
|
|
@@ -58,6 +60,11 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
58
60
|
override mouseDown(target: GModelElement, event: MouseEvent): Action[] {
|
|
59
61
|
super.mouseDown(target, event);
|
|
60
62
|
if (event.button === 0) {
|
|
63
|
+
if (this.tracker.isTracking()) {
|
|
64
|
+
// we have a move in progress that was not resolved yet (e.g., user may have triggered a mouse up outside the window)
|
|
65
|
+
this.draggingMouseUp(target, event);
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
61
68
|
this.initializeMove(target, event);
|
|
62
69
|
return [];
|
|
63
70
|
}
|
|
@@ -105,6 +112,10 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
105
112
|
return !!element && isNonRoutableSelectedMovableBoundsAware(element) && !(element instanceof GResizeHandle);
|
|
106
113
|
}
|
|
107
114
|
|
|
115
|
+
protected isValidRevertable(element?: GModelElement): element is MoveableElement {
|
|
116
|
+
return !!element && isNonRoutableMovableBoundsAware(element) && !(element instanceof GResizeHandle);
|
|
117
|
+
}
|
|
118
|
+
|
|
108
119
|
override nonDraggingMouseUp(element: GModelElement, event: MouseEvent): Action[] {
|
|
109
120
|
// should reset everything that may have happend on mouse down
|
|
110
121
|
this.moveInitializedFeedback.dispose();
|
|
@@ -161,8 +172,8 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
161
172
|
return Array.from(topLevelElements);
|
|
162
173
|
}
|
|
163
174
|
|
|
164
|
-
protected getElementsToMove(context: GModelElement): MoveableElement[] {
|
|
165
|
-
return getElements(context.root.index, Array.from(this.elementId2startPos.keys()),
|
|
175
|
+
protected getElementsToMove(context: GModelElement, moveable: TypeGuard<MoveableElement> = this.isValidMoveable): MoveableElement[] {
|
|
176
|
+
return getElements(context.root.index, Array.from(this.elementId2startPos.keys()), moveable);
|
|
166
177
|
}
|
|
167
178
|
|
|
168
179
|
protected resetElementPositions(context: GModelElement): MoveAction | undefined {
|
|
@@ -173,7 +184,7 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
173
184
|
protected revertElementMoves(context?: GModelElement): ElementMove[] {
|
|
174
185
|
const elementMoves: ElementMove[] = [];
|
|
175
186
|
if (context?.root?.index) {
|
|
176
|
-
const movableElements = this.getElementsToMove(context);
|
|
187
|
+
const movableElements = this.getElementsToMove(context, this.isValidRevertable);
|
|
177
188
|
movableElements.forEach(element =>
|
|
178
189
|
elementMoves.push({ elementId: element.id, toPosition: this.elementId2startPos.get(element.id)! })
|
|
179
190
|
);
|
|
@@ -192,7 +203,7 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
192
203
|
.filter(element => this.tool.changeBoundsManager.isValid(element))
|
|
193
204
|
.forEach(element => this.elementId2startPos.delete(element.id));
|
|
194
205
|
} else {
|
|
195
|
-
if (elementsToMove.every(element => this.tool.changeBoundsManager.isValid(element))) {
|
|
206
|
+
if (elementsToMove.length > 0 && elementsToMove.every(element => this.tool.changeBoundsManager.isValid(element))) {
|
|
196
207
|
// do not reset any element as all are valid
|
|
197
208
|
this.elementId2startPos.clear();
|
|
198
209
|
}
|
|
@@ -201,6 +212,10 @@ export class FeedbackMoveMouseListener extends DragAwareMouseListener {
|
|
|
201
212
|
return [];
|
|
202
213
|
}
|
|
203
214
|
|
|
215
|
+
selectionChanged(root: Readonly<GModelRoot>, selectedElements: string[], deselectedElements?: string[]): void {
|
|
216
|
+
this.dispose();
|
|
217
|
+
}
|
|
218
|
+
|
|
204
219
|
override dispose(): void {
|
|
205
220
|
this.pendingMoveInitialized?.cancel();
|
|
206
221
|
this.moveInitializedFeedback.dispose();
|
|
@@ -98,21 +98,23 @@ export class ChangeBoundsTool extends BaseEditTool {
|
|
|
98
98
|
enable(): void {
|
|
99
99
|
// install feedback move mouse listener for client-side move updates
|
|
100
100
|
const feedbackMoveMouseListener = this.createMoveMouseListener();
|
|
101
|
+
this.toDisposeOnDisable.push(this.mouseTool.registerListener(feedbackMoveMouseListener));
|
|
101
102
|
if (Disposable.is(feedbackMoveMouseListener)) {
|
|
102
103
|
this.toDisposeOnDisable.push(feedbackMoveMouseListener);
|
|
103
104
|
}
|
|
105
|
+
if (ISelectionListener.is(feedbackMoveMouseListener)) {
|
|
106
|
+
this.toDisposeOnDisable.push(this.selectionService.addListener(feedbackMoveMouseListener));
|
|
107
|
+
}
|
|
104
108
|
|
|
105
109
|
// install change bounds listener for client-side resize updates and server-side updates
|
|
106
110
|
const changeBoundsListener = this.createChangeBoundsListener();
|
|
111
|
+
this.toDisposeOnDisable.push(this.mouseTool.registerListener(changeBoundsListener));
|
|
107
112
|
if (Disposable.is(changeBoundsListener)) {
|
|
108
113
|
this.toDisposeOnDisable.push(changeBoundsListener);
|
|
109
114
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
this.mouseTool.registerListener(changeBoundsListener),
|
|
114
|
-
this.selectionService.onSelectionChanged(change => changeBoundsListener.selectionChanged(change.root, change.selectedElements))
|
|
115
|
-
);
|
|
115
|
+
if (ISelectionListener.is(changeBoundsListener)) {
|
|
116
|
+
this.toDisposeOnDisable.push(this.selectionService.addListener(changeBoundsListener));
|
|
117
|
+
}
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
createChangeBoundsTracker(): ChangeBoundsTracker {
|
|
@@ -123,7 +125,7 @@ export class ChangeBoundsTool extends BaseEditTool {
|
|
|
123
125
|
return new FeedbackMoveMouseListener(this);
|
|
124
126
|
}
|
|
125
127
|
|
|
126
|
-
protected createChangeBoundsListener(): MouseListener
|
|
128
|
+
protected createChangeBoundsListener(): MouseListener {
|
|
127
129
|
return new ChangeBoundsListener(this);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
@@ -82,7 +82,7 @@ export class EdgeEditTool extends BaseEditTool {
|
|
|
82
82
|
this.feedbackEdgeSourceMovingListener,
|
|
83
83
|
this.feedbackEdgeTargetMovingListener,
|
|
84
84
|
this.feedbackMovingListener,
|
|
85
|
-
this.selectionService.
|
|
85
|
+
this.selectionService.addListener(this.edgeEditListener)
|
|
86
86
|
);
|
|
87
87
|
}
|
|
88
88
|
|
package/src/utils/gmodel-util.ts
CHANGED
|
@@ -196,6 +196,10 @@ export function isNonRoutableSelectedMovableBoundsAware(element: GModelElement):
|
|
|
196
196
|
return isNonRoutableSelectedBoundsAware(element) && isMoveable(element);
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
export function isNonRoutableMovableBoundsAware(element: GModelElement): element is BoundsAwareModelElement {
|
|
200
|
+
return isNonRoutableBoundsAware(element) && isMoveable(element);
|
|
201
|
+
}
|
|
202
|
+
|
|
199
203
|
/**
|
|
200
204
|
* A typeguard function to check wether a given {@link GModelElement} implements the {@link BoundsAware} model feature,
|
|
201
205
|
* the {@link Selectable} model feature and is actually selected. In addition, the element must not be a {@link GRoutableElement}.
|
|
@@ -203,7 +207,17 @@ export function isNonRoutableSelectedMovableBoundsAware(element: GModelElement):
|
|
|
203
207
|
* @returns A type predicate indicating wether the element is of type {@link SelectableBoundsAware}.
|
|
204
208
|
*/
|
|
205
209
|
export function isNonRoutableSelectedBoundsAware(element: GModelElement): element is SelectableBoundsAware {
|
|
206
|
-
return
|
|
210
|
+
return isNonRoutableBoundsAware(element) && isSelected(element);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* A typeguard function to check wether a given {@link GModelElement} implements the {@link BoundsAware} model feature.
|
|
215
|
+
* In addition, the element must not be a {@link GRoutableElement}.
|
|
216
|
+
* @param element The element to check.
|
|
217
|
+
* @returns A type predicate indicating wether the element is of type {@link BoundsAwareModelElement}.
|
|
218
|
+
*/
|
|
219
|
+
export function isNonRoutableBoundsAware(element: GModelElement): element is BoundsAwareModelElement {
|
|
220
|
+
return isBoundsAware(element) && !isRoutable(element);
|
|
207
221
|
}
|
|
208
222
|
|
|
209
223
|
/**
|