@tangle-network/sandbox-ui 0.105.1 → 0.105.2
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/dist/{chunk-FW77EXKG.js → chunk-F7LNWZQR.js} +26 -3
- package/dist/{chunk-MXQT46AZ.js → chunk-LWSWKLI5.js} +1 -1
- package/dist/{chunk-NT6SCOY2.js → chunk-X24MVW2R.js} +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.js +3 -3
- package/dist/terminal.js +2 -2
- package/dist/workbench.js +3 -3
- package/package.json +1 -1
|
@@ -37,6 +37,20 @@ function createTerminalConnectionId() {
|
|
|
37
37
|
}
|
|
38
38
|
return `terminal-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
39
39
|
}
|
|
40
|
+
function interactiveIdentityKey(incarnationId, control) {
|
|
41
|
+
if (incarnationId === void 0 && control === void 0) return "plain";
|
|
42
|
+
if (incarnationId === void 0 || control === void 0) {
|
|
43
|
+
return `incomplete:${incarnationId ?? ""}`;
|
|
44
|
+
}
|
|
45
|
+
return [
|
|
46
|
+
incarnationId,
|
|
47
|
+
control.refDigest,
|
|
48
|
+
String(control.generation),
|
|
49
|
+
control.leaseId,
|
|
50
|
+
control.holderId,
|
|
51
|
+
control.expiresAt
|
|
52
|
+
].join("\0");
|
|
53
|
+
}
|
|
40
54
|
function usePtySession({
|
|
41
55
|
apiUrl,
|
|
42
56
|
token,
|
|
@@ -161,6 +175,7 @@ function usePtySession({
|
|
|
161
175
|
}
|
|
162
176
|
ws.binaryType = "arraybuffer";
|
|
163
177
|
pendingWsRef.current = ws;
|
|
178
|
+
const isCurrentSocket = () => wsRef.current === ws || pendingWsRef.current === ws;
|
|
164
179
|
let opened = false;
|
|
165
180
|
let settled = false;
|
|
166
181
|
const settle = (ok) => {
|
|
@@ -229,7 +244,7 @@ function usePtySession({
|
|
|
229
244
|
wsRef.current = ws;
|
|
230
245
|
};
|
|
231
246
|
ws.onmessage = (ev) => {
|
|
232
|
-
if (!mountedRef.current) return;
|
|
247
|
+
if (!mountedRef.current || !isCurrentSocket()) return;
|
|
233
248
|
const data = ev.data;
|
|
234
249
|
let text;
|
|
235
250
|
if (typeof data === "string") {
|
|
@@ -240,7 +255,7 @@ function usePtySession({
|
|
|
240
255
|
text = new TextDecoder().decode(data);
|
|
241
256
|
} else {
|
|
242
257
|
data.text().then((t) => {
|
|
243
|
-
if (mountedRef.current) onDataRef.current(t);
|
|
258
|
+
if (mountedRef.current && isCurrentSocket()) onDataRef.current(t);
|
|
244
259
|
}).catch(() => {
|
|
245
260
|
});
|
|
246
261
|
return;
|
|
@@ -419,6 +434,7 @@ function usePtySession({
|
|
|
419
434
|
controlRef.current = control;
|
|
420
435
|
exactAttachRequiredRef.current = incarnationId !== void 0 || control !== void 0;
|
|
421
436
|
connectStreamRef.current = connectStream;
|
|
437
|
+
const exactIdentityKey = interactiveIdentityKey(incarnationId, control);
|
|
422
438
|
const connect = useCallback(async () => {
|
|
423
439
|
cleanup();
|
|
424
440
|
const myGen = ++connectGenRef.current;
|
|
@@ -494,7 +510,14 @@ function usePtySession({
|
|
|
494
510
|
setIsConnected(false);
|
|
495
511
|
}
|
|
496
512
|
}
|
|
497
|
-
}, [
|
|
513
|
+
}, [
|
|
514
|
+
apiUrl,
|
|
515
|
+
providedConnectionId,
|
|
516
|
+
cleanup,
|
|
517
|
+
connectWs,
|
|
518
|
+
connectStream,
|
|
519
|
+
exactIdentityKey
|
|
520
|
+
]);
|
|
498
521
|
reconnectRef.current = connect;
|
|
499
522
|
const resizeTerminal = useCallback(async (cols, rows) => {
|
|
500
523
|
if (cols > 0) colsRef.current = cols;
|
package/dist/hooks.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -153,7 +153,7 @@ import {
|
|
|
153
153
|
buildUnifiedPatch,
|
|
154
154
|
computeDiffStats,
|
|
155
155
|
resolveLanguage
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-X24MVW2R.js";
|
|
157
157
|
import {
|
|
158
158
|
FileArtifactPane,
|
|
159
159
|
FilePreview,
|
|
@@ -238,10 +238,10 @@ import {
|
|
|
238
238
|
UsageChart,
|
|
239
239
|
formatPrice
|
|
240
240
|
} from "./chunk-OMUIPJQZ.js";
|
|
241
|
-
import "./chunk-
|
|
241
|
+
import "./chunk-LWSWKLI5.js";
|
|
242
242
|
import {
|
|
243
243
|
usePtySession
|
|
244
|
-
} from "./chunk-
|
|
244
|
+
} from "./chunk-F7LNWZQR.js";
|
|
245
245
|
import {
|
|
246
246
|
Avatar,
|
|
247
247
|
AvatarFallback,
|
package/dist/terminal.js
CHANGED
package/dist/workbench.js
CHANGED
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
buildUnifiedPatch,
|
|
13
13
|
computeDiffStats,
|
|
14
14
|
resolveLanguage
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X24MVW2R.js";
|
|
16
16
|
import "./chunk-PZVUIUUW.js";
|
|
17
17
|
import "./chunk-K4Q4E7D7.js";
|
|
18
18
|
import "./chunk-OMUIPJQZ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-LWSWKLI5.js";
|
|
20
|
+
import "./chunk-F7LNWZQR.js";
|
|
21
21
|
import "./chunk-2XPJ2XF7.js";
|
|
22
22
|
import "./chunk-RQZRXKMR.js";
|
|
23
23
|
import "./chunk-BGVEHENC.js";
|
package/package.json
CHANGED