@hydranium/glsp-client-theia 1.0.0-next.23 → 1.0.0-next.232
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/README.md +59 -24
- package/lib/browser/action-dispatcher.d.ts +1 -1
- package/lib/browser/action-dispatcher.d.ts.map +1 -1
- package/lib/browser/action-dispatcher.js +1 -1
- package/lib/browser/action-dispatcher.js.map +1 -1
- package/lib/browser/client-contribution.d.ts +83 -25
- package/lib/browser/client-contribution.d.ts.map +1 -1
- package/lib/browser/client-contribution.js +225 -53
- package/lib/browser/client-contribution.js.map +1 -1
- package/lib/browser/diagram-loader.d.ts +16 -7
- package/lib/browser/diagram-loader.d.ts.map +1 -1
- package/lib/browser/diagram-loader.js +18 -10
- package/lib/browser/diagram-loader.js.map +1 -1
- package/lib/browser/diagram-only-marker-manager.d.ts.map +1 -1
- package/lib/browser/diagram-only-marker-manager.js.map +1 -1
- package/lib/browser/diagram-widget.d.ts +42 -24
- package/lib/browser/diagram-widget.d.ts.map +1 -1
- package/lib/browser/diagram-widget.js +74 -24
- package/lib/browser/diagram-widget.js.map +1 -1
- package/lib/browser/glsp-client-theia-module.d.ts +1 -1
- package/lib/browser/glsp-client-theia-module.d.ts.map +1 -1
- package/lib/browser/glsp-client-theia-module.js +3 -1
- package/lib/browser/glsp-client-theia-module.js.map +1 -1
- package/lib/browser/glsp-client.d.ts +17 -0
- package/lib/browser/glsp-client.d.ts.map +1 -0
- package/lib/browser/glsp-client.js +23 -0
- package/lib/browser/glsp-client.js.map +1 -0
- package/lib/browser/glsp-diagram-manager.d.ts +61 -0
- package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
- package/lib/browser/glsp-diagram-manager.js +126 -0
- package/lib/browser/glsp-diagram-manager.js.map +1 -1
- package/lib/browser/glsp-message-service.d.ts +8 -0
- package/lib/browser/glsp-message-service.d.ts.map +1 -1
- package/lib/browser/glsp-message-service.js +8 -0
- package/lib/browser/glsp-message-service.js.map +1 -1
- package/lib/browser/glsp-saveable.d.ts +66 -0
- package/lib/browser/glsp-saveable.d.ts.map +1 -0
- package/lib/browser/glsp-saveable.js +109 -0
- package/lib/browser/glsp-saveable.js.map +1 -0
- package/lib/browser/glsp-theia-frontend-module.d.ts.map +1 -1
- package/lib/browser/glsp-theia-frontend-module.js +4 -1
- package/lib/browser/glsp-theia-frontend-module.js.map +1 -1
- package/lib/browser/hidden-bounds-updater.d.ts +3 -5
- package/lib/browser/hidden-bounds-updater.d.ts.map +1 -1
- package/lib/browser/hidden-bounds-updater.js +8 -4
- package/lib/browser/hidden-bounds-updater.js.map +1 -1
- package/lib/browser/hydranium-glsp-diagram-configuration.d.ts.map +1 -1
- package/lib/browser/hydranium-glsp-diagram-configuration.js.map +1 -1
- package/lib/browser/index.d.ts +5 -0
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +4 -0
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/status-overlay.d.ts +23 -0
- package/lib/browser/status-overlay.d.ts.map +1 -0
- package/lib/browser/status-overlay.js +52 -0
- package/lib/browser/status-overlay.js.map +1 -0
- package/lib/browser/window-session.d.ts +57 -0
- package/lib/browser/window-session.d.ts.map +1 -0
- package/lib/browser/window-session.js +102 -0
- package/lib/browser/window-session.js.map +1 -0
- package/lib/node/connection-container-module.js.map +1 -1
- package/lib/node/glsp-server-connection-handler.d.ts +12 -11
- package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
- package/lib/node/glsp-server-connection-handler.js +12 -15
- package/lib/node/glsp-server-connection-handler.js.map +1 -1
- package/lib/testing/bind-recorder.js.map +1 -1
- package/package.json +34 -41
- package/src/browser/action-dispatcher.ts +1 -1
- package/src/browser/client-contribution.ts +250 -54
- package/src/browser/diagram-loader.ts +19 -12
- package/src/browser/diagram-widget.ts +79 -27
- package/src/browser/glsp-client-theia-module.ts +4 -2
- package/src/browser/glsp-client.ts +20 -0
- package/src/browser/glsp-diagram-manager.ts +140 -2
- package/src/browser/glsp-message-service.ts +8 -0
- package/src/browser/glsp-saveable.ts +110 -0
- package/src/browser/glsp-theia-frontend-module.ts +4 -1
- package/src/browser/hidden-bounds-updater.ts +6 -7
- package/src/browser/index.ts +9 -0
- package/src/browser/status-overlay.ts +43 -0
- package/src/browser/window-session.ts +114 -0
- package/src/node/glsp-server-connection-handler.ts +13 -15
- package/style/diagram-loading.css +2 -5
|
@@ -0,0 +1,66 @@
|
|
|
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 { GLSPSaveable } from '@eclipse-glsp/theia-integration/lib/browser/diagram/glsp-saveable';
|
|
10
|
+
/**
|
|
11
|
+
* A `GLSPSaveable` whose every save is a request the server answers, and which
|
|
12
|
+
* stays dirty until that answer arrives.
|
|
13
|
+
*
|
|
14
|
+
* GLSP's sends a `SaveModelAction`, which the server does not answer. It takes
|
|
15
|
+
* the next dirty-state change to clean as the answer, but the editor context
|
|
16
|
+
* reports a change only when the dirty flag changes: the second of two saves
|
|
17
|
+
* gets no answer, and a failed save gets none either. Here each save sends a
|
|
18
|
+
* `RequestSaveModelAction` and settles on the response to that request only:
|
|
19
|
+
* it resolves when the server has saved, rejects when the server rejects it,
|
|
20
|
+
* and rejects when {@link saveTimeout} runs out. A save sent while another is
|
|
21
|
+
* pending is a request of its own, so an edit made between the two is saved.
|
|
22
|
+
*
|
|
23
|
+
* GLSP's also reports not dirty from the moment it sends a save. Theia's exit
|
|
24
|
+
* check asks only whether anything is dirty, so the window closes over a save
|
|
25
|
+
* the server has not finished, and a page reloaded right after Ctrl+S gives no
|
|
26
|
+
* warning. Here the saveable is dirty while any save is pending. GLSP's also
|
|
27
|
+
* gives up after 2 s, and Theia's Save All then counts the save as failed and
|
|
28
|
+
* closes the window anyway, so a slow save of a large model is cut off.
|
|
29
|
+
*
|
|
30
|
+
* The dirty flag still comes from the server. An edit whose dirty-state change
|
|
31
|
+
* has not arrived when Save All runs does not make the saveable dirty, so that
|
|
32
|
+
* edit is not saved.
|
|
33
|
+
*
|
|
34
|
+
* The server answers only where the diagram module registers the request's
|
|
35
|
+
* handler; `AbstractHydraniumGlspDiagramModule` does. A server without it does
|
|
36
|
+
* not advertise the request, and against such a server the saveable is GLSP's:
|
|
37
|
+
* it sends a `SaveModelAction` and reports dirty as GLSP's does. It does not
|
|
38
|
+
* keep only the dirty-while-pending half there, because GLSP's tracks one
|
|
39
|
+
* pending save and a second save overwrites it, so the first would never
|
|
40
|
+
* report clean.
|
|
41
|
+
*
|
|
42
|
+
* The answer means the server has done what its save does, which is not always
|
|
43
|
+
* the disk write: under the `fire-and-forget` `SaveDeliveryPolicy` the server
|
|
44
|
+
* answers before the write finishes and answers a failed write as saved, so a
|
|
45
|
+
* window closed on that answer can still lose the write.
|
|
46
|
+
*/
|
|
47
|
+
export declare class HydraniumGlspSaveable extends GLSPSaveable {
|
|
48
|
+
/**
|
|
49
|
+
* How long a save waits for the server's response before it rejects.
|
|
50
|
+
* Long, because the wait only runs out when the server hangs, and a save
|
|
51
|
+
* that rejects in Theia's Save All lets the window close over it.
|
|
52
|
+
*/
|
|
53
|
+
protected saveTimeout: number;
|
|
54
|
+
/** The saves sent and not yet settled. */
|
|
55
|
+
protected readonly pendingSaves: Set<Promise<void>>;
|
|
56
|
+
get dirty(): boolean;
|
|
57
|
+
save(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the server answers a {@link RequestSaveModelAction}. GLSP's model
|
|
60
|
+
* source registers a handler for each kind the server advertises before it
|
|
61
|
+
* requests the model, so the dispatcher knows it from the first save on.
|
|
62
|
+
*/
|
|
63
|
+
protected serverAnswersSaves(): boolean;
|
|
64
|
+
protected sendSave(): Promise<void>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=glsp-saveable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glsp-saveable.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-saveable.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAMlF,OAAO,EAAE,YAAY,EAAE,MAAM,mEAAmE,CAAC;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;IACpD;;;;OAIG;IACH,UAAmB,WAAW,SAAU;IACxC,0CAA0C;IAC1C,SAAS,CAAC,QAAQ,CAAC,YAAY,qBAA4B;IAE3D,IAAa,KAAK,IAAI,OAAO,CAK5B;IAEQ,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAS7B;IAED;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,IAAI,OAAO,CAEtC;IAED,SAAS,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAmBlC;CACH"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.HydraniumGlspSaveable = void 0;
|
|
12
|
+
const protocol_1 = require("@hydranium/protocol");
|
|
13
|
+
// The module path, not the package root: the root also loads GLSP's diagram
|
|
14
|
+
// widget, which touches DOM globals at module load, and this module's unit tests
|
|
15
|
+
// load it in Node.
|
|
16
|
+
const glsp_saveable_1 = require("@eclipse-glsp/theia-integration/lib/browser/diagram/glsp-saveable");
|
|
17
|
+
/**
|
|
18
|
+
* A `GLSPSaveable` whose every save is a request the server answers, and which
|
|
19
|
+
* stays dirty until that answer arrives.
|
|
20
|
+
*
|
|
21
|
+
* GLSP's sends a `SaveModelAction`, which the server does not answer. It takes
|
|
22
|
+
* the next dirty-state change to clean as the answer, but the editor context
|
|
23
|
+
* reports a change only when the dirty flag changes: the second of two saves
|
|
24
|
+
* gets no answer, and a failed save gets none either. Here each save sends a
|
|
25
|
+
* `RequestSaveModelAction` and settles on the response to that request only:
|
|
26
|
+
* it resolves when the server has saved, rejects when the server rejects it,
|
|
27
|
+
* and rejects when {@link saveTimeout} runs out. A save sent while another is
|
|
28
|
+
* pending is a request of its own, so an edit made between the two is saved.
|
|
29
|
+
*
|
|
30
|
+
* GLSP's also reports not dirty from the moment it sends a save. Theia's exit
|
|
31
|
+
* check asks only whether anything is dirty, so the window closes over a save
|
|
32
|
+
* the server has not finished, and a page reloaded right after Ctrl+S gives no
|
|
33
|
+
* warning. Here the saveable is dirty while any save is pending. GLSP's also
|
|
34
|
+
* gives up after 2 s, and Theia's Save All then counts the save as failed and
|
|
35
|
+
* closes the window anyway, so a slow save of a large model is cut off.
|
|
36
|
+
*
|
|
37
|
+
* The dirty flag still comes from the server. An edit whose dirty-state change
|
|
38
|
+
* has not arrived when Save All runs does not make the saveable dirty, so that
|
|
39
|
+
* edit is not saved.
|
|
40
|
+
*
|
|
41
|
+
* The server answers only where the diagram module registers the request's
|
|
42
|
+
* handler; `AbstractHydraniumGlspDiagramModule` does. A server without it does
|
|
43
|
+
* not advertise the request, and against such a server the saveable is GLSP's:
|
|
44
|
+
* it sends a `SaveModelAction` and reports dirty as GLSP's does. It does not
|
|
45
|
+
* keep only the dirty-while-pending half there, because GLSP's tracks one
|
|
46
|
+
* pending save and a second save overwrites it, so the first would never
|
|
47
|
+
* report clean.
|
|
48
|
+
*
|
|
49
|
+
* The answer means the server has done what its save does, which is not always
|
|
50
|
+
* the disk write: under the `fire-and-forget` `SaveDeliveryPolicy` the server
|
|
51
|
+
* answers before the write finishes and answers a failed write as saved, so a
|
|
52
|
+
* window closed on that answer can still lose the write.
|
|
53
|
+
*/
|
|
54
|
+
class HydraniumGlspSaveable extends glsp_saveable_1.GLSPSaveable {
|
|
55
|
+
/**
|
|
56
|
+
* How long a save waits for the server's response before it rejects.
|
|
57
|
+
* Long, because the wait only runs out when the server hangs, and a save
|
|
58
|
+
* that rejects in Theia's Save All lets the window close over it.
|
|
59
|
+
*/
|
|
60
|
+
saveTimeout = 10_000;
|
|
61
|
+
/** The saves sent and not yet settled. */
|
|
62
|
+
pendingSaves = new Set();
|
|
63
|
+
get dirty() {
|
|
64
|
+
if (!this.serverAnswersSaves()) {
|
|
65
|
+
return super.dirty;
|
|
66
|
+
}
|
|
67
|
+
return this.editorContextService.isDirty || this.pendingSaves.size > 0;
|
|
68
|
+
}
|
|
69
|
+
save() {
|
|
70
|
+
if (!this.serverAnswersSaves()) {
|
|
71
|
+
return super.save();
|
|
72
|
+
}
|
|
73
|
+
if (this.editorContextService.isDirty) {
|
|
74
|
+
return this.sendSave();
|
|
75
|
+
}
|
|
76
|
+
// Nothing new to save, but a save still pending has not finished.
|
|
77
|
+
return Promise.all(this.pendingSaves).then(() => undefined);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Whether the server answers a {@link RequestSaveModelAction}. GLSP's model
|
|
81
|
+
* source registers a handler for each kind the server advertises before it
|
|
82
|
+
* requests the model, so the dispatcher knows it from the first save on.
|
|
83
|
+
*/
|
|
84
|
+
serverAnswersSaves() {
|
|
85
|
+
return this.actionDispatcher.hasHandler(protocol_1.RequestSaveModelAction.create());
|
|
86
|
+
}
|
|
87
|
+
sendSave() {
|
|
88
|
+
// `request` with a bound of our own rather than GLSP's `requestUntil`:
|
|
89
|
+
// that one forgets a request when it times out, so a late response is
|
|
90
|
+
// dispatched as an action no client handler takes, which rejects.
|
|
91
|
+
// Here a late response settles the forgotten request and nothing else.
|
|
92
|
+
const response = this.actionDispatcher.request(protocol_1.RequestSaveModelAction.create());
|
|
93
|
+
let timer;
|
|
94
|
+
const timedOut = new Promise((_resolve, reject) => {
|
|
95
|
+
timer = setTimeout(() => reject(new Error('Save operation timed out')), this.saveTimeout);
|
|
96
|
+
});
|
|
97
|
+
const saving = Promise.race([response, timedOut])
|
|
98
|
+
.then(() => undefined)
|
|
99
|
+
.finally(() => {
|
|
100
|
+
clearTimeout(timer);
|
|
101
|
+
this.pendingSaves.delete(saving);
|
|
102
|
+
this.onDirtyChangedEmitter.fire(undefined);
|
|
103
|
+
});
|
|
104
|
+
this.pendingSaves.add(saving);
|
|
105
|
+
return saving;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.HydraniumGlspSaveable = HydraniumGlspSaveable;
|
|
109
|
+
//# sourceMappingURL=glsp-saveable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glsp-saveable.js","sourceRoot":"","sources":["../../src/browser/glsp-saveable.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,kDAA6D;AAC7D,4EAA4E;AAC5E,iFAAiF;AACjF,mBAAmB;AACnB,qGAAiG;AAEjG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,2BAAmC,SAAQ,4BAAY;IACpD;;;;OAIG;IACgB,WAAW,GAAG,MAAM,CAAC;IACxC,0CAA0C;IACvB,YAAY,GAAG,IAAI,GAAG,EAAiB,CAAC;IAE3D,IAAa,KAAK;QACf,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,KAAK,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,oBAAoB,CAAC,OAAO,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC;IAC1E,CAAC;IAEQ,IAAI;QACV,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;QACvB,CAAC;QAC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,OAAO,MAAM,CAAC;IACjB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-theia-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-theia-frontend-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EAEvB,uBAAuB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"glsp-theia-frontend-module.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-theia-frontend-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,kBAAkB,EAEvB,uBAAuB,EAEzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI/D;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,eAAoE,CAAC;AACxG,MAAM,MAAM,sBAAsB,GAAG,OAAO,sBAAsB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8BAAsB,wCAAyC,SAAQ,uBAAuB;IAC3F,qEAAqE;IACrE,kBAA2B,eAAe,EAAE,mBAAmB,CAAC;IAEhE,oFAAoF;IACpF,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,EAAE,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAE3F,8FAA8F;IAC9F,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,UAAU,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEnF;;;;;;;;;;OAUG;IACH,SAAS,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE/C;;;;;;;;;OASG;IACH,SAAS,CAAC,sBAAsB,IAAI,UAAU,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,sBAAsB,GAAG,SAAS,CAElH;IAED;;;;;;;OAOG;IACM,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAOnD;IAEQ,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAEjE;IAEQ,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAWnE;IAEQ,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAGhE;IAED;;;;;;;;;;;;;;;;OAgBG;IACM,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAGjE;CACH"}
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.AbstractHydraniumGlspTheiaFrontendModule = exports.SkipClientContribution = void 0;
|
|
12
12
|
const theia_integration_1 = require("@eclipse-glsp/theia-integration");
|
|
13
|
-
const browser_1 = require("@hydranium/client-theia/
|
|
13
|
+
const browser_1 = require("@hydranium/client-theia/browser");
|
|
14
14
|
const diagram_widget_1 = require("./diagram-widget");
|
|
15
|
+
const window_session_1 = require("./window-session");
|
|
15
16
|
/**
|
|
16
17
|
* Sentinel returned from {@link AbstractHydraniumGlspTheiaFrontendModule.bindClientContribution}
|
|
17
18
|
* to mean "this module deliberately does not bind a GLSPClientContribution"
|
|
@@ -84,6 +85,8 @@ class AbstractHydraniumGlspTheiaFrontendModule extends theia_integration_1.GLSPT
|
|
|
84
85
|
*/
|
|
85
86
|
initialize(context) {
|
|
86
87
|
super.initialize(context);
|
|
88
|
+
(0, browser_1.bindConnectionReporter)(context.bind, context.isBound);
|
|
89
|
+
(0, window_session_1.bindWindowSessionService)(context.bind, context.isBound);
|
|
87
90
|
if (this.logLevelPreference) {
|
|
88
91
|
(0, browser_1.bindLogLevelPreference)(context.bind, this.logLevelPreference);
|
|
89
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsp-theia-frontend-module.js","sourceRoot":"","sources":["../../src/browser/glsp-theia-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,uEAQyC;AAEzC,
|
|
1
|
+
{"version":3,"file":"glsp-theia-frontend-module.js","sourceRoot":"","sources":["../../src/browser/glsp-theia-frontend-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,uEAQyC;AAEzC,6DAAiG;AAEjG,qDAA8D;AAC9D,qDAA4D;AAE5D;;;;;;GAMG;AACU,QAAA,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;AAGxG;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8CAA+D,SAAQ,2CAAuB;IAU3F;;;;;;;;;;OAUG;IACgB,kBAAkB,CAAU;IAE/C;;;;;;;;;OASG;IACO,sBAAsB;QAC7B,OAAO,SAAS,CAAC;IACpB,CAAC;IAED;;;;;;;OAOG;IACM,UAAU,CAAC,OAAyB;QAC1C,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC1B,IAAA,gCAAsB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACtD,IAAA,yCAAwB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC3B,IAAA,gCAAsB,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;QACjE,CAAC;IACJ,CAAC;IAEQ,wBAAwB,CAAC,OAAyB;QACxD,OAAO,CAAC,IAAI,CAAC,wCAAoB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;IACpE,CAAC;IAEQ,0BAA0B,CAAC,OAAyB;QAC1D,MAAM,YAAY,GAAG,IAAI,CAAC,sBAAsB,EAAE,CAAC;QACnD,IAAI,YAAY,KAAK,QAAA,sBAAsB,EAAE,CAAC;YAC3C,OAAO;QACV,CAAC;QACD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC9B,KAAK,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC;YAC1C,OAAO;QACV,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,0CAAsB,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;IAChE,CAAC;IAEQ,uBAAuB,CAAC,OAAyB;QACvD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;QAC9D,IAAA,0CAAsB,EAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACM,wBAAwB,CAAC,OAAyB;QACxD,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO,CAAC,MAAM,CAAC,qCAAiB,CAAC,CAAC,EAAE,CAAC,2CAA0B,CAAC,CAAC;IACpE,CAAC;CACH"}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* SPDX-License-Identifier: MIT
|
|
8
8
|
********************************************************************************/
|
|
9
9
|
import { type Action, type ElementAndRoutingPoints, type GModelElement, type GRoutableElement, GLSPHiddenBoundsUpdater, RequestBoundsAction } from '@eclipse-glsp/client';
|
|
10
|
-
import { ChannelLogger } from '@hydranium/client-theia/
|
|
11
|
-
import {
|
|
10
|
+
import { ChannelLogger } from '@hydranium/client-theia/browser';
|
|
11
|
+
import { Clock } from '@hydranium/client-theia/common';
|
|
12
12
|
import { type VNode } from 'snabbdom';
|
|
13
13
|
/**
|
|
14
14
|
* Instruments sprotty's hidden-bounds pass and repairs degenerate routes before
|
|
@@ -50,9 +50,7 @@ import { type VNode } from 'snabbdom';
|
|
|
50
50
|
*/
|
|
51
51
|
export declare class HydraniumHiddenBoundsUpdater extends GLSPHiddenBoundsUpdater {
|
|
52
52
|
protected readonly channel: ChannelLogger;
|
|
53
|
-
/**
|
|
54
|
-
* measures — no logic is gated on time, so there is nothing to fake in
|
|
55
|
-
* production. Overridden in tests for a deterministic elapsed value. */
|
|
53
|
+
/** The diagram container's {@link Clock}, or a `SystemClock`; it only measures. */
|
|
56
54
|
protected readonly clock: Clock;
|
|
57
55
|
/**
|
|
58
56
|
* Scope description for the in-flight request, read from the `cause` in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hidden-bounds-updater.d.ts","sourceRoot":"","sources":["../../src/browser/hidden-bounds-updater.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,MAAM,EACX,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,uBAAuB,EAGvB,mBAAmB,EAGrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"hidden-bounds-updater.d.ts","sourceRoot":"","sources":["../../src/browser/hidden-bounds-updater.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EACJ,KAAK,MAAM,EACX,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,uBAAuB,EAGvB,mBAAmB,EAGrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,C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v) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.HydraniumHiddenBoundsUpdater = void 0;
|
|
21
21
|
const client_1 = require("@eclipse-glsp/client");
|
|
22
|
-
const browser_1 = require("@hydranium/client-theia/
|
|
22
|
+
const browser_1 = require("@hydranium/client-theia/browser");
|
|
23
|
+
const common_1 = require("@hydranium/client-theia/common");
|
|
23
24
|
const protocol_1 = require("@hydranium/protocol");
|
|
24
25
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
25
26
|
/** How many scoped element ids the log line names before summarising the rest.
|
|
@@ -66,9 +67,7 @@ const SCOPE_ID_CAP = 3;
|
|
|
66
67
|
*/
|
|
67
68
|
let HydraniumHiddenBoundsUpdater = class HydraniumHiddenBoundsUpdater extends client_1.GLSPHiddenBoundsUpdater {
|
|
68
69
|
channel;
|
|
69
|
-
/**
|
|
70
|
-
* measures — no logic is gated on time, so there is nothing to fake in
|
|
71
|
-
* production. Overridden in tests for a deterministic elapsed value. */
|
|
70
|
+
/** The diagram container's {@link Clock}, or a `SystemClock`; it only measures. */
|
|
72
71
|
clock = new protocol_1.SystemClock();
|
|
73
72
|
/**
|
|
74
73
|
* Scope description for the in-flight request, read from the `cause` in
|
|
@@ -201,6 +200,11 @@ __decorate([
|
|
|
201
200
|
(0, inversify_1.inject)(browser_1.ChannelLogger),
|
|
202
201
|
__metadata("design:type", browser_1.ChannelLogger)
|
|
203
202
|
], HydraniumHiddenBoundsUpdater.prototype, "channel", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
(0, inversify_1.inject)(common_1.Clock),
|
|
205
|
+
(0, inversify_1.optional)(),
|
|
206
|
+
__metadata("design:type", Object)
|
|
207
|
+
], HydraniumHiddenBoundsUpdater.prototype, "clock", void 0);
|
|
204
208
|
exports.HydraniumHiddenBoundsUpdater = HydraniumHiddenBoundsUpdater = __decorate([
|
|
205
209
|
(0, inversify_1.injectable)()
|
|
206
210
|
], HydraniumHiddenBoundsUpdater);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hidden-bounds-updater.js","sourceRoot":"","sources":["../../src/browser/hidden-bounds-updater.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,iDAW8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"hidden-bounds-updater.js","sourceRoot":"","sources":["../../src/browser/hidden-bounds-updater.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,iDAW8B;AAC9B,6DAAgE;AAChE,2DAAuD;AACvD,kDAAkD;AAClD,4DAA4E;AAG5E;;wEAEwE;AACxE,MAAM,YAAY,GAAG,CAAC,CAAC;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,gCAAuB;IAC5B,OAAO,CAAiB;IAElE,mFAAmF;IACrC,KAAK,GAAU,IAAI,sBAAW,EAAE,CAAC;IAE/E;;;;OAIG;IACO,YAAY,CAAU;IAEvB,QAAQ,CAAC,KAAY,EAAE,OAAsB;QACnD,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC/B,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,KAAK,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACO,eAAe,CAAC,OAAyB;QAChD,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAC5C,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC5B,OAAO;QACV,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,mB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AAC,IAAI,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,MAAM,GAAG,YAAY,OAAO,CAAC;QAC3F,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;CACH,CAAA;;AA1I4C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA8B,uBAAa;6DAAC;AAGpB;IAA7C,IAAA,kBAAM,EAAC,cAAK,CAAC;IAAE,IAAA,oBAAQ,GAAE;;2DAAqD;uCAJrE,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA2IxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-diagram-configuration.d.ts","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,wBAAwB,EAA6D,MAAM,iCAAiC,CAAC;AACtI,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,8BAA8B,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,8BACsB,yCAA0C,SAAQ,wBAAwB;IAC7F;;;;;OAKG;IACH,SAAS,CAAC,8BAA8B,UAAQ;
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-diagram-configuration.d.ts","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,wBAAwB,EAA6D,MAAM,iCAAiC,CAAC;AACtI,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,8BAA8B,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,8BACsB,yCAA0C,SAAQ,wBAAwB;IAC7F;;;;;OAKG;IACH,SAAS,CAAC,8BAA8B,UAAQ;IAEhD,UAAmB,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAMjE;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydranium-glsp-diagram-configuration.js","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAGlF,uEAAsI;AACtI,4DAA0E;AAC1E,qFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAA0C,SAAQ,4CAAwB;IAC7F;;;;;OAKG;IACO,8BAA8B,GAAG,IAAI,CAAC;IAE7B,mBAAmB,CAAC,SAAoB;QACxD,IAAA,kDAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC1E,MAAM,oBAAoB,GAAG,IAAI,CAAC,8BAA8B;YAC7D,CAAC,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,GAA0B,EAAE,CAAC,IAAI,0DAAyB,EAAE,CAAC;QAClE,IAAA,6CAAyB,EAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;CACH,CAAA
|
|
1
|
+
{"version":3,"file":"hydranium-glsp-diagram-configuration.js","sourceRoot":"","sources":["../../src/browser/hydranium-glsp-diagram-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAGlF,uEAAsI;AACtI,4DAA0E;AAC1E,qFAA6E;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAe,yCAAyC,GAAxD,MAAe,yCAA0C,SAAQ,4CAAwB;IAC7F;;;;;OAKG;IACO,8BAA8B,GAAG,IAAI,CAAC;IAE7B,mBAAmB,CAAC,SAAoB;QACxD,IAAA,kDAA8B,EAAC,SAAS,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;QAC1E,MAAM,oBAAoB,GAAG,IAAI,CAAC,8BAA8B;YAC7D,CAAC,CAAC,IAAI,CAAC,kBAAkB;YACzB,CAAC,CAAC,GAA0B,EAAE,CAAC,IAAI,0DAAyB,EAAE,CAAC;QAClE,IAAA,6CAAyB,EAAC,SAAS,EAAE,oBAAoB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;CACH,CAAA;;oDAhBqB,yCAAyC;IAD9D,IAAA,sBAAU,GAAE;GACS,yCAAyC,CAgB9D"}
|
package/lib/browser/index.d.ts
CHANGED
|
@@ -11,10 +11,15 @@ export * from './client-contribution';
|
|
|
11
11
|
export * from './diagram-loader';
|
|
12
12
|
export * from './diagram-only-marker-manager';
|
|
13
13
|
export * from './diagram-widget';
|
|
14
|
+
export * from './glsp-client';
|
|
14
15
|
export * from './glsp-client-theia-module';
|
|
15
16
|
export * from './glsp-diagram-manager';
|
|
16
17
|
export * from './glsp-message-service';
|
|
18
|
+
export * from './glsp-saveable';
|
|
17
19
|
export * from './glsp-theia-frontend-module';
|
|
18
20
|
export * from './hidden-bounds-updater';
|
|
19
21
|
export * from './hydranium-glsp-diagram-configuration';
|
|
22
|
+
export * from './status-overlay';
|
|
23
|
+
export * from './window-session';
|
|
24
|
+
export type { GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
|
|
20
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AAKjC,YAAY,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC"}
|
package/lib/browser/index.js
CHANGED
|
@@ -29,10 +29,14 @@ __exportStar(require("./client-contribution"), exports);
|
|
|
29
29
|
__exportStar(require("./diagram-loader"), exports);
|
|
30
30
|
__exportStar(require("./diagram-only-marker-manager"), exports);
|
|
31
31
|
__exportStar(require("./diagram-widget"), exports);
|
|
32
|
+
__exportStar(require("./glsp-client"), exports);
|
|
32
33
|
__exportStar(require("./glsp-client-theia-module"), exports);
|
|
33
34
|
__exportStar(require("./glsp-diagram-manager"), exports);
|
|
34
35
|
__exportStar(require("./glsp-message-service"), exports);
|
|
36
|
+
__exportStar(require("./glsp-saveable"), exports);
|
|
35
37
|
__exportStar(require("./glsp-theia-frontend-module"), exports);
|
|
36
38
|
__exportStar(require("./hidden-bounds-updater"), exports);
|
|
37
39
|
__exportStar(require("./hydranium-glsp-diagram-configuration"), exports);
|
|
40
|
+
__exportStar(require("./status-overlay"), exports);
|
|
41
|
+
__exportStar(require("./window-session"), exports);
|
|
38
42
|
//# sourceMappingURL=index.js.map
|
package/lib/browser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,gEAAgE;AAChE,mFAAmF;AACnF,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,gEAA8C;AAC9C,mDAAiC;AACjC,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,+DAA6C;AAC7C,0DAAwC;AACxC,yEAAuD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;;AAElF,gEAAgE;AAChE,mFAAmF;AACnF,sDAAoC;AACpC,wDAAsC;AACtC,mDAAiC;AACjC,gEAA8C;AAC9C,mDAAiC;AACjC,gDAA8B;AAC9B,6DAA2C;AAC3C,yDAAuC;AACvC,yDAAuC;AACvC,kDAAgC;AAChC,+DAA6C;AAC7C,0DAAwC;AACxC,yEAAuD;AACvD,mDAAiC;AACjC,mDAAiC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { type StatusAction, StatusOverlay } from '@eclipse-glsp/client';
|
|
10
|
+
/**
|
|
11
|
+
* GLSP's status overlay, kept on the page.
|
|
12
|
+
*
|
|
13
|
+
* It inserts its element into the diagram's base div when the diagram starts,
|
|
14
|
+
* and sprotty's first render then replaces that div with its own, so the element
|
|
15
|
+
* is left detached and no status it shows is ever seen. This puts the element
|
|
16
|
+
* back into the current base div before it shows anything.
|
|
17
|
+
*/
|
|
18
|
+
export declare class HydraniumStatusOverlay extends StatusOverlay {
|
|
19
|
+
handle(action: StatusAction): void;
|
|
20
|
+
show(...args: Parameters<StatusOverlay['show']>): void;
|
|
21
|
+
protected reattach(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=status-overlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-overlay.d.ts","sourceRoot":"","sources":["../../src/browser/status-overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,KAAK,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGxE;;;;;;;GAOG;AACH,qBACa,sBAAuB,SAAQ,aAAa;IAC7C,MAAM,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAG1C;IAEQ,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAG9D;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CASzB;CACH"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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.HydraniumStatusOverlay = void 0;
|
|
18
|
+
const client_1 = require("@eclipse-glsp/client");
|
|
19
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
20
|
+
/**
|
|
21
|
+
* GLSP's status overlay, kept on the page.
|
|
22
|
+
*
|
|
23
|
+
* It inserts its element into the diagram's base div when the diagram starts,
|
|
24
|
+
* and sprotty's first render then replaces that div with its own, so the element
|
|
25
|
+
* is left detached and no status it shows is ever seen. This puts the element
|
|
26
|
+
* back into the current base div before it shows anything.
|
|
27
|
+
*/
|
|
28
|
+
let HydraniumStatusOverlay = class HydraniumStatusOverlay extends client_1.StatusOverlay {
|
|
29
|
+
handle(action) {
|
|
30
|
+
this.reattach();
|
|
31
|
+
super.handle(action);
|
|
32
|
+
}
|
|
33
|
+
show(...args) {
|
|
34
|
+
super.show(...args);
|
|
35
|
+
this.reattach();
|
|
36
|
+
}
|
|
37
|
+
reattach() {
|
|
38
|
+
const container = this.containerElement;
|
|
39
|
+
if (!container || container.isConnected) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const parent = this.getParentContainer();
|
|
43
|
+
if (parent) {
|
|
44
|
+
this.insertContainerIntoParent(container, parent);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.HydraniumStatusOverlay = HydraniumStatusOverlay;
|
|
49
|
+
exports.HydraniumStatusOverlay = HydraniumStatusOverlay = __decorate([
|
|
50
|
+
(0, inversify_1.injectable)()
|
|
51
|
+
], HydraniumStatusOverlay);
|
|
52
|
+
//# sourceMappingURL=status-overlay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-overlay.js","sourceRoot":"","sources":["../../src/browser/status-overlay.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAwE;AACxE,4DAA0D;AAE1D;;;;;;;GAOG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,sBAAa;IAC7C,MAAM,CAAC,MAAoB;QACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAEQ,IAAI,CAAC,GAAG,IAAuC;QACrD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,QAAQ,EAAE,CAAC;IACnB,CAAC;IAES,QAAQ;QACf,MAAM,SAAS,GAAG,IAAI,CAAC,gBAA2C,CAAC;QACnE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;YACvC,OAAO;QACV,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACzC,IAAI,MAAM,EAAE,CAAC;YACV,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACrD,CAAC;IACJ,CAAC;CACH,CAAA;;iCArBY,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAqBlC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
|
|
10
|
+
import { type interfaces } from '@theia/core/shared/inversify';
|
|
11
|
+
/** The `sessionStorage` key of the window's {@link WindowSession}. */
|
|
12
|
+
export declare const WINDOW_SESSION_KEY = "hydranium.glsp.windowSession";
|
|
13
|
+
/** Holds the id of the window session the last page in the tab left, for the next page to take up. */
|
|
14
|
+
export declare const RELEASED_WINDOW_SESSION_KEY = "hydranium.glsp.releasedWindowSession";
|
|
15
|
+
/** The window's part of every diagram client id it opens, and the token its diagrams resume with. */
|
|
16
|
+
export interface WindowSession {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly resumeToken: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function isWindowSession(value: unknown): value is WindowSession;
|
|
21
|
+
export declare const WindowSessionService: unique symbol;
|
|
22
|
+
/**
|
|
23
|
+
* The page's window session: the one the last page in this tab left, so a
|
|
24
|
+
* reload resumes its diagrams, and a new one otherwise.
|
|
25
|
+
*
|
|
26
|
+
* A reload only has a session to resume on a server that outlives the page; a
|
|
27
|
+
* server started per frontend, as a Theia plugin host's is, is new after one.
|
|
28
|
+
*/
|
|
29
|
+
export interface WindowSessionService {
|
|
30
|
+
current(): WindowSession;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Keeps the window session in `sessionStorage` and hands it on only as the page
|
|
34
|
+
* leaves. A duplicated tab copies `sessionStorage` while the original page is
|
|
35
|
+
* still live, so the copy finds no released session and draws its own; taking
|
|
36
|
+
* the original's would end the original's diagram sessions. Where
|
|
37
|
+
* `sessionStorage` is unavailable the session lasts for the page, and a reload
|
|
38
|
+
* resumes nothing.
|
|
39
|
+
*
|
|
40
|
+
* Claimed as the frontend starts, not with the first diagram: until then the
|
|
41
|
+
* released mark stays, and a tab duplicated meanwhile would take it too. A page
|
|
42
|
+
* restored from the back-forward cache takes the mark back, since Theia
|
|
43
|
+
* before 1.75 leaves it live without a reload.
|
|
44
|
+
*/
|
|
45
|
+
export declare class DefaultWindowSessionService implements WindowSessionService, FrontendApplicationContribution {
|
|
46
|
+
protected session?: WindowSession;
|
|
47
|
+
initialize(): void;
|
|
48
|
+
current(): WindowSession;
|
|
49
|
+
protected claim(): WindowSession;
|
|
50
|
+
protected parse(text: string | null): WindowSession | undefined;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Bind {@link WindowSessionService} once per container, and claim it as the
|
|
54
|
+
* frontend starts. An adopter rebinds {@link WindowSessionService}.
|
|
55
|
+
*/
|
|
56
|
+
export declare function bindWindowSessionService(bind: interfaces.Bind, isBound: interfaces.IsBound): void;
|
|
57
|
+
//# sourceMappingURL=window-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-session.d.ts","sourceRoot":"","sources":["../../src/browser/window-session.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAIlF,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE3E,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,iCAAiC,CAAC;AACjE,sGAAsG;AACtG,eAAO,MAAM,2BAA2B,yCAAyC,CAAC;AAElF,qGAAqG;AACrG,MAAM,WAAW,aAAa;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAOtE;AAED,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AAEnE;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IAClC,OAAO,IAAI,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,qBACa,2BAA4B,YAAW,oBAAoB,EAAE,+BAA+B;IACtG,SAAS,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;IAElC,UAAU,IAAI,IAAI,CAEjB;IAED,OAAO,IAAI,aAAa,CAGvB;IAED,SAAS,CAAC,KAAK,IAAI,aAAa,CAkB/B;IAED,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,SAAS,CAO9D;CACH;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,GAAG,IAAI,CAMjG"}
|
|
@@ -0,0 +1,102 @@
|
|
|
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.DefaultWindowSessionService = exports.WindowSessionService = exports.RELEASED_WINDOW_SESSION_KEY = exports.WINDOW_SESSION_KEY = void 0;
|
|
18
|
+
exports.isWindowSession = isWindowSession;
|
|
19
|
+
exports.bindWindowSessionService = bindWindowSessionService;
|
|
20
|
+
const protocol_1 = require("@hydranium/protocol");
|
|
21
|
+
// Not the `@theia/core/lib/browser` barrel, which touches DOM globals at load.
|
|
22
|
+
const frontend_application_contribution_1 = require("@theia/core/lib/browser/frontend-application-contribution");
|
|
23
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
24
|
+
/** The `sessionStorage` key of the window's {@link WindowSession}. */
|
|
25
|
+
exports.WINDOW_SESSION_KEY = 'hydranium.glsp.windowSession';
|
|
26
|
+
/** Holds the id of the window session the last page in the tab left, for the next page to take up. */
|
|
27
|
+
exports.RELEASED_WINDOW_SESSION_KEY = 'hydranium.glsp.releasedWindowSession';
|
|
28
|
+
function isWindowSession(value) {
|
|
29
|
+
return (typeof value === 'object' &&
|
|
30
|
+
value !== null &&
|
|
31
|
+
typeof value.id === 'string' &&
|
|
32
|
+
typeof value.resumeToken === 'string');
|
|
33
|
+
}
|
|
34
|
+
exports.WindowSessionService = Symbol('WindowSessionService');
|
|
35
|
+
/**
|
|
36
|
+
* Keeps the window session in `sessionStorage` and hands it on only as the page
|
|
37
|
+
* leaves. A duplicated tab copies `sessionStorage` while the original page is
|
|
38
|
+
* still live, so the copy finds no released session and draws its own; taking
|
|
39
|
+
* the original's would end the original's diagram sessions. Where
|
|
40
|
+
* `sessionStorage` is unavailable the session lasts for the page, and a reload
|
|
41
|
+
* resumes nothing.
|
|
42
|
+
*
|
|
43
|
+
* Claimed as the frontend starts, not with the first diagram: until then the
|
|
44
|
+
* released mark stays, and a tab duplicated meanwhile would take it too. A page
|
|
45
|
+
* restored from the back-forward cache takes the mark back, since Theia
|
|
46
|
+
* before 1.75 leaves it live without a reload.
|
|
47
|
+
*/
|
|
48
|
+
let DefaultWindowSessionService = class DefaultWindowSessionService {
|
|
49
|
+
session;
|
|
50
|
+
initialize() {
|
|
51
|
+
this.current();
|
|
52
|
+
}
|
|
53
|
+
current() {
|
|
54
|
+
this.session ??= this.claim();
|
|
55
|
+
return this.session;
|
|
56
|
+
}
|
|
57
|
+
claim() {
|
|
58
|
+
const created = { id: (0, protocol_1.randomUuid)(), resumeToken: (0, protocol_1.randomUuid)() };
|
|
59
|
+
try {
|
|
60
|
+
const storage = globalThis.sessionStorage;
|
|
61
|
+
const stored = this.parse(storage.getItem(exports.WINDOW_SESSION_KEY));
|
|
62
|
+
const session = stored && storage.getItem(exports.RELEASED_WINDOW_SESSION_KEY) === stored.id ? stored : created;
|
|
63
|
+
storage.setItem(exports.WINDOW_SESSION_KEY, JSON.stringify(session));
|
|
64
|
+
storage.removeItem(exports.RELEASED_WINDOW_SESSION_KEY);
|
|
65
|
+
globalThis.addEventListener?.('pagehide', () => storage.setItem(exports.RELEASED_WINDOW_SESSION_KEY, session.id));
|
|
66
|
+
globalThis.addEventListener?.('pageshow', event => {
|
|
67
|
+
if (event.persisted) {
|
|
68
|
+
storage.removeItem(exports.RELEASED_WINDOW_SESSION_KEY);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return session;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return created;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
parse(text) {
|
|
78
|
+
try {
|
|
79
|
+
const value = text ? JSON.parse(text) : undefined;
|
|
80
|
+
return isWindowSession(value) ? value : undefined;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
exports.DefaultWindowSessionService = DefaultWindowSessionService;
|
|
88
|
+
exports.DefaultWindowSessionService = DefaultWindowSessionService = __decorate([
|
|
89
|
+
(0, inversify_1.injectable)()
|
|
90
|
+
], DefaultWindowSessionService);
|
|
91
|
+
/**
|
|
92
|
+
* Bind {@link WindowSessionService} once per container, and claim it as the
|
|
93
|
+
* frontend starts. An adopter rebinds {@link WindowSessionService}.
|
|
94
|
+
*/
|
|
95
|
+
function bindWindowSessionService(bind, isBound) {
|
|
96
|
+
if (!isBound(exports.WindowSessionService)) {
|
|
97
|
+
bind(DefaultWindowSessionService).toSelf().inSingletonScope();
|
|
98
|
+
bind(exports.WindowSessionService).toService(DefaultWindowSessionService);
|
|
99
|
+
bind(frontend_application_contribution_1.FrontendApplicationContribution).toService(exports.WindowSessionService);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=window-session.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"window-session.js","sourceRoot":"","sources":["../../src/browser/window-session.ts"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