@eclipse-glsp/client 0.10.0-next.c073915.168 → 0.10.0-next.c94277c.176
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/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +2 -1
- package/lib/base/container-modules.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +2 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +11 -12
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/model/update-model-command.d.ts +14 -7
- package/lib/base/model/update-model-command.d.ts.map +1 -1
- package/lib/base/model/update-model-command.js +31 -41
- package/lib/base/model/update-model-command.js.map +1 -1
- package/lib/base/source-uri-aware.d.ts +2 -17
- package/lib/base/source-uri-aware.d.ts.map +1 -1
- package/lib/base/source-uri-aware.js +4 -6
- package/lib/base/source-uri-aware.js.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.d.ts +36 -6
- package/lib/features/change-bounds/movement-restrictor.d.ts.map +1 -1
- package/lib/features/change-bounds/movement-restrictor.js +54 -39
- package/lib/features/change-bounds/movement-restrictor.js.map +1 -1
- package/lib/features/change-bounds/snap.d.ts +20 -5
- package/lib/features/change-bounds/snap.d.ts.map +1 -1
- package/lib/features/change-bounds/snap.js +19 -8
- package/lib/features/change-bounds/snap.js.map +1 -1
- package/lib/features/layout/di.config.d.ts +2 -2
- package/lib/features/layout/di.config.d.ts.map +1 -1
- package/lib/features/layout/di.config.js +8 -5
- package/lib/features/layout/di.config.js.map +1 -1
- package/lib/features/layout/hbox-layout.d.ts +41 -0
- package/lib/features/layout/hbox-layout.d.ts.map +1 -0
- package/lib/features/layout/hbox-layout.js +189 -0
- package/lib/features/layout/hbox-layout.js.map +1 -0
- package/lib/features/layout/{layout-commands.d.ts → layout-elements-action.d.ts} +75 -57
- package/lib/features/layout/layout-elements-action.d.ts.map +1 -0
- package/lib/features/layout/{layout-commands.js → layout-elements-action.js} +153 -197
- package/lib/features/layout/layout-elements-action.js.map +1 -0
- package/lib/features/layout/layout-elements-action.spec.d.ts +3 -0
- package/lib/features/layout/layout-elements-action.spec.d.ts.map +1 -0
- package/lib/features/layout/{layout-commands.spec.js → layout-elements-action.spec.js} +63 -56
- package/lib/features/layout/layout-elements-action.spec.js.map +1 -0
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +9 -2
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/select/selection-service.d.ts +12 -3
- package/lib/features/select/selection-service.d.ts.map +1 -1
- package/lib/features/select/selection-service.js +31 -45
- package/lib/features/select/selection-service.js.map +1 -1
- package/lib/features/select/selection-service.spec.js +1 -1
- package/lib/features/select/selection-service.spec.js.map +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js +1 -1
- package/lib/features/tool-feedback/change-bounds-tool-feedback.js.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +3 -2
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts.map +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +13 -6
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js.map +1 -1
- package/lib/features/tools/di.config.d.ts +9 -2
- package/lib/features/tools/di.config.d.ts.map +1 -1
- package/lib/features/tools/di.config.js +14 -3
- package/lib/features/tools/di.config.js.map +1 -1
- package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts +26 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.d.ts.map +1 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.js +29 -0
- package/lib/features/tools/enable-default-tools-on-focus-loss.js.map +1 -0
- package/lib/features/validation/di.config.d.ts +0 -15
- package/lib/features/validation/di.config.d.ts.map +1 -1
- package/lib/features/validation/di.config.js +6 -4
- package/lib/features/validation/di.config.js.map +1 -1
- package/lib/features/validation/marker-navigator.d.ts +11 -17
- package/lib/features/validation/marker-navigator.d.ts.map +1 -1
- package/lib/features/validation/marker-navigator.js +32 -61
- package/lib/features/validation/marker-navigator.js.map +1 -1
- package/lib/features/validation/validate.d.ts +8 -19
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +23 -52
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/lib/model.d.ts +1 -1
- package/lib/lib/model.d.ts.map +1 -1
- package/lib/lib/model.js +3 -3
- package/lib/lib/model.js.map +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts +1 -1
- package/lib/model-source/glsp-diagram-server.d.ts.map +1 -1
- package/lib/model-source/glsp-diagram-server.js +1 -1
- package/lib/model-source/glsp-diagram-server.js.map +1 -1
- package/lib/utils/layout-utils.d.ts +4 -20
- package/lib/utils/layout-utils.d.ts.map +1 -1
- package/lib/utils/layout-utils.js +1 -1
- package/lib/utils/layout-utils.js.map +1 -1
- package/lib/views/base-view-module.d.ts.map +1 -1
- package/lib/views/base-view-module.js +3 -1
- package/lib/views/base-view-module.js.map +1 -1
- package/package.json +3 -3
- package/src/base/container-modules.ts +4 -3
- package/src/base/editor-context-service.ts +15 -7
- package/src/base/model/update-model-command.ts +48 -34
- package/src/base/source-uri-aware.ts +5 -4
- package/src/features/change-bounds/movement-restrictor.ts +73 -43
- package/src/features/change-bounds/snap.ts +15 -12
- package/src/features/layout/di.config.ts +14 -6
- package/src/features/layout/hbox-layout.ts +256 -0
- package/src/features/layout/{layout-commands.spec.ts → layout-elements-action.spec.ts} +56 -48
- package/src/features/layout/{layout-commands.ts → layout-elements-action.ts} +195 -207
- package/src/features/mouse-tool/mouse-tool.ts +8 -2
- package/src/features/select/selection-service.spec.ts +1 -1
- package/src/features/select/selection-service.ts +37 -50
- package/src/features/tool-feedback/change-bounds-tool-feedback.ts +1 -1
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +14 -6
- package/src/features/tools/di.config.ts +13 -2
- package/src/features/tools/enable-default-tools-on-focus-loss.ts +33 -0
- package/src/features/validation/di.config.ts +10 -7
- package/src/features/validation/marker-navigator.ts +29 -66
- package/src/features/validation/validate.ts +30 -67
- package/src/index.ts +5 -4
- package/src/lib/model.ts +1 -1
- package/src/model-source/glsp-diagram-server.ts +1 -1
- package/src/utils/layout-utils.ts +7 -27
- package/src/views/base-view-module.ts +5 -1
- package/lib/features/layout/layout-commands.d.ts.map +0 -1
- package/lib/features/layout/layout-commands.js.map +0 -1
- package/lib/features/layout/layout-commands.spec.d.ts +0 -3
- package/lib/features/layout/layout-commands.spec.d.ts.map +0 -1
- package/lib/features/layout/layout-commands.spec.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-modules.d.ts","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmCvD,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"container-modules.d.ts","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAmCvD,eAAO,MAAM,eAAe,mBAkC3B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,SAAS,CAI9E"}
|
|
@@ -66,7 +66,8 @@ exports.DEFAULT_MODULES = [
|
|
|
66
66
|
di_config_14.default,
|
|
67
67
|
sprotty_1.routingModule,
|
|
68
68
|
di_config_13.default,
|
|
69
|
-
di_config_15.
|
|
69
|
+
di_config_15.toolsModule,
|
|
70
|
+
di_config_15.enableDefaultToolsOnFocusLossModule,
|
|
70
71
|
di_config_16.validationModule,
|
|
71
72
|
sprotty_1.zorderModule
|
|
72
73
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-modules.js","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAAuD;AACvD,qCAciB;AACjB,qEAA6E;AAC7E,kEAAuE;AACvE,gEAA6E;AAC7E,gEAAoE;AACpE,gEAAmE;AACnE,2DAA2D;AAC3D,2DAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"container-modules.js","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAAuD;AACvD,qCAciB;AACjB,qEAA6E;AAC7E,kEAAuE;AACvE,gEAA6E;AAC7E,gEAAoE;AACpE,gEAAmE;AACnE,2DAA2D;AAC3D,2DAA0D;AAC1D,4DAAwD;AACxD,0EAAkF;AAClF,iEAAmE;AACnE,iEAAoE;AACpE,6DAA4D;AAC5D,oEAAqE;AACrE,mEAAmE;AACnE,4DAA+F;AAC/F,iEAA2F;AAC3F,+DAAgE;AAChE,4CAA4C;AAE/B,QAAA,eAAe,GAAG;IAC3B,uBAAa;IACb,oBAAiB;IACjB,sBAAY;IACZ,sBAAY;IACZ,gCAAsB;IACtB,0BAAgB;IAChB,sBAAY;IACZ,sBAAY;IACZ,oBAAU;IACV,mBAAwB;IACxB,mBAAqB;IACrB,mBAAoB;IACpB,mBAAmB;IACnB,mBAAe;IACf,oBAAmB;IACnB,oBAAgB;IAChB,qCAAyB;IACzB,oBAAkB;IAClB,2BAAiB;IACjB,mBAAY;IACZ,kCAAqB;IACrB,mBAAgB;IAChB,2BAAiB;IACjB,mBAAwB;IACxB,6BAAgB;IAChB,oBAAU;IACV,oBAAiB;IACjB,uBAAa;IACb,oBAAkB;IAClB,wBAAW;IACX,gDAAmC;IACnC,6BAAgB;IAChB,sBAAY;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,qBAAqB,CAAC,GAAG,OAA0B;IAC/D,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAClC,SAAS,CAAC,IAAI,CAAC,GAAG,uBAAe,EAAE,GAAG,OAAO,CAAC,CAAC;IAC/C,OAAO,SAAS,CAAC;AACrB,CAAC;AAJD,sDAIC"}
|
|
@@ -32,12 +32,11 @@ export interface EditModeListener {
|
|
|
32
32
|
* position, etc.).
|
|
33
33
|
*/
|
|
34
34
|
export declare class EditorContextService implements IActionHandler {
|
|
35
|
-
protected editModeListeners: EditModeListener[];
|
|
36
35
|
protected selectionService: SelectionService;
|
|
37
36
|
protected mousePositionTracker: MousePositionTracker;
|
|
38
|
-
protected
|
|
37
|
+
protected editModeListeners: EditModeListener[];
|
|
38
|
+
protected modelSourceProvider: () => Promise<ModelSource>;
|
|
39
39
|
protected _editMode: string;
|
|
40
|
-
constructor(editModeListeners?: EditModeListener[]);
|
|
41
40
|
register(editModeListener: EditModeListener): void;
|
|
42
41
|
deregister(editModeListener: EditModeListener): void;
|
|
43
42
|
get(args?: Args): EditorContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-context-service.d.ts","sourceRoot":"","sources":["../../src/base/editor-context-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAyB,aAAa,EAA6B,MAAM,wBAAwB,CAAC;AAEvH,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAIxE,MAAM,WAAW,gBAAgB;IAC7B,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7D;AAED;;;;;;;;;;;GAWG;AACH,qBACa,oBAAqB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AAI,QAAQ,IAAI,MAAM,CAErB;IAED,IAAI,SAAS,IAAI,QAAQ,CAAC,UAAU,CAAC,CAEpC;IAED,IAAI,gBAAgB,IAAI,QAAQ,CAAC,aAAa,CAAC,EAAE,CAEhD;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;CACJ;AAED,oBAAY,4BAA4B,GAAG,MAAM,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -8,9 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
12
|
exports.EditorContextService = void 0;
|
|
16
13
|
/********************************************************************************
|
|
@@ -47,8 +44,8 @@ const types_1 = require("./types");
|
|
|
47
44
|
* position, etc.).
|
|
48
45
|
*/
|
|
49
46
|
let EditorContextService = class EditorContextService {
|
|
50
|
-
constructor(
|
|
51
|
-
this.editModeListeners =
|
|
47
|
+
constructor() {
|
|
48
|
+
this.editModeListeners = [];
|
|
52
49
|
}
|
|
53
50
|
register(editModeListener) {
|
|
54
51
|
(0, protocol_1.distinctAdd)(this.editModeListeners, editModeListener);
|
|
@@ -81,9 +78,9 @@ let EditorContextService = class EditorContextService {
|
|
|
81
78
|
this.editModeListeners.forEach(listener => listener.editModeChanged(oldValue, this.editMode));
|
|
82
79
|
}
|
|
83
80
|
async getSourceUri() {
|
|
84
|
-
const modelSource = await this.
|
|
81
|
+
const modelSource = await this.modelSourceProvider();
|
|
85
82
|
if ((0, source_uri_aware_1.isSourceUriAware)(modelSource)) {
|
|
86
|
-
return modelSource.
|
|
83
|
+
return modelSource.sourceURI;
|
|
87
84
|
}
|
|
88
85
|
return undefined;
|
|
89
86
|
}
|
|
@@ -108,15 +105,17 @@ __decorate([
|
|
|
108
105
|
(0, inversify_1.inject)(sprotty_1.MousePositionTracker),
|
|
109
106
|
__metadata("design:type", sprotty_1.MousePositionTracker)
|
|
110
107
|
], EditorContextService.prototype, "mousePositionTracker", void 0);
|
|
108
|
+
__decorate([
|
|
109
|
+
(0, inversify_1.multiInject)(types_1.TYPES.IEditModeListener),
|
|
110
|
+
(0, inversify_1.optional)(),
|
|
111
|
+
__metadata("design:type", Array)
|
|
112
|
+
], EditorContextService.prototype, "editModeListeners", void 0);
|
|
111
113
|
__decorate([
|
|
112
114
|
(0, inversify_1.inject)(types_1.TYPES.ModelSourceProvider),
|
|
113
115
|
__metadata("design:type", Function)
|
|
114
|
-
], EditorContextService.prototype, "
|
|
116
|
+
], EditorContextService.prototype, "modelSourceProvider", void 0);
|
|
115
117
|
EditorContextService = __decorate([
|
|
116
|
-
(0, inversify_1.injectable)()
|
|
117
|
-
__param(0, (0, inversify_1.multiInject)(types_1.TYPES.IEditModeListener)),
|
|
118
|
-
__param(0, (0, inversify_1.optional)()),
|
|
119
|
-
__metadata("design:paramtypes", [Array])
|
|
118
|
+
(0, inversify_1.injectable)()
|
|
120
119
|
], EditorContextService);
|
|
121
120
|
exports.EditorContextService = EditorContextService;
|
|
122
121
|
//# sourceMappingURL=editor-context-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-context-service.js","sourceRoot":"","sources":["../../src/base/editor-context-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-context-service.js","sourceRoot":"","sources":["../../src/base/editor-context-service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAuH;AACvH,yCAAsE;AACtE,qCAAuG;AACvG,4EAAwE;AACxE,yDAAsD;AACtD,mCAAgC;AAMhC;;;;;;;;;;;GAWG;AAEH,IAAa,oBAAoB,GA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C,EAAE;YAC/B,OAAO,WAAW,CAAC,SAAS,CAAC;SAChC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;IAED,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,gBAAgB,CAAC,mBAAmB,EAAE,CAAC;IACvD,CAAC;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,QAAQ,KAAK,mBAAQ,CAAC,QAAQ,CAAC;IAC/C,CAAC;CACJ,CAAA;AAzEG;IADC,IAAA,kBAAM,EAAC,aAAK,CAAC,gBAAgB,CAAC;8BACH,oCAAgB;8DAAC;AAG7C;IADC,IAAA,kBAAM,EAAC,8BAAoB,CAAC;8BACG,8BAAoB;kEAAC;AAIrD;IAFC,IAAA,uBAAW,EAAC,aAAK,CAAC,iBAAiB,CAAC;IACpC,IAAA,oBAAQ,GAAE;;+DAC0C;AAGrD;IADC,IAAA,kBAAM,EAAC,aAAK,CAAC,mBAAmB,CAAC;;iEACwB;AAZjD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA2EhC;AA3EY,oDAAoB"}
|
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { Action, UpdateModelAction } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { ActionHandlerRegistry, Command, CommandExecutionContext, CommandReturn, IActionHandler, ILogger, SModelRoot, UpdateModelCommand } from 'sprotty';
|
|
17
|
+
import { ActionHandlerRegistry, Animation, Command, CommandExecutionContext, CommandReturn, IActionHandler, ILogger, SModelRoot, UpdateAnimationData, UpdateModelCommand } from 'sprotty';
|
|
18
18
|
import { IFeedbackActionDispatcher } from '../../features/tool-feedback/feedback-action-dispatcher';
|
|
19
|
+
import { FeedbackCommand } from '../../features/tool-feedback/model';
|
|
20
|
+
/**
|
|
21
|
+
* ActionHandler that transforms a {@link SetModelAction} into an {@link UpdateModelAction} that can be handled
|
|
22
|
+
* by the {@link FeedbackAwareUpdateModelCommand}. This can be done because in sprotty an {@link UpdateModelCommand} and
|
|
23
|
+
* a {@link SetModelCommand} have the same behavior of no model is present yet.
|
|
24
|
+
*/
|
|
19
25
|
export declare class SetModelActionHandler implements IActionHandler {
|
|
20
26
|
handle(action: Action): Action | void;
|
|
21
27
|
}
|
|
@@ -23,18 +29,19 @@ export interface SModelRootListener {
|
|
|
23
29
|
modelRootChanged(root: Readonly<SModelRoot>): void;
|
|
24
30
|
}
|
|
25
31
|
/**
|
|
26
|
-
* A special
|
|
27
|
-
* feedback to the `newRoot` before performing the update
|
|
32
|
+
* A special {@link UpdateModelCommand} that retrieves all registered {@link Action}s from the {@link IFeedbackActionDispatcher}
|
|
33
|
+
* (if present) and applies their feedback to the `newRoot` before performing the update. This enables persistent client-side feedback
|
|
34
|
+
* across model updates initiated by the GLSP server.
|
|
28
35
|
*/
|
|
29
36
|
export declare class FeedbackAwareUpdateModelCommand extends UpdateModelCommand {
|
|
30
37
|
protected logger: ILogger;
|
|
31
|
-
protected
|
|
32
|
-
protected actionHandlerRegistryProvider: () => Promise<ActionHandlerRegistry>;
|
|
38
|
+
protected feedbackActionDispatcher: IFeedbackActionDispatcher;
|
|
33
39
|
protected modelRootListeners: SModelRootListener[];
|
|
34
40
|
protected actionHandlerRegistry?: ActionHandlerRegistry;
|
|
35
|
-
constructor(action: UpdateModelAction);
|
|
36
|
-
protected initialize(): void;
|
|
41
|
+
constructor(action: UpdateModelAction, actionHandlerRegistryProvider: () => Promise<ActionHandlerRegistry>);
|
|
37
42
|
protected performUpdate(oldRoot: SModelRoot, newRoot: SModelRoot, context: CommandExecutionContext): CommandReturn;
|
|
38
43
|
protected getFeedbackCommands(registry: ActionHandlerRegistry): Command[];
|
|
44
|
+
protected getPriority(command: Partial<FeedbackCommand>): number;
|
|
45
|
+
protected createAnimations(data: UpdateAnimationData, root: SModelRoot, context: CommandExecutionContext): Animation[];
|
|
39
46
|
}
|
|
40
47
|
//# sourceMappingURL=update-model-command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-model-command.d.ts","sourceRoot":"","sources":["../../../src/base/model/update-model-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"update-model-command.d.ts","sourceRoot":"","sources":["../../../src/base/model/update-model-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAA+B,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhG,OAAO,EACH,qBAAqB,EACrB,SAAS,EACT,OAAO,EAEP,uBAAuB,EACvB,aAAa,EACb,cAAc,EACd,OAAO,EAEP,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EACrB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,yBAAyB,EAAE,MAAM,yDAAyD,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE;;;;GAIG;AACH,qBACa,qBAAsB,YAAW,cAAc;IACxD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;CAKxC;AAED,MAAM,WAAW,kBAAkB;IAC/B,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CACtD;AAED;;;;GAIG;AACH,qBACa,+BAAgC,SAAQ,kBAAkB;IAEnE,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;IAI1B,SAAS,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;IAI9D,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,EAAE,CAAM;IAExD,SAAS,CAAC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;gBAG9B,MAAM,EAAE,iBAAiB,EAE/C,6BAA6B,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC;cAMpD,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,GAAG,aAAa;IAiB3H,SAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO,EAAE;IAazE,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,MAAM;cAM7C,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,uBAAuB,GAAG,SAAS,EAAE;CAIlI"}
|
|
@@ -31,10 +31,12 @@ exports.FeedbackAwareUpdateModelCommand = exports.SetModelActionHandler = void 0
|
|
|
31
31
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
32
32
|
const inversify_1 = require("inversify");
|
|
33
33
|
const sprotty_1 = require("sprotty");
|
|
34
|
-
const model_1 = require("../../features/tool-feedback/model");
|
|
35
34
|
const types_1 = require("../types");
|
|
36
|
-
|
|
37
|
-
*
|
|
35
|
+
/**
|
|
36
|
+
* ActionHandler that transforms a {@link SetModelAction} into an {@link UpdateModelAction} that can be handled
|
|
37
|
+
* by the {@link FeedbackAwareUpdateModelCommand}. This can be done because in sprotty an {@link UpdateModelCommand} and
|
|
38
|
+
* a {@link SetModelCommand} have the same behavior of no model is present yet.
|
|
39
|
+
*/
|
|
38
40
|
let SetModelActionHandler = class SetModelActionHandler {
|
|
39
41
|
handle(action) {
|
|
40
42
|
if (protocol_1.SetModelAction.is(action)) {
|
|
@@ -47,29 +49,21 @@ SetModelActionHandler = __decorate([
|
|
|
47
49
|
], SetModelActionHandler);
|
|
48
50
|
exports.SetModelActionHandler = SetModelActionHandler;
|
|
49
51
|
/**
|
|
50
|
-
* A special
|
|
51
|
-
* feedback to the `newRoot` before performing the update
|
|
52
|
+
* A special {@link UpdateModelCommand} that retrieves all registered {@link Action}s from the {@link IFeedbackActionDispatcher}
|
|
53
|
+
* (if present) and applies their feedback to the `newRoot` before performing the update. This enables persistent client-side feedback
|
|
54
|
+
* across model updates initiated by the GLSP server.
|
|
52
55
|
*/
|
|
53
56
|
let FeedbackAwareUpdateModelCommand = class FeedbackAwareUpdateModelCommand extends sprotty_1.UpdateModelCommand {
|
|
54
|
-
constructor(action) {
|
|
57
|
+
constructor(action, actionHandlerRegistryProvider) {
|
|
55
58
|
super(Object.assign({ animate: true }, action));
|
|
56
59
|
this.modelRootListeners = [];
|
|
57
|
-
|
|
58
|
-
initialize() {
|
|
59
|
-
this.actionHandlerRegistryProvider().then(registry => (this.actionHandlerRegistry = registry));
|
|
60
|
+
actionHandlerRegistryProvider().then(registry => (this.actionHandlerRegistry = registry));
|
|
60
61
|
}
|
|
61
62
|
performUpdate(oldRoot, newRoot, context) {
|
|
62
63
|
if (this.feedbackActionDispatcher && this.actionHandlerRegistry) {
|
|
63
|
-
// Create a temporary context
|
|
64
|
+
// Create a temporary context which defines the `newRoot` as `root`
|
|
64
65
|
// This way we do not corrupt the redo/undo behavior of the super class
|
|
65
|
-
const tempContext = {
|
|
66
|
-
root: newRoot,
|
|
67
|
-
duration: context.duration,
|
|
68
|
-
logger: context.logger,
|
|
69
|
-
modelChanged: context.modelChanged,
|
|
70
|
-
modelFactory: context.modelFactory,
|
|
71
|
-
syncer: context.syncer
|
|
72
|
-
};
|
|
66
|
+
const tempContext = Object.assign(Object.assign({}, context), { root: newRoot });
|
|
73
67
|
const feedbackCommands = this.getFeedbackCommands(this.actionHandlerRegistry);
|
|
74
68
|
feedbackCommands.forEach(command => command.execute(tempContext));
|
|
75
69
|
}
|
|
@@ -79,13 +73,24 @@ let FeedbackAwareUpdateModelCommand = class FeedbackAwareUpdateModelCommand exte
|
|
|
79
73
|
getFeedbackCommands(registry) {
|
|
80
74
|
const result = [];
|
|
81
75
|
this.feedbackActionDispatcher.getRegisteredFeedback().forEach(action => {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
const commands = registry
|
|
77
|
+
.get(action.kind)
|
|
78
|
+
.filter((0, protocol_1.toTypeGuard)(sprotty_1.CommandActionHandler))
|
|
79
|
+
.map(handler => handler.handle(action));
|
|
80
|
+
result.push(...commands);
|
|
86
81
|
});
|
|
87
|
-
// sort commands
|
|
88
|
-
return result.sort((a, b) => getPriority(b) - getPriority(a));
|
|
82
|
+
// sort commands descanting by priority
|
|
83
|
+
return result.sort((a, b) => this.getPriority(b) - this.getPriority(a));
|
|
84
|
+
}
|
|
85
|
+
getPriority(command) {
|
|
86
|
+
var _a;
|
|
87
|
+
return (_a = command.priority) !== null && _a !== void 0 ? _a : 0;
|
|
88
|
+
}
|
|
89
|
+
// Override the `createAnimations` implementation and remove the animation for edge morphing. Otherwise routing & reconnect
|
|
90
|
+
// handles flicker after each server update.
|
|
91
|
+
createAnimations(data, root, context) {
|
|
92
|
+
const animations = super.createAnimations(data, root, context);
|
|
93
|
+
return animations.filter(animation => !(animation instanceof sprotty_1.MorphEdgesAnimation));
|
|
89
94
|
}
|
|
90
95
|
};
|
|
91
96
|
__decorate([
|
|
@@ -97,31 +102,16 @@ __decorate([
|
|
|
97
102
|
(0, inversify_1.optional)(),
|
|
98
103
|
__metadata("design:type", Object)
|
|
99
104
|
], FeedbackAwareUpdateModelCommand.prototype, "feedbackActionDispatcher", void 0);
|
|
100
|
-
__decorate([
|
|
101
|
-
(0, inversify_1.inject)(types_1.TYPES.ActionHandlerRegistryProvider),
|
|
102
|
-
__metadata("design:type", Function)
|
|
103
|
-
], FeedbackAwareUpdateModelCommand.prototype, "actionHandlerRegistryProvider", void 0);
|
|
104
105
|
__decorate([
|
|
105
106
|
(0, inversify_1.multiInject)(types_1.TYPES.SModelRootListener),
|
|
106
107
|
(0, inversify_1.optional)(),
|
|
107
108
|
__metadata("design:type", Array)
|
|
108
109
|
], FeedbackAwareUpdateModelCommand.prototype, "modelRootListeners", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, inversify_1.postConstruct)(),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", []),
|
|
113
|
-
__metadata("design:returntype", void 0)
|
|
114
|
-
], FeedbackAwareUpdateModelCommand.prototype, "initialize", null);
|
|
115
110
|
FeedbackAwareUpdateModelCommand = __decorate([
|
|
116
111
|
(0, inversify_1.injectable)(),
|
|
117
112
|
__param(0, (0, inversify_1.inject)(types_1.TYPES.Action)),
|
|
118
|
-
|
|
113
|
+
__param(1, (0, inversify_1.inject)(types_1.TYPES.ActionHandlerRegistryProvider)),
|
|
114
|
+
__metadata("design:paramtypes", [Object, Function])
|
|
119
115
|
], FeedbackAwareUpdateModelCommand);
|
|
120
116
|
exports.FeedbackAwareUpdateModelCommand = FeedbackAwareUpdateModelCommand;
|
|
121
|
-
function getPriority(command) {
|
|
122
|
-
if (command instanceof model_1.FeedbackCommand) {
|
|
123
|
-
return command.priority;
|
|
124
|
-
}
|
|
125
|
-
return 0;
|
|
126
|
-
}
|
|
127
117
|
//# sourceMappingURL=update-model-command.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-model-command.js","sourceRoot":"","sources":["../../../src/base/model/update-model-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"update-model-command.js","sourceRoot":"","sources":["../../../src/base/model/update-model-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAgG;AAChG,yCAAsE;AACtE,qCAaiB;AAGjB,oCAAiC;AAEjC;;;;GAIG;AAEH,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAC9B,MAAM,CAAC,MAAc;QACjB,IAAI,yBAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EA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oBAAQ,GAAE;;2EAC6C;AAV/C,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;IAgBJ,WAAA,IAAA,kBAAM,EAAC,aAAK,CAAC,MAAM,CAAC,CAAA;IACpB,WAAA,IAAA,kBAAM,EAAC,aAAK,CAAC,6BAA6B,CAAC,CAAA;;GAhBvC,+BAA+B,CA+D3C;AA/DY,0EAA+B"}
|
|
@@ -1,20 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* This Source Code may also be made available under the following Secondary
|
|
9
|
-
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
* with the GNU Classpath Exception which is available at
|
|
12
|
-
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
*
|
|
14
|
-
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
-
********************************************************************************/
|
|
16
|
-
export declare abstract class SourceUriAware {
|
|
17
|
-
abstract getSourceURI(): string;
|
|
1
|
+
export interface SourceUriAware {
|
|
2
|
+
sourceURI: string;
|
|
18
3
|
}
|
|
19
4
|
export declare function isSourceUriAware(obj: any): obj is SourceUriAware;
|
|
20
5
|
//# sourceMappingURL=source-uri-aware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-uri-aware.d.ts","sourceRoot":"","sources":["../../src/base/source-uri-aware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"source-uri-aware.d.ts","sourceRoot":"","sources":["../../src/base/source-uri-aware.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,cAAc;IAC3B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,cAAc,CAEhE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSourceUriAware =
|
|
3
|
+
exports.isSourceUriAware = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2020 EclipseSource and others.
|
|
5
|
+
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -16,11 +16,9 @@ exports.isSourceUriAware = exports.SourceUriAware = void 0;
|
|
|
16
16
|
*
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
exports.SourceUriAware = SourceUriAware;
|
|
19
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
22
20
|
function isSourceUriAware(obj) {
|
|
23
|
-
return obj
|
|
21
|
+
return protocol_1.AnyObject.is(obj) && (0, protocol_1.hasStringProp)(obj, 'sourceURI');
|
|
24
22
|
}
|
|
25
23
|
exports.isSourceUriAware = isSourceUriAware;
|
|
26
24
|
//# sourceMappingURL=source-uri-aware.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-uri-aware.js","sourceRoot":"","sources":["../../src/base/source-uri-aware.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"source-uri-aware.js","sourceRoot":"","sources":["../../src/base/source-uri-aware.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAkE;AAKlE,SAAgB,gBAAgB,CAAC,GAAQ;IACrC,OAAO,oBAAS,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,IAAA,wBAAa,EAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAChE,CAAC;AAFD,4CAEC"}
|
|
@@ -16,15 +16,45 @@
|
|
|
16
16
|
import { Point } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { BoundsAware, SModelElement } from 'sprotty';
|
|
18
18
|
import { ModifyCSSFeedbackAction } from '../tool-feedback/css-feedback';
|
|
19
|
+
/**
|
|
20
|
+
* A `MovementRestrictor` is an optional service that can be used by tools to validate
|
|
21
|
+
* whether a certain move operation (e.g. `ChangeBoundsOperation`) in the diagram is valid.
|
|
22
|
+
*/
|
|
19
23
|
export interface IMovementRestrictor {
|
|
20
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Validate whether moving the given element to a new given location is allowed.
|
|
26
|
+
* @param element The element that should be moved.
|
|
27
|
+
* @param newLocation The new location of the element.
|
|
28
|
+
* @returns `true` if the the element is movable and moving to the given location is allowed, `false` otherwise.
|
|
29
|
+
* Should also return `false` if the newLocation is `undefined`:
|
|
30
|
+
*/
|
|
31
|
+
validate(element: SModelElement, newLocation?: Point): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Feedback css-classes. Can be applied to elements that did fail the validation.
|
|
34
|
+
*/
|
|
21
35
|
cssClasses?: string[];
|
|
22
36
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
/**
|
|
38
|
+
* A `IMovementRestrictor` that checks for overlapping elements. Move operations
|
|
39
|
+
* are only valid if the element does not collide with another element after moving.
|
|
40
|
+
*/
|
|
41
|
+
export declare class NoOverlapMovementRestrictor implements IMovementRestrictor {
|
|
26
42
|
cssClasses: string[];
|
|
27
|
-
validate(
|
|
43
|
+
validate(element: SModelElement, newLocation?: Point): boolean;
|
|
44
|
+
protected areOverlapping(element1: SModelElement & BoundsAware, element2: SModelElement & BoundsAware): boolean;
|
|
28
45
|
}
|
|
29
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Utility function to create an action that applies the given {@link IMovementRestrictor.cssClasses} to the given element.
|
|
48
|
+
* @param element The element on which the css classes should be applied.
|
|
49
|
+
* @param movementRestrictor The movement restrictor whose cssClasses should be applied.
|
|
50
|
+
* @returns The corresponding {@link ModifyCSSFeedbackAction}
|
|
51
|
+
*/
|
|
52
|
+
export declare function createMovementRestrictionFeedback(element: SModelElement, movementRestrictor: IMovementRestrictor): ModifyCSSFeedbackAction;
|
|
53
|
+
/**
|
|
54
|
+
* Utility function to create an action that removes the given {@link IMovementRestrictor.cssClasses} from the given element.
|
|
55
|
+
* @param element The element from which the css classes should be removed.
|
|
56
|
+
* @param movementRestrictor The movement restrictor whose cssClasses should be removed.
|
|
57
|
+
* @returns The corresponding {@link ModifyCSSFeedbackAction}
|
|
58
|
+
*/
|
|
59
|
+
export declare function removeMovementRestrictionFeedback(element: SModelElement, movementRestrictor: IMovementRestrictor): ModifyCSSFeedbackAction;
|
|
30
60
|
//# sourceMappingURL=movement-restrictor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movement-restrictor.d.ts","sourceRoot":"","sources":["../../../src/features/change-bounds/movement-restrictor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAyB,MAAM,SAAS,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"movement-restrictor.d.ts","sourceRoot":"","sources":["../../../src/features/change-bounds/movement-restrictor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAyB,MAAM,SAAS,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC;IAC/D;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,qBACa,2BAA4B,YAAW,mBAAmB;IACnE,UAAU,WAA4B;IAEtC,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,EAAE,KAAK,GAAG,OAAO;IAsB9D,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,WAAW,EAAE,QAAQ,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO;CAoBlH;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC7C,OAAO,EAAE,aAAa,EACtB,kBAAkB,EAAE,mBAAmB,GACxC,uBAAuB,CAMzB;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC7C,OAAO,EAAE,aAAa,EACtB,kBAAkB,EAAE,mBAAmB,GACxC,uBAAuB,CAOzB"}
|
|
@@ -6,34 +6,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.removeMovementRestrictionFeedback = exports.createMovementRestrictionFeedback = exports.NoOverlapMovementRestrictor = void 0;
|
|
10
10
|
const inversify_1 = require("inversify");
|
|
11
11
|
const sprotty_1 = require("sprotty");
|
|
12
12
|
const viewpoint_util_1 = require("../../utils/viewpoint-util");
|
|
13
13
|
const css_feedback_1 = require("../tool-feedback/css-feedback");
|
|
14
14
|
const model_1 = require("./model");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return css_feedback_1.ModifyCSSFeedbackAction.create({ elements, add: movementRestrictor.cssClasses });
|
|
21
|
-
}
|
|
22
|
-
exports.createMovementRestrictionFeedback = createMovementRestrictionFeedback;
|
|
23
|
-
function removeMovementRestrictionFeedback(element, movementRestrictor) {
|
|
24
|
-
const elements = [element];
|
|
25
|
-
if (element instanceof sprotty_1.SParentElement) {
|
|
26
|
-
element.children.filter(child => child instanceof model_1.SResizeHandle).forEach(e => elements.push(e));
|
|
27
|
-
}
|
|
28
|
-
return css_feedback_1.ModifyCSSFeedbackAction.create({ elements, remove: movementRestrictor.cssClasses });
|
|
29
|
-
}
|
|
30
|
-
exports.removeMovementRestrictionFeedback = removeMovementRestrictionFeedback;
|
|
31
|
-
let NoOverlapMovmentRestrictor = class NoOverlapMovmentRestrictor {
|
|
15
|
+
/**
|
|
16
|
+
* A `IMovementRestrictor` that checks for overlapping elements. Move operations
|
|
17
|
+
* are only valid if the element does not collide with another element after moving.
|
|
18
|
+
*/
|
|
19
|
+
let NoOverlapMovementRestrictor = class NoOverlapMovementRestrictor {
|
|
32
20
|
constructor() {
|
|
33
21
|
this.cssClasses = ['movement-not-allowed'];
|
|
34
22
|
}
|
|
35
|
-
validate(
|
|
36
|
-
if (!(0, model_1.isBoundsAwareMoveable)(element)) {
|
|
23
|
+
validate(element, newLocation) {
|
|
24
|
+
if (!(0, model_1.isBoundsAwareMoveable)(element) || !newLocation) {
|
|
37
25
|
return false;
|
|
38
26
|
}
|
|
39
27
|
// Create ghost element at the newLocation
|
|
@@ -49,29 +37,56 @@ let NoOverlapMovmentRestrictor = class NoOverlapMovmentRestrictor {
|
|
|
49
37
|
return !Array.from(element.root.index
|
|
50
38
|
.all()
|
|
51
39
|
.filter(e => e.id !== ghostElement.id && e !== ghostElement.root && e instanceof sprotty_1.SNode)
|
|
52
|
-
.map(e => e)).some(e => areOverlapping(e, ghostElement));
|
|
40
|
+
.map(e => e)).some(e => this.areOverlapping(e, ghostElement));
|
|
41
|
+
}
|
|
42
|
+
areOverlapping(element1, element2) {
|
|
43
|
+
const b1 = (0, viewpoint_util_1.toAbsoluteBounds)(element1);
|
|
44
|
+
const b2 = (0, viewpoint_util_1.toAbsoluteBounds)(element2);
|
|
45
|
+
const r1TopLeft = b1;
|
|
46
|
+
const r1BottomRight = { x: b1.x + b1.width, y: b1.y + b1.height };
|
|
47
|
+
const r2TopLeft = b2;
|
|
48
|
+
const r2BottomRight = { x: b2.x + b2.width, y: b2.y + b2.height };
|
|
49
|
+
// If one rectangle is on left side of other
|
|
50
|
+
if (r1TopLeft.x > r2BottomRight.x || r2TopLeft.x > r1BottomRight.x) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
// If one rectangle is above other
|
|
54
|
+
if (r1BottomRight.y < r2TopLeft.y || r2BottomRight.y < r1TopLeft.y) {
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
|
-
|
|
60
|
+
NoOverlapMovementRestrictor = __decorate([
|
|
56
61
|
(0, inversify_1.injectable)()
|
|
57
|
-
],
|
|
58
|
-
exports.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
|
|
62
|
+
], NoOverlapMovementRestrictor);
|
|
63
|
+
exports.NoOverlapMovementRestrictor = NoOverlapMovementRestrictor;
|
|
64
|
+
/**
|
|
65
|
+
* Utility function to create an action that applies the given {@link IMovementRestrictor.cssClasses} to the given element.
|
|
66
|
+
* @param element The element on which the css classes should be applied.
|
|
67
|
+
* @param movementRestrictor The movement restrictor whose cssClasses should be applied.
|
|
68
|
+
* @returns The corresponding {@link ModifyCSSFeedbackAction}
|
|
69
|
+
*/
|
|
70
|
+
function createMovementRestrictionFeedback(element, movementRestrictor) {
|
|
71
|
+
const elements = [element];
|
|
72
|
+
if (element instanceof sprotty_1.SParentElement) {
|
|
73
|
+
element.children.filter(child => child instanceof model_1.SResizeHandle).forEach(e => elements.push(e));
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
75
|
+
return css_feedback_1.ModifyCSSFeedbackAction.create({ elements, add: movementRestrictor.cssClasses });
|
|
76
|
+
}
|
|
77
|
+
exports.createMovementRestrictionFeedback = createMovementRestrictionFeedback;
|
|
78
|
+
/**
|
|
79
|
+
* Utility function to create an action that removes the given {@link IMovementRestrictor.cssClasses} from the given element.
|
|
80
|
+
* @param element The element from which the css classes should be removed.
|
|
81
|
+
* @param movementRestrictor The movement restrictor whose cssClasses should be removed.
|
|
82
|
+
* @returns The corresponding {@link ModifyCSSFeedbackAction}
|
|
83
|
+
*/
|
|
84
|
+
function removeMovementRestrictionFeedback(element, movementRestrictor) {
|
|
85
|
+
const elements = [element];
|
|
86
|
+
if (element instanceof sprotty_1.SParentElement) {
|
|
87
|
+
element.children.filter(child => child instanceof model_1.SResizeHandle).forEach(e => elements.push(e));
|
|
73
88
|
}
|
|
74
|
-
return
|
|
89
|
+
return css_feedback_1.ModifyCSSFeedbackAction.create({ elements, remove: movementRestrictor.cssClasses });
|
|
75
90
|
}
|
|
76
|
-
exports.
|
|
91
|
+
exports.removeMovementRestrictionFeedback = removeMovementRestrictionFeedback;
|
|
77
92
|
//# sourceMappingURL=movement-restrictor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"movement-restrictor.js","sourceRoot":"","sources":["../../../src/features/change-bounds/movement-restrictor.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,yCAAuC;AACvC,qCAA4E;AAC5E,+DAA8D;AAC9D,gEAAwE;AACxE,mCAA+D;
|
|
1
|
+
{"version":3,"file":"movement-restrictor.js","sourceRoot":"","sources":["../../../src/features/change-bounds/movement-restrictor.ts"],"names":[],"mappings":";;;;;;;;;AAgBA,yCAAuC;AACvC,qCAA4E;AAC5E,+DAA8D;AAC9D,gEAAwE;AACxE,mCA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AE,GAAG,EAAE,kBAAkB,CAAC,UAAU,EAAE,CAAC,CAAC;AAC5F,CAAC;AATD,8EASC;AAED;;;;;GAKG;AACH,SAAgB,iCAAiC,CAC7C,OAAsB,EACtB,kBAAuC;IAEvC,MAAM,QAAQ,GAAoB,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,OAAO,YAAY,wBAAc,EAAE;QACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,YAAY,qBAAa,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KACnG;IAED,OAAO,sCAAuB,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC,UAAU,EAAE,CAAC,CAAC;AAC/F,CAAC;AAVD,8EAUC"}
|
|
@@ -13,12 +13,27 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Point } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { Point, Writable } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { ISnapper, SModelElement } from 'sprotty';
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* A {@link ISnapper} implementation that snaps all elements onto a fixed gride size.
|
|
20
|
+
* The default grid size is 10x10 pixel.
|
|
21
|
+
* To configure a custom grid size bind the `TYPES.ISnapper` service identifier
|
|
22
|
+
* to constant value, e.g:
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* bind(TYPES.ISnapper).toConstantValue(new GridSnapper({x:25 ,y:25 }));
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
19
28
|
export declare class GridSnapper implements ISnapper {
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
grid: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
};
|
|
33
|
+
constructor(grid?: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
});
|
|
22
37
|
snap(position: Point, element: SModelElement): Point;
|
|
23
38
|
}
|
|
24
39
|
/**
|
|
@@ -32,7 +47,7 @@ export declare class GridSnapper implements ISnapper {
|
|
|
32
47
|
export declare class PointPositionUpdater {
|
|
33
48
|
protected snapper?: ISnapper | undefined;
|
|
34
49
|
protected lastDragPosition?: Point;
|
|
35
|
-
protected positionDelta:
|
|
50
|
+
protected positionDelta: Writable<Point>;
|
|
36
51
|
constructor(snapper?: ISnapper | undefined);
|
|
37
52
|
/**
|
|
38
53
|
* Init the position with the {@link Point} of your mouse cursor.
|