@eclipse-glsp/client 0.10.0-next.c94277c.176 → 1.1.0-next.26c3266.182
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/decoration.css +5 -1
- package/css/glsp-sprotty.css +39 -0
- package/css/tool-palette.css +2 -2
- package/lib/base/container-modules.js +8 -8
- package/lib/base/container-modules.js.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts +5 -7
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map +1 -1
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js +7 -14
- package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts +0 -1
- package/lib/features/mouse-tool/mouse-tool.d.ts.map +1 -1
- package/lib/features/mouse-tool/mouse-tool.js +0 -3
- package/lib/features/mouse-tool/mouse-tool.js.map +1 -1
- package/lib/features/select/select-mouse-listener.d.ts +3 -1
- package/lib/features/select/select-mouse-listener.d.ts.map +1 -1
- package/lib/features/select/select-mouse-listener.js +62 -0
- package/lib/features/select/select-mouse-listener.js.map +1 -1
- package/lib/features/source-model-watcher/di.config.d.ts +4 -0
- package/lib/features/{model-source-watcher → source-model-watcher}/di.config.d.ts.map +1 -1
- package/lib/features/{model-source-watcher → source-model-watcher}/di.config.js +4 -4
- package/lib/features/{model-source-watcher → source-model-watcher}/di.config.js.map +1 -1
- package/lib/features/{model-source-watcher/model-source-changed-action-handler.d.ts → source-model-watcher/source-model-changed-action-handler.d.ts} +9 -9
- package/lib/features/{model-source-watcher/model-source-changed-action-handler.d.ts.map → source-model-watcher/source-model-changed-action-handler.d.ts.map} +1 -1
- package/lib/features/{model-source-watcher/model-source-changed-action-handler.js → source-model-watcher/source-model-changed-action-handler.js} +19 -19
- package/lib/features/{model-source-watcher/model-source-changed-action-handler.js.map → source-model-watcher/source-model-changed-action-handler.js.map} +1 -1
- package/lib/features/validation/issue-marker.d.ts +10 -5
- package/lib/features/validation/issue-marker.d.ts.map +1 -1
- package/lib/features/validation/issue-marker.js +12 -4
- package/lib/features/validation/issue-marker.js.map +1 -1
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +5 -1
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -11
- package/lib/index.js.map +1 -1
- package/lib/views/glsp-projection-view.d.ts +30 -0
- package/lib/views/glsp-projection-view.d.ts.map +1 -0
- package/lib/views/glsp-projection-view.js +142 -0
- package/lib/views/glsp-projection-view.js.map +1 -0
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.d.ts.map +1 -1
- package/lib/views/index.js +1 -0
- package/lib/views/index.js.map +1 -1
- package/package.json +4 -4
- package/src/base/container-modules.ts +2 -2
- package/src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts +19 -25
- package/src/features/mouse-tool/mouse-tool.ts +0 -4
- package/src/features/select/select-mouse-listener.ts +81 -1
- package/src/features/{model-source-watcher → source-model-watcher}/di.config.ts +5 -5
- package/src/features/{model-source-watcher/model-source-changed-action-handler.ts → source-model-watcher/source-model-changed-action-handler.ts} +12 -12
- package/src/features/validation/issue-marker.ts +22 -12
- package/src/features/validation/validate.ts +6 -3
- package/src/index.ts +3 -3
- package/src/views/glsp-projection-view.tsx +166 -0
- package/src/views/index.ts +2 -0
- package/lib/features/model-source-watcher/di.config.d.ts +0 -4
package/css/decoration.css
CHANGED
|
@@ -23,16 +23,20 @@
|
|
|
23
23
|
|
|
24
24
|
.sprotty-issue-background {
|
|
25
25
|
fill: var(--glsp-issue-background);
|
|
26
|
+
background-color: var(--glsp-issue-background);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
.sprotty-issue.sprotty-error {
|
|
29
30
|
fill: var(--glsp-error-foreground);
|
|
31
|
+
background-color: var(--glsp-error-foreground);
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
.sprotty-issue.sprotty-warning {
|
|
33
35
|
fill: var(--glsp-warning-foreground);
|
|
36
|
+
background-color: var(--glsp-warning-foreground);
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
.sprotty-issue.sprotty-info {
|
|
37
40
|
fill: var(--glsp-info-foreground);
|
|
38
|
-
|
|
41
|
+
background-color: var(--glsp-info-foreground);
|
|
42
|
+
}
|
package/css/glsp-sprotty.css
CHANGED
|
@@ -215,3 +215,42 @@ text {
|
|
|
215
215
|
font-size: 8pt;
|
|
216
216
|
text-anchor: middle;
|
|
217
217
|
}
|
|
218
|
+
|
|
219
|
+
.glsp-projection {
|
|
220
|
+
width: 40%;
|
|
221
|
+
opacity: 1;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.sprotty-projection-bar.vertical.bordered-projection-bar {
|
|
225
|
+
width: var(--theia-scrollbar-rail-width);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.sprotty-projection-bar.horizontal.bordered-projection-bar {
|
|
229
|
+
height: var(--theia-scrollbar-rail-width);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.projection-scroll-bar {
|
|
233
|
+
transition: opacity 0.8s linear;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.mouse-enter .projection-scroll-bar {
|
|
237
|
+
opacity: 0.3;
|
|
238
|
+
background: transparent;
|
|
239
|
+
background-color: #aaa;
|
|
240
|
+
z-index: 1;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.mouse-leave .projection-scroll-bar {
|
|
244
|
+
opacity: 0;
|
|
245
|
+
pointer-events: none;
|
|
246
|
+
background: transparent;
|
|
247
|
+
background-color: #aaa;
|
|
248
|
+
z-index: 1;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.bordered-projection-bar {
|
|
252
|
+
border-left: 1px solid rgba(212, 212, 212, 0.2);
|
|
253
|
+
border-top: 1px solid rgba(212, 212, 212, 0.2);
|
|
254
|
+
fill: transparent;
|
|
255
|
+
width: var(--theia-scrollbar-rail-width);
|
|
256
|
+
}
|
package/css/tool-palette.css
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
/* Css for main container */
|
|
18
18
|
.tool-palette {
|
|
19
19
|
position: absolute;
|
|
20
|
-
right:
|
|
20
|
+
right: 40px;
|
|
21
21
|
top: 25px;
|
|
22
22
|
text-align: center;
|
|
23
23
|
width: 225px;
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
|
|
141
141
|
.minimize-palette-button {
|
|
142
142
|
position: absolute;
|
|
143
|
-
right:
|
|
143
|
+
right: 20px;
|
|
144
144
|
top: 35px;
|
|
145
145
|
z-index: 1000;
|
|
146
146
|
}
|
|
@@ -26,10 +26,10 @@ const di_config_5 = require("../features/edit-label/di.config");
|
|
|
26
26
|
const di_config_6 = require("../features/hints/di.config");
|
|
27
27
|
const di_config_7 = require("../features/hover/di.config");
|
|
28
28
|
const di_config_8 = require("../features/layout/di.config");
|
|
29
|
-
const di_config_9 = require("../features/
|
|
30
|
-
const di_config_10 = require("../features/
|
|
31
|
-
const di_config_11 = require("../features/
|
|
32
|
-
const di_config_12 = require("../features/
|
|
29
|
+
const di_config_9 = require("../features/mouse-tool/di.config");
|
|
30
|
+
const di_config_10 = require("../features/navigation/di.config");
|
|
31
|
+
const di_config_11 = require("../features/select/di.config");
|
|
32
|
+
const di_config_12 = require("../features/source-model-watcher/di.config");
|
|
33
33
|
const di_config_13 = require("../features/tool-feedback/di.config");
|
|
34
34
|
const di_config_14 = require("../features/tool-palette/di.config");
|
|
35
35
|
const di_config_15 = require("../features/tools/di.config");
|
|
@@ -51,8 +51,8 @@ exports.DEFAULT_MODULES = [
|
|
|
51
51
|
di_config_4.default,
|
|
52
52
|
di_config_5.default,
|
|
53
53
|
di_config_7.default,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
di_config_9.default,
|
|
55
|
+
di_config_11.default,
|
|
56
56
|
di_config_3.glspServerCopyPasteModule,
|
|
57
57
|
di_config_17.default,
|
|
58
58
|
sprotty_1.labelEditUiModule,
|
|
@@ -60,8 +60,8 @@ exports.DEFAULT_MODULES = [
|
|
|
60
60
|
di_config_16.markerNavigatorModule,
|
|
61
61
|
di_config_6.default,
|
|
62
62
|
sprotty_1.modelSourceModule,
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
di_config_12.default,
|
|
64
|
+
di_config_10.navigationModule,
|
|
65
65
|
sprotty_1.openModule,
|
|
66
66
|
di_config_14.default,
|
|
67
67
|
sprotty_1.routingModule,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-modules.js","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAAuD;AACvD,qCAciB;AACjB,qEAA6E;AAC7E,kEAAuE;AACvE,gEAA6E;AAC7E,gEAAoE;AACpE,gEAAmE;AACnE,2DAA2D;AAC3D,2DAA0D;AAC1D,4DAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"container-modules.js","sourceRoot":"","sources":["../../src/base/container-modules.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAAuD;AACvD,qCAciB;AACjB,qEAA6E;AAC7E,kEAAuE;AACvE,gEAA6E;AAC7E,gEAAoE;AACpE,gEAAmE;AACnE,2DAA2D;AAC3D,2DAA0D;AAC1D,4DAAwD;AACxD,gEAAmE;AACnE,iEAAoE;AACpE,6DAA4D;AAC5D,2EAAkF;AAClF,oEAAqE;AACrE,mEAAmE;AACnE,4DAA+F;AAC/F,iEAA2F;AAC3F,+DAAgE;AAChE,4CAA4C;AAE/B,QAAA,eAAe,GAAG;IAC3B,uBAAa;IACb,oBAAiB;IACjB,sBAAY;IACZ,sBAAY;IACZ,gCAAsB;IACtB,0BAAgB;IAChB,sBAAY;IACZ,sBAAY;IACZ,oBAAU;IACV,mBAAwB;IACxB,mBAAqB;IACrB,mBAAoB;IACpB,mBAAmB;IACnB,mBAAe;IACf,mBAAmB;IACnB,oBAAgB;IAChB,qCAAyB;IACzB,oBAAkB;IAClB,2BAAiB;IACjB,mBAAY;IACZ,kCAAqB;IACrB,mBAAgB;IAChB,2BAAiB;IACjB,oBAAwB;IACxB,6BAAgB;IAChB,oBAAU;IACV,oBAAiB;IACjB,uBAAa;IACb,oBAAkB;IAClB,wBAAW;IACX,gDAAmC;IACnC,6BAAgB;IAChB,sBAAY;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAgB,qBAAqB,CAAC,GAAG,OAA0B;IAC/D,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAClC,SAAS,CAAC,IAAI,CAAC,GAAG,uBAAe,EAAE,GAAG,OAAO,CAAC,CAAC;IAC/C,OAAO,SAAS,CAAC;AACrB,CAAC;AAJD,sDAIC"}
|
|
@@ -17,25 +17,23 @@ import { Action } from '@eclipse-glsp/protocol';
|
|
|
17
17
|
import { ContextMenuProviderRegistry, IContextMenuServiceProvider, MouseListener, SModelElement } from 'sprotty';
|
|
18
18
|
import { SelectionService } from '../select/selection-service';
|
|
19
19
|
export declare class SelectionServiceAwareContextMenuMouseListener extends MouseListener {
|
|
20
|
-
protected readonly contextMenuService
|
|
21
|
-
protected readonly menuProvider
|
|
20
|
+
protected readonly contextMenuService?: IContextMenuServiceProvider;
|
|
21
|
+
protected readonly menuProvider?: ContextMenuProviderRegistry;
|
|
22
22
|
protected selectionService: SelectionService;
|
|
23
23
|
/**
|
|
24
|
-
* Opens the context menu
|
|
24
|
+
* Opens the context menu.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
contextMenu(target: SModelElement, event: MouseEvent): (Action | Promise<Action>)[];
|
|
27
27
|
/**
|
|
28
28
|
* Opens the context menu.
|
|
29
29
|
*
|
|
30
|
-
* - query the element on the click-target
|
|
31
|
-
* - select the element
|
|
32
30
|
* - query the context menu service and the context menu elements
|
|
33
31
|
* - show the context menu
|
|
34
32
|
* - send a focus state change to indicate that the diagram becomes inactive, once the context menu is shown
|
|
35
33
|
*
|
|
36
34
|
* When the context menu is closed, we focus the diagram element again.
|
|
37
35
|
*/
|
|
38
|
-
protected openContextMenu(
|
|
36
|
+
protected openContextMenu(target: SModelElement, event: MouseEvent): Promise<Action>[];
|
|
39
37
|
protected focusEventTarget(event: MouseEvent): void;
|
|
40
38
|
}
|
|
41
39
|
//# sourceMappingURL=selection-service-aware-context-menu-mouse-listener.d.ts.map
|
package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-service-aware-context-menu-mouse-listener.d.ts","sourceRoot":"","sources":["../../../src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,
|
|
1
|
+
{"version":3,"file":"selection-service-aware-context-menu-mouse-listener.d.ts","sourceRoot":"","sources":["../../../src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAEhD,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGjH,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,qBACa,6CAA8C,SAAQ,aAAa;IAG5E,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,2BAA2B,CAAC;IAIpE,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAG9D,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE7C;;OAEG;IACM,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;IAI5F;;;;;;;;OAQG;IACH,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE;IActF,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;CAOtD"}
|
|
@@ -17,32 +17,25 @@ const types_1 = require("../../base/types");
|
|
|
17
17
|
const selection_service_1 = require("../select/selection-service");
|
|
18
18
|
let SelectionServiceAwareContextMenuMouseListener = class SelectionServiceAwareContextMenuMouseListener extends sprotty_1.MouseListener {
|
|
19
19
|
/**
|
|
20
|
-
* Opens the context menu
|
|
20
|
+
* Opens the context menu.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return this.openContextMenu(event, target);
|
|
25
|
-
}
|
|
26
|
-
return [];
|
|
22
|
+
contextMenu(target, event) {
|
|
23
|
+
return this.openContextMenu(target, event);
|
|
27
24
|
}
|
|
28
25
|
/**
|
|
29
26
|
* Opens the context menu.
|
|
30
27
|
*
|
|
31
|
-
* - query the element on the click-target
|
|
32
|
-
* - select the element
|
|
33
28
|
* - query the context menu service and the context menu elements
|
|
34
29
|
* - show the context menu
|
|
35
30
|
* - send a focus state change to indicate that the diagram becomes inactive, once the context menu is shown
|
|
36
31
|
*
|
|
37
32
|
* When the context menu is closed, we focus the diagram element again.
|
|
38
33
|
*/
|
|
39
|
-
openContextMenu(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (selectableTarget) {
|
|
43
|
-
selectableTarget.selected = true;
|
|
44
|
-
this.selectionService.updateSelection(target.root, [selectableTarget.id], []);
|
|
34
|
+
openContextMenu(target, event) {
|
|
35
|
+
if (!this.contextMenuService || !this.menuProvider) {
|
|
36
|
+
return [];
|
|
45
37
|
}
|
|
38
|
+
const mousePosition = { x: event.x, y: event.y };
|
|
46
39
|
const result = Promise.all([this.contextMenuService(), this.menuProvider.getItems(target.root, mousePosition)])
|
|
47
40
|
.then(([menuService, menuItems]) => menuService.show(menuItems, mousePosition, () => this.focusEventTarget(event)))
|
|
48
41
|
.then(() => focus_change_action_1.FocusStateChangedAction.create(false));
|
package/lib/features/context-menu/selection-service-aware-context-menu-mouse-listener.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-service-aware-context-menu-mouse-listener.js","sourceRoot":"","sources":["../../../src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,yCAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"selection-service-aware-context-menu-mouse-listener.js","sourceRoot":"","sources":["../../../src/features/context-menu/selection-service-aware-context-menu-mouse-listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA,yCAAyD;AACzD,qCAAiH;AACjH,gFAAiF;AACjF,4CAAyC;AACzC,mEAA+D;AAG/D,IAAa,6CAA6C,GAA1D,MAAa,6CAA8C,SAAQ,uBAAa;IAY5E;;OAEG;IACM,WAAW,CAAC,MAAqB,EAAE,KAAiB;QACzD,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;OAQG;IACO,eAAe,CAAC,MAAqB,EAAE,KAAiB;QAC9D,IAAI,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE;YAChD,OAAO,EAAE,CAAC;SACb;QAED,MAAM,aAAa,GAAG,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QAEjD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC;aAC1G,IAAI,CAAC,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;aAClH,IAAI,CAAC,GAAW,EAAE,CAAC,6CAAuB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/D,OAAO,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IAES,gBAAgB,CAAC,KAAiB;QACxC,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,YAAY,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;QACpF,MAAM,gBAAgB,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACvD,IAAI,gBAAgB,EAAE;YAClB,gBAAgB,CAAC,KAAK,EAAE,CAAC;SAC5B;IACL,CAAC;CACJ,CAAA;AA9CG;IAFC,IAAA,kBAAM,EAAC,aAAK,CAAC,2BAA2B,CAAC;IACzC,IAAA,oBAAQ,GAAE;;yFACyD;AAIpE;IAFC,IAAA,kBAAM,EAAC,aAAK,CAAC,4BAA4B,CAAC;IAC1C,IAAA,oBAAQ,GAAE;8BACuB,qCAA2B;mFAAC;AAG9D;IADC,IAAA,kBAAM,EAAC,aAAK,CAAC,gBAAgB,CAAC;8BACH,oCAAgB;uFAAC;AAVpC,6CAA6C;IADzD,IAAA,sBAAU,GAAE;GACA,6CAA6C,CAiDzD;AAjDY,sGAA6C"}
|
|
@@ -14,7 +14,6 @@ export declare class RankingMouseTool extends MouseTool implements IMouseTool {
|
|
|
14
14
|
constructor(mouseListeners?: MouseListener[]);
|
|
15
15
|
register(mouseListener: MouseListener): void;
|
|
16
16
|
deregister(mouseListener: MouseListener): void;
|
|
17
|
-
contextMenu(model: SModelRoot, event: MouseEvent): void;
|
|
18
17
|
protected handleEvent<K extends MouseListenerMethods>(methodName: K, model: SModelRoot, event: MouseEvent): void;
|
|
19
18
|
notifyListenersByRank<K extends MouseListenerMethods>(element: SModelElement, methodName: K, model: SModelRoot, event: MouseEvent): Promise<void>;
|
|
20
19
|
dispatchActions<K extends MouseListenerMethods>(mouseListeners: MouseListener[], methodName: K, element: SModelElement, event: MouseEvent): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-tool.d.ts","sourceRoot":"","sources":["../../../src/features/mouse-tool/mouse-tool.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI9E,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CAClD;AAED;;;GAGG;AACH,aAAK,oBAAoB,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AAElE,qBACa,gBAAiB,SAAQ,SAAU,YAAW,UAAU;cAGY,cAAc,EAAE,aAAa,EAAE;IAF5G,SAAS,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;gBAEgB,cAAc,GAAE,aAAa,EAAO;IAKxG,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAK5C,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"mouse-tool.d.ts","sourceRoot":"","sources":["../../../src/features/mouse-tool/mouse-tool.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI9E,MAAM,WAAW,UAAU;IACvB,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7C,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CAClD;AAED;;;GAGG;AACH,aAAK,oBAAoB,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;AAElE,qBACa,gBAAiB,SAAQ,SAAU,YAAW,UAAU;cAGY,cAAc,EAAE,aAAa,EAAE;IAF5G,SAAS,CAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;gBAEgB,cAAc,GAAE,aAAa,EAAO;IAKxG,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;IAK5C,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;cAKpC,WAAW,CAAC,CAAC,SAAS,oBAAoB,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI;IASnH,qBAAqB,CAAC,CAAC,SAAS,oBAAoB,EACtD,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,CAAC,EACb,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC;IAMV,eAAe,CAAC,CAAC,SAAS,oBAAoB,EAChD,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,EAAE,CAAC,EACb,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,UAAU,GAClB,OAAO,CAAC,IAAI,CAAC;CAenB"}
|
|
@@ -47,9 +47,6 @@ let RankingMouseTool = class RankingMouseTool extends sprotty_1.MouseTool {
|
|
|
47
47
|
super.deregister(mouseListener);
|
|
48
48
|
this.rankedMouseListeners = groupBy(this.mouseListeners, listener => (0, model_1.getRank)(listener));
|
|
49
49
|
}
|
|
50
|
-
contextMenu(model, event) {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
}
|
|
53
50
|
handleEvent(methodName, model, event) {
|
|
54
51
|
this.focusOnMouseEvent(methodName, model);
|
|
55
52
|
const element = this.getTargetElement(model, event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mouse-tool.js","sourceRoot":"","sources":["../../../src/features/mouse-tool/mouse-tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAgD;AAChD,yCAA8D;AAC9D,qCAA8E;AAC9E,4CAAyC;AACzC,yCAAwC;AAcxC,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,mBAAS;IAG3C,YAA6E,iBAAkC,EAAE;QAC7G,KAAK,CAAC,cAAc,CAAC,CAAC;QADmD,mBAAc,GAAd,cAAc,CAAsB;QAE7G,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;IACvF,CAAC;IAEQ,QAAQ,CAAC,aAA4B;QAC1C,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;IAC5F,CAAC;IAEQ,UAAU,CAAC,aAA4B;QAC5C,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;QAChC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAA,eAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;IAC5F,CAAC;
|
|
1
|
+
{"version":3,"file":"mouse-tool.js","sourceRoot":"","sources":["../../../src/features/mouse-tool/mouse-tool.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAgD;AAChD,yCAA8D;AAC9D,qCAA8E;AAC9E,4CAAyC;AACzC,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GAAG,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAClB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;SAC3B;aAAM;YACH,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAChC,IAAI,OAAO,EAAE;gBACT,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACtB;SACJ;QACD,OAAO,MAAM,CAAC;IAClB,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC;IACtB,OAAO,IAAI,GAAG,CAAS,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import {
|
|
16
|
+
import { Action } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { SelectMouseListener, SModelElement } from 'sprotty';
|
|
17
18
|
import { Ranked } from '../rank/model';
|
|
18
19
|
/**
|
|
19
20
|
* Ranked select mouse listener that is executed before default mouse listeners when using the RankedMouseTool.
|
|
@@ -21,5 +22,6 @@ import { Ranked } from '../rank/model';
|
|
|
21
22
|
*/
|
|
22
23
|
export declare class RankedSelectMouseListener extends SelectMouseListener implements Ranked {
|
|
23
24
|
rank: number;
|
|
25
|
+
mouseDown(target: SModelElement, event: MouseEvent): Action[];
|
|
24
26
|
}
|
|
25
27
|
//# sourceMappingURL=select-mouse-listener.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-mouse-listener.d.ts","sourceRoot":"","sources":["../../../src/features/select/select-mouse-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"select-mouse-listener.d.ts","sourceRoot":"","sources":["../../../src/features/select/select-mouse-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAgB,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAMH,mBAAmB,EACnB,aAAa,EAKhB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAErD;;;GAGG;AACH,qBAAa,yBAA0B,SAAQ,mBAAoB,YAAW,MAAM;IAChF,IAAI,EAAE,MAAM,CAAoB;IAEvB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE;CAiEzE"}
|
|
@@ -16,7 +16,9 @@ exports.RankedSelectMouseListener = void 0;
|
|
|
16
16
|
*
|
|
17
17
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
18
|
********************************************************************************/
|
|
19
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
20
|
const sprotty_1 = require("sprotty");
|
|
21
|
+
const iterable_1 = require("sprotty/lib/utils/iterable");
|
|
20
22
|
const model_1 = require("../rank/model");
|
|
21
23
|
/**
|
|
22
24
|
* Ranked select mouse listener that is executed before default mouse listeners when using the RankedMouseTool.
|
|
@@ -27,6 +29,66 @@ class RankedSelectMouseListener extends sprotty_1.SelectMouseListener {
|
|
|
27
29
|
super(...arguments);
|
|
28
30
|
this.rank = model_1.DEFAULT_RANK - 1; /* we want to be executed before all default mouse listeners */
|
|
29
31
|
}
|
|
32
|
+
mouseDown(target, event) {
|
|
33
|
+
const result = [];
|
|
34
|
+
if (this.buttonHandlerRegistry !== undefined && target instanceof sprotty_1.SButton && target.enabled) {
|
|
35
|
+
const buttonHandler = this.buttonHandlerRegistry.get(target.type);
|
|
36
|
+
if (buttonHandler !== undefined) {
|
|
37
|
+
return buttonHandler.buttonPressed(target);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const selectableTarget = (0, sprotty_1.findParentByFeature)(target, sprotty_1.isSelectable);
|
|
41
|
+
if (selectableTarget !== undefined || target instanceof sprotty_1.SModelRoot) {
|
|
42
|
+
this.hasDragged = false;
|
|
43
|
+
let deselect = [];
|
|
44
|
+
// multi-selection?
|
|
45
|
+
if (!(0, sprotty_1.isCtrlOrCmd)(event)) {
|
|
46
|
+
deselect = (0, iterable_1.toArray)(target.root.index
|
|
47
|
+
.all()
|
|
48
|
+
.filter(element => (0, sprotty_1.isSelectable)(element) &&
|
|
49
|
+
element.selected &&
|
|
50
|
+
!(selectableTarget instanceof sprotty_1.SRoutingHandle && element === selectableTarget.parent)));
|
|
51
|
+
}
|
|
52
|
+
if (selectableTarget !== undefined) {
|
|
53
|
+
if (!selectableTarget.selected) {
|
|
54
|
+
this.wasSelected = false;
|
|
55
|
+
result.push(protocol_1.SelectAction.create({
|
|
56
|
+
selectedElementsIDs: [selectableTarget.id],
|
|
57
|
+
deselectedElementsIDs: deselect.map(e => e.id)
|
|
58
|
+
}));
|
|
59
|
+
result.push(sprotty_1.BringToFrontAction.create([selectableTarget.id]));
|
|
60
|
+
const routableDeselect = deselect.filter(e => e instanceof sprotty_1.SRoutableElement).map(e => e.id);
|
|
61
|
+
if (selectableTarget instanceof sprotty_1.SRoutableElement) {
|
|
62
|
+
result.push(sprotty_1.SwitchEditModeAction.create({
|
|
63
|
+
elementsToActivate: [selectableTarget.id],
|
|
64
|
+
elementsToDeactivate: routableDeselect
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
else if (routableDeselect.length > 0) {
|
|
68
|
+
result.push(sprotty_1.SwitchEditModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if ((0, sprotty_1.isCtrlOrCmd)(event)) {
|
|
72
|
+
this.wasSelected = false;
|
|
73
|
+
result.push(protocol_1.SelectAction.create({ deselectedElementsIDs: [selectableTarget.id] }));
|
|
74
|
+
if (selectableTarget instanceof sprotty_1.SRoutableElement) {
|
|
75
|
+
result.push(sprotty_1.SwitchEditModeAction.create({ elementsToDeactivate: [selectableTarget.id] }));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
this.wasSelected = true;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
result.push(protocol_1.SelectAction.create({ deselectedElementsIDs: deselect.map(e => e.id) }));
|
|
84
|
+
const routableDeselect = deselect.filter(e => e instanceof sprotty_1.SRoutableElement).map(e => e.id);
|
|
85
|
+
if (routableDeselect.length > 0) {
|
|
86
|
+
result.push(sprotty_1.SwitchEditModeAction.create({ elementsToDeactivate: routableDeselect }));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
30
92
|
}
|
|
31
93
|
exports.RankedSelectMouseListener = RankedSelectMouseListener;
|
|
32
94
|
//# sourceMappingURL=select-mouse-listener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-mouse-listener.js","sourceRoot":"","sources":["../../../src/features/select/select-mouse-listener.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"select-mouse-listener.js","sourceRoot":"","sources":["../../../src/features/select/select-mouse-listener.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA8D;AAC9D,qCAYiB;AACjB,yDAAqD;AACrD,yCAAqD;AAErD;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,6BAAmB;IAAlE;;QACI,SAAI,GAAW,oBAAY,GAAG,CAAC,CAAC,CAAC,+DAA+D;IAmEpG,CAAC;IAjEY,SAAS,CAAC,MAAqB,EAAE,KAAiB;QACvD,MAAM,MAAM,GAAa,EAAE,CA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M,CAAC,EAAE,qBAAqB,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;gBACrF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,0BAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC5F,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC7B,MAAM,CAAC,IAAI,CAAC,8BAAoB,CAAC,MAAM,CAAC,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;iBACxF;aACJ;SACJ;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AApED,8DAoEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../../src/features/model-
|
|
1
|
+
{"version":3,"file":"di.config.d.ts","sourceRoot":"","sources":["../../../src/features/source-model-watcher/di.config.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAI5C,QAAA,MAAM,wBAAwB,iBAE5B,CAAC;AAEH,eAAe,wBAAwB,CAAC"}
|
|
@@ -18,9 +18,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
19
19
|
const inversify_1 = require("inversify");
|
|
20
20
|
const sprotty_1 = require("sprotty");
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
(0, sprotty_1.configureActionHandler)({ bind, isBound }, protocol_1.
|
|
21
|
+
const source_model_changed_action_handler_1 = require("./source-model-changed-action-handler");
|
|
22
|
+
const sourceModelWatcherModule = new inversify_1.ContainerModule((bind, _unbind, isBound) => {
|
|
23
|
+
(0, sprotty_1.configureActionHandler)({ bind, isBound }, protocol_1.SourceModelChangedAction.KIND, source_model_changed_action_handler_1.SourceModelChangedActionHandler);
|
|
24
24
|
});
|
|
25
|
-
exports.default =
|
|
25
|
+
exports.default = sourceModelWatcherModule;
|
|
26
26
|
//# sourceMappingURL=di.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../../src/features/model-
|
|
1
|
+
{"version":3,"file":"di.config.js","sourceRoot":"","sources":["../../../src/features/source-model-watcher/di.config.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAkE;AAClE,yCAA4C;AAC5C,qCAAiD;AACjD,+FAAwF;AAExF,MAAM,wBAAwB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;IAC5E,IAAA,gCAAsB,EAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,mCAAwB,CAAC,IAAI,EAAE,qEAA+B,CAAC,CAAC;AAC9G,CAAC,CAAC,CAAC;AAEH,kBAAe,wBAAwB,CAAC"}
|
|
@@ -13,26 +13,26 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action,
|
|
16
|
+
import { Action, SourceModelChangedAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { IActionDispatcher, IActionHandler, ViewerOptions } from 'sprotty';
|
|
18
18
|
/**
|
|
19
|
-
* An external handler of the model
|
|
19
|
+
* An external handler of the source model change event.
|
|
20
20
|
*
|
|
21
21
|
* This allows external applications to react specifically to this event, e.g. by bringing up the diagram,
|
|
22
22
|
* check their dirty state, show a dialog, etc.
|
|
23
23
|
*/
|
|
24
|
-
export declare abstract class
|
|
24
|
+
export declare abstract class ExternalSourceModelChangedHandler {
|
|
25
25
|
/**
|
|
26
|
-
* Notifies about a change of the model
|
|
26
|
+
* Notifies about a change of the source model.
|
|
27
27
|
* @returns actions to be dispatched after the notification.
|
|
28
28
|
*/
|
|
29
|
-
abstract
|
|
29
|
+
abstract notifySourceModelChange(sourceModelName: string, options: ViewerOptions): Promise<Action[]>;
|
|
30
30
|
}
|
|
31
|
-
export declare class
|
|
31
|
+
export declare class SourceModelChangedActionHandler implements IActionHandler {
|
|
32
32
|
protected dispatcher: IActionDispatcher;
|
|
33
33
|
protected options: ViewerOptions;
|
|
34
|
-
protected externalModelSourceChangedHandler?:
|
|
34
|
+
protected externalModelSourceChangedHandler?: ExternalSourceModelChangedHandler;
|
|
35
35
|
handle(action: Action): void;
|
|
36
|
-
protected showSimpleNotification(action:
|
|
36
|
+
protected showSimpleNotification(action: SourceModelChangedAction): void;
|
|
37
37
|
}
|
|
38
|
-
//# sourceMappingURL=model-
|
|
38
|
+
//# sourceMappingURL=source-model-changed-action-handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-
|
|
1
|
+
{"version":3,"file":"source-model-changed-action-handler.d.ts","sourceRoot":"","sources":["../../../src/features/source-model-watcher/source-model-changed-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAA2C,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEnH,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG3E;;;;;GAKG;AACH,8BACsB,iCAAiC;IACnD;;;OAGG;IACH,QAAQ,CAAC,uBAAuB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CACvG;AAED,qBACa,+BAAgC,YAAW,cAAc;IAElE,SAAS,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAGxC,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;IAIjC,SAAS,CAAC,iCAAiC,CAAC,EAAE,iCAAiC,CAAC;IAEhF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAY5B,SAAS,CAAC,sBAAsB,CAAC,MAAM,EAAE,wBAAwB,GAAG,IAAI;CAS3E"}
|
|
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.SourceModelChangedActionHandler = exports.ExternalSourceModelChangedHandler = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
14
|
* Copyright (c) 2020-2022 EclipseSource and others.
|
|
15
15
|
*
|
|
@@ -29,23 +29,23 @@ const protocol_1 = require("@eclipse-glsp/protocol");
|
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
30
|
const types_1 = require("../../base/types");
|
|
31
31
|
/**
|
|
32
|
-
* An external handler of the model
|
|
32
|
+
* An external handler of the source model change event.
|
|
33
33
|
*
|
|
34
34
|
* This allows external applications to react specifically to this event, e.g. by bringing up the diagram,
|
|
35
35
|
* check their dirty state, show a dialog, etc.
|
|
36
36
|
*/
|
|
37
|
-
let
|
|
37
|
+
let ExternalSourceModelChangedHandler = class ExternalSourceModelChangedHandler {
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
ExternalSourceModelChangedHandler = __decorate([
|
|
40
40
|
(0, inversify_1.injectable)()
|
|
41
|
-
],
|
|
42
|
-
exports.
|
|
43
|
-
let
|
|
41
|
+
], ExternalSourceModelChangedHandler);
|
|
42
|
+
exports.ExternalSourceModelChangedHandler = ExternalSourceModelChangedHandler;
|
|
43
|
+
let SourceModelChangedActionHandler = class SourceModelChangedActionHandler {
|
|
44
44
|
handle(action) {
|
|
45
|
-
if (protocol_1.
|
|
45
|
+
if (protocol_1.SourceModelChangedAction.is(action)) {
|
|
46
46
|
if (this.externalModelSourceChangedHandler) {
|
|
47
47
|
this.externalModelSourceChangedHandler
|
|
48
|
-
.
|
|
48
|
+
.notifySourceModelChange(action.sourceModelName, this.options)
|
|
49
49
|
.then(actions => this.dispatcher.dispatchAll(actions));
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
@@ -53,7 +53,7 @@ let ModelSourceChangedActionHandler = class ModelSourceChangedActionHandler {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
showSimpleNotification(action) {
|
|
56
|
-
const message = `The model
|
|
56
|
+
const message = `The source model ${action.sourceModelName} has changed. You might want to consider reloading.`;
|
|
57
57
|
const timeout = 0;
|
|
58
58
|
const severity = 'WARNING';
|
|
59
59
|
this.dispatcher.dispatchAll([
|
|
@@ -65,18 +65,18 @@ let ModelSourceChangedActionHandler = class ModelSourceChangedActionHandler {
|
|
|
65
65
|
__decorate([
|
|
66
66
|
(0, inversify_1.inject)(types_1.TYPES.IActionDispatcher),
|
|
67
67
|
__metadata("design:type", Object)
|
|
68
|
-
],
|
|
68
|
+
], SourceModelChangedActionHandler.prototype, "dispatcher", void 0);
|
|
69
69
|
__decorate([
|
|
70
70
|
(0, inversify_1.inject)(types_1.TYPES.ViewerOptions),
|
|
71
71
|
__metadata("design:type", Object)
|
|
72
|
-
],
|
|
72
|
+
], SourceModelChangedActionHandler.prototype, "options", void 0);
|
|
73
73
|
__decorate([
|
|
74
|
-
(0, inversify_1.inject)(
|
|
74
|
+
(0, inversify_1.inject)(ExternalSourceModelChangedHandler),
|
|
75
75
|
(0, inversify_1.optional)(),
|
|
76
|
-
__metadata("design:type",
|
|
77
|
-
],
|
|
78
|
-
|
|
76
|
+
__metadata("design:type", ExternalSourceModelChangedHandler)
|
|
77
|
+
], SourceModelChangedActionHandler.prototype, "externalModelSourceChangedHandler", void 0);
|
|
78
|
+
SourceModelChangedActionHandler = __decorate([
|
|
79
79
|
(0, inversify_1.injectable)()
|
|
80
|
-
],
|
|
81
|
-
exports.
|
|
82
|
-
//# sourceMappingURL=model-
|
|
80
|
+
], SourceModelChangedActionHandler);
|
|
81
|
+
exports.SourceModelChangedActionHandler = SourceModelChangedActionHandler;
|
|
82
|
+
//# sourceMappingURL=source-model-changed-action-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-
|
|
1
|
+
{"version":3,"file":"source-model-changed-action-handler.js","sourceRoot":"","sources":["../../../src/features/source-model-watcher/source-model-changed-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAmH;AACnH,yCAAyD;AAEzD,4CAAyC;AAEzC;;;;;GAKG;AAEH,IAAsB,iCAAiC,GAAvD,MAAsB,iCAAiC;CAMtD,CAAA;AANqB,iCAAiC;IADtD,IAAA,sBAAU,GAAE;GACS,iCAAiC,CAMtD;AANqB,8EAAiC;AASvD,IAAa,+BAA+B,GAA5C,MAAa,+BAA+B;IAWxC,MAAM,CAAC,MAAc;QACjB,IAAI,mCAAwB,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE;YACrC,IAAI,IAAI,CAAC,iCAAiC,EAAE;gBACxC,IAAI,CAAC,iCAAiC;qBACjC,uBAAuB,CAAC,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,OAAO,CAAC;qBAC7D,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC3D,OAAO;aACV;YACD,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;SACvC;IACL,CAAC;IAES,sBAAsB,CAAC,MAAgC;QAC7D,MAAM,OAAO,GAAG,oBAAoB,MAAM,CAAC,eAAe,qDAAqD,CAAC;QAChH,MAAM,OAAO,GAAG,CAAC,CAAC;QAClB,MAAM,QAAQ,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC;YACxB,6BAAkB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;YACzD,8BAAmB,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;SAC7D,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA9BG;IADC,IAAA,kBAAM,EAAC,aAAK,CAAC,iBAAiB,CAAC;;mEACQ;AAGxC;IADC,IAAA,kBAAM,EAAC,aAAK,CAAC,aAAa,CAAC;;gEACK;AAIjC;IAFC,IAAA,kBAAM,EAAC,iCAAiC,CAAC;IACzC,IAAA,oBAAQ,GAAE;8BACmC,iCAAiC;0FAAC;AATvE,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAgC3C;AAhCY,0EAA+B"}
|
|
@@ -13,10 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Marker } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { SIssue, SIssueMarker, SParentElement } from 'sprotty';
|
|
18
|
-
export declare class GIssueMarker extends SIssueMarker {
|
|
16
|
+
import { Bounds, Marker } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { Projectable, SIssue, SIssueMarker, SParentElement } from 'sprotty';
|
|
18
|
+
export declare class GIssueMarker extends SIssueMarker implements Projectable {
|
|
19
19
|
constructor();
|
|
20
|
+
projectionCssClasses: string[];
|
|
21
|
+
projectedBounds?: Bounds;
|
|
22
|
+
issues: SIssue[];
|
|
23
|
+
type: string;
|
|
24
|
+
computeProjectionCssClasses(): void;
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* Retrieves the `SIssueMarker` contained by the provided model element as
|
|
@@ -32,12 +37,12 @@ export declare function getOrCreateSIssueMarker(modelElement: SParentElement): S
|
|
|
32
37
|
* @param modelElement for which the `SIssueMarker` should be retrieved.
|
|
33
38
|
* @returns the child `SIssueMarker` or `undefined` if no such child exists.
|
|
34
39
|
*/
|
|
35
|
-
export declare function getSIssueMarker(modelElement: SParentElement):
|
|
40
|
+
export declare function getSIssueMarker(modelElement: SParentElement): GIssueMarker | undefined;
|
|
36
41
|
/**
|
|
37
42
|
* Creates an `SIssue` with `severity` and `message` set according to
|
|
38
43
|
* the `kind` and `description` of the provided `Marker`.
|
|
39
44
|
* @param marker `Marker` for that an `SIssue` should be created.
|
|
40
45
|
* @returns the created `SIssue`.
|
|
41
46
|
*/
|
|
42
|
-
export declare function createSIssue(marker: Marker): SIssue;
|
|
47
|
+
export declare function createSIssue(marker: Marker, parent?: SParentElement): SIssue;
|
|
43
48
|
//# sourceMappingURL=issue-marker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-marker.d.ts","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"issue-marker.d.ts","sourceRoot":"","sources":["../../../src/features/validation/issue-marker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAc,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAiB,WAAW,EAAe,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGxG,qBAAa,YAAa,SAAQ,YAAa,YAAW,WAAW;;IAKjE,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,IAAI,SAAY;IAEzB,2BAA2B,IAAI,IAAI;CAItC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,CAclF;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,cAAc,GAAG,YAAY,GAAG,SAAS,CAUtF;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAmB5E"}
|