@dao42/d42paas-front 0.7.50 → 0.7.51
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 +7 -7
- package/dist/DaoPaaS.umd.js +6 -6
- package/package.json +1 -1
package/dist/DaoPaaS.es.js
CHANGED
|
@@ -174561,8 +174561,8 @@ const FileTree = ({
|
|
|
174561
174561
|
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
174562
174562
|
name: "file",
|
|
174563
174563
|
children: /* @__PURE__ */ jsxs(TreeRootLayout, {
|
|
174564
|
+
className: "tree-root-containe",
|
|
174564
174565
|
ref: treeRef,
|
|
174565
|
-
className: `tree-root-layout`,
|
|
174566
174566
|
dropBgColor,
|
|
174567
174567
|
dropTextColor,
|
|
174568
174568
|
hoverBgColor,
|
|
@@ -221035,7 +221035,7 @@ const Editor = ({
|
|
|
221035
221035
|
}), /* @__PURE__ */ jsxs(EditorLayout, {
|
|
221036
221036
|
style: containerStyle,
|
|
221037
221037
|
theme,
|
|
221038
|
-
className: `editor-
|
|
221038
|
+
className: `editor-container flex flex-col`,
|
|
221039
221039
|
children: [/* @__PURE__ */ jsx(FileTreeStack, {
|
|
221040
221040
|
editor,
|
|
221041
221041
|
menuStyle,
|
|
@@ -221044,7 +221044,7 @@ const Editor = ({
|
|
|
221044
221044
|
}), /* @__PURE__ */ jsx(ContentLayout, {
|
|
221045
221045
|
ref: divEl,
|
|
221046
221046
|
userList: userListStore.getState().userList,
|
|
221047
|
-
className: "editor-
|
|
221047
|
+
className: "editor-container flex-1",
|
|
221048
221048
|
style: editorStyle
|
|
221049
221049
|
})]
|
|
221050
221050
|
})]
|
|
@@ -221127,7 +221127,7 @@ const FileTreeStack = ({
|
|
|
221127
221127
|
menuStyle,
|
|
221128
221128
|
id: "menu-list",
|
|
221129
221129
|
ref,
|
|
221130
|
-
className: "flex flex-row
|
|
221130
|
+
className: "flex flex-row file-list-container items-center flex-shrink-0 scroll-smooth no-scrollbar overflow-x-scroll bg-codezone-black overflow-auto touch-pan-x",
|
|
221131
221131
|
children: fileTreeStack == null ? void 0 : fileTreeStack.map((f2, index2) => /* @__PURE__ */ jsxs("li", {
|
|
221132
221132
|
className: `
|
|
221133
221133
|
flex
|
|
@@ -228395,7 +228395,7 @@ const Console = (_e2) => {
|
|
|
228395
228395
|
}, [dockerStatus]);
|
|
228396
228396
|
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
228397
228397
|
children: /* @__PURE__ */ jsx("div", {
|
|
228398
|
-
className: props2.className ? props2.className : ""
|
|
228398
|
+
className: `console-container ${props2.className ? props2.className : ""}`,
|
|
228399
228399
|
style: {
|
|
228400
228400
|
height: "100%",
|
|
228401
228401
|
width: "100%"
|
|
@@ -228701,7 +228701,7 @@ const TerminalComponent = (_i) => {
|
|
|
228701
228701
|
return /* @__PURE__ */ jsx(FollowLayout, {
|
|
228702
228702
|
name: "terminal",
|
|
228703
228703
|
children: /* @__PURE__ */ jsx("div", {
|
|
228704
|
-
className:
|
|
228704
|
+
className: "terminal-container shell-container",
|
|
228705
228705
|
id: "terminal",
|
|
228706
228706
|
style: {
|
|
228707
228707
|
height: "100%",
|
|
@@ -229049,7 +229049,7 @@ const Avatar = (_m) => {
|
|
|
229049
229049
|
"user"
|
|
229050
229050
|
]);
|
|
229051
229051
|
return /* @__PURE__ */ jsx(AvatarLayout, __spreadValues({
|
|
229052
|
-
className: "rounded-full motion-safe:hover:scale-110 h-8 w-8 self-center bg-cover bg-no-repeat bg-center border-2",
|
|
229052
|
+
className: "avatar-container rounded-full motion-safe:hover:scale-110 h-8 w-8 self-center bg-cover bg-no-repeat bg-center border-2",
|
|
229053
229053
|
user
|
|
229054
229054
|
}, props2));
|
|
229055
229055
|
};
|
package/dist/DaoPaaS.umd.js
CHANGED
|
@@ -2198,7 +2198,7 @@ The flag will not be saved for the future.
|
|
|
2198
2198
|
}
|
|
2199
2199
|
}
|
|
2200
2200
|
}
|
|
2201
|
-
`;function e5e(n,e){var t,i;for(let r=0;r<n.length;r++)n[r].type==="DIRECTORY"?(t=e==null?void 0:e.children)==null||t.push(`${e.index}${n[r].name}/`):(i=e==null?void 0:e.children)==null||i.push(`${e.index}${n[r].name}`)}function oMt(n){if(!n)return;const e={},t=n.name;e[t]={index:t,children:[],hasChildren:!0,data:t},e5e(n.children,e[t]);let i=[...n.children],r=[...e[t].children];for(;i.length;){const o=i.length;for(let s=0;s<o;s++){const a=i.shift(),l=r.shift();switch(i=i.concat(a.children),a.type){case"DIRECTORY":const c=l;e[c]={index:c,hasChildren:!0,children:[],data:a.name},e5e(a.children,e[c]),r=r.concat(e[c].children);break;case"FILE":const u=l;e[u]={index:u,hasChildren:!1,data:a.name};break}}}return e}const WO=async n=>await new Promise(t=>{const i=new FileReader;i.readAsDataURL(n),i.onload=r=>{t(r.target.result)}}),t5e=({onCustomSelect:n,dropBgColor:e="pink",dropTextColor:t="black",hoverBgColor:i="rgb(37 45 124 / 80%)",hoverTextColor:r="#fff",bgColor:o="#15171c",fontColor:s="#fff",onClick:a})=>{const l={target:"",files:[]};Xr.getState().socket;const[c,u]=O.exports.useState(),[d,h]=O.exports.useState([]),[f,g]=O.exports.useState([]),[p,m]=O.exports.useState({}),[_,v]=O.exports.useState(""),[b,y]=O.exports.useState(""),w=O.exports.useRef(null),{CRDTInfo:x,dockerInfo:S}=Zt(he=>he),{fileTree:T}=MH(he=>he),[L,I]=O.exports.useState({});O.exports.useEffect(()=>{if(Zt.getState().appStatus==="replay"&&(g([]),h([])),!T.data)return;const he=oMt(T==null?void 0:T.data);g(f.filter(j=>he[j])),h(d.filter(j=>he[j])),I(he)},[T]),O.exports.useEffect(()=>{g([]),h([])},[S]);const D=he=>{var j;if(he.length===1&&(g(he),Zt.getState().appStatus==="code")){const re={timestamp:Date.now(),userInfo:xd.getState().userInfo,editor:{extraInfo:{messageId:"1",playgroundId:Zt.getState().playgroundInfo.playgroundId},evtType:"File"},file:{action:"Get",path:he[0]}};a&&a({uri:`${T.data.uri}${he[0]}`,path:he[0]}),(j=Xr.getState().socket)==null||j.emit("fileContent",JSON.stringify(re))}},N=he=>{h([...d,he])},R=he=>{h(d.filter(j=>j!==he))},z=he=>{var j;console.log(he,213),(j=Xr.getState().socket)==null||j.emit("upload",he),l.target="",l.files=[],console.log(l,217)},F=he=>{he[he.length-1]!=="/"?l.target=`${he.split("/").slice(0,-1).join("/")}/`:l.target=he},Y=async(he,j="/")=>await new Promise(ne=>{if(he.isFile)he.file(async Ae=>{ne([{path:`${j}${Ae.name}`,content:await WO(Ae)}])});else if(he.isDirectory){let Ae=[{path:`${j}${he.name}/`,content:""}];he.createReader().readEntries(async He=>{for(let nt=0;nt<He.length;nt++)Ae=Ae.concat(await Y(He[nt],`${j}${he.name}/`));ne(Ae)})}}),H=async he=>{var we;he.preventDefault(),he.currentTarget.lastElementChild.classList.remove("root-drag-over");let j=he.target;for(;j&&((we=j.tagName)==null?void 0:we.toLowerCase())!=="button";)j=j.lastChild;const re=j?j.dataset.rctItemId:"/";F(re);const ne=he.dataTransfer.items;if(ne.length===0)return;const Ae=[];for(const He of ne)Ae.push(He.webkitGetAsEntry());console.log("drop5",295);for(const He of Ae)He&&(l.files=l.files.concat(await Y(He)));j==null||j.parentNode.classList.remove("rct-tree-item-title-container-selected"),j==null||j.parentNode.parentNode.classList.remove("rct-tree-item-li-selected"),console.log("drop5",310),z(JSON.stringify(l))};O.exports.useEffect(()=>{w.current&&(w.current.removeEventListener("drop",H),w.current.addEventListener("drop",H,!1),w.current.addEventListener("dragover",he=>{he.dataTransfer.items.length!==0&&(he.preventDefault(),he.stopPropagation())},!1),w.current.addEventListener("dragenter",he=>{var j,re,ne,Ae,we,He,nt;((j=he==null?void 0:he.dataTransfer)==null?void 0:j.items.length)!==0&&(he.preventDefault(),he.stopPropagation(),console.log(he.currentTarget.lastElementChild),he.currentTarget.lastElementChild.classList.remove("root-drag-over"),he.target.classList.contains("rct-tree-root")&&(console.log(he.target),he.target.classList.add("root-drag-over")),((ne=(re=he==null?void 0:he.target)==null?void 0:re.tagName)==null?void 0:ne.toLowerCase())==="button"&&((we=(Ae=he.target)==null?void 0:Ae.parentNode)==null||we.classList.add("rct-tree-item-title-container-selected"),(nt=(He=he.target)==null?void 0:He.parentNode)==null||nt.parentNode.classList.add("rct-tree-item-li-selected")))},!1),w.current.addEventListener("dragleave",he=>{he.dataTransfer.items.length!==0&&(he.preventDefault(),he.stopPropagation(),he.target.tagName.toLowerCase()==="button"&&(he.target.parentNode.classList.remove("rct-tree-item-title-container-selected"),he.target.parentNode.parentNode.classList.remove("rct-tree-item-li-selected")))},!1))},[w]),O.exports.useEffect(()=>{var j;const he=As.getState().userList.find(re=>re.uuid===x.userInfo.uuid);if(((j=x==null?void 0:x.editor)==null?void 0:j.evtType)==="File"&&he){const re=x.file.path;Td(x.userInfo)?Zt.getState().appStatus==="replay"&&!Xw.getState().ignoreReplayers.some(ne=>ne==="file")&&(D([re]),re[re.length-1]==="/"&&(d.indexOf(re)===-1?N(re):R(re))):(m(ne=>{const Ae=Pe({},ne),we=Object.entries(Ae);for(const He of we){const[nt,Et]=He,tt=Et.findIndex(jt=>jt.uuid===he.uuid);if(tt>-1){Ae[nt].splice(tt,1),Ae[nt].length===0&&delete Ae[nt];break}}return Ae[re]?Ae[re].push({uuid:he.uuid,color:he.color,avatar:he.avatar}):Ae[re]=[{uuid:he.uuid,color:he.color,avatar:he.avatar}],Ae}),re[re.length-1]==="/"&&(d.indexOf(re)===-1?N(re):R(re)))}},[x]);const P=he=>{N(he),he[he.length-1]!=="/"&&(he=`${he.split("/").slice(0,-1).join("/")}/`),I(j=>{var ne;const re=`${he}${IH().substring(0,6)}`;return(ne=j[he].children)==null||ne.push(re),j[re]={index:re,hasChildren:!1,data:"Untitled"},v(re),y(""),j})},U=he=>{N(he),he[he.length-1]!=="/"&&(he=`${he.split("/").slice(0,-1).join("/")}/`),I(j=>{var ne;const re=`${he}${IH().substring(0,6)}/`;return(ne=j[he].children)==null||ne.push(re),j[re]={index:re,hasChildren:!0,children:[],data:"Untitled"},v(re),y(""),j})},J=he=>{b===""&&I(j=>(delete j[he],j)),v("")},M=(he,j="")=>{var Ae;const re={action:"",path:"",newPath:"",userInfo:xd.getState().userInfo},ne=he.index.split("/");he.hasChildren?ne.splice(-2,1,j):ne.splice(-1,1,j),he.data==="Untitled"?(re.action="CREATE",re.path=ne.join("/")):(re.action="RENAME",re.path=he.index,re.newPath=ne.join("/")),(Ae=Xr.getState().socket)==null||Ae.emit("fileTreeOp",JSON.stringify(re))},W=(he,j)=>{F(he),document.getElementById(`manual-upload-${j}`).click()},de=async he=>{for(const j of he)l.files=l.files.concat([{path:`/${j.name}`,content:await WO(j)}]);z(JSON.stringify(l))},ue=async he=>{for(const j of he)l.files=l.files.concat([{path:`/${j.webkitRelativePath}`,content:await WO(j)}]);z(JSON.stringify(l))},fe=he=>{var j;pf.setFileTreeStack(pf.fileTreeStack.filter(re=>re.path!==he)),(j=Xr.getState().socket)==null||j.emit("fileTreeOp",JSON.stringify({action:"DELETE",path:he})),Zt.getState().switchDoc({value:"",path:"/"})};return oe(f5,{name:"file",children:xt(rMt,{ref:w,className:"tree-root-layout",dropBgColor:e,dropTextColor:t,hoverBgColor:i,hoverTextColor:r,bgColor:o,fontColor:s,children:[oe("input",{id:"manual-upload-file",type:"file",multiple:!0,hidden:!0,onChange:he=>{de(he.target.files)}}),oe("input",{id:"manual-upload-folder",type:"file",multiple:!0,hidden:!0,onChange:he=>{ue(he.target.files)}}),oe(tmt,{canDragAndDrop:!0,canSearch:!1,items:L,onFocusItem:he=>u(he.index),onExpandItem:he=>{N(he.index)},onCollapseItem:he=>{R(he.index)},getItemTitle:he=>he.data,viewState:{["tree-1"]:{focusedItem:c,expandedItems:d,selectedItems:f}},onSelectItems:he=>{D(he),n==null||n(he)},renderItem:({title:he,arrow:j,depth:re,context:ne,children:Ae})=>{var we;return xt("div",_t(Pe({},ne.itemContainerWithChildrenProps),{className:["rct-tree-item-li",ne.isSelected?"rct-tree-item-li-selected":"",ne.isExpanded?"rct-tree-item-li-expanded":"",ne.isFocused?"rct-tree-item-li-focused":"",Ae?"rct-tree-item-li-hasChildren":""].join(" "),children:[xt("div",{className:["rct-tree-item-title-container",ne.isSelected?"rct-tree-item-title-container-selected":"",ne.isExpanded?"rct-tree-item-title-container-expanded":"",ne.isFocused?"rct-tree-item-title-container-focused":"",Ae?"rct-tree-item-title-container-hasChildren":""].join(" "),children:[p[ne.interactiveElementProps["data-rct-item-id"]]&&p[ne.interactiveElementProps["data-rct-item-id"]].map(He=>oe("div",{className:"rct-tree-item-avatar rounded-full absolute border",style:{borderColor:He.color,backgroundImage:`url(${He.avatar})`}},He.uuid)),xt("div",{className:"rct-tree-item-toolbar absolute right-0",children:[oe("button",{onClick:()=>{P(ne.interactiveElementProps["data-rct-item-id"])},children:oe("i",{className:"d42 add-file"})}),oe("button",{onClick:()=>{U(ne.interactiveElementProps["data-rct-item-id"])},children:oe("i",{className:"d42 add-folder"})}),oe(Vc,{as:"div",className:"relative",children:({open:He})=>xt(ns,{children:[oe(Vc.Button,{children:oe("i",{className:"d42 more"})}),oe(h5,{show:He,as:O.exports.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:xt(Vc.Items,{static:!0,className:"absolute z-1 w-20 right-0 top-full",children:[oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{W(ne.interactiveElementProps["data-rct-item-id"],"file")},children:"\u4E0A\u4F20\u6587\u4EF6"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{W(ne.interactiveElementProps["data-rct-item-id"],"folder")},children:"\u4E0A\u4F20\u6587\u4EF6\u5939"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{var nt;y((nt=he==null?void 0:he.props)==null?void 0:nt.children),v(ne.interactiveElementProps["data-rct-item-id"])},children:"\u91CD\u547D\u540D"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center text-red-800 my-2",onClick:()=>fe(ne.interactiveElementProps["data-rct-item-id"]),children:"\u5220\u9664"})})})]})})]})})]}),j,_===ne.interactiveElementProps["data-rct-item-id"]?oe("input",{className:"text-black focus:outline-none active:outline-none",type:"text",autoFocus:!0,value:b,onInput:He=>y(He.target.value),onKeyDown:He=>{switch(He.key){case"Enter":J(_),M(L[_],b);break;case"Escape":J(_);break}}}):xt("button",_t(Pe(Pe({},ne.itemContainerWithoutChildrenProps),ne.interactiveElementProps),{className:["rct-tree-item-button",ne.isSelected?"rct-tree-item-button-selected":"",ne.isExpanded?"rct-tree-item-button-expanded":"",ne.isFocused?"rct-tree-item-button-focused":"",Ae?"rct-tree-item-button-hasChildren":"no-child"].join(" "),children:[((we=j==null?void 0:j.props)==null?void 0:we.className.includes("rct-tree-item-arrow-hasChildren"))?oe(iMt,{className:"folder-svg"}):oe(J4e,{className:"file-svg"}),he]}))]}),Ae]}))},children:oe(wmt,{treeId:"tree-1",rootItem:"/",treeLabel:"File Tree"})})]})})};var sMt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getStringFromFile:WO,FileTree:t5e}),SJ;(function(n){n.erb="erb",n.ru="ruby",n.ejs="html",n.json="json",n.abap="abap",n.cls="apex",n.azcli="azcli",n.bat="bat",n.cmd="bat",n.c="c",n.h="c",n.mligo="cameligo",n.clj="clojure",n.cljs="clojure",n.cljc="clojure",n.edn="clojure",n.coffee="coffeescript",n.cpp="cpp",n.cc="cpp",n.cxx="cpp",n.hpp="cpp",n.hh="cpp",n.hxx="cpp",n.cs="csharp",n.csx="csharp",n.cake="csharp",n.css="css",n.dart="dart",n.dockerfile="dockerfile",n.ecl="ecl",n.fs="fsharp",n.fsi="fsharp",n.ml="fsharp",n.mli="fsharp",n.fsx="fsharp",n.fsscript="fsharp",n.go="go",n.graphql="graphql",n.gql="graphql",n.handlebars="handlebars",n.hbs="handlebars",n.tf="hcl",n.tfvars="hcl",n.hcl="hcl",n.html="html",n.htm="html",n.shtml="html",n.xhtml="html",n.mdoc="html",n.jsp="html",n.asp="html",n.aspx="html",n.jshtm="html",n.ini="ini",n.properties="ini",n.gitconfig="ini",n.java="java",n.jav="java",n.js="javascript",n.es6="javascript",n.jsx="javascript",n.mjs="javascript",n.jl="julia",n.kt="kotlin",n.less="less",n.lex="lexon",n.lua="lua",n.m3="m3",n.i3="m3",n.mg="m3",n.ig="m3",n.md="markdown",n.markdown="markdown",n.mdown="markdown",n.mkdn="markdown",n.mkd="markdown",n.mdwn="markdown",n.mdtxt="markdown",n.mdtext="markdown",n.s="mips",n.dax="msdax",n.msdax="msdax",n.m="c",n.pas="pascal",n.p="pascal",n.pp="pascal",n.ligo="pascaligo",n.pl="perl",n.php="php",n.php4="php",n.php5="php",n.phtml="php",n.ctp="php",n.dats="postiats",n.sats="postiats",n.hats="postiats",n.pq="powerquery",n.pqm="powerquery",n.ps1="powershell",n.psm1="powershell",n.psd1="powershell",n.jade="pug",n.pug="pug",n.py="python",n.rpy="python",n.pyw="python",n.cpy="python",n.gyp="python",n.gypi="python",n.r="r",n.rhistory="r",n.rmd="r",n.rprofile="r",n.rt="r",n.cshtml="razor",n.redis="redis",n.rst="restructuredtext",n.rb="ruby",n.rbx="ruby",n.rjs="ruby",n.gemspec="ruby",n.rs="rust",n.rlib="rust",n.sb="sb",n.scala="scala",n.sc="scala",n.sbt="scala",n.scm="scheme",n.ss="scheme",n.sch="scheme",n.rkt="scheme",n.scss="scss",n.sh="shell",n.bash="shell",n.aes="sophia",n.sol="sol",n.sql="sql",n.st="st",n.iecst="st",n.iecplc="st",n.lc3lib="st",n.swift="swift",n.sv="systemverilog",n.svh="systemverilog",n.tcl="tcl",n.twig="twig",n.ts="typescript",n.tsx="typescript",n.vb="vb",n.v="verilog",n.vh="verilog",n.xml="xml",n.dtd="xml",n.ascx="xml",n.csproj="xml",n.config="xml",n.wxi="xml",n.wxl="xml",n.wxs="xml",n.xaml="xml",n.svg="xml",n.svgz="xml",n.opf="xml",n.xsl="xml",n.yaml="yaml",n.yml="yaml"})(SJ||(SJ={}));const aMt=$o.div`
|
|
2201
|
+
`;function e5e(n,e){var t,i;for(let r=0;r<n.length;r++)n[r].type==="DIRECTORY"?(t=e==null?void 0:e.children)==null||t.push(`${e.index}${n[r].name}/`):(i=e==null?void 0:e.children)==null||i.push(`${e.index}${n[r].name}`)}function oMt(n){if(!n)return;const e={},t=n.name;e[t]={index:t,children:[],hasChildren:!0,data:t},e5e(n.children,e[t]);let i=[...n.children],r=[...e[t].children];for(;i.length;){const o=i.length;for(let s=0;s<o;s++){const a=i.shift(),l=r.shift();switch(i=i.concat(a.children),a.type){case"DIRECTORY":const c=l;e[c]={index:c,hasChildren:!0,children:[],data:a.name},e5e(a.children,e[c]),r=r.concat(e[c].children);break;case"FILE":const u=l;e[u]={index:u,hasChildren:!1,data:a.name};break}}}return e}const WO=async n=>await new Promise(t=>{const i=new FileReader;i.readAsDataURL(n),i.onload=r=>{t(r.target.result)}}),t5e=({onCustomSelect:n,dropBgColor:e="pink",dropTextColor:t="black",hoverBgColor:i="rgb(37 45 124 / 80%)",hoverTextColor:r="#fff",bgColor:o="#15171c",fontColor:s="#fff",onClick:a})=>{const l={target:"",files:[]};Xr.getState().socket;const[c,u]=O.exports.useState(),[d,h]=O.exports.useState([]),[f,g]=O.exports.useState([]),[p,m]=O.exports.useState({}),[_,v]=O.exports.useState(""),[b,y]=O.exports.useState(""),w=O.exports.useRef(null),{CRDTInfo:x,dockerInfo:S}=Zt(he=>he),{fileTree:T}=MH(he=>he),[L,I]=O.exports.useState({});O.exports.useEffect(()=>{if(Zt.getState().appStatus==="replay"&&(g([]),h([])),!T.data)return;const he=oMt(T==null?void 0:T.data);g(f.filter(j=>he[j])),h(d.filter(j=>he[j])),I(he)},[T]),O.exports.useEffect(()=>{g([]),h([])},[S]);const D=he=>{var j;if(he.length===1&&(g(he),Zt.getState().appStatus==="code")){const re={timestamp:Date.now(),userInfo:xd.getState().userInfo,editor:{extraInfo:{messageId:"1",playgroundId:Zt.getState().playgroundInfo.playgroundId},evtType:"File"},file:{action:"Get",path:he[0]}};a&&a({uri:`${T.data.uri}${he[0]}`,path:he[0]}),(j=Xr.getState().socket)==null||j.emit("fileContent",JSON.stringify(re))}},N=he=>{h([...d,he])},R=he=>{h(d.filter(j=>j!==he))},z=he=>{var j;console.log(he,213),(j=Xr.getState().socket)==null||j.emit("upload",he),l.target="",l.files=[],console.log(l,217)},F=he=>{he[he.length-1]!=="/"?l.target=`${he.split("/").slice(0,-1).join("/")}/`:l.target=he},Y=async(he,j="/")=>await new Promise(ne=>{if(he.isFile)he.file(async Ae=>{ne([{path:`${j}${Ae.name}`,content:await WO(Ae)}])});else if(he.isDirectory){let Ae=[{path:`${j}${he.name}/`,content:""}];he.createReader().readEntries(async He=>{for(let nt=0;nt<He.length;nt++)Ae=Ae.concat(await Y(He[nt],`${j}${he.name}/`));ne(Ae)})}}),H=async he=>{var we;he.preventDefault(),he.currentTarget.lastElementChild.classList.remove("root-drag-over");let j=he.target;for(;j&&((we=j.tagName)==null?void 0:we.toLowerCase())!=="button";)j=j.lastChild;const re=j?j.dataset.rctItemId:"/";F(re);const ne=he.dataTransfer.items;if(ne.length===0)return;const Ae=[];for(const He of ne)Ae.push(He.webkitGetAsEntry());console.log("drop5",295);for(const He of Ae)He&&(l.files=l.files.concat(await Y(He)));j==null||j.parentNode.classList.remove("rct-tree-item-title-container-selected"),j==null||j.parentNode.parentNode.classList.remove("rct-tree-item-li-selected"),console.log("drop5",310),z(JSON.stringify(l))};O.exports.useEffect(()=>{w.current&&(w.current.removeEventListener("drop",H),w.current.addEventListener("drop",H,!1),w.current.addEventListener("dragover",he=>{he.dataTransfer.items.length!==0&&(he.preventDefault(),he.stopPropagation())},!1),w.current.addEventListener("dragenter",he=>{var j,re,ne,Ae,we,He,nt;((j=he==null?void 0:he.dataTransfer)==null?void 0:j.items.length)!==0&&(he.preventDefault(),he.stopPropagation(),console.log(he.currentTarget.lastElementChild),he.currentTarget.lastElementChild.classList.remove("root-drag-over"),he.target.classList.contains("rct-tree-root")&&(console.log(he.target),he.target.classList.add("root-drag-over")),((ne=(re=he==null?void 0:he.target)==null?void 0:re.tagName)==null?void 0:ne.toLowerCase())==="button"&&((we=(Ae=he.target)==null?void 0:Ae.parentNode)==null||we.classList.add("rct-tree-item-title-container-selected"),(nt=(He=he.target)==null?void 0:He.parentNode)==null||nt.parentNode.classList.add("rct-tree-item-li-selected")))},!1),w.current.addEventListener("dragleave",he=>{he.dataTransfer.items.length!==0&&(he.preventDefault(),he.stopPropagation(),he.target.tagName.toLowerCase()==="button"&&(he.target.parentNode.classList.remove("rct-tree-item-title-container-selected"),he.target.parentNode.parentNode.classList.remove("rct-tree-item-li-selected")))},!1))},[w]),O.exports.useEffect(()=>{var j;const he=As.getState().userList.find(re=>re.uuid===x.userInfo.uuid);if(((j=x==null?void 0:x.editor)==null?void 0:j.evtType)==="File"&&he){const re=x.file.path;Td(x.userInfo)?Zt.getState().appStatus==="replay"&&!Xw.getState().ignoreReplayers.some(ne=>ne==="file")&&(D([re]),re[re.length-1]==="/"&&(d.indexOf(re)===-1?N(re):R(re))):(m(ne=>{const Ae=Pe({},ne),we=Object.entries(Ae);for(const He of we){const[nt,Et]=He,tt=Et.findIndex(jt=>jt.uuid===he.uuid);if(tt>-1){Ae[nt].splice(tt,1),Ae[nt].length===0&&delete Ae[nt];break}}return Ae[re]?Ae[re].push({uuid:he.uuid,color:he.color,avatar:he.avatar}):Ae[re]=[{uuid:he.uuid,color:he.color,avatar:he.avatar}],Ae}),re[re.length-1]==="/"&&(d.indexOf(re)===-1?N(re):R(re)))}},[x]);const P=he=>{N(he),he[he.length-1]!=="/"&&(he=`${he.split("/").slice(0,-1).join("/")}/`),I(j=>{var ne;const re=`${he}${IH().substring(0,6)}`;return(ne=j[he].children)==null||ne.push(re),j[re]={index:re,hasChildren:!1,data:"Untitled"},v(re),y(""),j})},U=he=>{N(he),he[he.length-1]!=="/"&&(he=`${he.split("/").slice(0,-1).join("/")}/`),I(j=>{var ne;const re=`${he}${IH().substring(0,6)}/`;return(ne=j[he].children)==null||ne.push(re),j[re]={index:re,hasChildren:!0,children:[],data:"Untitled"},v(re),y(""),j})},J=he=>{b===""&&I(j=>(delete j[he],j)),v("")},M=(he,j="")=>{var Ae;const re={action:"",path:"",newPath:"",userInfo:xd.getState().userInfo},ne=he.index.split("/");he.hasChildren?ne.splice(-2,1,j):ne.splice(-1,1,j),he.data==="Untitled"?(re.action="CREATE",re.path=ne.join("/")):(re.action="RENAME",re.path=he.index,re.newPath=ne.join("/")),(Ae=Xr.getState().socket)==null||Ae.emit("fileTreeOp",JSON.stringify(re))},W=(he,j)=>{F(he),document.getElementById(`manual-upload-${j}`).click()},de=async he=>{for(const j of he)l.files=l.files.concat([{path:`/${j.name}`,content:await WO(j)}]);z(JSON.stringify(l))},ue=async he=>{for(const j of he)l.files=l.files.concat([{path:`/${j.webkitRelativePath}`,content:await WO(j)}]);z(JSON.stringify(l))},fe=he=>{var j;pf.setFileTreeStack(pf.fileTreeStack.filter(re=>re.path!==he)),(j=Xr.getState().socket)==null||j.emit("fileTreeOp",JSON.stringify({action:"DELETE",path:he})),Zt.getState().switchDoc({value:"",path:"/"})};return oe(f5,{name:"file",children:xt(rMt,{className:"tree-root-containe",ref:w,dropBgColor:e,dropTextColor:t,hoverBgColor:i,hoverTextColor:r,bgColor:o,fontColor:s,children:[oe("input",{id:"manual-upload-file",type:"file",multiple:!0,hidden:!0,onChange:he=>{de(he.target.files)}}),oe("input",{id:"manual-upload-folder",type:"file",multiple:!0,hidden:!0,onChange:he=>{ue(he.target.files)}}),oe(tmt,{canDragAndDrop:!0,canSearch:!1,items:L,onFocusItem:he=>u(he.index),onExpandItem:he=>{N(he.index)},onCollapseItem:he=>{R(he.index)},getItemTitle:he=>he.data,viewState:{["tree-1"]:{focusedItem:c,expandedItems:d,selectedItems:f}},onSelectItems:he=>{D(he),n==null||n(he)},renderItem:({title:he,arrow:j,depth:re,context:ne,children:Ae})=>{var we;return xt("div",_t(Pe({},ne.itemContainerWithChildrenProps),{className:["rct-tree-item-li",ne.isSelected?"rct-tree-item-li-selected":"",ne.isExpanded?"rct-tree-item-li-expanded":"",ne.isFocused?"rct-tree-item-li-focused":"",Ae?"rct-tree-item-li-hasChildren":""].join(" "),children:[xt("div",{className:["rct-tree-item-title-container",ne.isSelected?"rct-tree-item-title-container-selected":"",ne.isExpanded?"rct-tree-item-title-container-expanded":"",ne.isFocused?"rct-tree-item-title-container-focused":"",Ae?"rct-tree-item-title-container-hasChildren":""].join(" "),children:[p[ne.interactiveElementProps["data-rct-item-id"]]&&p[ne.interactiveElementProps["data-rct-item-id"]].map(He=>oe("div",{className:"rct-tree-item-avatar rounded-full absolute border",style:{borderColor:He.color,backgroundImage:`url(${He.avatar})`}},He.uuid)),xt("div",{className:"rct-tree-item-toolbar absolute right-0",children:[oe("button",{onClick:()=>{P(ne.interactiveElementProps["data-rct-item-id"])},children:oe("i",{className:"d42 add-file"})}),oe("button",{onClick:()=>{U(ne.interactiveElementProps["data-rct-item-id"])},children:oe("i",{className:"d42 add-folder"})}),oe(Vc,{as:"div",className:"relative",children:({open:He})=>xt(ns,{children:[oe(Vc.Button,{children:oe("i",{className:"d42 more"})}),oe(h5,{show:He,as:O.exports.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:xt(Vc.Items,{static:!0,className:"absolute z-1 w-20 right-0 top-full",children:[oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{W(ne.interactiveElementProps["data-rct-item-id"],"file")},children:"\u4E0A\u4F20\u6587\u4EF6"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{W(ne.interactiveElementProps["data-rct-item-id"],"folder")},children:"\u4E0A\u4F20\u6587\u4EF6\u5939"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center my-2",onClick:()=>{var nt;y((nt=he==null?void 0:he.props)==null?void 0:nt.children),v(ne.interactiveElementProps["data-rct-item-id"])},children:"\u91CD\u547D\u540D"})})}),oe(Vc.Item,{children:oe("div",{className:"code-dropdown-btn-item",children:oe("button",{className:"w-full justify-center text-red-800 my-2",onClick:()=>fe(ne.interactiveElementProps["data-rct-item-id"]),children:"\u5220\u9664"})})})]})})]})})]}),j,_===ne.interactiveElementProps["data-rct-item-id"]?oe("input",{className:"text-black focus:outline-none active:outline-none",type:"text",autoFocus:!0,value:b,onInput:He=>y(He.target.value),onKeyDown:He=>{switch(He.key){case"Enter":J(_),M(L[_],b);break;case"Escape":J(_);break}}}):xt("button",_t(Pe(Pe({},ne.itemContainerWithoutChildrenProps),ne.interactiveElementProps),{className:["rct-tree-item-button",ne.isSelected?"rct-tree-item-button-selected":"",ne.isExpanded?"rct-tree-item-button-expanded":"",ne.isFocused?"rct-tree-item-button-focused":"",Ae?"rct-tree-item-button-hasChildren":"no-child"].join(" "),children:[((we=j==null?void 0:j.props)==null?void 0:we.className.includes("rct-tree-item-arrow-hasChildren"))?oe(iMt,{className:"folder-svg"}):oe(J4e,{className:"file-svg"}),he]}))]}),Ae]}))},children:oe(wmt,{treeId:"tree-1",rootItem:"/",treeLabel:"File Tree"})})]})})};var sMt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",getStringFromFile:WO,FileTree:t5e}),SJ;(function(n){n.erb="erb",n.ru="ruby",n.ejs="html",n.json="json",n.abap="abap",n.cls="apex",n.azcli="azcli",n.bat="bat",n.cmd="bat",n.c="c",n.h="c",n.mligo="cameligo",n.clj="clojure",n.cljs="clojure",n.cljc="clojure",n.edn="clojure",n.coffee="coffeescript",n.cpp="cpp",n.cc="cpp",n.cxx="cpp",n.hpp="cpp",n.hh="cpp",n.hxx="cpp",n.cs="csharp",n.csx="csharp",n.cake="csharp",n.css="css",n.dart="dart",n.dockerfile="dockerfile",n.ecl="ecl",n.fs="fsharp",n.fsi="fsharp",n.ml="fsharp",n.mli="fsharp",n.fsx="fsharp",n.fsscript="fsharp",n.go="go",n.graphql="graphql",n.gql="graphql",n.handlebars="handlebars",n.hbs="handlebars",n.tf="hcl",n.tfvars="hcl",n.hcl="hcl",n.html="html",n.htm="html",n.shtml="html",n.xhtml="html",n.mdoc="html",n.jsp="html",n.asp="html",n.aspx="html",n.jshtm="html",n.ini="ini",n.properties="ini",n.gitconfig="ini",n.java="java",n.jav="java",n.js="javascript",n.es6="javascript",n.jsx="javascript",n.mjs="javascript",n.jl="julia",n.kt="kotlin",n.less="less",n.lex="lexon",n.lua="lua",n.m3="m3",n.i3="m3",n.mg="m3",n.ig="m3",n.md="markdown",n.markdown="markdown",n.mdown="markdown",n.mkdn="markdown",n.mkd="markdown",n.mdwn="markdown",n.mdtxt="markdown",n.mdtext="markdown",n.s="mips",n.dax="msdax",n.msdax="msdax",n.m="c",n.pas="pascal",n.p="pascal",n.pp="pascal",n.ligo="pascaligo",n.pl="perl",n.php="php",n.php4="php",n.php5="php",n.phtml="php",n.ctp="php",n.dats="postiats",n.sats="postiats",n.hats="postiats",n.pq="powerquery",n.pqm="powerquery",n.ps1="powershell",n.psm1="powershell",n.psd1="powershell",n.jade="pug",n.pug="pug",n.py="python",n.rpy="python",n.pyw="python",n.cpy="python",n.gyp="python",n.gypi="python",n.r="r",n.rhistory="r",n.rmd="r",n.rprofile="r",n.rt="r",n.cshtml="razor",n.redis="redis",n.rst="restructuredtext",n.rb="ruby",n.rbx="ruby",n.rjs="ruby",n.gemspec="ruby",n.rs="rust",n.rlib="rust",n.sb="sb",n.scala="scala",n.sc="scala",n.sbt="scala",n.scm="scheme",n.ss="scheme",n.sch="scheme",n.rkt="scheme",n.scss="scss",n.sh="shell",n.bash="shell",n.aes="sophia",n.sol="sol",n.sql="sql",n.st="st",n.iecst="st",n.iecplc="st",n.lc3lib="st",n.swift="swift",n.sv="systemverilog",n.svh="systemverilog",n.tcl="tcl",n.twig="twig",n.ts="typescript",n.tsx="typescript",n.vb="vb",n.v="verilog",n.vh="verilog",n.xml="xml",n.dtd="xml",n.ascx="xml",n.csproj="xml",n.config="xml",n.wxi="xml",n.wxl="xml",n.wxs="xml",n.xaml="xml",n.svg="xml",n.svgz="xml",n.opf="xml",n.xsl="xml",n.yaml="yaml",n.yml="yaml"})(SJ||(SJ={}));const aMt=$o.div`
|
|
2202
2202
|
width: 100%;
|
|
2203
2203
|
/* .contentWidgets {
|
|
2204
2204
|
visibility: hidden;
|
|
@@ -2560,7 +2560,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};class O9{constructor(e){
|
|
|
2560
2560
|
top: 0;
|
|
2561
2561
|
padding: 15px;
|
|
2562
2562
|
z-index: 2000;
|
|
2563
|
-
`,ZKt=({showMarkdown:n,markdownVal:e})=>{const t=O.exports.useRef(null);return O.exports.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]),hH.createPortal(oe(XKt,{className:"markdown-layout overflow-y-auto transition-all bg-white shadow-xl shadow-slate-700/10 ring-1 ring-gray-900/5 md:max-w-3xl md:mx-auto lg:max-w-4xl lg:pt-16 lg:pb-28 prose lg:prose-xl",style:{transform:n?"translate(0)":"translate(100%)"},ref:t,children:oe(ste,{remarkPlugins:[uzt],rehypePlugins:[YKt],children:e})}),document.body)},QKt={base:"vs-dark",inherit:!0,rules:[{background:"282a36",token:""},{foreground:"6272a4",token:"comment"},{foreground:"f1fa8c",token:"string"},{foreground:"bd93f9",token:"constant.numeric"},{foreground:"bd93f9",token:"constant.language"},{foreground:"bd93f9",token:"constant.character"},{foreground:"bd93f9",token:"constant.other"},{foreground:"ffb86c",token:"variable.other.readwrite.instance"},{foreground:"ff79c6",token:"constant.character.escaped"},{foreground:"ff79c6",token:"constant.character.escape"},{foreground:"ff79c6",token:"string source"},{foreground:"ff79c6",token:"string source.ruby"},{foreground:"ff79c6",token:"keyword"},{foreground:"ff79c6",token:"storage"},{foreground:"8be9fd",fontStyle:"italic",token:"storage.type"},{foreground:"50fa7b",fontStyle:"underline",token:"entity.name.class"},{foreground:"50fa7b",fontStyle:"italic underline",token:"entity.other.inherited-class"},{foreground:"50fa7b",token:"entity.name.function"},{foreground:"ffb86c",fontStyle:"italic",token:"variable.parameter"},{foreground:"ff79c6",token:"entity.name.tag"},{foreground:"50fa7b",token:"entity.other.attribute-name"},{foreground:"8be9fd",token:"support.function"},{foreground:"6be5fd",token:"support.constant"},{foreground:"66d9ef",fontStyle:" italic",token:"support.type"},{foreground:"66d9ef",fontStyle:" italic",token:"support.class"},{foreground:"f8f8f0",background:"ff79c6",token:"invalid"},{foreground:"f8f8f0",background:"bd93f9",token:"invalid.deprecated"},{foreground:"cfcfc2",token:"meta.structure.dictionary.json string.quoted.double.json"},{foreground:"6272a4",token:"meta.diff"},{foreground:"6272a4",token:"meta.diff.header"},{foreground:"ff79c6",token:"markup.deleted"},{foreground:"50fa7b",token:"markup.inserted"},{foreground:"e6db74",token:"markup.changed"},{foreground:"bd93f9",token:"constant.numeric.line-number.find-in-files - match"},{foreground:"e6db74",token:"entity.name.filename"},{foreground:"f83333",token:"message.error"},{foreground:"eeeeee",token:"punctuation.definition.string.begin.json - meta.structure.dictionary.value.json"},{foreground:"eeeeee",token:"punctuation.definition.string.end.json - meta.structure.dictionary.value.json"},{foreground:"8be9fd",token:"meta.structure.dictionary.json string.quoted.double.json"},{foreground:"f1fa8c",token:"meta.structure.dictionary.value.json string.quoted.double.json"},{foreground:"50fa7b",token:"meta meta meta meta meta meta meta.structure.dictionary.value string"},{foreground:"ffb86c",token:"meta meta meta meta meta meta.structure.dictionary.value string"},{foreground:"ff79c6",token:"meta meta meta meta meta.structure.dictionary.value string"},{foreground:"bd93f9",token:"meta meta meta meta.structure.dictionary.value string"},{foreground:"50fa7b",token:"meta meta meta.structure.dictionary.value string"},{foreground:"ffb86c",token:"meta meta.structure.dictionary.value string"}],colors:{"editor.foreground":"#f8f8f2","editor.background":"#282a36","editor.selectionBackground":"#44475a","editor.lineHighlightBackground":"#44475a","editorCursor.foreground":"#f8f8f0","editorWhitespace.foreground":"#3B3A32","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}},Rne="/home/runner/app";let Io;const OP=new Map,y3e=Xl(n=>({cursor:{},setCursor:e=>n(t=>({cursor:e}))})),fh=new jc(0),C3e=[],JKt=({doc:n,containerStyle:e,menuStyle:t,editorStyle:i,serviceWorkerOrigin:r,useLsp:o,theme:s})=>{const a=O.exports.useRef(null),[l,c]=O.exports.useState(null),[u,d]=O.exports.useState(null),[h,f]=O.exports.useState(!1),[g,p]=O.exports.useState(""),{setCRDTInfo:m,setAsyncType:_,switchDoc:v}=Zt.getState(),b=Zt(ue=>ue.CRDTInfo),y=Zt(ue=>ue.dockerInfo),w=MH(ue=>ue.fileTree);Zt(ue=>ue.CRDTInfo.file);const x=Zt(ue=>ue.doc),S=Zt(ue=>ue.globalData),[T,L]=O.exports.useState(""),I=As(ue=>ue.userList),D=xd(ue=>ue.userInfo),N=Xr(ue=>ue.socket);Mo.exports.debounce(ue=>{ue()},300);const R=ue=>{const{CRDTInfo:fe,setCRDTInfo:he}=Zt.getState();he(_t(Pe({},fe),{file:{action:"Get",value:ue.getValue(gc.EndOfLinePreference.LF),path:ue.uri.path.replace(Rne,"")}}))};fh.sendOperation=(ue,fe)=>{if(Zt.getState().appStatus==="replay")return;const{userInfo:he}=xd.getState(),{doc:j,switchDoc:re}=Zt.getState();let ne;(j==null?void 0:j.path)?ne=j.path:(ne=`temp-${C3e.length+1}`,re({path:ne}),C3e.push(ne));const Ae={timestamp:Date.now(),userInfo:Mo.exports.pick(he,["role","uuid"]),cursor:_t(Pe({},l.getCursor()),{path:ne}),editor:{operation:fe,revision:ue,evtType:"Editor"},file:{action:"Update",path:ne}};N==null||N.emit("editFile",LM.encode(Ae))},fh.applyOperation=ue=>{l.applyOperation(ue)};const z=ue=>{var he;const fe=Zt.getState().doc;console.log(l.liveOperationCode),fh.applyClient(ue),setTimeout(()=>{AH((fe==null?void 0:fe.path)?fe==null?void 0:fe.path:"singleFile",{value:Io.getModel().getValue(gc.EndOfLinePreference.LF),revision:fh.revision})},0),((he=fe==null?void 0:fe.path)==null?void 0:he.includes("md"))&&p(Io.getModel().getValue(gc.EndOfLinePreference.LF)),L(Io.getModel().getValue(gc.EndOfLinePreference.LF))},F=ue=>{var he;console.log(ue);const fe={timestamp:Date.now(),userInfo:Mo.exports.pick(D,["role","uuid"]),position:{endLineNumber:Io.getVisibleRanges()[0].endLineNumber},file:{action:"Update",path:(he=Zt.getState().doc)==null?void 0:he.path}};N==null||N.emit("position",LM.encode(fe)),l.ignoreNextExtraChange=!1},Y=ue=>{Zt.getState()},H=ue=>{if(!ue||(ue==null?void 0:ue.reason)===0&&(ue==null?void 0:ue.source)==="keyboard")return;const fe=l.getCursor();y3e.getState().setCursor(fe),P(fe)},P=ue=>{var he,j;const fe={timestamp:Date.now(),cursor:ue||y3e.getState().cursor,file:{action:"Update",path:(j=(he=Zt.getState())==null?void 0:he.doc)==null?void 0:j.path},userInfo:Mo.exports.pick(D,"uuid","role")};N==null||N.emit("cursor",JSON.stringify(fe))},U=ue=>{},J=ue=>{const fe=l.getCursor();P(fe)},M=ue=>{if((ue==null?void 0:ue.path)&&Io){let fe=/\.(\w+$)/gim.exec(ue.path);fe=fe||["",ue.path.substring(1)];const{CRDTInfo:he,doc:j,appStatus:re,setAppStatus:ne}=Zt.getState(),{shadowUser:Ae}=Ed.getState(),we=SJ[fe[1]];if(f(!1),p(""),fe[1]==="md"&&(f(!0),p((ue==null?void 0:ue.value)?ue==null?void 0:ue.value:"")),ue.path&&fe&&re==="replay"&&!Xw.getState().ignoreReplayers.some(He=>He==="editor")){pf.updateModel({value:ue.value,path:ue.path,language:we,APP_DIR:Rne},He=>{var nt;fh.revision=((nt=he.editor)==null?void 0:nt.revision)?he.editor.revision:0,Io.setModel(He),l==null||l.updateModel(),l==null||l.onFocus(),l==null||l.onCursorActivity(),u==null||u.setCursors(),ue&&OP.set(ue.path,{operation:[],revision:fh.revision,value:ue.value})},!0);return}re!=="replay"&&(Ae.uuid||ue.path&&fe&&Td(he.userInfo))&&(pf.setFileTreeStack([]),pf.updateModel({value:ue.value,path:ue.path,language:we,APP_DIR:Rne},He=>{var nt;fh.revision=((nt=he.editor)==null?void 0:nt.revision)?he.editor.revision:0,Io.setModel(He),l==null||l.updateModel(),l==null||l.onFocus(),l==null||l.onCursorActivity(),u==null||u.setCursors(),ue&&(OP.set(ue.path,{operation:[],revision:fh.revision,value:ue.value}),Zt.getState().appStatus!=="replay"&&AH(j==null?void 0:j.path,{value:ue.value,revision:fh.revision}))},!0))}},W=()=>{!Io||(gc.getModels().forEach(ue=>ue.dispose()),pf.setFileTreeStack([]))},de=()=>{const ue=Io._codeEditorService,fe=ue.openCodeEditor.bind(ue);ue.openCodeEditor=async(he,j,re)=>{const ne=await fe(he,j);if(ne===null){const Ae=gc.getModels().find(we=>new RegExp(he.resource.path).test(we.uri.path));R(Ae)}return ne}};return O.exports.useEffect(()=>(W(),Io=gc.create(a.current,{theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},glyphMargin:!0,lightbulb:{enabled:!0}}),Io.onDidAttemptReadOnlyEdit(()=>{var fe,he;if(confirm("\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")){Io.updateOptions({readOnly:!1});const j=pf.fileTreeStack.map(ne=>_t(Pe({},ne),{deleted:!1,label:ne.label.replace(" has deleted","")}));pf.setFileTreeStack(j);const re={action:"RECORVERY",path:(he=(fe=Zt.getState())==null?void 0:fe.doc)==null?void 0:he.path,newPath:""};N==null||N.emit("fileTreeOp",JSON.stringify(re))}}),gc.defineTheme("myCoolTheme",QKt),gc.setTheme("myCoolTheme"),c(new zFt(Io,r)),d(new UFt(Io,I.filter(ue=>!Td(ue)))),de(),()=>{Io.dispose()}),[]),O.exports.useEffect(()=>{l==null||l.registerCallbacks({change:z,cursorActivity:H,selectionActivity:Y,blur:U,focus:J,scroll:F}),l==null||l.onCursorActivity()},[l]),O.exports.useEffect(()=>(N==null||N.on("editFile",ue=>{var j,re,ne,Ae,we;const fe=LM.decode(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(((ne=Io==null?void 0:Io.getModel())==null?void 0:ne.uri.path.includes((re=fe==null?void 0:fe.file)==null?void 0:re.path))&&fh.applyServer(Zf.fromJSON(fe.editor.operation)),!Td(fe.userInfo)&&fe.file.path){const He=As.getState().userList.find(nt=>nt.uuid===fe.userInfo.uuid);u==null||u.pushCursorToList(Pe(Pe({},He),fe.userInfo)),((Ae=fe.file)==null?void 0:Ae.path)!==he&&(u==null||u.removeCursor(fe.userInfo)),setTimeout(()=>{var nt,Et;((Et=(nt=fe==null?void 0:fe.file)==null?void 0:nt.path)==null?void 0:Et.includes("md"))&&p(Io.getModel().getValue(1))},100)}m(fe),_("editor"),vw(_t(Pe({},fe),{event:"editor",editor:_t(Pe({},fe.editor),{revision:(we=fe.editor)==null?void 0:we.revision})}))}),N==null||N.on("serverAck",async ue=>{var j,re,ne,Ae;const fe=LM.decode(ue);fh.serverAck(),m(fe),_("editor"),OP.set((j=fe==null?void 0:fe.file)==null?void 0:j.path,_t(Pe({},OP.get((re=fe==null?void 0:fe.file)==null?void 0:re.path)),{operation:fh.operation}));const he=await hle(fe.file.path);GT((ne=fe==null?void 0:fe.file)==null?void 0:ne.path,{value:he.value,revision:he.revision+1,path:fe.file.path}),vw(_t(Pe({},fe),{event:"editor",editor:_t(Pe({},fe.editor),{revision:(Ae=fe.editor)==null?void 0:Ae.revision})}))}),N==null||N.on("selection",async ue=>{var j,re;const fe=JSON.parse(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(_("editor"),!Td(fe.userInfo)&&fe.file.path){const ne=As.getState().userList.find(Ae=>Ae.uuid===fe.userInfo.uuid);u==null||u.pushSelectionToList(Pe(Pe({},ne),fe.userInfo)),((re=fe.file)==null?void 0:re.path)!==he&&(u==null||u.removeSelection(fe.userInfo))}}),N==null||N.on("cursor",async ue=>{var j,re;const fe=JSON.parse(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(_("editor"),!Td(fe.userInfo)&&fe.file.path){const ne=As.getState().userList.find(Ae=>Ae.uuid===fe.userInfo.uuid);u==null||u.pushCursorToList(Pe(Pe({},ne),fe.userInfo)),((re=fe.file)==null?void 0:re.path)!==he&&(u==null||u.removeCursor(fe.userInfo))}}),()=>{N==null||N.off("editFile"),N==null||N.off("serverAck"),N==null||N.off("selection"),N==null||N.off("cursor")}),[l,N]),O.exports.useEffect(()=>{u==null||u.updateList(I.filter(ue=>!Td(ue)))},[I]),O.exports.useEffect(()=>{const{appStatus:ue}=Zt.getState();ue!=="replay"&&(x.path==="/"&&Io.setValue(""),!/\/$/.test(x.path)&&M(x))},[x]),O.exports.useEffect(()=>{Td(b.userInfo)&&W()},[y]),O.exports.useEffect(()=>{const{appStatus:ue}=Zt.getState();ue==="replay"&&dle(b.file.path).then(fe=>{Io.setValue(fe.value)})},[b]),O.exports.useEffect(()=>{Io.updateOptions({readOnly:S.disableEditor})},[S]),O.exports.useEffect(()=>{const ue=pf.fileTreeStack.map(fe=>s_e(w,fe.path)?_t(Pe({},fe),{deleted:!0,label:`${fe.label} has deleted`}):fe);pf.setFileTreeStack(ue),(x==null?void 0:x.path)&&s_e(w,x.path)&&Io.updateOptions({readOnly:!0})},[w]),xt(f5,{name:"editor",children:[oe(ZKt,{showMarkdown:h,markdownVal:g,setDrawerOpen:ue=>{console.log(ue)}}),xt(aMt,{style:e,theme:s,className:"editor-layout flex flex-col",children:[oe(tGt,{editor:Io,menuStyle:t,switchModel:R,clearPlayground:W}),oe(lMt,{ref:a,userList:As.getState().userList,className:"editor-content flex-1",style:i})]})]})},eGt=$o.ul`
|
|
2563
|
+
`,ZKt=({showMarkdown:n,markdownVal:e})=>{const t=O.exports.useRef(null);return O.exports.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]),hH.createPortal(oe(XKt,{className:"markdown-layout overflow-y-auto transition-all bg-white shadow-xl shadow-slate-700/10 ring-1 ring-gray-900/5 md:max-w-3xl md:mx-auto lg:max-w-4xl lg:pt-16 lg:pb-28 prose lg:prose-xl",style:{transform:n?"translate(0)":"translate(100%)"},ref:t,children:oe(ste,{remarkPlugins:[uzt],rehypePlugins:[YKt],children:e})}),document.body)},QKt={base:"vs-dark",inherit:!0,rules:[{background:"282a36",token:""},{foreground:"6272a4",token:"comment"},{foreground:"f1fa8c",token:"string"},{foreground:"bd93f9",token:"constant.numeric"},{foreground:"bd93f9",token:"constant.language"},{foreground:"bd93f9",token:"constant.character"},{foreground:"bd93f9",token:"constant.other"},{foreground:"ffb86c",token:"variable.other.readwrite.instance"},{foreground:"ff79c6",token:"constant.character.escaped"},{foreground:"ff79c6",token:"constant.character.escape"},{foreground:"ff79c6",token:"string source"},{foreground:"ff79c6",token:"string source.ruby"},{foreground:"ff79c6",token:"keyword"},{foreground:"ff79c6",token:"storage"},{foreground:"8be9fd",fontStyle:"italic",token:"storage.type"},{foreground:"50fa7b",fontStyle:"underline",token:"entity.name.class"},{foreground:"50fa7b",fontStyle:"italic underline",token:"entity.other.inherited-class"},{foreground:"50fa7b",token:"entity.name.function"},{foreground:"ffb86c",fontStyle:"italic",token:"variable.parameter"},{foreground:"ff79c6",token:"entity.name.tag"},{foreground:"50fa7b",token:"entity.other.attribute-name"},{foreground:"8be9fd",token:"support.function"},{foreground:"6be5fd",token:"support.constant"},{foreground:"66d9ef",fontStyle:" italic",token:"support.type"},{foreground:"66d9ef",fontStyle:" italic",token:"support.class"},{foreground:"f8f8f0",background:"ff79c6",token:"invalid"},{foreground:"f8f8f0",background:"bd93f9",token:"invalid.deprecated"},{foreground:"cfcfc2",token:"meta.structure.dictionary.json string.quoted.double.json"},{foreground:"6272a4",token:"meta.diff"},{foreground:"6272a4",token:"meta.diff.header"},{foreground:"ff79c6",token:"markup.deleted"},{foreground:"50fa7b",token:"markup.inserted"},{foreground:"e6db74",token:"markup.changed"},{foreground:"bd93f9",token:"constant.numeric.line-number.find-in-files - match"},{foreground:"e6db74",token:"entity.name.filename"},{foreground:"f83333",token:"message.error"},{foreground:"eeeeee",token:"punctuation.definition.string.begin.json - meta.structure.dictionary.value.json"},{foreground:"eeeeee",token:"punctuation.definition.string.end.json - meta.structure.dictionary.value.json"},{foreground:"8be9fd",token:"meta.structure.dictionary.json string.quoted.double.json"},{foreground:"f1fa8c",token:"meta.structure.dictionary.value.json string.quoted.double.json"},{foreground:"50fa7b",token:"meta meta meta meta meta meta meta.structure.dictionary.value string"},{foreground:"ffb86c",token:"meta meta meta meta meta meta.structure.dictionary.value string"},{foreground:"ff79c6",token:"meta meta meta meta meta.structure.dictionary.value string"},{foreground:"bd93f9",token:"meta meta meta meta.structure.dictionary.value string"},{foreground:"50fa7b",token:"meta meta meta.structure.dictionary.value string"},{foreground:"ffb86c",token:"meta meta.structure.dictionary.value string"}],colors:{"editor.foreground":"#f8f8f2","editor.background":"#282a36","editor.selectionBackground":"#44475a","editor.lineHighlightBackground":"#44475a","editorCursor.foreground":"#f8f8f0","editorWhitespace.foreground":"#3B3A32","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}},Rne="/home/runner/app";let Io;const OP=new Map,y3e=Xl(n=>({cursor:{},setCursor:e=>n(t=>({cursor:e}))})),fh=new jc(0),C3e=[],JKt=({doc:n,containerStyle:e,menuStyle:t,editorStyle:i,serviceWorkerOrigin:r,useLsp:o,theme:s})=>{const a=O.exports.useRef(null),[l,c]=O.exports.useState(null),[u,d]=O.exports.useState(null),[h,f]=O.exports.useState(!1),[g,p]=O.exports.useState(""),{setCRDTInfo:m,setAsyncType:_,switchDoc:v}=Zt.getState(),b=Zt(ue=>ue.CRDTInfo),y=Zt(ue=>ue.dockerInfo),w=MH(ue=>ue.fileTree);Zt(ue=>ue.CRDTInfo.file);const x=Zt(ue=>ue.doc),S=Zt(ue=>ue.globalData),[T,L]=O.exports.useState(""),I=As(ue=>ue.userList),D=xd(ue=>ue.userInfo),N=Xr(ue=>ue.socket);Mo.exports.debounce(ue=>{ue()},300);const R=ue=>{const{CRDTInfo:fe,setCRDTInfo:he}=Zt.getState();he(_t(Pe({},fe),{file:{action:"Get",value:ue.getValue(gc.EndOfLinePreference.LF),path:ue.uri.path.replace(Rne,"")}}))};fh.sendOperation=(ue,fe)=>{if(Zt.getState().appStatus==="replay")return;const{userInfo:he}=xd.getState(),{doc:j,switchDoc:re}=Zt.getState();let ne;(j==null?void 0:j.path)?ne=j.path:(ne=`temp-${C3e.length+1}`,re({path:ne}),C3e.push(ne));const Ae={timestamp:Date.now(),userInfo:Mo.exports.pick(he,["role","uuid"]),cursor:_t(Pe({},l.getCursor()),{path:ne}),editor:{operation:fe,revision:ue,evtType:"Editor"},file:{action:"Update",path:ne}};N==null||N.emit("editFile",LM.encode(Ae))},fh.applyOperation=ue=>{l.applyOperation(ue)};const z=ue=>{var he;const fe=Zt.getState().doc;console.log(l.liveOperationCode),fh.applyClient(ue),setTimeout(()=>{AH((fe==null?void 0:fe.path)?fe==null?void 0:fe.path:"singleFile",{value:Io.getModel().getValue(gc.EndOfLinePreference.LF),revision:fh.revision})},0),((he=fe==null?void 0:fe.path)==null?void 0:he.includes("md"))&&p(Io.getModel().getValue(gc.EndOfLinePreference.LF)),L(Io.getModel().getValue(gc.EndOfLinePreference.LF))},F=ue=>{var he;console.log(ue);const fe={timestamp:Date.now(),userInfo:Mo.exports.pick(D,["role","uuid"]),position:{endLineNumber:Io.getVisibleRanges()[0].endLineNumber},file:{action:"Update",path:(he=Zt.getState().doc)==null?void 0:he.path}};N==null||N.emit("position",LM.encode(fe)),l.ignoreNextExtraChange=!1},Y=ue=>{Zt.getState()},H=ue=>{if(!ue||(ue==null?void 0:ue.reason)===0&&(ue==null?void 0:ue.source)==="keyboard")return;const fe=l.getCursor();y3e.getState().setCursor(fe),P(fe)},P=ue=>{var he,j;const fe={timestamp:Date.now(),cursor:ue||y3e.getState().cursor,file:{action:"Update",path:(j=(he=Zt.getState())==null?void 0:he.doc)==null?void 0:j.path},userInfo:Mo.exports.pick(D,"uuid","role")};N==null||N.emit("cursor",JSON.stringify(fe))},U=ue=>{},J=ue=>{const fe=l.getCursor();P(fe)},M=ue=>{if((ue==null?void 0:ue.path)&&Io){let fe=/\.(\w+$)/gim.exec(ue.path);fe=fe||["",ue.path.substring(1)];const{CRDTInfo:he,doc:j,appStatus:re,setAppStatus:ne}=Zt.getState(),{shadowUser:Ae}=Ed.getState(),we=SJ[fe[1]];if(f(!1),p(""),fe[1]==="md"&&(f(!0),p((ue==null?void 0:ue.value)?ue==null?void 0:ue.value:"")),ue.path&&fe&&re==="replay"&&!Xw.getState().ignoreReplayers.some(He=>He==="editor")){pf.updateModel({value:ue.value,path:ue.path,language:we,APP_DIR:Rne},He=>{var nt;fh.revision=((nt=he.editor)==null?void 0:nt.revision)?he.editor.revision:0,Io.setModel(He),l==null||l.updateModel(),l==null||l.onFocus(),l==null||l.onCursorActivity(),u==null||u.setCursors(),ue&&OP.set(ue.path,{operation:[],revision:fh.revision,value:ue.value})},!0);return}re!=="replay"&&(Ae.uuid||ue.path&&fe&&Td(he.userInfo))&&(pf.setFileTreeStack([]),pf.updateModel({value:ue.value,path:ue.path,language:we,APP_DIR:Rne},He=>{var nt;fh.revision=((nt=he.editor)==null?void 0:nt.revision)?he.editor.revision:0,Io.setModel(He),l==null||l.updateModel(),l==null||l.onFocus(),l==null||l.onCursorActivity(),u==null||u.setCursors(),ue&&(OP.set(ue.path,{operation:[],revision:fh.revision,value:ue.value}),Zt.getState().appStatus!=="replay"&&AH(j==null?void 0:j.path,{value:ue.value,revision:fh.revision}))},!0))}},W=()=>{!Io||(gc.getModels().forEach(ue=>ue.dispose()),pf.setFileTreeStack([]))},de=()=>{const ue=Io._codeEditorService,fe=ue.openCodeEditor.bind(ue);ue.openCodeEditor=async(he,j,re)=>{const ne=await fe(he,j);if(ne===null){const Ae=gc.getModels().find(we=>new RegExp(he.resource.path).test(we.uri.path));R(Ae)}return ne}};return O.exports.useEffect(()=>(W(),Io=gc.create(a.current,{theme:"vs-dark",automaticLayout:!0,minimap:{enabled:!1},glyphMargin:!0,lightbulb:{enabled:!0}}),Io.onDidAttemptReadOnlyEdit(()=>{var fe,he;if(confirm("\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")){Io.updateOptions({readOnly:!1});const j=pf.fileTreeStack.map(ne=>_t(Pe({},ne),{deleted:!1,label:ne.label.replace(" has deleted","")}));pf.setFileTreeStack(j);const re={action:"RECORVERY",path:(he=(fe=Zt.getState())==null?void 0:fe.doc)==null?void 0:he.path,newPath:""};N==null||N.emit("fileTreeOp",JSON.stringify(re))}}),gc.defineTheme("myCoolTheme",QKt),gc.setTheme("myCoolTheme"),c(new zFt(Io,r)),d(new UFt(Io,I.filter(ue=>!Td(ue)))),de(),()=>{Io.dispose()}),[]),O.exports.useEffect(()=>{l==null||l.registerCallbacks({change:z,cursorActivity:H,selectionActivity:Y,blur:U,focus:J,scroll:F}),l==null||l.onCursorActivity()},[l]),O.exports.useEffect(()=>(N==null||N.on("editFile",ue=>{var j,re,ne,Ae,we;const fe=LM.decode(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(((ne=Io==null?void 0:Io.getModel())==null?void 0:ne.uri.path.includes((re=fe==null?void 0:fe.file)==null?void 0:re.path))&&fh.applyServer(Zf.fromJSON(fe.editor.operation)),!Td(fe.userInfo)&&fe.file.path){const He=As.getState().userList.find(nt=>nt.uuid===fe.userInfo.uuid);u==null||u.pushCursorToList(Pe(Pe({},He),fe.userInfo)),((Ae=fe.file)==null?void 0:Ae.path)!==he&&(u==null||u.removeCursor(fe.userInfo)),setTimeout(()=>{var nt,Et;((Et=(nt=fe==null?void 0:fe.file)==null?void 0:nt.path)==null?void 0:Et.includes("md"))&&p(Io.getModel().getValue(1))},100)}m(fe),_("editor"),vw(_t(Pe({},fe),{event:"editor",editor:_t(Pe({},fe.editor),{revision:(we=fe.editor)==null?void 0:we.revision})}))}),N==null||N.on("serverAck",async ue=>{var j,re,ne,Ae;const fe=LM.decode(ue);fh.serverAck(),m(fe),_("editor"),OP.set((j=fe==null?void 0:fe.file)==null?void 0:j.path,_t(Pe({},OP.get((re=fe==null?void 0:fe.file)==null?void 0:re.path)),{operation:fh.operation}));const he=await hle(fe.file.path);GT((ne=fe==null?void 0:fe.file)==null?void 0:ne.path,{value:he.value,revision:he.revision+1,path:fe.file.path}),vw(_t(Pe({},fe),{event:"editor",editor:_t(Pe({},fe.editor),{revision:(Ae=fe.editor)==null?void 0:Ae.revision})}))}),N==null||N.on("selection",async ue=>{var j,re;const fe=JSON.parse(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(_("editor"),!Td(fe.userInfo)&&fe.file.path){const ne=As.getState().userList.find(Ae=>Ae.uuid===fe.userInfo.uuid);u==null||u.pushSelectionToList(Pe(Pe({},ne),fe.userInfo)),((re=fe.file)==null?void 0:re.path)!==he&&(u==null||u.removeSelection(fe.userInfo))}}),N==null||N.on("cursor",async ue=>{var j,re;const fe=JSON.parse(ue),he=(j=Zt.getState().doc)==null?void 0:j.path;if(_("editor"),!Td(fe.userInfo)&&fe.file.path){const ne=As.getState().userList.find(Ae=>Ae.uuid===fe.userInfo.uuid);u==null||u.pushCursorToList(Pe(Pe({},ne),fe.userInfo)),((re=fe.file)==null?void 0:re.path)!==he&&(u==null||u.removeCursor(fe.userInfo))}}),()=>{N==null||N.off("editFile"),N==null||N.off("serverAck"),N==null||N.off("selection"),N==null||N.off("cursor")}),[l,N]),O.exports.useEffect(()=>{u==null||u.updateList(I.filter(ue=>!Td(ue)))},[I]),O.exports.useEffect(()=>{const{appStatus:ue}=Zt.getState();ue!=="replay"&&(x.path==="/"&&Io.setValue(""),!/\/$/.test(x.path)&&M(x))},[x]),O.exports.useEffect(()=>{Td(b.userInfo)&&W()},[y]),O.exports.useEffect(()=>{const{appStatus:ue}=Zt.getState();ue==="replay"&&dle(b.file.path).then(fe=>{Io.setValue(fe.value)})},[b]),O.exports.useEffect(()=>{Io.updateOptions({readOnly:S.disableEditor})},[S]),O.exports.useEffect(()=>{const ue=pf.fileTreeStack.map(fe=>s_e(w,fe.path)?_t(Pe({},fe),{deleted:!0,label:`${fe.label} has deleted`}):fe);pf.setFileTreeStack(ue),(x==null?void 0:x.path)&&s_e(w,x.path)&&Io.updateOptions({readOnly:!0})},[w]),xt(f5,{name:"editor",children:[oe(ZKt,{showMarkdown:h,markdownVal:g,setDrawerOpen:ue=>{console.log(ue)}}),xt(aMt,{style:e,theme:s,className:"editor-container flex flex-col",children:[oe(tGt,{editor:Io,menuStyle:t,switchModel:R,clearPlayground:W}),oe(lMt,{ref:a,userList:As.getState().userList,className:"editor-container flex-1",style:i})]})]})},eGt=$o.ul`
|
|
2564
2564
|
.active {
|
|
2565
2565
|
background-color: ${n=>n.menuStyle.backgroundColor};
|
|
2566
2566
|
box-shadow: 0px 1px 0px 0 #333;
|
|
@@ -2597,7 +2597,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};class O9{constructor(e){
|
|
|
2597
2597
|
color: ${n=>n.menuStyle.hoverIconColor};
|
|
2598
2598
|
}
|
|
2599
2599
|
}
|
|
2600
|
-
`,tGt=({editor:n,switchModel:e,clearPlayground:t,menuStyle:i={backgroundColor:"#005391",textColor:"#fff",hoverBgColor:"rgb(37 45 124 / 80%)",hoverTextColor:"#fff",iconColor:"#fff",hoverIconColor:"#fff"}})=>{const r=Zt(u=>u.switchDoc);Zt(u=>u.dockerInfo);const o=Zt(u=>u.doc),s=u9(u=>u.fileTreeStack),a=u9(u=>u.setFileTreeStack),l=nGt(),c=(u,d)=>{u.preventDefault(),u.stopPropagation();const h=[...s];h.splice(d,1),a(h),h.length===0?(r({path:"",value:""}),n.getModel().setValue("")):e(h.slice(-1)[0].model)};return s&&s.length>0?oe(eGt,{menuStyle:i,id:"menu-list",ref:l,className:"flex flex-row
|
|
2600
|
+
`,tGt=({editor:n,switchModel:e,clearPlayground:t,menuStyle:i={backgroundColor:"#005391",textColor:"#fff",hoverBgColor:"rgb(37 45 124 / 80%)",hoverTextColor:"#fff",iconColor:"#fff",hoverIconColor:"#fff"}})=>{const r=Zt(u=>u.switchDoc);Zt(u=>u.dockerInfo);const o=Zt(u=>u.doc),s=u9(u=>u.fileTreeStack),a=u9(u=>u.setFileTreeStack),l=nGt(),c=(u,d)=>{u.preventDefault(),u.stopPropagation();const h=[...s];h.splice(d,1),a(h),h.length===0?(r({path:"",value:""}),n.getModel().setValue("")):e(h.slice(-1)[0].model)};return s&&s.length>0?oe(eGt,{menuStyle:i,id:"menu-list",ref:l,className:"flex flex-row file-list-container items-center flex-shrink-0 scroll-smooth no-scrollbar overflow-x-scroll bg-codezone-black overflow-auto touch-pan-x",children:s==null?void 0:s.map((u,d)=>xt("li",{className:`
|
|
2601
2601
|
flex
|
|
2602
2602
|
flex-row
|
|
2603
2603
|
flex-grow-0
|
|
@@ -2617,7 +2617,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};class O9{constructor(e){
|
|
|
2617
2617
|
`),d.clear(),u(d,h)},u=(d,h)=>{d.write(h)};return O.exports.useEffect(()=>{if(!o){const d=new One.exports.Terminal(r);s(d)}},[]),O.exports.useEffect(()=>{!o||(l==="STOP"?c(o,`\r
|
|
2618
2618
|
`):c(o,Zt.getState().dockerInfo.consoleHistory))},[o]),O.exports.useEffect(()=>{var h;if(!o)return;const d=a.CRDTInfo.console;d&&u(o,((h=d==null?void 0:d.doc)==null?void 0:h.value)||"")},[a.CRDTInfo]),O.exports.useEffect(()=>{!o||(l==="STOP"?setTimeout(()=>{u(o,`\r
|
|
2619
2619
|
\u5E94\u7528\u672A\u542F\u52A8\r
|
|
2620
|
-
`)},400):c(o,""))},[l]),oe(f5,{children:oe("div",{className
|
|
2620
|
+
`)},400):c(o,""))},[l]),oe(f5,{children:oe("div",{className:`console-container ${e.className?e.className:""}`,style:{height:"100%",width:"100%"},children:oe(x3e,Pe({terminal:o},e))})})};var iGt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:E3e});const T3e="https://",rGt=$o.div``,oGt=$o.div`
|
|
2621
2621
|
background-color: white;
|
|
2622
2622
|
height: 30px;
|
|
2623
2623
|
display: flex;
|
|
@@ -2677,11 +2677,11 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`};class O9{constructor(e){
|
|
|
2677
2677
|
background-color: #5a5a5a;
|
|
2678
2678
|
opacity: 0.6;
|
|
2679
2679
|
`,k3e=o=>{var s=o,{showURL:n=!1,freshIconColor:e="#00bcd4",inputColor:t="#adacac",openIconColor:i="#adacac"}=s,r=lo(s,["showURL","freshIconColor","inputColor","openIconColor"]);var y;const a=Zt(w=>w.playgroundStatus),l=Zt(w=>w.dockerStatus),[c,u]=O.exports.useState("EMPTY"),[d,h]=O.exports.useState("STOP"),f=w=>w?(w.indexOf("http://")!==0&&w.indexOf("https://")!==0&&(w=`${T3e}${w}`),w):`${T3e}showmebug.com`;O.exports.useEffect(()=>{u(a)},[a]),O.exports.useEffect(()=>{h(l),setTimeout(()=>{v()},800)},[l]);const g=O.exports.useRef(null),[p,m]=O.exports.useState(f((y=Zt.getState().dockerInfo)==null?void 0:y.url));O.exports.useEffect(()=>{},[g]);const _=w=>{var S,T;if(w.keyCode!==13)return;const x=f(w.target.value);m(x),(T=(S=g==null?void 0:g.current)==null?void 0:S.contentWindow)==null||T.location.replace(x)},v=()=>{var w,x;(x=(w=g==null?void 0:g.current)==null?void 0:w.contentWindow)==null||x.location.replace(p)},b=()=>{window.open(p)};return O.exports.useEffect(()=>{var w,x,S;c!=="EMPTY"&&(m(f((w=Zt.getState().dockerInfo)==null?void 0:w.url)),c==="ACTIVE"&&d==="RUNNING"&&p!=="http://"&&p!=="https://"&&((S=(x=g==null?void 0:g.current)==null?void 0:x.contentWindow)==null||S.location.replace(p)))},[c,d]),oe(f5,{name:"browser",children:xt(rGt,{className:"w-full h-full",children:[n?xt(oGt,{freshIconColor:e,inputColor:t,openIconColor:i,children:[oe("i",{className:"d42 text-xl reload cursor-pointer",onClick:v}),oe("input",{type:"text",value:p,onChange:w=>m(w.target.value),onKeyDown:_}),oe("i",{className:"d42 text-xl file-copy cursor-pointer",onClick:b})]}):null,d==="STOP"&&oe(sGt,{children:oe("span",{children:"\u70B9\u51FB\u201C\u8FD0\u884C\u201D\uFF0C\u542F\u52A8\u5E94\u7528"})}),oe("iframe",{ref:g,src:p,style:{width:"100%",height:"calc(100% - 30px)"}})]})})};var aGt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:k3e});const L3e=t=>{var i=t,{options:n}=i,e=lo(i,["options"]);const r=Pe({},n),o=document.createElement("div");o.classList.add("xterm-helper-user-label");const[s,a]=O.exports.useState(null),{CRDTInfo:l}=Zt(f=>f),c=Xr(f=>f.socket),u=(f,g)=>{f.write(`\r
|
|
2680
|
-
`),f.clear(),d(f,g)},d=(f,g)=>{f.write(g)},h=f=>{var p,m;if(Zt.getState().appStatus==="replay")return;const g={timestamp:Date.now(),userInfo:Mo.exports.pick(xd.getState().userInfo,"uuid"),terminal:{doc:{action:"Edit",value:f}}};(m=(p=Xr.getState())==null?void 0:p.socket)==null||m.emit("terminal",JSON.stringify(g))};return O.exports.useEffect(()=>{if(!s){const f=new One.exports.Terminal(r);a(f)}},[]),O.exports.useEffect(()=>{var f,g,p,m;!s||l.terminal&&u(s,((m=(p=(g=(f=Zt.getState())==null?void 0:f.CRDTInfo)==null?void 0:g.terminal)==null?void 0:p.doc)==null?void 0:m.value)||"")},[s]),O.exports.useEffect(()=>{var g,p,m,_;const f=l.terminal;if(s&&f){if(((g=f==null?void 0:f.doc)==null?void 0:g.action)==="Get"){u(s,((p=f==null?void 0:f.doc)==null?void 0:p.value)||"");return}if(d(s,((m=f==null?void 0:f.doc)==null?void 0:m.value)||""),!l.userInfo.uuid)return;const v=As.getState().userList.find(({uuid:b})=>b===l.userInfo.uuid);if(v&&!Td(l.userInfo)){const b=(_=s==null?void 0:s._core)==null?void 0:_._helperContainer,y=b==null?void 0:b.firstChild;o.innerText=v.username,o.style.backgroundColor=v.color,o.style.top=y.style.top,o.style.left=y.style.left,b==null||b.appendChild(o),s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:v.color}));const w=setTimeout(()=>{b==null||b.removeChild(o),s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:"#ffffff"}))},6e3);return()=>{try{b==null||b.removeChild(o)}catch{}s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:"#ffffff"})),clearTimeout(w)}}}},[l.terminal]),O.exports.useEffect(()=>(c==null||c.on("terminal",f=>{var m,_,v,b;const p=JSON.parse(f).terminal;if(p){if(((m=p==null?void 0:p.doc)==null?void 0:m.action)==="Get"){u(s,((_=p==null?void 0:p.doc)==null?void 0:_.value)||"");return}d(s,((v=p==null?void 0:p.doc)==null?void 0:v.value)||"");const y=(b=s==null?void 0:s._core)==null?void 0:b._helperContainer,w=y==null?void 0:y.firstChild;o.style.top=w.style.top,o.style.left=w.style.left,y==null||y.appendChild(o),Zt.getState().setAsyncType("terminal")}}),()=>{c==null||c.off("terminal")}),[s,c]),oe(f5,{name:"terminal",children:oe("div",{className:
|
|
2680
|
+
`),f.clear(),d(f,g)},d=(f,g)=>{f.write(g)},h=f=>{var p,m;if(Zt.getState().appStatus==="replay")return;const g={timestamp:Date.now(),userInfo:Mo.exports.pick(xd.getState().userInfo,"uuid"),terminal:{doc:{action:"Edit",value:f}}};(m=(p=Xr.getState())==null?void 0:p.socket)==null||m.emit("terminal",JSON.stringify(g))};return O.exports.useEffect(()=>{if(!s){const f=new One.exports.Terminal(r);a(f)}},[]),O.exports.useEffect(()=>{var f,g,p,m;!s||l.terminal&&u(s,((m=(p=(g=(f=Zt.getState())==null?void 0:f.CRDTInfo)==null?void 0:g.terminal)==null?void 0:p.doc)==null?void 0:m.value)||"")},[s]),O.exports.useEffect(()=>{var g,p,m,_;const f=l.terminal;if(s&&f){if(((g=f==null?void 0:f.doc)==null?void 0:g.action)==="Get"){u(s,((p=f==null?void 0:f.doc)==null?void 0:p.value)||"");return}if(d(s,((m=f==null?void 0:f.doc)==null?void 0:m.value)||""),!l.userInfo.uuid)return;const v=As.getState().userList.find(({uuid:b})=>b===l.userInfo.uuid);if(v&&!Td(l.userInfo)){const b=(_=s==null?void 0:s._core)==null?void 0:_._helperContainer,y=b==null?void 0:b.firstChild;o.innerText=v.username,o.style.backgroundColor=v.color,o.style.top=y.style.top,o.style.left=y.style.left,b==null||b.appendChild(o),s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:v.color}));const w=setTimeout(()=>{b==null||b.removeChild(o),s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:"#ffffff"}))},6e3);return()=>{try{b==null||b.removeChild(o)}catch{}s.setOption("theme",_t(Pe({},s.getOption("theme")),{cursor:"#ffffff"})),clearTimeout(w)}}}},[l.terminal]),O.exports.useEffect(()=>(c==null||c.on("terminal",f=>{var m,_,v,b;const p=JSON.parse(f).terminal;if(p){if(((m=p==null?void 0:p.doc)==null?void 0:m.action)==="Get"){u(s,((_=p==null?void 0:p.doc)==null?void 0:_.value)||"");return}d(s,((v=p==null?void 0:p.doc)==null?void 0:v.value)||"");const y=(b=s==null?void 0:s._core)==null?void 0:b._helperContainer,w=y==null?void 0:y.firstChild;o.style.top=w.style.top,o.style.left=w.style.left,y==null||y.appendChild(o),Zt.getState().setAsyncType("terminal")}}),()=>{c==null||c.off("terminal")}),[s,c]),oe(f5,{name:"terminal",children:oe("div",{className:"terminal-container shell-container",id:"terminal",style:{height:"100%",width:"100%"},children:oe(x3e,Pe({terminal:s,onKey:h},e))})})};var lGt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:L3e});const cGt=r=>{var o=r,{activeKey:n,onSelect:e,tabItems:t}=o,i=lo(o,["activeKey","onSelect","tabItems"]);return oe(Dfe,_t(Pe({},i),{activeKey:n,onSelect:e,children:t==null?void 0:t.map(s=>oe(Dfe.Item,{eventKey:s.eventKey,children:s.itemName},s.eventKey))}))};var uGt=/[A-Z]|^ms/g,dGt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,D3e=function(e){return e.charCodeAt(1)===45},I3e=function(e){return e!=null&&typeof e!="boolean"},Mne=Jz(function(n){return D3e(n)?n:n.replace(uGt,"-$&").toLowerCase()}),A3e=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(dGt,function(i,r,o){return hp={name:r,styles:o,next:hp},r})}return fge[e]!==1&&!D3e(e)&&typeof t=="number"&&t!==0?t+"px":t};function rD(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return hp={name:t.name,styles:t.styles,next:hp},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)hp={name:i.name,styles:i.styles,next:hp},i=i.next;var r=t.styles+";";return r}return hGt(n,e,t)}case"function":{if(n!==void 0){var o=hp,s=t(n);return hp=o,rD(n,e,s)}break}}if(e==null)return t;var a=e[t];return a!==void 0?a:t}function hGt(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r<t.length;r++)i+=rD(n,e,t[r])+";";else for(var o in t){var s=t[o];if(typeof s!="object")e!=null&&e[s]!==void 0?i+=o+"{"+e[s]+"}":I3e(s)&&(i+=Mne(o)+":"+A3e(o,s)+";");else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var a=0;a<s.length;a++)I3e(s[a])&&(i+=Mne(o)+":"+A3e(o,s[a])+";");else{var l=rD(n,e,s);switch(o){case"animation":case"animationName":{i+=Mne(o)+":"+l+";";break}default:i+=o+"{"+l+"}"}}}return i}var N3e=/label:\s*([^\s;\n{]+)\s*(;|$)/g,hp,Pne=function(e,t,i){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,o="";hp=void 0;var s=e[0];s==null||s.raw===void 0?(r=!1,o+=rD(i,t,s)):o+=s[0];for(var a=1;a<e.length;a++)o+=rD(i,t,e[a]),r&&(o+=s[a]);N3e.lastIndex=0;for(var l="",c;(c=N3e.exec(o))!==null;)l+="-"+c[1];var u=hge(o)+l;return{name:u,styles:o,next:hp}},fGt=!0;function R3e(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var gGt=function(e,t,i){var r=e.key+"-"+t.name;if((i===!1||fGt===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles),e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function O3e(n,e){if(n.inserted[e.name]===void 0)return n.insert("",e,n.sheet,!0)}function M3e(n,e,t){var i=[],r=R3e(n,i,t);return i.length<2?t:r+e(i)}var pGt=function(e){var t=dge(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var i=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=Pne(c,t.registered,void 0);return gGt(t,d,!1),t.key+"-"+d.name},r=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=Pne(c,t.registered),h="animation-"+d.name;return O3e(t,{name:d.name,styles:"@keyframes "+h+"{"+d.styles+"}"}),h},o=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=Pne(c,t.registered);O3e(t,d)},s=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return M3e(t.registered,i,mGt(c))};return{css:i,cx:s,injectGlobal:o,keyframes:r,hydrate:function(l){l.forEach(function(c){t.inserted[c]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:R3e.bind(null,t.registered),merge:M3e.bind(null,t.registered,i)}},mGt=function n(e){for(var t="",i=0;i<e.length;i++){var r=e[i];if(r!=null){var o=void 0;switch(typeof r){case"boolean":break;case"object":{if(Array.isArray(r))o=n(r);else{o="";for(var s in r)r[s]&&s&&(o&&(o+=" "),o+=s)}break}default:o=r}o&&(t&&(t+=" "),t+=o)}}return t},_Gt=pGt({key:"css"}),vGt=_Gt.css;const bGt=$o.div`
|
|
2681
2681
|
background: #eee;
|
|
2682
2682
|
border-color: ${n=>n.user.color};
|
|
2683
2683
|
background-image: ${n=>'url("'+n.user.avatar+'")'};
|
|
2684
|
-
`,P3e=t=>{var i=t,{user:n}=i,e=lo(i,["user"]);return oe(bGt,Pe({className:"rounded-full motion-safe:hover:scale-110 h-8 w-8 self-center bg-cover bg-no-repeat bg-center border-2",user:n},e))},F3e=Ne.createContext({});function yGt(t){var i=t,{children:n}=i,e=lo(i,["children"]);return Ne.createElement(F3e.Provider,{value:e},n)}const B3e=!0;function CGt({baseColor:n,highlightColor:e,width:t,height:i,borderRadius:r,circle:o,direction:s,duration:a,enableAnimation:l=B3e}){const c={};return s==="rtl"&&(c["--animation-direction"]="reverse"),typeof a=="number"&&(c["--animation-duration"]=`${a}s`),l||(c["--pseudo-element-display"]="none"),(typeof t=="string"||typeof t=="number")&&(c.width=t),(typeof i=="string"||typeof i=="number")&&(c.height=i),(typeof r=="string"||typeof r=="number")&&(c.borderRadius=r),o&&(c.borderRadius="50%"),typeof n!="undefined"&&(c["--base-color"]=n),typeof e!="undefined"&&(c["--highlight-color"]=e),c}function wGt(l){var c=l,{count:n=1,wrapper:e,className:t,containerClassName:i,containerTestId:r,circle:o=!1,style:s}=c,a=lo(c,["count","wrapper","className","containerClassName","containerTestId","circle","style"]);var u,d;const h=Ne.useContext(F3e),f=_t(Pe(Pe({},h),a),{circle:o}),g=Pe(Pe({},s),CGt(f));let p="react-loading-skeleton";t&&(p+=` ${t}`);const m=(u=f.inline)!==null&&u!==void 0?u:!1,_=[];for(let v=0;v<n;v++){const b=Ne.createElement("span",{className:p,style:g,key:v},"\u200C");m?_.push(b):_.push(Ne.createElement(Ne.Fragment,{key:v},b,Ne.createElement("br",null)))}return Ne.createElement("span",{className:i,"data-testid":r,"aria-live":"polite","aria-busy":(d=f.enableAnimation)!==null&&d!==void 0?d:B3e},e?_.map((v,b)=>Ne.createElement(e,{key:b},v)):_)}var Pun="";const Fne=({count:n})=>xt(yGt,{baseColor:"#202020",highlightColor:"#444",children:[oe(wGt,{wrapper:SGt,height:15,count:n||5}),";"]});function SGt({children:n}){return oe("div",{style:{display:"block",lineHeight:1,padding:"1rem",marginTop:"0.5rem",marginBottom:"0.5rem",width:"100%"},children:n})}const xGt=$o.div`
|
|
2684
|
+
`,P3e=t=>{var i=t,{user:n}=i,e=lo(i,["user"]);return oe(bGt,Pe({className:"avatar-container rounded-full motion-safe:hover:scale-110 h-8 w-8 self-center bg-cover bg-no-repeat bg-center border-2",user:n},e))},F3e=Ne.createContext({});function yGt(t){var i=t,{children:n}=i,e=lo(i,["children"]);return Ne.createElement(F3e.Provider,{value:e},n)}const B3e=!0;function CGt({baseColor:n,highlightColor:e,width:t,height:i,borderRadius:r,circle:o,direction:s,duration:a,enableAnimation:l=B3e}){const c={};return s==="rtl"&&(c["--animation-direction"]="reverse"),typeof a=="number"&&(c["--animation-duration"]=`${a}s`),l||(c["--pseudo-element-display"]="none"),(typeof t=="string"||typeof t=="number")&&(c.width=t),(typeof i=="string"||typeof i=="number")&&(c.height=i),(typeof r=="string"||typeof r=="number")&&(c.borderRadius=r),o&&(c.borderRadius="50%"),typeof n!="undefined"&&(c["--base-color"]=n),typeof e!="undefined"&&(c["--highlight-color"]=e),c}function wGt(l){var c=l,{count:n=1,wrapper:e,className:t,containerClassName:i,containerTestId:r,circle:o=!1,style:s}=c,a=lo(c,["count","wrapper","className","containerClassName","containerTestId","circle","style"]);var u,d;const h=Ne.useContext(F3e),f=_t(Pe(Pe({},h),a),{circle:o}),g=Pe(Pe({},s),CGt(f));let p="react-loading-skeleton";t&&(p+=` ${t}`);const m=(u=f.inline)!==null&&u!==void 0?u:!1,_=[];for(let v=0;v<n;v++){const b=Ne.createElement("span",{className:p,style:g,key:v},"\u200C");m?_.push(b):_.push(Ne.createElement(Ne.Fragment,{key:v},b,Ne.createElement("br",null)))}return Ne.createElement("span",{className:i,"data-testid":r,"aria-live":"polite","aria-busy":(d=f.enableAnimation)!==null&&d!==void 0?d:B3e},e?_.map((v,b)=>Ne.createElement(e,{key:b},v)):_)}var Pun="";const Fne=({count:n})=>xt(yGt,{baseColor:"#202020",highlightColor:"#444",children:[oe(wGt,{wrapper:SGt,height:15,count:n||5}),";"]});function SGt({children:n}){return oe("div",{style:{display:"block",lineHeight:1,padding:"1rem",marginTop:"0.5rem",marginBottom:"0.5rem",width:"100%"},children:n})}const xGt=$o.div`
|
|
2685
2685
|
position: relative;
|
|
2686
2686
|
display: flex;
|
|
2687
2687
|
align-items: center;
|