@hydranium/glsp-client-theia 1.0.0-next.28 → 1.0.0-next.280

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.
Files changed (83) hide show
  1. package/README.md +57 -98
  2. package/lib/browser/action-dispatcher.d.ts +11 -6
  3. package/lib/browser/action-dispatcher.d.ts.map +1 -1
  4. package/lib/browser/action-dispatcher.js +24 -5
  5. package/lib/browser/action-dispatcher.js.map +1 -1
  6. package/lib/browser/client-contribution.d.ts +87 -25
  7. package/lib/browser/client-contribution.d.ts.map +1 -1
  8. package/lib/browser/client-contribution.js +233 -53
  9. package/lib/browser/client-contribution.js.map +1 -1
  10. package/lib/browser/diagram-loader.d.ts +16 -7
  11. package/lib/browser/diagram-loader.d.ts.map +1 -1
  12. package/lib/browser/diagram-loader.js +19 -11
  13. package/lib/browser/diagram-loader.js.map +1 -1
  14. package/lib/browser/diagram-only-marker-manager.d.ts.map +1 -1
  15. package/lib/browser/diagram-only-marker-manager.js.map +1 -1
  16. package/lib/browser/diagram-widget.d.ts +42 -24
  17. package/lib/browser/diagram-widget.d.ts.map +1 -1
  18. package/lib/browser/diagram-widget.js +74 -24
  19. package/lib/browser/diagram-widget.js.map +1 -1
  20. package/lib/browser/glsp-client-theia-module.d.ts +1 -1
  21. package/lib/browser/glsp-client-theia-module.d.ts.map +1 -1
  22. package/lib/browser/glsp-client-theia-module.js +3 -1
  23. package/lib/browser/glsp-client-theia-module.js.map +1 -1
  24. package/lib/browser/glsp-client.d.ts +17 -0
  25. package/lib/browser/glsp-client.d.ts.map +1 -0
  26. package/lib/browser/glsp-client.js +23 -0
  27. package/lib/browser/glsp-client.js.map +1 -0
  28. package/lib/browser/glsp-diagram-manager.d.ts +61 -0
  29. package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
  30. package/lib/browser/glsp-diagram-manager.js +126 -0
  31. package/lib/browser/glsp-diagram-manager.js.map +1 -1
  32. package/lib/browser/glsp-message-service.d.ts.map +1 -1
  33. package/lib/browser/glsp-message-service.js.map +1 -1
  34. package/lib/browser/glsp-saveable.d.ts +66 -0
  35. package/lib/browser/glsp-saveable.d.ts.map +1 -0
  36. package/lib/browser/glsp-saveable.js +109 -0
  37. package/lib/browser/glsp-saveable.js.map +1 -0
  38. package/lib/browser/glsp-theia-frontend-module.d.ts.map +1 -1
  39. package/lib/browser/glsp-theia-frontend-module.js +4 -1
  40. package/lib/browser/glsp-theia-frontend-module.js.map +1 -1
  41. package/lib/browser/hidden-bounds-updater.d.ts +3 -5
  42. package/lib/browser/hidden-bounds-updater.d.ts.map +1 -1
  43. package/lib/browser/hidden-bounds-updater.js +8 -4
  44. package/lib/browser/hidden-bounds-updater.js.map +1 -1
  45. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts +3 -1
  46. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts.map +1 -1
  47. package/lib/browser/hydranium-glsp-diagram-configuration.js +3 -1
  48. package/lib/browser/hydranium-glsp-diagram-configuration.js.map +1 -1
  49. package/lib/browser/index.d.ts +5 -0
  50. package/lib/browser/index.d.ts.map +1 -1
  51. package/lib/browser/index.js +4 -0
  52. package/lib/browser/index.js.map +1 -1
  53. package/lib/browser/status-overlay.d.ts +23 -0
  54. package/lib/browser/status-overlay.d.ts.map +1 -0
  55. package/lib/browser/status-overlay.js +52 -0
  56. package/lib/browser/status-overlay.js.map +1 -0
  57. package/lib/browser/window-session.d.ts +57 -0
  58. package/lib/browser/window-session.d.ts.map +1 -0
  59. package/lib/browser/window-session.js +102 -0
  60. package/lib/browser/window-session.js.map +1 -0
  61. package/lib/node/connection-container-module.js.map +1 -1
  62. package/lib/node/glsp-server-connection-handler.d.ts +11 -20
  63. package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
  64. package/lib/node/glsp-server-connection-handler.js +12 -15
  65. package/lib/node/glsp-server-connection-handler.js.map +1 -1
  66. package/lib/testing/bind-recorder.js.map +1 -1
  67. package/package.json +34 -41
  68. package/src/browser/action-dispatcher.ts +26 -10
  69. package/src/browser/client-contribution.ts +254 -55
  70. package/src/browser/diagram-loader.ts +21 -14
  71. package/src/browser/diagram-widget.ts +79 -27
  72. package/src/browser/glsp-client-theia-module.ts +4 -2
  73. package/src/browser/glsp-client.ts +20 -0
  74. package/src/browser/glsp-diagram-manager.ts +140 -2
  75. package/src/browser/glsp-saveable.ts +110 -0
  76. package/src/browser/glsp-theia-frontend-module.ts +4 -1
  77. package/src/browser/hidden-bounds-updater.ts +6 -7
  78. package/src/browser/hydranium-glsp-diagram-configuration.ts +3 -1
  79. package/src/browser/index.ts +9 -0
  80. package/src/browser/status-overlay.ts +43 -0
  81. package/src/browser/window-session.ts +114 -0
  82. package/src/node/glsp-server-connection-handler.ts +12 -24
  83. package/style/diagram-loading.css +2 -5
@@ -20,89 +20,269 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
20
20
  return function (target, key) { decorator(target, key, paramIndex); }
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.HydraniumGlspClientContribution = void 0;
23
+ exports.HydraniumGlspClientContribution = exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS = void 0;
24
+ const client_1 = require("@eclipse-glsp/client");
24
25
  const theia_integration_1 = require("@eclipse-glsp/theia-integration");
26
+ const common_1 = require("@eclipse-glsp/theia-integration/lib/common");
27
+ const browser_1 = require("@hydranium/client-theia/browser");
28
+ const common_2 = require("@hydranium/client-theia/common");
29
+ const protocol_1 = require("@hydranium/protocol");
30
+ const core_1 = require("@theia/core");
25
31
  const promise_util_1 = require("@theia/core/lib/common/promise-util");
26
32
  const inversify_1 = require("@theia/core/shared/inversify");
27
- const output_channel_1 = require("@theia/output/lib/browser/output-channel");
28
- const browser_1 = require("@theia/workspace/lib/browser");
33
+ const browser_2 = require("@theia/workspace/lib/browser");
34
+ // GLSP's channel connection uses the top-level `vscode-jsonrpc`'s root entry, which
35
+ // installs no runtime layer; without the browser entry, no message is received.
36
+ require("vscode-jsonrpc/browser");
37
+ const glsp_client_1 = require("./glsp-client");
38
+ exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS = 30_000;
29
39
  /**
30
40
  * Theia GLSP client contribution for adopters whose GLSP server runs in a
31
41
  * sideloaded VS Code extension process (or any other deferred-start setup).
32
- * The behaviours adopters reliably need are lifted:
33
42
  *
34
- * 1. `waitForBackendConnected`: tail the OutputChannel for a server-printed
35
- * ready marker. While a socket connection might open earlier, the GLSP
36
- * server typically does internal initialisation before it can accept
37
- * client connections — we wait for it to say so.
38
- * 2. `start`: defer until a workspace is opened. If Theia starts without a
39
- * workspace, this prevents the frontend-backend connection (and its
40
- * "connecting" progress spinner) from firing prematurely.
43
+ * The client starts once a workspace is open and sends its first request at
44
+ * once; the backend handler holds it until its socket to the server is up. A
45
+ * start that fails, and a connection lost after one succeeded, start a fresh
46
+ * client after a backoff, for as long as the contribution lives. Each start is
47
+ * reported through the {@link ConnectionReporter}, and announced through
48
+ * {@link onDidStartClient} and {@link onDidLoseClient}.
41
49
  *
42
50
  * A `GLSPClient` override filtering inbound messages by clientId is
43
51
  * deliberately NOT provided: upstream's `BaseJsonrpcGLSPClient.onActionMessage`
44
- * already filters by clientId, so the `TheiaJsonrpcGLSPClient` returned by
45
- * `BaseGLSPClientContribution.createGLSPClient` is correct as-is.
52
+ * already filters by clientId.
46
53
  */
47
54
  let HydraniumGlspClientContribution = class HydraniumGlspClientContribution extends theia_integration_1.BaseGLSPClientContribution {
48
- outputChannelManager;
49
55
  workspaceService;
56
+ connectionReporter;
57
+ logger;
58
+ /** Times the restart escalation reset: the container's {@link Clock}, or a `SystemClock`. */
59
+ clock = new protocol_1.SystemClock();
50
60
  id;
51
- channelName;
52
- readyMarker;
61
+ /** Delay before the restart following each consecutive failed start or lost
62
+ * client; the last repeats. */
63
+ restartDelaysMs = [1_000, 2_000, 4_000, 8_000];
64
+ /** How long a client must stay up before the restart delays start over, so
65
+ * a server that fails right after starting is not restarted at once. */
66
+ restartEscalationResetMs = 30_000;
67
+ consecutiveFailures = 0;
68
+ restartTimer;
69
+ /** Running since the current client started; cleared once a restart has taken it into account. */
70
+ sinceStart;
71
+ /** Clients started so far, which numbers them in the log: they share {@link id}. */
72
+ startedClients = 0;
73
+ /** The attempt waiting for a channel, if any. */
74
+ channelRequest;
75
+ disposed = false;
76
+ clientStartedEmitter = new core_1.Emitter();
77
+ clientLostEmitter = new core_1.Emitter();
78
+ /** Fires with each client once it has started and its server has answered. */
79
+ onDidStartClient = this.clientStartedEmitter.event;
80
+ /** Fires when the started client stops; {@link glspClient} already waits
81
+ * for its replacement then. */
82
+ onDidLoseClient = this.clientLostEmitter.event;
53
83
  constructor(options) {
54
84
  super();
55
85
  this.id = options.languageContributionId;
56
- this.channelName = options.channelName;
57
- this.readyMarker = options.readyMarker;
58
- }
59
- /** Wait for the server to print its ready marker into the OutputChannel.
60
- * Resolves immediately if the marker is already present (server started
61
- * before the client contribution mounted). */
62
- async waitForBackendConnected() {
63
- const channel = this.outputChannelManager.getChannel(this.channelName);
64
- const channelText = channel.resource?.textModel?.getValue() ?? '';
65
- if (channelText.includes(this.readyMarker)) {
86
+ this.glspClientStartupTimeout = options.startupTimeoutMs ?? exports.DEFAULT_GLSP_CLIENT_STARTUP_TIMEOUT_MS;
87
+ }
88
+ /** The client every diagram load awaits; after a failed start, a fresh one. */
89
+ get glspClient() {
90
+ return this.glspClientDeferred.state === 'rejected' ? this.restart() : this.glspClientDeferred.promise;
91
+ }
92
+ /** Start a fresh client over a fresh channel at once, if the last start failed. */
93
+ restart() {
94
+ if (!this.disposed && this.glspClientDeferred.state === 'rejected') {
95
+ this.replaceClient();
96
+ void this.activateClient();
97
+ }
98
+ return this.glspClientDeferred.promise;
99
+ }
100
+ /** Point {@link glspClient} at a fresh client still to start, and tear down
101
+ * the old one's channel. */
102
+ replaceClient() {
103
+ clearTimeout(this.restartTimer);
104
+ // Replaced before the old channel goes, so the old client stopping is
105
+ // not taken for a loss of the new one.
106
+ this.glspClientDeferred = new promise_util_1.Deferred();
107
+ this.toDispose.dispose();
108
+ // Upstream refuses to open a channel while the collection is disposed.
109
+ this.toDispose.push(core_1.Disposable.NULL);
110
+ }
111
+ /** Settles the promise current when it began, so a start a restart overtook
112
+ * cannot settle its successor. */
113
+ async activateClient() {
114
+ const pending = this.glspClientDeferred;
115
+ await this.workspaceOpened();
116
+ if (this.disposed) {
66
117
  return;
67
118
  }
68
- const deferred = new promise_util_1.Deferred();
69
- const channelListener = channel.onContentChange(() => {
70
- const text = channel.resource?.textModel?.getValue() ?? '';
71
- if (text.includes(this.readyMarker)) {
72
- channelListener.dispose();
73
- deferred.resolve();
119
+ const attempt = this.connectionReporter.connecting(this.connectionTarget);
120
+ const timeout = this.glspClientStartupTimeout > 0
121
+ ? setTimeout(() => pending.reject(new Error(this.startupTimeoutMessage())), this.glspClientStartupTimeout)
122
+ : undefined;
123
+ pending.promise.then(client => {
124
+ clearTimeout(timeout);
125
+ attempt.connected();
126
+ this.sinceStart = this.clock.stopwatch();
127
+ this.logger.info(`[${this.id}] Diagram client ${++this.startedClients} started.`);
128
+ this.clientStartedEmitter.fire(client);
129
+ this.restartOnLoss(client);
130
+ }, (error) => {
131
+ clearTimeout(timeout);
132
+ if (this.disposed) {
133
+ attempt.cancelled();
134
+ return;
135
+ }
136
+ attempt.failed((0, protocol_1.describeError)(error), () => void this.restart());
137
+ this.scheduleRestart(() => {
138
+ if (this.glspClientDeferred === pending) {
139
+ void this.restart();
140
+ }
141
+ });
142
+ });
143
+ try {
144
+ const connection = await this.createConnection();
145
+ // Ahead of the client's own listener, whose teardown rejects with a
146
+ // transport message instead.
147
+ connection.onClose(() => pending.reject(new Error(this.unreachableMessage())));
148
+ // Upstream builds the connection from the `vscode-jsonrpc` hoisted
149
+ // beside it and the client's typed messages from its protocol's copy;
150
+ // a type sent over another copy's connection throws.
151
+ const client = await this.createGLSPClient((0, protocol_1.sendByMethodName)(connection));
152
+ connection.onDispose(() => client.stop());
153
+ await this.start(client);
154
+ pending.resolve(client);
155
+ }
156
+ catch (error) {
157
+ pending.reject(error);
158
+ }
159
+ }
160
+ /** Run `restart` after the delay for the failures so far, and return that delay. */
161
+ scheduleRestart(restart) {
162
+ if (this.sinceStart !== undefined && this.sinceStart.elapsedMs >= this.restartEscalationResetMs) {
163
+ this.consecutiveFailures = 0;
164
+ }
165
+ this.sinceStart = undefined;
166
+ const delay = this.restartDelaysMs[Math.min(this.consecutiveFailures, this.restartDelaysMs.length - 1)];
167
+ this.consecutiveFailures++;
168
+ clearTimeout(this.restartTimer);
169
+ this.restartTimer = setTimeout(restart, delay);
170
+ return delay;
171
+ }
172
+ /** Once `client` stops, replace it and start its replacement after the
173
+ * restart delay, unless a dispose stopped it. */
174
+ restartOnLoss(client) {
175
+ const listener = client.onCurrentStateChanged(state => {
176
+ if (state !== client_1.ClientState.ServerError && state !== client_1.ClientState.Stopped) {
177
+ return;
178
+ }
179
+ listener.dispose();
180
+ if (!this.disposed) {
181
+ this.replaceClient();
182
+ this.clientLostEmitter.fire();
183
+ const delay = this.scheduleRestart(() => void this.activateClient());
184
+ // Upstream's client has just logged that it will not be restarted, which holds for it alone.
185
+ this.logger.info(`[${this.id}] Diagram client ${this.startedClients} lost; starting a fresh one in ${delay} ms.`);
74
186
  }
75
187
  });
76
- return deferred.promise;
77
188
  }
189
+ /** Start the client and initialize its server, rejecting on failure; the
190
+ * caller settles {@link glspClient}. */
78
191
  async start(glspClient) {
79
- // Defer starting the GLSP client until a workspace is opened. If Theia
80
- // starts without a workspace, this prevents creating the frontend-
81
- // backend connection (and showing the "connecting" progress) prematurely.
192
+ await glspClient.start();
193
+ await this.initialize(glspClient);
194
+ }
195
+ /** Without upstream's own error notification, which would duplicate the reporter's. */
196
+ async initialize(glspClient) {
197
+ return glspClient.initializeServer(await this.createInitializeParameters());
198
+ }
199
+ /** Upstream's base client, without the notifications of its Theia subclass,
200
+ * which would duplicate the reporter's. */
201
+ async createGLSPClient(connectionProvider) {
202
+ return new glsp_client_1.HydraniumGlspClient({ id: this.id, connectionProvider });
203
+ }
204
+ /**
205
+ * Whichever channel arrives goes to the attempt waiting now, and one that
206
+ * arrives with none waiting is closed. Theia holds each open until its
207
+ * websocket is back, and after an outage every held open past the first
208
+ * throws "already open" without reaching its handler, so the first to arrive
209
+ * has to serve the latest attempt. Without Theia's replay, which would be a
210
+ * second opener of the same path.
211
+ */
212
+ async createChannelConnection() {
213
+ this.channelRequest?.reject(new Error('A newer start took over the channel request.'));
214
+ const request = new promise_util_1.Deferred();
215
+ this.channelRequest = request;
216
+ this.connectionProvider.listen(common_1.GLSPContribution.getPath(this), (_path, channel) => {
217
+ const waiting = this.channelRequest;
218
+ this.channelRequest = undefined;
219
+ if (waiting && !this.disposed) {
220
+ waiting.resolve(channel);
221
+ }
222
+ else {
223
+ channel.close();
224
+ }
225
+ }, false);
226
+ const channel = await request.promise;
227
+ const connection = (0, common_1.createChannelConnection)(channel, this.logger);
228
+ this.toDispose.push(core_1.Disposable.create(() => this.disposeChannel(connection, channel)));
229
+ return connection;
230
+ }
231
+ /** Also closes the channel: upstream leaves a Theia channel open, and the
232
+ * next one on the same path then cannot open. */
233
+ async disposeChannel(connection, channel) {
234
+ await super.disposeChannel(connection, channel);
235
+ channel.close();
236
+ }
237
+ /** Also fails a start in flight, so nothing reports it after this. */
238
+ dispose() {
239
+ this.disposed = true;
240
+ clearTimeout(this.restartTimer);
241
+ this.glspClientDeferred.promise.catch(() => undefined);
242
+ this.glspClientDeferred.reject(new Error('The diagram client was disposed.'));
243
+ this.clientStartedEmitter.dispose();
244
+ this.clientLostEmitter.dispose();
245
+ super.dispose();
246
+ }
247
+ async workspaceOpened() {
82
248
  const roots = this.workspaceService.tryGetRoots();
83
- if (!roots || roots.length === 0) {
84
- await new Promise(resolve => {
85
- const disposable = this.workspaceService.onWorkspaceChanged(changedRoots => {
86
- if (changedRoots && changedRoots.length > 0) {
87
- disposable.dispose();
88
- resolve();
89
- }
90
- });
91
- });
249
+ if (roots.length === 0) {
250
+ await core_1.Event.toPromise(core_1.Event.filter(this.workspaceService.onWorkspaceChanged, changedRoots => changedRoots.length > 0));
92
251
  }
93
- await this.waitForBackendConnected();
94
- return super.start(glspClient);
252
+ }
253
+ get connectionTarget() {
254
+ return (this.cachedConnectionTarget ??= {
255
+ connectingMessage: core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-connecting', 'Connecting to the diagram server…'),
256
+ connectedMessage: core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-connected', 'Connected to the diagram server.')
257
+ });
258
+ }
259
+ /** One object per contribution: the reporter keys what it has shown on it. */
260
+ cachedConnectionTarget;
261
+ unreachableMessage() {
262
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-unreachable', 'Could not connect to the diagram server.');
263
+ }
264
+ startupTimeoutMessage() {
265
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-server-timeout', 'The diagram server did not answer within {0} seconds.', String(Math.round(this.glspClientStartupTimeout / 1000)));
95
266
  }
96
267
  };
97
268
  exports.HydraniumGlspClientContribution = HydraniumGlspClientContribution;
98
269
  __decorate([
99
- (0, inversify_1.inject)(output_channel_1.OutputChannelManager),
100
- __metadata("design:type", output_channel_1.OutputChannelManager)
101
- ], HydraniumGlspClientContribution.prototype, "outputChannelManager", void 0);
102
- __decorate([
103
- (0, inversify_1.inject)(browser_1.WorkspaceService),
104
- __metadata("design:type", browser_1.WorkspaceService)
270
+ (0, inversify_1.inject)(browser_2.WorkspaceService),
271
+ __metadata("design:type", browser_2.WorkspaceService)
105
272
  ], HydraniumGlspClientContribution.prototype, "workspaceService", void 0);
273
+ __decorate([
274
+ (0, inversify_1.inject)(browser_1.ConnectionReporter),
275
+ __metadata("design:type", Object)
276
+ ], HydraniumGlspClientContribution.prototype, "connectionReporter", void 0);
277
+ __decorate([
278
+ (0, inversify_1.inject)(browser_1.ChannelLogger),
279
+ __metadata("design:type", browser_1.ChannelLogger)
280
+ ], HydraniumGlspClientContribution.prototype, "logger", void 0);
281
+ __decorate([
282
+ (0, inversify_1.inject)(common_2.Clock),
283
+ (0, inversify_1.optional)(),
284
+ __metadata("design:type", Object)
285
+ ], HydraniumGlspClientContribution.prototype, "clock", void 0);
106
286
  exports.HydraniumGlspClientContribution = HydraniumGlspClientContribution = __decorate([
107
287
  (0, inversify_1.injectable)(),
108
288
  __param(0, (0, inversify_1.unmanaged)()),
@@ -1 +1 @@
1
- {"version":3,"file":"client-contribution.js","sourceRoot":"","sources":["../../src/browser/client-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAGlF,uEAA6E;AAC7E,sEAA+D;AAC/D,4DAA6E;AAC7E,6EAAgF;AAChF,0DAAgE;AAYhE;;;;;;;;;;;;;;;;;GAiBG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,8CAA0B;IACpC,oBAAoB,CAAwB;IACvC,gBAAgB,CAAoB;IAExE,EAAE,CAAS;IACD,WAAW,CAAS;IACpB,WAAW,CAAS;IAEvC,YAAyB,OAAkC;QACxD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,sBAAsB,CAAC;QACzC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAC1C,CAAC;IAED;;mDAE+C;IACrC,KAAK,CAAC,uBAAuB;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACvE,MAAM,WAAW,GACb,OAA4E,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACvH,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC1C,OAAO;QACV,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,uBAAQ,EAAQ,CAAC;QACtC,MAAM,eAAe,GAAG,OA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AAU,GAAE;IASG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GARd,+BAA+B,CAsD3C"}
1
+ {"version":3,"file":"client-contribution.js","sourceRoot":"","sources":["../../src/browser/client-contribution.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;;;;AAElF,iDAA2F;AAC3F,uEAA6E;AAC7E,uEAAuG;AACvG,6DAA2G;AAC3G,2DAAuD;AACvD,kDAAmG;AACnG,sCAA4E;AAC5E,sEAA+D;AAC/D,4DAAuF;AACvF,0DAAgE;AAChE,oFAAoF;AACpF,gFAAgF;AAChF,kCAAgC;AAChC,+CAAoD;AAEvC,QAAA,sCAAsC,GAAG,MAAM,CAAC;AAU7D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,+BAA+B,GAArC,MAAM,+BAAgC,SAAQ,8CAA0B;IAC/B,gBAAgB,CAAoB;IAClC,kBAAkB,CAAsB;IAC7C,MAAM,CAAiB;IACjE,6FAA6F;IAC/C,KAAK,GAAU,IAAI,sBAAW,EAAE,CAAC;IAEtE,EAAE,CAAS;IAEpB;oCACgC;IACb,eAAe,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACrF;6EACyE;IACtD,wBAAwB,GAAW,MAAM,CAAC;IACnD,mBAAmB,GAAG,CAAC,CAAC;IACxB,YAAY,CAAiC;IACvD,kGAAkG;IACxF,UAAU,CAAa;IACjC,oFAAoF;IAC1E,cAAc,GAAG,CAAC,CAAC;IAC7B,iDAAiD;IACvC,cAAc,CAAqB;IACnC,QAAQ,GAAG,KAAK,CAAC;IACR,oBAAoB,GAAG,IAAI,cAAO,EAAc,CAAC;IACjD,iBAAiB,GAAG,IAAI,cAAO,EAAQ,CAAC;IAE3D,8EAA8E;IACrE,gBAAgB,GAAsB,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC;IAC/E;oCACgC;IACvB,eAAe,GAAgB,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAA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,CAAC,KAAK,CAAC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC,CAAC,CAC1D,CAAC;IACL,CAAC;CACH,CAAA;;AAvP+C;IAA5C,IAAA,kBAAM,EAAC,0BAAgB,CAAC;8BAAuC,0BAAgB;yEAAC;AAClC;IAA9C,IAAA,kBAAM,EAAC,4BAAkB,CAAC;;2EAA4D;AAC7C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA6B,uBAAa;+DAAC;AAEnB;IAA7C,IAAA,kBAAM,EAAC,cAAK,CAAC;IAAE,IAAA,oBAAQ,GAAE;;8DAAqD;0CALrE,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;IAkCG,WAAA,IAAA,qBAAS,GAAE,CAAA;;GAjCd,+BAA+B,CAwP3C"}
@@ -7,7 +7,7 @@
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
9
  import { DiagramLoader, type DiagramLoadingOptions } from '@eclipse-glsp/client';
10
- import { ChannelLogger } from '@hydranium/client-theia/lib/browser';
10
+ import { ChannelLogger } from '@hydranium/client-theia/browser';
11
11
  import { Deferred } from '@hydranium/protocol';
12
12
  /**
13
13
  * How a diagram load ended. A discriminated union rather than a boolean or a
@@ -26,8 +26,7 @@ export interface DiagramLoadFailure {
26
26
  readonly error: unknown;
27
27
  /**
28
28
  * Whether the `severity: 'ERROR'` {@link StatusAction} reached the action
29
- * dispatcher — i.e. whether GLSP's `StatusOverlay` is now displaying this
30
- * failure.
29
+ * dispatcher. It says nothing about whether a status overlay shows it.
31
30
  *
32
31
  * `false` means the report itself failed, which happens when the action
33
32
  * dispatcher is the thing that could not initialize. A consumer that covers
@@ -110,10 +109,20 @@ export declare class HydraniumDiagramLoader extends DiagramLoader {
110
109
  protected reportLoadFailure(err: unknown): Promise<boolean>;
111
110
  /**
112
111
  * The sentence a failed load is reported with, on every surface that reports
113
- * it, and the only seam an adopter rewords or localizes it at. Public
114
- * because the canvas overlay is one of those surfaces and lives in another
115
- * class: it renders this failure exactly when the `StatusAction` did not
116
- * land, so a second copy of the sentence there could only ever drift unseen.
112
+ * it. Public because the canvas overlay is one of those surfaces and lives in
113
+ * another class, where a second copy of the sentence would drift.
114
+ *
115
+ * **The seam and the catalogue key answer different questions, so it carries
116
+ * both.** Overriding this method changes the WORDING for every user of one
117
+ * adopter's product; the key is what gives a reader the sentence in their own
118
+ * language, and no override can supply that without an adopter writing a
119
+ * subclass per locale — which is the thing a catalogue exists to avoid. Two
120
+ * of the three surfaces this reaches are user-visible, so the audience
121
+ * triage answers it: a host-bound string a user sees takes an inline key.
122
+ *
123
+ * The Output-channel line is therefore localized too, which is deliberate
124
+ * rather than overlooked — the alternative is a second English copy of one
125
+ * sentence, and the reason for a single source here has not changed.
117
126
  */
118
127
  loadFailureLabel(err: unknown): string;
119
128
  /** Render a thrown value as a message. Shared so the channel line, the status
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-loader.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,aAAa,EAAE,KAAK,qBAAqB,EAAgB,MAAM,sBAAsB,CAAC;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG/C;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IAChC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAkB;IAChC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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C;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBACa,sBAAuB,SAAQ,aAAa;IAC/B,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAG,aAAa,CAAC;IAElE,SAAS,CAAC,QAAQ,CAAC,OAAO,+BAAsC;IAChE,SAAS,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAEvC;;;+DAG2D;IAC3D,IAAI,WAAW,IAAI,kBAAkB,GAAG,SAAS,CAEhD;IAED;uEACmE;IACnE,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAE7C;IAEc,IAAI,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CASlE;IAED;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAMlD;IAED;;;;;;;;;;;OAWG;IACH,UAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAUhE;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAErC;IAED;qFACiF;IACjF,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAE1C;CACH"}
@@ -19,8 +19,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  exports.HydraniumDiagramLoader = void 0;
21
21
  const client_1 = require("@eclipse-glsp/client");
22
- const browser_1 = require("@hydranium/client-theia/lib/browser");
22
+ const browser_1 = require("@hydranium/client-theia/browser");
23
23
  const protocol_1 = require("@hydranium/protocol");
24
+ const core_1 = require("@theia/core");
24
25
  const inversify_1 = require("@theia/core/shared/inversify");
25
26
  /**
26
27
  * Diagram loader that never lets a load failure vanish.
@@ -75,10 +76,7 @@ let HydraniumDiagramLoader = class HydraniumDiagramLoader extends client_1.Diagr
75
76
  this.settle({ status: 'loaded' });
76
77
  }
77
78
  catch (err) {
78
- // Report first, settle second, and carry whether the report landed: a
79
- // consumer that uncovers the canvas on settle then finds the error
80
- // already on the status overlay — or learns that it has to render the
81
- // failure itself because nothing else can.
79
+ // Report first, settle second, and carry whether the report landed.
82
80
  const surfaced = await this.reportLoadFailure(err);
83
81
  this.settle({ status: 'failed', error: err, surfaced });
84
82
  }
@@ -128,18 +126,28 @@ let HydraniumDiagramLoader = class HydraniumDiagramLoader extends client_1.Diagr
128
126
  }
129
127
  /**
130
128
  * The sentence a failed load is reported with, on every surface that reports
131
- * it, and the only seam an adopter rewords or localizes it at. Public
132
- * because the canvas overlay is one of those surfaces and lives in another
133
- * class: it renders this failure exactly when the `StatusAction` did not
134
- * land, so a second copy of the sentence there could only ever drift unseen.
129
+ * it. Public because the canvas overlay is one of those surfaces and lives in
130
+ * another class, where a second copy of the sentence would drift.
131
+ *
132
+ * **The seam and the catalogue key answer different questions, so it carries
133
+ * both.** Overriding this method changes the WORDING for every user of one
134
+ * adopter's product; the key is what gives a reader the sentence in their own
135
+ * language, and no override can supply that without an adopter writing a
136
+ * subclass per locale — which is the thing a catalogue exists to avoid. Two
137
+ * of the three surfaces this reaches are user-visible, so the audience
138
+ * triage answers it: a host-bound string a user sees takes an inline key.
139
+ *
140
+ * The Output-channel line is therefore localized too, which is deliberate
141
+ * rather than overlooked — the alternative is a second English copy of one
142
+ * sentence, and the reason for a single source here has not changed.
135
143
  */
136
144
  loadFailureLabel(err) {
137
- return `Diagram failed to load: ${this.formatError(err)}`;
145
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-load-failed', 'Diagram failed to load: {0}', this.formatError(err));
138
146
  }
139
147
  /** Render a thrown value as a message. Shared so the channel line, the status
140
148
  * overlay and any consumer rendering {@link DiagramLoadFailure.error} agree. */
141
149
  formatError(err) {
142
- return err instanceof Error ? err.message : String(err);
150
+ return (0, protocol_1.describeError)(err);
143
151
  }
144
152
  };
145
153
  exports.HydraniumDiagramLoader = HydraniumDiagramLoader;
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-loader.js","sourceRoot":"","sources":["../../src/browser/diagram-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,iDAA+F;AAC/F,iEAAoE;AACpE,kDAA+C;AAC/C,4DAAkE;AAkClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,sBAAa;IACZ,OAAO,CAAiB;IAE/C,OAAO,GAAG,IAAI,mBAAQ,EAAsB,CAAC;IACtD,OAAO,CAAsB;IAEvC;;;+DAG2D;IAC3D,IAAI,WAAW;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;uEACmE;IACnE,eAAe;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,OAA+B;QAChD,IAAI,CAAC;YACF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1B,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACZ,sEAAsE;YACtE,mEAAmE;YACnE,sEAAsE;YACtE,2CAA2C;YAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACO,M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WG;IACO,KAAK,CAAC,iBAAiB,CAAC,GAAY;QAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC;YACF,MAAM,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,qBAAY,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YACxF,OAAO,IAAI,CAAC;QACf,CAAC;QAAC,OAAO,SAAS,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,kEAAkE,EAAE,SAAS,CAAC,CAAC;YAClG,OAAO,KAAK,CAAC;QAChB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,GAAY;QAC1B,OAAO,UAAG,CAAC,QAAQ,CAAC,iDAAiD,EAAE,6BAA6B,EAAE,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAChI,CAAC;IAED;qFACiF;IACvE,WAAW,CAAC,GAAY;QAC/B,OAAO,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;CACH,CAAA;;AApG4C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA8B,uBAAa;uDAAC;iCADxD,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAqGlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;CAG7E"}
1
+ {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1E;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;AAJY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
1
+ {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;;oCAJY,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
@@ -6,9 +6,13 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { GLSPDiagramWidget } from '@eclipse-glsp/theia-integration';
9
+ import { type Args } from '@eclipse-glsp/client';
10
+ import { GLSPDiagramWidget, type GLSPDiagramWidgetOptions } from '@eclipse-glsp/theia-integration';
10
11
  import { type Message } from '@theia/core/lib/browser';
12
+ import { Emitter, type Event } from '@theia/core';
13
+ import { type Container } from '@theia/core/shared/inversify';
11
14
  import { type DiagramLoadOutcome, HydraniumDiagramLoader } from './diagram-loader';
15
+ import { WindowSessionService } from './window-session';
12
16
  import '../../style/diagram-loading.css';
13
17
  /** Class on the overlay root. Adopters style / override via this contract. */
14
18
  export declare const DIAGRAM_LOADING_CLASS = "hydranium-diagram-loading";
@@ -24,32 +28,48 @@ export declare const DIAGRAM_LOADING_FAILED_CLASS = "hydranium-diagram-loading-f
24
28
  * model to read as a broken editor rather than a slow one.
25
29
  *
26
30
  * **How the pending state is sourced.** From {@link HydraniumDiagramLoader}, not
27
- * from `actionDispatcher.onceModelInitialized()`. The loader settles on failure
28
- * as well as on success, and it does so even when its own error-reporting
29
- * dispatch throws; `onceModelInitialized()` simply never settles on a failed
30
- * load. That distinction is not academic here: this overlay is opaque and covers
31
- * the widget node, while GLSP's `StatusOverlay` — where the loader reports the
32
- * failure — mounts *inside* the diagram's base div. Keyed on model
33
- * initialization, a failed load would leave a spinner turning on top of the
34
- * error message explaining it. Keyed on the loader, exactly one component decides
35
- * whether the canvas is pending and the two mechanisms compose instead of
36
- * competing.
31
+ * from `actionDispatcher.onceModelInitialized()`: the loader settles on failure
32
+ * as well as on success, even when its own error report throws, while
33
+ * `onceModelInitialized()` never settles on a failed load and would leave the
34
+ * spinner turning for good.
37
35
  *
38
- * **The one case where this overlay reports the failure itself.** When
39
- * `DiagramLoadFailure.surfaced` is `false` the loader could not dispatch its
40
- * `StatusAction` — the action dispatcher was what failed — so the status overlay
41
- * shows nothing. Uncovering the canvas would then leave a blank diagram whose only
42
- * explanation is a line in the Output channel. In that case, and only that case,
43
- * the overlay stays up and swaps the spinner for the error text.
36
+ * A failed load keeps the overlay up with the error and a Retry, which asks for
37
+ * a fresh widget through {@link onDidRequestReopen}.
44
38
  *
45
39
  * Bound unconditionally by `AbstractHydraniumGlspTheiaFrontendModule`. To opt out,
46
40
  * override {@link showLoadingOverlay} to a no-op; to change what is rendered,
47
41
  * override {@link createLoadingOverlay} or {@link loadingLabel}.
42
+ *
43
+ * Its saveable is a {@link HydraniumGlspSaveable}, which keeps a pending save
44
+ * dirty, so Theia's exit check still counts it; see {@link createSaveable}.
48
45
  */
49
46
  export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
47
+ protected readonly windowSessions: WindowSessionService;
50
48
  protected loadingOverlay?: HTMLElement;
49
+ protected readonly reopenRequestEmitter: Emitter<void>;
50
+ /** Fires when this diagram asks to be replaced by a fresh widget, as its
51
+ * Retry does; `AbstractHydraniumGlspDiagramManager` reopens it. A load is
52
+ * not repeated in place, since GLSP's model source registers its handlers
53
+ * once per load. */
54
+ readonly onDidRequestReopen: Event<void>;
55
+ /**
56
+ * Replaces the saveable GLSP's `configure` builds inline, with no factory
57
+ * seam. The widget factory calls `configure` before the widget reaches the
58
+ * shell, so Theia only ever tracks this one.
59
+ */
60
+ configure(options: GLSPDiagramWidgetOptions, diContainer: Container): void;
61
+ /** The widget's saveable. Override to change how saves and dirty state behave. */
62
+ protected createSaveable(): GLSPDiagramWidget['saveable'];
63
+ /** Adds the window's resume token, so a reload or reconnect takes this diagram's session over. */
64
+ protected getRequestModelOptions(): Args;
51
65
  protected onAfterAttach(msg: Message): void;
52
66
  dispose(): void;
67
+ /**
68
+ * GLSP's restore with `animate: false`; compare the two on a GLSP upgrade.
69
+ * An animated restore holds back every later command, so a Delete right
70
+ * after a select-all typed as the diagram opens finds nothing selected.
71
+ */
72
+ protected setViewportData(viewportData: Parameters<GLSPDiagramWidget['setViewportData']>[0]): Promise<void>;
53
73
  /**
54
74
  * Cover the canvas until the load settles.
55
75
  *
@@ -59,13 +79,7 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
59
79
  * rather than creating and immediately removing one, so there is no flash.
60
80
  */
61
81
  protected showLoadingOverlay(): void;
62
- /**
63
- * Take the overlay down, or keep it as the failure's only reporter.
64
- *
65
- * The overlay is retained ONLY for a failure the loader could not surface;
66
- * anything else uncovers the canvas, so a load that failed *and was reported*
67
- * reveals GLSP's status overlay rather than double-reporting on top of it.
68
- */
82
+ /** Take the overlay down, or keep it as the failure's report. */
69
83
  protected onLoadSettled(outcome: DiagramLoadOutcome): void;
70
84
  /**
71
85
  * Repurpose the pending overlay in place as a failure report: same node, so
@@ -78,6 +92,10 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
78
92
  * is a no-op rather than a fallback wording.
79
93
  */
80
94
  protected showLoadFailure(error: unknown): void;
95
+ /** Ask for a fresh widget, after a failed load. */
96
+ protected retryLoad(): void;
97
+ /** Build the failure overlay's Retry button, which calls {@link retryLoad}. */
98
+ protected createRetryButton(): HTMLElement;
81
99
  protected hideLoadingOverlay(): void;
82
100
  /** Build the overlay DOM. Override to change the wording or add content; the
83
101
  * root must carry {@link DIAGRAM_LOADING_CLASS} for the shipped styling, and
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-widget.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-widget.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAInF,OAAO,iCAAiC,CAAC;AAEzC,8EAA8E;AAC9E,eAAO,MAAM,qBA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