@dao42/d42paas-front 0.7.33 → 0.7.34

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.
@@ -15083,16 +15083,14 @@ create$5((set2) => ({
15083
15083
  }));
15084
15084
  const shadowUserStore = create$5(persist((set2) => ({
15085
15085
  shadowUser: {},
15086
- switchShadowUser: (arg) => set2(() => {
15087
- if (arg.uuid || arg.userId) {
15088
- console.log(`\u5DF2\u5207\u6362\u81F3\u3010${arg.username}\u3011\u89C6\u89D2`);
15086
+ switchShadowUser: (id2) => set2(() => {
15087
+ let user;
15088
+ if (id2 !== void 0) {
15089
+ user = userListStore.getState().userList.find((user2) => user2.userId === id2);
15090
+ console.log(`\u5DF2\u5207\u6362\u81F3\u3010${user.username}\u3011\u89C6\u89D2`);
15089
15091
  } else {
15090
15092
  console.log(`\u5DF2\u9000\u51FA\u8DDF\u968F\u89C6\u89D2`);
15091
15093
  }
15092
- const user = userListStore.getState().userList.find((x2) => {
15093
- var _a2;
15094
- return x2.userId === ((_a2 = arg.userId) == null ? void 0 : _a2.toString());
15095
- });
15096
15094
  return {
15097
15095
  shadowUser: user ? user : {}
15098
15096
  };
@@ -28620,6 +28618,21 @@ const PlaygroundInit = (arg) => {
28620
28618
  callback && callback();
28621
28619
  }
28622
28620
  });
28621
+ io.on("dockerInfo", (data) => {
28622
+ var _a2;
28623
+ const {
28624
+ dockerInfo: dockerInfo2
28625
+ } = JSON.parse(data);
28626
+ const otPlaygroundInfo = oTStore.getState().playgroundInfo;
28627
+ if (dockerInfo2) {
28628
+ (_a2 = otPlaygroundInfo == null ? void 0 : otPlaygroundInfo.dockerInfos) == null ? void 0 : _a2.set(dockerInfo2.dockerId, dockerInfo2);
28629
+ setDockerInfo(__spreadValues(__spreadValues({}, oTStore.getState().dockerInfo), dockerInfo2));
28630
+ dockerState.getState().setDockerStatus(dockerInfo2.status);
28631
+ dockerInfo2.fileTree && switchFileTree({
28632
+ data: dockerInfo2.fileTree
28633
+ });
28634
+ }
28635
+ });
28623
28636
  io.on("playgroundStatus", (data) => {
28624
28637
  setPlaygroundStatus(data);
28625
28638
  });
@@ -44711,18 +44724,18 @@ class DaoPaaS {
44711
44724
  callback && callback();
44712
44725
  };
44713
44726
  }
44714
- followUser(userInfo, callback) {
44727
+ followUser(userId, callback) {
44715
44728
  const {
44716
44729
  switchShadowUser
44717
44730
  } = shadowUserStore.getState();
44718
- switchShadowUser(userInfo);
44719
- callback && callback();
44731
+ switchShadowUser(userId);
44732
+ callback && callback(this.userList.find((u2) => u2.userId === userId));
44720
44733
  }
44721
44734
  unFollowUser(userInfo, callback) {
44722
44735
  const {
44723
44736
  switchShadowUser
44724
44737
  } = shadowUserStore.getState();
44725
- switchShadowUser({});
44738
+ switchShadowUser();
44726
44739
  callback && callback();
44727
44740
  }
44728
44741
  replay(arg) {
@@ -46111,7 +46124,7 @@ var TreeItemRenamingInput = function(props2) {
46111
46124
  environment.setActiveTree(treeId);
46112
46125
  });
46113
46126
  };
46114
- var confirm = function() {
46127
+ var confirm2 = function() {
46115
46128
  var _a3;
46116
46129
  (_a3 = environment.onRenameItem) === null || _a3 === void 0 ? void 0 : _a3.call(environment, item, title, treeInformation.treeId);
46117
46130
  setRenamingItem(null);
@@ -46146,13 +46159,13 @@ var TreeItemRenamingInput = function(props2) {
46146
46159
  var submitButtonProps = {
46147
46160
  onClick: function(e2) {
46148
46161
  e2.stopPropagation();
46149
- confirm();
46162
+ confirm2();
46150
46163
  }
46151
46164
  };
46152
46165
  var formProps = {
46153
46166
  onSubmit: function(e2) {
46154
46167
  e2.preventDefault();
46155
- confirm();
46168
+ confirm2();
46156
46169
  }
46157
46170
  };
46158
46171
  return renderers.renderRenameInput({
@@ -48271,6 +48284,9 @@ Transition.Child = function Child(props2) {
48271
48284
  return !hasTransitionContext && hasOpenClosedContext ? /* @__PURE__ */ jsx(Transition, __spreadValues({}, Object.assign({}, props2))) : /* @__PURE__ */ jsx(TransitionChild, __spreadValues({}, Object.assign({}, props2)));
48272
48285
  };
48273
48286
  Transition.Root = Transition;
48287
+ const checkIfTheFileHasDeleted = (fileTree, value) => {
48288
+ return !JSON.stringify(fileTree).includes(value);
48289
+ };
48274
48290
  const IoClient = function(revision) {
48275
48291
  this.revision = revision;
48276
48292
  this.state = synchronized_;
@@ -48404,25 +48420,25 @@ const FollowLayout = ({
48404
48420
  if (!(shadowUser == null ? void 0 : shadowUser.uuid))
48405
48421
  return;
48406
48422
  setAsyncType(void 0);
48407
- switchShadowUser({});
48423
+ switchShadowUser(void 0);
48408
48424
  },
48409
48425
  onKeyDown: () => {
48410
48426
  if (!(shadowUser == null ? void 0 : shadowUser.uuid))
48411
48427
  return;
48412
48428
  setAsyncType(void 0);
48413
- switchShadowUser({});
48429
+ switchShadowUser(void 0);
48414
48430
  },
48415
48431
  onScroll: () => {
48416
48432
  if (!(shadowUser == null ? void 0 : shadowUser.uuid))
48417
48433
  return;
48418
48434
  setAsyncType(void 0);
48419
- switchShadowUser({});
48435
+ switchShadowUser(void 0);
48420
48436
  },
48421
48437
  onWheel: () => {
48422
48438
  if (!(shadowUser == null ? void 0 : shadowUser.uuid))
48423
48439
  return;
48424
48440
  setAsyncType(void 0);
48425
- switchShadowUser({});
48441
+ switchShadowUser(void 0);
48426
48442
  },
48427
48443
  children: [oTStore.getState().appStatus === "replay" && FROZEN_CONTROL_COMPONENTS.some((d2) => d2 === name) ? /* @__PURE__ */ jsx(Freezer, {}) : null, children]
48428
48444
  });
@@ -48444,583 +48460,6 @@ const Freezer = ({
48444
48460
  }) => /* @__PURE__ */ jsx(FreezerLayout, {
48445
48461
  children
48446
48462
  });
48447
- function addChildrenArray(children, parent2) {
48448
- var _a2, _b2;
48449
- for (let i = 0; i < children.length; i++) {
48450
- if (children[i].type === "DIRECTORY") {
48451
- (_a2 = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a2.push(`${parent2.index}${children[i].name}/`);
48452
- } else {
48453
- (_b2 = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _b2.push(`${parent2.index}${children[i].name}`);
48454
- }
48455
- }
48456
- }
48457
- function formatFileToTree(data) {
48458
- if (!data)
48459
- return;
48460
- const formatData = {};
48461
- const root2 = data.name;
48462
- formatData[root2] = {
48463
- index: root2,
48464
- children: [],
48465
- hasChildren: true,
48466
- data: root2
48467
- };
48468
- addChildrenArray(data.children, formatData[root2]);
48469
- let nodeChildren = [...data.children];
48470
- let pathChildren = [...formatData[root2].children];
48471
- while (nodeChildren.length) {
48472
- const size2 = nodeChildren.length;
48473
- for (let i = 0; i < size2; i++) {
48474
- const child = nodeChildren.shift();
48475
- const path2 = pathChildren.shift();
48476
- nodeChildren = nodeChildren.concat(child.children);
48477
- switch (child.type) {
48478
- case "DIRECTORY":
48479
- const dirPath = path2;
48480
- formatData[dirPath] = {
48481
- index: dirPath,
48482
- hasChildren: true,
48483
- children: [],
48484
- data: child.name
48485
- };
48486
- addChildrenArray(child.children, formatData[dirPath]);
48487
- pathChildren = pathChildren.concat(formatData[dirPath].children);
48488
- break;
48489
- case "FILE":
48490
- const filePath = path2;
48491
- formatData[filePath] = {
48492
- index: filePath,
48493
- hasChildren: false,
48494
- data: child.name
48495
- };
48496
- break;
48497
- }
48498
- }
48499
- }
48500
- return formatData;
48501
- }
48502
- const getStringFromFile = async (file) => {
48503
- const base64String = await new Promise((resolve2) => {
48504
- const reader2 = new FileReader();
48505
- reader2.readAsDataURL(file);
48506
- reader2.onload = (e2) => {
48507
- resolve2(e2.target.result);
48508
- };
48509
- });
48510
- return base64String;
48511
- };
48512
- const FileTree = ({
48513
- onCustomSelect
48514
- }) => {
48515
- const addedFolder = {
48516
- target: "",
48517
- files: []
48518
- };
48519
- const io = useOT.getState().socket;
48520
- const [focusedItem, setFocusedItem] = react.exports.useState();
48521
- const [expandedItems, setExpandedItems] = react.exports.useState([]);
48522
- const [selectedItems, setSelectedItems] = react.exports.useState([]);
48523
- const [remoteUserList, setRemoteUserList] = react.exports.useState({});
48524
- const [renameItem, setRenameItem] = react.exports.useState("");
48525
- const [renameValue, setRenameValue] = react.exports.useState("");
48526
- const treeRef = react.exports.useRef(null);
48527
- const {
48528
- CRDTInfo: CRDTInfo2,
48529
- dockerInfo: dockerInfo2
48530
- } = oTStore((state2) => state2);
48531
- const {
48532
- fileTree
48533
- } = fileTreeStore((state2) => state2);
48534
- const [treeData, setTreeData] = react.exports.useState({});
48535
- react.exports.useEffect(() => {
48536
- if (oTStore.getState().appStatus === "replay") {
48537
- setSelectedItems([]);
48538
- setExpandedItems([]);
48539
- }
48540
- if (!fileTree.data)
48541
- return;
48542
- const newData = formatFileToTree(fileTree == null ? void 0 : fileTree.data);
48543
- setSelectedItems(selectedItems.filter((item) => newData[item]));
48544
- setExpandedItems(expandedItems.filter((item) => newData[item]));
48545
- setTreeData(newData);
48546
- }, [fileTree]);
48547
- react.exports.useEffect(() => {
48548
- setSelectedItems([]);
48549
- setExpandedItems([]);
48550
- }, [dockerInfo2]);
48551
- const onSelect = (items) => {
48552
- if (items.length === 1) {
48553
- setSelectedItems(items);
48554
- if (oTStore.getState().appStatus === "code") {
48555
- const crdt = {
48556
- timestamp: Date.now(),
48557
- userInfo: userStore.getState().userInfo,
48558
- editor: {
48559
- extraInfo: {
48560
- messageId: "1",
48561
- playgroundId: oTStore.getState().playgroundInfo.playgroundId
48562
- },
48563
- evtType: "File"
48564
- },
48565
- file: {
48566
- action: "Get",
48567
- path: items[0]
48568
- }
48569
- };
48570
- io == null ? void 0 : io.emit("fileContent", JSON.stringify(crdt));
48571
- }
48572
- }
48573
- };
48574
- const onExpand = (item) => {
48575
- setExpandedItems([...expandedItems, item]);
48576
- };
48577
- const onCollapse = (item) => {
48578
- setExpandedItems(expandedItems.filter((expandedItemIndex) => expandedItemIndex !== item));
48579
- };
48580
- const onUploadFile = (payload) => {
48581
- io == null ? void 0 : io.emit("upload", payload);
48582
- addedFolder.target = "";
48583
- addedFolder.files = [];
48584
- };
48585
- const formatUploadFileTarget = (path2) => {
48586
- if (path2[path2.length - 1] !== "/") {
48587
- addedFolder.target = `${path2.split("/").slice(0, -1).join("/")}/`;
48588
- } else {
48589
- addedFolder.target = path2;
48590
- }
48591
- };
48592
- const traverseFileTree = async (item, path2 = "/") => {
48593
- const data = await new Promise((resolve2) => {
48594
- if (item.isFile) {
48595
- item.file(async (file) => {
48596
- resolve2([{
48597
- path: `${path2}${file.name}`,
48598
- content: await getStringFromFile(file)
48599
- }]);
48600
- });
48601
- } else if (item.isDirectory) {
48602
- let result = [{
48603
- path: `${path2}${item.name}/`,
48604
- content: ""
48605
- }];
48606
- const dirReader = item.createReader();
48607
- dirReader.readEntries(async (entries) => {
48608
- for (let i = 0; i < entries.length; i++) {
48609
- result = result.concat(await traverseFileTree(entries[i], `${path2}${item.name}/`));
48610
- }
48611
- resolve2(result);
48612
- });
48613
- }
48614
- });
48615
- return data;
48616
- };
48617
- const onOriginDrop = async (event) => {
48618
- var _a2;
48619
- event.preventDefault();
48620
- let buttonElement = event.target;
48621
- while (buttonElement && ((_a2 = buttonElement.tagName) == null ? void 0 : _a2.toLowerCase()) !== "button") {
48622
- buttonElement = buttonElement.lastChild;
48623
- }
48624
- const node2 = buttonElement ? buttonElement.dataset["rctItemId"] : "/";
48625
- formatUploadFileTarget(node2);
48626
- const items = event.dataTransfer.items;
48627
- if (items.length === 0)
48628
- return;
48629
- const itemsIterate = [];
48630
- for (const i of items) {
48631
- itemsIterate.push(i.webkitGetAsEntry());
48632
- }
48633
- for (const item of itemsIterate) {
48634
- if (item) {
48635
- addedFolder.files = addedFolder.files.concat(await traverseFileTree(item));
48636
- }
48637
- }
48638
- buttonElement == null ? void 0 : buttonElement.parentNode.classList.remove("rct-tree-item-title-container-selected");
48639
- buttonElement == null ? void 0 : buttonElement.parentNode.parentNode.classList.remove("rct-tree-item-li-selected");
48640
- onUploadFile(JSON.stringify(addedFolder));
48641
- };
48642
- react.exports.useEffect(() => {
48643
- if (treeRef.current) {
48644
- treeRef.current.removeEventListener("drop", onOriginDrop);
48645
- treeRef.current.addEventListener("drop", onOriginDrop, false);
48646
- treeRef.current.addEventListener("dragover", (e2) => {
48647
- if (e2.dataTransfer.items.length === 0)
48648
- return;
48649
- e2.preventDefault();
48650
- e2.stopPropagation();
48651
- }, false);
48652
- treeRef.current.addEventListener("dragenter", (e2) => {
48653
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
48654
- if (((_a2 = e2 == null ? void 0 : e2.dataTransfer) == null ? void 0 : _a2.items.length) === 0)
48655
- return;
48656
- e2.preventDefault();
48657
- e2.stopPropagation();
48658
- if (((_c2 = (_b2 = e2 == null ? void 0 : e2.target) == null ? void 0 : _b2.tagName) == null ? void 0 : _c2.toLowerCase()) === "button") {
48659
- (_e2 = (_d2 = e2.target) == null ? void 0 : _d2.parentNode) == null ? void 0 : _e2.classList.add("rct-tree-item-title-container-selected");
48660
- (_g2 = (_f2 = e2.target) == null ? void 0 : _f2.parentNode) == null ? void 0 : _g2.parentNode.classList.add("rct-tree-item-li-selected");
48661
- }
48662
- }, false);
48663
- treeRef.current.addEventListener("dragleave", (e2) => {
48664
- if (e2.dataTransfer.items.length === 0)
48665
- return;
48666
- e2.preventDefault();
48667
- e2.stopPropagation();
48668
- if (e2.target.tagName.toLowerCase() === "button") {
48669
- e2.target.parentNode.classList.remove("rct-tree-item-title-container-selected");
48670
- e2.target.parentNode.parentNode.classList.remove("rct-tree-item-li-selected");
48671
- }
48672
- }, false);
48673
- }
48674
- }, [treeRef]);
48675
- react.exports.useEffect(() => {
48676
- var _a2, _b2;
48677
- const user = userListStore.getState().userList.find((item) => item.uuid === CRDTInfo2.userInfo.uuid);
48678
- if (((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.editor) == null ? void 0 : _a2.evtType) === "File" && user) {
48679
- const path2 = (_b2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.file) == null ? void 0 : _b2.path;
48680
- if (!IsMe(CRDTInfo2.userInfo)) {
48681
- setRemoteUserList((oldUserListItem) => {
48682
- const userListItem = __spreadValues({}, oldUserListItem);
48683
- const remoteUserListObj = Object.entries(userListItem);
48684
- for (const iteratorItem of remoteUserListObj) {
48685
- const [key, value] = iteratorItem;
48686
- const index2 = value.findIndex((item) => item.uuid === user.uuid);
48687
- if (index2 > -1) {
48688
- userListItem[key].splice(index2, 1);
48689
- if (userListItem[key].length === 0) {
48690
- delete userListItem[key];
48691
- }
48692
- break;
48693
- }
48694
- }
48695
- if (userListItem[path2]) {
48696
- userListItem[path2].push({
48697
- uuid: user.uuid,
48698
- color: user.color,
48699
- avatar: user.avatar
48700
- });
48701
- } else {
48702
- userListItem[path2] = [{
48703
- uuid: user.uuid,
48704
- color: user.color,
48705
- avatar: user.avatar
48706
- }];
48707
- }
48708
- return userListItem;
48709
- });
48710
- if (path2[path2.length - 1] === "/") {
48711
- const index2 = expandedItems.indexOf(path2);
48712
- if (index2 === -1) {
48713
- onExpand(path2);
48714
- } else {
48715
- onCollapse(path2);
48716
- }
48717
- }
48718
- } else if (oTStore.getState().appStatus === "replay" && !ignoreReplayerStore.getState().ignoreReplayers.some((d2) => d2 === "file")) {
48719
- onSelect([path2]);
48720
- if (path2[path2.length - 1] === "/") {
48721
- const index2 = expandedItems.indexOf(path2);
48722
- if (index2 === -1) {
48723
- onExpand(path2);
48724
- } else {
48725
- onCollapse(path2);
48726
- }
48727
- }
48728
- }
48729
- }
48730
- }, [CRDTInfo2]);
48731
- const handleAddFile = (path2) => {
48732
- onExpand(path2);
48733
- if (path2[path2.length - 1] !== "/") {
48734
- path2 = `${path2.split("/").slice(0, -1).join("/")}/`;
48735
- }
48736
- setTreeData((treeData2) => {
48737
- var _a2;
48738
- const newFilePath = `${path2}${v4$1().substring(0, 6)}`;
48739
- (_a2 = treeData2[path2].children) == null ? void 0 : _a2.push(newFilePath);
48740
- treeData2[newFilePath] = {
48741
- index: newFilePath,
48742
- hasChildren: false,
48743
- data: "Untitled"
48744
- };
48745
- setRenameItem(newFilePath);
48746
- setRenameValue("");
48747
- return treeData2;
48748
- });
48749
- };
48750
- const handleAddFolder = (path2) => {
48751
- onExpand(path2);
48752
- if (path2[path2.length - 1] !== "/") {
48753
- path2 = `${path2.split("/").slice(0, -1).join("/")}/`;
48754
- }
48755
- setTreeData((treeData2) => {
48756
- var _a2;
48757
- const newFolderPath = `${path2}${v4$1().substring(0, 6)}/`;
48758
- (_a2 = treeData2[path2].children) == null ? void 0 : _a2.push(newFolderPath);
48759
- treeData2[newFolderPath] = {
48760
- index: newFolderPath,
48761
- hasChildren: true,
48762
- children: [],
48763
- data: "Untitled"
48764
- };
48765
- setRenameItem(newFolderPath);
48766
- setRenameValue("");
48767
- return treeData2;
48768
- });
48769
- };
48770
- const handleStopRenaming = (path2) => {
48771
- if (renameValue === "") {
48772
- setTreeData((treeData2) => {
48773
- delete treeData2[path2];
48774
- return treeData2;
48775
- });
48776
- }
48777
- setRenameItem("");
48778
- };
48779
- const handleSave = (treeNode, name = "") => {
48780
- const payload = {
48781
- action: "",
48782
- path: "",
48783
- newPath: ""
48784
- };
48785
- const newPath = treeNode.index.split("/");
48786
- if (treeNode.hasChildren) {
48787
- newPath.splice(-2, 1, name);
48788
- } else {
48789
- newPath.splice(-1, 1, name);
48790
- }
48791
- if (treeNode.data === "Untitled") {
48792
- payload.action = "CREATE";
48793
- payload.path = newPath.join("/");
48794
- } else {
48795
- payload.action = "RENAME";
48796
- payload.path = treeNode.index;
48797
- payload.newPath = newPath.join("/");
48798
- }
48799
- io == null ? void 0 : io.emit("fileTreeOp", JSON.stringify(payload));
48800
- };
48801
- const handleUpload = (path2, uploadType) => {
48802
- formatUploadFileTarget(path2);
48803
- document.getElementById(`manual-upload-${uploadType}`).click();
48804
- };
48805
- const handleManualUploadFile = async (files) => {
48806
- for (const item of files) {
48807
- addedFolder.files = addedFolder.files.concat([{
48808
- path: `/${item.name}`,
48809
- content: await getStringFromFile(item)
48810
- }]);
48811
- }
48812
- onUploadFile(JSON.stringify(addedFolder));
48813
- };
48814
- const handleManualUploadFolder = async (files) => {
48815
- for (const item of files) {
48816
- addedFolder.files = addedFolder.files.concat([{
48817
- path: `/${item.webkitRelativePath}`,
48818
- content: await getStringFromFile(item)
48819
- }]);
48820
- }
48821
- onUploadFile(JSON.stringify(addedFolder));
48822
- };
48823
- const handleDeleteFileFolder = (path2) => {
48824
- io == null ? void 0 : io.emit("fileTreeOp", JSON.stringify({
48825
- action: "DELETE",
48826
- path: path2
48827
- }));
48828
- };
48829
- return /* @__PURE__ */ jsx(FollowLayout, {
48830
- name: "file",
48831
- children: /* @__PURE__ */ jsxs("div", {
48832
- ref: treeRef,
48833
- style: {
48834
- height: "100%",
48835
- overflow: "auto"
48836
- },
48837
- children: [/* @__PURE__ */ jsx("input", {
48838
- id: "manual-upload-file",
48839
- type: "file",
48840
- multiple: true,
48841
- hidden: true,
48842
- onChange: (event) => {
48843
- handleManualUploadFile(event.target.files);
48844
- }
48845
- }), /* @__PURE__ */ jsx("input", {
48846
- id: "manual-upload-folder",
48847
- type: "file",
48848
- multiple: true,
48849
- hidden: true,
48850
- webkitdirectory: "",
48851
- mozdirectory: "",
48852
- directory: "",
48853
- onChange: (event) => {
48854
- handleManualUploadFolder(event.target.files);
48855
- }
48856
- }), /* @__PURE__ */ jsx(ControlledTreeEnvironment, {
48857
- canDragAndDrop: true,
48858
- canSearch: false,
48859
- items: treeData,
48860
- onFocusItem: (item) => setFocusedItem(item.index),
48861
- onExpandItem: (item) => {
48862
- onExpand(item.index);
48863
- },
48864
- onCollapseItem: (item) => {
48865
- onCollapse(item.index);
48866
- },
48867
- getItemTitle: (item) => item.data,
48868
- viewState: {
48869
- ["tree-1"]: {
48870
- focusedItem,
48871
- expandedItems,
48872
- selectedItems
48873
- }
48874
- },
48875
- onSelectItems: (items) => {
48876
- onSelect(items);
48877
- onCustomSelect == null ? void 0 : onCustomSelect(items);
48878
- },
48879
- renderItem: ({
48880
- title,
48881
- arrow,
48882
- depth,
48883
- context,
48884
- children
48885
- }) => {
48886
- return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, context.itemContainerWithChildrenProps), {
48887
- 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(" "),
48888
- children: [/* @__PURE__ */ jsxs("div", {
48889
- 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(" "),
48890
- style: {
48891
- paddingLeft: `${depth}0px`
48892
- },
48893
- children: [remoteUserList[context.interactiveElementProps["data-rct-item-id"]] && remoteUserList[context.interactiveElementProps["data-rct-item-id"]].map((remoteUser) => /* @__PURE__ */ jsx("div", {
48894
- className: "rct-tree-item-avatar rounded-full absolute border",
48895
- style: {
48896
- borderColor: remoteUser.color,
48897
- backgroundImage: `url(${remoteUser.avatar})`
48898
- }
48899
- }, remoteUser.uuid)), /* @__PURE__ */ jsxs("div", {
48900
- className: "rct-tree-item-toolbar absolute right-0",
48901
- children: [/* @__PURE__ */ jsx("button", {
48902
- onClick: () => {
48903
- handleAddFile(context.interactiveElementProps["data-rct-item-id"]);
48904
- },
48905
- children: /* @__PURE__ */ jsx("i", {
48906
- className: "d42 add-file"
48907
- })
48908
- }), /* @__PURE__ */ jsx("button", {
48909
- onClick: () => {
48910
- handleAddFolder(context.interactiveElementProps["data-rct-item-id"]);
48911
- },
48912
- children: /* @__PURE__ */ jsx("i", {
48913
- className: "d42 add-folder"
48914
- })
48915
- }), /* @__PURE__ */ jsx(Menu$2, {
48916
- as: "div",
48917
- className: "relative",
48918
- children: ({
48919
- open: open2
48920
- }) => /* @__PURE__ */ jsxs(Fragment, {
48921
- children: [/* @__PURE__ */ jsx(Menu$2.Button, {
48922
- children: /* @__PURE__ */ jsx("i", {
48923
- className: "d42 more"
48924
- })
48925
- }), /* @__PURE__ */ jsx(Transition, {
48926
- show: open2,
48927
- as: react.exports.Fragment,
48928
- enter: "transition ease-out duration-100",
48929
- enterFrom: "transform opacity-0 scale-95",
48930
- enterTo: "transform opacity-100 scale-100",
48931
- leave: "transition ease-in duration-75",
48932
- leaveFrom: "transform opacity-100 scale-100",
48933
- leaveTo: "transform opacity-0 scale-95",
48934
- children: /* @__PURE__ */ jsxs(Menu$2.Items, {
48935
- static: true,
48936
- className: "absolute z-1 w-20 right-0 top-full",
48937
- children: [/* @__PURE__ */ jsx(Menu$2.Item, {
48938
- children: /* @__PURE__ */ jsx("div", {
48939
- className: "code-dropdown-btn-item",
48940
- children: /* @__PURE__ */ jsx("button", {
48941
- className: "w-full justify-center my-2",
48942
- onClick: () => {
48943
- handleUpload(context.interactiveElementProps["data-rct-item-id"], "file");
48944
- },
48945
- children: "\u4E0A\u4F20\u6587\u4EF6"
48946
- })
48947
- })
48948
- }), /* @__PURE__ */ jsx(Menu$2.Item, {
48949
- children: /* @__PURE__ */ jsx("div", {
48950
- className: "code-dropdown-btn-item",
48951
- children: /* @__PURE__ */ jsx("button", {
48952
- className: "w-full justify-center my-2",
48953
- onClick: () => {
48954
- handleUpload(context.interactiveElementProps["data-rct-item-id"], "folder");
48955
- },
48956
- children: "\u4E0A\u4F20\u6587\u4EF6\u5939"
48957
- })
48958
- })
48959
- }), /* @__PURE__ */ jsx(Menu$2.Item, {
48960
- children: /* @__PURE__ */ jsx("div", {
48961
- className: "code-dropdown-btn-item",
48962
- children: /* @__PURE__ */ jsx("button", {
48963
- className: "w-full justify-center my-2",
48964
- onClick: () => {
48965
- setRenameValue(title.props.children);
48966
- setRenameItem(context.interactiveElementProps["data-rct-item-id"]);
48967
- },
48968
- children: "\u91CD\u547D\u540D"
48969
- })
48970
- })
48971
- }), /* @__PURE__ */ jsx(Menu$2.Item, {
48972
- children: /* @__PURE__ */ jsx("div", {
48973
- className: "code-dropdown-btn-item",
48974
- children: /* @__PURE__ */ jsx("button", {
48975
- className: "w-full justify-center text-red-800 my-2",
48976
- onClick: () => handleDeleteFileFolder(context.interactiveElementProps["data-rct-item-id"]),
48977
- children: "\u5220\u9664"
48978
- })
48979
- })
48980
- })]
48981
- })
48982
- })]
48983
- })
48984
- })]
48985
- }), arrow, renameItem === context.interactiveElementProps["data-rct-item-id"] ? /* @__PURE__ */ jsx("input", {
48986
- className: "text-black focus:outline-none active:outline-none",
48987
- type: "text",
48988
- autoFocus: true,
48989
- value: renameValue,
48990
- onInput: (event) => setRenameValue(event.target.value),
48991
- onKeyDown: (event) => {
48992
- switch (event.key) {
48993
- case "Enter":
48994
- handleStopRenaming(renameItem);
48995
- handleSave(treeData[renameItem], renameValue);
48996
- break;
48997
- case "Escape":
48998
- handleStopRenaming(renameItem);
48999
- break;
49000
- }
49001
- }
49002
- }) : /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues(__spreadValues({}, context.itemContainerWithoutChildrenProps), context.interactiveElementProps), {
49003
- 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(" "),
49004
- children: title
49005
- }))]
49006
- }), children]
49007
- }));
49008
- },
49009
- children: /* @__PURE__ */ jsx(Tree, {
49010
- treeId: "tree-1",
49011
- rootItem: "/",
49012
- treeLabel: "File Tree"
49013
- })
49014
- })]
49015
- })
49016
- });
49017
- };
49018
- var index$6 = /* @__PURE__ */ Object.freeze({
49019
- __proto__: null,
49020
- [Symbol.toStringTag]: "Module",
49021
- getStringFromFile,
49022
- FileTree
49023
- });
49024
48463
  function _format$1(message, args) {
49025
48464
  let result;
49026
48465
  if (args.length === 0) {
@@ -174461,6 +173900,649 @@ var monaco = /* @__PURE__ */ Object.freeze({
174461
173900
  editor: editor$1,
174462
173901
  languages
174463
173902
  });
173903
+ create$5((set2) => ({
173904
+ cursor: {},
173905
+ setCursor: (arg) => set2((state2) => ({ cursor: arg }))
173906
+ }));
173907
+ const editorStore = create$5((set2) => ({
173908
+ fileTreeStack: [],
173909
+ setFileTreeStack: (arg) => set2(() => ({ fileTreeStack: arg }))
173910
+ }));
173911
+ class EditorData {
173912
+ localSetFileTreeStack(arg) {
173913
+ editorStore.getState().setFileTreeStack(arg);
173914
+ }
173915
+ static get fileTreeStack() {
173916
+ const fileTreeStack = editorStore.getState().fileTreeStack;
173917
+ return fileTreeStack;
173918
+ }
173919
+ static setFileTreeStack(arg) {
173920
+ return editorStore.getState().setFileTreeStack(arg);
173921
+ }
173922
+ static updateModel({
173923
+ value,
173924
+ path: path2,
173925
+ language: language2,
173926
+ APP_DIR: APP_DIR2
173927
+ }, callback, cover = false) {
173928
+ let gotModel = editor$1.getModels().find((x2) => x2.uri.path.includes(path2));
173929
+ if (!gotModel && !!cover) {
173930
+ gotModel = editor$1.createModel(value, language2, Uri.parse(`file://${APP_DIR2}${path2}`));
173931
+ }
173932
+ const _fileTreeStack = [
173933
+ ...this.fileTreeStack,
173934
+ {
173935
+ label: path2,
173936
+ path: path2,
173937
+ model: gotModel
173938
+ }
173939
+ ];
173940
+ this.setFileTreeStack(lodash$2.exports.uniqBy(_fileTreeStack, "path"));
173941
+ if (cover) {
173942
+ gotModel == null ? void 0 : gotModel.setValue(value);
173943
+ }
173944
+ callback && callback(gotModel);
173945
+ }
173946
+ }
173947
+ __publicField(EditorData, "EditorData");
173948
+ const TreeRootLayout = newStyled.div`
173949
+ height: 100%;
173950
+ overflow: auto;
173951
+ `;
173952
+ function addChildrenArray(children, parent2) {
173953
+ var _a2, _b2;
173954
+ for (let i = 0; i < children.length; i++) {
173955
+ if (children[i].type === "DIRECTORY") {
173956
+ (_a2 = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _a2.push(`${parent2.index}${children[i].name}/`);
173957
+ } else {
173958
+ (_b2 = parent2 == null ? void 0 : parent2.children) == null ? void 0 : _b2.push(`${parent2.index}${children[i].name}`);
173959
+ }
173960
+ }
173961
+ }
173962
+ function formatFileToTree(data) {
173963
+ if (!data)
173964
+ return;
173965
+ const formatData = {};
173966
+ const root2 = data.name;
173967
+ formatData[root2] = {
173968
+ index: root2,
173969
+ children: [],
173970
+ hasChildren: true,
173971
+ data: root2
173972
+ };
173973
+ addChildrenArray(data.children, formatData[root2]);
173974
+ let nodeChildren = [...data.children];
173975
+ let pathChildren = [...formatData[root2].children];
173976
+ while (nodeChildren.length) {
173977
+ const size2 = nodeChildren.length;
173978
+ for (let i = 0; i < size2; i++) {
173979
+ const child = nodeChildren.shift();
173980
+ const path2 = pathChildren.shift();
173981
+ nodeChildren = nodeChildren.concat(child.children);
173982
+ switch (child.type) {
173983
+ case "DIRECTORY":
173984
+ const dirPath = path2;
173985
+ formatData[dirPath] = {
173986
+ index: dirPath,
173987
+ hasChildren: true,
173988
+ children: [],
173989
+ data: child.name
173990
+ };
173991
+ addChildrenArray(child.children, formatData[dirPath]);
173992
+ pathChildren = pathChildren.concat(formatData[dirPath].children);
173993
+ break;
173994
+ case "FILE":
173995
+ const filePath = path2;
173996
+ formatData[filePath] = {
173997
+ index: filePath,
173998
+ hasChildren: false,
173999
+ data: child.name
174000
+ };
174001
+ break;
174002
+ }
174003
+ }
174004
+ }
174005
+ return formatData;
174006
+ }
174007
+ const getStringFromFile = async (file) => {
174008
+ const base64String = await new Promise((resolve2) => {
174009
+ const reader2 = new FileReader();
174010
+ reader2.readAsDataURL(file);
174011
+ reader2.onload = (e2) => {
174012
+ resolve2(e2.target.result);
174013
+ };
174014
+ });
174015
+ return base64String;
174016
+ };
174017
+ const FileTree = ({
174018
+ onCustomSelect,
174019
+ className
174020
+ }) => {
174021
+ const addedFolder = {
174022
+ target: "",
174023
+ files: []
174024
+ };
174025
+ useOT.getState().socket;
174026
+ const [focusedItem, setFocusedItem] = react.exports.useState();
174027
+ const [expandedItems, setExpandedItems] = react.exports.useState([]);
174028
+ const [selectedItems, setSelectedItems] = react.exports.useState([]);
174029
+ const [remoteUserList, setRemoteUserList] = react.exports.useState({});
174030
+ const [renameItem, setRenameItem] = react.exports.useState("");
174031
+ const [renameValue, setRenameValue] = react.exports.useState("");
174032
+ const treeRef = react.exports.useRef(null);
174033
+ const {
174034
+ CRDTInfo: CRDTInfo2,
174035
+ dockerInfo: dockerInfo2
174036
+ } = oTStore((state2) => state2);
174037
+ const {
174038
+ fileTree
174039
+ } = fileTreeStore((state2) => state2);
174040
+ const [treeData, setTreeData] = react.exports.useState({});
174041
+ react.exports.useEffect(() => {
174042
+ if (oTStore.getState().appStatus === "replay") {
174043
+ setSelectedItems([]);
174044
+ setExpandedItems([]);
174045
+ }
174046
+ if (!fileTree.data)
174047
+ return;
174048
+ const newData = formatFileToTree(fileTree == null ? void 0 : fileTree.data);
174049
+ setSelectedItems(selectedItems.filter((item) => newData[item]));
174050
+ setExpandedItems(expandedItems.filter((item) => newData[item]));
174051
+ setTreeData(newData);
174052
+ }, [fileTree]);
174053
+ react.exports.useEffect(() => {
174054
+ setSelectedItems([]);
174055
+ setExpandedItems([]);
174056
+ }, [dockerInfo2]);
174057
+ const onSelect = (items) => {
174058
+ var _a2;
174059
+ if (items.length === 1) {
174060
+ setSelectedItems(items);
174061
+ if (oTStore.getState().appStatus === "code") {
174062
+ const crdt = {
174063
+ timestamp: Date.now(),
174064
+ userInfo: userStore.getState().userInfo,
174065
+ editor: {
174066
+ extraInfo: {
174067
+ messageId: "1",
174068
+ playgroundId: oTStore.getState().playgroundInfo.playgroundId
174069
+ },
174070
+ evtType: "File"
174071
+ },
174072
+ file: {
174073
+ action: "Get",
174074
+ path: items[0]
174075
+ }
174076
+ };
174077
+ (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("fileContent", JSON.stringify(crdt));
174078
+ }
174079
+ }
174080
+ };
174081
+ const onExpand = (item) => {
174082
+ setExpandedItems([...expandedItems, item]);
174083
+ };
174084
+ const onCollapse = (item) => {
174085
+ setExpandedItems(expandedItems.filter((expandedItemIndex) => expandedItemIndex !== item));
174086
+ };
174087
+ const onUploadFile = (payload) => {
174088
+ var _a2;
174089
+ console.log(payload, 213);
174090
+ (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("upload", payload);
174091
+ addedFolder.target = "";
174092
+ addedFolder.files = [];
174093
+ console.log(addedFolder, 217);
174094
+ };
174095
+ const formatUploadFileTarget = (path2) => {
174096
+ if (path2[path2.length - 1] !== "/") {
174097
+ addedFolder.target = `${path2.split("/").slice(0, -1).join("/")}/`;
174098
+ } else {
174099
+ addedFolder.target = path2;
174100
+ }
174101
+ };
174102
+ const traverseFileTree = async (item, path2 = "/") => {
174103
+ const data = await new Promise((resolve2) => {
174104
+ if (item.isFile) {
174105
+ item.file(async (file) => {
174106
+ resolve2([{
174107
+ path: `${path2}${file.name}`,
174108
+ content: await getStringFromFile(file)
174109
+ }]);
174110
+ });
174111
+ } else if (item.isDirectory) {
174112
+ let result = [{
174113
+ path: `${path2}${item.name}/`,
174114
+ content: ""
174115
+ }];
174116
+ const dirReader = item.createReader();
174117
+ dirReader.readEntries(async (entries) => {
174118
+ for (let i = 0; i < entries.length; i++) {
174119
+ result = result.concat(await traverseFileTree(entries[i], `${path2}${item.name}/`));
174120
+ }
174121
+ resolve2(result);
174122
+ });
174123
+ }
174124
+ });
174125
+ return data;
174126
+ };
174127
+ const onOriginDrop = async (event) => {
174128
+ var _a2;
174129
+ event.preventDefault();
174130
+ event.currentTarget.lastElementChild.classList.remove("root-drag-over");
174131
+ let buttonElement = event.target;
174132
+ while (buttonElement && ((_a2 = buttonElement.tagName) == null ? void 0 : _a2.toLowerCase()) !== "button") {
174133
+ buttonElement = buttonElement.lastChild;
174134
+ }
174135
+ const node2 = buttonElement ? buttonElement.dataset["rctItemId"] : "/";
174136
+ formatUploadFileTarget(node2);
174137
+ const items = event.dataTransfer.items;
174138
+ if (items.length === 0)
174139
+ return;
174140
+ const itemsIterate = [];
174141
+ for (const i of items) {
174142
+ itemsIterate.push(i.webkitGetAsEntry());
174143
+ }
174144
+ console.log("drop5", 295);
174145
+ for (const item of itemsIterate) {
174146
+ if (item) {
174147
+ addedFolder.files = addedFolder.files.concat(await traverseFileTree(item));
174148
+ }
174149
+ }
174150
+ buttonElement == null ? void 0 : buttonElement.parentNode.classList.remove("rct-tree-item-title-container-selected");
174151
+ buttonElement == null ? void 0 : buttonElement.parentNode.parentNode.classList.remove("rct-tree-item-li-selected");
174152
+ console.log("drop5", 310);
174153
+ onUploadFile(JSON.stringify(addedFolder));
174154
+ };
174155
+ react.exports.useEffect(() => {
174156
+ if (treeRef.current) {
174157
+ treeRef.current.removeEventListener("drop", onOriginDrop);
174158
+ treeRef.current.addEventListener("drop", onOriginDrop, false);
174159
+ treeRef.current.addEventListener("dragover", (e2) => {
174160
+ if (e2.dataTransfer.items.length === 0)
174161
+ return;
174162
+ e2.preventDefault();
174163
+ e2.stopPropagation();
174164
+ }, false);
174165
+ treeRef.current.addEventListener("dragenter", (e2) => {
174166
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
174167
+ if (((_a2 = e2 == null ? void 0 : e2.dataTransfer) == null ? void 0 : _a2.items.length) === 0)
174168
+ return;
174169
+ e2.preventDefault();
174170
+ e2.stopPropagation();
174171
+ console.log(e2.currentTarget.lastElementChild);
174172
+ e2.currentTarget.lastElementChild.classList.remove("root-drag-over");
174173
+ if (e2.target.classList.contains("rct-tree-root")) {
174174
+ console.log(e2.target);
174175
+ e2.target.classList.add("root-drag-over");
174176
+ }
174177
+ if (((_c2 = (_b2 = e2 == null ? void 0 : e2.target) == null ? void 0 : _b2.tagName) == null ? void 0 : _c2.toLowerCase()) === "button") {
174178
+ (_e2 = (_d2 = e2.target) == null ? void 0 : _d2.parentNode) == null ? void 0 : _e2.classList.add("rct-tree-item-title-container-selected");
174179
+ (_g2 = (_f2 = e2.target) == null ? void 0 : _f2.parentNode) == null ? void 0 : _g2.parentNode.classList.add("rct-tree-item-li-selected");
174180
+ }
174181
+ }, false);
174182
+ treeRef.current.addEventListener("dragleave", (e2) => {
174183
+ if (e2.dataTransfer.items.length === 0)
174184
+ return;
174185
+ e2.preventDefault();
174186
+ e2.stopPropagation();
174187
+ if (e2.target.tagName.toLowerCase() === "button") {
174188
+ e2.target.parentNode.classList.remove("rct-tree-item-title-container-selected");
174189
+ e2.target.parentNode.parentNode.classList.remove("rct-tree-item-li-selected");
174190
+ }
174191
+ }, false);
174192
+ }
174193
+ }, [treeRef]);
174194
+ react.exports.useEffect(() => {
174195
+ var _a2;
174196
+ const user = userListStore.getState().userList.find((item) => item.uuid === CRDTInfo2.userInfo.uuid);
174197
+ if (((_a2 = CRDTInfo2 == null ? void 0 : CRDTInfo2.editor) == null ? void 0 : _a2.evtType) === "File" && user) {
174198
+ const path2 = CRDTInfo2.file.path;
174199
+ if (!IsMe(CRDTInfo2.userInfo)) {
174200
+ setRemoteUserList((oldUserListItem) => {
174201
+ const userListItem = __spreadValues({}, oldUserListItem);
174202
+ const remoteUserListObj = Object.entries(userListItem);
174203
+ for (const iteratorItem of remoteUserListObj) {
174204
+ const [key, value] = iteratorItem;
174205
+ const index2 = value.findIndex((item) => item.uuid === user.uuid);
174206
+ if (index2 > -1) {
174207
+ userListItem[key].splice(index2, 1);
174208
+ if (userListItem[key].length === 0) {
174209
+ delete userListItem[key];
174210
+ }
174211
+ break;
174212
+ }
174213
+ }
174214
+ if (userListItem[path2]) {
174215
+ userListItem[path2].push({
174216
+ uuid: user.uuid,
174217
+ color: user.color,
174218
+ avatar: user.avatar
174219
+ });
174220
+ } else {
174221
+ userListItem[path2] = [{
174222
+ uuid: user.uuid,
174223
+ color: user.color,
174224
+ avatar: user.avatar
174225
+ }];
174226
+ }
174227
+ return userListItem;
174228
+ });
174229
+ if (path2[path2.length - 1] === "/") {
174230
+ const index2 = expandedItems.indexOf(path2);
174231
+ if (index2 === -1) {
174232
+ onExpand(path2);
174233
+ } else {
174234
+ onCollapse(path2);
174235
+ }
174236
+ }
174237
+ } else if (oTStore.getState().appStatus === "replay" && !ignoreReplayerStore.getState().ignoreReplayers.some((d2) => d2 === "file")) {
174238
+ onSelect([path2]);
174239
+ if (path2[path2.length - 1] === "/") {
174240
+ const index2 = expandedItems.indexOf(path2);
174241
+ if (index2 === -1) {
174242
+ onExpand(path2);
174243
+ } else {
174244
+ onCollapse(path2);
174245
+ }
174246
+ }
174247
+ }
174248
+ }
174249
+ }, [CRDTInfo2]);
174250
+ const handleAddFile = (path2) => {
174251
+ onExpand(path2);
174252
+ if (path2[path2.length - 1] !== "/") {
174253
+ path2 = `${path2.split("/").slice(0, -1).join("/")}/`;
174254
+ }
174255
+ setTreeData((treeData2) => {
174256
+ var _a2;
174257
+ const newFilePath = `${path2}${v4$1().substring(0, 6)}`;
174258
+ (_a2 = treeData2[path2].children) == null ? void 0 : _a2.push(newFilePath);
174259
+ treeData2[newFilePath] = {
174260
+ index: newFilePath,
174261
+ hasChildren: false,
174262
+ data: "Untitled"
174263
+ };
174264
+ setRenameItem(newFilePath);
174265
+ setRenameValue("");
174266
+ return treeData2;
174267
+ });
174268
+ };
174269
+ const handleAddFolder = (path2) => {
174270
+ onExpand(path2);
174271
+ if (path2[path2.length - 1] !== "/") {
174272
+ path2 = `${path2.split("/").slice(0, -1).join("/")}/`;
174273
+ }
174274
+ setTreeData((treeData2) => {
174275
+ var _a2;
174276
+ const newFolderPath = `${path2}${v4$1().substring(0, 6)}/`;
174277
+ (_a2 = treeData2[path2].children) == null ? void 0 : _a2.push(newFolderPath);
174278
+ treeData2[newFolderPath] = {
174279
+ index: newFolderPath,
174280
+ hasChildren: true,
174281
+ children: [],
174282
+ data: "Untitled"
174283
+ };
174284
+ setRenameItem(newFolderPath);
174285
+ setRenameValue("");
174286
+ return treeData2;
174287
+ });
174288
+ };
174289
+ const handleStopRenaming = (path2) => {
174290
+ if (renameValue === "") {
174291
+ setTreeData((treeData2) => {
174292
+ delete treeData2[path2];
174293
+ return treeData2;
174294
+ });
174295
+ }
174296
+ setRenameItem("");
174297
+ };
174298
+ const handleSave = (treeNode, name = "") => {
174299
+ var _a2;
174300
+ const payload = {
174301
+ action: "",
174302
+ path: "",
174303
+ newPath: "",
174304
+ userInfo: userStore.getState().userInfo
174305
+ };
174306
+ const newPath = treeNode.index.split("/");
174307
+ if (treeNode.hasChildren) {
174308
+ newPath.splice(-2, 1, name);
174309
+ } else {
174310
+ newPath.splice(-1, 1, name);
174311
+ }
174312
+ if (treeNode.data === "Untitled") {
174313
+ payload.action = "CREATE";
174314
+ payload.path = newPath.join("/");
174315
+ } else {
174316
+ payload.action = "RENAME";
174317
+ payload.path = treeNode.index;
174318
+ payload.newPath = newPath.join("/");
174319
+ }
174320
+ (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("fileTreeOp", JSON.stringify(payload));
174321
+ };
174322
+ const handleUpload = (path2, uploadType) => {
174323
+ formatUploadFileTarget(path2);
174324
+ document.getElementById(`manual-upload-${uploadType}`).click();
174325
+ };
174326
+ const handleManualUploadFile = async (files) => {
174327
+ for (const item of files) {
174328
+ addedFolder.files = addedFolder.files.concat([{
174329
+ path: `/${item.name}`,
174330
+ content: await getStringFromFile(item)
174331
+ }]);
174332
+ }
174333
+ onUploadFile(JSON.stringify(addedFolder));
174334
+ };
174335
+ const handleManualUploadFolder = async (files) => {
174336
+ for (const item of files) {
174337
+ addedFolder.files = addedFolder.files.concat([{
174338
+ path: `/${item.webkitRelativePath}`,
174339
+ content: await getStringFromFile(item)
174340
+ }]);
174341
+ }
174342
+ onUploadFile(JSON.stringify(addedFolder));
174343
+ };
174344
+ const handleDeleteFileFolder = (path2) => {
174345
+ var _a2;
174346
+ EditorData.setFileTreeStack(EditorData.fileTreeStack.filter((file) => file.path !== path2));
174347
+ (_a2 = useOT.getState().socket) == null ? void 0 : _a2.emit("fileTreeOp", JSON.stringify({
174348
+ action: "DELETE",
174349
+ path: path2
174350
+ }));
174351
+ oTStore.getState().switchDoc({
174352
+ value: "",
174353
+ path: "/"
174354
+ });
174355
+ };
174356
+ return /* @__PURE__ */ jsx(FollowLayout, {
174357
+ name: "file",
174358
+ children: /* @__PURE__ */ jsxs(TreeRootLayout, {
174359
+ className: `tree-root-layout ${className ? className : ""}`,
174360
+ ref: treeRef,
174361
+ children: [/* @__PURE__ */ jsx("input", {
174362
+ id: "manual-upload-file",
174363
+ type: "file",
174364
+ multiple: true,
174365
+ hidden: true,
174366
+ onChange: (event) => {
174367
+ handleManualUploadFile(event.target.files);
174368
+ }
174369
+ }), /* @__PURE__ */ jsx("input", {
174370
+ id: "manual-upload-folder",
174371
+ type: "file",
174372
+ multiple: true,
174373
+ hidden: true,
174374
+ onChange: (event) => {
174375
+ handleManualUploadFolder(event.target.files);
174376
+ }
174377
+ }), /* @__PURE__ */ jsx(ControlledTreeEnvironment, {
174378
+ canDragAndDrop: true,
174379
+ canSearch: false,
174380
+ items: treeData,
174381
+ onFocusItem: (item) => setFocusedItem(item.index),
174382
+ onExpandItem: (item) => {
174383
+ onExpand(item.index);
174384
+ },
174385
+ onCollapseItem: (item) => {
174386
+ onCollapse(item.index);
174387
+ },
174388
+ getItemTitle: (item) => item.data,
174389
+ viewState: {
174390
+ ["tree-1"]: {
174391
+ focusedItem,
174392
+ expandedItems,
174393
+ selectedItems
174394
+ }
174395
+ },
174396
+ onSelectItems: (items) => {
174397
+ onSelect(items);
174398
+ onCustomSelect == null ? void 0 : onCustomSelect(items);
174399
+ },
174400
+ renderItem: ({
174401
+ title,
174402
+ arrow,
174403
+ depth,
174404
+ context,
174405
+ children
174406
+ }) => {
174407
+ return /* @__PURE__ */ jsxs("div", __spreadProps(__spreadValues({}, context.itemContainerWithChildrenProps), {
174408
+ 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(" "),
174409
+ children: [/* @__PURE__ */ jsxs("div", {
174410
+ 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(" "),
174411
+ style: {
174412
+ paddingLeft: `${depth}0px`
174413
+ },
174414
+ children: [remoteUserList[context.interactiveElementProps["data-rct-item-id"]] && remoteUserList[context.interactiveElementProps["data-rct-item-id"]].map((remoteUser) => /* @__PURE__ */ jsx("div", {
174415
+ className: "rct-tree-item-avatar rounded-full absolute border",
174416
+ style: {
174417
+ borderColor: remoteUser.color,
174418
+ backgroundImage: `url(${remoteUser.avatar})`
174419
+ }
174420
+ }, remoteUser.uuid)), /* @__PURE__ */ jsxs("div", {
174421
+ className: "rct-tree-item-toolbar absolute right-0",
174422
+ children: [/* @__PURE__ */ jsx("button", {
174423
+ onClick: () => {
174424
+ handleAddFile(context.interactiveElementProps["data-rct-item-id"]);
174425
+ },
174426
+ children: /* @__PURE__ */ jsx("i", {
174427
+ className: "d42 add-file"
174428
+ })
174429
+ }), /* @__PURE__ */ jsx("button", {
174430
+ onClick: () => {
174431
+ handleAddFolder(context.interactiveElementProps["data-rct-item-id"]);
174432
+ },
174433
+ children: /* @__PURE__ */ jsx("i", {
174434
+ className: "d42 add-folder"
174435
+ })
174436
+ }), /* @__PURE__ */ jsx(Menu$2, {
174437
+ as: "div",
174438
+ className: "relative",
174439
+ children: ({
174440
+ open: open2
174441
+ }) => /* @__PURE__ */ jsxs(Fragment, {
174442
+ children: [/* @__PURE__ */ jsx(Menu$2.Button, {
174443
+ children: /* @__PURE__ */ jsx("i", {
174444
+ className: "d42 more"
174445
+ })
174446
+ }), /* @__PURE__ */ jsx(Transition, {
174447
+ show: open2,
174448
+ as: react.exports.Fragment,
174449
+ enter: "transition ease-out duration-100",
174450
+ enterFrom: "transform opacity-0 scale-95",
174451
+ enterTo: "transform opacity-100 scale-100",
174452
+ leave: "transition ease-in duration-75",
174453
+ leaveFrom: "transform opacity-100 scale-100",
174454
+ leaveTo: "transform opacity-0 scale-95",
174455
+ children: /* @__PURE__ */ jsxs(Menu$2.Items, {
174456
+ static: true,
174457
+ className: "absolute z-1 w-20 right-0 top-full",
174458
+ children: [/* @__PURE__ */ jsx(Menu$2.Item, {
174459
+ children: /* @__PURE__ */ jsx("div", {
174460
+ className: "code-dropdown-btn-item",
174461
+ children: /* @__PURE__ */ jsx("button", {
174462
+ className: "w-full justify-center my-2",
174463
+ onClick: () => {
174464
+ handleUpload(context.interactiveElementProps["data-rct-item-id"], "file");
174465
+ },
174466
+ children: "\u4E0A\u4F20\u6587\u4EF6"
174467
+ })
174468
+ })
174469
+ }), /* @__PURE__ */ jsx(Menu$2.Item, {
174470
+ children: /* @__PURE__ */ jsx("div", {
174471
+ className: "code-dropdown-btn-item",
174472
+ children: /* @__PURE__ */ jsx("button", {
174473
+ className: "w-full justify-center my-2",
174474
+ onClick: () => {
174475
+ handleUpload(context.interactiveElementProps["data-rct-item-id"], "folder");
174476
+ },
174477
+ children: "\u4E0A\u4F20\u6587\u4EF6\u5939"
174478
+ })
174479
+ })
174480
+ }), /* @__PURE__ */ jsx(Menu$2.Item, {
174481
+ children: /* @__PURE__ */ jsx("div", {
174482
+ className: "code-dropdown-btn-item",
174483
+ children: /* @__PURE__ */ jsx("button", {
174484
+ className: "w-full justify-center my-2",
174485
+ onClick: () => {
174486
+ var _a2;
174487
+ setRenameValue((_a2 = title == null ? void 0 : title.props) == null ? void 0 : _a2.children);
174488
+ setRenameItem(context.interactiveElementProps["data-rct-item-id"]);
174489
+ },
174490
+ children: "\u91CD\u547D\u540D"
174491
+ })
174492
+ })
174493
+ }), /* @__PURE__ */ jsx(Menu$2.Item, {
174494
+ children: /* @__PURE__ */ jsx("div", {
174495
+ className: "code-dropdown-btn-item",
174496
+ children: /* @__PURE__ */ jsx("button", {
174497
+ className: "w-full justify-center text-red-800 my-2",
174498
+ onClick: () => handleDeleteFileFolder(context.interactiveElementProps["data-rct-item-id"]),
174499
+ children: "\u5220\u9664"
174500
+ })
174501
+ })
174502
+ })]
174503
+ })
174504
+ })]
174505
+ })
174506
+ })]
174507
+ }), arrow, renameItem === context.interactiveElementProps["data-rct-item-id"] ? /* @__PURE__ */ jsx("input", {
174508
+ className: "text-black focus:outline-none active:outline-none",
174509
+ type: "text",
174510
+ autoFocus: true,
174511
+ value: renameValue,
174512
+ onInput: (event) => setRenameValue(event.target.value),
174513
+ onKeyDown: (event) => {
174514
+ switch (event.key) {
174515
+ case "Enter":
174516
+ handleStopRenaming(renameItem);
174517
+ handleSave(treeData[renameItem], renameValue);
174518
+ break;
174519
+ case "Escape":
174520
+ handleStopRenaming(renameItem);
174521
+ break;
174522
+ }
174523
+ }
174524
+ }) : /* @__PURE__ */ jsx("button", __spreadProps(__spreadValues(__spreadValues({}, context.itemContainerWithoutChildrenProps), context.interactiveElementProps), {
174525
+ 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(" "),
174526
+ children: title
174527
+ }))]
174528
+ }), children]
174529
+ }));
174530
+ },
174531
+ children: /* @__PURE__ */ jsx(Tree, {
174532
+ treeId: "tree-1",
174533
+ rootItem: "/",
174534
+ treeLabel: "File Tree"
174535
+ })
174536
+ })]
174537
+ })
174538
+ });
174539
+ };
174540
+ var index$6 = /* @__PURE__ */ Object.freeze({
174541
+ __proto__: null,
174542
+ [Symbol.toStringTag]: "Module",
174543
+ getStringFromFile,
174544
+ FileTree
174545
+ });
174464
174546
  var FExtension;
174465
174547
  (function(FExtension2) {
174466
174548
  FExtension2["erb"] = "erb";
@@ -190152,51 +190234,6 @@ class MonacoAdapter {
190152
190234
  return new Cursor(start, end);
190153
190235
  }
190154
190236
  }
190155
- create$5((set2) => ({
190156
- cursor: {},
190157
- setCursor: (arg) => set2((state2) => ({ cursor: arg }))
190158
- }));
190159
- const editorStore = create$5((set2) => ({
190160
- fileTreeStack: [],
190161
- setFileTreeStack: (arg) => set2(() => ({ fileTreeStack: arg }))
190162
- }));
190163
- class EditorData {
190164
- localSetFileTreeStack(arg) {
190165
- editorStore.getState().setFileTreeStack(arg);
190166
- }
190167
- static get fileTreeStack() {
190168
- const fileTreeStack = editorStore.getState().fileTreeStack;
190169
- return fileTreeStack;
190170
- }
190171
- static setFileTreeStack(arg) {
190172
- return editorStore.getState().setFileTreeStack(arg);
190173
- }
190174
- static updateModel({
190175
- value,
190176
- path: path2,
190177
- language: language2,
190178
- APP_DIR: APP_DIR2
190179
- }, callback, cover = false) {
190180
- let gotModel = editor$1.getModels().find((x2) => x2.uri.path.includes(path2));
190181
- if (!gotModel && !!cover) {
190182
- gotModel = editor$1.createModel(value, language2, Uri.parse(`file://${APP_DIR2}${path2}`));
190183
- }
190184
- const _fileTreeStack = [
190185
- ...this.fileTreeStack,
190186
- {
190187
- label: path2,
190188
- path: path2,
190189
- model: gotModel
190190
- }
190191
- ];
190192
- this.setFileTreeStack(lodash$2.exports.uniqBy(_fileTreeStack, "path"));
190193
- if (cover) {
190194
- gotModel == null ? void 0 : gotModel.setValue(value);
190195
- }
190196
- callback && callback(gotModel);
190197
- }
190198
- }
190199
- __publicField(EditorData, "EditorData");
190200
190237
  class ClientMeta {
190201
190238
  constructor(editor2, clientList) {
190202
190239
  __publicField(this, "clientList");
@@ -220162,7 +220199,8 @@ const Editor = ({
220162
220199
  menuStyle,
220163
220200
  editorStyle,
220164
220201
  serviceWorkerOrigin,
220165
- useLsp
220202
+ useLsp,
220203
+ className
220166
220204
  }) => {
220167
220205
  const divEl = react.exports.useRef(null);
220168
220206
  const [clientEditor, setClientEditor] = react.exports.useState(null);
@@ -220176,9 +220214,11 @@ const Editor = ({
220176
220214
  } = oTStore.getState();
220177
220215
  const CRDTInfo2 = oTStore((state2) => state2.CRDTInfo);
220178
220216
  const dockerInfo2 = oTStore((state2) => state2.dockerInfo);
220217
+ const fileTree = fileTreeStore((state2) => state2.fileTree);
220179
220218
  oTStore((state2) => state2.CRDTInfo.file);
220180
220219
  const docFile = oTStore((state2) => state2.doc);
220181
220220
  const globalData = oTStore((state2) => state2.globalData);
220221
+ const [keepVal, setKeepVal] = react.exports.useState("");
220182
220222
  const userList = userListStore((state2) => state2.userList);
220183
220223
  const userInfo = userStore((state2) => state2.userInfo);
220184
220224
  const io = useOT((state2) => state2.socket);
@@ -220242,6 +220282,7 @@ const Editor = ({
220242
220282
  const onChange = (operation) => {
220243
220283
  var _a2;
220244
220284
  const applyDoc = oTStore.getState().doc;
220285
+ console.log(clientEditor.liveOperationCode);
220245
220286
  setTimeout(() => {
220246
220287
  client.applyClient(operation);
220247
220288
  setLocalFile((applyDoc == null ? void 0 : applyDoc.path) ? applyDoc == null ? void 0 : applyDoc.path : "singleFile", {
@@ -220252,6 +220293,7 @@ const Editor = ({
220252
220293
  if ((_a2 = applyDoc == null ? void 0 : applyDoc.path) == null ? void 0 : _a2.includes("md")) {
220253
220294
  setMarkdownVal(editor.getValue());
220254
220295
  }
220296
+ setKeepVal(editor.getValue());
220255
220297
  };
220256
220298
  const onDidScroll = (evt) => {
220257
220299
  var _a2;
@@ -220407,6 +220449,28 @@ const Editor = ({
220407
220449
  enabled: true
220408
220450
  }
220409
220451
  });
220452
+ editor.onDidAttemptReadOnlyEdit(() => {
220453
+ var _a2, _b2;
220454
+ const text2 = "\u8BE5\u6587\u4EF6\u5DF2\u88AB\u5220\u9664\uFF0C\u7EE7\u7EED\u7F16\u8F91\u9700\u8981\u91CD\u65B0\u521B\u5EFA\u6B64\u6587\u4EF6\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u91CD\u65B0\u521B\u5EFA\uFF1F";
220455
+ if (confirm(text2)) {
220456
+ editor.updateOptions({
220457
+ readOnly: false
220458
+ });
220459
+ const _fileTreeStack = EditorData.fileTreeStack.map((value) => {
220460
+ return __spreadProps(__spreadValues({}, value), {
220461
+ deleted: false,
220462
+ label: value.label.replace(" has deleted", "")
220463
+ });
220464
+ });
220465
+ EditorData.setFileTreeStack(_fileTreeStack);
220466
+ const payload = {
220467
+ action: "RECORVERY",
220468
+ path: (_b2 = (_a2 = oTStore.getState()) == null ? void 0 : _a2.doc) == null ? void 0 : _b2.path,
220469
+ newPath: ""
220470
+ };
220471
+ io == null ? void 0 : io.emit("fileTreeOp", JSON.stringify(payload));
220472
+ }
220473
+ });
220410
220474
  editor$1.defineTheme("myCoolTheme", {
220411
220475
  base: "vs-dark",
220412
220476
  inherit: false,
@@ -220537,6 +220601,9 @@ const Editor = ({
220537
220601
  } = oTStore.getState();
220538
220602
  if (appStatus === "replay")
220539
220603
  return;
220604
+ if (docFile.path === "/") {
220605
+ editor.setValue("");
220606
+ }
220540
220607
  if (/\/$/.test(docFile.path))
220541
220608
  return;
220542
220609
  updateModel(docFile);
@@ -220561,6 +220628,23 @@ const Editor = ({
220561
220628
  readOnly: globalData.disableEditor
220562
220629
  });
220563
220630
  }, [globalData]);
220631
+ react.exports.useEffect(() => {
220632
+ const _fileTreeStack = EditorData.fileTreeStack.map((value) => {
220633
+ if (checkIfTheFileHasDeleted(fileTree, value.path)) {
220634
+ return __spreadProps(__spreadValues({}, value), {
220635
+ deleted: true,
220636
+ label: `${value.label} has deleted`
220637
+ });
220638
+ }
220639
+ return value;
220640
+ });
220641
+ EditorData.setFileTreeStack(_fileTreeStack);
220642
+ if ((docFile == null ? void 0 : docFile.path) && checkIfTheFileHasDeleted(fileTree, docFile.path)) {
220643
+ editor.updateOptions({
220644
+ readOnly: true
220645
+ });
220646
+ }
220647
+ }, [fileTree]);
220564
220648
  return /* @__PURE__ */ jsxs(FollowLayout, {
220565
220649
  name: "editor",
220566
220650
  children: [/* @__PURE__ */ jsx(Markdown, {
@@ -220571,7 +220655,7 @@ const Editor = ({
220571
220655
  }
220572
220656
  }), /* @__PURE__ */ jsxs(EditorLayout, {
220573
220657
  style: containerStyle,
220574
- className: "editor-layout flex flex-col",
220658
+ className: `editor-layout ${className ? className : ""} flex flex-col`,
220575
220659
  children: [/* @__PURE__ */ jsx(FileTreeStack, {
220576
220660
  editor,
220577
220661
  menuStyle,
@@ -220593,6 +220677,7 @@ const FileTreeStack = ({
220593
220677
  clearPlayground
220594
220678
  }) => {
220595
220679
  const switchDoc2 = oTStore((state2) => state2.switchDoc);
220680
+ oTStore((state2) => state2.dockerInfo);
220596
220681
  const docFile = oTStore((state2) => state2.doc);
220597
220682
  const fileTreeStack = editorStore((state2) => state2.fileTreeStack);
220598
220683
  const setFileTreeStack = editorStore((state2) => state2.setFileTreeStack);
@@ -227885,6 +227970,7 @@ const Console = (_e2) => {
227885
227970
  }, [dockerStatus]);
227886
227971
  return /* @__PURE__ */ jsx(FollowLayout, {
227887
227972
  children: /* @__PURE__ */ jsx("div", {
227973
+ className: props2.className ? props2.className : "",
227888
227974
  style: {
227889
227975
  height: "100%",
227890
227976
  width: "100%"
@@ -227951,7 +228037,11 @@ const StopMask = newStyled.div`
227951
228037
  opacity: 0.6;
227952
228038
  `;
227953
228039
  const OutputBrowser = (_g2) => {
227954
- var props2 = __objRest(_g2, []);
228040
+ var _h2 = _g2, {
228041
+ showURL = false
228042
+ } = _h2, props2 = __objRest(_h2, [
228043
+ "showURL"
228044
+ ]);
227955
228045
  var _a2;
227956
228046
  const pStatus = oTStore((state2) => state2.playgroundStatus);
227957
228047
  const dStatus = oTStore((state2) => state2.dockerStatus);
@@ -228006,7 +228096,7 @@ const OutputBrowser = (_g2) => {
228006
228096
  }, [playgroundStatus, dockerStatus]);
228007
228097
  return /* @__PURE__ */ jsxs(FollowLayout, {
228008
228098
  name: "browser",
228009
- children: [/* @__PURE__ */ jsxs(NavBar, {
228099
+ children: [showURL ? /* @__PURE__ */ jsxs(NavBar, {
228010
228100
  children: [/* @__PURE__ */ jsx("i", {
228011
228101
  className: "d42 text-xl reload cursor-pointer",
228012
228102
  onClick: onRefresh
@@ -228019,7 +228109,7 @@ const OutputBrowser = (_g2) => {
228019
228109
  className: "d42 text-xl file-copy cursor-pointer",
228020
228110
  onClick: onOpenInNewTab
228021
228111
  })]
228022
- }), dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
228112
+ }) : null, dockerStatus === "STOP" && /* @__PURE__ */ jsx(StopMask, {
228023
228113
  children: /* @__PURE__ */ jsx("span", {
228024
228114
  children: "\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"
228025
228115
  })
@@ -228038,10 +228128,10 @@ var index$2 = /* @__PURE__ */ Object.freeze({
228038
228128
  [Symbol.toStringTag]: "Module",
228039
228129
  "default": OutputBrowser
228040
228130
  });
228041
- const TerminalComponent = (_h2) => {
228042
- var _i = _h2, {
228131
+ const TerminalComponent = (_i) => {
228132
+ var _j = _i, {
228043
228133
  options
228044
- } = _i, props2 = __objRest(_i, [
228134
+ } = _j, props2 = __objRest(_j, [
228045
228135
  "options"
228046
228136
  ]);
228047
228137
  const defaultOptions2 = __spreadValues({}, options);
@@ -228161,6 +228251,7 @@ const TerminalComponent = (_h2) => {
228161
228251
  return /* @__PURE__ */ jsx(FollowLayout, {
228162
228252
  name: "terminal",
228163
228253
  children: /* @__PURE__ */ jsx("div", {
228254
+ className: props2.className ? props2.className : "",
228164
228255
  id: "terminal",
228165
228256
  style: {
228166
228257
  height: "100%",
@@ -228178,12 +228269,12 @@ var index$1 = /* @__PURE__ */ Object.freeze({
228178
228269
  [Symbol.toStringTag]: "Module",
228179
228270
  "default": TerminalComponent
228180
228271
  });
228181
- const Tabs = (_j) => {
228182
- var _k = _j, {
228272
+ const Tabs = (_k) => {
228273
+ var _l = _k, {
228183
228274
  activeKey,
228184
228275
  onSelect,
228185
228276
  tabItems
228186
- } = _k, props2 = __objRest(_k, [
228277
+ } = _l, props2 = __objRest(_l, [
228187
228278
  "activeKey",
228188
228279
  "onSelect",
228189
228280
  "tabItems"
@@ -228501,10 +228592,10 @@ const AvatarLayout = newStyled.div`
228501
228592
  border-color: ${(props2) => props2.user.color};
228502
228593
  background-image: ${(props2) => 'url("' + props2.user.avatar + '")'};
228503
228594
  `;
228504
- const Avatar = (_l) => {
228505
- var _m = _l, {
228595
+ const Avatar = (_m) => {
228596
+ var _n = _m, {
228506
228597
  user
228507
- } = _m, props2 = __objRest(_m, [
228598
+ } = _n, props2 = __objRest(_n, [
228508
228599
  "user"
228509
228600
  ]);
228510
228601
  return /* @__PURE__ */ jsx(AvatarLayout, __spreadValues({
@@ -228513,8 +228604,8 @@ const Avatar = (_l) => {
228513
228604
  }, props2));
228514
228605
  };
228515
228606
  const SkeletonThemeContext = React.createContext({});
228516
- function SkeletonTheme(_n) {
228517
- var _o = _n, { children } = _o, styleOptions = __objRest(_o, ["children"]);
228607
+ function SkeletonTheme(_o) {
228608
+ var _p = _o, { children } = _p, styleOptions = __objRest(_p, ["children"]);
228518
228609
  return React.createElement(SkeletonThemeContext.Provider, { value: styleOptions }, children);
228519
228610
  }
228520
228611
  const defaultEnableAnimation = true;
@@ -228540,8 +228631,8 @@ function styleOptionsToCssProperties({ baseColor, highlightColor, width, height,
228540
228631
  style2["--highlight-color"] = highlightColor;
228541
228632
  return style2;
228542
228633
  }
228543
- function Skeleton$1(_p) {
228544
- var _q = _p, { count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp } = _q, propsStyleOptions = __objRest(_q, ["count", "wrapper", "className", "containerClassName", "containerTestId", "circle", "style"]);
228634
+ function Skeleton$1(_q) {
228635
+ var _r = _q, { count = 1, wrapper: Wrapper, className: customClassName, containerClassName, containerTestId, circle = false, style: styleProp } = _r, propsStyleOptions = __objRest(_r, ["count", "wrapper", "className", "containerClassName", "containerTestId", "circle", "style"]);
228545
228636
  var _a2, _b2;
228546
228637
  const contextStyleOptions = React.useContext(SkeletonThemeContext);
228547
228638
  const styleOptions = __spreadProps(__spreadValues(__spreadValues({}, contextStyleOptions), propsStyleOptions), {
@@ -228664,8 +228755,8 @@ const ButtonContent = ({
228664
228755
  })()
228665
228756
  });
228666
228757
  };
228667
- const ToolBar = (_r) => {
228668
- var props2 = __objRest(_r, []);
228758
+ const ToolBar = (_s) => {
228759
+ var props2 = __objRest(_s, []);
228669
228760
  const io = useOT.getState().socket;
228670
228761
  const pStatus = oTStore((state2) => state2.playgroundStatus);
228671
228762
  const dStatus = oTStore((state2) => state2.dockerStatus);
@@ -228783,7 +228874,7 @@ const MainLayout = newStyled.div`
228783
228874
  const PreviewWrapper = newStyled.div`
228784
228875
  height: 40vh;
228785
228876
  color: #333333;
228786
- background-color: #eaeaea;
228877
+ /* background-color: #eaeaea; */
228787
228878
  `;
228788
228879
  const TermWrapper = newStyled.div`
228789
228880
  height: calc(100% - 40vh - 51px);
@@ -228869,6 +228960,7 @@ const Index = (props2) => {
228869
228960
  count: 10
228870
228961
  }),
228871
228962
  children: /* @__PURE__ */ jsx(LazyEditorComponent, {
228963
+ className: "editor-custom-style",
228872
228964
  serviceWorkerOrigin: props2.serviceWorkerOrigin,
228873
228965
  useLsp: true
228874
228966
  })