@eclipse-glsp/client 1.1.0-next.d3b810d.243 → 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/css/autocomplete-palette.css +22 -0
- 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/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/autocomplete-palette/autocomplete-suggestion-providers.js +18 -0
- 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/index.d.ts +12 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +62 -48
- 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/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/index.ts +17 -3
|
@@ -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,KAAK,EAAE,CAAC;IACxC,CAAC;IAFe,yBAAM,SAErB,CAAA;AACL,CAAC,EAVgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAUlC;AAqBD,IAAiB,iBAAiB,CAUjC;AAVD,WAAiB,iBAAiB;IACjB,sBAAI,GAAG,mBAAmB,CAAC;IAExC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,iBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,oBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,UAAoB,EAAE,KAAa,EAAE,KAAa;QACrE,OAAO,EAAE,IAAI,EAAE,kBAAA,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACpD,CAAC;IAFe,wBAAM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C/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":"zoom-handler.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/move-zoom/zoom-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAG5F,OAAO,EAEH,iBAAiB,EACjB,cAAc,EACd,QAAQ,EAGR,aAAa,EACb,UAAU,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAA2C,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAE5G;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,MAAM;IAC9C,IAAI,EAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC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AAC,oBAAoB,EAAE,oBAAoB,CAAC;IACpB,SAAS,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACzE,SAAS,CAAC,QAAQ,CAAC,0BAA0B,0CAAqB,iBAAiB,WAA0C;IAE7H,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;IAMhD,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI;IAWlD,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,GAAG,KAAK;IAQtG,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAQ3G,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,UAAU,GAAG,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,iBAAiB;CAanH"}
|
|
@@ -0,0 +1,159 @@
|
|
|
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.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,EAVgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAUlC;AAiBD,IAAiB,iBAAiB,CAUjC;AAVD,WAAiB,iBAAiB;IACjB,sBAAI,GAAG,mBAAmB,CAAC;IAExC,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,iBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,kBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,oBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,UAAoB,EAAE,UAAkB;QAC3D,OAAO,EAAE,IAAI,EAAE,kBAAA,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAFe,wBAAM,SAErB,CAAA;AACL,CAAC,EAVgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAUjC;AAED;oCAC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;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,EAAsB,MAAM,4BAA4B,CAAC;AAKhI,oBAAY,UAAU;IAClB,QAAQ,IAAA;IACR,QAAQ,IAAA;IACR,OAAO,IAAA;CACV;AAED;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM;IAC/C,IAAI,EAAE,OAAO,mBAAmB,CAAC,IAAI,CAAC;IACtC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;CAC1B;AACD,yBAAiB,mBAAmB,CAAC;IAC1B,MAAM,IAAI,wBAAwB,CAAC;IAE1C,SAAgB,EAAE,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,mBAAmB,CAE7D;IAED,SAAgB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,mBAAmB,CAExF;CACJ;AAID,qBACa,oBAAqB,YAAW,cAAc;IAeP,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC;IAb3E,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAEpB,SAAS,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAGzE,MAAM,CAAC,QAAQ,CAAC,cAAc,MAAM;IAGpC,MAAM,CAAC,QAAQ,CAAC,cAAc,MAAM;IACpC,SAAS,CAAC,IAAI;;;MAAsF;IAEpG,SAAS,CAAC,UAAU,UAAS;gBAEsC,OAAO,CAAC,sBAAU;IAMrF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,QAAQ;IAMhD,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI;IAKtD,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,qBAAqB,EAAE,EAAE,MAAM,EAAE,mBAAmB,GAAG,MAAM,EAAE;IA4B1F,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO;CAGhH"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
27
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
28
|
+
};
|
|
29
|
+
var ResizeElementHandler_1;
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.ResizeElementHandler = exports.ResizeElementAction = exports.ResizeType = void 0;
|
|
32
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
33
|
+
const inversify_1 = require("inversify");
|
|
34
|
+
const editor_context_service_1 = require("../../../base/editor-context-service");
|
|
35
|
+
const types_1 = require("../../../base/types");
|
|
36
|
+
const layout_utils_1 = require("../../../utils/layout-utils");
|
|
37
|
+
const smodel_util_1 = require("../../../utils/smodel-util");
|
|
38
|
+
const snap_1 = require("../../change-bounds/snap");
|
|
39
|
+
// eslint-disable-next-line no-shadow
|
|
40
|
+
var ResizeType;
|
|
41
|
+
(function (ResizeType) {
|
|
42
|
+
ResizeType[ResizeType["Increase"] = 0] = "Increase";
|
|
43
|
+
ResizeType[ResizeType["Decrease"] = 1] = "Decrease";
|
|
44
|
+
ResizeType[ResizeType["MinSize"] = 2] = "MinSize";
|
|
45
|
+
})(ResizeType = exports.ResizeType || (exports.ResizeType = {}));
|
|
46
|
+
var ResizeElementAction;
|
|
47
|
+
(function (ResizeElementAction) {
|
|
48
|
+
ResizeElementAction.KIND = 'resizeElementAction';
|
|
49
|
+
function is(object) {
|
|
50
|
+
return protocol_1.Action.hasKind(object, ResizeElementAction.KIND);
|
|
51
|
+
}
|
|
52
|
+
ResizeElementAction.is = is;
|
|
53
|
+
function create(elementIds, resizeType) {
|
|
54
|
+
return { kind: ResizeElementAction.KIND, elementIds, resizeType };
|
|
55
|
+
}
|
|
56
|
+
ResizeElementAction.create = create;
|
|
57
|
+
})(ResizeElementAction = exports.ResizeElementAction || (exports.ResizeElementAction = {}));
|
|
58
|
+
/* The ResizeElementHandler class is an implementation of the IActionHandler interface that handles
|
|
59
|
+
resizing of elements. */
|
|
60
|
+
let ResizeElementHandler = ResizeElementHandler_1 = class ResizeElementHandler {
|
|
61
|
+
constructor(snapper) {
|
|
62
|
+
this.snapper = snapper;
|
|
63
|
+
this.grid = { x: ResizeElementHandler_1.defaultResizeX, y: ResizeElementHandler_1.defaultResizeY };
|
|
64
|
+
this.isEditMode = false;
|
|
65
|
+
if (snapper instanceof snap_1.GridSnapper) {
|
|
66
|
+
this.grid = snapper.grid;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
handle(action) {
|
|
70
|
+
if (ResizeElementAction.is(action)) {
|
|
71
|
+
this.handleResizeElement(action);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
handleResizeElement(action) {
|
|
75
|
+
const elements = (0, smodel_util_1.getElements)(this.editorContextService.modelRoot.index, action.elementIds, smodel_util_1.isSelectableAndBoundsAware);
|
|
76
|
+
this.dispatcher.dispatchAll(this.resize(elements, action));
|
|
77
|
+
}
|
|
78
|
+
resize(elements, action) {
|
|
79
|
+
const actions = [];
|
|
80
|
+
elements.forEach(element => {
|
|
81
|
+
const { x, y, width: oldWidth, height: oldHeight } = element.bounds;
|
|
82
|
+
let width = 0;
|
|
83
|
+
let height = 0;
|
|
84
|
+
if (action.resizeType === ResizeType.Decrease) {
|
|
85
|
+
width = oldWidth - this.grid.x;
|
|
86
|
+
height = oldHeight - this.grid.y;
|
|
87
|
+
}
|
|
88
|
+
else if (action.resizeType === ResizeType.Increase) {
|
|
89
|
+
width = oldWidth + this.grid.x;
|
|
90
|
+
height = oldHeight + this.grid.y;
|
|
91
|
+
}
|
|
92
|
+
else if (action.resizeType === ResizeType.MinSize) {
|
|
93
|
+
width = (0, layout_utils_1.minWidth)(element);
|
|
94
|
+
height = (0, layout_utils_1.minHeight)(element);
|
|
95
|
+
}
|
|
96
|
+
if (this.isValidBoundChange(element, { x, y }, { width, height })) {
|
|
97
|
+
const resizeElement = { id: element.id, bounds: { x, y, width, height } };
|
|
98
|
+
actions.push(protocol_1.ChangeBoundsOperation.create([(0, smodel_util_1.toElementAndBounds)(resizeElement)]));
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return actions;
|
|
102
|
+
}
|
|
103
|
+
isValidBoundChange(element, newPosition, newSize) {
|
|
104
|
+
return (0, layout_utils_1.isValidSize)(element, newSize) && (0, layout_utils_1.isValidMove)(element, newPosition);
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
// Default x resize used if GridSnapper is not provided
|
|
108
|
+
ResizeElementHandler.defaultResizeX = 20;
|
|
109
|
+
// Default y resize used if GridSnapper is not provided
|
|
110
|
+
ResizeElementHandler.defaultResizeY = 20;
|
|
111
|
+
__decorate([
|
|
112
|
+
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
113
|
+
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
114
|
+
], ResizeElementHandler.prototype, "editorContextService", void 0);
|
|
115
|
+
__decorate([
|
|
116
|
+
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
117
|
+
__metadata("design:type", Object)
|
|
118
|
+
], ResizeElementHandler.prototype, "dispatcher", void 0);
|
|
119
|
+
ResizeElementHandler = ResizeElementHandler_1 = __decorate([
|
|
120
|
+
(0, inversify_1.injectable)(),
|
|
121
|
+
__param(0, (0, inversify_1.inject)(types_1.TYPES.ISnapper)),
|
|
122
|
+
__param(0, (0, inversify_1.optional)()),
|
|
123
|
+
__metadata("design:paramtypes", [Object])
|
|
124
|
+
], ResizeElementHandler);
|
|
125
|
+
exports.ResizeElementHandler = ResizeElementHandler;
|
|
126
|
+
//# sourceMappingURL=resize-key-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-key-handler.js","sourceRoot":"","sources":["../../../../src/features/accessibility/resize-key-tool/resize-key-handler.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;;AAElF,qDAAyF;AACzF,yCAAyD;AAEzD,iFAA4E;AAC5E,+CAA4C;AAC5C,8DAA4F;AAC5F,4DAAgI;AAEhI,mDAAuD;AAEvD,qCAAqC;AACrC,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,mDAAQ,CAAA;IACR,mDAAQ,CAAA;IACR,iDAAO,CAAA;AACX,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAUD,IAAiB,mBAAmB,CAUnC;AAVD,WAAiB,mBAAmB;IACnB,wBAAI,GAAG,qBAAqB,CAAC;IAE1C,SAAgB,EAAE,CAAC,MAAW;QAC1B,OAAO,iBAAM,CAAC,OAAO,CAAC,MAAM,EAAE,oBAAA,IAAI,CAAC,CAAC;IACxC,CAAC;IAFe,sBAAE,KAEjB,CAAA;IAED,SAAgB,MAAM,CAAC,UAAoB,EAAE,UAAsB;QAC/D,OAAO,EAAE,IAAI,EAAE,oBAAA,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAClD,CAAC;IAFe,0BAAM,SAErB,CAAA;AACL,CAAC,EAVgB,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAUnC;AAED;wBACwB;AAEjB,IAAM,oBA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AAoB;kEAAC;AAErD;IAAC,IAAA,kBAAM,EAAC,aAAK,CAAC,iBAAiB,CAAC;;wDAAyC;AAJhE,oBAAoB;IADhC,IAAA,sBAAU,GAAE;IAgBI,WAAA,IAAA,kBAAM,EAAC,aAAK,CAAC,QAAQ,CAAC,CAAA;IAAE,WAAA,IAAA,oBAAQ,GAAE,CAAA;;GAftC,oBAAoB,CA+DhC;AA/DY,oDAAoB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { ISnapper, KeyListener, KeyTool, SModelElement } from 'sprotty';
|
|
18
|
+
import { GLSPTool } from '../../../base/tool-manager/glsp-tool-manager';
|
|
19
|
+
import { IMovementRestrictor } from '../../change-bounds/movement-restrictor';
|
|
20
|
+
import { SelectionService } from '../../select/selection-service';
|
|
21
|
+
export declare class ResizeKeyTool implements GLSPTool {
|
|
22
|
+
static ID: string;
|
|
23
|
+
isEditTool: boolean;
|
|
24
|
+
protected readonly keytool: KeyTool;
|
|
25
|
+
readonly movementRestrictor?: IMovementRestrictor;
|
|
26
|
+
readonly snapper?: ISnapper;
|
|
27
|
+
readonly selectionService: SelectionService;
|
|
28
|
+
protected resizeKeyListener: ResizeKeyListener;
|
|
29
|
+
get id(): string;
|
|
30
|
+
enable(): void;
|
|
31
|
+
disable(): void;
|
|
32
|
+
}
|
|
33
|
+
export declare class ResizeKeyListener extends KeyListener {
|
|
34
|
+
protected readonly tool: ResizeKeyTool;
|
|
35
|
+
protected isEditMode: boolean;
|
|
36
|
+
constructor(tool: ResizeKeyTool);
|
|
37
|
+
keyDown(element: SModelElement, event: KeyboardEvent): Action[];
|
|
38
|
+
protected matchesIncreaseSizeKeystroke(event: KeyboardEvent): boolean;
|
|
39
|
+
protected matchesActivateResizeModeKeystroke(event: KeyboardEvent): boolean;
|
|
40
|
+
protected matchesDeactivateResizeModeKeystroke(event: KeyboardEvent): boolean;
|
|
41
|
+
protected matchesMinSizeKeystroke(event: KeyboardEvent): boolean;
|
|
42
|
+
protected matchesDecreaseSizeKeystroke(event: KeyboardEvent): boolean;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=resize-key-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-key-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/resize-key-tool/resize-key-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAA+C,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAErH,OAAO,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAC;AAExE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAGlE,qBACa,aAAc,YAAW,QAAQ;IAC1C,MAAM,CAAC,EAAE,SAA0B;IAEnC,UAAU,UAAQ;IAED,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,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