@eclipse-glsp/client 1.1.0-next.d4c9817.234 → 1.1.0-next.d81a1ea.249
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{lib/features/change-bounds/snap.spec.d.ts → css/autocomplete-palette.css} +8 -3
- package/css/glsp-sprotty.css +16 -1
- package/lib/base/auto-complete/auto-complete-widget.d.ts +8 -2
- package/lib/base/auto-complete/auto-complete-widget.d.ts.map +1 -1
- package/lib/base/auto-complete/auto-complete-widget.js +25 -6
- package/lib/base/auto-complete/auto-complete-widget.js.map +1 -1
- package/lib/base/container-modules.d.ts +1 -1
- package/lib/base/container-modules.d.ts.map +1 -1
- package/lib/base/container-modules.js +42 -40
- package/lib/base/container-modules.js.map +1 -1
- package/lib/features/accessibility/di.config.d.ts +21 -0
- package/lib/features/accessibility/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/di.config.js +34 -0
- package/lib/features/accessibility/di.config.js.map +1 -0
- package/lib/features/accessibility/move-zoom/di.config.d.ts +23 -0
- package/lib/features/accessibility/move-zoom/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/move-zoom/di.config.js +41 -0
- package/lib/features/accessibility/move-zoom/di.config.js.map +1 -0
- package/lib/features/accessibility/move-zoom/move-handler.d.ts +81 -0
- package/lib/features/accessibility/move-zoom/move-handler.d.ts.map +1 -0
- package/lib/features/accessibility/move-zoom/move-handler.js +173 -0
- package/lib/features/accessibility/move-zoom/move-handler.js.map +1 -0
- package/lib/features/accessibility/move-zoom/zoom-handler.d.ts +74 -0
- package/lib/features/accessibility/move-zoom/zoom-handler.d.ts.map +1 -0
- package/lib/features/accessibility/move-zoom/zoom-handler.js +159 -0
- package/lib/features/accessibility/move-zoom/zoom-handler.js.map +1 -0
- package/lib/features/accessibility/resize-key-tool/di.config.d.ts +23 -0
- package/lib/features/accessibility/resize-key-tool/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/resize-key-tool/di.config.js +38 -0
- package/lib/features/accessibility/resize-key-tool/di.config.js.map +1 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts +55 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.d.ts.map +1 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js +126 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-handler.js.map +1 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts +44 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.d.ts.map +1 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js +127 -0
- package/lib/features/accessibility/resize-key-tool/resize-key-tool.js.map +1 -0
- package/lib/features/accessibility/search/di.config.d.ts +20 -0
- package/lib/features/accessibility/search/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/search/di.config.js +33 -0
- package/lib/features/accessibility/search/di.config.js.map +1 -0
- package/lib/features/accessibility/search/search-palette.d.ts +47 -0
- package/lib/features/accessibility/search/search-palette.d.ts.map +1 -0
- package/lib/features/accessibility/search/search-palette.js +155 -0
- package/lib/features/accessibility/search/search-palette.js.map +1 -0
- package/lib/features/accessibility/search/search-tool.d.ts +30 -0
- package/lib/features/accessibility/search/search-tool.d.ts.map +1 -0
- package/lib/features/accessibility/search/search-tool.js +73 -0
- package/lib/features/accessibility/search/search-tool.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts +35 -0
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.d.ts.map +1 -0
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js +87 -0
- package/lib/features/accessibility/view-key-tools/deselect-key-tool.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/di.config.d.ts +20 -0
- package/lib/features/accessibility/view-key-tools/di.config.d.ts.map +1 -0
- package/lib/features/accessibility/view-key-tools/di.config.js +35 -0
- package/lib/features/accessibility/view-key-tools/di.config.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts +49 -0
- package/lib/features/accessibility/view-key-tools/movement-key-tool.d.ts.map +1 -0
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js +131 -0
- package/lib/features/accessibility/view-key-tools/movement-key-tool.js.map +1 -0
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts +43 -0
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.d.ts.map +1 -0
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js +109 -0
- package/lib/features/accessibility/view-key-tools/zoom-key-tool.js.map +1 -0
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.d.ts +35 -0
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.d.ts.map +1 -0
- package/lib/features/{tools/marquee-behavior.spec.d.ts → autocomplete-palette/autocomplete-suggestion-providers.js} +4 -3
- package/lib/features/autocomplete-palette/autocomplete-suggestion-providers.js.map +1 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.d.ts +41 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.d.ts.map +1 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js +82 -0
- package/lib/features/autocomplete-palette/base-autocomplete-palette.js.map +1 -0
- package/lib/features/svg-metadata/di.config.d.ts +19 -0
- package/lib/features/svg-metadata/di.config.d.ts.map +1 -0
- package/lib/features/svg-metadata/di.config.js +26 -0
- package/lib/features/svg-metadata/di.config.js.map +1 -0
- package/lib/features/svg-metadata/metadata-placer.d.ts +24 -0
- package/lib/features/svg-metadata/metadata-placer.d.ts.map +1 -0
- package/lib/features/svg-metadata/metadata-placer.js +63 -0
- package/lib/features/svg-metadata/metadata-placer.js.map +1 -0
- package/lib/features/tool-feedback/creation-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/creation-tool-feedback.js +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.d.ts +1 -1
- package/lib/features/tool-feedback/edge-edit-tool-feedback.js +1 -1
- package/lib/index.d.ts +12 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +62 -45
- package/lib/index.js.map +1 -1
- package/package.json +5 -3
- package/src/base/auto-complete/auto-complete-widget.ts +31 -7
- package/src/base/container-modules.ts +3 -1
- package/src/features/accessibility/README.md +65 -0
- package/src/features/accessibility/di.config.ts +32 -0
- package/src/features/accessibility/move-zoom/di.config.ts +43 -0
- package/src/features/accessibility/move-zoom/move-handler.ts +198 -0
- package/src/features/accessibility/move-zoom/zoom-handler.ts +178 -0
- package/src/features/accessibility/resize-key-tool/di.config.ts +37 -0
- package/src/features/accessibility/resize-key-tool/resize-key-handler.ts +120 -0
- package/src/features/accessibility/resize-key-tool/resize-key-tool.ts +108 -0
- package/src/features/accessibility/search/di.config.ts +31 -0
- package/src/features/accessibility/search/search-palette.ts +181 -0
- package/src/features/accessibility/search/search-tool.ts +60 -0
- package/src/features/accessibility/view-key-tools/deselect-key-tool.ts +80 -0
- package/src/features/accessibility/view-key-tools/di.config.ts +33 -0
- package/src/features/accessibility/view-key-tools/movement-key-tool.ts +115 -0
- package/src/features/accessibility/view-key-tools/zoom-key-tool.ts +94 -0
- package/src/features/autocomplete-palette/autocomplete-suggestion-providers.ts +37 -0
- package/src/features/autocomplete-palette/base-autocomplete-palette.ts +88 -0
- package/src/features/svg-metadata/di.config.ts +26 -0
- package/src/features/svg-metadata/metadata-placer.ts +51 -0
- package/src/features/tool-feedback/creation-tool-feedback.ts +1 -1
- package/src/features/tool-feedback/edge-edit-tool-feedback.ts +1 -1
- package/src/index.ts +18 -1
- package/lib/features/bounds/freeform-layout.spec.d.ts +0 -3
- package/lib/features/bounds/freeform-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/freeform-layout.spec.js +0 -201
- package/lib/features/bounds/freeform-layout.spec.js.map +0 -1
- package/lib/features/bounds/hbox-layout.spec.d.ts +0 -3
- package/lib/features/bounds/hbox-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/hbox-layout.spec.js +0 -161
- package/lib/features/bounds/hbox-layout.spec.js.map +0 -1
- package/lib/features/bounds/layouter-test-util.spec.d.ts +0 -33
- package/lib/features/bounds/layouter-test-util.spec.d.ts.map +0 -1
- package/lib/features/bounds/layouter-test-util.spec.js +0 -96
- package/lib/features/bounds/layouter-test-util.spec.js.map +0 -1
- package/lib/features/bounds/vbox-layout.spec.d.ts +0 -3
- package/lib/features/bounds/vbox-layout.spec.d.ts.map +0 -1
- package/lib/features/bounds/vbox-layout.spec.js +0 -161
- package/lib/features/bounds/vbox-layout.spec.js.map +0 -1
- package/lib/features/change-bounds/snap.spec.d.ts.map +0 -1
- package/lib/features/change-bounds/snap.spec.js +0 -82
- package/lib/features/change-bounds/snap.spec.js.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.d.ts +0 -3
- package/lib/features/layout/layout-elements-action.spec.d.ts.map +0 -1
- package/lib/features/layout/layout-elements-action.spec.js +0 -325
- package/lib/features/layout/layout-elements-action.spec.js.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts +0 -3
- package/lib/features/navigation/navigation-target-resolver.spec.d.ts.map +0 -1
- package/lib/features/navigation/navigation-target-resolver.spec.js +0 -54
- package/lib/features/navigation/navigation-target-resolver.spec.js.map +0 -1
- package/lib/features/select/selection-service.spec.d.ts +0 -2
- package/lib/features/select/selection-service.spec.d.ts.map +0 -1
- package/lib/features/select/selection-service.spec.js +0 -363
- package/lib/features/select/selection-service.spec.js.map +0 -1
- package/lib/features/tools/marquee-behavior.spec.d.ts.map +0 -1
- package/lib/features/tools/marquee-behavior.spec.js +0 -165
- package/lib/features/tools/marquee-behavior.spec.js.map +0 -1
- package/lib/features/validation/marker-navigator.spec.d.ts +0 -3
- package/lib/features/validation/marker-navigator.spec.d.ts.map +0 -1
- package/lib/features/validation/marker-navigator.spec.js +0 -169
- package/lib/features/validation/marker-navigator.spec.js.map +0 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.MoveElementHandler = exports.MoveViewportHandler = exports.MoveElementAction = exports.MoveViewportAction = void 0;
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const lodash_1 = require("lodash");
|
|
31
|
+
const sprotty_1 = require("sprotty");
|
|
32
|
+
const editor_context_service_1 = require("../../../base/editor-context-service");
|
|
33
|
+
const types_1 = require("../../../base/types");
|
|
34
|
+
const smodel_util_1 = require("../../../utils/smodel-util");
|
|
35
|
+
var MoveViewportAction;
|
|
36
|
+
(function (MoveViewportAction) {
|
|
37
|
+
MoveViewportAction.KIND = 'moveViewportAction';
|
|
38
|
+
function is(object) {
|
|
39
|
+
return protocol_1.Action.hasKind(object, MoveViewportAction.KIND);
|
|
40
|
+
}
|
|
41
|
+
MoveViewportAction.is = is;
|
|
42
|
+
function create(moveX, moveY) {
|
|
43
|
+
return { kind: MoveViewportAction.KIND, moveX, moveY };
|
|
44
|
+
}
|
|
45
|
+
MoveViewportAction.create = create;
|
|
46
|
+
})(MoveViewportAction = exports.MoveViewportAction || (exports.MoveViewportAction = {}));
|
|
47
|
+
var MoveElementAction;
|
|
48
|
+
(function (MoveElementAction) {
|
|
49
|
+
MoveElementAction.KIND = 'moveElementAction';
|
|
50
|
+
function is(object) {
|
|
51
|
+
return protocol_1.Action.hasKind(object, MoveElementAction.KIND);
|
|
52
|
+
}
|
|
53
|
+
MoveElementAction.is = is;
|
|
54
|
+
function create(elementIds, moveX, moveY) {
|
|
55
|
+
return { kind: MoveElementAction.KIND, elementIds, moveX, moveY };
|
|
56
|
+
}
|
|
57
|
+
MoveElementAction.create = create;
|
|
58
|
+
})(MoveElementAction = exports.MoveElementAction || (exports.MoveElementAction = {}));
|
|
59
|
+
/* The MoveViewportHandler class is an implementation of the IActionHandler interface that handles
|
|
60
|
+
moving of the viewport. */
|
|
61
|
+
let MoveViewportHandler = class MoveViewportHandler {
|
|
62
|
+
constructor() {
|
|
63
|
+
this.throttledHandleViewportMove = (0, lodash_1.throttle)((action) => this.handleMoveViewport(action), 150);
|
|
64
|
+
}
|
|
65
|
+
handle(action) {
|
|
66
|
+
if (MoveViewportAction.is(action)) {
|
|
67
|
+
this.throttledHandleViewportMove(action);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
handleMoveViewport(action) {
|
|
71
|
+
const viewport = (0, sprotty_1.findParentByFeature)(this.editorContextService.modelRoot, sprotty_1.isViewport);
|
|
72
|
+
if (!viewport) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.dispatcher.dispatch(this.moveViewport(viewport, action.moveX, action.moveY));
|
|
76
|
+
}
|
|
77
|
+
moveViewport(viewport, offsetX, offSetY) {
|
|
78
|
+
const newViewport = {
|
|
79
|
+
scroll: {
|
|
80
|
+
x: viewport.scroll.x + offsetX,
|
|
81
|
+
y: viewport.scroll.y + offSetY
|
|
82
|
+
},
|
|
83
|
+
zoom: viewport.zoom
|
|
84
|
+
};
|
|
85
|
+
return protocol_1.SetViewportAction.create(viewport.id, newViewport, { animate: true });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
90
|
+
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
91
|
+
], MoveViewportHandler.prototype, "editorContextService", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], MoveViewportHandler.prototype, "dispatcher", void 0);
|
|
96
|
+
MoveViewportHandler = __decorate([
|
|
97
|
+
(0, inversify_1.injectable)()
|
|
98
|
+
], MoveViewportHandler);
|
|
99
|
+
exports.MoveViewportHandler = MoveViewportHandler;
|
|
100
|
+
/* The MoveElementHandler class is an implementation of the IActionHandler interface that handles
|
|
101
|
+
moving elements. */
|
|
102
|
+
let MoveElementHandler = class MoveElementHandler {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.throttledHandleElementMove = (0, lodash_1.throttle)((action) => this.handleMoveElement(action), 150);
|
|
105
|
+
}
|
|
106
|
+
handle(action) {
|
|
107
|
+
if (MoveElementAction.is(action)) {
|
|
108
|
+
this.throttledHandleElementMove(action);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
handleMoveElement(action) {
|
|
112
|
+
const viewport = (0, sprotty_1.findParentByFeature)(this.editorContextService.modelRoot, sprotty_1.isViewport);
|
|
113
|
+
if (!viewport) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const elements = (0, smodel_util_1.getElements)(this.editorContextService.modelRoot.index, action.elementIds, smodel_util_1.isSelectableAndBoundsAware);
|
|
117
|
+
this.dispatcher.dispatchAll(this.move(viewport, elements, action.moveX, action.moveY));
|
|
118
|
+
}
|
|
119
|
+
getBounds(element, offSetX, offSetY) {
|
|
120
|
+
return { x: element.bounds.x + offSetX, y: element.bounds.y + offSetY };
|
|
121
|
+
}
|
|
122
|
+
adaptViewport(viewport, newPoint, moveX, moveY) {
|
|
123
|
+
if (newPoint.x < viewport.scroll.x ||
|
|
124
|
+
newPoint.x > viewport.scroll.x + viewport.canvasBounds.width ||
|
|
125
|
+
newPoint.y < viewport.scroll.y ||
|
|
126
|
+
newPoint.y > viewport.scroll.y + viewport.canvasBounds.height) {
|
|
127
|
+
return MoveViewportAction.create(moveX, moveY);
|
|
128
|
+
}
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
moveElement(element, offSetX, offSetY) {
|
|
132
|
+
return protocol_1.ChangeBoundsOperation.create([
|
|
133
|
+
{
|
|
134
|
+
elementId: element.id,
|
|
135
|
+
newSize: {
|
|
136
|
+
width: element.bounds.width,
|
|
137
|
+
height: element.bounds.height
|
|
138
|
+
},
|
|
139
|
+
newPosition: {
|
|
140
|
+
x: element.bounds.x + offSetX,
|
|
141
|
+
y: element.bounds.y + offSetY
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]);
|
|
145
|
+
}
|
|
146
|
+
move(viewport, selectedElements, deltaX, deltaY) {
|
|
147
|
+
const results = [];
|
|
148
|
+
if (selectedElements.length !== 0) {
|
|
149
|
+
selectedElements.forEach(currentElement => {
|
|
150
|
+
results.push(this.moveElement(currentElement, deltaX, deltaY));
|
|
151
|
+
const newPosition = this.getBounds(currentElement, deltaX, deltaY);
|
|
152
|
+
const viewportAction = this.adaptViewport(viewport, newPosition, deltaX, deltaY);
|
|
153
|
+
if (viewportAction) {
|
|
154
|
+
results.push(viewportAction);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return results;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
163
|
+
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
164
|
+
], MoveElementHandler.prototype, "editorContextService", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
167
|
+
__metadata("design:type", Object)
|
|
168
|
+
], MoveElementHandler.prototype, "dispatcher", void 0);
|
|
169
|
+
MoveElementHandler = __decorate([
|
|
170
|
+
(0, inversify_1.injectable)()
|
|
171
|
+
], MoveElementHandler);
|
|
172
|
+
exports.MoveElementHandler = MoveElementHandler;
|
|
173
|
+
//# sourceMappingURL=move-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-handler.js","sourceRoot":"","sources":["../../../../src/features/accessibility/move-zoom/move-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA2G;AAC3G,yCAA+C;AAC/C,mCAAkC;AAClC,qCAAmH;AACnH,iFAA4E;AAC5E,+CAA4C;AAC5C,4DAA4G;AAiB5G,IAAiB,kBAAkB,CAUlC;AAVD,WAAiB,kBAAkB;IAClB,uBAAI,GAAG,oBAAoB,CAAC;IAEzC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,iBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,qBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,KAAa,EAAE,KAAa;QAC/C,OAAO,EAAE,IAAI,EAAE,mBAAA,IAAI,EAAE,KAAK,EAAE,KAA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,MAAM,CAAC,MAAM;iBAChC;gBACD,WAAW,EAAE;oBACT,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO;oBAC7B,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO;iBAChC;aACJ;SACJ,CAAC,CAAC;IACP,CAAC;IAES,IAAI,CAAC,QAA+B,EAAE,gBAAyC,EAAE,MAAc,EAAE,MAAc;QACrH,MAAM,OAAO,GAAa,EAAE,CAAC;QAE7B,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,gBAAgB,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE;gBACtC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;gBAC/D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;gBACnE,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;gBACjF,IAAI,cAAc,EAAE;oBAChB,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;iBAChC;YACL,CAAC,CAAC,CAAC;SACN;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AA1EG;IAAC,IAAA,kBAAM,EAAC,6CAAoB,CAAC;8BACG,6CAAoB;gEAAC;AACrD;IAAC,IAAA,kBAAM,EAAC,aAAK,CAAC,iBAAiB,CAAC;;sDAAyC;AAHhE,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CA2E9B;AA3EY,gDAAkB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
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
|
+
import { Action, Bounds, Point, SetViewportAction, Viewport } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { IActionDispatcher, IActionHandler, ICommand, SModelElement, SModelRoot } from 'sprotty';
|
|
18
|
+
import { EditorContextService } from '../../../base/editor-context-service';
|
|
19
|
+
import { SelectableBoundsAware } from '../../../utils/smodel-util';
|
|
20
|
+
/**
|
|
21
|
+
* Action for triggering zooming of the viewport.
|
|
22
|
+
*/
|
|
23
|
+
export interface ZoomViewportAction extends Action {
|
|
24
|
+
kind: typeof ZoomViewportAction.KIND;
|
|
25
|
+
/**
|
|
26
|
+
* used to specify the amount by which the viewport should be zoomed
|
|
27
|
+
*/
|
|
28
|
+
zoomFactor: number;
|
|
29
|
+
}
|
|
30
|
+
export declare namespace ZoomViewportAction {
|
|
31
|
+
const KIND = "zoomViewportAction";
|
|
32
|
+
function is(object: any): object is ZoomViewportAction;
|
|
33
|
+
function create(zoomFactor: number): ZoomViewportAction;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Action for triggering zooming of the elements..
|
|
37
|
+
*/
|
|
38
|
+
export interface ZoomElementAction extends Action {
|
|
39
|
+
kind: typeof ZoomElementAction.KIND;
|
|
40
|
+
/**
|
|
41
|
+
* used to specify the elements to be zoomed in/out
|
|
42
|
+
*/
|
|
43
|
+
elementIds: string[];
|
|
44
|
+
/**
|
|
45
|
+
* used to specify the amount by which the viewport should be zoomed
|
|
46
|
+
*/
|
|
47
|
+
zoomFactor: number;
|
|
48
|
+
}
|
|
49
|
+
export declare namespace ZoomElementAction {
|
|
50
|
+
const KIND = "zoomElementAction";
|
|
51
|
+
function is(object: any): object is ZoomElementAction;
|
|
52
|
+
function create(elementIds: string[], zoomFactor: number): ZoomElementAction;
|
|
53
|
+
}
|
|
54
|
+
export declare class ZoomViewportHandler implements IActionHandler {
|
|
55
|
+
protected editorContextService: EditorContextService;
|
|
56
|
+
static readonly defaultZoomInFactor = 1.1;
|
|
57
|
+
static readonly defaultZoomOutFactor = 0.9;
|
|
58
|
+
protected dispatcher: IActionDispatcher;
|
|
59
|
+
protected readonly throttledHandleViewportZoom: import("lodash").DebouncedFunc<(action: ZoomViewportAction) => void>;
|
|
60
|
+
handle(action: Action): void;
|
|
61
|
+
handleZoomViewport(action: ZoomViewportAction): void;
|
|
62
|
+
protected setNewZoomFactor(viewport: SModelRoot & Viewport, zoomFactor: number): SetViewportAction;
|
|
63
|
+
}
|
|
64
|
+
export declare class ZoomElementHandler implements IActionHandler {
|
|
65
|
+
protected editorContextService: EditorContextService;
|
|
66
|
+
protected dispatcher: IActionDispatcher;
|
|
67
|
+
protected readonly throttledHandleElementZoom: import("lodash").DebouncedFunc<(action: ZoomElementAction) => void>;
|
|
68
|
+
handle(action: Action): void | Action | ICommand;
|
|
69
|
+
handleZoomElement(action: ZoomElementAction): void;
|
|
70
|
+
protected getCenter(viewport: SModelRoot & Viewport, selectedElements: SelectableBoundsAware[]): Point;
|
|
71
|
+
protected boundsInViewport(viewport: SModelRoot & Viewport, element: SModelElement, bounds: Bounds): Bounds;
|
|
72
|
+
protected setNewZoomFactor(viewport: SModelRoot & Viewport, zoomFactor: number, point: Point): SetViewportAction;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=zoom-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"z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
|
|
3
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.ZoomElementHandler = exports.ZoomViewportHandler = exports.ZoomElementAction = exports.ZoomViewportAction = void 0;
|
|
28
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
29
|
+
const inversify_1 = require("inversify");
|
|
30
|
+
const lodash_1 = require("lodash");
|
|
31
|
+
const sprotty_1 = require("sprotty");
|
|
32
|
+
const editor_context_service_1 = require("../../../base/editor-context-service");
|
|
33
|
+
const types_1 = require("../../../base/types");
|
|
34
|
+
const smodel_util_1 = require("../../../utils/smodel-util");
|
|
35
|
+
var ZoomViewportAction;
|
|
36
|
+
(function (ZoomViewportAction) {
|
|
37
|
+
ZoomViewportAction.KIND = 'zoomViewportAction';
|
|
38
|
+
function is(object) {
|
|
39
|
+
return protocol_1.Action.hasKind(object, ZoomViewportAction.KIND);
|
|
40
|
+
}
|
|
41
|
+
ZoomViewportAction.is = is;
|
|
42
|
+
function create(zoomFactor) {
|
|
43
|
+
return { kind: ZoomViewportAction.KIND, zoomFactor };
|
|
44
|
+
}
|
|
45
|
+
ZoomViewportAction.create = create;
|
|
46
|
+
})(ZoomViewportAction = exports.ZoomViewportAction || (exports.ZoomViewportAction = {}));
|
|
47
|
+
var ZoomElementAction;
|
|
48
|
+
(function (ZoomElementAction) {
|
|
49
|
+
ZoomElementAction.KIND = 'zoomElementAction';
|
|
50
|
+
function is(object) {
|
|
51
|
+
return protocol_1.Action.hasKind(object, ZoomElementAction.KIND);
|
|
52
|
+
}
|
|
53
|
+
ZoomElementAction.is = is;
|
|
54
|
+
function create(elementIds, zoomFactor) {
|
|
55
|
+
return { kind: ZoomElementAction.KIND, elementIds, zoomFactor };
|
|
56
|
+
}
|
|
57
|
+
ZoomElementAction.create = create;
|
|
58
|
+
})(ZoomElementAction = exports.ZoomElementAction || (exports.ZoomElementAction = {}));
|
|
59
|
+
/* The ZoomViewportHandler class is an implementation of the IActionHandler interface that handles
|
|
60
|
+
zooming in and out of a viewport. */
|
|
61
|
+
let ZoomViewportHandler = class ZoomViewportHandler {
|
|
62
|
+
constructor() {
|
|
63
|
+
this.throttledHandleViewportZoom = (0, lodash_1.throttle)((action) => this.handleZoomViewport(action), 150);
|
|
64
|
+
}
|
|
65
|
+
handle(action) {
|
|
66
|
+
if (ZoomViewportAction.is(action)) {
|
|
67
|
+
this.throttledHandleViewportZoom(action);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
handleZoomViewport(action) {
|
|
71
|
+
const viewport = (0, sprotty_1.findParentByFeature)(this.editorContextService.modelRoot, sprotty_1.isViewport);
|
|
72
|
+
if (!viewport) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.dispatcher.dispatch(this.setNewZoomFactor(viewport, action.zoomFactor));
|
|
76
|
+
}
|
|
77
|
+
setNewZoomFactor(viewport, zoomFactor) {
|
|
78
|
+
const newZoom = viewport.zoom * zoomFactor;
|
|
79
|
+
const newViewport = {
|
|
80
|
+
scroll: viewport.scroll,
|
|
81
|
+
zoom: newZoom
|
|
82
|
+
};
|
|
83
|
+
return protocol_1.SetViewportAction.create(viewport.id, newViewport, { animate: true });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
ZoomViewportHandler.defaultZoomInFactor = 1.1;
|
|
87
|
+
ZoomViewportHandler.defaultZoomOutFactor = 0.9;
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
90
|
+
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
91
|
+
], ZoomViewportHandler.prototype, "editorContextService", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
94
|
+
__metadata("design:type", Object)
|
|
95
|
+
], ZoomViewportHandler.prototype, "dispatcher", void 0);
|
|
96
|
+
ZoomViewportHandler = __decorate([
|
|
97
|
+
(0, inversify_1.injectable)()
|
|
98
|
+
], ZoomViewportHandler);
|
|
99
|
+
exports.ZoomViewportHandler = ZoomViewportHandler;
|
|
100
|
+
/* The ZoomElementHandler class is an implementation of the IActionHandler interface that handles
|
|
101
|
+
zooming in and out of elements. */
|
|
102
|
+
let ZoomElementHandler = class ZoomElementHandler {
|
|
103
|
+
constructor() {
|
|
104
|
+
this.throttledHandleElementZoom = (0, lodash_1.throttle)((action) => this.handleZoomElement(action), 150);
|
|
105
|
+
}
|
|
106
|
+
handle(action) {
|
|
107
|
+
if (ZoomElementAction.is(action)) {
|
|
108
|
+
this.throttledHandleElementZoom(action);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
handleZoomElement(action) {
|
|
112
|
+
const viewport = (0, sprotty_1.findParentByFeature)(this.editorContextService.modelRoot, sprotty_1.isViewport);
|
|
113
|
+
if (!viewport) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const elements = (0, smodel_util_1.getElements)(this.editorContextService.modelRoot.index, action.elementIds, smodel_util_1.isSelectableAndBoundsAware);
|
|
117
|
+
const center = this.getCenter(viewport, elements);
|
|
118
|
+
this.dispatcher.dispatch(this.setNewZoomFactor(viewport, action.zoomFactor, center));
|
|
119
|
+
}
|
|
120
|
+
getCenter(viewport, selectedElements) {
|
|
121
|
+
// Get bounds of elements based on the viewport
|
|
122
|
+
const allBounds = selectedElements.map(e => this.boundsInViewport(viewport, e, e.bounds));
|
|
123
|
+
const mergedBounds = allBounds.reduce((b0, b1) => protocol_1.Bounds.combine(b0, b1));
|
|
124
|
+
return protocol_1.Bounds.center(mergedBounds);
|
|
125
|
+
}
|
|
126
|
+
// copy from center-fit.ts, translates the children bounds to the viewport bounds
|
|
127
|
+
boundsInViewport(viewport, element, bounds) {
|
|
128
|
+
if (element instanceof sprotty_1.SChildElement && element.parent !== viewport) {
|
|
129
|
+
return this.boundsInViewport(viewport, element.parent, element.parent.localToParent(bounds));
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
return bounds;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
setNewZoomFactor(viewport, zoomFactor, point) {
|
|
136
|
+
const newZoom = viewport.zoom * zoomFactor;
|
|
137
|
+
const newViewport = {
|
|
138
|
+
scroll: {
|
|
139
|
+
x: point.x - (0.5 * viewport.canvasBounds.width) / newZoom,
|
|
140
|
+
y: point.y - (0.5 * viewport.canvasBounds.height) / newZoom
|
|
141
|
+
},
|
|
142
|
+
zoom: newZoom
|
|
143
|
+
};
|
|
144
|
+
return protocol_1.SetViewportAction.create(viewport.id, newViewport, { animate: true });
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
__decorate([
|
|
148
|
+
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
149
|
+
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
150
|
+
], ZoomElementHandler.prototype, "editorContextService", void 0);
|
|
151
|
+
__decorate([
|
|
152
|
+
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
153
|
+
__metadata("design:type", Object)
|
|
154
|
+
], ZoomElementHandler.prototype, "dispatcher", void 0);
|
|
155
|
+
ZoomElementHandler = __decorate([
|
|
156
|
+
(0, inversify_1.injectable)()
|
|
157
|
+
], ZoomElementHandler);
|
|
158
|
+
exports.ZoomElementHandler = ZoomElementHandler;
|
|
159
|
+
//# sourceMappingURL=zoom-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-handler.js","sourceRoot":"","sources":["../../../../src/features/accessibility/move-zoom/zoom-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,qDAA4F;AAC5F,yCAA+C;AAC/C,mCAAkC;AAClC,qCASiB;AACjB,iFAA4E;AAC5E,+CAA4C;AAC5C,4DAA4G;AAa5G,IAAiB,kBAAkB,CAUlC;AAVD,WAAiB,kBAAkB;IAClB,uBAAI,GAAG,oBAAoB,CAAC;IAEzC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,iBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,mBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,qBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,UAAkB;QACrC,OAAO,EAAE,IAAI,EAAE,mBAAA,IAAI,EAAE,UAAU,EAAE,CAAC;IACtC,CAAC;IAFe,yBAAM,SAErB,CAAA;AACL,CAAC,EA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Q,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,OAAO;gBAC1D,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,OAAO;aAC9D;YACD,IAAI,EAAE,OAAO;SAChB,CAAC;QAEF,OAAO,4BAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IACjF,CAAC;CACJ,CAAA;AAnDG;IAAC,IAAA,kBAAM,EAAC,6CAAoB,CAAC;8BACG,6CAAoB;gEAAC;AACrD;IAAC,IAAA,kBAAM,EAAC,aAAK,CAAC,iBAAiB,CAAC;;sDAAyC;AAHhE,kBAAkB;IAD9B,IAAA,sBAAU,GAAE;GACA,kBAAkB,CAoD9B;AApDY,gDAAkB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
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
|
+
import { BindingContext } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { ContainerModule } from 'inversify';
|
|
18
|
+
/**
|
|
19
|
+
* Handles resize actions.
|
|
20
|
+
*/
|
|
21
|
+
export declare const glspResizeKeyModule: ContainerModule;
|
|
22
|
+
export declare function configureResizeTools(context: BindingContext): void;
|
|
23
|
+
//# sourceMappingURL=di.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/resize-key-tool/di.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAiB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C;;GAEG;AACH,eAAO,MAAM,mBAAmB,iBAG9B,CAAC;AAEH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAKlE"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
*
|
|
9
|
+
* This Source Code may also be made available under the following Secondary
|
|
10
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
* with the GNU Classpath Exception which is available at
|
|
13
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
*
|
|
15
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
|
+
********************************************************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.configureResizeTools = exports.glspResizeKeyModule = void 0;
|
|
19
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
20
|
+
const inversify_1 = require("inversify");
|
|
21
|
+
const sprotty_1 = require("sprotty");
|
|
22
|
+
const types_1 = require("../../../base/types");
|
|
23
|
+
const resize_key_handler_1 = require("./resize-key-handler");
|
|
24
|
+
const resize_key_tool_1 = require("./resize-key-tool");
|
|
25
|
+
/**
|
|
26
|
+
* Handles resize actions.
|
|
27
|
+
*/
|
|
28
|
+
exports.glspResizeKeyModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
29
|
+
const context = { bind, unbind, isBound, rebind };
|
|
30
|
+
configureResizeTools(context);
|
|
31
|
+
});
|
|
32
|
+
function configureResizeTools(context) {
|
|
33
|
+
context.bind(resize_key_handler_1.ResizeElementHandler).toSelf().inSingletonScope();
|
|
34
|
+
(0, sprotty_1.configureActionHandler)(context, resize_key_handler_1.ResizeElementAction.KIND, resize_key_handler_1.ResizeElementHandler);
|
|
35
|
+
(0, protocol_1.bindAsService)(context, types_1.TYPES.IDefaultTool, resize_key_tool_1.ResizeKeyTool);
|
|
36
|
+
}
|
|
37
|
+
exports.configureResizeTools = configureResizeTools;
|
|
38
|
+
//# sourceMappingURL=di.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../../../src/features/accessibility/resize-key-tool/di.config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,qDAAuE;AACvE,yCAA4C;AAC5C,qCAAiD;AACjD,+CAA4C;AAC5C,6DAAiF;AACjF,uDAAkD;AAElD;;GAEG;AACU,QAAA,mBAAmB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IACrF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC,CAAC,CAAC;AAEH,SAAgB,oBAAoB,CAAC,OAAuB;IACxD,OAAO,CAAC,IAAI,CAAC,yCAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAE/D,IAAA,gCAAsB,EAAC,OAAO,EAAE,wCAAmB,CAAC,IAAI,EAAE,yCAAoB,CAAC,CAAC;IAChF,IAAA,wBAAa,EAAC,OAAO,EAAE,aAAK,CAAC,YAAY,EAAE,+BAAa,CAAC,CAAC;AAC9D,CAAC;AALD,oDAKC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
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
|
+
import { Action, Dimension, Point } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { IActionDispatcher, IActionHandler, ICommand, ISnapper } from 'sprotty';
|
|
18
|
+
import { EditorContextService } from '../../../base/editor-context-service';
|
|
19
|
+
import { SelectableBoundsAware } from '../../../utils/smodel-util';
|
|
20
|
+
export declare enum ResizeType {
|
|
21
|
+
Increase = 0,
|
|
22
|
+
Decrease = 1,
|
|
23
|
+
MinSize = 2
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Action for triggering resizing of elements.
|
|
27
|
+
*/
|
|
28
|
+
export interface ResizeElementAction extends Action {
|
|
29
|
+
kind: typeof ResizeElementAction.KIND;
|
|
30
|
+
elementIds: string[];
|
|
31
|
+
resizeType: ResizeType;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace ResizeElementAction {
|
|
34
|
+
const KIND = "resizeElementAction";
|
|
35
|
+
function is(object: any): object is ResizeElementAction;
|
|
36
|
+
function create(elementIds: string[], resizeType: ResizeType): ResizeElementAction;
|
|
37
|
+
}
|
|
38
|
+
export declare class ResizeElementHandler implements IActionHandler {
|
|
39
|
+
protected readonly snapper?: ISnapper | undefined;
|
|
40
|
+
protected editorContextService: EditorContextService;
|
|
41
|
+
protected dispatcher: IActionDispatcher;
|
|
42
|
+
static readonly defaultResizeX = 20;
|
|
43
|
+
static readonly defaultResizeY = 20;
|
|
44
|
+
protected grid: {
|
|
45
|
+
x: number;
|
|
46
|
+
y: number;
|
|
47
|
+
};
|
|
48
|
+
protected isEditMode: boolean;
|
|
49
|
+
constructor(snapper?: ISnapper | undefined);
|
|
50
|
+
handle(action: Action): void | Action | ICommand;
|
|
51
|
+
handleResizeElement(action: ResizeElementAction): void;
|
|
52
|
+
protected resize(elements: SelectableBoundsAware[], action: ResizeElementAction): Action[];
|
|
53
|
+
protected isValidBoundChange(element: SelectableBoundsAware, newPosition: Point, newSize: Dimension): boolean;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=resize-key-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-key-handler.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/resize-key-tool/resize-key-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAyB,SAAS,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAEzF,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAiC,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAG5E,OAAO,EAA2C,qBAAqB,EAA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