@hydranium/glsp-client 1.0.0-next.399 → 1.0.0-next.401
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/glsp-client-module.d.ts.map +1 -1
- package/lib/glsp-client-module.js +2 -0
- package/lib/glsp-client-module.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/label-edit-ui.d.ts +20 -0
- package/lib/label-edit-ui.d.ts.map +1 -0
- package/lib/label-edit-ui.js +57 -0
- package/lib/label-edit-ui.js.map +1 -0
- package/package.json +3 -3
- package/src/glsp-client-module.ts +3 -0
- package/src/index.ts +1 -0
- package/src/label-edit-ui.ts +48 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-client-module.d.ts","sourceRoot":"","sources":["../src/glsp-client-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,cAAc,
|
|
1
|
+
{"version":3,"file":"glsp-client-module.d.ts","sourceRoot":"","sources":["../src/glsp-client-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,cAAc,EAQrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA4C,KAAK,MAAM,EAAe,MAAM,qBAAqB,CAAC;AAUzG,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACrC;;mDAE+C;IAC/C,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;kBAGc;IACd,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,GAAE,uBAA4B,GAAG,IAAI,CA+B3G"}
|
|
@@ -14,6 +14,7 @@ const protocol_1 = require("@hydranium/protocol");
|
|
|
14
14
|
const action_dispatcher_1 = require("./action-dispatcher");
|
|
15
15
|
const diagram_loader_1 = require("./diagram-loader");
|
|
16
16
|
const hidden_bounds_updater_1 = require("./hidden-bounds-updater");
|
|
17
|
+
const label_edit_ui_1 = require("./label-edit-ui");
|
|
17
18
|
const select_mouse_listener_1 = require("./select-mouse-listener");
|
|
18
19
|
const sprotty_logger_adapter_1 = require("./sprotty-logger-adapter");
|
|
19
20
|
const status_overlay_1 = require("./status-overlay");
|
|
@@ -63,6 +64,7 @@ function createGlspClientModule(context, options = {}) {
|
|
|
63
64
|
rebind(client_1.DiagramLoader).to(diagram_loader_1.HydraniumDiagramLoader).inSingletonScope();
|
|
64
65
|
rebind(client_1.GLSPHiddenBoundsUpdater).to(hidden_bounds_updater_1.HydraniumHiddenBoundsUpdater).inSingletonScope();
|
|
65
66
|
rebind(client_1.StatusOverlay).to(status_overlay_1.HydraniumStatusOverlay).inSingletonScope();
|
|
67
|
+
rebind(client_1.GlspEditLabelUI).to(label_edit_ui_1.HydraniumLabelEditUI).inSingletonScope();
|
|
66
68
|
rebind(client_1.RankedSelectMouseListener).to(select_mouse_listener_1.HydraniumSelectMouseListener).inSingletonScope();
|
|
67
69
|
rebind(client_1.TYPES.ILogger).to(sprotty_logger_adapter_1.SprottyLoggerAdapter).inSingletonScope();
|
|
68
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-client-module.js","sourceRoot":"","sources":["../src/glsp-client-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"glsp-client-module.js","sourceRoot":"","sources":["../src/glsp-client-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,iDAS8B;AAC9B,kDAAyG;AACzG,2DAAoE;AACpE,qDAA0D;AAC1D,mEAAuE;AACvE,mDAAuD;AACvD,mEAAuE;AACvE,qEAAgE;AAChE,qDAA0D;AAC1D,mCAA+C;AAe/C;;;;;;;;;;;;;;;;;GAiBG;AACH,gCAAuC,OAAuB,EAAE,OAAO,GAA4B,EAAE;IAClG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QAClB,CAAC,OAAO,CAAC,4BAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,4BAAoB,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACvH,CAAC;SAAM,IAAI,CAAC,OAAO,CAAC,4BAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,4BAAoB,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,IAAI,wBAAa,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,4BAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,4BAAoB,CAAC,MAAM,CAAC;aAC7B,cAAc,CAAC,GAAG,CAAC,EAAE;YACnB,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAS,4BAAoB,CAAC,MAAM,CAAC,CAAC;YACtE,MAAM,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,4BAAoB,CAAC,KAAK,CAAC;gBAC5D,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAQ,4BAAoB,CAAC,KAAK,CAAC;gBACtD,CAAC,CAAC,IAAI,sBAAW,EAAE,CAAC;YACvB,OAAO,IAAI,wBAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC,CAAC;aACD,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,OAAO,CAAC,kBAAkB,KAAK,SAAS,EAAE,CAAC;QAC5C,CAAC,OAAO,CAAC,4BAAoB,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,4BAAoB,CAAC,kBAAkB,CAAC,CAAC,eAAe,CACxH,OAAO,CAAC,kBAAkB,CAC5B,CAAC;IACL,CAAC;IACD,IAAI,CAAC,iDAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,MAAM,CAAC,6BAAoB,CAAC,CAAC,SAAS,CAAC,iDAA6B,CAAC,CAAC;IACtE,MAAM,CAAC,sBAAa,CAAC,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,MAAM,CAAC,gCAAuB,CAAC,CAAC,EAAE,CAAC,oDAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpF,MAAM,CAAC,sBAAa,CAAC,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,MAAM,CAAC,wBAAe,CAAC,CAAC,EAAE,CAAC,oCAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,MAAM,CAAC,kCAAyB,CAAC,CAAC,EAAE,CAAC,oDAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACtF,MAAM,CAAC,cAAK,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,6CAAoB,CAAC,CAAC,gBAAgB,EAAE,CAAC;AACrE,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './glsp-client';
|
|
|
17
17
|
export * from './glsp-connection';
|
|
18
18
|
export * from './glsp-client-module';
|
|
19
19
|
export * from './hidden-bounds-updater';
|
|
20
|
+
export * from './label-edit-ui';
|
|
20
21
|
export * from './message-overlay';
|
|
21
22
|
export * from './select-mouse-listener';
|
|
22
23
|
export * from './sprotty-logger-adapter';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAOlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAOlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __exportStar(require("./glsp-client"), exports);
|
|
|
38
38
|
__exportStar(require("./glsp-connection"), exports);
|
|
39
39
|
__exportStar(require("./glsp-client-module"), exports);
|
|
40
40
|
__exportStar(require("./hidden-bounds-updater"), exports);
|
|
41
|
+
__exportStar(require("./label-edit-ui"), exports);
|
|
41
42
|
__exportStar(require("./message-overlay"), exports);
|
|
42
43
|
__exportStar(require("./select-mouse-listener"), exports);
|
|
43
44
|
__exportStar(require("./sprotty-logger-adapter"), exports);
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,SAAS;AACT,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,4DAA0C;AAC1C,4DAA0C;AAC1C,kDAAgC;AAChC,yCAAuB;AACvB,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC;AACxC,oDAAkC;AAClC,0DAAwC;AACxC,2DAAyC;AACzC,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAC5E,4EAA4E;AAC5E,SAAS;AACT,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,4DAA0C;AAC1C,4DAA0C;AAC1C,kDAAgC;AAChC,yCAAuB;AACvB,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,0DAAwC;AACxC,kDAAgC;AAChC,oDAAkC;AAClC,0DAAwC;AACxC,2DAAyC;AACzC,mDAAiC;AACjC,gDAA8B;AAC9B,0CAAwB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
import { GlspEditLabelUI } from '@eclipse-glsp/client';
|
|
10
|
+
/**
|
|
11
|
+
* Sprotty 1.4 leaves a delayed blur submission alive when its label editor
|
|
12
|
+
* closes. The same input serves the next label, so that callback can submit
|
|
13
|
+
* or close a later edit. Keep the blur timer owned by the visible editor.
|
|
14
|
+
*/
|
|
15
|
+
export declare class HydraniumLabelEditUI extends GlspEditLabelUI {
|
|
16
|
+
protected blurTimeout: number | undefined;
|
|
17
|
+
protected configureAndAdd(element: HTMLInputElement | HTMLTextAreaElement, containerElement: HTMLElement): void;
|
|
18
|
+
hide(): void;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=label-edit-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-edit-ui.d.ts","sourceRoot":"","sources":["../src/label-edit-ui.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,qBACa,oBAAqB,SAAQ,eAAe;IACtD,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C,UAAmB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,GAAG,IAAI,CAkBvH;IAEQ,IAAI,IAAI,IAAI,CAKpB;CACH"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/********************************************************************************
|
|
3
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
4
|
+
*
|
|
5
|
+
* This program and the accompanying materials are made available under the
|
|
6
|
+
* terms of the MIT License which is available in the project root.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: MIT
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
11
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
12
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
13
|
+
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;
|
|
14
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.HydraniumLabelEditUI = void 0;
|
|
18
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
20
|
+
/**
|
|
21
|
+
* Sprotty 1.4 leaves a delayed blur submission alive when its label editor
|
|
22
|
+
* closes. The same input serves the next label, so that callback can submit
|
|
23
|
+
* or close a later edit. Keep the blur timer owned by the visible editor.
|
|
24
|
+
*/
|
|
25
|
+
let HydraniumLabelEditUI = class HydraniumLabelEditUI extends client_1.GlspEditLabelUI {
|
|
26
|
+
blurTimeout;
|
|
27
|
+
configureAndAdd(element, containerElement) {
|
|
28
|
+
// The base installs an anonymous blur listener whose timer cannot be
|
|
29
|
+
// cancelled. Configure the input here so hide can cancel that work.
|
|
30
|
+
element.style.visibility = 'hidden';
|
|
31
|
+
element.style.position = 'absolute';
|
|
32
|
+
element.style.top = '0px';
|
|
33
|
+
element.style.left = '0px';
|
|
34
|
+
const target = element;
|
|
35
|
+
target.addEventListener('keydown', event => this.hideIfEscapeEvent(event));
|
|
36
|
+
target.addEventListener('keyup', event => this.validateLabelIfContentChange(event, element.value));
|
|
37
|
+
target.addEventListener('blur', () => {
|
|
38
|
+
window.clearTimeout(this.blurTimeout);
|
|
39
|
+
this.blurTimeout = window.setTimeout(() => {
|
|
40
|
+
this.blurTimeout = undefined;
|
|
41
|
+
void this.applyLabelEdit();
|
|
42
|
+
}, 200);
|
|
43
|
+
});
|
|
44
|
+
containerElement.appendChild(element);
|
|
45
|
+
}
|
|
46
|
+
hide() {
|
|
47
|
+
super.hide();
|
|
48
|
+
// Hiding the focused input can itself fire blur, so cancel after it.
|
|
49
|
+
window.clearTimeout(this.blurTimeout);
|
|
50
|
+
this.blurTimeout = undefined;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
exports.HydraniumLabelEditUI = HydraniumLabelEditUI;
|
|
54
|
+
exports.HydraniumLabelEditUI = HydraniumLabelEditUI = __decorate([
|
|
55
|
+
(0, inversify_1.injectable)()
|
|
56
|
+
], HydraniumLabelEditUI);
|
|
57
|
+
//# sourceMappingURL=label-edit-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label-edit-ui.js","sourceRoot":"","sources":["../src/label-edit-ui.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAuD;AACvD,yCAAuC;AAEvC;;;;GAIG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,wBAAe;IAC5C,WAAW,CAAqB;IAEvB,eAAe,CAAC,OAA+C,EAAE,gBAA6B;QAC9G,qEAAqE;QACrE,oEAAoE;QACpE,OAAO,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;QACpC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;QAC3B,MAAM,MAAM,GAAgB,OAAO,CAAC;QACpC,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QACnG,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;YAClC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACtC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACvC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;gBAC7B,KAAK,IAAI,CAAC,cAAc,EAAE,CAAC;YAC9B,CAAC,EAAE,GAAG,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;QACH,gBAAgB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAEQ,IAAI;QACV,KAAK,CAAC,IAAI,EAAE,CAAC;QACb,qEAAqE;QACrE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAChC,CAAC;CACH,CAAA;;+BA7BY,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA6BhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hydranium/glsp-client",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.401",
|
|
4
4
|
"description": "Host-neutral client classes for GLSP heads built on @hydranium/glsp-server, the binder that mounts them in a Theia frontend, a VS Code webview or a plain browser page, the one call that mounts a diagram in a page, and the edge whose labels keep finite bounds without bendpoints.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"diagram",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@eclipse-glsp/client": "2.8.0",
|
|
66
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
66
|
+
"@hydranium/protocol": "1.0.0-next.401",
|
|
67
67
|
"@types/node": "^22.0.0",
|
|
68
68
|
"inversify": "6.2.2",
|
|
69
69
|
"reflect-metadata": "0.2.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@eclipse-glsp/client": "^2.7.0",
|
|
76
|
-
"@hydranium/protocol": "1.0.0-next.
|
|
76
|
+
"@hydranium/protocol": "1.0.0-next.401",
|
|
77
77
|
"inversify": "^6.1.3",
|
|
78
78
|
"snabbdom": "~3.5.1"
|
|
79
79
|
},
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
DiagramLoader,
|
|
13
13
|
GLSPActionDispatcher,
|
|
14
14
|
GLSPHiddenBoundsUpdater,
|
|
15
|
+
GlspEditLabelUI,
|
|
15
16
|
RankedSelectMouseListener,
|
|
16
17
|
StatusOverlay,
|
|
17
18
|
TYPES
|
|
@@ -20,6 +21,7 @@ import { type Clock, ConsoleLogger, DefaultTracer, type Logger, SystemClock } fr
|
|
|
20
21
|
import { HydraniumGlspActionDispatcher } from './action-dispatcher';
|
|
21
22
|
import { HydraniumDiagramLoader } from './diagram-loader';
|
|
22
23
|
import { HydraniumHiddenBoundsUpdater } from './hidden-bounds-updater';
|
|
24
|
+
import { HydraniumLabelEditUI } from './label-edit-ui';
|
|
23
25
|
import { HydraniumSelectMouseListener } from './select-mouse-listener';
|
|
24
26
|
import { SprottyLoggerAdapter } from './sprotty-logger-adapter';
|
|
25
27
|
import { HydraniumStatusOverlay } from './status-overlay';
|
|
@@ -84,6 +86,7 @@ export function createGlspClientModule(context: BindingContext, options: GlspCli
|
|
|
84
86
|
rebind(DiagramLoader).to(HydraniumDiagramLoader).inSingletonScope();
|
|
85
87
|
rebind(GLSPHiddenBoundsUpdater).to(HydraniumHiddenBoundsUpdater).inSingletonScope();
|
|
86
88
|
rebind(StatusOverlay).to(HydraniumStatusOverlay).inSingletonScope();
|
|
89
|
+
rebind(GlspEditLabelUI).to(HydraniumLabelEditUI).inSingletonScope();
|
|
87
90
|
rebind(RankedSelectMouseListener).to(HydraniumSelectMouseListener).inSingletonScope();
|
|
88
91
|
rebind(TYPES.ILogger).to(SprottyLoggerAdapter).inSingletonScope();
|
|
89
92
|
}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export * from './glsp-client';
|
|
|
23
23
|
export * from './glsp-connection';
|
|
24
24
|
export * from './glsp-client-module';
|
|
25
25
|
export * from './hidden-bounds-updater';
|
|
26
|
+
export * from './label-edit-ui';
|
|
26
27
|
export * from './message-overlay';
|
|
27
28
|
export * from './select-mouse-listener';
|
|
28
29
|
export * from './sprotty-logger-adapter';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2026 CrossBreeze, EclipseSource and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the MIT License which is available in the project root.
|
|
6
|
+
*
|
|
7
|
+
* SPDX-License-Identifier: MIT
|
|
8
|
+
********************************************************************************/
|
|
9
|
+
|
|
10
|
+
import { GlspEditLabelUI } from '@eclipse-glsp/client';
|
|
11
|
+
import { injectable } from 'inversify';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Sprotty 1.4 leaves a delayed blur submission alive when its label editor
|
|
15
|
+
* closes. The same input serves the next label, so that callback can submit
|
|
16
|
+
* or close a later edit. Keep the blur timer owned by the visible editor.
|
|
17
|
+
*/
|
|
18
|
+
@injectable()
|
|
19
|
+
export class HydraniumLabelEditUI extends GlspEditLabelUI {
|
|
20
|
+
protected blurTimeout: number | undefined;
|
|
21
|
+
|
|
22
|
+
protected override configureAndAdd(element: HTMLInputElement | HTMLTextAreaElement, containerElement: HTMLElement): void {
|
|
23
|
+
// The base installs an anonymous blur listener whose timer cannot be
|
|
24
|
+
// cancelled. Configure the input here so hide can cancel that work.
|
|
25
|
+
element.style.visibility = 'hidden';
|
|
26
|
+
element.style.position = 'absolute';
|
|
27
|
+
element.style.top = '0px';
|
|
28
|
+
element.style.left = '0px';
|
|
29
|
+
const target: HTMLElement = element;
|
|
30
|
+
target.addEventListener('keydown', event => this.hideIfEscapeEvent(event));
|
|
31
|
+
target.addEventListener('keyup', event => this.validateLabelIfContentChange(event, element.value));
|
|
32
|
+
target.addEventListener('blur', () => {
|
|
33
|
+
window.clearTimeout(this.blurTimeout);
|
|
34
|
+
this.blurTimeout = window.setTimeout(() => {
|
|
35
|
+
this.blurTimeout = undefined;
|
|
36
|
+
void this.applyLabelEdit();
|
|
37
|
+
}, 200);
|
|
38
|
+
});
|
|
39
|
+
containerElement.appendChild(element);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
override hide(): void {
|
|
43
|
+
super.hide();
|
|
44
|
+
// Hiding the focused input can itself fire blur, so cancel after it.
|
|
45
|
+
window.clearTimeout(this.blurTimeout);
|
|
46
|
+
this.blurTimeout = undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|