@eclipse-glsp/client 2.1.1 → 2.2.0-next.326
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/ghost-element.css +3 -1
- package/css/glsp-sprotty.css +4 -5
- package/lib/base/action-dispatcher.d.ts +3 -2
- package/lib/base/action-dispatcher.d.ts.map +1 -1
- package/lib/base/action-dispatcher.js +17 -2
- package/lib/base/action-dispatcher.js.map +1 -1
- package/lib/base/action-dispatcher.spec.js +2 -2
- package/lib/base/action-dispatcher.spec.js.map +1 -1
- package/lib/base/action-handler-registry.d.ts +6 -2
- package/lib/base/action-handler-registry.d.ts.map +1 -1
- package/lib/base/action-handler-registry.js +31 -3
- package/lib/base/action-handler-registry.js.map +1 -1
- package/lib/base/command-stack.d.ts +8 -16
- package/lib/base/command-stack.d.ts.map +1 -1
- package/lib/base/command-stack.js +15 -14
- package/lib/base/command-stack.js.map +1 -1
- package/lib/base/default.module.d.ts +1 -1
- package/lib/base/default.module.d.ts.map +1 -1
- package/lib/base/default.module.js +16 -3
- package/lib/base/default.module.js.map +1 -1
- package/lib/base/editor-context-service.d.ts +44 -3
- package/lib/base/editor-context-service.d.ts.map +1 -1
- package/lib/base/editor-context-service.js +36 -13
- package/lib/base/editor-context-service.js.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.d.ts +28 -1
- package/lib/base/feedback/feedback-action-dispatcher.d.ts.map +1 -1
- package/lib/base/feedback/feedback-action-dispatcher.js +27 -2
- package/lib/base/feedback/feedback-action-dispatcher.js.map +1 -1
- package/lib/base/feedback/feedback-command.d.ts +9 -4
- package/lib/base/feedback/feedback-command.d.ts.map +1 -1
- package/lib/base/feedback/feedback-command.js +14 -3
- package/lib/base/feedback/feedback-command.js.map +1 -1
- package/lib/base/feedback/index.d.ts +2 -1
- package/lib/base/feedback/index.d.ts.map +1 -1
- package/lib/base/feedback/index.js +2 -1
- package/lib/base/feedback/index.js.map +1 -1
- package/lib/base/feedback/set-model-command.d.ts +25 -0
- package/lib/base/feedback/set-model-command.d.ts.map +1 -0
- package/lib/base/feedback/set-model-command.js +65 -0
- package/lib/base/feedback/set-model-command.js.map +1 -0
- package/lib/base/feedback/update-model-command.d.ts +17 -6
- package/lib/base/feedback/update-model-command.d.ts.map +1 -1
- package/lib/base/feedback/update-model-command.js +9 -29
- package/lib/base/feedback/update-model-command.js.map +1 -1
- package/lib/base/index.d.ts +2 -1
- package/lib/base/index.d.ts.map +1 -1
- package/lib/base/index.js +2 -1
- package/lib/base/index.js.map +1 -1
- package/lib/base/model/diagram-loader.d.ts +12 -7
- package/lib/base/model/diagram-loader.d.ts.map +1 -1
- package/lib/base/model/diagram-loader.js +10 -17
- package/lib/base/model/diagram-loader.js.map +1 -1
- package/lib/base/model/glsp-model-source.d.ts +1 -1
- package/lib/base/model/glsp-model-source.js +1 -1
- package/lib/base/ranked.d.ts +11 -1
- package/lib/base/ranked.d.ts.map +1 -1
- package/lib/base/ranked.js +7 -1
- package/lib/base/ranked.js.map +1 -1
- package/lib/base/selection-service.d.ts +9 -8
- package/lib/base/selection-service.d.ts.map +1 -1
- package/lib/base/selection-service.js +11 -14
- package/lib/base/selection-service.js.map +1 -1
- package/lib/base/selection-service.spec.js +5 -1
- package/lib/base/selection-service.spec.js.map +1 -1
- package/lib/base/tool-manager/tool-manager.d.ts +10 -8
- package/lib/base/tool-manager/tool-manager.d.ts.map +1 -1
- package/lib/base/tool-manager/tool-manager.js +25 -22
- package/lib/base/tool-manager/tool-manager.js.map +1 -1
- package/lib/base/ui-extension-registry.d.ts +23 -0
- package/lib/base/ui-extension-registry.d.ts.map +1 -0
- package/lib/base/ui-extension-registry.js +51 -0
- package/lib/base/ui-extension-registry.js.map +1 -0
- package/lib/base/view/key-tool.d.ts +21 -2
- package/lib/base/view/key-tool.d.ts.map +1 -1
- package/lib/base/view/key-tool.js +21 -3
- package/lib/base/view/key-tool.js.map +1 -1
- package/lib/base/view/mouse-tool.d.ts +20 -3
- package/lib/base/view/mouse-tool.d.ts.map +1 -1
- package/lib/base/view/mouse-tool.js +9 -5
- package/lib/base/view/mouse-tool.js.map +1 -1
- package/lib/default-modules.d.ts.map +1 -1
- package/lib/default-modules.js +2 -1
- package/lib/default-modules.js.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts +6 -4
- package/lib/features/bounds/glsp-hidden-bounds-updater.d.ts.map +1 -1
- package/lib/features/bounds/glsp-hidden-bounds-updater.js +20 -3
- package/lib/features/bounds/glsp-hidden-bounds-updater.js.map +1 -1
- package/lib/features/bounds/local-bounds.d.ts +8 -4
- package/lib/features/bounds/local-bounds.d.ts.map +1 -1
- package/lib/features/bounds/local-bounds.js +9 -5
- package/lib/features/bounds/local-bounds.js.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.d.ts +2 -2
- package/lib/features/bounds/set-bounds-feedback-command.d.ts.map +1 -1
- package/lib/features/bounds/set-bounds-feedback-command.js +5 -3
- package/lib/features/bounds/set-bounds-feedback-command.js.map +1 -1
- package/lib/features/change-bounds/position-snapper.d.ts +1 -1
- package/lib/features/change-bounds/position-snapper.js +1 -1
- package/lib/features/command-palette/command-palette-module.d.ts.map +1 -1
- package/lib/features/command-palette/command-palette-module.js +2 -1
- package/lib/features/command-palette/command-palette-module.js.map +1 -1
- package/lib/features/command-palette/command-palette.d.ts +21 -0
- package/lib/features/command-palette/command-palette.d.ts.map +1 -0
- package/lib/features/command-palette/command-palette.js +46 -0
- package/lib/features/command-palette/command-palette.js.map +1 -0
- package/lib/features/command-palette/index.d.ts +1 -0
- package/lib/features/command-palette/index.d.ts.map +1 -1
- package/lib/features/command-palette/index.js +1 -0
- package/lib/features/command-palette/index.js.map +1 -1
- package/lib/features/element-template/add-template-element.d.ts +1 -1
- package/lib/features/element-template/add-template-element.d.ts.map +1 -1
- package/lib/features/element-template/add-template-element.js +6 -5
- package/lib/features/element-template/add-template-element.js.map +1 -1
- package/lib/features/helper-lines/helper-line-feedback.d.ts +1 -1
- package/lib/features/helper-lines/helper-line-feedback.d.ts.map +1 -1
- package/lib/features/helper-lines/helper-line-feedback.js +9 -3
- package/lib/features/helper-lines/helper-line-feedback.js.map +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.d.ts +1 -1
- package/lib/features/helper-lines/helper-line-manager-default.js +1 -1
- package/lib/features/helper-lines/helper-line-manager.d.ts +1 -1
- package/lib/features/hints/type-hint-provider.d.ts +17 -2
- package/lib/features/hints/type-hint-provider.d.ts.map +1 -1
- package/lib/features/hints/type-hint-provider.js +13 -13
- package/lib/features/hints/type-hint-provider.js.map +1 -1
- package/lib/features/label-edit-ui/label-edit-ui-module.d.ts +18 -0
- package/lib/features/label-edit-ui/label-edit-ui-module.d.ts.map +1 -0
- package/lib/features/label-edit-ui/label-edit-ui-module.js +27 -0
- package/lib/features/label-edit-ui/label-edit-ui-module.js.map +1 -0
- package/lib/features/label-edit-ui/label-edit-ui.d.ts +21 -0
- package/lib/features/label-edit-ui/label-edit-ui.d.ts.map +1 -0
- package/lib/features/label-edit-ui/label-edit-ui.js +46 -0
- package/lib/features/label-edit-ui/label-edit-ui.js.map +1 -0
- package/lib/features/navigation/navigation-action-handler.d.ts +15 -0
- package/lib/features/navigation/navigation-action-handler.d.ts.map +1 -1
- package/lib/features/navigation/navigation-action-handler.js +2 -2
- package/lib/features/navigation/navigation-action-handler.js.map +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.d.ts +1 -1
- package/lib/features/tools/change-bounds/change-bounds-tool-feedback.js +1 -1
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.d.ts +1 -1
- package/lib/features/tools/marquee-selection/marquee-behavior.spec.js +1 -1
- package/lib/features/validation/validate.d.ts +20 -2
- package/lib/features/validation/validate.d.ts.map +1 -1
- package/lib/features/validation/validate.js +14 -11
- package/lib/features/validation/validate.js.map +1 -1
- package/lib/utils/gmodel-util.d.ts +2 -1
- package/lib/utils/gmodel-util.d.ts.map +1 -1
- package/lib/utils/gmodel-util.js +15 -5
- package/lib/utils/gmodel-util.js.map +1 -1
- package/lib/utils/html-utils.js +1 -1
- package/package.json +7 -6
- package/src/base/action-dispatcher.spec.ts +5 -4
- package/src/base/action-dispatcher.ts +20 -4
- package/src/base/action-handler-registry.ts +24 -3
- package/src/base/command-stack.ts +17 -29
- package/src/base/default.module.ts +22 -4
- package/src/base/editor-context-service.ts +61 -16
- package/src/base/feedback/feedback-action-dispatcher.ts +50 -2
- package/src/base/feedback/feedback-command.ts +16 -5
- package/src/base/feedback/index.ts +3 -1
- package/src/base/feedback/set-model-command.ts +45 -0
- package/src/base/feedback/update-model-command.ts +9 -46
- package/src/base/index.ts +2 -1
- package/src/base/model/diagram-loader.ts +21 -14
- package/src/base/model/glsp-model-source.ts +1 -1
- package/src/base/ranked.ts +15 -1
- package/src/base/selection-service.spec.ts +8 -2
- package/src/base/selection-service.ts +22 -21
- package/src/base/tool-manager/tool-manager.ts +27 -23
- package/src/base/ui-extension-registry.ts +33 -0
- package/src/base/view/key-tool.ts +16 -4
- package/src/base/view/mouse-tool.ts +23 -6
- package/src/default-modules.ts +1 -1
- package/src/features/bounds/glsp-hidden-bounds-updater.ts +27 -5
- package/src/features/bounds/local-bounds.ts +24 -7
- package/src/features/bounds/set-bounds-feedback-command.ts +5 -3
- package/src/features/change-bounds/position-snapper.ts +1 -1
- package/src/features/command-palette/command-palette-module.ts +3 -2
- package/src/features/command-palette/command-palette.ts +34 -0
- package/src/features/command-palette/index.ts +1 -0
- package/src/features/element-template/add-template-element.ts +6 -5
- package/src/features/helper-lines/helper-line-feedback.ts +9 -3
- package/src/features/helper-lines/helper-line-manager-default.ts +1 -1
- package/src/features/helper-lines/helper-line-manager.ts +1 -1
- package/src/features/hints/type-hint-provider.ts +6 -6
- package/src/features/label-edit-ui/label-edit-ui-module.ts +24 -0
- package/src/features/label-edit-ui/label-edit-ui.ts +33 -0
- package/src/features/navigation/navigation-action-handler.ts +2 -2
- package/src/features/tools/change-bounds/change-bounds-tool-feedback.ts +1 -1
- package/src/features/tools/marquee-selection/marquee-behavior.spec.ts +1 -1
- package/src/features/validation/validate.ts +19 -12
- package/src/utils/gmodel-util.ts +16 -5
- package/src/utils/html-utils.ts +1 -1
- package/lib/tsconfig.tsbuildinfo +0 -1
package/css/ghost-element.css
CHANGED
package/css/glsp-sprotty.css
CHANGED
|
@@ -73,11 +73,6 @@
|
|
|
73
73
|
fill: #1d80d1;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.sprotty-hidden .sprotty-resize-handle {
|
|
77
|
-
/** resize handles should not be considered as part of the elements bounds */
|
|
78
|
-
display: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
76
|
.sprotty-edge {
|
|
82
77
|
fill: none;
|
|
83
78
|
stroke-width: 1.5px;
|
|
@@ -235,6 +230,10 @@
|
|
|
235
230
|
opacity: 1;
|
|
236
231
|
}
|
|
237
232
|
|
|
233
|
+
.sprotty.sprotty-hidden .sprotty-projection-bar {
|
|
234
|
+
visibility: hidden;
|
|
235
|
+
}
|
|
236
|
+
|
|
238
237
|
.sprotty-projection-bar.vertical.bordered-projection-bar {
|
|
239
238
|
position: absolute;
|
|
240
239
|
top: 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2019-
|
|
3
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials are made available under the
|
|
6
6
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -21,7 +21,8 @@ export declare class GLSPActionDispatcher extends ActionDispatcher {
|
|
|
21
21
|
protected initializedConstraint: boolean;
|
|
22
22
|
protected initializationConstraint: ModelInitializationConstraint;
|
|
23
23
|
initialize(): Promise<void>;
|
|
24
|
-
|
|
24
|
+
protected doInitialize(): Promise<void>;
|
|
25
|
+
protected startModelInitialization(): void;
|
|
25
26
|
onceModelInitialized(): Promise<void>;
|
|
26
27
|
hasHandler(action: Action): boolean;
|
|
27
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"action-dispatcher.d.ts","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAc,aAAa,EAAE,cAAc,EAAkB,MAAM,uBAAuB,CAAC;AAI5H,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,qBACa,oBAAqB,SAAQ,gBAAgB;IACtD,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAa;IACrE,SAAS,CAAC,qBAAqB,UAAS;IAGxC,SAAS,CAAC,wBAAwB,EAAE,6BAA6B,CAAC;IAEzD,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;cAOpB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAY7C,SAAS,CAAC,wBAAwB,IAAI,IAAI;IAQ1C,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAInC;;;;OAIG;IACH,4BAA4B,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAIzC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;cAMnC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBrD,OAAO,CAAC,GAAG,SAAS,cAAc,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAQtF;;;;;;;;;OASG;IACH,YAAY,CAAC,GAAG,SAAS,cAAc,EACnC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,EAC1B,SAAS,SAAO,EAChB,eAAe,UAAQ,GACxB,OAAO,CAAC,GAAG,GAAG,SAAS,CAAC;CA2B9B"}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GLSPActionDispatcher = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2019-
|
|
14
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
15
15
|
*
|
|
16
16
|
* This program and the accompanying materials are made available under the
|
|
17
17
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -27,6 +27,7 @@ exports.GLSPActionDispatcher = void 0;
|
|
|
27
27
|
********************************************************************************/
|
|
28
28
|
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
|
+
const action_handler_registry_1 = require("./action-handler-registry");
|
|
30
31
|
const glsp_model_source_1 = require("./model/glsp-model-source");
|
|
31
32
|
const model_initialization_constraint_1 = require("./model/model-initialization-constraint");
|
|
32
33
|
let GLSPActionDispatcher = class GLSPActionDispatcher extends sprotty_1.ActionDispatcher {
|
|
@@ -36,7 +37,21 @@ let GLSPActionDispatcher = class GLSPActionDispatcher extends sprotty_1.ActionDi
|
|
|
36
37
|
this.initializedConstraint = false;
|
|
37
38
|
}
|
|
38
39
|
initialize() {
|
|
39
|
-
|
|
40
|
+
if (!this.initialized) {
|
|
41
|
+
this.initialized = this.doInitialize();
|
|
42
|
+
}
|
|
43
|
+
return this.initialized;
|
|
44
|
+
}
|
|
45
|
+
async doInitialize() {
|
|
46
|
+
const registry = await this.actionHandlerRegistryProvider();
|
|
47
|
+
this.actionHandlerRegistry = registry;
|
|
48
|
+
if (registry instanceof action_handler_registry_1.GLSPActionHandlerRegistry) {
|
|
49
|
+
registry.initialize();
|
|
50
|
+
}
|
|
51
|
+
this.handleAction(sprotty_1.SetModelAction.create(sprotty_1.EMPTY_ROOT)).catch(() => {
|
|
52
|
+
/* Logged in handleAction method */
|
|
53
|
+
});
|
|
54
|
+
this.startModelInitialization();
|
|
40
55
|
}
|
|
41
56
|
startModelInitialization() {
|
|
42
57
|
if (!this.initializedConstraint) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"action-dispatcher.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAA4H;AAC5H,yCAA+C;AAC/C,uEAAsE;AACtE,iEAA2D;AAC3D,6FAAwF;AAGjF,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,0BAAgB;IAAnD;;QACgB,aAAQ,GAAgC,IAAI,GAAG,EAAE,CAAC;QAC3D,0BAAqB,GAAG,KAAK,CAAC;IA8H5C,CAAC;IAzHY,UAAU;QACf,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;SAC1C;QACD,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAES,KAAK,CAAC,YAAY;QACxB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,6BAA6B,EAAE,CAAC;QAC5D,IAAI,CAAC,qBAAqB,GAAG,QAAQ,CAAC;QACtC,IAAI,QAAQ,YAAY,mDAAyB,EAAE;YAC/C,QAAQ,CAAC,UAAU,EAAE,CAAC;SACzB;QACD,IAAI,CAAC,YAAY,CAAC,wBAAc,CAAC,MAAM,CAAC,oBAA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YAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC9C,IAAI,QAAQ,KAAK,SAAS,EAAE;gBACxB,UAAU;gBACV,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAEhC,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,mBAAmB,GAAG,SAAS,GAAG,KAAK,CAAC;gBACtG,IAAI,eAAe,EAAE;oBACjB,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;iBACjC;qBAAM;oBACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;oBACrC,QAAQ,CAAC,OAAO,EAAE,CAAC;iBACtB;aACJ;QACL,CAAC,EAAE,SAAS,CAAC,CAAC;QACd,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAEtC,OAAO,KAAK,CAAC,OAAO,CAAM,MAAM,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAhIY,oDAAoB;AAKnB;IADT,IAAA,kBAAM,EAAC,+DAA6B,CAAC;8BACF,+DAA6B;sEAAC;+BALzD,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CAgIhC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/********************************************************************************
|
|
4
|
-
* Copyright (c) 2023 EclipseSource and others.
|
|
4
|
+
* Copyright (c) 2023-2024 EclipseSource and others.
|
|
5
5
|
*
|
|
6
6
|
* This program and the accompanying materials are made available under the
|
|
7
7
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -15,9 +15,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
*
|
|
16
16
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
17
17
|
********************************************************************************/
|
|
18
|
+
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
18
19
|
const chai_1 = require("chai");
|
|
19
20
|
const inversify_1 = require("inversify");
|
|
20
|
-
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
21
21
|
const action_dispatcher_1 = require("./action-dispatcher");
|
|
22
22
|
const default_module_1 = require("./default.module");
|
|
23
23
|
const container = new inversify_1.Container();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-dispatcher.spec.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,+BAA8B;AAC9B,yCAAsC;
|
|
1
|
+
{"version":3,"file":"action-dispatcher.spec.js","sourceRoot":"","sources":["../../src/base/action-dispatcher.spec.ts"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAAoH;AACpH,+BAA8B;AAC9B,yCAAsC;AAEtC,2DAA2D;AAC3D,qDAAiD;AAGjD,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAClC,SAAS,CAAC,IAAI,CAAC,8BAAa,CAAC,CAAC;AAC9B,SAAS,CAAC,IAAI,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,eAAe,CAA4B;IAC7E,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,aAAa;IAC1B,kBAAkB,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,CAAQ;CAC7C,CAAC,CAAC;AACJ,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,+BAAqB,CAAC,CAAC;AACtD,MAAM,gBAAgB,GAAG,SAAS,CAAC,GAAG,CAAC,wCAAoB,CAAC,CAAC;AAE7D,IAAI,gBAAgB,GAAG,CAAC,CAAC;AACzB,MAAM,WAAW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BAAkB,EAAE,oDAAoD,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QAChG,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2023 EclipseSource and others.
|
|
2
|
+
* Copyright (c) 2023-2024 EclipseSource 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
|
|
@@ -13,13 +13,17 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { ActionHandlerRegistry } from '@eclipse-glsp/sprotty';
|
|
16
|
+
import { ActionHandlerRegistration, ActionHandlerRegistry, IActionHandlerInitializer, LazyInjector } from '@eclipse-glsp/sprotty';
|
|
17
17
|
export declare class GLSPActionHandlerRegistry extends ActionHandlerRegistry {
|
|
18
|
+
protected lazyInjector: LazyInjector;
|
|
19
|
+
protected initialized: boolean;
|
|
20
|
+
constructor(registrations?: ActionHandlerRegistration[], initializers?: IActionHandlerInitializer[]);
|
|
18
21
|
/**
|
|
19
22
|
* Retrieve a set of all action kinds for which (at least) one
|
|
20
23
|
* handler is registered
|
|
21
24
|
* @returns the set of handled action kinds
|
|
22
25
|
*/
|
|
23
26
|
getHandledActionKinds(): string[];
|
|
27
|
+
initialize(): void;
|
|
24
28
|
}
|
|
25
29
|
//# sourceMappingURL=action-handler-registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-handler-registry.d.ts","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"action-handler-registry.d.ts","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,YAAY,EAAS,MAAM,uBAAuB,CAAC;AAGzI,qBACa,yBAA0B,SAAQ,qBAAqB;IAEhE,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IAErC,SAAS,CAAC,WAAW,UAAS;gBAEN,aAAa,GAAE,yBAAyB,EAAO,EAAc,YAAY,GAAE,yBAAyB,EAAO;IAGnI;;;;OAIG;IACH,qBAAqB,IAAI,MAAM,EAAE;IAIjC,UAAU,IAAI,IAAI;CAYrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/********************************************************************************
|
|
3
|
-
* Copyright (c) 2023 EclipseSource and others.
|
|
3
|
+
* Copyright (c) 2023-2024 EclipseSource and others.
|
|
4
4
|
*
|
|
5
5
|
* This program and the accompanying materials are made available under the
|
|
6
6
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -20,11 +20,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
20
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
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
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
|
+
};
|
|
23
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
30
|
exports.GLSPActionHandlerRegistry = void 0;
|
|
25
|
-
const inversify_1 = require("inversify");
|
|
26
31
|
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
32
|
+
const inversify_1 = require("inversify");
|
|
27
33
|
let GLSPActionHandlerRegistry = class GLSPActionHandlerRegistry extends sprotty_1.ActionHandlerRegistry {
|
|
34
|
+
constructor(registrations = [], initializers = []) {
|
|
35
|
+
super(registrations, initializers);
|
|
36
|
+
this.initialized = false;
|
|
37
|
+
}
|
|
28
38
|
/**
|
|
29
39
|
* Retrieve a set of all action kinds for which (at least) one
|
|
30
40
|
* handler is registered
|
|
@@ -33,9 +43,27 @@ let GLSPActionHandlerRegistry = class GLSPActionHandlerRegistry extends sprotty_
|
|
|
33
43
|
getHandledActionKinds() {
|
|
34
44
|
return Array.from(this.elements.keys());
|
|
35
45
|
}
|
|
46
|
+
initialize() {
|
|
47
|
+
if (this.initialized) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.lazyInjector
|
|
51
|
+
.getAll(sprotty_1.TYPES.ActionHandlerRegistration)
|
|
52
|
+
.forEach(registration => this.register(registration.actionKind, registration.factory()));
|
|
53
|
+
this.lazyInjector
|
|
54
|
+
.getAll(sprotty_1.TYPES.IActionHandlerInitializer)
|
|
55
|
+
.forEach(initializer => this.initializeActionHandler(initializer));
|
|
56
|
+
}
|
|
36
57
|
};
|
|
37
58
|
exports.GLSPActionHandlerRegistry = GLSPActionHandlerRegistry;
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, inversify_1.inject)(sprotty_1.LazyInjector),
|
|
61
|
+
__metadata("design:type", Object)
|
|
62
|
+
], GLSPActionHandlerRegistry.prototype, "lazyInjector", void 0);
|
|
38
63
|
exports.GLSPActionHandlerRegistry = GLSPActionHandlerRegistry = __decorate([
|
|
39
|
-
(0, inversify_1.injectable)()
|
|
64
|
+
(0, inversify_1.injectable)(),
|
|
65
|
+
__param(0, (0, inversify_1.optional)()),
|
|
66
|
+
__param(1, (0, inversify_1.optional)()),
|
|
67
|
+
__metadata("design:paramtypes", [Array, Array])
|
|
40
68
|
], GLSPActionHandlerRegistry);
|
|
41
69
|
//# sourceMappingURL=action-handler-registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-handler-registry.js","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF
|
|
1
|
+
{"version":3,"file":"action-handler-registry.js","sourceRoot":"","sources":["../../src/base/action-handler-registry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;;;;AAElF,mDAAyI;AACzI,yCAAyD;AAGlD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,+BAAqB;IAMhE,YAAwB,gBAA6C,EAAE,EAAc,eAA4C,EAAE;QAC/H,KAAK,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;QAH7B,gBAAW,GAAG,KAAK,CAAC;IAI9B,CAAC;IACD;;;;OAIG;IACH,qBAAqB;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU;QACN,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,OAAO;SACV;QAED,IAAI,CAAC,YAAY;aACZ,MAAM,CAA4B,eAAK,CAAC,yBAAyB,CAAC;aAClE,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAC7F,IAAI,CAAC,YAAY;aACZ,MAAM,CAA4B,eAAK,CAAC,yBAAyB,CAAC;aAClE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ,CAAA;AA9BY,8DAAyB;AAExB;IADT,IAAA,kBAAM,EAAC,sBAAY,CAAC;;+DACgB;oCAF5B,yBAAyB;IADrC,IAAA,sBAAU,GAAE;IAOI,WAAA,IAAA,oBAAQ,GAAE,CAAA;IAAmD,WAAA,IAAA,oBAAQ,GAAE,CAAA;;GAN3E,yBAAyB,CA8BrC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2024 EclipseSource 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
|
|
@@ -13,24 +13,16 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { CommandStack, Disposable, DisposableCollection,
|
|
17
|
-
|
|
18
|
-
* A hook to listen for model root changes. Will be called after a server update
|
|
19
|
-
* has been processed
|
|
20
|
-
*/
|
|
21
|
-
export interface IGModelRootListener {
|
|
22
|
-
modelRootChanged(root: Readonly<GModelRoot>): void;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated Use {@link IGModelRootListener} instead
|
|
26
|
-
*/
|
|
27
|
-
export type ISModelRootListener = IGModelRootListener;
|
|
16
|
+
import { CommandStack, Disposable, DisposableCollection, Event, GModelRoot, ICommand, LazyInjector } from '@eclipse-glsp/sprotty';
|
|
17
|
+
import { EditorContextService } from './editor-context-service';
|
|
28
18
|
export declare class GLSPCommandStack extends CommandStack implements Disposable {
|
|
29
|
-
protected
|
|
19
|
+
protected lazyInjector: LazyInjector;
|
|
30
20
|
protected toDispose: DisposableCollection;
|
|
31
|
-
protected initialize(): void;
|
|
32
21
|
dispose(): void;
|
|
33
|
-
|
|
22
|
+
get editorContext(): EditorContextService;
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Use the `EditorContext.onModelRootChanged` event instead
|
|
25
|
+
*/
|
|
34
26
|
get onModelRootChanged(): Event<Readonly<GModelRoot>>;
|
|
35
27
|
undo(): Promise<GModelRoot>;
|
|
36
28
|
redo(): Promise<GModelRoot>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-stack.d.ts","sourceRoot":"","sources":["../../src/base/command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"command-stack.d.ts","sourceRoot":"","sources":["../../src/base/command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,KAAK,EACL,UAAU,EACV,QAAQ,EACR,YAAY,EAGf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,qBACa,gBAAiB,SAAQ,YAAa,YAAW,UAAU;IAEpE,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,SAAS,uBAA8B;IAGjD,OAAO,IAAI,IAAI;IAMf,IAAI,aAAa,IAAI,oBAAoB,CAExC;IAED;;OAEG;IACH,IAAI,kBAAkB,IAAI,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAEpD;IAEQ,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAQ3B,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IAQ3B,OAAO,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;IAQxD,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,IAAI;CAG9D"}
|
|
@@ -11,7 +11,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.GLSPCommandStack = void 0;
|
|
13
13
|
/********************************************************************************
|
|
14
|
-
* Copyright (c) 2019-
|
|
14
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
15
15
|
*
|
|
16
16
|
* This program and the accompanying materials are made available under the
|
|
17
17
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -27,23 +27,25 @@ exports.GLSPCommandStack = void 0;
|
|
|
27
27
|
********************************************************************************/
|
|
28
28
|
const sprotty_1 = require("@eclipse-glsp/sprotty");
|
|
29
29
|
const inversify_1 = require("inversify");
|
|
30
|
+
const editor_context_service_1 = require("./editor-context-service");
|
|
30
31
|
let GLSPCommandStack = class GLSPCommandStack extends sprotty_1.CommandStack {
|
|
31
32
|
constructor() {
|
|
32
33
|
super(...arguments);
|
|
33
|
-
this.modelRootListeners = [];
|
|
34
34
|
this.toDispose = new sprotty_1.DisposableCollection();
|
|
35
|
-
this.onModelRootChangedEmitter = new sprotty_1.Emitter();
|
|
36
|
-
}
|
|
37
|
-
initialize() {
|
|
38
|
-
super.initialize();
|
|
39
|
-
this.toDispose.push(this.onModelRootChangedEmitter);
|
|
40
|
-
this.modelRootListeners.forEach(listener => this.onModelRootChanged(root => listener.modelRootChanged(root)));
|
|
41
35
|
}
|
|
42
36
|
dispose() {
|
|
43
37
|
this.toDispose.dispose();
|
|
44
38
|
}
|
|
39
|
+
// Use lazyInjector to resolve circular dependency
|
|
40
|
+
// GLSPActionDispatcher --> GLSPCommandStack --> EditorContextService --> GLSPActionDispatcher
|
|
41
|
+
get editorContext() {
|
|
42
|
+
return this.lazyInjector.get(editor_context_service_1.EditorContextService);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use the `EditorContext.onModelRootChanged` event instead
|
|
46
|
+
*/
|
|
45
47
|
get onModelRootChanged() {
|
|
46
|
-
return this.
|
|
48
|
+
return this.editorContext.onModelRootChanged;
|
|
47
49
|
}
|
|
48
50
|
undo() {
|
|
49
51
|
this.logger.warn(this, 'GLSPCommandStack.undo() was called. This should never happen as the GLSP server is responsible for handling undo requests');
|
|
@@ -61,15 +63,14 @@ let GLSPCommandStack = class GLSPCommandStack extends sprotty_1.CommandStack {
|
|
|
61
63
|
return result;
|
|
62
64
|
}
|
|
63
65
|
notifyListeners(root) {
|
|
64
|
-
this.
|
|
66
|
+
this.editorContext.notifyModelRootChanged(root, this);
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
69
|
exports.GLSPCommandStack = GLSPCommandStack;
|
|
68
70
|
__decorate([
|
|
69
|
-
(0, inversify_1.
|
|
70
|
-
(
|
|
71
|
-
|
|
72
|
-
], GLSPCommandStack.prototype, "modelRootListeners", void 0);
|
|
71
|
+
(0, inversify_1.inject)(sprotty_1.LazyInjector),
|
|
72
|
+
__metadata("design:type", Object)
|
|
73
|
+
], GLSPCommandStack.prototype, "lazyInjector", void 0);
|
|
73
74
|
__decorate([
|
|
74
75
|
(0, inversify_1.preDestroy)(),
|
|
75
76
|
__metadata("design:type", Function),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-stack.js","sourceRoot":"","sources":["../../src/base/command-stack.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"command-stack.js","sourceRoot":"","sources":["../../src/base/command-stack.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAU+B;AAC/B,yCAA2D;AAC3D,qEAAgE;AAGzD,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,sBAAY;IAA3C;;QAGO,cAAS,GAAG,IAAI,8BAAoB,EAAE,CAAC;IA+CrD,CAAC;IA5CG,OAAO;QACH,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED,kDAAkD;IAClD,+FAA+F;IAC/F,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,6CAAoB,CAAC,CAAC;IACvD,CAAC;IAED;;OAEG;IACH,IAAI,kBAAkB;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,kBAAkB,CAAC;IACjD,CAAC;IAEQ,IAAI;QACT,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,IAAI,EACJ,2HAA2H,CAC9H,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEQ,IAAI;QACT,IAAI,CAAC,MAAM,CAAC,IAAI,CACZ,IAAI,EACJ,2HAA2H,CAC9H,CAAC;QACF,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAEQ,OAAO,CAAC,OAAiB;QAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,OAAO,YAAY,yBAAe,IAAI,OAAO,YAAY,4BAAkB,EAAE;YAC7E,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;SACnD;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAES,eAAe,CAAC,IAA0B;QAChD,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1D,CAAC;CACJ,CAAA;AAlDY,4CAAgB;AAEf;IADT,IAAA,kBAAM,EAAC,sBAAY,CAAC;;sDACgB;AAIrC;IADC,IAAA,sBAAU,GAAE;;;;+CAGZ;2BARQ,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAkD5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019-
|
|
2
|
+
* Copyright (c) 2019-2024 EclipseSource 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.module.d.ts","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAEH,aAAa,
|
|
1
|
+
{"version":3,"file":"default.module.d.ts","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAEH,aAAa,EAehB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,mCAAmC,CAAC;AAC3C,OAAO,4BAA4B,CAAC;AAwBpC;;;GAGG;AACH,eAAO,MAAM,aAAa,eAuExB,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defaultModule = void 0;
|
|
4
4
|
/********************************************************************************
|
|
5
|
-
* Copyright (c) 2019-
|
|
5
|
+
* Copyright (c) 2019-2024 EclipseSource and others.
|
|
6
6
|
*
|
|
7
7
|
* This program and the accompanying materials are made available under the
|
|
8
8
|
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -23,6 +23,7 @@ const action_dispatcher_1 = require("./action-dispatcher");
|
|
|
23
23
|
const action_handler_registry_1 = require("./action-handler-registry");
|
|
24
24
|
const command_stack_1 = require("./command-stack");
|
|
25
25
|
const editor_context_service_1 = require("./editor-context-service");
|
|
26
|
+
const feedback_1 = require("./feedback");
|
|
26
27
|
const css_feedback_1 = require("./feedback/css-feedback");
|
|
27
28
|
const feedback_action_dispatcher_1 = require("./feedback/feedback-action-dispatcher");
|
|
28
29
|
const update_model_command_1 = require("./feedback/update-model-command");
|
|
@@ -36,6 +37,7 @@ const selection_clearing_mouse_listener_1 = require("./selection-clearing-mouse-
|
|
|
36
37
|
const selection_service_1 = require("./selection-service");
|
|
37
38
|
const tool_1 = require("./tool-manager/tool");
|
|
38
39
|
const tool_manager_1 = require("./tool-manager/tool-manager");
|
|
40
|
+
const ui_extension_registry_1 = require("./ui-extension-registry");
|
|
39
41
|
const key_tool_1 = require("./view/key-tool");
|
|
40
42
|
const mouse_tool_1 = require("./view/mouse-tool");
|
|
41
43
|
const view_registry_1 = require("./view/view-registry");
|
|
@@ -47,7 +49,9 @@ exports.defaultModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebi
|
|
|
47
49
|
// load bindings from sprotty's default module to avoid code duplication
|
|
48
50
|
sprotty_1.sprottyDefaultModule.registry(bind, unbind, isBound, rebind, ...rest);
|
|
49
51
|
const context = { bind, unbind, isBound, rebind };
|
|
52
|
+
(0, sprotty_1.bindLazyInjector)(context);
|
|
50
53
|
bind(editor_context_service_1.EditorContextService).toSelf().inSingletonScope();
|
|
54
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(editor_context_service_1.EditorContextService);
|
|
51
55
|
bind(sprotty_1.TYPES.IEditorContextServiceProvider).toProvider(ctx => async () => ctx.container.get(editor_context_service_1.EditorContextService));
|
|
52
56
|
(0, sprotty_1.configureActionHandler)(context, sprotty_1.SetEditModeAction.KIND, editor_context_service_1.EditorContextService);
|
|
53
57
|
(0, sprotty_1.configureActionHandler)(context, sprotty_1.SetDirtyStateAction.KIND, editor_context_service_1.EditorContextService);
|
|
@@ -56,16 +60,18 @@ exports.defaultModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebi
|
|
|
56
60
|
// Model update initialization ------------------------------------
|
|
57
61
|
bind(sprotty_1.TYPES.IFeedbackActionDispatcher).to(feedback_action_dispatcher_1.FeedbackActionDispatcher).inSingletonScope();
|
|
58
62
|
(0, sprotty_1.configureCommand)(context, update_model_command_1.FeedbackAwareUpdateModelCommand);
|
|
63
|
+
rebind(sprotty_1.SetModelCommand).to(feedback_1.FeedbackAwareSetModelCommand);
|
|
59
64
|
bind(mouse_tool_1.GLSPMouseTool).toSelf().inSingletonScope();
|
|
60
65
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.MouseTool).toService(mouse_tool_1.GLSPMouseTool);
|
|
66
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(mouse_tool_1.GLSPMouseTool);
|
|
61
67
|
bind(key_tool_1.GLSPKeyTool).toSelf().inSingletonScope();
|
|
62
68
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.KeyTool).toService(key_tool_1.GLSPKeyTool);
|
|
69
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(key_tool_1.GLSPKeyTool);
|
|
63
70
|
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.MouseListener, selection_clearing_mouse_listener_1.SelectionClearingMouseListener);
|
|
64
71
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.TYPES.ICommandStack).to(command_stack_1.GLSPCommandStack).inSingletonScope();
|
|
65
72
|
bind(action_dispatcher_1.GLSPActionDispatcher).toSelf().inSingletonScope();
|
|
66
73
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.TYPES.IActionDispatcher).toService(action_dispatcher_1.GLSPActionDispatcher);
|
|
67
|
-
|
|
68
|
-
(0, sprotty_1.bindOrRebind)(context, sprotty_1.ActionHandlerRegistry).toService(action_handler_registry_1.GLSPActionHandlerRegistry);
|
|
74
|
+
(0, sprotty_1.bindOrRebind)(context, sprotty_1.ActionHandlerRegistry).to(action_handler_registry_1.GLSPActionHandlerRegistry).inSingletonScope();
|
|
69
75
|
(0, sprotty_1.bindAsService)(context, sprotty_1.TYPES.ModelSource, glsp_model_source_1.GLSPModelSource);
|
|
70
76
|
bind(diagram_loader_1.DiagramLoader).toSelf().inSingletonScope();
|
|
71
77
|
bind(model_initialization_constraint_1.ModelInitializationConstraint).to(model_initialization_constraint_1.DefaultModelInitializationConstraint).inSingletonScope();
|
|
@@ -73,6 +79,8 @@ exports.defaultModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebi
|
|
|
73
79
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.TYPES.SModelRegistry).to(model_registry_1.GModelRegistry).inSingletonScope();
|
|
74
80
|
(0, sprotty_1.bindOrRebind)(context, sprotty_1.TYPES.ViewRegistry).to(view_registry_1.GViewRegistry).inSingletonScope();
|
|
75
81
|
bind(selection_service_1.SelectionService).toSelf().inSingletonScope();
|
|
82
|
+
bind(sprotty_1.TYPES.IGModelRootListener).toService(selection_service_1.SelectionService);
|
|
83
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(selection_service_1.SelectionService);
|
|
76
84
|
// Feedback Support ------------------------------------
|
|
77
85
|
// Generic re-usable feedback modifying css classes
|
|
78
86
|
(0, sprotty_1.configureCommand)(context, css_feedback_1.ModifyCssFeedbackCommand);
|
|
@@ -82,10 +90,15 @@ exports.defaultModule = new sprotty_1.FeatureModule((bind, unbind, isBound, rebi
|
|
|
82
90
|
bind(sprotty_1.TYPES.HiddenVNodePostprocessor).toService(sprotty_1.LocationPostprocessor);
|
|
83
91
|
// Tool manager initialization ------------------------------------
|
|
84
92
|
bind(sprotty_1.TYPES.IToolManager).to(tool_manager_1.ToolManager).inSingletonScope();
|
|
93
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(sprotty_1.TYPES.IToolManager);
|
|
94
|
+
bind(sprotty_1.TYPES.IEditModeListener).toService(sprotty_1.TYPES.IToolManager);
|
|
85
95
|
bind(tool_manager_1.DefaultToolsEnablingKeyListener).toSelf().inSingletonScope();
|
|
86
96
|
bind(sprotty_1.TYPES.KeyListener).toService(tool_manager_1.DefaultToolsEnablingKeyListener);
|
|
87
97
|
bind(tool_manager_1.ToolManagerActionHandler).toSelf().inSingletonScope();
|
|
88
98
|
(0, sprotty_1.configureActionHandler)(context, tool_1.EnableDefaultToolsAction.KIND, tool_manager_1.ToolManagerActionHandler);
|
|
89
99
|
(0, sprotty_1.configureActionHandler)(context, tool_1.EnableToolsAction.KIND, tool_manager_1.ToolManagerActionHandler);
|
|
100
|
+
bind(ui_extension_registry_1.GLSPUIExtensionRegistry).toSelf().inSingletonScope();
|
|
101
|
+
(0, sprotty_1.bindOrRebind)(context, sprotty_1.TYPES.UIExtensionRegistry).toService(ui_extension_registry_1.GLSPUIExtensionRegistry);
|
|
102
|
+
bind(sprotty_1.TYPES.IDiagramStartup).toService(ui_extension_registry_1.GLSPUIExtensionRegistry);
|
|
90
103
|
});
|
|
91
104
|
//# sourceMappingURL=default.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.module.js","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,
|
|
1
|
+
{"version":3,"file":"default.module.js","sourceRoot":"","sources":["../../src/base/default.module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,mDAiB+B;AAC/B,6CAA2C;AAC3C,sCAAoC;AACpC,2DAA2D;AAC3D,uEAAsE;AACtE,mDAAmD;AACnD,qEAAgE;AAChE,yCAA0D;AAC1D,0DAAmE;AACnE,sFAAiF;AACjF,0EAAkF;AAClF,iFAA4E;AAC5E,yDAAqD;AACrD,2DAAuD;AACvD,iEAA4D;AAC5D,6FAA8H;AAC9H,2DAAwD;AACxD,2FAAqF;AACrF,2DAAuD;AACvD,8CAAkF;AAClF,8DAAqH;AACrH,mEAAkE;AAClE,8CAA8C;AAC9C,kDAAkD;AAClD,wDAAqD;AAErD;;;GAGG;AACU,QAAA,aAAa,GAAG,IAAI,uBAAa,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE;IACtF,wEAAwE;IACxE,8BAAoB,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC;IACtE,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAElD,IAAA,0BAAgB,EAAC,OAAO,CAAC,CAAC;IAE1B,IAAI,CAAC,6CAAoB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IACvD,IAAI,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,6CAAoB,CAAC,CAAC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uB,CAAC,CAAC;IACpF,IAAI,CAAC,eAAK,CAAC,eAAe,CAAC,CAAC,SAAS,CAAC,+CAAuB,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2020-2024 EclipseSource 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, AnyObject, Args, Disposable, DisposableCollection, EditorContext, Emitter, Event, GModelElement, GModelRoot, IActionHandler, LazyInjector, MaybePromise, MousePositionTracker, SetDirtyStateAction, SetEditModeAction, ValueChange } from '@eclipse-glsp/sprotty';
|
|
2
17
|
import { GLSPActionDispatcher } from './action-dispatcher';
|
|
3
18
|
import { IDiagramOptions, IDiagramStartup } from './model/diagram-loader';
|
|
4
19
|
import { SelectionService } from './selection-service';
|
|
20
|
+
/**
|
|
21
|
+
* A hook to listen for model root changes. Will be called after a server update
|
|
22
|
+
* has been processed
|
|
23
|
+
*/
|
|
24
|
+
export interface IGModelRootListener {
|
|
25
|
+
modelRootChanged(root: Readonly<GModelRoot>): void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated Use {@link IGModelRootListener} instead
|
|
29
|
+
*/
|
|
30
|
+
export type ISModelRootListener = IGModelRootListener;
|
|
31
|
+
/**
|
|
32
|
+
* A hook to listen for edit mode changes. Will be after the {@link EditorContextService}
|
|
33
|
+
* has handled the {@link SetEditModeAction}.
|
|
34
|
+
*/
|
|
5
35
|
export interface IEditModeListener {
|
|
6
36
|
editModeChanged(newValue: string, oldValue: string): void;
|
|
7
37
|
}
|
|
@@ -21,8 +51,8 @@ export type DirtyStateChange = Pick<SetDirtyStateAction, 'isDirty' | 'reason'>;
|
|
|
21
51
|
export declare class EditorContextService implements IActionHandler, Disposable, IDiagramStartup {
|
|
22
52
|
protected selectionService: SelectionService;
|
|
23
53
|
protected mousePositionTracker: MousePositionTracker;
|
|
54
|
+
protected lazyInjector: LazyInjector;
|
|
24
55
|
protected diagramOptions: IDiagramOptions;
|
|
25
|
-
protected editModeListeners: IEditModeListener[];
|
|
26
56
|
protected actionDispatcher: GLSPActionDispatcher;
|
|
27
57
|
protected _editMode: string;
|
|
28
58
|
protected onEditModeChangedEmitter: Emitter<ValueChange<string>>;
|
|
@@ -30,11 +60,23 @@ export declare class EditorContextService implements IActionHandler, Disposable,
|
|
|
30
60
|
protected _isDirty: boolean;
|
|
31
61
|
protected onDirtyStateChangedEmitter: Emitter<DirtyStateChange>;
|
|
32
62
|
get onDirtyStateChanged(): Event<DirtyStateChange>;
|
|
63
|
+
protected _modelRoot?: Readonly<GModelRoot>;
|
|
64
|
+
protected onModelRootChangedEmitter: Emitter<Readonly<GModelRoot>>;
|
|
65
|
+
get onModelRootChanged(): Event<Readonly<GModelRoot>>;
|
|
33
66
|
protected toDispose: DisposableCollection;
|
|
34
67
|
protected initialize(): void;
|
|
68
|
+
preLoadDiagram(): MaybePromise<void>;
|
|
35
69
|
dispose(): void;
|
|
36
70
|
get(args?: Args): EditorContext;
|
|
37
71
|
getWithSelection(selectedElementIds: string[], args?: Args): EditorContext;
|
|
72
|
+
/**
|
|
73
|
+
* Notifies the service about a model root change. This method should not be called
|
|
74
|
+
* directly. It is called by the `CommandStack` after a model update has been processed.
|
|
75
|
+
* @throws an error if the notifier is not a `CommandStack`
|
|
76
|
+
* @param root the new model root
|
|
77
|
+
* @param notifier the object that triggered the model root change
|
|
78
|
+
*/
|
|
79
|
+
notifyModelRootChanged(root: Readonly<GModelRoot>, notifier: AnyObject): void;
|
|
38
80
|
handle(action: Action): void;
|
|
39
81
|
protected handleSetEditModeAction(action: SetEditModeAction): void;
|
|
40
82
|
protected handleSetDirtyStateAction(action: SetDirtyStateAction): void;
|
|
@@ -46,7 +88,6 @@ export declare class EditorContextService implements IActionHandler, Disposable,
|
|
|
46
88
|
get selectedElements(): Readonly<GModelElement>[];
|
|
47
89
|
get isReadonly(): boolean;
|
|
48
90
|
get isDirty(): boolean;
|
|
49
|
-
postRequestModel(): MaybePromise<void>;
|
|
50
91
|
}
|
|
51
92
|
export type EditorContextServiceProvider = () => Promise<EditorContextService>;
|
|
52
93
|
//# sourceMappingURL=editor-context-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor-context-service.d.ts","sourceRoot":"","sources":["../../src/base/editor-context-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editor-context-service.d.ts","sourceRoot":"","sources":["../../src/base/editor-context-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EACH,MAAM,EACN,SAAS,EACT,IAAI,EAEJ,UAAU,EACV,oBAAoB,EAEpB,aAAa,EACb,OAAO,EACP,KAAK,EACL,aAAa,EACb,UAAU,EACV,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EAEjB,WAAW,EACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;GAGG;A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