@eclipse-glsp/client 2.3.0-next.375 → 2.3.0-next.378
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/accessibility/keyboard-pointer/keyboard-pointer-position.d.ts +4 -5
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-position.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-position.js +6 -7
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer-position.js.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts +3 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.d.ts.map +1 -1
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js +5 -0
- package/lib/features/accessibility/keyboard-pointer/keyboard-pointer.js.map +1 -1
- package/lib/features/tools/node-creation/container-manager.d.ts +13 -1
- package/lib/features/tools/node-creation/container-manager.d.ts.map +1 -1
- package/lib/features/tools/node-creation/container-manager.js +9 -1
- package/lib/features/tools/node-creation/container-manager.js.map +1 -1
- package/lib/features/tools/node-creation/node-creation-module.js +1 -1
- package/lib/features/tools/node-creation/node-creation-module.js.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.d.ts +3 -3
- package/lib/features/tools/node-creation/node-creation-tool.d.ts.map +1 -1
- package/lib/features/tools/node-creation/node-creation-tool.js +2 -3
- package/lib/features/tools/node-creation/node-creation-tool.js.map +1 -1
- package/package.json +3 -3
- package/src/features/accessibility/keyboard-pointer/keyboard-pointer-position.ts +8 -10
- package/src/features/accessibility/keyboard-pointer/keyboard-pointer.ts +6 -2
- package/src/features/tools/node-creation/container-manager.ts +18 -2
- package/src/features/tools/node-creation/node-creation-module.ts +1 -1
- package/src/features/tools/node-creation/node-creation-tool.ts +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { GModelElement, Point } from '@eclipse-glsp/sprotty';
|
|
17
|
-
import { Containable } from '../../hints/model';
|
|
18
|
-
import { KeyboardPointer } from './keyboard-pointer';
|
|
19
17
|
import { CursorCSS } from '../../../base/feedback/css-feedback';
|
|
18
|
+
import { ContainerElement } from '../../hints/model';
|
|
19
|
+
import { KeyboardPointer } from './keyboard-pointer';
|
|
20
20
|
export declare class KeyboardPointerPosition {
|
|
21
21
|
protected readonly keyboardPointer: KeyboardPointer;
|
|
22
22
|
renderPosition: Point;
|
|
@@ -25,11 +25,10 @@ export declare class KeyboardPointerPosition {
|
|
|
25
25
|
get diagramPosition(): Point;
|
|
26
26
|
childrenAtDiagramPosition(): GModelElement[];
|
|
27
27
|
containableParentAtDiagramPosition(elementTypeId: string): {
|
|
28
|
-
container:
|
|
28
|
+
container: ContainerElement | undefined;
|
|
29
29
|
status: CursorCSS;
|
|
30
30
|
};
|
|
31
31
|
calcRelativeRenderPosition(x: number, y: number): Point;
|
|
32
32
|
private containableParentOf;
|
|
33
|
-
private isCreationAllowed;
|
|
34
33
|
}
|
|
35
34
|
//# sourceMappingURL=keyboard-pointer-position.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-pointer-position.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-position.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAA+C,aAAa,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"keyboard-pointer-position.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-position.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAA+C,aAAa,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,qBAAa,uBAAuB;IAGpB,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,eAAe;IAFxD,cAAc,EAAE,KAAK,CAAoB;gBAEjB,eAAe,EAAE,eAAe;IAE/D,IAAI,wBAAwB,IAAI,KAAK,CAKpC;IAED,IAAI,eAAe,IAAI,KAAK,CAE3B;IAED,yBAAyB,IAAI,aAAa,EAAE;IAS5C,kCAAkC,CAAC,aAAa,EAAE,MAAM,GAAG;QACvD,SAAS,EAAE,gBAAgB,GAAG,SAAS,CAAC;QACxC,MAAM,EAAE,SAAS,CAAC;KACrB;IAMD,0BAA0B,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK;IAOvD,OAAO,CAAC,mBAAmB;CAY9B"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.KeyboardPointerPosition = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
5
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) 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
|
|
@@ -17,10 +17,10 @@ exports.KeyboardPointerPosition = void 0;
|
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
19
|
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
20
|
-
const
|
|
20
|
+
const css_feedback_1 = require("../../../base/feedback/css-feedback");
|
|
21
21
|
const viewpoint_util_1 = require("../../../utils/viewpoint-util");
|
|
22
|
+
const model_1 = require("../../hints/model");
|
|
22
23
|
const constants_1 = require("./constants");
|
|
23
|
-
const css_feedback_1 = require("../../../base/feedback/css-feedback");
|
|
24
24
|
class KeyboardPointerPosition {
|
|
25
25
|
constructor(keyboardPointer) {
|
|
26
26
|
this.keyboardPointer = keyboardPointer;
|
|
@@ -56,12 +56,11 @@ class KeyboardPointerPosition {
|
|
|
56
56
|
const container = (0, sprotty_1.findParentByFeature)(target, model_1.isContainable);
|
|
57
57
|
return {
|
|
58
58
|
container,
|
|
59
|
-
status: this.isCreationAllowed(container, elementTypeId)
|
|
59
|
+
status: this.keyboardPointer.containerManager.isCreationAllowed(container, elementTypeId)
|
|
60
|
+
? css_feedback_1.CursorCSS.NODE_CREATION
|
|
61
|
+
: css_feedback_1.CursorCSS.OPERATION_NOT_ALLOWED
|
|
60
62
|
};
|
|
61
63
|
}
|
|
62
|
-
isCreationAllowed(container, elementTypeId) {
|
|
63
|
-
return container && container.isContainableElement(elementTypeId);
|
|
64
|
-
}
|
|
65
64
|
}
|
|
66
65
|
exports.KeyboardPointerPosition = KeyboardPointerPosition;
|
|
67
66
|
//# sourceMappingURL=keyboard-pointer-position.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-pointer-position.js","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-position.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAA0G;AAC1G,
|
|
1
|
+
{"version":3,"file":"keyboard-pointer-position.js","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer-position.ts"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AAC,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC;SAC/B,CAAC;IACN,CAAC;IAEO,mBAAmB,CACvB,MAAqB,EACrB,aAAqB;QAErB,MAAM,SAAS,GAAG,IAAA,6BAAmB,EAAC,MAAM,EAAE,qBAAa,CAAC,CAAC;QAC7D,OAAO;YACH,SAAS;YACT,MAAM,EAAE,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,CAAC;gBACrF,CAAC,CAAC,wBAAS,CAAC,aAAa;gBACzB,CAAC,CAAC,wBAAS,CAAC,qBAAqB;SACxC,CAAC;IACN,CAAC;CACJ;AArDD,0DAqDC"}
|
|
@@ -16,14 +16,16 @@
|
|
|
16
16
|
import { Action, GModelRoot, IActionDispatcher, IActionHandler, TriggerNodeCreationAction } from '@eclipse-glsp/sprotty';
|
|
17
17
|
import { EditorContextService } from '../../../base/editor-context-service';
|
|
18
18
|
import { GLSPAbstractUIExtension } from '../../../base/ui-extension/ui-extension';
|
|
19
|
+
import { ContainerManager } from '../../tools/node-creation/container-manager';
|
|
19
20
|
import { KeyboardPointerKeyboardListener } from './keyboard-pointer-listener';
|
|
20
21
|
import { KeyboardPointerPosition } from './keyboard-pointer-position';
|
|
21
22
|
export declare class KeyboardPointer extends GLSPAbstractUIExtension implements IActionHandler {
|
|
22
23
|
protected readonly actionDispatcher: IActionDispatcher;
|
|
23
24
|
protected _triggerAction: TriggerNodeCreationAction;
|
|
25
|
+
editorContextService: EditorContextService;
|
|
26
|
+
containerManager: ContainerManager;
|
|
24
27
|
protected position: KeyboardPointerPosition;
|
|
25
28
|
protected keyListener: KeyboardPointerKeyboardListener;
|
|
26
|
-
editorContextService: EditorContextService;
|
|
27
29
|
constructor(actionDispatcher: IActionDispatcher);
|
|
28
30
|
get triggerAction(): TriggerNodeCreationAction;
|
|
29
31
|
get isVisible(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-pointer.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAS,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEhI,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"keyboard-pointer.d.ts","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAS,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAEhI,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAI/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,qBACa,eAAgB,SAAQ,uBAAwB,YAAW,cAAc;IAcrC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,iBAAiB;IAbnG,SAAS,CAAC,cAAc,EAAE,yBAAyB,CAGjD;IAGK,oBAAoB,EAAE,oBAAoB,CAAC;IAE3C,gBAAgB,EAAE,gBAAgB,CAAC;IAE1C,SAAS,CAAC,QAAQ,EAAE,uBAAuB,CAAqC;IAChF,SAAS,CAAC,WAAW,EAAE,+BAA+B,CAAC;gBAES,gBAAgB,EAAE,iBAAiB;IAMnG,IAAI,aAAa,IAAI,yBAAyB,CAE7C;IAED,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,WAAW,IAAI,uBAAuB,CAEzC;IACD,IAAI,cAAc,IAAI,+BAA+B,CAEpD;IAED,EAAE,IAAI,MAAM;IAIZ,cAAc,IAAI,MAAM;IAIxB,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,WAAW,GAAG,IAAI;cAO9C,YAAY,CAAC,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,GAAG,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI;IAIjI,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAYrC,MAAM,IAAI,IAAI;CAsBjB"}
|
|
@@ -33,6 +33,7 @@ const inversify_1 = require("inversify");
|
|
|
33
33
|
const editor_context_service_1 = require("../../../base/editor-context-service");
|
|
34
34
|
const css_feedback_1 = require("../../../base/feedback/css-feedback");
|
|
35
35
|
const ui_extension_1 = require("../../../base/ui-extension/ui-extension");
|
|
36
|
+
const container_manager_1 = require("../../tools/node-creation/container-manager");
|
|
36
37
|
const action_1 = require("../keyboard-grid/action");
|
|
37
38
|
const actions_1 = require("./actions");
|
|
38
39
|
const constants_1 = require("./constants");
|
|
@@ -116,6 +117,10 @@ __decorate([
|
|
|
116
117
|
(0, inversify_1.inject)(editor_context_service_1.EditorContextService),
|
|
117
118
|
__metadata("design:type", editor_context_service_1.EditorContextService)
|
|
118
119
|
], KeyboardPointer.prototype, "editorContextService", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, inversify_1.inject)(sprotty_1.TYPES.IContainerManager),
|
|
122
|
+
__metadata("design:type", container_manager_1.ContainerManager)
|
|
123
|
+
], KeyboardPointer.prototype, "containerManager", void 0);
|
|
119
124
|
exports.KeyboardPointer = KeyboardPointer = __decorate([
|
|
120
125
|
(0, inversify_1.injectable)(),
|
|
121
126
|
__param(0, (0, inversify_1.inject)(sprotty_1.TYPES.IActionDispatcher)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard-pointer.js","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAAgI;AAChI,yCAA+C;AAC/C,iFAA4E;AAC5E,sEAAgE;AAChE,0EAAkF;AAClF,oDAAyE;AACzE,uCAAmE;AACnE,2CAAsD;AACtD,2EAA8E;AAC9E,2EAAsE;AAG/D,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,sCAAuB;
|
|
1
|
+
{"version":3,"file":"keyboard-pointer.js","sourceRoot":"","sources":["../../../../src/features/accessibility/keyboard-pointer/keyboard-pointer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAAgI;AAChI,yCAA+C;AAC/C,iFAA4E;AAC5E,sEAAgE;AAChE,0EAAkF;AAClF,mFAA+E;AAC/E,oDAAyE;AACzE,uCAAmE;AACnE,2CAAsD;AACtD,2EAA8E;AAC9E,2EAAsE;AAG/D,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,sCAAuB;IAcxD,YAA6C,gBAAsD;QAC/F,KAAK,EAAE,CAAC;QADoD,qBAAgB,GAAhB,gBAAgB,CAAmB;QAbzF,mBAAc,GAA8B;YAClD,aAAa,EAAE,gBAAgB;YAC/B,IAAI,EAAE,qBAAqB;SAC9B,CAAC;QAOQ,aAAQ,GAA4B,IAAI,mDAAuB,CAAC,IAAI,CAAC,CAAC;QAM5E,IAAI,CAAC,WAAW,GAAG,IAAI,2DAA+B,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACnF,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,IAAI,SAAS;;QACT,OAAO,CAAA,MAAA,IAAI,CAAC,gBAAgB,0CAAE,KAAK,CAAC,UAAU,M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BATjC,eAAe;IAD3B,IAAA,sBAAU,GAAE;IAeI,WAAA,IAAA,kBAAM,EAAC,eAAK,CAAC,iBAAiB,CAAC,CAAA;;GAdnC,eAAe,CAwF3B"}
|
|
@@ -33,9 +33,21 @@ export interface TrackedInsert {
|
|
|
33
33
|
valid: boolean;
|
|
34
34
|
options: InsertOptions;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export interface IContainerManager {
|
|
37
|
+
insert(proxy: GModelElement, location: Point, elementTypeId: string, opts?: Partial<InsertOptions>): TrackedInsert;
|
|
38
|
+
isCreationAllowed(container: ContainerElement | undefined, elementTypeId: string, opts?: Partial<InsertOptions>): boolean;
|
|
39
|
+
findContainer(location: Point, ctx: GModelElement, evt?: MouseEvent): ContainerElement | undefined;
|
|
40
|
+
addInsertFeedback(feedback: FeedbackEmitter, trackedInsert: TrackedInsert, ctx?: GModelElement, event?: MouseEvent): FeedbackEmitter;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The default {@link IContainerManager} implementation.
|
|
44
|
+
* This class class manages the insertion of elements into containers by validating their positions and types,
|
|
45
|
+
* providing feedback on the insertion process, and determining the appropriate container based on the location and context.
|
|
46
|
+
*/
|
|
47
|
+
export declare class ContainerManager implements IContainerManager {
|
|
37
48
|
protected readonly changeBoundsManager: ChangeBoundsManager;
|
|
38
49
|
insert(proxy: GModelElement, location: Point, elementTypeId: string, opts?: Partial<InsertOptions>): TrackedInsert;
|
|
50
|
+
isCreationAllowed(container: ContainerElement | undefined, elementTypeId: string, opts?: Partial<InsertOptions>): boolean;
|
|
39
51
|
findContainer(location: Point, ctx: GModelElement, evt?: MouseEvent): ContainerElement | undefined;
|
|
40
52
|
addInsertFeedback(feedback: FeedbackEmitter, trackedInsert: TrackedInsert, ctx?: GModelElement, event?: MouseEvent): FeedbackEmitter;
|
|
41
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-manager.d.ts","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/container-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAA0B,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,iGAAiG;IACjG,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAEtC,kGAAkG;IAClG,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,2EAA2E;IAC3E,GAAG,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAEpC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,KAAK,CAAC;IAChB,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,aAAa,CAAC;CAC1B;AAED,
|
|
1
|
+
{"version":3,"file":"container-manager.d.ts","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/container-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,EAA0B,MAAM,uBAAuB,CAAC;AAGrF,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAiB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAE7E,MAAM,WAAW,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,iGAAiG;IACjG,2BAA2B,CAAC,EAAE,OAAO,CA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E,gBAAgB,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAAG,OAAO;IAIzH,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,UAAU,GAAG,gBAAgB,GAAG,SAAS;IAOlG,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,eAAe;CASvI"}
|
|
@@ -33,18 +33,26 @@ const change_bounds_manager_1 = require("../change-bounds/change-bounds-manager"
|
|
|
33
33
|
exports.DEFAULT_INSERT_OPTIONS = {
|
|
34
34
|
validateLocationInContainer: false
|
|
35
35
|
};
|
|
36
|
+
/**
|
|
37
|
+
* The default {@link IContainerManager} implementation.
|
|
38
|
+
* This class class manages the insertion of elements into containers by validating their positions and types,
|
|
39
|
+
* providing feedback on the insertion process, and determining the appropriate container based on the location and context.
|
|
40
|
+
*/
|
|
36
41
|
let ContainerManager = class ContainerManager {
|
|
37
42
|
insert(proxy, location, elementTypeId, opts) {
|
|
38
43
|
var _a;
|
|
39
44
|
const options = { ...exports.DEFAULT_INSERT_OPTIONS, ...opts };
|
|
40
45
|
const container = this.findContainer(location, proxy, opts === null || opts === void 0 ? void 0 : opts.evt);
|
|
41
|
-
let valid =
|
|
46
|
+
let valid = this.isCreationAllowed(container, elementTypeId, opts);
|
|
42
47
|
if (valid && (!container || options.validateLocationInContainer)) {
|
|
43
48
|
// we need to check whether the location is valid either because we do not have a container or the option is set
|
|
44
49
|
valid = (_a = opts === null || opts === void 0 ? void 0 : opts.validLocationOverwrite) !== null && _a !== void 0 ? _a : this.changeBoundsManager.hasValidPosition(proxy, location);
|
|
45
50
|
}
|
|
46
51
|
return { elementTypeId, container, location, valid, options };
|
|
47
52
|
}
|
|
53
|
+
isCreationAllowed(container, elementTypeId, opts) {
|
|
54
|
+
return !container || container.isContainableElement(elementTypeId);
|
|
55
|
+
}
|
|
48
56
|
findContainer(location, ctx, evt) {
|
|
49
57
|
// reverse order of children to find the innermost, top-rendered containers first
|
|
50
58
|
return (0, sprotty_1.findChildrenAtPosition)(ctx.root, location)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-manager.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/container-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAAqF;AACrF,yCAA+C;AAC/C,sEAAyG;AAEzG,6CAAoE;AACpE,kFAA6E;AAahE,QAAA,sBAAsB,GAAkB;IACjD,2BAA2B,EAAE,KAAK;CACrC,CAAC;
|
|
1
|
+
{"version":3,"file":"container-manager.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/container-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,mDAAqF;AACrF,yCAA+C;AAC/C,sEAAyG;AAEzG,6CAAoE;AACpE,kFAA6E;AAahE,QAAA,sBAAsB,GAAkB;IACjD,2BAA2B,EAAE,KAAK;CACrC,CAAC;AAiBF;;;;GAIG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGzB,MAAM,CAAC,KAAoB,EAAE,QAAe,EAAE,aAAqB,EAAE,IAA6B;;QAC9F,MAAM,OAAO,GAAG,EAAE,GAAG,8BAAsB,EAAE,GAAG,IAAI,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,CAAC,CAAC;QACjE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;QACnE,IAAI,KAAK,IAAI,CAAC,CAAC,SAAS,IAAI,OAAO,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AAO,QAAQ,CAAC;IACpB,CAAC;CACJ,CAAA;AAlCY,4CAAgB;AACuB;IAA/C,IAAA,kBAAM,EAAC,2CAAmB,CAAC;8BAAyC,2CAAmB;6DAAC;2BADhF,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAkC5B"}
|
|
@@ -24,7 +24,7 @@ const node_creation_tool_1 = require("./node-creation-tool");
|
|
|
24
24
|
const node_creation_views_1 = require("./node-creation-views");
|
|
25
25
|
exports.nodeCreationToolModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebind) => {
|
|
26
26
|
const context = { bind, unbind, isBound, rebind };
|
|
27
|
-
|
|
27
|
+
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.IContainerManager, container_manager_1.ContainerManager);
|
|
28
28
|
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.ITool, node_creation_tool_1.NodeCreationTool);
|
|
29
29
|
(0, sprotty_1.configureActionHandler)(context, sprotty_1.TriggerNodeCreationAction.KIND, node_creation_tool_1.NodeCreationTool);
|
|
30
30
|
(0, sprotty_1.configureModelElement)(context, insert_indicator_1.InsertIndicator.TYPE, insert_indicator_1.InsertIndicator, node_creation_views_1.InsertIndicatorView);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-creation-module.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/node-creation-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAO+B;AAC/B,4FAAuF;AACvF,2DAAuD;AACvD,yDAAqD;AACrD,6DAAwD;AACxD,+DAA4D;AAE/C,QAAA,sBAAsB,GAAG,IAAI,uBAAa,CACnD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,
|
|
1
|
+
{"version":3,"file":"node-creation-module.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/node-creation-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAO+B;AAC/B,4FAAuF;AACvF,2DAAuD;AACvD,yDAAqD;AACrD,6DAAwD;AACxD,+DAA4D;AAE/C,QAAA,sBAAsB,GAAG,IAAI,uBAAa,CACnD,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClD,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,iBAAiB,EAAE,oCAAgB,CAAC,CAAC;IAClE,IAAA,uBAAa,EAAC,OAAO,EAAE,eAAK,CAAC,KAAK,EAAE,qCAAgB,CAAC,CAAC;IACtD,IAAA,gCAAsB,EAAC,OAAO,EAAE,mCAAyB,CAAC,IAAI,EAAE,qCAAgB,CAAC,CAAC;IAClF,IAAA,+BAAqB,EAAC,OAAO,EAAE,kCAAe,CAAC,IAAI,EAAE,kCAAe,EAAE,yCAAmB,CAAC,CAAC;AAC/F,CAAC,EACD;IACI,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC;IACrC,QAAQ,EAAE,+CAAqB;CAClC,CACJ,CAAC"}
|
|
@@ -23,12 +23,12 @@ import { MouseTrackingElementPositionListener, PositioningTool } from '../../ele
|
|
|
23
23
|
import { BaseCreationTool } from '../base-tools';
|
|
24
24
|
import { ChangeBoundsManager } from '../change-bounds/change-bounds-manager';
|
|
25
25
|
import { TrackedMove } from '../change-bounds/change-bounds-tracker';
|
|
26
|
-
import {
|
|
26
|
+
import { IContainerManager, TrackedInsert } from './container-manager';
|
|
27
27
|
export declare class NodeCreationTool extends BaseCreationTool<TriggerNodeCreationAction> implements PositioningTool {
|
|
28
28
|
static ID: string;
|
|
29
29
|
protected isTriggerAction: typeof TriggerNodeCreationAction.is;
|
|
30
30
|
readonly changeBoundsManager: ChangeBoundsManager;
|
|
31
|
-
readonly containerManager:
|
|
31
|
+
readonly containerManager: IContainerManager;
|
|
32
32
|
modelFactory: IModelFactory;
|
|
33
33
|
get id(): string;
|
|
34
34
|
doEnable(): void;
|
|
@@ -38,7 +38,7 @@ export declare class NodeCreationTool extends BaseCreationTool<TriggerNodeCreati
|
|
|
38
38
|
protected createNodeCreationCursorFeedback(): FeedbackEmitter;
|
|
39
39
|
}
|
|
40
40
|
export interface ContainerPositioningTool extends PositioningTool {
|
|
41
|
-
readonly containerManager:
|
|
41
|
+
readonly containerManager: IContainerManager;
|
|
42
42
|
}
|
|
43
43
|
export declare class NodeInsertTrackingListener extends MouseTrackingElementPositionListener {
|
|
44
44
|
protected elementTypeId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-creation-tool.d.ts","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/node-creation-tool.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,IAAI,EAIJ,UAAU,EAEV,aAAa,EACb,YAAY,EACZ,aAAa,EAGb,yBAAyB,EAI5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,oCAAoC,EAAE,eAAe,EAAE,MAAM,iEAAiE,CAAC;AAExI,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,
|
|
1
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AAM,EAAE,aAAa,GAAG,MAAM;IAQlG,SAAS,CAAC,0BAA0B,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS;IAgBpH,SAAS,CAAC,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM;IAUhE,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,SAAS;IAK7F,SAAS,CAAC,gBAAgB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,aAAa;IAQhF,SAAS,CAAC,yBAAyB,IAAI,IAAI;IAIlC,OAAO,IAAI,IAAI;CAI3B"}
|
|
@@ -37,7 +37,6 @@ const mouse_tracking_element_position_listener_1 = require("../../element-templa
|
|
|
37
37
|
const remove_template_element_1 = require("../../element-template/remove-template-element");
|
|
38
38
|
const base_tools_1 = require("../base-tools");
|
|
39
39
|
const change_bounds_manager_1 = require("../change-bounds/change-bounds-manager");
|
|
40
|
-
const container_manager_1 = require("./container-manager");
|
|
41
40
|
const insert_indicator_1 = require("./insert-indicator");
|
|
42
41
|
let NodeCreationTool = NodeCreationTool_1 = class NodeCreationTool extends base_tools_1.BaseCreationTool {
|
|
43
42
|
constructor() {
|
|
@@ -76,8 +75,8 @@ __decorate([
|
|
|
76
75
|
__metadata("design:type", change_bounds_manager_1.ChangeBoundsManager)
|
|
77
76
|
], NodeCreationTool.prototype, "changeBoundsManager", void 0);
|
|
78
77
|
__decorate([
|
|
79
|
-
(0, inversify_1.inject)(
|
|
80
|
-
__metadata("design:type",
|
|
78
|
+
(0, inversify_1.inject)(sprotty_1.TYPES.IContainerManager),
|
|
79
|
+
__metadata("design:type", Object)
|
|
81
80
|
], NodeCreationTool.prototype, "containerManager", void 0);
|
|
82
81
|
__decorate([
|
|
83
82
|
(0, inversify_1.inject)(sprotty_1.TYPES.IModelFactory),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-creation-tool.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/node-creation-tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAiB+B;AAC/B,yCAA+C;AAC/C,6CAA2C;AAC3C,uFAAiF;AAEjF,sEAAqH;AAErH,0DAA2E;AAE3E,sFAA8G;AAC9G,8HAAwI;AACxI,4FAA8F;AAC9F,8CAAiD;AACjD,kFAA6E;
|
|
1
|
+
{"version":3,"file":"node-creation-tool.js","sourceRoot":"","sources":["../../../../src/features/tools/node-creation/node-creation-tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAiB+B;AAC/B,yCAA+C;AAC/C,6CAA2C;AAC3C,uFAAiF;AAEjF,sEAAqH;AAErH,0DAA2E;AAE3E,sFAA8G;AAC9G,8HAAwI;AACxI,4FAA8F;AAC9F,8CAAiD;AACjD,kFAA6E;AAG7E,yDAAqD;AAG9C,IAAM,gBAAgB,wBAAtB,MAAM,gBAAiB,SAAQ,6BAA2C;IAA1E;;QAGO,oBAAe,GAAG,mCAAyB,CAAC,EAAE,CAAC;IAwC7D,CAAC;IAlCG,IAAI,EAAE;QACF,OAAO,kBAAgB,CAAC,EAAE,CAAC;IAC/B,CAAC;IAED,QAAQ;;QACJ,MAAM,YAAY,GAAG,MAAA,IAAI,CAAC,aAAa,CAAC,YAAY,mCAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,EAAE,CAAC;QACnI,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;QACrF,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,YAAY,CAAC,CAAC,CA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": "A sprotty-based client for GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"watch": "tsc -w"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@eclipse-glsp/sprotty": "2.3.0-next.
|
|
49
|
+
"@eclipse-glsp/sprotty": "2.3.0-next.378+96fdfd3",
|
|
50
50
|
"autocompleter": "^9.1.2",
|
|
51
51
|
"file-saver": "^2.0.5",
|
|
52
52
|
"lodash": "4.17.21",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "96fdfd31fdaa7e6be26e61edd1862b8090d919c3"
|
|
67
67
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 Business Informatics Group (TU Wien) and others.
|
|
2
|
+
* Copyright (c) 2023-2024 Business Informatics Group (TU Wien) and others.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made available under the
|
|
5
5
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { findChildrenAtPosition, findParentByFeature, GModelElement, Point } from '@eclipse-glsp/sprotty';
|
|
17
|
-
import {
|
|
17
|
+
import { CursorCSS } from '../../../base/feedback/css-feedback';
|
|
18
18
|
import { getAbsolutePositionByPoint } from '../../../utils/viewpoint-util';
|
|
19
|
+
import { ContainerElement, isContainable } from '../../hints/model';
|
|
19
20
|
import { KeyboardPointerMetadata } from './constants';
|
|
20
21
|
import { KeyboardPointer } from './keyboard-pointer';
|
|
21
|
-
import { CursorCSS } from '../../../base/feedback/css-feedback';
|
|
22
22
|
|
|
23
23
|
export class KeyboardPointerPosition {
|
|
24
24
|
public renderPosition: Point = { x: 20, y: 20 };
|
|
@@ -46,7 +46,7 @@ export class KeyboardPointerPosition {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
containableParentAtDiagramPosition(elementTypeId: string): {
|
|
49
|
-
container:
|
|
49
|
+
container: ContainerElement | undefined;
|
|
50
50
|
status: CursorCSS;
|
|
51
51
|
} {
|
|
52
52
|
const children = this.childrenAtDiagramPosition();
|
|
@@ -64,15 +64,13 @@ export class KeyboardPointerPosition {
|
|
|
64
64
|
private containableParentOf(
|
|
65
65
|
target: GModelElement,
|
|
66
66
|
elementTypeId: string
|
|
67
|
-
): { container:
|
|
67
|
+
): { container: ContainerElement | undefined; status: CursorCSS } {
|
|
68
68
|
const container = findParentByFeature(target, isContainable);
|
|
69
69
|
return {
|
|
70
70
|
container,
|
|
71
|
-
status: this.isCreationAllowed(container, elementTypeId)
|
|
71
|
+
status: this.keyboardPointer.containerManager.isCreationAllowed(container, elementTypeId)
|
|
72
|
+
? CursorCSS.NODE_CREATION
|
|
73
|
+
: CursorCSS.OPERATION_NOT_ALLOWED
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
private isCreationAllowed(container: (GModelElement & Containable) | undefined, elementTypeId: string): boolean | undefined {
|
|
76
|
-
return container && container.isContainableElement(elementTypeId);
|
|
77
|
-
}
|
|
78
76
|
}
|
|
@@ -18,6 +18,7 @@ import { inject, injectable } from 'inversify';
|
|
|
18
18
|
import { EditorContextService } from '../../../base/editor-context-service';
|
|
19
19
|
import { CursorCSS } from '../../../base/feedback/css-feedback';
|
|
20
20
|
import { GLSPAbstractUIExtension } from '../../../base/ui-extension/ui-extension';
|
|
21
|
+
import { ContainerManager } from '../../tools/node-creation/container-manager';
|
|
21
22
|
import { KeyboardGridCellSelectedAction } from '../keyboard-grid/action';
|
|
22
23
|
import { SetKeyboardPointerRenderPositionAction } from './actions';
|
|
23
24
|
import { KeyboardPointerMetadata } from './constants';
|
|
@@ -31,10 +32,13 @@ export class KeyboardPointer extends GLSPAbstractUIExtension implements IActionH
|
|
|
31
32
|
kind: 'triggerNodeCreation'
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
protected position: KeyboardPointerPosition = new KeyboardPointerPosition(this);
|
|
35
|
-
protected keyListener: KeyboardPointerKeyboardListener;
|
|
36
35
|
@inject(EditorContextService)
|
|
37
36
|
public editorContextService: EditorContextService;
|
|
37
|
+
@inject(TYPES.IContainerManager)
|
|
38
|
+
public containerManager: ContainerManager;
|
|
39
|
+
|
|
40
|
+
protected position: KeyboardPointerPosition = new KeyboardPointerPosition(this);
|
|
41
|
+
protected keyListener: KeyboardPointerKeyboardListener;
|
|
38
42
|
|
|
39
43
|
constructor(@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: IActionDispatcher) {
|
|
40
44
|
super();
|
|
@@ -44,14 +44,26 @@ export interface TrackedInsert {
|
|
|
44
44
|
options: InsertOptions;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export interface IContainerManager {
|
|
48
|
+
insert(proxy: GModelElement, location: Point, elementTypeId: string, opts?: Partial<InsertOptions>): TrackedInsert;
|
|
49
|
+
isCreationAllowed(container: ContainerElement | undefined, elementTypeId: string, opts?: Partial<InsertOptions>): boolean;
|
|
50
|
+
findContainer(location: Point, ctx: GModelElement, evt?: MouseEvent): ContainerElement | undefined;
|
|
51
|
+
addInsertFeedback(feedback: FeedbackEmitter, trackedInsert: TrackedInsert, ctx?: GModelElement, event?: MouseEvent): FeedbackEmitter;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The default {@link IContainerManager} implementation.
|
|
56
|
+
* This class class manages the insertion of elements into containers by validating their positions and types,
|
|
57
|
+
* providing feedback on the insertion process, and determining the appropriate container based on the location and context.
|
|
58
|
+
*/
|
|
47
59
|
@injectable()
|
|
48
|
-
export class ContainerManager {
|
|
60
|
+
export class ContainerManager implements IContainerManager {
|
|
49
61
|
@inject(ChangeBoundsManager) protected readonly changeBoundsManager: ChangeBoundsManager;
|
|
50
62
|
|
|
51
63
|
insert(proxy: GModelElement, location: Point, elementTypeId: string, opts?: Partial<InsertOptions>): TrackedInsert {
|
|
52
64
|
const options = { ...DEFAULT_INSERT_OPTIONS, ...opts };
|
|
53
65
|
const container = this.findContainer(location, proxy, opts?.evt);
|
|
54
|
-
let valid =
|
|
66
|
+
let valid = this.isCreationAllowed(container, elementTypeId, opts);
|
|
55
67
|
if (valid && (!container || options.validateLocationInContainer)) {
|
|
56
68
|
// we need to check whether the location is valid either because we do not have a container or the option is set
|
|
57
69
|
valid = opts?.validLocationOverwrite ?? this.changeBoundsManager.hasValidPosition(proxy, location);
|
|
@@ -59,6 +71,10 @@ export class ContainerManager {
|
|
|
59
71
|
return { elementTypeId, container, location, valid, options };
|
|
60
72
|
}
|
|
61
73
|
|
|
74
|
+
isCreationAllowed(container: ContainerElement | undefined, elementTypeId: string, opts?: Partial<InsertOptions>): boolean {
|
|
75
|
+
return !container || container.isContainableElement(elementTypeId);
|
|
76
|
+
}
|
|
77
|
+
|
|
62
78
|
findContainer(location: Point, ctx: GModelElement, evt?: MouseEvent): ContainerElement | undefined {
|
|
63
79
|
// reverse order of children to find the innermost, top-rendered containers first
|
|
64
80
|
return findChildrenAtPosition(ctx.root, location)
|
|
@@ -30,7 +30,7 @@ import { InsertIndicatorView } from './node-creation-views';
|
|
|
30
30
|
export const nodeCreationToolModule = new FeatureModule(
|
|
31
31
|
(bind, unbind, isBound, rebind) => {
|
|
32
32
|
const context = { bind, unbind, isBound, rebind };
|
|
33
|
-
|
|
33
|
+
bindAsService(context, TYPES.IContainerManager, ContainerManager);
|
|
34
34
|
bindAsService(context, TYPES.ITool, NodeCreationTool);
|
|
35
35
|
configureActionHandler(context, TriggerNodeCreationAction.KIND, NodeCreationTool);
|
|
36
36
|
configureModelElement(context, InsertIndicator.TYPE, InsertIndicator, InsertIndicatorView);
|
|
@@ -45,7 +45,7 @@ import { RemoveTemplateElementsAction } from '../../element-template/remove-temp
|
|
|
45
45
|
import { BaseCreationTool } from '../base-tools';
|
|
46
46
|
import { ChangeBoundsManager } from '../change-bounds/change-bounds-manager';
|
|
47
47
|
import { TrackedMove } from '../change-bounds/change-bounds-tracker';
|
|
48
|
-
import {
|
|
48
|
+
import { IContainerManager, TrackedInsert } from './container-manager';
|
|
49
49
|
import { InsertIndicator } from './insert-indicator';
|
|
50
50
|
|
|
51
51
|
@injectable()
|
|
@@ -55,7 +55,7 @@ export class NodeCreationTool extends BaseCreationTool<TriggerNodeCreationAction
|
|
|
55
55
|
protected isTriggerAction = TriggerNodeCreationAction.is;
|
|
56
56
|
|
|
57
57
|
@inject(ChangeBoundsManager) readonly changeBoundsManager: ChangeBoundsManager;
|
|
58
|
-
@inject(
|
|
58
|
+
@inject(TYPES.IContainerManager) readonly containerManager: IContainerManager;
|
|
59
59
|
@inject(TYPES.IModelFactory) modelFactory: IModelFactory;
|
|
60
60
|
|
|
61
61
|
get id(): string {
|
|
@@ -95,7 +95,7 @@ export class NodeCreationTool extends BaseCreationTool<TriggerNodeCreationAction
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
export interface ContainerPositioningTool extends PositioningTool {
|
|
98
|
-
readonly containerManager:
|
|
98
|
+
readonly containerManager: IContainerManager;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export class NodeInsertTrackingListener extends MouseTrackingElementPositionListener {
|