@dao42/d42paas-front 0.5.25 → 0.5.33
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/DaoPaaS.es.js +485 -258
- package/dist/DaoPaaS.umd.js +488 -477
- package/dist/editor.d.ts +98 -21
- package/dist/index.html +6 -3
- package/dist/style.css +1 -1
- package/package.json +7 -4
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -14706,7 +14706,7 @@ const daopaasDB = openDB("daopaas", 1, {
|
|
|
14706
14706
|
db2.createObjectStore("media");
|
|
14707
14707
|
}
|
|
14708
14708
|
});
|
|
14709
|
-
async function setReplaySource(val
|
|
14709
|
+
async function setReplaySource(val) {
|
|
14710
14710
|
const {
|
|
14711
14711
|
CRDTInfo,
|
|
14712
14712
|
appStatus,
|
|
@@ -14904,6 +14904,7 @@ const persist = (config, baseOptions) => (set, get2, api2) => {
|
|
|
14904
14904
|
return stateFromStorage || configResult;
|
|
14905
14905
|
};
|
|
14906
14906
|
const oTStore = create$2((set) => ({
|
|
14907
|
+
asyncType: void 0,
|
|
14907
14908
|
appStatus: "code",
|
|
14908
14909
|
setAppStatus: (arg) => set(() => ({
|
|
14909
14910
|
appStatus: arg
|
|
@@ -15021,6 +15022,9 @@ const oTStore = create$2((set) => ({
|
|
|
15021
15022
|
})),
|
|
15022
15023
|
setQueryObject: (arg) => set(() => ({
|
|
15023
15024
|
queryObject: arg
|
|
15025
|
+
})),
|
|
15026
|
+
setAsyncType: (arg) => set(() => ({
|
|
15027
|
+
asyncType: arg
|
|
15024
15028
|
}))
|
|
15025
15029
|
}));
|
|
15026
15030
|
const userStore = create$2(persist((set) => ({
|
|
@@ -15032,6 +15036,22 @@ const userStore = create$2(persist((set) => ({
|
|
|
15032
15036
|
name: "userInfo",
|
|
15033
15037
|
getStorage: () => localStorage
|
|
15034
15038
|
}));
|
|
15039
|
+
const shadowUserStore = create$2(persist((set) => ({
|
|
15040
|
+
shadowUser: {},
|
|
15041
|
+
switchShadowUser: (arg) => set(() => {
|
|
15042
|
+
if (arg.uuid) {
|
|
15043
|
+
alert(`\u5DF2\u5207\u6362\u81F3\u3010${arg.username}\u3011\u89C6\u89D2`);
|
|
15044
|
+
} else {
|
|
15045
|
+
alert(`\u5DF2\u9000\u51FA\u8DDF\u968F\u89C6\u89D2`);
|
|
15046
|
+
}
|
|
15047
|
+
return {
|
|
15048
|
+
shadowUser: arg
|
|
15049
|
+
};
|
|
15050
|
+
})
|
|
15051
|
+
}), {
|
|
15052
|
+
name: "shadowUser",
|
|
15053
|
+
getStorage: () => localStorage
|
|
15054
|
+
}));
|
|
15035
15055
|
const userListStore = create$2(persist((set) => ({
|
|
15036
15056
|
userList: [],
|
|
15037
15057
|
setUserList: (arg) => set(() => ({
|
|
@@ -15044,9 +15064,11 @@ const userListStore = create$2(persist((set) => ({
|
|
|
15044
15064
|
if (typeof indexedDB === "undefined") {
|
|
15045
15065
|
return null;
|
|
15046
15066
|
}
|
|
15047
|
-
|
|
15067
|
+
const response = await (await daopaasDB).getAll("users");
|
|
15068
|
+
return JSON.stringify(response[0]) || null;
|
|
15048
15069
|
},
|
|
15049
15070
|
setItem: async (name, value) => {
|
|
15071
|
+
console.log(name);
|
|
15050
15072
|
(await daopaasDB).put("users", JSON.parse(value).state[name], "userList");
|
|
15051
15073
|
},
|
|
15052
15074
|
removeItem: async () => {
|
|
@@ -27231,6 +27253,7 @@ const PlaygroundInit = (arg) => {
|
|
|
27231
27253
|
switchDoc,
|
|
27232
27254
|
setSenders,
|
|
27233
27255
|
setCRDTInfo,
|
|
27256
|
+
setAsyncType,
|
|
27234
27257
|
setServerAck,
|
|
27235
27258
|
setCustomAck,
|
|
27236
27259
|
switchDocTree,
|
|
@@ -27244,6 +27267,7 @@ const PlaygroundInit = (arg) => {
|
|
|
27244
27267
|
setAppStatus,
|
|
27245
27268
|
setGlobalData
|
|
27246
27269
|
} = oTStore.getState();
|
|
27270
|
+
shadowUserStore.getState();
|
|
27247
27271
|
window.clearCache = () => {
|
|
27248
27272
|
localStorage.clear();
|
|
27249
27273
|
indexedDB.deleteDatabase("daopaas").onsuccess = () => {
|
|
@@ -27255,7 +27279,7 @@ const PlaygroundInit = (arg) => {
|
|
|
27255
27279
|
ticket
|
|
27256
27280
|
}));
|
|
27257
27281
|
io.on("connect", () => {
|
|
27258
|
-
|
|
27282
|
+
setAsyncType(void 0);
|
|
27259
27283
|
setInterval(() => {
|
|
27260
27284
|
io.emit("heartbeat", "\u{1F497}");
|
|
27261
27285
|
}, heartbeatTime);
|
|
@@ -27308,26 +27332,30 @@ const PlaygroundInit = (arg) => {
|
|
|
27308
27332
|
setDockerStatus(data || "STOP");
|
|
27309
27333
|
});
|
|
27310
27334
|
io.on("fileContent", async (d2) => {
|
|
27335
|
+
var _a2, _b2, _c2, _d3;
|
|
27311
27336
|
const _d2 = JSON.parse(d2);
|
|
27312
27337
|
setCRDTInfo(_d2);
|
|
27338
|
+
setAsyncType("file");
|
|
27313
27339
|
setReplaySource(_d2);
|
|
27314
|
-
if (IsMe(_d2 == null ? void 0 : _d2.userInfo) &&
|
|
27340
|
+
if (shadowUserStore.getState().shadowUser.uuid || IsMe(_d2 == null ? void 0 : _d2.userInfo) && _d2.file) {
|
|
27315
27341
|
switchDoc(_d2.file);
|
|
27316
|
-
(await daopaasDB).put("files", _d2.file.value, _d2.file.path);
|
|
27342
|
+
(await daopaasDB).put("files", (_a2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _a2.value, (_b2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _b2.path);
|
|
27317
27343
|
if (!await getLocalReplayFile(_d2.file.path)) {
|
|
27318
|
-
setLocalReplayFile(_d2.file.path, _d2.file.value);
|
|
27344
|
+
setLocalReplayFile((_c2 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _c2.path, (_d3 = _d2 == null ? void 0 : _d2.file) == null ? void 0 : _d3.value);
|
|
27319
27345
|
}
|
|
27320
27346
|
}
|
|
27321
27347
|
});
|
|
27322
27348
|
io.on("terminal", (d2) => {
|
|
27323
27349
|
const _d2 = JSON.parse(d2);
|
|
27324
27350
|
setCRDTInfo(_d2);
|
|
27351
|
+
setAsyncType("terminal");
|
|
27325
27352
|
setReplaySource(_d2);
|
|
27326
27353
|
});
|
|
27327
27354
|
io.on("editFile", (d2) => {
|
|
27328
27355
|
const _d2 = JSON.parse(d2);
|
|
27329
27356
|
setFromServer(true);
|
|
27330
27357
|
setCRDTInfo(_d2);
|
|
27358
|
+
setAsyncType("editor");
|
|
27331
27359
|
setReplaySource(_d2);
|
|
27332
27360
|
});
|
|
27333
27361
|
io.on("saveFile", (d2) => {
|
|
@@ -27336,11 +27364,25 @@ const PlaygroundInit = (arg) => {
|
|
|
27336
27364
|
io.on("customAck", (d2) => {
|
|
27337
27365
|
const _d2 = JSON.parse(d2);
|
|
27338
27366
|
setCRDTInfo(_d2);
|
|
27367
|
+
setAsyncType("editor");
|
|
27339
27368
|
setReplaySource(_d2);
|
|
27340
27369
|
setCustomAck();
|
|
27341
27370
|
});
|
|
27371
|
+
io.on("extraSync", (d2) => {
|
|
27372
|
+
const _d2 = JSON.parse(d2);
|
|
27373
|
+
switch (_d2.extend.type) {
|
|
27374
|
+
case "editor-scroll":
|
|
27375
|
+
setCRDTInfo(_d2);
|
|
27376
|
+
setAsyncType("editor");
|
|
27377
|
+
setCustomAck();
|
|
27378
|
+
break;
|
|
27379
|
+
default:
|
|
27380
|
+
return;
|
|
27381
|
+
}
|
|
27382
|
+
});
|
|
27342
27383
|
io.on("serverAck", (d2) => {
|
|
27343
27384
|
const _d2 = JSON.parse(d2);
|
|
27385
|
+
setAsyncType("editor");
|
|
27344
27386
|
setReplaySource(_d2);
|
|
27345
27387
|
setServerAck();
|
|
27346
27388
|
});
|
|
@@ -27356,12 +27398,14 @@ const PlaygroundInit = (arg) => {
|
|
|
27356
27398
|
io.on("console", (d2) => {
|
|
27357
27399
|
const _d2 = JSON.parse(d2);
|
|
27358
27400
|
setCRDTInfo(_d2);
|
|
27401
|
+
setAsyncType("console");
|
|
27359
27402
|
setReplaySource(_d2);
|
|
27360
27403
|
});
|
|
27361
27404
|
io.on("mediaRecord", (d2) => {
|
|
27362
27405
|
const _d2 = JSON.parse(d2);
|
|
27363
27406
|
setLocalMedia(_d2.timestamp, _d2);
|
|
27364
27407
|
setCRDTInfo(_d2);
|
|
27408
|
+
setAsyncType("media");
|
|
27365
27409
|
setReplaySource(_d2);
|
|
27366
27410
|
});
|
|
27367
27411
|
io.on("disconnect", (reason) => {
|
|
@@ -29527,43 +29571,16 @@ class DaoPaaS {
|
|
|
29527
29571
|
__publicField(this, "playgroundId");
|
|
29528
29572
|
__publicField(this, "userId");
|
|
29529
29573
|
__publicField(this, "tenantId");
|
|
29574
|
+
__publicField(this, "username");
|
|
29530
29575
|
__publicField(this, "userInfo", {});
|
|
29531
29576
|
__publicField(this, "io");
|
|
29532
|
-
const {
|
|
29533
|
-
setSocket,
|
|
29534
|
-
socket: socket2
|
|
29535
|
-
} = useOT.getState();
|
|
29536
29577
|
this.ticket = ticket;
|
|
29537
29578
|
this.playgroundId = playgroundId;
|
|
29538
29579
|
this.userId = userId;
|
|
29539
29580
|
this.tenantId = tenantId;
|
|
29581
|
+
this.username = username ? username : "";
|
|
29540
29582
|
sessionStorage.setItem("playgroundId", playgroundId);
|
|
29541
|
-
|
|
29542
|
-
method: "POST",
|
|
29543
|
-
headers: {
|
|
29544
|
-
"Content-Type": "application/json"
|
|
29545
|
-
},
|
|
29546
|
-
body: JSON.stringify({
|
|
29547
|
-
ticket: this.ticket
|
|
29548
|
-
})
|
|
29549
|
-
}).then((response) => {
|
|
29550
|
-
return response.json();
|
|
29551
|
-
}).then((data) => {
|
|
29552
|
-
this.io = new sockerIO({
|
|
29553
|
-
ticket,
|
|
29554
|
-
playgroundId,
|
|
29555
|
-
userId,
|
|
29556
|
-
username,
|
|
29557
|
-
tenantId,
|
|
29558
|
-
ioPath: `wss://${data.data}`
|
|
29559
|
-
});
|
|
29560
|
-
setSocket(this.io);
|
|
29561
|
-
this.init({
|
|
29562
|
-
ticket,
|
|
29563
|
-
playgroundId,
|
|
29564
|
-
userId
|
|
29565
|
-
});
|
|
29566
|
-
});
|
|
29583
|
+
this.init();
|
|
29567
29584
|
}
|
|
29568
29585
|
get otstore() {
|
|
29569
29586
|
return oTStore.getState();
|
|
@@ -29571,21 +29588,37 @@ class DaoPaaS {
|
|
|
29571
29588
|
get playgroundStatus() {
|
|
29572
29589
|
return this.otstore.playgroundStatus;
|
|
29573
29590
|
}
|
|
29574
|
-
async init(
|
|
29575
|
-
|
|
29576
|
-
|
|
29577
|
-
|
|
29578
|
-
|
|
29579
|
-
|
|
29580
|
-
placement: "bottomEnd"
|
|
29581
|
-
});
|
|
29582
|
-
}
|
|
29583
|
-
};
|
|
29584
|
-
reactDom.exports.unstable_batchedUpdates(() => {
|
|
29591
|
+
async init() {
|
|
29592
|
+
const {
|
|
29593
|
+
setSocket,
|
|
29594
|
+
socket: socket2
|
|
29595
|
+
} = useOT.getState();
|
|
29596
|
+
reactDom.exports.unstable_batchedUpdates(async () => {
|
|
29585
29597
|
const {
|
|
29586
29598
|
setUserInfo,
|
|
29587
29599
|
userInfo
|
|
29588
29600
|
} = userStore.getState();
|
|
29601
|
+
const args = {
|
|
29602
|
+
ticket: this.ticket,
|
|
29603
|
+
playgroundId: this.playgroundId,
|
|
29604
|
+
userId: this.userId,
|
|
29605
|
+
username: this.username,
|
|
29606
|
+
tenantId: this.tenantId
|
|
29607
|
+
};
|
|
29608
|
+
const response = await fetch("https://develop.1024paas.com/jssdk/ticket", {
|
|
29609
|
+
method: "POST",
|
|
29610
|
+
headers: {
|
|
29611
|
+
"Content-Type": "application/json"
|
|
29612
|
+
},
|
|
29613
|
+
body: JSON.stringify({
|
|
29614
|
+
ticket: this.ticket
|
|
29615
|
+
})
|
|
29616
|
+
});
|
|
29617
|
+
const data = await response.json();
|
|
29618
|
+
this.io = new sockerIO(__spreadProps(__spreadValues({}, args), {
|
|
29619
|
+
ioPath: `wss://${data.data}`
|
|
29620
|
+
}));
|
|
29621
|
+
setSocket(this.io);
|
|
29589
29622
|
if (!args.userId)
|
|
29590
29623
|
throw "\u7F3A\u5C11userId";
|
|
29591
29624
|
if (!args.playgroundId)
|
|
@@ -29600,6 +29633,15 @@ class DaoPaaS {
|
|
|
29600
29633
|
io: this.io
|
|
29601
29634
|
}));
|
|
29602
29635
|
});
|
|
29636
|
+
window.onerror = (message) => {
|
|
29637
|
+
if (/dError/.test(message)) {
|
|
29638
|
+
Toast.message({
|
|
29639
|
+
type: "error",
|
|
29640
|
+
content: message.replace("Uncaught dError:", ""),
|
|
29641
|
+
placement: "bottomEnd"
|
|
29642
|
+
});
|
|
29643
|
+
}
|
|
29644
|
+
};
|
|
29603
29645
|
}
|
|
29604
29646
|
clearIDB() {
|
|
29605
29647
|
}
|
|
@@ -31647,13 +31689,13 @@ var Tree = react.exports.forwardRef(function(props, ref) {
|
|
|
31647
31689
|
}
|
|
31648
31690
|
return react.exports.createElement(TreeContext.Provider, { value: treeContextProps }, react.exports.createElement(TreeActionsProvider, { ref }, react.exports.createElement(TreeManager, null)));
|
|
31649
31691
|
});
|
|
31650
|
-
|
|
31692
|
+
const IoClient = function(revision) {
|
|
31651
31693
|
this.revision = revision;
|
|
31652
31694
|
this.state = synchronized_;
|
|
31653
31695
|
this.operation = [];
|
|
31654
31696
|
this.receiveOperation = [];
|
|
31655
31697
|
this.io = useOT.getState().socket;
|
|
31656
|
-
}
|
|
31698
|
+
};
|
|
31657
31699
|
IoClient.prototype.setState = function(state) {
|
|
31658
31700
|
this.state = state;
|
|
31659
31701
|
};
|
|
@@ -31734,10 +31776,15 @@ AwaitingWithBuffer.prototype.applyClient = function(client2, operation) {
|
|
|
31734
31776
|
return new AwaitingWithBuffer(this.outstanding, newBuffer);
|
|
31735
31777
|
};
|
|
31736
31778
|
AwaitingWithBuffer.prototype.applyServer = function(client2, operation) {
|
|
31779
|
+
let pair2, pair1;
|
|
31737
31780
|
const transform = operation.constructor.transform;
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31781
|
+
if (this.outstanding.baseLength === operation.baseLength) {
|
|
31782
|
+
pair1 = transform(this.outstanding, operation);
|
|
31783
|
+
if (this.buffer.baseLength === pair1[1].baseLength) {
|
|
31784
|
+
pair2 = transform(this.buffer, pair1[1]);
|
|
31785
|
+
client2.applyOperation(pair2[1]);
|
|
31786
|
+
}
|
|
31787
|
+
}
|
|
31741
31788
|
return new AwaitingWithBuffer(pair1[0], pair2[0]);
|
|
31742
31789
|
};
|
|
31743
31790
|
AwaitingWithBuffer.prototype.serverAck = function(client2) {
|
|
@@ -31750,6 +31797,58 @@ AwaitingWithBuffer.prototype.transformSelection = function(selection2) {
|
|
|
31750
31797
|
AwaitingWithBuffer.prototype.resend = function(client2) {
|
|
31751
31798
|
client2.sendOperation(client2.revision, this.outstanding);
|
|
31752
31799
|
};
|
|
31800
|
+
const FollowLayoutWrapper = newStyled.div`
|
|
31801
|
+
width: 100%;
|
|
31802
|
+
height: 100%;
|
|
31803
|
+
|
|
31804
|
+
border-width: 4px 3px;
|
|
31805
|
+
border-radius: 2px;
|
|
31806
|
+
position: relative;
|
|
31807
|
+
border-color: ${(props) => props.user.color};
|
|
31808
|
+
border-style: ${(props) => props.user.color && props.isPass ? "solid" : "none"};
|
|
31809
|
+
`;
|
|
31810
|
+
const FollowLayout = ({
|
|
31811
|
+
className = "",
|
|
31812
|
+
children,
|
|
31813
|
+
name
|
|
31814
|
+
}) => {
|
|
31815
|
+
const shadowUser = shadowUserStore((state) => state.shadowUser);
|
|
31816
|
+
const asyncType = oTStore((state) => state.asyncType);
|
|
31817
|
+
const setAsyncType = oTStore((state) => state.setAsyncType);
|
|
31818
|
+
const {
|
|
31819
|
+
switchShadowUser
|
|
31820
|
+
} = shadowUserStore.getState();
|
|
31821
|
+
return /* @__PURE__ */ jsx(FollowLayoutWrapper, {
|
|
31822
|
+
user: shadowUser,
|
|
31823
|
+
className: `${className}`,
|
|
31824
|
+
isPass: asyncType === name && !IsMe(shadowUser),
|
|
31825
|
+
onClick: () => {
|
|
31826
|
+
if (!shadowUser.uuid)
|
|
31827
|
+
return;
|
|
31828
|
+
setAsyncType(void 0);
|
|
31829
|
+
switchShadowUser({});
|
|
31830
|
+
},
|
|
31831
|
+
onKeyDown: () => {
|
|
31832
|
+
if (!shadowUser.uuid)
|
|
31833
|
+
return;
|
|
31834
|
+
setAsyncType(void 0);
|
|
31835
|
+
switchShadowUser({});
|
|
31836
|
+
},
|
|
31837
|
+
onScroll: () => {
|
|
31838
|
+
if (!shadowUser.uuid)
|
|
31839
|
+
return;
|
|
31840
|
+
setAsyncType(void 0);
|
|
31841
|
+
switchShadowUser({});
|
|
31842
|
+
},
|
|
31843
|
+
onWheel: () => {
|
|
31844
|
+
if (!shadowUser.uuid)
|
|
31845
|
+
return;
|
|
31846
|
+
setAsyncType(void 0);
|
|
31847
|
+
switchShadowUser({});
|
|
31848
|
+
},
|
|
31849
|
+
children
|
|
31850
|
+
});
|
|
31851
|
+
};
|
|
31753
31852
|
function addChildrenArray(children, parent2) {
|
|
31754
31853
|
for (let i2 = 0; i2 < children.length; i2++) {
|
|
31755
31854
|
if (children[i2].type === "DIRECTORY") {
|
|
@@ -32027,65 +32126,68 @@ const FileTree = ({
|
|
|
32027
32126
|
}
|
|
32028
32127
|
}
|
|
32029
32128
|
}, [CRDTInfo]);
|
|
32030
|
-
return /* @__PURE__ */ jsx(
|
|
32031
|
-
|
|
32032
|
-
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
|
|
32037
|
-
canDragAndDrop: true,
|
|
32038
|
-
items: treeData,
|
|
32039
|
-
onFocusItem: (item) => setFocusedItem(item.index),
|
|
32040
|
-
onExpandItem: (item) => {
|
|
32041
|
-
onExpand(item.index);
|
|
32042
|
-
},
|
|
32043
|
-
onCollapseItem: (item) => {
|
|
32044
|
-
onCollapse(item.index);
|
|
32045
|
-
},
|
|
32046
|
-
getItemTitle: (item) => item.data,
|
|
32047
|
-
viewState: {
|
|
32048
|
-
["tree-1"]: {
|
|
32049
|
-
focusedItem,
|
|
32050
|
-
expandedItems,
|
|
32051
|
-
selectedItems
|
|
32052
|
-
}
|
|
32053
|
-
},
|
|
32054
|
-
onSelectItems: (items) => {
|
|
32055
|
-
onSelect(items);
|
|
32056
|
-
onCustomSelect == null ? void 0 : onCustomSelect(items);
|
|
32129
|
+
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
32130
|
+
name: "file",
|
|
32131
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
32132
|
+
ref: treeRef,
|
|
32133
|
+
style: {
|
|
32134
|
+
height: "100%",
|
|
32135
|
+
overflow: "auto"
|
|
32057
32136
|
},
|
|
32058
|
-
|
|
32059
|
-
|
|
32060
|
-
|
|
32061
|
-
|
|
32062
|
-
|
|
32063
|
-
|
|
32064
|
-
|
|
32065
|
-
|
|
32066
|
-
|
|
32067
|
-
|
|
32068
|
-
|
|
32069
|
-
|
|
32070
|
-
|
|
32071
|
-
|
|
32072
|
-
|
|
32073
|
-
|
|
32074
|
-
|
|
32075
|
-
|
|
32076
|
-
|
|
32137
|
+
children: /* @__PURE__ */ jsx(ControlledTreeEnvironment, {
|
|
32138
|
+
canDragAndDrop: true,
|
|
32139
|
+
items: treeData,
|
|
32140
|
+
onFocusItem: (item) => setFocusedItem(item.index),
|
|
32141
|
+
onExpandItem: (item) => {
|
|
32142
|
+
onExpand(item.index);
|
|
32143
|
+
},
|
|
32144
|
+
onCollapseItem: (item) => {
|
|
32145
|
+
onCollapse(item.index);
|
|
32146
|
+
},
|
|
32147
|
+
getItemTitle: (item) => item.data,
|
|
32148
|
+
viewState: {
|
|
32149
|
+
["tree-1"]: {
|
|
32150
|
+
focusedItem,
|
|
32151
|
+
expandedItems,
|
|
32152
|
+
selectedItems
|
|
32153
|
+
}
|
|
32154
|
+
},
|
|
32155
|
+
onSelectItems: (items) => {
|
|
32156
|
+
onSelect(items);
|
|
32157
|
+
onCustomSelect == null ? void 0 : onCustomSelect(items);
|
|
32158
|
+
},
|
|
32159
|
+
renderItem: ({
|
|
32160
|
+
title,
|
|
32161
|
+
arrow,
|
|
32162
|
+
depth,
|
|
32163
|
+
context,
|
|
32164
|
+
children
|
|
32165
|
+
}) => {
|
|
32166
|
+
return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, context.itemContainerWithChildrenProps), {
|
|
32167
|
+
className: ["rct-tree-item-li", context.isSelected ? "rct-tree-item-li-selected" : "", context.isExpanded ? "rct-tree-item-li-expanded" : "", context.isFocused ? "rct-tree-item-li-focused" : "", children ? "rct-tree-item-li-hasChildren" : ""].join(" "),
|
|
32168
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
32169
|
+
className: ["rct-tree-item-title-container", context.isSelected ? "rct-tree-item-title-container-selected" : "", context.isExpanded ? "rct-tree-item-title-container-expanded" : "", context.isFocused ? "rct-tree-item-title-container-focused" : "", children ? "rct-tree-item-title-container-hasChildren" : ""].join(" "),
|
|
32077
32170
|
style: {
|
|
32078
|
-
|
|
32079
|
-
|
|
32080
|
-
}
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
|
|
32084
|
-
|
|
32085
|
-
|
|
32086
|
-
|
|
32087
|
-
|
|
32088
|
-
|
|
32171
|
+
paddingLeft: `${depth}0px`
|
|
32172
|
+
},
|
|
32173
|
+
children: [arrow, /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues(__spreadValues({}, context.itemContainerWithoutChildrenProps), context.interactiveElementProps), {
|
|
32174
|
+
className: ["rct-tree-item-button", context.isSelected ? "rct-tree-item-button-selected" : "", context.isExpanded ? "rct-tree-item-button-expanded" : "", context.isFocused ? "rct-tree-item-button-focused" : "", children ? "rct-tree-item-button-hasChildren" : ""].join(" "),
|
|
32175
|
+
children: title
|
|
32176
|
+
})), remoteUserList[context.interactiveElementProps["data-rct-item-id"]] && remoteUserList[context.interactiveElementProps["data-rct-item-id"]].map((remoteUser) => /* @__PURE__ */ jsx("div", {
|
|
32177
|
+
className: "rct-tree-item-avatar rounded-full absolute border",
|
|
32178
|
+
style: {
|
|
32179
|
+
borderColor: remoteUser.color,
|
|
32180
|
+
backgroundImage: `url(${remoteUser.avatar})`
|
|
32181
|
+
}
|
|
32182
|
+
}, remoteUser.uuid))]
|
|
32183
|
+
}), children]
|
|
32184
|
+
}));
|
|
32185
|
+
},
|
|
32186
|
+
children: /* @__PURE__ */ jsx(Tree, {
|
|
32187
|
+
treeId: "tree-1",
|
|
32188
|
+
rootItem: "/",
|
|
32189
|
+
treeLabel: "File Tree"
|
|
32190
|
+
})
|
|
32089
32191
|
})
|
|
32090
32192
|
})
|
|
32091
32193
|
});
|
|
@@ -56242,7 +56344,7 @@ function setARIAContainer(parent2) {
|
|
|
56242
56344
|
statusContainer2 = createStatusContainer();
|
|
56243
56345
|
parent2.appendChild(ariaContainer);
|
|
56244
56346
|
}
|
|
56245
|
-
function alert(msg2) {
|
|
56347
|
+
function alert$1(msg2) {
|
|
56246
56348
|
if (!ariaContainer) {
|
|
56247
56349
|
return;
|
|
56248
56350
|
}
|
|
@@ -56259,7 +56361,7 @@ function status(msg2) {
|
|
|
56259
56361
|
return;
|
|
56260
56362
|
}
|
|
56261
56363
|
if (isMacintosh) {
|
|
56262
|
-
alert(msg2);
|
|
56364
|
+
alert$1(msg2);
|
|
56263
56365
|
} else {
|
|
56264
56366
|
if (statusContainer.textContent !== msg2) {
|
|
56265
56367
|
clearNode(statusContainer2);
|
|
@@ -102882,7 +102984,7 @@ class TypeLabelController {
|
|
|
102882
102984
|
if (focus.length > 0 && focus[0] === this.previouslyFocused) {
|
|
102883
102985
|
const ariaLabel = (_a2 = this.list.options.accessibilityProvider) === null || _a2 === void 0 ? void 0 : _a2.getAriaLabel(this.list.element(focus[0]));
|
|
102884
102986
|
if (ariaLabel) {
|
|
102885
|
-
alert(ariaLabel);
|
|
102987
|
+
alert$1(ariaLabel);
|
|
102886
102988
|
}
|
|
102887
102989
|
}
|
|
102888
102990
|
this.previouslyFocused = -1;
|
|
@@ -111757,7 +111859,7 @@ class InputBox extends Widget {
|
|
|
111757
111859
|
} else {
|
|
111758
111860
|
alertText = localize("alertInfoMessage", "Info: {0}", this.message.content);
|
|
111759
111861
|
}
|
|
111760
|
-
alert(alertText);
|
|
111862
|
+
alert$1(alertText);
|
|
111761
111863
|
this.state = "open";
|
|
111762
111864
|
}
|
|
111763
111865
|
_hideMessage() {
|
|
@@ -116168,15 +116270,15 @@ function alertFormattingEdits(edits) {
|
|
|
116168
116270
|
const { startLineNumber, endLineNumber } = range2;
|
|
116169
116271
|
if (startLineNumber === endLineNumber) {
|
|
116170
116272
|
if (edits.length === 1) {
|
|
116171
|
-
alert(localize("hint11", "Made 1 formatting edit on line {0}", startLineNumber));
|
|
116273
|
+
alert$1(localize("hint11", "Made 1 formatting edit on line {0}", startLineNumber));
|
|
116172
116274
|
} else {
|
|
116173
|
-
alert(localize("hintn1", "Made {0} formatting edits on line {1}", edits.length, startLineNumber));
|
|
116275
|
+
alert$1(localize("hintn1", "Made {0} formatting edits on line {1}", edits.length, startLineNumber));
|
|
116174
116276
|
}
|
|
116175
116277
|
} else {
|
|
116176
116278
|
if (edits.length === 1) {
|
|
116177
|
-
alert(localize("hint1n", "Made 1 formatting edit between lines {0} and {1}", startLineNumber, endLineNumber));
|
|
116279
|
+
alert$1(localize("hint1n", "Made 1 formatting edit between lines {0} and {1}", startLineNumber, endLineNumber));
|
|
116178
116280
|
} else {
|
|
116179
|
-
alert(localize("hintnn", "Made {0} formatting edits between lines {1} and {2}", edits.length, startLineNumber, endLineNumber));
|
|
116281
|
+
alert$1(localize("hintnn", "Made {0} formatting edits between lines {1} and {2}", edits.length, startLineNumber, endLineNumber));
|
|
116180
116282
|
}
|
|
116181
116283
|
}
|
|
116182
116284
|
}
|
|
@@ -118680,7 +118782,7 @@ let SelectionAnchorController = class SelectionAnchorController2 {
|
|
|
118680
118782
|
}]);
|
|
118681
118783
|
this.decorationId = newDecorationId[0];
|
|
118682
118784
|
this.selectionAnchorSetContextKey.set(!!this.decorationId);
|
|
118683
|
-
alert(localize("anchorSet", "Anchor set at {0}:{1}", position2.lineNumber, position2.column));
|
|
118785
|
+
alert$1(localize("anchorSet", "Anchor set at {0}:{1}", position2.lineNumber, position2.column));
|
|
118684
118786
|
}
|
|
118685
118787
|
}
|
|
118686
118788
|
goToSelectionAnchor() {
|
|
@@ -119811,7 +119913,7 @@ let MessageController = class MessageController2 {
|
|
|
119811
119913
|
this._visible.reset();
|
|
119812
119914
|
}
|
|
119813
119915
|
showMessage(message, position2) {
|
|
119814
|
-
alert(message);
|
|
119916
|
+
alert$1(message);
|
|
119815
119917
|
this._visible.set(true);
|
|
119816
119918
|
this._messageWidget.clear();
|
|
119817
119919
|
this._messageListeners.clear();
|
|
@@ -125037,7 +125139,7 @@ class SymbolNavigationAction extends EditorAction {
|
|
|
125037
125139
|
if (!references || cts.token.isCancellationRequested) {
|
|
125038
125140
|
return;
|
|
125039
125141
|
}
|
|
125040
|
-
alert(references.ariaMessage);
|
|
125142
|
+
alert$1(references.ariaMessage);
|
|
125041
125143
|
let altAction;
|
|
125042
125144
|
if (references.referenceAt(model.uri, pos)) {
|
|
125043
125145
|
const altActionId = this._getAlternativeCommand(editor2);
|
|
@@ -137373,7 +137475,7 @@ let SuggestController = class SuggestController2 {
|
|
|
137373
137475
|
_alertCompletionItem(item) {
|
|
137374
137476
|
if (isNonEmptyArray(item.completion.additionalTextEdits)) {
|
|
137375
137477
|
let msg2 = localize("aria.alert.snippet", "Accepting '{0}' made {1} additional edits", item.textLabel, item.completion.additionalTextEdits.length);
|
|
137376
|
-
alert(msg2);
|
|
137478
|
+
alert$1(msg2);
|
|
137377
137479
|
}
|
|
137378
137480
|
}
|
|
137379
137481
|
triggerSuggest(onlyFrom, auto) {
|
|
@@ -144153,7 +144255,7 @@ class FindWidget extends Widget {
|
|
|
144153
144255
|
label = NLS_NO_RESULTS;
|
|
144154
144256
|
}
|
|
144155
144257
|
this._matchesCount.appendChild(document.createTextNode(label));
|
|
144156
|
-
alert(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString));
|
|
144258
|
+
alert$1(this._getAriaLabel(label, this._state.currentMatch, this._state.searchString));
|
|
144157
144259
|
MAX_MATCHES_COUNT_WIDTH = Math.max(MAX_MATCHES_COUNT_WIDTH, this._matchesCount.clientWidth);
|
|
144158
144260
|
}
|
|
144159
144261
|
_getAriaLabel(label, currentMatch, searchString) {
|
|
@@ -153058,7 +153160,7 @@ let ParameterHintsWidget = class ParameterHintsWidget2 extends Disposable {
|
|
|
153058
153160
|
labelToAnnounce += typeof signature.documentation === "string" ? `, ${signature.documentation}` : `, ${signature.documentation.value}`;
|
|
153059
153161
|
}
|
|
153060
153162
|
if (this.announcedLabel !== labelToAnnounce) {
|
|
153061
|
-
alert(localize("hint", "{0}, hint", labelToAnnounce));
|
|
153163
|
+
alert$1(localize("hint", "{0}, hint", labelToAnnounce));
|
|
153062
153164
|
this.announcedLabel = labelToAnnounce;
|
|
153063
153165
|
}
|
|
153064
153166
|
}
|
|
@@ -153670,7 +153772,7 @@ let RenameController = class RenameController2 {
|
|
|
153670
153772
|
quotableLabel: localize("quotableLabel", "Renaming {0}", loc === null || loc === void 0 ? void 0 : loc.text)
|
|
153671
153773
|
}).then((result) => {
|
|
153672
153774
|
if (result.ariaSummary) {
|
|
153673
|
-
alert(localize("aria", "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc.text, inputFieldResult.newName, result.ariaSummary));
|
|
153775
|
+
alert$1(localize("aria", "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc.text, inputFieldResult.newName, result.ariaSummary));
|
|
153674
153776
|
}
|
|
153675
153777
|
}).catch((err) => {
|
|
153676
153778
|
this._notificationService.error(localize("rename.failedApply", "Rename failed to apply edits"));
|
|
@@ -154156,9 +154258,9 @@ class ToggleTabFocusModeAction extends EditorAction {
|
|
|
154156
154258
|
const newValue = !oldValue;
|
|
154157
154259
|
TabFocus.setTabFocusMode(newValue);
|
|
154158
154260
|
if (newValue) {
|
|
154159
|
-
alert(localize("toggle.tabMovesFocus.on", "Pressing Tab will now move focus to the next focusable element"));
|
|
154261
|
+
alert$1(localize("toggle.tabMovesFocus.on", "Pressing Tab will now move focus to the next focusable element"));
|
|
154160
154262
|
} else {
|
|
154161
|
-
alert(localize("toggle.tabMovesFocus.off", "Pressing Tab will now insert the tab character"));
|
|
154263
|
+
alert$1(localize("toggle.tabMovesFocus.off", "Pressing Tab will now insert the tab character"));
|
|
154162
154264
|
}
|
|
154163
154265
|
}
|
|
154164
154266
|
}
|
|
@@ -154554,7 +154656,7 @@ class WordHighlighter {
|
|
|
154554
154656
|
const word = this._getWord();
|
|
154555
154657
|
if (word) {
|
|
154556
154658
|
const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber);
|
|
154557
|
-
alert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);
|
|
154659
|
+
alert$1(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);
|
|
154558
154660
|
}
|
|
154559
154661
|
} finally {
|
|
154560
154662
|
this._ignorePositionChangeEvent = false;
|
|
@@ -154572,7 +154674,7 @@ class WordHighlighter {
|
|
|
154572
154674
|
const word = this._getWord();
|
|
154573
154675
|
if (word) {
|
|
154574
154676
|
const lineContent = this.editor.getModel().getLineContent(dest.startLineNumber);
|
|
154575
|
-
alert(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);
|
|
154677
|
+
alert$1(`${lineContent}, ${newIndex + 1} of ${highlights.length} for '${word.word}'`);
|
|
154576
154678
|
}
|
|
154577
154679
|
} finally {
|
|
154578
154680
|
this._ignorePositionChangeEvent = false;
|
|
@@ -155518,7 +155620,7 @@ let AccessibilityHelpWidget = class AccessibilityHelpWidget2 extends Widget {
|
|
|
155518
155620
|
return;
|
|
155519
155621
|
}
|
|
155520
155622
|
if (e2.equals(2048 | 35)) {
|
|
155521
|
-
alert(AccessibilityHelpNLS.emergencyConfOn);
|
|
155623
|
+
alert$1(AccessibilityHelpNLS.emergencyConfOn);
|
|
155522
155624
|
this._editor.updateOptions({
|
|
155523
155625
|
accessibilitySupport: "on"
|
|
155524
155626
|
});
|
|
@@ -155529,7 +155631,7 @@ let AccessibilityHelpWidget = class AccessibilityHelpWidget2 extends Widget {
|
|
|
155529
155631
|
e2.stopPropagation();
|
|
155530
155632
|
}
|
|
155531
155633
|
if (e2.equals(2048 | 38)) {
|
|
155532
|
-
alert(AccessibilityHelpNLS.openingDocs);
|
|
155634
|
+
alert$1(AccessibilityHelpNLS.openingDocs);
|
|
155533
155635
|
let url2 = this._editor.getRawOptions().accessibilityHelpUrl;
|
|
155534
155636
|
if (typeof url2 === "undefined") {
|
|
155535
155637
|
url2 = "https://go.microsoft.com/fwlink/?linkid=852450";
|
|
@@ -157517,6 +157619,24 @@ class ToggleHighContrast extends EditorAction {
|
|
|
157517
157619
|
}
|
|
157518
157620
|
}
|
|
157519
157621
|
registerEditorAction(ToggleHighContrast);
|
|
157622
|
+
var monaco = /* @__PURE__ */ Object.freeze({
|
|
157623
|
+
__proto__: null,
|
|
157624
|
+
[Symbol.toStringTag]: "Module",
|
|
157625
|
+
CancellationTokenSource,
|
|
157626
|
+
Emitter,
|
|
157627
|
+
KeyCode,
|
|
157628
|
+
KeyMod,
|
|
157629
|
+
Position: Position$4,
|
|
157630
|
+
Range: Range$4,
|
|
157631
|
+
Selection: Selection$2,
|
|
157632
|
+
SelectionDirection,
|
|
157633
|
+
MarkerSeverity,
|
|
157634
|
+
MarkerTag,
|
|
157635
|
+
Uri,
|
|
157636
|
+
Token,
|
|
157637
|
+
editor: editor$1,
|
|
157638
|
+
languages
|
|
157639
|
+
});
|
|
157520
157640
|
var lib$2 = {};
|
|
157521
157641
|
var textOperation = { exports: {} };
|
|
157522
157642
|
(function(module2) {
|
|
@@ -162761,8 +162881,8 @@ var DEFAULT = {
|
|
|
162761
162881
|
startClosed: false,
|
|
162762
162882
|
debug: false
|
|
162763
162883
|
};
|
|
162764
|
-
|
|
162765
|
-
function
|
|
162884
|
+
var ReconnectingWebSocket = function() {
|
|
162885
|
+
function ReconnectingWebSocket2(url2, protocols, options) {
|
|
162766
162886
|
var _this = this;
|
|
162767
162887
|
if (options === void 0) {
|
|
162768
162888
|
options = {};
|
|
@@ -162844,63 +162964,63 @@ var DEFAULT = {
|
|
|
162844
162964
|
}
|
|
162845
162965
|
this._connect();
|
|
162846
162966
|
}
|
|
162847
|
-
Object.defineProperty(
|
|
162967
|
+
Object.defineProperty(ReconnectingWebSocket2, "CONNECTING", {
|
|
162848
162968
|
get: function() {
|
|
162849
162969
|
return 0;
|
|
162850
162970
|
},
|
|
162851
162971
|
enumerable: true,
|
|
162852
162972
|
configurable: true
|
|
162853
162973
|
});
|
|
162854
|
-
Object.defineProperty(
|
|
162974
|
+
Object.defineProperty(ReconnectingWebSocket2, "OPEN", {
|
|
162855
162975
|
get: function() {
|
|
162856
162976
|
return 1;
|
|
162857
162977
|
},
|
|
162858
162978
|
enumerable: true,
|
|
162859
162979
|
configurable: true
|
|
162860
162980
|
});
|
|
162861
|
-
Object.defineProperty(
|
|
162981
|
+
Object.defineProperty(ReconnectingWebSocket2, "CLOSING", {
|
|
162862
162982
|
get: function() {
|
|
162863
162983
|
return 2;
|
|
162864
162984
|
},
|
|
162865
162985
|
enumerable: true,
|
|
162866
162986
|
configurable: true
|
|
162867
162987
|
});
|
|
162868
|
-
Object.defineProperty(
|
|
162988
|
+
Object.defineProperty(ReconnectingWebSocket2, "CLOSED", {
|
|
162869
162989
|
get: function() {
|
|
162870
162990
|
return 3;
|
|
162871
162991
|
},
|
|
162872
162992
|
enumerable: true,
|
|
162873
162993
|
configurable: true
|
|
162874
162994
|
});
|
|
162875
|
-
Object.defineProperty(
|
|
162995
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "CONNECTING", {
|
|
162876
162996
|
get: function() {
|
|
162877
|
-
return
|
|
162997
|
+
return ReconnectingWebSocket2.CONNECTING;
|
|
162878
162998
|
},
|
|
162879
162999
|
enumerable: true,
|
|
162880
163000
|
configurable: true
|
|
162881
163001
|
});
|
|
162882
|
-
Object.defineProperty(
|
|
163002
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "OPEN", {
|
|
162883
163003
|
get: function() {
|
|
162884
|
-
return
|
|
163004
|
+
return ReconnectingWebSocket2.OPEN;
|
|
162885
163005
|
},
|
|
162886
163006
|
enumerable: true,
|
|
162887
163007
|
configurable: true
|
|
162888
163008
|
});
|
|
162889
|
-
Object.defineProperty(
|
|
163009
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "CLOSING", {
|
|
162890
163010
|
get: function() {
|
|
162891
|
-
return
|
|
163011
|
+
return ReconnectingWebSocket2.CLOSING;
|
|
162892
163012
|
},
|
|
162893
163013
|
enumerable: true,
|
|
162894
163014
|
configurable: true
|
|
162895
163015
|
});
|
|
162896
|
-
Object.defineProperty(
|
|
163016
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "CLOSED", {
|
|
162897
163017
|
get: function() {
|
|
162898
|
-
return
|
|
163018
|
+
return ReconnectingWebSocket2.CLOSED;
|
|
162899
163019
|
},
|
|
162900
163020
|
enumerable: true,
|
|
162901
163021
|
configurable: true
|
|
162902
163022
|
});
|
|
162903
|
-
Object.defineProperty(
|
|
163023
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "binaryType", {
|
|
162904
163024
|
get: function() {
|
|
162905
163025
|
return this._ws ? this._ws.binaryType : this._binaryType;
|
|
162906
163026
|
},
|
|
@@ -162913,14 +163033,14 @@ var DEFAULT = {
|
|
|
162913
163033
|
enumerable: true,
|
|
162914
163034
|
configurable: true
|
|
162915
163035
|
});
|
|
162916
|
-
Object.defineProperty(
|
|
163036
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "retryCount", {
|
|
162917
163037
|
get: function() {
|
|
162918
163038
|
return Math.max(this._retryCount, 0);
|
|
162919
163039
|
},
|
|
162920
163040
|
enumerable: true,
|
|
162921
163041
|
configurable: true
|
|
162922
163042
|
});
|
|
162923
|
-
Object.defineProperty(
|
|
163043
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "bufferedAmount", {
|
|
162924
163044
|
get: function() {
|
|
162925
163045
|
var bytes = this._messageQueue.reduce(function(acc, message) {
|
|
162926
163046
|
if (typeof message === "string") {
|
|
@@ -162937,38 +163057,38 @@ var DEFAULT = {
|
|
|
162937
163057
|
enumerable: true,
|
|
162938
163058
|
configurable: true
|
|
162939
163059
|
});
|
|
162940
|
-
Object.defineProperty(
|
|
163060
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "extensions", {
|
|
162941
163061
|
get: function() {
|
|
162942
163062
|
return this._ws ? this._ws.extensions : "";
|
|
162943
163063
|
},
|
|
162944
163064
|
enumerable: true,
|
|
162945
163065
|
configurable: true
|
|
162946
163066
|
});
|
|
162947
|
-
Object.defineProperty(
|
|
163067
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "protocol", {
|
|
162948
163068
|
get: function() {
|
|
162949
163069
|
return this._ws ? this._ws.protocol : "";
|
|
162950
163070
|
},
|
|
162951
163071
|
enumerable: true,
|
|
162952
163072
|
configurable: true
|
|
162953
163073
|
});
|
|
162954
|
-
Object.defineProperty(
|
|
163074
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "readyState", {
|
|
162955
163075
|
get: function() {
|
|
162956
163076
|
if (this._ws) {
|
|
162957
163077
|
return this._ws.readyState;
|
|
162958
163078
|
}
|
|
162959
|
-
return this._options.startClosed ?
|
|
163079
|
+
return this._options.startClosed ? ReconnectingWebSocket2.CLOSED : ReconnectingWebSocket2.CONNECTING;
|
|
162960
163080
|
},
|
|
162961
163081
|
enumerable: true,
|
|
162962
163082
|
configurable: true
|
|
162963
163083
|
});
|
|
162964
|
-
Object.defineProperty(
|
|
163084
|
+
Object.defineProperty(ReconnectingWebSocket2.prototype, "url", {
|
|
162965
163085
|
get: function() {
|
|
162966
163086
|
return this._ws ? this._ws.url : "";
|
|
162967
163087
|
},
|
|
162968
163088
|
enumerable: true,
|
|
162969
163089
|
configurable: true
|
|
162970
163090
|
});
|
|
162971
|
-
|
|
163091
|
+
ReconnectingWebSocket2.prototype.close = function(code2, reason) {
|
|
162972
163092
|
if (code2 === void 0) {
|
|
162973
163093
|
code2 = 1e3;
|
|
162974
163094
|
}
|
|
@@ -162985,7 +163105,7 @@ var DEFAULT = {
|
|
|
162985
163105
|
}
|
|
162986
163106
|
this._ws.close(code2, reason);
|
|
162987
163107
|
};
|
|
162988
|
-
|
|
163108
|
+
ReconnectingWebSocket2.prototype.reconnect = function(code2, reason) {
|
|
162989
163109
|
this._shouldReconnect = true;
|
|
162990
163110
|
this._closeCalled = false;
|
|
162991
163111
|
this._retryCount = -1;
|
|
@@ -162996,7 +163116,7 @@ var DEFAULT = {
|
|
|
162996
163116
|
this._connect();
|
|
162997
163117
|
}
|
|
162998
163118
|
};
|
|
162999
|
-
|
|
163119
|
+
ReconnectingWebSocket2.prototype.send = function(data) {
|
|
163000
163120
|
if (this._ws && this._ws.readyState === this.OPEN) {
|
|
163001
163121
|
this._debug("send", data);
|
|
163002
163122
|
this._ws.send(data);
|
|
@@ -163008,12 +163128,12 @@ var DEFAULT = {
|
|
|
163008
163128
|
}
|
|
163009
163129
|
}
|
|
163010
163130
|
};
|
|
163011
|
-
|
|
163131
|
+
ReconnectingWebSocket2.prototype.addEventListener = function(type, listener) {
|
|
163012
163132
|
if (this._listeners[type]) {
|
|
163013
163133
|
this._listeners[type].push(listener);
|
|
163014
163134
|
}
|
|
163015
163135
|
};
|
|
163016
|
-
|
|
163136
|
+
ReconnectingWebSocket2.prototype.dispatchEvent = function(event) {
|
|
163017
163137
|
var e_1, _a2;
|
|
163018
163138
|
var listeners2 = this._listeners[event.type];
|
|
163019
163139
|
if (listeners2) {
|
|
@@ -163036,14 +163156,14 @@ var DEFAULT = {
|
|
|
163036
163156
|
}
|
|
163037
163157
|
return true;
|
|
163038
163158
|
};
|
|
163039
|
-
|
|
163159
|
+
ReconnectingWebSocket2.prototype.removeEventListener = function(type, listener) {
|
|
163040
163160
|
if (this._listeners[type]) {
|
|
163041
163161
|
this._listeners[type] = this._listeners[type].filter(function(l2) {
|
|
163042
163162
|
return l2 !== listener;
|
|
163043
163163
|
});
|
|
163044
163164
|
}
|
|
163045
163165
|
};
|
|
163046
|
-
|
|
163166
|
+
ReconnectingWebSocket2.prototype._debug = function() {
|
|
163047
163167
|
var args = [];
|
|
163048
163168
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
163049
163169
|
args[_i] = arguments[_i];
|
|
@@ -163052,7 +163172,7 @@ var DEFAULT = {
|
|
|
163052
163172
|
console.log.apply(console, __spread(["RWS>"], args));
|
|
163053
163173
|
}
|
|
163054
163174
|
};
|
|
163055
|
-
|
|
163175
|
+
ReconnectingWebSocket2.prototype._getNextDelay = function() {
|
|
163056
163176
|
var _a2 = this._options, _b2 = _a2.reconnectionDelayGrowFactor, reconnectionDelayGrowFactor = _b2 === void 0 ? DEFAULT.reconnectionDelayGrowFactor : _b2, _c2 = _a2.minReconnectionDelay, minReconnectionDelay = _c2 === void 0 ? DEFAULT.minReconnectionDelay : _c2, _d2 = _a2.maxReconnectionDelay, maxReconnectionDelay = _d2 === void 0 ? DEFAULT.maxReconnectionDelay : _d2;
|
|
163057
163177
|
var delay = 0;
|
|
163058
163178
|
if (this._retryCount > 0) {
|
|
@@ -163064,13 +163184,13 @@ var DEFAULT = {
|
|
|
163064
163184
|
this._debug("next delay", delay);
|
|
163065
163185
|
return delay;
|
|
163066
163186
|
};
|
|
163067
|
-
|
|
163187
|
+
ReconnectingWebSocket2.prototype._wait = function() {
|
|
163068
163188
|
var _this = this;
|
|
163069
163189
|
return new Promise(function(resolve2) {
|
|
163070
163190
|
setTimeout(resolve2, _this._getNextDelay());
|
|
163071
163191
|
});
|
|
163072
163192
|
};
|
|
163073
|
-
|
|
163193
|
+
ReconnectingWebSocket2.prototype._getNextUrl = function(urlProvider) {
|
|
163074
163194
|
if (typeof urlProvider === "string") {
|
|
163075
163195
|
return Promise.resolve(urlProvider);
|
|
163076
163196
|
}
|
|
@@ -163085,7 +163205,7 @@ var DEFAULT = {
|
|
|
163085
163205
|
}
|
|
163086
163206
|
throw Error("Invalid URL");
|
|
163087
163207
|
};
|
|
163088
|
-
|
|
163208
|
+
ReconnectingWebSocket2.prototype._connect = function() {
|
|
163089
163209
|
var _this = this;
|
|
163090
163210
|
if (this._connectLock || !this._shouldReconnect) {
|
|
163091
163211
|
return;
|
|
@@ -163118,11 +163238,11 @@ var DEFAULT = {
|
|
|
163118
163238
|
}, connectionTimeout);
|
|
163119
163239
|
});
|
|
163120
163240
|
};
|
|
163121
|
-
|
|
163241
|
+
ReconnectingWebSocket2.prototype._handleTimeout = function() {
|
|
163122
163242
|
this._debug("timeout event");
|
|
163123
163243
|
this._handleError(new ErrorEvent$1(Error("TIMEOUT"), this));
|
|
163124
163244
|
};
|
|
163125
|
-
|
|
163245
|
+
ReconnectingWebSocket2.prototype._disconnect = function(code2, reason) {
|
|
163126
163246
|
if (code2 === void 0) {
|
|
163127
163247
|
code2 = 1e3;
|
|
163128
163248
|
}
|
|
@@ -163137,18 +163257,18 @@ var DEFAULT = {
|
|
|
163137
163257
|
} catch (error2) {
|
|
163138
163258
|
}
|
|
163139
163259
|
};
|
|
163140
|
-
|
|
163260
|
+
ReconnectingWebSocket2.prototype._acceptOpen = function() {
|
|
163141
163261
|
this._debug("accept open");
|
|
163142
163262
|
this._retryCount = 0;
|
|
163143
163263
|
};
|
|
163144
|
-
|
|
163264
|
+
ReconnectingWebSocket2.prototype._callEventListener = function(event, listener) {
|
|
163145
163265
|
if ("handleEvent" in listener) {
|
|
163146
163266
|
listener.handleEvent(event);
|
|
163147
163267
|
} else {
|
|
163148
163268
|
listener(event);
|
|
163149
163269
|
}
|
|
163150
163270
|
};
|
|
163151
|
-
|
|
163271
|
+
ReconnectingWebSocket2.prototype._removeListeners = function() {
|
|
163152
163272
|
if (!this._ws) {
|
|
163153
163273
|
return;
|
|
163154
163274
|
}
|
|
@@ -163158,7 +163278,7 @@ var DEFAULT = {
|
|
|
163158
163278
|
this._ws.removeEventListener("message", this._handleMessage);
|
|
163159
163279
|
this._ws.removeEventListener("error", this._handleError);
|
|
163160
163280
|
};
|
|
163161
|
-
|
|
163281
|
+
ReconnectingWebSocket2.prototype._addListeners = function() {
|
|
163162
163282
|
if (!this._ws) {
|
|
163163
163283
|
return;
|
|
163164
163284
|
}
|
|
@@ -163168,12 +163288,12 @@ var DEFAULT = {
|
|
|
163168
163288
|
this._ws.addEventListener("message", this._handleMessage);
|
|
163169
163289
|
this._ws.addEventListener("error", this._handleError);
|
|
163170
163290
|
};
|
|
163171
|
-
|
|
163291
|
+
ReconnectingWebSocket2.prototype._clearTimeouts = function() {
|
|
163172
163292
|
clearTimeout(this._connectTimeout);
|
|
163173
163293
|
clearTimeout(this._uptimeTimeout);
|
|
163174
163294
|
};
|
|
163175
|
-
return
|
|
163176
|
-
}
|
|
163295
|
+
return ReconnectingWebSocket2;
|
|
163296
|
+
}();
|
|
163177
163297
|
var lib = {};
|
|
163178
163298
|
var disposable = {};
|
|
163179
163299
|
var services = {};
|
|
@@ -174681,6 +174801,7 @@ const useValue = create$2((set) => ({
|
|
|
174681
174801
|
}));
|
|
174682
174802
|
let editor;
|
|
174683
174803
|
const EditorLayout = newStyled.div`
|
|
174804
|
+
width: 100%;
|
|
174684
174805
|
.contentWidgets {
|
|
174685
174806
|
visibility: hidden;
|
|
174686
174807
|
}
|
|
@@ -174707,6 +174828,7 @@ const EditorLayout = newStyled.div`
|
|
|
174707
174828
|
padding: 15px;
|
|
174708
174829
|
color: #fff;
|
|
174709
174830
|
font-size: 12px;
|
|
174831
|
+
flex: 0 0 auto;
|
|
174710
174832
|
}
|
|
174711
174833
|
|
|
174712
174834
|
.active {
|
|
@@ -174716,7 +174838,6 @@ const EditorLayout = newStyled.div`
|
|
|
174716
174838
|
border-right: 1px solid rgb(42 96 231); */
|
|
174717
174839
|
/* background: red; */
|
|
174718
174840
|
}
|
|
174719
|
-
|
|
174720
174841
|
}
|
|
174721
174842
|
`;
|
|
174722
174843
|
const ContentLayout = newStyled.div`
|
|
@@ -174726,7 +174847,10 @@ const ContentLayout = newStyled.div`
|
|
|
174726
174847
|
`;
|
|
174727
174848
|
const Editor = ({
|
|
174728
174849
|
doc,
|
|
174729
|
-
docType
|
|
174850
|
+
docType,
|
|
174851
|
+
containerStyle,
|
|
174852
|
+
menuStyle,
|
|
174853
|
+
editorStyle
|
|
174730
174854
|
}) => {
|
|
174731
174855
|
const divEl = react.exports.useRef(null);
|
|
174732
174856
|
react.exports.useState(doc ? doc : "");
|
|
@@ -174799,17 +174923,43 @@ const Editor = ({
|
|
|
174799
174923
|
setPosition(editor.getPosition());
|
|
174800
174924
|
let keepString = 0;
|
|
174801
174925
|
let rangeLengthamount = 0;
|
|
174926
|
+
let rangeOffsetthamount = 0;
|
|
174927
|
+
let preOffset = 0;
|
|
174802
174928
|
const valuelength = editorValue.length - changes.reduce((change, nextChange, i2) => change - nextChange.rangeLength + nextChange.text.length, 0);
|
|
174803
|
-
const operation =
|
|
174804
|
-
|
|
174805
|
-
|
|
174806
|
-
|
|
174807
|
-
|
|
174929
|
+
const operation = new TextOperation();
|
|
174930
|
+
changes.sort((change1, change2) => change1.rangeOffset - change2.rangeOffset).forEach((change, index2, _array) => {
|
|
174931
|
+
operation.retain(index2 === 0 ? change.rangeOffset : change.rangeOffset - preOffset).delete(change.rangeLength).insert(change.text);
|
|
174932
|
+
if (index2 + 1 === _array.length) {
|
|
174933
|
+
operation.retain(valuelength - change.rangeLength - change.rangeOffset);
|
|
174934
|
+
}
|
|
174935
|
+
preOffset = change.rangeOffset + change.rangeLength;
|
|
174936
|
+
rangeLengthamount += change.rangeLength;
|
|
174937
|
+
keepString += change.text.length;
|
|
174938
|
+
rangeOffsetthamount += change.rangeOffset;
|
|
174939
|
+
});
|
|
174808
174940
|
client2.applyClient(operation);
|
|
174809
174941
|
} else {
|
|
174810
174942
|
setValue(changes[0].text);
|
|
174811
174943
|
}
|
|
174812
174944
|
});
|
|
174945
|
+
editor.onDidScrollChange((evt) => {
|
|
174946
|
+
var _a2, _b2;
|
|
174947
|
+
const {
|
|
174948
|
+
userInfo
|
|
174949
|
+
} = userStore.getState();
|
|
174950
|
+
const topPercent = evt.scrollTopChanged ? (evt.scrollTop / evt.scrollHeight).toFixed(2) : 1;
|
|
174951
|
+
const leftPercent = evt.scrollLeftChanged ? (evt.scrollLeft / evt.scrollWidth).toFixed(2) : 1;
|
|
174952
|
+
const crdt = {
|
|
174953
|
+
timestamp: Date.now().toString(),
|
|
174954
|
+
userInfo: lodash$2.exports.pick(userInfo, "uuid", "role"),
|
|
174955
|
+
extend: {
|
|
174956
|
+
type: "editor-scroll",
|
|
174957
|
+
topPercent,
|
|
174958
|
+
leftPercent
|
|
174959
|
+
}
|
|
174960
|
+
};
|
|
174961
|
+
(_b2 = (_a2 = useOT.getState()) == null ? void 0 : _a2.socket) == null ? void 0 : _b2.emit("extraSync", JSON.stringify(crdt));
|
|
174962
|
+
});
|
|
174813
174963
|
editor.createContextKey("save", true);
|
|
174814
174964
|
editor.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, () => {
|
|
174815
174965
|
var _a2, _b2;
|
|
@@ -174877,7 +175027,7 @@ const Editor = ({
|
|
|
174877
175027
|
setLocalFile(doc2.path, file.value);
|
|
174878
175028
|
}
|
|
174879
175029
|
};
|
|
174880
|
-
const lspServerInject = (
|
|
175030
|
+
const lspServerInject = (_lan, disable) => {
|
|
174881
175031
|
languages.register({
|
|
174882
175032
|
id: "ruby",
|
|
174883
175033
|
extensions: [".rb"],
|
|
@@ -174893,7 +175043,45 @@ const Editor = ({
|
|
|
174893
175043
|
extensions: [".ts"],
|
|
174894
175044
|
aliases: ["TypeScript", "ts", "TS", "typescript"]
|
|
174895
175045
|
});
|
|
174896
|
-
|
|
175046
|
+
if (disable)
|
|
175047
|
+
return;
|
|
175048
|
+
lib.MonacoServices.install(monaco);
|
|
175049
|
+
const {
|
|
175050
|
+
lspUrl,
|
|
175051
|
+
ticket
|
|
175052
|
+
} = oTStore.getState().dockerInfo;
|
|
175053
|
+
if (!lspUrl)
|
|
175054
|
+
return;
|
|
175055
|
+
const webSocket = new ReconnectingWebSocket(`wss://${lspUrl}/${ticket}`, [], {
|
|
175056
|
+
maxReconnectionDelay: 1e4,
|
|
175057
|
+
minReconnectionDelay: 1e3,
|
|
175058
|
+
reconnectionDelayGrowFactor: 1.3,
|
|
175059
|
+
connectionTimeout: 1e4,
|
|
175060
|
+
maxRetries: Infinity,
|
|
175061
|
+
debug: false
|
|
175062
|
+
});
|
|
175063
|
+
lib$1.listen({
|
|
175064
|
+
webSocket,
|
|
175065
|
+
onConnection: (connection2) => {
|
|
175066
|
+
const languageClient = new lib.MonacoLanguageClient({
|
|
175067
|
+
name: "Language Client",
|
|
175068
|
+
clientOptions: {
|
|
175069
|
+
documentSelector: ["java", "ruby"],
|
|
175070
|
+
errorHandler: {
|
|
175071
|
+
error: () => lib.ErrorAction.Continue,
|
|
175072
|
+
closed: () => lib.CloseAction.DoNotRestart
|
|
175073
|
+
}
|
|
175074
|
+
},
|
|
175075
|
+
connectionProvider: {
|
|
175076
|
+
get: (errorHandler2, closeHandler) => {
|
|
175077
|
+
return Promise.resolve(lib.createConnection(connection2, errorHandler2, closeHandler));
|
|
175078
|
+
}
|
|
175079
|
+
}
|
|
175080
|
+
});
|
|
175081
|
+
const disposable2 = languageClient.start();
|
|
175082
|
+
connection2.onClose(() => disposable2.dispose());
|
|
175083
|
+
}
|
|
175084
|
+
});
|
|
174897
175085
|
};
|
|
174898
175086
|
const switchModel = (model) => {
|
|
174899
175087
|
const {
|
|
@@ -174934,13 +175122,14 @@ const Editor = ({
|
|
|
174934
175122
|
});
|
|
174935
175123
|
editor = editor$1.create(divEl.current, {
|
|
174936
175124
|
theme: "vs-dark",
|
|
175125
|
+
automaticLayout: true,
|
|
174937
175126
|
glyphMargin: true,
|
|
174938
175127
|
lightbulb: {
|
|
174939
175128
|
enabled: true
|
|
174940
175129
|
}
|
|
174941
175130
|
});
|
|
174942
|
-
lspServerInject(INIT_LANGUAGE, oTStore.getState().lspServerDisabled);
|
|
174943
175131
|
editorEventBinder();
|
|
175132
|
+
lspServerInject(INIT_LANGUAGE, oTStore.getState().lspServerDisabled);
|
|
174944
175133
|
const editorService = editor._codeEditorService;
|
|
174945
175134
|
const openEditorBase = editorService.openCodeEditor.bind(editorService);
|
|
174946
175135
|
editorService.openCodeEditor = async (input, source, workspacePath) => {
|
|
@@ -174971,6 +175160,7 @@ const Editor = ({
|
|
|
174971
175160
|
useValue.getState();
|
|
174972
175161
|
if (!CRDTInfo.editor || CRDTInfo.editor.evtType !== "Editor")
|
|
174973
175162
|
return;
|
|
175163
|
+
console.log(CRDTInfo);
|
|
174974
175164
|
if (editor && ((doc2 == null ? void 0 : doc2.path) === ((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _a2.path) || ((_b2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _b2.path) === "singleFile")) {
|
|
174975
175165
|
const server_operation = CRDTInfo.editor.operation;
|
|
174976
175166
|
const CLIENT_OPERATION = receiveOperation(CRDTInfo.editor.revision, TextOperation.fromJSON(server_operation), (_c2 = CRDTInfo == null ? void 0 : CRDTInfo.file) == null ? void 0 : _c2.path);
|
|
@@ -174986,7 +175176,7 @@ const Editor = ({
|
|
|
174986
175176
|
index2 += op;
|
|
174987
175177
|
}
|
|
174988
175178
|
if (TextOperation.isInsert(op)) {
|
|
174989
|
-
const insert = model.getPositionAt(index2);
|
|
175179
|
+
const insert = model == null ? void 0 : model.getPositionAt(index2);
|
|
174990
175180
|
const originResult = {
|
|
174991
175181
|
forceMoveMarkers: true,
|
|
174992
175182
|
range: new Range$4(insert.lineNumber, insert.column, insert.lineNumber, insert.column),
|
|
@@ -174995,8 +175185,8 @@ const Editor = ({
|
|
|
174995
175185
|
results.push(originResult);
|
|
174996
175186
|
}
|
|
174997
175187
|
if (TextOperation.isDelete(op)) {
|
|
174998
|
-
const start = model.getPositionAt(index2);
|
|
174999
|
-
const end = model.getPositionAt(index2 - op);
|
|
175188
|
+
const start = model == null ? void 0 : model.getPositionAt(index2);
|
|
175189
|
+
const end = model == null ? void 0 : model.getPositionAt(index2 - op);
|
|
175000
175190
|
results.push({
|
|
175001
175191
|
forceMoveMarkers: false,
|
|
175002
175192
|
range: new Range$4(start.lineNumber, start.column, end.lineNumber, end.column),
|
|
@@ -175006,10 +175196,23 @@ const Editor = ({
|
|
|
175006
175196
|
}
|
|
175007
175197
|
});
|
|
175008
175198
|
{
|
|
175009
|
-
model.pushEditOperations([], results, null);
|
|
175199
|
+
model == null ? void 0 : model.pushEditOperations([], results, null);
|
|
175010
175200
|
}
|
|
175011
175201
|
}
|
|
175012
175202
|
}, [OTSTATE.CRDTInfo]);
|
|
175203
|
+
react.exports.useEffect(() => {
|
|
175204
|
+
var _a2;
|
|
175205
|
+
const {
|
|
175206
|
+
CRDTInfo
|
|
175207
|
+
} = oTStore.getState();
|
|
175208
|
+
const {
|
|
175209
|
+
shadowUser
|
|
175210
|
+
} = shadowUserStore.getState();
|
|
175211
|
+
if (((_a2 = CRDTInfo == null ? void 0 : CRDTInfo.extend) == null ? void 0 : _a2.type) === "editor-scroll" && editor && shadowUser.uuid) {
|
|
175212
|
+
editor.setScrollTop(editor.getScrollHeight() * Number(CRDTInfo.extend.topPercent));
|
|
175213
|
+
editor.setScrollLeft(-(editor.getScrollWidth() * Number(CRDTInfo.extend.leftPercent)));
|
|
175214
|
+
}
|
|
175215
|
+
}, [OTSTATE.CRDTInfo.extend]);
|
|
175013
175216
|
react.exports.useEffect(() => {
|
|
175014
175217
|
var _a2, _b2;
|
|
175015
175218
|
if (!editor)
|
|
@@ -175050,10 +175253,9 @@ const Editor = ({
|
|
|
175050
175253
|
}));
|
|
175051
175254
|
});
|
|
175052
175255
|
setUsersDelta(usersDelta.map((deltaInfo) => {
|
|
175053
|
-
var _a3;
|
|
175054
175256
|
if (deltaInfo.uuid === CRDTInfo.userInfo.uuid) {
|
|
175055
175257
|
return __spreadProps(__spreadValues({}, deltaInfo), {
|
|
175056
|
-
delta: editor.deltaDecorations(deltaInfo.delta ? deltaInfo.delta : "", (
|
|
175258
|
+
delta: editor.deltaDecorations(deltaInfo.delta ? deltaInfo.delta : "", (CRDTInfo == null ? void 0 : CRDTInfo.selection).map((s2) => ({
|
|
175057
175259
|
range: new Range$4(s2[0], s2[1], s2[2], s2[3]),
|
|
175058
175260
|
options: {
|
|
175059
175261
|
isWholeLine: false,
|
|
@@ -175084,15 +175286,18 @@ const Editor = ({
|
|
|
175084
175286
|
}));
|
|
175085
175287
|
}, [OTSTATE.serverAck]);
|
|
175086
175288
|
react.exports.useEffect(() => {
|
|
175087
|
-
if (file)
|
|
175289
|
+
if ((file == null ? void 0 : file.value) === null)
|
|
175290
|
+
return;
|
|
175291
|
+
if ((file == null ? void 0 : file.path) && editor) {
|
|
175088
175292
|
const egt = /\.(\w+$)/gim.exec(file.path);
|
|
175089
175293
|
const {
|
|
175090
175294
|
CRDTInfo,
|
|
175091
175295
|
doc: doc2
|
|
175092
175296
|
} = oTStore.getState();
|
|
175093
|
-
|
|
175094
|
-
|
|
175095
|
-
|
|
175297
|
+
const {
|
|
175298
|
+
shadowUser
|
|
175299
|
+
} = shadowUserStore.getState();
|
|
175300
|
+
if (shadowUser.uuid || file.path && egt && IsMe(CRDTInfo.userInfo)) {
|
|
175096
175301
|
updateLspOps({
|
|
175097
175302
|
value: file.value,
|
|
175098
175303
|
path: file.path,
|
|
@@ -175147,22 +175352,28 @@ const Editor = ({
|
|
|
175147
175352
|
}
|
|
175148
175353
|
});
|
|
175149
175354
|
}, [USERLISTSTORE.userList, file == null ? void 0 : file.path]);
|
|
175150
|
-
return /* @__PURE__ */
|
|
175151
|
-
|
|
175152
|
-
children:
|
|
175153
|
-
|
|
175154
|
-
|
|
175155
|
-
|
|
175156
|
-
|
|
175157
|
-
|
|
175158
|
-
|
|
175159
|
-
|
|
175160
|
-
|
|
175161
|
-
|
|
175162
|
-
|
|
175163
|
-
|
|
175164
|
-
|
|
175165
|
-
|
|
175355
|
+
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
175356
|
+
name: "editor",
|
|
175357
|
+
children: /* @__PURE__ */ jsxs(EditorLayout, {
|
|
175358
|
+
style: containerStyle,
|
|
175359
|
+
className: "editor-layout flex flex-col",
|
|
175360
|
+
children: [FileTreeStack.length > 0 ? /* @__PURE__ */ jsx("ul", {
|
|
175361
|
+
style: menuStyle,
|
|
175362
|
+
className: "bg-codezone-black stack-list flex flex-row items-center flex-shrink-0",
|
|
175363
|
+
children: FileTreeStack.map((f2, index2) => /* @__PURE__ */ jsx("li", {
|
|
175364
|
+
className: `flex flex-row justify-center items-center cursor-pointer flex-grow-0 flex-shrink-0 ${f2.path === (file == null ? void 0 : file.path) ? "active" : ""}`,
|
|
175365
|
+
onClick: () => {
|
|
175366
|
+
switchModel(f2.model);
|
|
175367
|
+
},
|
|
175368
|
+
children: f2.label.substring(1)
|
|
175369
|
+
}, index2))
|
|
175370
|
+
}) : null, /* @__PURE__ */ jsx(ContentLayout, {
|
|
175371
|
+
ref: divEl,
|
|
175372
|
+
userList: userListStore.getState().userList,
|
|
175373
|
+
className: "edito-content flex-1",
|
|
175374
|
+
style: editorStyle
|
|
175375
|
+
})]
|
|
175376
|
+
})
|
|
175166
175377
|
});
|
|
175167
175378
|
};
|
|
175168
175379
|
var index$4 = /* @__PURE__ */ Object.freeze({
|
|
@@ -182263,7 +182474,7 @@ const XTerm = (_a2) => {
|
|
|
182263
182474
|
}
|
|
182264
182475
|
break;
|
|
182265
182476
|
}
|
|
182266
|
-
onKey(character2);
|
|
182477
|
+
onKey == null ? void 0 : onKey(character2);
|
|
182267
182478
|
});
|
|
182268
182479
|
};
|
|
182269
182480
|
const fitTerminal = () => {
|
|
@@ -182271,7 +182482,8 @@ const XTerm = (_a2) => {
|
|
|
182271
182482
|
setTimeout(() => {
|
|
182272
182483
|
xtermFitAddon.fit();
|
|
182273
182484
|
}, 0);
|
|
182274
|
-
} catch (
|
|
182485
|
+
} catch (err) {
|
|
182486
|
+
throw err;
|
|
182275
182487
|
}
|
|
182276
182488
|
};
|
|
182277
182489
|
react.exports.useEffect(() => {
|
|
@@ -182342,14 +182554,12 @@ const Console = (_c2) => {
|
|
|
182342
182554
|
}
|
|
182343
182555
|
}, [terminal]);
|
|
182344
182556
|
react.exports.useEffect(() => {
|
|
182557
|
+
var _a2;
|
|
182558
|
+
if (!terminal)
|
|
182559
|
+
return;
|
|
182345
182560
|
const crdt = CRDTInfo.console;
|
|
182346
|
-
if (
|
|
182347
|
-
|
|
182348
|
-
writeText(terminal, crdt.doc.value);
|
|
182349
|
-
initTerminalText(terminal, "");
|
|
182350
|
-
return;
|
|
182351
|
-
}
|
|
182352
|
-
writeText(terminal, crdt.doc.value || "");
|
|
182561
|
+
if (crdt) {
|
|
182562
|
+
writeText(terminal, ((_a2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _a2.value) || "");
|
|
182353
182563
|
}
|
|
182354
182564
|
}, [CRDTInfo.console]);
|
|
182355
182565
|
react.exports.useEffect(() => {
|
|
@@ -182357,20 +182567,22 @@ const Console = (_c2) => {
|
|
|
182357
182567
|
return;
|
|
182358
182568
|
if (dockerStatus === "STOP") {
|
|
182359
182569
|
setTimeout(() => {
|
|
182360
|
-
|
|
182570
|
+
writeText(terminal, "\r\n\u5E94\u7528\u672A\u542F\u52A8\r\n");
|
|
182361
182571
|
}, 400);
|
|
182362
182572
|
} else {
|
|
182363
182573
|
initTerminalText(terminal, "");
|
|
182364
182574
|
}
|
|
182365
182575
|
}, [dockerStatus]);
|
|
182366
|
-
return /* @__PURE__ */ jsx(
|
|
182367
|
-
|
|
182368
|
-
|
|
182369
|
-
|
|
182370
|
-
|
|
182371
|
-
|
|
182372
|
-
|
|
182373
|
-
|
|
182576
|
+
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
182577
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
182578
|
+
style: {
|
|
182579
|
+
height: "100%",
|
|
182580
|
+
width: "100%"
|
|
182581
|
+
},
|
|
182582
|
+
children: /* @__PURE__ */ jsx(XTerm, __spreadValues({
|
|
182583
|
+
terminal
|
|
182584
|
+
}, props))
|
|
182585
|
+
})
|
|
182374
182586
|
});
|
|
182375
182587
|
};
|
|
182376
182588
|
var index$3 = /* @__PURE__ */ Object.freeze({
|
|
@@ -182463,28 +182675,32 @@ const OutputBrowser = (_e2) => {
|
|
|
182463
182675
|
react.exports.useEffect(() => {
|
|
182464
182676
|
}, [iframeRef]);
|
|
182465
182677
|
const onEnterKey = (e2) => {
|
|
182678
|
+
var _a2, _b2;
|
|
182466
182679
|
if (e2.keyCode !== 13)
|
|
182467
182680
|
return;
|
|
182468
182681
|
const url22 = urlWithProtocol(e2.target.value);
|
|
182469
182682
|
setIframeSrc(url22);
|
|
182470
|
-
iframeRef.current.contentWindow.location.replace(url22);
|
|
182683
|
+
(_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(url22);
|
|
182471
182684
|
};
|
|
182472
182685
|
const onRefresh = () => {
|
|
182473
|
-
|
|
182686
|
+
var _a2, _b2;
|
|
182687
|
+
(_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(iframeSrc);
|
|
182474
182688
|
};
|
|
182475
182689
|
const onOpenInNewTab = () => {
|
|
182476
182690
|
window.open(iframeSrc);
|
|
182477
182691
|
};
|
|
182478
182692
|
react.exports.useEffect(() => {
|
|
182693
|
+
var _a2, _b2;
|
|
182479
182694
|
if (playgroundStatus === "EMPTY")
|
|
182480
182695
|
return;
|
|
182481
182696
|
if (playgroundStatus === "ACTIVE" && dockerStatus === "RUNNING") {
|
|
182482
182697
|
if (iframeSrc !== "http://" && iframeSrc !== "https://") {
|
|
182483
|
-
iframeRef.current.contentWindow.location.replace(iframeSrc);
|
|
182698
|
+
(_b2 = (_a2 = iframeRef == null ? void 0 : iframeRef.current) == null ? void 0 : _a2.contentWindow) == null ? void 0 : _b2.location.replace(iframeSrc);
|
|
182484
182699
|
}
|
|
182485
182700
|
}
|
|
182486
182701
|
}, [playgroundStatus, dockerStatus]);
|
|
182487
|
-
return /* @__PURE__ */ jsxs(
|
|
182702
|
+
return /* @__PURE__ */ jsxs(FollowLayout, {
|
|
182703
|
+
name: "browser",
|
|
182488
182704
|
children: [/* @__PURE__ */ jsxs(NavBar, {
|
|
182489
182705
|
children: [/* @__PURE__ */ jsx("i", {
|
|
182490
182706
|
className: "d42 text-xl reload cursor-pointer",
|
|
@@ -182578,13 +182794,18 @@ const TerminalComponent = (_g2) => {
|
|
|
182578
182794
|
return;
|
|
182579
182795
|
}
|
|
182580
182796
|
writeText(terminal, ((_b2 = crdt == null ? void 0 : crdt.doc) == null ? void 0 : _b2.value) || "");
|
|
182581
|
-
|
|
182797
|
+
if (!CRDTInfo.userInfo.uuid)
|
|
182798
|
+
return;
|
|
182799
|
+
const postUser = userListStore.getState().userList.find(({
|
|
182800
|
+
uuid: uuid2
|
|
182801
|
+
}) => uuid2 === CRDTInfo.userInfo.uuid);
|
|
182582
182802
|
if (postUser && !IsMe(CRDTInfo.userInfo)) {
|
|
182583
|
-
const helperContainer = terminal._core._helperContainer;
|
|
182803
|
+
const helperContainer = (_c2 = terminal == null ? void 0 : terminal._core) == null ? void 0 : _c2._helperContainer;
|
|
182804
|
+
const childNode = helperContainer == null ? void 0 : helperContainer.firstChild;
|
|
182584
182805
|
userLabel.innerText = postUser.name;
|
|
182585
182806
|
userLabel.style.backgroundColor = postUser.color;
|
|
182586
|
-
userLabel.style.top =
|
|
182587
|
-
userLabel.style.left =
|
|
182807
|
+
userLabel.style.top = childNode.style.top;
|
|
182808
|
+
userLabel.style.left = childNode.style.left;
|
|
182588
182809
|
helperContainer == null ? void 0 : helperContainer.appendChild(userLabel);
|
|
182589
182810
|
terminal.setOption("theme", __spreadProps(__spreadValues({}, terminal.getOption("theme")), {
|
|
182590
182811
|
cursor: postUser.color
|
|
@@ -182608,16 +182829,19 @@ const TerminalComponent = (_g2) => {
|
|
|
182608
182829
|
}
|
|
182609
182830
|
}
|
|
182610
182831
|
}, [CRDTInfo.terminal]);
|
|
182611
|
-
return /* @__PURE__ */ jsx(
|
|
182612
|
-
|
|
182613
|
-
|
|
182614
|
-
|
|
182615
|
-
|
|
182616
|
-
|
|
182617
|
-
|
|
182618
|
-
|
|
182619
|
-
|
|
182620
|
-
|
|
182832
|
+
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
182833
|
+
name: "terminal",
|
|
182834
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
182835
|
+
id: "terminal",
|
|
182836
|
+
style: {
|
|
182837
|
+
height: "100%",
|
|
182838
|
+
width: "100%"
|
|
182839
|
+
},
|
|
182840
|
+
children: /* @__PURE__ */ jsx(XTerm, __spreadValues({
|
|
182841
|
+
terminal,
|
|
182842
|
+
onKey
|
|
182843
|
+
}, props))
|
|
182844
|
+
})
|
|
182621
182845
|
});
|
|
182622
182846
|
};
|
|
182623
182847
|
var index$1 = /* @__PURE__ */ Object.freeze({
|
|
@@ -182638,7 +182862,7 @@ const Tabs = (_i) => {
|
|
|
182638
182862
|
return /* @__PURE__ */ jsx(Nav$1, __spreadProps(__spreadValues({}, props), {
|
|
182639
182863
|
activeKey,
|
|
182640
182864
|
onSelect,
|
|
182641
|
-
children: tabItems.map((item) => /* @__PURE__ */ jsx(Nav$1.Item, {
|
|
182865
|
+
children: tabItems == null ? void 0 : tabItems.map((item) => /* @__PURE__ */ jsx(Nav$1.Item, {
|
|
182642
182866
|
eventKey: item.eventKey,
|
|
182643
182867
|
children: item.itemName
|
|
182644
182868
|
}, item.eventKey))
|
|
@@ -183126,13 +183350,13 @@ const ToolBar = (_q) => {
|
|
|
183126
183350
|
}, [dStatus]);
|
|
183127
183351
|
const onRun = () => {
|
|
183128
183352
|
if (oTStore.getState().playgroundStatus === "ACTIVE") {
|
|
183129
|
-
io.emit("run");
|
|
183353
|
+
io == null ? void 0 : io.emit("run");
|
|
183130
183354
|
} else if (oTStore.getState().playgroundStatus === "INACTIVE") {
|
|
183131
|
-
io.emit("active");
|
|
183355
|
+
io == null ? void 0 : io.emit("active");
|
|
183132
183356
|
}
|
|
183133
183357
|
};
|
|
183134
183358
|
const onStop = () => {
|
|
183135
|
-
io.emit("stop");
|
|
183359
|
+
io == null ? void 0 : io.emit("stop");
|
|
183136
183360
|
};
|
|
183137
183361
|
const [netStatus, setNetStatus] = react.exports.useState("ONLINE");
|
|
183138
183362
|
react.exports.useEffect(() => {
|
|
@@ -183151,10 +183375,6 @@ const ToolBar = (_q) => {
|
|
|
183151
183375
|
}, 3e5);
|
|
183152
183376
|
}, []);
|
|
183153
183377
|
const getSpeedWithDownlink = () => {
|
|
183154
|
-
const connection2 = window.navigator.connection;
|
|
183155
|
-
if (connection2 && connection2.downlink) {
|
|
183156
|
-
return connection2.downlink * 1024 / 8;
|
|
183157
|
-
}
|
|
183158
183378
|
};
|
|
183159
183379
|
return /* @__PURE__ */ jsxs(ToolBarWrapper, {
|
|
183160
183380
|
children: [/* @__PURE__ */ jsx(ButtonWrapper, __spreadProps(__spreadValues({
|
|
@@ -232591,6 +232811,7 @@ const Index = (props) => {
|
|
|
232591
232811
|
};
|
|
232592
232812
|
const isFolded = useIndexState.getState().isFolded;
|
|
232593
232813
|
const playgroundInfo = oTStore((state) => state.playgroundInfo);
|
|
232814
|
+
const dockerInfo = oTStore((state) => state.dockerInfo);
|
|
232594
232815
|
const [active, setActive] = react.exports.useState("shell");
|
|
232595
232816
|
const [url2, setUrl] = react.exports.useState(playgroundInfo.url);
|
|
232596
232817
|
const {
|
|
@@ -232608,7 +232829,7 @@ const Index = (props) => {
|
|
|
232608
232829
|
}
|
|
232609
232830
|
}, [active]);
|
|
232610
232831
|
react.exports.useEffect(() => {
|
|
232611
|
-
props.replay && replay();
|
|
232832
|
+
props.replay && props.replay();
|
|
232612
232833
|
}, [props.replay]);
|
|
232613
232834
|
react.exports.useEffect(() => {
|
|
232614
232835
|
setUrl(playgroundInfo.url);
|
|
@@ -232629,7 +232850,7 @@ const Index = (props) => {
|
|
|
232629
232850
|
children: [/* @__PURE__ */ jsx(SliderComponent, {}), /* @__PURE__ */ jsx(TreeComponent, {})]
|
|
232630
232851
|
}), /* @__PURE__ */ jsx("section", {
|
|
232631
232852
|
className: "bg-codezone-black rounded-sm mx-3.5 flex-1 flex flex-col",
|
|
232632
|
-
children:
|
|
232853
|
+
children: dockerInfo.dockerId ? /* @__PURE__ */ jsx(react.exports.Suspense, {
|
|
232633
232854
|
fallback: /* @__PURE__ */ jsx(Skeleton, {
|
|
232634
232855
|
count: 10
|
|
232635
232856
|
}),
|
|
@@ -232701,8 +232922,8 @@ const HeaderComponent = () => {
|
|
|
232701
232922
|
resizable=yes,
|
|
232702
232923
|
width=500,
|
|
232703
232924
|
height=500`);
|
|
232704
|
-
minePage.addEventListener("load", () => {
|
|
232705
|
-
minePage.close();
|
|
232925
|
+
minePage == null ? void 0 : minePage.addEventListener("load", () => {
|
|
232926
|
+
minePage == null ? void 0 : minePage.close();
|
|
232706
232927
|
}, false);
|
|
232707
232928
|
}
|
|
232708
232929
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -232748,11 +232969,12 @@ const HeaderComponent = () => {
|
|
|
232748
232969
|
}) : null, appStatus !== "replay" ? /* @__PURE__ */ jsx("button", {
|
|
232749
232970
|
className: "replay-button self-center",
|
|
232750
232971
|
onClick: () => {
|
|
232972
|
+
var _a3, _b3;
|
|
232751
232973
|
if (!globalData.isRecording) {
|
|
232752
232974
|
oTStore.getState().setGlobalData({
|
|
232753
232975
|
isRecording: true
|
|
232754
232976
|
});
|
|
232755
|
-
useOT.getState().socket.emit("globalData", {
|
|
232977
|
+
(_b3 = (_a3 = useOT.getState()) == null ? void 0 : _a3.socket) == null ? void 0 : _b3.emit("globalData", {
|
|
232756
232978
|
isRecording: true
|
|
232757
232979
|
});
|
|
232758
232980
|
return;
|
|
@@ -232762,10 +232984,11 @@ const HeaderComponent = () => {
|
|
|
232762
232984
|
}) : null, globalData.isRecording ? /* @__PURE__ */ jsx("button", {
|
|
232763
232985
|
className: "replay-button self-center",
|
|
232764
232986
|
onClick: () => {
|
|
232987
|
+
var _a3, _b3;
|
|
232765
232988
|
oTStore.getState().setGlobalData({
|
|
232766
232989
|
isRecording: false
|
|
232767
232990
|
});
|
|
232768
|
-
useOT.getState().socket.emit("globalData", {
|
|
232991
|
+
(_b3 = (_a3 = useOT.getState()) == null ? void 0 : _a3.socket) == null ? void 0 : _b3.emit("globalData", {
|
|
232769
232992
|
isRecording: false
|
|
232770
232993
|
});
|
|
232771
232994
|
setAppStatus("code");
|
|
@@ -232777,6 +233000,10 @@ const HeaderComponent = () => {
|
|
|
232777
233000
|
className: "items-center flex relative",
|
|
232778
233001
|
children: userListStore.getState().userList.map((item, index2) => {
|
|
232779
233002
|
return /* @__PURE__ */ jsx("div", {
|
|
233003
|
+
onClick: () => {
|
|
233004
|
+
shadowUserStore.getState().switchShadowUser(item);
|
|
233005
|
+
console.log(shadowUserStore.getState().shadowUser);
|
|
233006
|
+
},
|
|
232780
233007
|
className: "-ml-2.5 z-0 avatar-hover",
|
|
232781
233008
|
children: /* @__PURE__ */ jsx(Avatar, {
|
|
232782
233009
|
user: item
|