filecat 7.14.4 → 7.15.0
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/build/dist/{1142.97da60368424992aa345.js → 1142.6cec4d95f144c80952de.js} +1 -1
- package/build/dist/{2572.7e7a9c31be5b678fae9f.js → 2572.48803ebce6979dfb42d8.js} +1 -1
- package/build/dist/{2674.57dca88c03c75c01a508.js → 2674.7cf072e7b6b1ea494153.js} +1 -1
- package/build/dist/6104.b140fbfeeb1bc5fcfc70.js +1 -0
- package/build/dist/6332.b6647d265cbe3061d5bd.js +1 -0
- package/build/dist/{6404.a2bcc23b592dbd6d719b.js → 6404.288a0ac8b516b5420a33.js} +1 -1
- package/build/dist/{735.80eacc3ca29a27059b14.js → 735.542ce0a03ec2ab236b79.js} +1 -1
- package/build/dist/{9299.d5615865bd9ebd376923.js → 9299.916f6075dbcd5f1af5f7.js} +1 -1
- package/build/dist/dark.css +14 -28
- package/build/dist/google-dark.css +15 -25
- package/build/dist/google.css +5 -13
- package/build/dist/index.html +1 -1
- package/build/dist/main.cc7cfac98131b3544b23.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/3299.937b009da6be833febd9.js +0 -1
- package/build/dist/8365.e876e79b3f2031b20183.js +0 -1
- package/build/dist/main.393fb0005ec80a2b4828.js +0 -2
- /package/build/dist/{main.393fb0005ec80a2b4828.js.LICENSE.txt → main.cc7cfac98131b3544b23.js.LICENSE.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6404,8277],{35304(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(96540),r=n(57889),l=(n(14284),n(62042)),o=n(22022),i=n(45602),c=(n(88781),n(86063));const d={classic:{backgroundColor:"#fafafa",lineColor:"#4d8f7f",lineWidth:2,root:{fillColor:"#4d8f7f",color:"#fff",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#fff",color:"#2f4f47",borderRadius:5,borderColor:"#4d8f7f",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#fff",color:"#3c3c3c",borderRadius:5,borderColor:"#a8d5c8",borderWidth:1,paddingX:12,paddingY:5}},dark:{backgroundColor:"#1f2226",lineColor:"#6b7c8c",lineWidth:1,root:{fillColor:"#3a4654",color:"#f2f4f6",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#2b323a",color:"#e6eaef",borderRadius:5,borderColor:"#4c5866",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#242a31",color:"#ccd3da",borderRadius:5,borderColor:"#3c454f",borderWidth:1,paddingX:12,paddingY:5}},simple:{backgroundColor:"#fff",lineColor:"#c8ccd0",lineWidth:1,root:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:10,paddingY:4},second:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3},node:{fillColor:"transparent",color:"#5f6368",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3}},colorful:{backgroundColor:"#fffdf6",lineColor:"#f2a65a",lineWidth:2,root:{fillColor:"#f2854a",color:"#fff",borderRadius:24,paddingX:20,paddingY:9},second:{fillColor:"#ffd66b",color:"#6b4a12",borderRadius:16,borderWidth:0,paddingX:14,paddingY:6},node:{fillColor:"#a8d8ea",color:"#1e3f4d",borderRadius:12,borderWidth:0,paddingX:12,paddingY:5}}};var s=n(34843),u=n(82893),m=n(61443),p=n(74848);function f(e){const[t,n]=(0,a.useState)(e.initValue||""),r=t=>{n(t),e.onChange(t)};return e.multiline?(0,p.jsx)("div",{className:"prompt-input",children:(0,p.jsx)(m.Z2,{placeholder:e.placeholder||"",rows:e.rows??5,value:t,handleInputChange:r})}):(0,p.jsx)("div",{className:"prompt-input",children:(0,p.jsx)(m.Sm,{placeholder:e.placeholder||"",value:t,handleInputChange:r})})}var E,b=n(75725),_=n(85997);n(30576);E=i.default,Object.entries(d).forEach(([e,t])=>{E.defineTheme?.(e,t)});const h=[{cmd:"INSERT_CHILD_NODE",icon:"account_tree",label:"添加子节点"},{cmd:"INSERT_NODE",icon:"subdirectory_arrow_right",label:"添加同级节点"},{cmd:"INSERT_PARENT_NODE",icon:"arrow_upward",label:"插入父节点"},{cmd:"CUT_NODE",icon:"content_cut",label:"剪切"},{cmd:"PASTE_NODE",icon:"content_paste",label:"粘贴"},{cmd:"REMOVE_NODE",icon:"delete",label:"删除节点"},{cmd:"INSERT_GROUP",icon:"add_circle_outline",label:"插入",children:[{cmd:"SET_NODE_ICON",icon:"emoji_emotions",label:"插入图标"},{cmd:"REMOVE_NODE_ICON",icon:"format_clear",label:"删除图标"},{cmd:"SET_NODE_NOTE",icon:"sticky_note_2",label:"节点备注"},{cmd:"REMOVE_NODE_NOTE",icon:"speaker_notes_off",label:"删除备注"},{cmd:"SET_NODE_TAG",icon:"sell",label:"节点标签"},{cmd:"REMOVE_NODE_TAG",icon:"label_off",label:"删除标签"},{cmd:"SET_NODE_HYPERLINK",icon:"link",label:"插入超链接"},{cmd:"REMOVE_NODE_HYPERLINK",icon:"link_off",label:"删除超链接"}]},{cmd:"ADD_GENERALIZATION",icon:"call_merge",label:"添加概要"},{cmd:"REMOVE_GENERALIZATION",icon:"call_split",label:"删除概要"}],N=[{value:"logicalStructure",label:"逻辑结构图"},{value:"mindMap",label:"思维导图"},{value:"organizationStructure",label:"组织结构图"},{value:"catalogOrganization",label:"目录组织图"},{value:"timeline",label:"时间轴(左)"},{value:"timeline2",label:"时间轴(下)"},{value:"timeline3",label:"时间轴(上)"},{value:"verticalTimeline",label:"时间轴(竖)"},{value:"fishbone",label:"鱼骨图"},{value:"rightFishbone",label:"鱼骨图(右)"}],v=[{value:"curve",label:"曲线"},{value:"straight",label:"直线"},{value:"direct",label:"直连"}],g=[{value:"default",label:"默认主题"},{value:"classic",label:"经典"},{value:"dark",label:"暗色"},{value:"simple",label:"极简"},{value:"colorful",label:"缤纷"}],x=i.default.iconList||[];function C(e){const{t}=(0,o.Bd)(),[n,d]=(0,a.useState)(!0),[m,E]=(0,a.useState)(""),[C,y]=(0,a.useState)(100),[D,T]=(0,a.useState)("default"),[,w]=(0,s.fp)(u.AG.prompt_card),[j,R]=(0,a.useState)("mindMap"),[S,k]=(0,a.useState)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),A=(0,a.useRef)(null),M=(0,a.useRef)(!1),Y=(0,a.useRef)({props:e});Y.current={props:e};const W=()=>{M.current||(M.current=!0,Y.current.props.on_dirty?.(!0))},P=async(e=!1)=>{if(!A.current)return e||(0,l.zN)(t("编辑器尚未就绪")),!1;const n=await Y.current.props.on_save((()=>{const e=A.current;return e?JSON.stringify(e.getData(!0)):""})(),e);return n&&(M.current=!1,Y.current.props.on_dirty?.(!1),Y.current.props.on_saved?.()),n};(0,a.useEffect)(()=>{e.register?.({save:P,is_dirty:()=>M.current})},[e.register]),(0,a.useEffect)(()=>{if(!I.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const a=[];A.current?.destroy?.(),A.current=null,M.current=!1,d(!0),E("");const o=async e=>{if(n||!I.current)return;const r=e&&e.root?e:null,l=r?r.root:e??{data:{text:t("中心主题")}},o=new i.default({el:I.current,data:l,fit:!0,enableDblclickBackToRootNode:!0,enableShortcutOnlyWhenMouseInSvg:!0,autoMoveWhenMouseInEdgeOnDrag:!0,...c.k$});A.current=o,r&&o.setFullData(r),d(!1),T(o.getTheme?.()||"default"),R(o.getLayout?.()||"mindMap");window.requestAnimationFrame(()=>{n||(()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);a.push(t),o.on("data_change",()=>{e&&(W(),y(O(o)))}),o.on("view_data_change",()=>{y(O(o))}),o.on("error",(e,t)=>{console.error("[mind]",e,t)}),y(O(o))})()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const a=await r.l.get(e.url);if(n)return;t=a}let a=null;if("string"==typeof t&&t.trim())try{a=JSON.parse(t)}catch{a=null}else t&&"object"==typeof t&&(a=t);a=(0,c.tW)(a),await o(a)}catch(e){n||(d(!1),E(t("加载思维导图失败")),(0,l.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,a.forEach(e=>window.clearTimeout(e)),A.current?.destroy?.(),A.current=null}},[e.url,e.data]),(0,a.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),P())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const V=e=>{const t=A.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),y(Math.round(100*n))},G={SET_NODE_NOTE:{title:"节点备注",placeholder:"请输入节点备注",get:e=>e.getData("note")||""},SET_NODE_TAG:{title:"节点标签",placeholder:"请输入节点标签,多个用逗号分隔",get:e=>(e.getData("tag")||[]).join(",")},SET_NODE_HYPERLINK:{title:"插入超链接",placeholder:"请输入链接地址",get:e=>e.getData("hyperlink")||""}};(0,a.useEffect)(()=>{if(!S)return;const e=()=>k(null),t=window.setTimeout(()=>{window.addEventListener("click",e),window.addEventListener("blur",e)},0);return()=>{window.clearTimeout(t),window.removeEventListener("click",e),window.removeEventListener("blur",e)}},[S]),(0,a.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=A.current?.renderer?.activeNodeList?.[0];t&&(e.preventDefault(),e.stopPropagation(),k({x:e.clientX,y:e.clientY,node:t}))};return e.addEventListener("contextmenu",t,!0),()=>e.removeEventListener("contextmenu",t,!0)},[]);const X=e=>e.map(e=>({v:e.cmd,r:(0,p.jsxs)("div",{className:"common-tag-center mind-menu-row",children:[(0,p.jsx)(_.In,{icon:e.icon,not_use_icon_style:!0}),(0,p.jsx)("span",{children:t(e.label)})]}),items:e.children?X(e.children):void 0})),H=e=>{const n=A.current,a=S;if(n&&a){if(k(null),"ADD_GENERALIZATION"===e||"REMOVE_GENERALIZATION"===e)return n.execCommand(e),void W();"SET_NODE_NOTE"!==e&&"SET_NODE_TAG"!==e&&"SET_NODE_HYPERLINK"!==e?"SET_NODE_ICON"!==e?e.startsWith("REMOVE_NODE_")?((e,t)=>{e&&("REMOVE_NODE_ICON"===t?A.current.execCommand("SET_NODE_ICON",e,[]):"REMOVE_NODE_NOTE"===t?A.current.execCommand("SET_NODE_NOTE",e,""):"REMOVE_NODE_TAG"===t?A.current.execCommand("SET_NODE_TAG",e,[]):"REMOVE_NODE_HYPERLINK"===t&&A.current.execCommand("SET_NODE_HYPERLINK",e,"",""),W())})(a.node,e):(n.execCommand(e,a.node),W()):(e=>{if(!e)return;const n=Array.isArray(e.getData("icon"))?e.getData("icon"):[];w({open:!0,title:t("插入图标"),context_div:(0,p.jsx)("div",{className:"prompt-icon-list",children:x.flatMap(t=>(t.list||[]).map((a,r)=>(0,p.jsx)("button",{type:"button",className:"prompt-icon-list__item",title:a.name,dangerouslySetInnerHTML:{__html:a.icon},onClick:()=>{A.current.execCommand("SET_NODE_ICON",e,[...n,`${t.type}_${a.name}`]),w({open:!1}),W()}},t.type+r)))}),cancel:()=>w({open:!1})})})(a.node):((e,n)=>{if(!e)return;const a=G[n],r=a.get(e);let l=r;w({open:!0,title:t(a.title),context_div:(0,p.jsx)(f,{initValue:r,placeholder:t(a.placeholder),multiline:!0,onChange:e=>l=e}),confirm:()=>{const t=l.trim();"SET_NODE_TAG"===n?A.current.execCommand(n,e,t.split(/[,,]/).map(e=>e.trim()).filter(Boolean)):"SET_NODE_HYPERLINK"===n?A.current.execCommand(n,e,t,t):A.current.execCommand(n,e,t),w({open:!1}),W()},cancel:()=>w({open:!1})})})(a.node,e)}};return(0,p.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,p.jsxs)("div",{className:"mind-toolbar",children:[(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>A.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>A.current?.execCommand?.("INSERT_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>A.current?.execCommand?.("REMOVE_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"delete"})}),(0,p.jsx)("span",{className:"mind-toolbar__sep"}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("撤销")+" (Ctrl+Z)",onClick:()=>A.current?.execCommand?.("BACK"),children:(0,p.jsx)("span",{className:"material-icons",children:"undo"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("重做")+" (Ctrl+Y)",onClick:()=>A.current?.execCommand?.("FORWARD"),children:(0,p.jsx)("span",{className:"material-icons",children:"redo"})}),(0,p.jsx)("span",{className:"mind-toolbar__sep"}),(0,p.jsxs)("span",{className:"mind-toolbar__zoom",children:[C,"%"]}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>V(O(A.current)/100-.2),children:(0,p.jsx)("span",{className:"material-icons",children:"remove"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>V(O(A.current)/100+.2),children:(0,p.jsx)("span",{className:"material-icons",children:"add"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>{A.current?.view?.fit?.(),y(O(A.current))},children:(0,p.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,p.jsxs)("div",{className:"mind-toolbar mind-toolbar--sub",children:[(0,p.jsx)("select",{className:"mind-select",title:t("结构"),value:j,onChange:e=>{const t=e.target.value;A.current?.setLayout?.(t),R(t),W()},children:N.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,p.jsxs)("select",{className:"mind-select",title:t("连线风格"),defaultValue:"",onChange:e=>{const t=e.target.value;if(t){const e=A.current?.getCustomThemeConfig?.()||{};A.current?.setThemeConfig?.({...e,lineStyle:t}),W()}e.target.value=""},children:[(0,p.jsx)("option",{value:"",children:t("连线风格")}),v.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))]}),(0,p.jsx)("select",{className:"mind-select",title:t("主题"),value:D,onChange:e=>{const t=e.target.value;T(t),A.current?.setTheme?.(t),W()},children:g.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,p.jsx)("span",{className:"mind-toolbar__gap"})]}),(0,p.jsxs)("div",{className:"mind-canvas",ref:L,children:[(0,p.jsx)("div",{className:"mind-mount",ref:I}),n&&(0,p.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,p.jsx)("div",{className:"mind-mask",children:m}),S&&(0,p.jsx)(b.rY,{click:()=>k(null),children:(0,p.jsx)(b.Pu,{x:S.x,y:S.y,items:X(h),click:e=>H(e)})})]})]})}function O(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){"use strict";function a(e){return"smm-mind"===e}n.d(t,{Hn:()=>s,hj:()=>a,tW:()=>o});const r={mousewheelMoveStep:35,scaleRatio:.08};let l=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?i(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e:{...e,root:c(e.root)}:e.data&&"object"==typeof e.data?e:c(e):null}function i(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(i):[]}}function c(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(c):[]}}function d(e){e.stopPropagation()}async function s(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),a=await(l||(l=Promise.all([Promise.all([n.e(8725),n.e(2728),n.e(2130),n.e(5602),n.e(8277)]).then(n.bind(n,45602)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),l);return{data:t,async mount(e,n){let l=!1;const o=await function(e,t){return new Promise(n=>{const a=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(a,16)};a()})}(e,()=>l);if(!o)return{destroy:()=>{},get_data:()=>null};const i=document.createElement("div");i.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",d,{capture:!0,passive:!0}),e.append(i);const c=new a({el:i,data:t?.root??t??{data:{text:""}},readonly:!n?.editable,fit:!0,...r});return t?.root&&c.setFullData(t),{destroy:()=>{l=!0,e.removeEventListener("wheel",d,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}n.d(t,["k$",0,r])},28277(){}}]);
|
|
1
|
+
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6404,8277],{35304(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(96540),r=n(57889),l=(n(14284),n(62042)),o=n(22022),i=n(45602),c=(n(88781),n(86063));const d={classic:{backgroundColor:"#fafafa",lineColor:"#4d8f7f",lineWidth:2,root:{fillColor:"#4d8f7f",color:"#fff",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#fff",color:"#2f4f47",borderRadius:5,borderColor:"#4d8f7f",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#fff",color:"#3c3c3c",borderRadius:5,borderColor:"#a8d5c8",borderWidth:1,paddingX:12,paddingY:5}},dark:{backgroundColor:"#1f2226",lineColor:"#6b7c8c",lineWidth:1,root:{fillColor:"#3a4654",color:"#f2f4f6",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#2b323a",color:"#e6eaef",borderRadius:5,borderColor:"#4c5866",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#242a31",color:"#ccd3da",borderRadius:5,borderColor:"#3c454f",borderWidth:1,paddingX:12,paddingY:5}},simple:{backgroundColor:"#fff",lineColor:"#c8ccd0",lineWidth:1,root:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:10,paddingY:4},second:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3},node:{fillColor:"transparent",color:"#5f6368",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3}},colorful:{backgroundColor:"#fffdf6",lineColor:"#f2a65a",lineWidth:2,root:{fillColor:"#f2854a",color:"#fff",borderRadius:24,paddingX:20,paddingY:9},second:{fillColor:"#ffd66b",color:"#6b4a12",borderRadius:16,borderWidth:0,paddingX:14,paddingY:6},node:{fillColor:"#a8d8ea",color:"#1e3f4d",borderRadius:12,borderWidth:0,paddingX:12,paddingY:5}}};var s=n(34843),u=n(82893),m=n(61443),p=n(74848);function f(e){const[t,n]=(0,a.useState)(e.initValue||""),r=t=>{n(t),e.onChange(t)};return e.multiline?(0,p.jsx)("div",{className:"prompt-input",children:(0,p.jsx)(m.Z2,{placeholder:e.placeholder||"",rows:e.rows??5,value:t,handleInputChange:r})}):(0,p.jsx)("div",{className:"prompt-input",children:(0,p.jsx)(m.Sm,{placeholder:e.placeholder||"",value:t,handleInputChange:r})})}var E,b=n(75725),_=n(85997);n(30576);E=i.default,Object.entries(d).forEach(([e,t])=>{E.defineTheme?.(e,t)});const h=[{cmd:"INSERT_CHILD_NODE",icon:"account_tree",label:"添加子节点"},{cmd:"INSERT_NODE",icon:"subdirectory_arrow_right",label:"添加同级节点"},{cmd:"INSERT_PARENT_NODE",icon:"arrow_upward",label:"插入父节点"},{cmd:"CUT_NODE",icon:"content_cut",label:"剪切"},{cmd:"PASTE_NODE",icon:"content_paste",label:"粘贴"},{cmd:"REMOVE_NODE",icon:"delete",label:"删除节点"},{cmd:"INSERT_GROUP",icon:"add_circle_outline",label:"插入",children:[{cmd:"SET_NODE_ICON",icon:"emoji_emotions",label:"插入图标"},{cmd:"REMOVE_NODE_ICON",icon:"format_clear",label:"删除图标"},{cmd:"SET_NODE_NOTE",icon:"sticky_note_2",label:"节点备注"},{cmd:"REMOVE_NODE_NOTE",icon:"speaker_notes_off",label:"删除备注"},{cmd:"SET_NODE_TAG",icon:"sell",label:"节点标签"},{cmd:"REMOVE_NODE_TAG",icon:"label_off",label:"删除标签"},{cmd:"SET_NODE_HYPERLINK",icon:"link",label:"插入超链接"},{cmd:"REMOVE_NODE_HYPERLINK",icon:"link_off",label:"删除超链接"}]},{cmd:"ADD_GENERALIZATION",icon:"call_merge",label:"添加概要"},{cmd:"REMOVE_GENERALIZATION",icon:"call_split",label:"删除概要"}],N=[{value:"logicalStructure",label:"逻辑结构图"},{value:"mindMap",label:"思维导图"},{value:"organizationStructure",label:"组织结构图"},{value:"catalogOrganization",label:"目录组织图"},{value:"timeline",label:"时间轴(左)"},{value:"timeline2",label:"时间轴(下)"},{value:"timeline3",label:"时间轴(上)"},{value:"verticalTimeline",label:"时间轴(竖)"},{value:"fishbone",label:"鱼骨图"},{value:"rightFishbone",label:"鱼骨图(右)"}],v=[{value:"curve",label:"曲线"},{value:"straight",label:"直线"},{value:"direct",label:"直连"}],g=[{value:"default",label:"默认主题"},{value:"classic",label:"经典"},{value:"dark",label:"暗色"},{value:"simple",label:"极简"},{value:"colorful",label:"缤纷"}],x=i.default.iconList||[];function C(e){const{t}=(0,o.Bd)(),[n,d]=(0,a.useState)(!0),[m,E]=(0,a.useState)(""),[C,y]=(0,a.useState)(100),[D,T]=(0,a.useState)("default"),[,w]=(0,s.fp)(u.AG.prompt_card),[j,R]=(0,a.useState)("mindMap"),[S,k]=(0,a.useState)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),A=(0,a.useRef)(null),M=(0,a.useRef)(!1),Y=(0,a.useRef)({props:e});Y.current={props:e};const W=()=>{M.current||(M.current=!0,Y.current.props.on_dirty?.(!0))},P=async(e=!1)=>{if(!A.current)return e||(0,l.zN)(t("编辑器尚未就绪")),!1;const n=await Y.current.props.on_save((()=>{const e=A.current;return e?JSON.stringify(e.getData(!0)):""})(),e);return n&&(M.current=!1,Y.current.props.on_dirty?.(!1),Y.current.props.on_saved?.()),n};(0,a.useEffect)(()=>{e.register?.({save:P,is_dirty:()=>M.current})},[e.register]),(0,a.useEffect)(()=>{if(!I.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const a=[];A.current?.destroy?.(),A.current=null,M.current=!1,d(!0),E("");const o=async e=>{if(n||!I.current)return;const r=e&&e.root?e:null,l=r?r.root:e??{data:{text:t("中心主题")}},o=new i.default({el:I.current,data:l,fit:!0,enableDblclickBackToRootNode:!0,enableShortcutOnlyWhenMouseInSvg:!0,autoMoveWhenMouseInEdgeOnDrag:!0,...c.k$});A.current=o,r&&o.setFullData(r),d(!1),T(o.getTheme?.()||"default"),R(o.getLayout?.()||"mindMap");window.requestAnimationFrame(()=>{n||(()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);a.push(t),o.on("data_change",()=>{e&&(W(),y(O(o)))}),o.on("view_data_change",()=>{y(O(o))}),o.on("error",(e,t)=>{console.error("[mind]",e,t)}),y(O(o))})()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const a=await r.l.get(e.url);if(n)return;t=a}let a=null;if("string"==typeof t&&t.trim())try{a=JSON.parse(t)}catch{a=null}else t&&"object"==typeof t&&(a=t);a=(0,c.tW)(a),await o(a)}catch(e){n||(d(!1),E(t("加载思维导图失败")),(0,l.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,a.forEach(e=>window.clearTimeout(e)),A.current?.destroy?.(),A.current=null}},[e.url,e.data]),(0,a.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),P())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const V=e=>{const t=A.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),y(Math.round(100*n))},G={SET_NODE_NOTE:{title:"节点备注",placeholder:"请输入节点备注",get:e=>e.getData("note")||""},SET_NODE_TAG:{title:"节点标签",placeholder:"请输入节点标签,多个用逗号分隔",get:e=>(e.getData("tag")||[]).join(",")},SET_NODE_HYPERLINK:{title:"插入超链接",placeholder:"请输入链接地址",get:e=>e.getData("hyperlink")||""}};(0,a.useEffect)(()=>{if(!S)return;const e=()=>k(null),t=window.setTimeout(()=>{window.addEventListener("click",e),window.addEventListener("blur",e)},0);return()=>{window.clearTimeout(t),window.removeEventListener("click",e),window.removeEventListener("blur",e)}},[S]),(0,a.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=A.current?.renderer?.activeNodeList?.[0];t&&(e.preventDefault(),e.stopPropagation(),k({x:e.clientX,y:e.clientY,node:t}))};return e.addEventListener("contextmenu",t,!0),()=>e.removeEventListener("contextmenu",t,!0)},[]);const X=e=>e.map(e=>({v:e.cmd,r:(0,p.jsxs)("div",{className:"common-tag-center mind-menu-row",children:[(0,p.jsx)(_.In,{icon:e.icon,not_use_icon_style:!0}),(0,p.jsx)("span",{children:t(e.label)})]}),items:e.children?X(e.children):void 0})),H=e=>{const n=A.current,a=S;if(n&&a){if(k(null),"ADD_GENERALIZATION"===e||"REMOVE_GENERALIZATION"===e)return n.execCommand(e),void W();"SET_NODE_NOTE"!==e&&"SET_NODE_TAG"!==e&&"SET_NODE_HYPERLINK"!==e?"SET_NODE_ICON"!==e?e.startsWith("REMOVE_NODE_")?((e,t)=>{e&&("REMOVE_NODE_ICON"===t?A.current.execCommand("SET_NODE_ICON",e,[]):"REMOVE_NODE_NOTE"===t?A.current.execCommand("SET_NODE_NOTE",e,""):"REMOVE_NODE_TAG"===t?A.current.execCommand("SET_NODE_TAG",e,[]):"REMOVE_NODE_HYPERLINK"===t&&A.current.execCommand("SET_NODE_HYPERLINK",e,"",""),W())})(a.node,e):(n.execCommand(e,a.node),W()):(e=>{if(!e)return;const n=Array.isArray(e.getData("icon"))?e.getData("icon"):[];w({open:!0,title:t("插入图标"),context_div:(0,p.jsx)("div",{className:"prompt-icon-list",children:x.flatMap(t=>(t.list||[]).map((a,r)=>(0,p.jsx)("button",{type:"button",className:"prompt-icon-list__item",title:a.name,dangerouslySetInnerHTML:{__html:a.icon},onClick:()=>{A.current.execCommand("SET_NODE_ICON",e,[...n,`${t.type}_${a.name}`]),w({open:!1}),W()}},t.type+r)))}),cancel:()=>w({open:!1})})})(a.node):((e,n)=>{if(!e)return;const a=G[n],r=a.get(e);let l=r;w({open:!0,title:t(a.title),context_div:(0,p.jsx)(f,{initValue:r,placeholder:t(a.placeholder),multiline:!0,onChange:e=>l=e}),confirm:()=>{const t=l.trim();"SET_NODE_TAG"===n?A.current.execCommand(n,e,t.split(/[,,]/).map(e=>e.trim()).filter(Boolean)):"SET_NODE_HYPERLINK"===n?A.current.execCommand(n,e,t,t):A.current.execCommand(n,e,t),w({open:!1}),W()},cancel:()=>w({open:!1})})})(a.node,e)}};return(0,p.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,p.jsxs)("div",{className:"mind-toolbar",children:[(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>A.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>A.current?.execCommand?.("INSERT_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>A.current?.execCommand?.("REMOVE_NODE"),children:(0,p.jsx)("span",{className:"material-icons",children:"delete"})}),(0,p.jsx)("span",{className:"mind-toolbar__sep"}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("撤销")+" (Ctrl+Z)",onClick:()=>A.current?.execCommand?.("BACK"),children:(0,p.jsx)("span",{className:"material-icons",children:"undo"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("重做")+" (Ctrl+Y)",onClick:()=>A.current?.execCommand?.("FORWARD"),children:(0,p.jsx)("span",{className:"material-icons",children:"redo"})}),(0,p.jsx)("span",{className:"mind-toolbar__sep"}),(0,p.jsxs)("span",{className:"mind-toolbar__zoom",children:[C,"%"]}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>V(O(A.current)/100-.2),children:(0,p.jsx)("span",{className:"material-icons",children:"remove"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>V(O(A.current)/100+.2),children:(0,p.jsx)("span",{className:"material-icons",children:"add"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>{A.current?.view?.fit?.(),y(O(A.current))},children:(0,p.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,p.jsxs)("div",{className:"mind-toolbar mind-toolbar--sub",children:[(0,p.jsx)("select",{className:"mind-select",title:t("结构"),value:j,onChange:e=>{const t=e.target.value;A.current?.setLayout?.(t),R(t),W()},children:N.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,p.jsxs)("select",{className:"mind-select",title:t("连线风格"),defaultValue:"",onChange:e=>{const t=e.target.value;if(t){const e=A.current?.getCustomThemeConfig?.()||{};A.current?.setThemeConfig?.({...e,lineStyle:t}),W()}e.target.value=""},children:[(0,p.jsx)("option",{value:"",children:t("连线风格")}),v.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))]}),(0,p.jsx)("select",{className:"mind-select",title:t("主题"),value:D,onChange:e=>{const t=e.target.value;T(t),A.current?.setTheme?.(t),W()},children:g.map(e=>(0,p.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,p.jsx)("span",{className:"mind-toolbar__gap"})]}),(0,p.jsxs)("div",{className:"mind-canvas",ref:L,children:[(0,p.jsx)("div",{className:"mind-mount",ref:I}),n&&(0,p.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,p.jsx)("div",{className:"mind-mask",children:m}),S&&(0,p.jsx)(b.rY,{click:()=>k(null),children:(0,p.jsx)(b.sw,{x:S.x,y:S.y,items:X(h),click:e=>H(e)})})]})]})}function O(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){"use strict";function a(e){return"smm-mind"===e}n.d(t,{Hn:()=>s,hj:()=>a,tW:()=>o});const r={mousewheelMoveStep:35,scaleRatio:.08};let l=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?i(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e:{...e,root:c(e.root)}:e.data&&"object"==typeof e.data?e:c(e):null}function i(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(i):[]}}function c(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(c):[]}}function d(e){e.stopPropagation()}async function s(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),a=await(l||(l=Promise.all([Promise.all([n.e(8725),n.e(2728),n.e(2130),n.e(5602),n.e(8277)]).then(n.bind(n,45602)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),l);return{data:t,async mount(e,n){let l=!1;const o=await function(e,t){return new Promise(n=>{const a=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(a,16)};a()})}(e,()=>l);if(!o)return{destroy:()=>{},get_data:()=>null};const i=document.createElement("div");i.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",d,{capture:!0,passive:!0}),e.append(i);const c=new a({el:i,data:t?.root??t??{data:{text:""}},readonly:!n?.editable,fit:!0,...r});return t?.root&&c.setFullData(t),{destroy:()=>{l=!0,e.removeEventListener("wheel",d,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}n.d(t,["k$",0,r])},28277(){}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[735,6404,8277],{87943(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>b});var a=n(96540),r=n(34843),l=n(82893),o=n(14284),i=n(62042),c=n(53459),d=n(34289),s=n(22022),u=n(35304),m=n(93245),f=n(23430),p=n(74848);function b(){const[e,t]=(0,r.fp)(l.AG.mind_editor),[n,b]=(0,a.useState)(!1),{t:_}=(0,s.Bd)(),E=(0,a.useRef)(null),h=void 0!==e.code_source,N=()=>{n&&!window.confirm(_("有未保存的修改,确定要关闭吗?"))||(t({}),e?.close?.())},v=async(e=!1)=>{await(E.current?.save(e))},g=(0,a.useRef)(n);return g.current=n,(0,m.a)(f.nE.mind,()=>!h&&g.current,e=>v(e),h),(0,a.useEffect)(()=>{if(void 0===e.url&&void 0===e.code_source)return;const t=e=>{"Escape"===e.key&&(e.stopPropagation(),N())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e.url,e.code_source,n]),void 0!==e.url||h?(0,p.jsx)("div",{id:"mind-container",className:h?"mind-container--over":void 0,children:(0,p.jsx)("div",{className:"mind-context",children:(0,p.jsx)(u.default,{fullscreen:!0,reset_key:e.url??e.name,url:h?void 0:e.url,data:h?e.code_source:void 0,on_dirty:b,register:e=>{E.current=e},header:(0,p.jsxs)("div",{className:"mind-topbar",children:[(0,p.jsx)("span",{className:"material-icons mind-topbar__icon",children:"account_tree"}),(0,p.jsx)("span",{className:"mind-topbar__name",children:e.name}),(0,p.jsx)("span",{style:{flex:1}}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:_("保存")+" (Ctrl+S)",onClick:v,children:(0,p.jsx)("span",{className:"material-icons",children:"save"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:_("关闭"),onClick:N,children:(0,p.jsx)("span",{className:"material-icons",children:"close"})})]}),on_save:async(n,a)=>{if(h)return e.on_save_code?.(n),a||(0,i.SK)(_("保存成功")),t({}),!0;return(await o.$M.post(`save/${encodeURIComponent((0,d.GG)("file",(0,d.vX)()))}${e.name}`,{context:n})).code===c.m.Success&&(a||(0,i.SK)(_("保存成功")),!0)}})})}):null}},35304(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(96540),r=n(57889),l=(n(14284),n(62042)),o=n(22022),i=n(45602),c=(n(88781),n(86063));const d={classic:{backgroundColor:"#fafafa",lineColor:"#4d8f7f",lineWidth:2,root:{fillColor:"#4d8f7f",color:"#fff",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#fff",color:"#2f4f47",borderRadius:5,borderColor:"#4d8f7f",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#fff",color:"#3c3c3c",borderRadius:5,borderColor:"#a8d5c8",borderWidth:1,paddingX:12,paddingY:5}},dark:{backgroundColor:"#1f2226",lineColor:"#6b7c8c",lineWidth:1,root:{fillColor:"#3a4654",color:"#f2f4f6",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#2b323a",color:"#e6eaef",borderRadius:5,borderColor:"#4c5866",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#242a31",color:"#ccd3da",borderRadius:5,borderColor:"#3c454f",borderWidth:1,paddingX:12,paddingY:5}},simple:{backgroundColor:"#fff",lineColor:"#c8ccd0",lineWidth:1,root:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:10,paddingY:4},second:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3},node:{fillColor:"transparent",color:"#5f6368",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3}},colorful:{backgroundColor:"#fffdf6",lineColor:"#f2a65a",lineWidth:2,root:{fillColor:"#f2854a",color:"#fff",borderRadius:24,paddingX:20,paddingY:9},second:{fillColor:"#ffd66b",color:"#6b4a12",borderRadius:16,borderWidth:0,paddingX:14,paddingY:6},node:{fillColor:"#a8d8ea",color:"#1e3f4d",borderRadius:12,borderWidth:0,paddingX:12,paddingY:5}}};var s=n(34843),u=n(82893),m=n(61443),f=n(74848);function p(e){const[t,n]=(0,a.useState)(e.initValue||""),r=t=>{n(t),e.onChange(t)};return e.multiline?(0,f.jsx)("div",{className:"prompt-input",children:(0,f.jsx)(m.Z2,{placeholder:e.placeholder||"",rows:e.rows??5,value:t,handleInputChange:r})}):(0,f.jsx)("div",{className:"prompt-input",children:(0,f.jsx)(m.Sm,{placeholder:e.placeholder||"",value:t,handleInputChange:r})})}var b,_=n(75725),E=n(85997);n(30576);b=i.default,Object.entries(d).forEach(([e,t])=>{b.defineTheme?.(e,t)});const h=[{cmd:"INSERT_CHILD_NODE",icon:"account_tree",label:"添加子节点"},{cmd:"INSERT_NODE",icon:"subdirectory_arrow_right",label:"添加同级节点"},{cmd:"INSERT_PARENT_NODE",icon:"arrow_upward",label:"插入父节点"},{cmd:"CUT_NODE",icon:"content_cut",label:"剪切"},{cmd:"PASTE_NODE",icon:"content_paste",label:"粘贴"},{cmd:"REMOVE_NODE",icon:"delete",label:"删除节点"},{cmd:"INSERT_GROUP",icon:"add_circle_outline",label:"插入",children:[{cmd:"SET_NODE_ICON",icon:"emoji_emotions",label:"插入图标"},{cmd:"REMOVE_NODE_ICON",icon:"format_clear",label:"删除图标"},{cmd:"SET_NODE_NOTE",icon:"sticky_note_2",label:"节点备注"},{cmd:"REMOVE_NODE_NOTE",icon:"speaker_notes_off",label:"删除备注"},{cmd:"SET_NODE_TAG",icon:"sell",label:"节点标签"},{cmd:"REMOVE_NODE_TAG",icon:"label_off",label:"删除标签"},{cmd:"SET_NODE_HYPERLINK",icon:"link",label:"插入超链接"},{cmd:"REMOVE_NODE_HYPERLINK",icon:"link_off",label:"删除超链接"}]},{cmd:"ADD_GENERALIZATION",icon:"call_merge",label:"添加概要"},{cmd:"REMOVE_GENERALIZATION",icon:"call_split",label:"删除概要"}],N=[{value:"logicalStructure",label:"逻辑结构图"},{value:"mindMap",label:"思维导图"},{value:"organizationStructure",label:"组织结构图"},{value:"catalogOrganization",label:"目录组织图"},{value:"timeline",label:"时间轴(左)"},{value:"timeline2",label:"时间轴(下)"},{value:"timeline3",label:"时间轴(上)"},{value:"verticalTimeline",label:"时间轴(竖)"},{value:"fishbone",label:"鱼骨图"},{value:"rightFishbone",label:"鱼骨图(右)"}],v=[{value:"curve",label:"曲线"},{value:"straight",label:"直线"},{value:"direct",label:"直连"}],g=[{value:"default",label:"默认主题"},{value:"classic",label:"经典"},{value:"dark",label:"暗色"},{value:"simple",label:"极简"},{value:"colorful",label:"缤纷"}],x=i.default.iconList||[];function C(e){const{t}=(0,o.Bd)(),[n,d]=(0,a.useState)(!0),[m,b]=(0,a.useState)(""),[C,O]=(0,a.useState)(100),[j,w]=(0,a.useState)("default"),[,D]=(0,s.fp)(u.AG.prompt_card),[R,T]=(0,a.useState)("mindMap"),[S,k]=(0,a.useState)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),A=(0,a.useRef)(null),M=(0,a.useRef)(!1),Y=(0,a.useRef)({props:e});Y.current={props:e};const W=()=>{M.current||(M.current=!0,Y.current.props.on_dirty?.(!0))},P=async(e=!1)=>{if(!A.current)return e||(0,l.zN)(t("编辑器尚未就绪")),!1;const n=await Y.current.props.on_save((()=>{const e=A.current;return e?JSON.stringify(e.getData(!0)):""})(),e);return n&&(M.current=!1,Y.current.props.on_dirty?.(!1),Y.current.props.on_saved?.()),n};(0,a.useEffect)(()=>{e.register?.({save:P,is_dirty:()=>M.current})},[e.register]),(0,a.useEffect)(()=>{if(!I.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const a=[];A.current?.destroy?.(),A.current=null,M.current=!1,d(!0),b("");const o=async e=>{if(n||!I.current)return;const r=e&&e.root?e:null,l=r?r.root:e??{data:{text:t("中心主题")}},o=new i.default({el:I.current,data:l,fit:!0,enableDblclickBackToRootNode:!0,enableShortcutOnlyWhenMouseInSvg:!0,autoMoveWhenMouseInEdgeOnDrag:!0,...c.k$});A.current=o,r&&o.setFullData(r),d(!1),w(o.getTheme?.()||"default"),T(o.getLayout?.()||"mindMap");window.requestAnimationFrame(()=>{n||(()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);a.push(t),o.on("data_change",()=>{e&&(W(),O(y(o)))}),o.on("view_data_change",()=>{O(y(o))}),o.on("error",(e,t)=>{console.error("[mind]",e,t)}),O(y(o))})()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const a=await r.l.get(e.url);if(n)return;t=a}let a=null;if("string"==typeof t&&t.trim())try{a=JSON.parse(t)}catch{a=null}else t&&"object"==typeof t&&(a=t);a=(0,c.tW)(a),await o(a)}catch(e){n||(d(!1),b(t("加载思维导图失败")),(0,l.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,a.forEach(e=>window.clearTimeout(e)),A.current?.destroy?.(),A.current=null}},[e.url,e.data]),(0,a.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),P())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const G=e=>{const t=A.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),O(Math.round(100*n))},V={SET_NODE_NOTE:{title:"节点备注",placeholder:"请输入节点备注",get:e=>e.getData("note")||""},SET_NODE_TAG:{title:"节点标签",placeholder:"请输入节点标签,多个用逗号分隔",get:e=>(e.getData("tag")||[]).join(",")},SET_NODE_HYPERLINK:{title:"插入超链接",placeholder:"请输入链接地址",get:e=>e.getData("hyperlink")||""}};(0,a.useEffect)(()=>{if(!S)return;const e=()=>k(null),t=window.setTimeout(()=>{window.addEventListener("click",e),window.addEventListener("blur",e)},0);return()=>{window.clearTimeout(t),window.removeEventListener("click",e),window.removeEventListener("blur",e)}},[S]),(0,a.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=A.current?.renderer?.activeNodeList?.[0];t&&(e.preventDefault(),e.stopPropagation(),k({x:e.clientX,y:e.clientY,node:t}))};return e.addEventListener("contextmenu",t,!0),()=>e.removeEventListener("contextmenu",t,!0)},[]);const X=e=>e.map(e=>({v:e.cmd,r:(0,f.jsxs)("div",{className:"common-tag-center mind-menu-row",children:[(0,f.jsx)(E.In,{icon:e.icon,not_use_icon_style:!0}),(0,f.jsx)("span",{children:t(e.label)})]}),items:e.children?X(e.children):void 0})),H=e=>{const n=A.current,a=S;if(n&&a){if(k(null),"ADD_GENERALIZATION"===e||"REMOVE_GENERALIZATION"===e)return n.execCommand(e),void W();"SET_NODE_NOTE"!==e&&"SET_NODE_TAG"!==e&&"SET_NODE_HYPERLINK"!==e?"SET_NODE_ICON"!==e?e.startsWith("REMOVE_NODE_")?((e,t)=>{e&&("REMOVE_NODE_ICON"===t?A.current.execCommand("SET_NODE_ICON",e,[]):"REMOVE_NODE_NOTE"===t?A.current.execCommand("SET_NODE_NOTE",e,""):"REMOVE_NODE_TAG"===t?A.current.execCommand("SET_NODE_TAG",e,[]):"REMOVE_NODE_HYPERLINK"===t&&A.current.execCommand("SET_NODE_HYPERLINK",e,"",""),W())})(a.node,e):(n.execCommand(e,a.node),W()):(e=>{if(!e)return;const n=Array.isArray(e.getData("icon"))?e.getData("icon"):[];D({open:!0,title:t("插入图标"),context_div:(0,f.jsx)("div",{className:"prompt-icon-list",children:x.flatMap(t=>(t.list||[]).map((a,r)=>(0,f.jsx)("button",{type:"button",className:"prompt-icon-list__item",title:a.name,dangerouslySetInnerHTML:{__html:a.icon},onClick:()=>{A.current.execCommand("SET_NODE_ICON",e,[...n,`${t.type}_${a.name}`]),D({open:!1}),W()}},t.type+r)))}),cancel:()=>D({open:!1})})})(a.node):((e,n)=>{if(!e)return;const a=V[n],r=a.get(e);let l=r;D({open:!0,title:t(a.title),context_div:(0,f.jsx)(p,{initValue:r,placeholder:t(a.placeholder),multiline:!0,onChange:e=>l=e}),confirm:()=>{const t=l.trim();"SET_NODE_TAG"===n?A.current.execCommand(n,e,t.split(/[,,]/).map(e=>e.trim()).filter(Boolean)):"SET_NODE_HYPERLINK"===n?A.current.execCommand(n,e,t,t):A.current.execCommand(n,e,t),D({open:!1}),W()},cancel:()=>D({open:!1})})})(a.node,e)}};return(0,f.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,f.jsxs)("div",{className:"mind-toolbar",children:[(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>A.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>A.current?.execCommand?.("INSERT_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>A.current?.execCommand?.("REMOVE_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"delete"})}),(0,f.jsx)("span",{className:"mind-toolbar__sep"}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("撤销")+" (Ctrl+Z)",onClick:()=>A.current?.execCommand?.("BACK"),children:(0,f.jsx)("span",{className:"material-icons",children:"undo"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("重做")+" (Ctrl+Y)",onClick:()=>A.current?.execCommand?.("FORWARD"),children:(0,f.jsx)("span",{className:"material-icons",children:"redo"})}),(0,f.jsx)("span",{className:"mind-toolbar__sep"}),(0,f.jsxs)("span",{className:"mind-toolbar__zoom",children:[C,"%"]}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>G(y(A.current)/100-.2),children:(0,f.jsx)("span",{className:"material-icons",children:"remove"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>G(y(A.current)/100+.2),children:(0,f.jsx)("span",{className:"material-icons",children:"add"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>{A.current?.view?.fit?.(),O(y(A.current))},children:(0,f.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,f.jsxs)("div",{className:"mind-toolbar mind-toolbar--sub",children:[(0,f.jsx)("select",{className:"mind-select",title:t("结构"),value:R,onChange:e=>{const t=e.target.value;A.current?.setLayout?.(t),T(t),W()},children:N.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,f.jsxs)("select",{className:"mind-select",title:t("连线风格"),defaultValue:"",onChange:e=>{const t=e.target.value;if(t){const e=A.current?.getCustomThemeConfig?.()||{};A.current?.setThemeConfig?.({...e,lineStyle:t}),W()}e.target.value=""},children:[(0,f.jsx)("option",{value:"",children:t("连线风格")}),v.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))]}),(0,f.jsx)("select",{className:"mind-select",title:t("主题"),value:j,onChange:e=>{const t=e.target.value;w(t),A.current?.setTheme?.(t),W()},children:g.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,f.jsx)("span",{className:"mind-toolbar__gap"})]}),(0,f.jsxs)("div",{className:"mind-canvas",ref:L,children:[(0,f.jsx)("div",{className:"mind-mount",ref:I}),n&&(0,f.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,f.jsx)("div",{className:"mind-mask",children:m}),S&&(0,f.jsx)(_.rY,{click:()=>k(null),children:(0,f.jsx)(_.Pu,{x:S.x,y:S.y,items:X(h),click:e=>H(e)})})]})]})}function y(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){"use strict";function a(e){return"smm-mind"===e}n.d(t,{Hn:()=>s,hj:()=>a,tW:()=>o});const r={mousewheelMoveStep:35,scaleRatio:.08};let l=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?i(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e:{...e,root:c(e.root)}:e.data&&"object"==typeof e.data?e:c(e):null}function i(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(i):[]}}function c(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(c):[]}}function d(e){e.stopPropagation()}async function s(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),a=await(l||(l=Promise.all([Promise.all([n.e(8725),n.e(2728),n.e(2130),n.e(5602),n.e(8277)]).then(n.bind(n,45602)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),l);return{data:t,async mount(e,n){let l=!1;const o=await function(e,t){return new Promise(n=>{const a=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(a,16)};a()})}(e,()=>l);if(!o)return{destroy:()=>{},get_data:()=>null};const i=document.createElement("div");i.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",d,{capture:!0,passive:!0}),e.append(i);const c=new a({el:i,data:t?.root??t??{data:{text:""}},readonly:!n?.editable,fit:!0,...r});return t?.root&&c.setFullData(t),{destroy:()=>{l=!0,e.removeEventListener("wheel",d,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}n.d(t,["k$",0,r])},93245(e,t,n){"use strict";n.d(t,{a:()=>c});var a=n(96540),r=n(34843),l=n(82893),o=n(23430);const i=[{id:o.nE.ace,label:"文本编辑器(ace)"},{id:o.nE.md,label:"md编辑器"},{id:o.nE.mind,label:"思维导图编辑器"},{id:o.nE.draw,label:"draw编辑器"},{id:o.nE.timeline,label:"时间线编辑器"},{id:o.nE.image,label:"图片编辑器"},{id:o.nE.excel,label:"excel编辑器"}];function c(e,t,n,o=!1){const[i]=(0,r.fp)(l.AG.user_base_info),c=i?.user_data?.editor_auto_save,d=(0,a.useRef)(c);d.current=c;const s=(0,a.useRef)(t);s.current=t;const u=(0,a.useRef)(n);u.current=n,(0,a.useEffect)(()=>{if(o)return;const t=d.current;if(!t?.enable||t.interval<=0||!t.editors?.includes(e))return;const n=setInterval(()=>{s.current()&&u.current(!0)},1e3*t.interval);return()=>clearInterval(n)},[c,e,o])}n.d(t,["d",0,i])},28277(){}}]);
|
|
1
|
+
(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[735,6404,8277],{87943(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>b});var a=n(96540),r=n(34843),l=n(82893),o=n(14284),i=n(62042),c=n(53459),d=n(34289),s=n(22022),u=n(35304),m=n(93245),f=n(23430),p=n(74848);function b(){const[e,t]=(0,r.fp)(l.AG.mind_editor),[n,b]=(0,a.useState)(!1),{t:_}=(0,s.Bd)(),E=(0,a.useRef)(null),h=void 0!==e.code_source,N=()=>{n&&!window.confirm(_("有未保存的修改,确定要关闭吗?"))||(t({}),e?.close?.())},v=async(e=!1)=>{await(E.current?.save(e))},g=(0,a.useRef)(n);return g.current=n,(0,m.a)(f.nE.mind,()=>!h&&g.current,e=>v(e),h),(0,a.useEffect)(()=>{if(void 0===e.url&&void 0===e.code_source)return;const t=e=>{"Escape"===e.key&&(e.stopPropagation(),N())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e.url,e.code_source,n]),void 0!==e.url||h?(0,p.jsx)("div",{id:"mind-container",className:h?"mind-container--over":void 0,children:(0,p.jsx)("div",{className:"mind-context",children:(0,p.jsx)(u.default,{fullscreen:!0,reset_key:e.url??e.name,url:h?void 0:e.url,data:h?e.code_source:void 0,on_dirty:b,register:e=>{E.current=e},header:(0,p.jsxs)("div",{className:"mind-topbar",children:[(0,p.jsx)("span",{className:"material-icons mind-topbar__icon",children:"account_tree"}),(0,p.jsx)("span",{className:"mind-topbar__name",children:e.name}),(0,p.jsx)("span",{style:{flex:1}}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:_("保存")+" (Ctrl+S)",onClick:v,children:(0,p.jsx)("span",{className:"material-icons",children:"save"})}),(0,p.jsx)("button",{type:"button",className:"mind-btn",title:_("关闭"),onClick:N,children:(0,p.jsx)("span",{className:"material-icons",children:"close"})})]}),on_save:async(n,a)=>{if(h)return e.on_save_code?.(n),a||(0,i.SK)(_("保存成功")),t({}),!0;return(await o.$M.post(`save/${encodeURIComponent((0,d.GG)("file",(0,d.vX)()))}${e.name}`,{context:n})).code===c.m.Success&&(a||(0,i.SK)(_("保存成功")),!0)}})})}):null}},35304(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>C});var a=n(96540),r=n(57889),l=(n(14284),n(62042)),o=n(22022),i=n(45602),c=(n(88781),n(86063));const d={classic:{backgroundColor:"#fafafa",lineColor:"#4d8f7f",lineWidth:2,root:{fillColor:"#4d8f7f",color:"#fff",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#fff",color:"#2f4f47",borderRadius:5,borderColor:"#4d8f7f",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#fff",color:"#3c3c3c",borderRadius:5,borderColor:"#a8d5c8",borderWidth:1,paddingX:12,paddingY:5}},dark:{backgroundColor:"#1f2226",lineColor:"#6b7c8c",lineWidth:1,root:{fillColor:"#3a4654",color:"#f2f4f6",borderRadius:6,paddingX:18,paddingY:8},second:{fillColor:"#2b323a",color:"#e6eaef",borderRadius:5,borderColor:"#4c5866",borderWidth:1,paddingX:14,paddingY:6},node:{fillColor:"#242a31",color:"#ccd3da",borderRadius:5,borderColor:"#3c454f",borderWidth:1,paddingX:12,paddingY:5}},simple:{backgroundColor:"#fff",lineColor:"#c8ccd0",lineWidth:1,root:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:10,paddingY:4},second:{fillColor:"transparent",color:"#202124",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3},node:{fillColor:"transparent",color:"#5f6368",borderRadius:0,borderWidth:0,paddingX:8,paddingY:3}},colorful:{backgroundColor:"#fffdf6",lineColor:"#f2a65a",lineWidth:2,root:{fillColor:"#f2854a",color:"#fff",borderRadius:24,paddingX:20,paddingY:9},second:{fillColor:"#ffd66b",color:"#6b4a12",borderRadius:16,borderWidth:0,paddingX:14,paddingY:6},node:{fillColor:"#a8d8ea",color:"#1e3f4d",borderRadius:12,borderWidth:0,paddingX:12,paddingY:5}}};var s=n(34843),u=n(82893),m=n(61443),f=n(74848);function p(e){const[t,n]=(0,a.useState)(e.initValue||""),r=t=>{n(t),e.onChange(t)};return e.multiline?(0,f.jsx)("div",{className:"prompt-input",children:(0,f.jsx)(m.Z2,{placeholder:e.placeholder||"",rows:e.rows??5,value:t,handleInputChange:r})}):(0,f.jsx)("div",{className:"prompt-input",children:(0,f.jsx)(m.Sm,{placeholder:e.placeholder||"",value:t,handleInputChange:r})})}var b,_=n(75725),E=n(85997);n(30576);b=i.default,Object.entries(d).forEach(([e,t])=>{b.defineTheme?.(e,t)});const h=[{cmd:"INSERT_CHILD_NODE",icon:"account_tree",label:"添加子节点"},{cmd:"INSERT_NODE",icon:"subdirectory_arrow_right",label:"添加同级节点"},{cmd:"INSERT_PARENT_NODE",icon:"arrow_upward",label:"插入父节点"},{cmd:"CUT_NODE",icon:"content_cut",label:"剪切"},{cmd:"PASTE_NODE",icon:"content_paste",label:"粘贴"},{cmd:"REMOVE_NODE",icon:"delete",label:"删除节点"},{cmd:"INSERT_GROUP",icon:"add_circle_outline",label:"插入",children:[{cmd:"SET_NODE_ICON",icon:"emoji_emotions",label:"插入图标"},{cmd:"REMOVE_NODE_ICON",icon:"format_clear",label:"删除图标"},{cmd:"SET_NODE_NOTE",icon:"sticky_note_2",label:"节点备注"},{cmd:"REMOVE_NODE_NOTE",icon:"speaker_notes_off",label:"删除备注"},{cmd:"SET_NODE_TAG",icon:"sell",label:"节点标签"},{cmd:"REMOVE_NODE_TAG",icon:"label_off",label:"删除标签"},{cmd:"SET_NODE_HYPERLINK",icon:"link",label:"插入超链接"},{cmd:"REMOVE_NODE_HYPERLINK",icon:"link_off",label:"删除超链接"}]},{cmd:"ADD_GENERALIZATION",icon:"call_merge",label:"添加概要"},{cmd:"REMOVE_GENERALIZATION",icon:"call_split",label:"删除概要"}],N=[{value:"logicalStructure",label:"逻辑结构图"},{value:"mindMap",label:"思维导图"},{value:"organizationStructure",label:"组织结构图"},{value:"catalogOrganization",label:"目录组织图"},{value:"timeline",label:"时间轴(左)"},{value:"timeline2",label:"时间轴(下)"},{value:"timeline3",label:"时间轴(上)"},{value:"verticalTimeline",label:"时间轴(竖)"},{value:"fishbone",label:"鱼骨图"},{value:"rightFishbone",label:"鱼骨图(右)"}],v=[{value:"curve",label:"曲线"},{value:"straight",label:"直线"},{value:"direct",label:"直连"}],g=[{value:"default",label:"默认主题"},{value:"classic",label:"经典"},{value:"dark",label:"暗色"},{value:"simple",label:"极简"},{value:"colorful",label:"缤纷"}],x=i.default.iconList||[];function C(e){const{t}=(0,o.Bd)(),[n,d]=(0,a.useState)(!0),[m,b]=(0,a.useState)(""),[C,O]=(0,a.useState)(100),[j,w]=(0,a.useState)("default"),[,D]=(0,s.fp)(u.AG.prompt_card),[R,T]=(0,a.useState)("mindMap"),[S,k]=(0,a.useState)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),A=(0,a.useRef)(null),M=(0,a.useRef)(!1),Y=(0,a.useRef)({props:e});Y.current={props:e};const W=()=>{M.current||(M.current=!0,Y.current.props.on_dirty?.(!0))},P=async(e=!1)=>{if(!A.current)return e||(0,l.zN)(t("编辑器尚未就绪")),!1;const n=await Y.current.props.on_save((()=>{const e=A.current;return e?JSON.stringify(e.getData(!0)):""})(),e);return n&&(M.current=!1,Y.current.props.on_dirty?.(!1),Y.current.props.on_saved?.()),n};(0,a.useEffect)(()=>{e.register?.({save:P,is_dirty:()=>M.current})},[e.register]),(0,a.useEffect)(()=>{if(!I.current)return;if(!e.url&&void 0===e.data)return;let n=!1;const a=[];A.current?.destroy?.(),A.current=null,M.current=!1,d(!0),b("");const o=async e=>{if(n||!I.current)return;const r=e&&e.root?e:null,l=r?r.root:e??{data:{text:t("中心主题")}},o=new i.default({el:I.current,data:l,fit:!0,enableDblclickBackToRootNode:!0,enableShortcutOnlyWhenMouseInSvg:!0,autoMoveWhenMouseInEdgeOnDrag:!0,...c.k$});A.current=o,r&&o.setFullData(r),d(!1),w(o.getTheme?.()||"default"),T(o.getLayout?.()||"mindMap");window.requestAnimationFrame(()=>{n||(()=>{let e=!1;const t=window.setTimeout(()=>{n||(e=!0)},400);a.push(t),o.on("data_change",()=>{e&&(W(),O(y(o)))}),o.on("view_data_change",()=>{O(y(o))}),o.on("error",(e,t)=>{console.error("[mind]",e,t)}),O(y(o))})()})};return(async()=>{try{let t=null;if(void 0!==e.data)t=e.data;else{const a=await r.l.get(e.url);if(n)return;t=a}let a=null;if("string"==typeof t&&t.trim())try{a=JSON.parse(t)}catch{a=null}else t&&"object"==typeof t&&(a=t);a=(0,c.tW)(a),await o(a)}catch(e){n||(d(!1),b(t("加载思维导图失败")),(0,l.zN)(t("加载思维导图失败")))}})(),()=>{n=!0,a.forEach(e=>window.clearTimeout(e)),A.current?.destroy?.(),A.current=null}},[e.url,e.data]),(0,a.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&("s"===e.key||"S"===e.key||83===e.keyCode)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),P())};return window.addEventListener("keydown",e,!0),document.addEventListener("keydown",e,!0),()=>{window.removeEventListener("keydown",e,!0),document.removeEventListener("keydown",e,!0)}},[]);const G=e=>{const t=A.current;if(!t)return;const n=Math.min(4,Math.max(.25,e));t.view.setScale(n),O(Math.round(100*n))},V={SET_NODE_NOTE:{title:"节点备注",placeholder:"请输入节点备注",get:e=>e.getData("note")||""},SET_NODE_TAG:{title:"节点标签",placeholder:"请输入节点标签,多个用逗号分隔",get:e=>(e.getData("tag")||[]).join(",")},SET_NODE_HYPERLINK:{title:"插入超链接",placeholder:"请输入链接地址",get:e=>e.getData("hyperlink")||""}};(0,a.useEffect)(()=>{if(!S)return;const e=()=>k(null),t=window.setTimeout(()=>{window.addEventListener("click",e),window.addEventListener("blur",e)},0);return()=>{window.clearTimeout(t),window.removeEventListener("click",e),window.removeEventListener("blur",e)}},[S]),(0,a.useEffect)(()=>{const e=L.current;if(!e)return;const t=e=>{const t=A.current?.renderer?.activeNodeList?.[0];t&&(e.preventDefault(),e.stopPropagation(),k({x:e.clientX,y:e.clientY,node:t}))};return e.addEventListener("contextmenu",t,!0),()=>e.removeEventListener("contextmenu",t,!0)},[]);const X=e=>e.map(e=>({v:e.cmd,r:(0,f.jsxs)("div",{className:"common-tag-center mind-menu-row",children:[(0,f.jsx)(E.In,{icon:e.icon,not_use_icon_style:!0}),(0,f.jsx)("span",{children:t(e.label)})]}),items:e.children?X(e.children):void 0})),H=e=>{const n=A.current,a=S;if(n&&a){if(k(null),"ADD_GENERALIZATION"===e||"REMOVE_GENERALIZATION"===e)return n.execCommand(e),void W();"SET_NODE_NOTE"!==e&&"SET_NODE_TAG"!==e&&"SET_NODE_HYPERLINK"!==e?"SET_NODE_ICON"!==e?e.startsWith("REMOVE_NODE_")?((e,t)=>{e&&("REMOVE_NODE_ICON"===t?A.current.execCommand("SET_NODE_ICON",e,[]):"REMOVE_NODE_NOTE"===t?A.current.execCommand("SET_NODE_NOTE",e,""):"REMOVE_NODE_TAG"===t?A.current.execCommand("SET_NODE_TAG",e,[]):"REMOVE_NODE_HYPERLINK"===t&&A.current.execCommand("SET_NODE_HYPERLINK",e,"",""),W())})(a.node,e):(n.execCommand(e,a.node),W()):(e=>{if(!e)return;const n=Array.isArray(e.getData("icon"))?e.getData("icon"):[];D({open:!0,title:t("插入图标"),context_div:(0,f.jsx)("div",{className:"prompt-icon-list",children:x.flatMap(t=>(t.list||[]).map((a,r)=>(0,f.jsx)("button",{type:"button",className:"prompt-icon-list__item",title:a.name,dangerouslySetInnerHTML:{__html:a.icon},onClick:()=>{A.current.execCommand("SET_NODE_ICON",e,[...n,`${t.type}_${a.name}`]),D({open:!1}),W()}},t.type+r)))}),cancel:()=>D({open:!1})})})(a.node):((e,n)=>{if(!e)return;const a=V[n],r=a.get(e);let l=r;D({open:!0,title:t(a.title),context_div:(0,f.jsx)(p,{initValue:r,placeholder:t(a.placeholder),multiline:!0,onChange:e=>l=e}),confirm:()=>{const t=l.trim();"SET_NODE_TAG"===n?A.current.execCommand(n,e,t.split(/[,,]/).map(e=>e.trim()).filter(Boolean)):"SET_NODE_HYPERLINK"===n?A.current.execCommand(n,e,t,t):A.current.execCommand(n,e,t),D({open:!1}),W()},cancel:()=>D({open:!1})})})(a.node,e)}};return(0,f.jsxs)("div",{className:"mind-wrap"+(e.fullscreen?" mind-wrap--full":""),children:[e.header,(0,f.jsxs)("div",{className:"mind-toolbar",children:[(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("添加子节点")+" (Tab)",onClick:()=>A.current?.execCommand?.("INSERT_CHILD_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"account_tree"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("添加同级节点")+" (Enter)",onClick:()=>A.current?.execCommand?.("INSERT_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"subdirectory_arrow_right"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("删除节点")+" (Delete)",onClick:()=>A.current?.execCommand?.("REMOVE_NODE"),children:(0,f.jsx)("span",{className:"material-icons",children:"delete"})}),(0,f.jsx)("span",{className:"mind-toolbar__sep"}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("撤销")+" (Ctrl+Z)",onClick:()=>A.current?.execCommand?.("BACK"),children:(0,f.jsx)("span",{className:"material-icons",children:"undo"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("重做")+" (Ctrl+Y)",onClick:()=>A.current?.execCommand?.("FORWARD"),children:(0,f.jsx)("span",{className:"material-icons",children:"redo"})}),(0,f.jsx)("span",{className:"mind-toolbar__sep"}),(0,f.jsxs)("span",{className:"mind-toolbar__zoom",children:[C,"%"]}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("缩小"),onClick:()=>G(y(A.current)/100-.2),children:(0,f.jsx)("span",{className:"material-icons",children:"remove"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("放大"),onClick:()=>G(y(A.current)/100+.2),children:(0,f.jsx)("span",{className:"material-icons",children:"add"})}),(0,f.jsx)("button",{type:"button",className:"mind-btn",title:t("适应窗口"),onClick:()=>{A.current?.view?.fit?.(),O(y(A.current))},children:(0,f.jsx)("span",{className:"material-icons",children:"fit_screen"})})]}),(0,f.jsxs)("div",{className:"mind-toolbar mind-toolbar--sub",children:[(0,f.jsx)("select",{className:"mind-select",title:t("结构"),value:R,onChange:e=>{const t=e.target.value;A.current?.setLayout?.(t),T(t),W()},children:N.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,f.jsxs)("select",{className:"mind-select",title:t("连线风格"),defaultValue:"",onChange:e=>{const t=e.target.value;if(t){const e=A.current?.getCustomThemeConfig?.()||{};A.current?.setThemeConfig?.({...e,lineStyle:t}),W()}e.target.value=""},children:[(0,f.jsx)("option",{value:"",children:t("连线风格")}),v.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))]}),(0,f.jsx)("select",{className:"mind-select",title:t("主题"),value:j,onChange:e=>{const t=e.target.value;w(t),A.current?.setTheme?.(t),W()},children:g.map(e=>(0,f.jsx)("option",{value:e.value,children:t(e.label)},e.value))}),(0,f.jsx)("span",{className:"mind-toolbar__gap"})]}),(0,f.jsxs)("div",{className:"mind-canvas",ref:L,children:[(0,f.jsx)("div",{className:"mind-mount",ref:I}),n&&(0,f.jsx)("div",{className:"mind-mask",children:"Loading..."}),m&&(0,f.jsx)("div",{className:"mind-mask",children:m}),S&&(0,f.jsx)(_.rY,{click:()=>k(null),children:(0,f.jsx)(_.sw,{x:S.x,y:S.y,items:X(h),click:e=>H(e)})})]})]})}function y(e){const t=e?.view?.getTransformData?.()?.state?.scale;return"number"==typeof t&&t>0?Math.round(100*t):100}},86063(e,t,n){"use strict";function a(e){return"smm-mind"===e}n.d(t,{Hn:()=>s,hj:()=>a,tW:()=>o});const r={mousewheelMoveStep:35,scaleRatio:.08};let l=null;function o(e){return e&&"object"==typeof e?e.data?.nodeData?i(e.data.nodeData):e.root&&"object"==typeof e.root?e.root.data?e:{...e,root:c(e.root)}:e.data&&"object"==typeof e.data?e:c(e):null}function i(e){return{data:{text:"string"==typeof e?.topic?e.topic:"string"==typeof e?.data?.text?e.data.text:""},children:Array.isArray(e?.children)?e.children.map(i):[]}}function c(e){return{data:{text:"string"==typeof e?.text?e.text:"",...e?.note?{note:e.note}:{}},children:Array.isArray(e?.children)?e.children.map(c):[]}}function d(e){e.stopPropagation()}async function s(e){const t=function(e){const t=e.trim();if(!t)return null;let n=null;try{n=JSON.parse(t)}catch{return null}return o(n)}(e),a=await(l||(l=Promise.all([Promise.all([n.e(8725),n.e(2728),n.e(2130),n.e(5602),n.e(8277)]).then(n.bind(n,45602)),n.e(8781).then(n.bind(n,88781))]).then(([e])=>e.default)),l);return{data:t,async mount(e,n){let l=!1;const o=await function(e,t){return new Promise(n=>{const a=()=>{t()?n(!1):e.isConnected&&e.clientWidth&&e.clientHeight?n(!0):window.setTimeout(a,16)};a()})}(e,()=>l);if(!o)return{destroy:()=>{},get_data:()=>null};const i=document.createElement("div");i.className="md-graph__mind-host",!1!==n?.release_wheel&&e.addEventListener("wheel",d,{capture:!0,passive:!0}),e.append(i);const c=new a({el:i,data:t?.root??t??{data:{text:""}},readonly:!n?.editable,fit:!0,...r});return t?.root&&c.setFullData(t),{destroy:()=>{l=!0,e.removeEventListener("wheel",d,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}n.d(t,["k$",0,r])},93245(e,t,n){"use strict";n.d(t,{a:()=>c});var a=n(96540),r=n(34843),l=n(82893),o=n(23430);const i=[{id:o.nE.ace,label:"文本编辑器(ace)"},{id:o.nE.md,label:"md编辑器"},{id:o.nE.mind,label:"思维导图编辑器"},{id:o.nE.draw,label:"draw编辑器"},{id:o.nE.timeline,label:"时间线编辑器"},{id:o.nE.image,label:"图片编辑器"},{id:o.nE.excel,label:"excel编辑器"}];function c(e,t,n,o=!1){const[i]=(0,r.fp)(l.AG.user_base_info),c=i?.user_data?.editor_auto_save,d=(0,a.useRef)(c);d.current=c;const s=(0,a.useRef)(t);s.current=t;const u=(0,a.useRef)(n);u.current=n,(0,a.useEffect)(()=>{if(o)return;const t=d.current;if(!t?.enable||t.interval<=0||!t.editors?.includes(e))return;const n=setInterval(()=>{s.current()&&u.current(!0)},1e3*t.interval);return()=>clearInterval(n)},[c,e,o])}n.d(t,["d",0,i])},28277(){}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9299],{47374(e,t,i){i.d(t,{e:()=>p});var n=i(96540),s=i(61973),o=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(22022),d=i(85997),_=i(74848);function p(e){let t=(0,s.zy)();const[i,p]=(0,n.useState)([]),[f,h]=(0,n.useState)("/"),[u,m]=(0,n.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const n=i.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(i.slice(0,n),e.baseRoute);const a=i.slice(n+1);for(let e=0;e<a.length;e++){const i=a[e];s.push({value:i,href:0===e?`${t}${i}/`:(0,o.IO)(s[e-1].href,i)})}h(t),p(s)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:f,onClick:g,children:(0,_.jsx)(d.In,{icon:"home"})})}),i.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,_.jsx)(r.QM,{click:()=>{m(void 0)},children:(0,_.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),m(void 0)}})})})})}},77481(e,t,i){i.d(t,{S:()=>l,X:()=>a});var n=i(96540),s=i(61443),o=i(74848);function a(e){const[t,i]=n.useState([]),a=(0,n.useRef)(-1),[l,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?i(Array.isArray(e.children)?e.children:[e.children]):i(e.rows)},[e.rows,e.children]);const _=()=>{a.current=-1,r(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,i)=>{const n=!!e.filter&&(e.filter.column??0)===i;let a=t;if(n){const i=e.filter,n=i.options.find(e=>e.value===i.value);null!=i.value&&n&&(a=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},i)})})}),(0,o.jsx)("tbody",{children:t.map((t,i)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(l===i?"row-dragging":"")+(c===i?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(a.current=i,r(i),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(i))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=a.current,i=c;_(),t<0||i<0||t===i||e.onRowDrag?.(t,i)})())},onDragEnd:_,children:t.map((i,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:i},n)})},i)})})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},19299(e,t,i){i.r(t),i.d(t,{default:()=>q});var n=i(96540),s=i(47374),o=i(34843),a=i(82893),l=i(14284),r=i(61973),c=i(4412),d=i(89824),_=i(34289),p=i(53459),f=i(99214),h=i(61443),u=i(47022),m=i(62042),w=i(22022),v=i(7523),g=i(78247),x=i(88815),y=i(6960),j=i(47071),k=i(14944),G=i(92275),A=i(23430);var b=i(34251),C=i(60096),S=i(87361),M=i(76559),$=i(85997),z=i(77481),D=i(70447),N=i(74848);const P=500;function E(e){const{t}=(0,w.Bd)(),i=(0,r.Zp)(),[,s]=(0,o.fp)(a.AG.prompt_card),[l,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(!1),[p,f]=(0,n.useState)([]),[u,m]=(0,n.useState)(0),[v,g]=(0,n.useState)(!1),x=(0,n.useMemo)(()=>new M.I(window.location.host,"file_deep_search"),[]),y=(0,n.useRef)(!1),j=decodeURIComponent(e.base_path);(0,n.useEffect)(()=>{let e=[],t=null;const i=()=>{if(t=null,y.current||!e.length)return;const i=e;e=[],m(e=>e+i.length),f(e=>e.length>=P?e:[...e,...i].slice(0,P))},n=()=>{y.current||_(!1)};return x.addMsg(G.HK.file_deep_search_data,n=>{y.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(i,100)))}),x.addMsg(G.HK.file_deep_search_end,()=>{y.current||(i(),_(!1))}),x.on_message("close",n),()=>{y.current=!0,clearTimeout(t),x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",n),x.close()}},[]);const k=()=>{const t=l.trim();if(!t||d)return;f([]),m(0),g(!0),_(!0);const i={param_path:e.base_path,keyword:t};x.sendData(G.HK.file_deep_search,i).catch(()=>{})},A=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),i(S.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,N.jsxs)("div",{className:"file-deep-search",children:[(0,N.jsxs)("div",{className:"file-deep-search__bar",children:[(0,N.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,N.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,N.jsxs)("div",{className:"file-deep-search__hint",children:[(0,N.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,N.jsx)("span",{className:"file-deep-search__count",children:u>P?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,N.jsxs)("div",{className:"file-deep-search__body",children:[p.length>0&&(0,N.jsx)(z.X,{headers:[t("名称"),t("路径"),""],rows:p.map(e=>{const i=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,N.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,N.jsx)(D.xP,{context:i}),(0,N.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,N.jsxs)("div",{className:"file-deep-search__empty",children:[(0,N.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>P&&(0,N.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===p.length&&(0,N.jsx)("div",{className:"file-deep-search__empty",children:t(v?"无匹配":"输入后搜")})]})]})}var F=i(23496),I=i(12730),X=i(75725),R=i(40505);let K={};function H(){const{t:e}=(0,w.Bd)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.nowFileList),[h,x]=(0,o.fp)(a.AG.uploadFiles),[y,j]=(0,o.fp)(a.AG.showPrompt),[C,M]=(0,o.fp)(a.AG.selectedFileList),[z,P]=(0,o.fp)(a.AG.copyedFileList),[E,F]=(0,o.fp)(a.AG.cutedFileList),[R,H]=(0,o.fp)(a.AG.selectedFileList),[L,U]=(0,o.fp)(a.AG.clickFileList),[Y,B]=(0,o.fp)(a.AG.fileShellShow),[O]=(0,o.fp)(a.AG.current_mount),[Z,W]=(0,o.fp)(a.AG.file_root_list),[T,V]=(0,o.fp)(a.AG.file_root_index),[q,J]=(0,n.useState)(void 0),[Q,ee]=(0,n.useState)(""),[te,ie]=(0,o.fp)(a.AG.workflow_show),[ne,se]=(0,o.fp)(a.AG.workflow_realtime_show),[oe,ae]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,n.useContext)(v.F),[re,ce]=(0,o.fp)(a.AG.user_base_info),{click_file:de}=(0,f.kZ)(),[_e,pe]=(0,o.fp)(a.AG.prompt_card),fe=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),he=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,m.SK)(e)}(0,n.useEffect)(()=>{K={}},[t]),(0,n.useEffect)(()=>()=>{B({show:!1,path:""})},[]);const me=(0,f.Vs)(),we=t=>{pe({open:!0,title:e("信息"),context_div:(0,N.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,N.jsx)(X.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,N.jsx)(X.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,N.jsx)(X.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,N.jsx)(X.Yh,{left:`${e("文件夹数")}`,right:he}),(0,N.jsx)(X.Yh,{left:`${e("文件数")}`,right:fe}),(0,N.jsx)(X.Yh,{left:`${e("当前位置")}`,right:(0,N.jsx)(D.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,N.jsxs)(n.Fragment,{children:[C.length>0&&(0,N.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,f.ib)(c,C);P(e.map(e=>(0,f.Ok)(e.name))),F([]),ue("已复制")}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,f.ib)(c,C);F(e.map(e=>(0,f.Ok)(e.name))),P([]),ue("已剪切")}}),(z.length>0||E.length>0)&&(0,N.jsx)($.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:z.length+E.length}),C.length>0&&(0,N.jsx)($.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,f.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,N.jsx)($.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,f.Ok)(i.name)}e&&0!==e.length?j({show:!0,type:d.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,m.zN)("没有选中")}}),1===C.length&&(0,N.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,N.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!te)}}),!O&&(0,N.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?B({show:!1,path:""}):B({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,N.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${S.o.share_list_setting_page}`)}}),(0,N.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,N.jsx)($.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:d.PromptEnum.DirNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,N.jsx)($.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:d.PromptEnum.FileNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,N.jsx)($.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:d.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const n=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=i?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,i&&s.add((0,I.S)(a)),n.push(o)}const o=[];if(i)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...n),x(o),j({show:!0,type:d.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,N.jsx)($.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!K.now_absolute_path){k.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(K={...K,...i},k.ws.removeMsg(G.HK.file_info),we(K))});const t=await k.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,_.GG)("file",(0,_.vX)())});e=t.context,K=e,we(K)}we(K)}}),(0,N.jsx)($.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=Z,n.item_pre_value=T,n.textClick=async t=>{if(-1===t)return i(`${S.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,m.N9)(e("请配置 文件夹路径"));(async e=>{V(e),await l.$M.post("base_switch",{root_index:e}),await le(),i("/file/"),H([]),U([])})(t),j({data:void 0,overlay:!1,type:"",show:!1})},j({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var L=i(2543),U=i(21499),Y=i(64694),B=i(17903);const O=n.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(i.bind(i,63659))),Z=n.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(i.bind(i,81636))),W=n.lazy(()=>Promise.all([i.e(4946),i.e(2626),i.e(892),i.e(9334),i.e(8365)]).then(i.bind(i,16514)));let T,V="";function q(){const[e,t]=(0,o.fp)(a.AG.editorSetting),[,i]=(0,o.fp)(a.AG.md_editor),[,m]=(0,o.fp)(a.AG.log_viewer),[,M]=(0,o.fp)(a.AG.image_editor),[,z]=(0,o.fp)(a.AG.markdown),[,D]=(0,o.fp)(a.AG.excalidraw_editor),[,P]=(0,o.fp)(a.AG.mind_editor),[,I]=(0,o.fp)(a.AG.timeline_editor),[,X]=(0,o.fp)(a.AG.excel_editor),[K,q]=(0,o.fp)(a.AG.file_preview),{t:J}=(0,w.Bd)();let Q=(0,r.zy)();const ee=(0,r.Zp)(),[te,ie]=(0,o.fp)(a.AG.nowFileList),[ne]=(0,o.fp)(a.AG.file_list_refresh),[se]=(0,o.fp)(a.AG.mount_enabled),[oe,ae]=(0,o.fp)(a.AG.current_mount),[le,re]=(0,o.fp)(a.AG.showPrompt),[ce,de]=(0,o.fp)(a.AG.selectedFileList),[_e,pe]=(0,o.fp)(a.AG.clickFileList),[fe,he]=(0,o.fp)(a.AG.fileShellShow),[ue,me]=(0,n.useState)(""),[we,ve]=(0,o.fp)(a.AG.workflow_show),[ge,xe]=(0,o.fp)(a.AG.workflow_realtime_show),[ye,je]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:ke}=(0,n.useContext)(v.F),[Ge,Ae]=(0,o.fp)(a.AG.user_base_info),{check_user_auth:be}=(0,g.MH)(),{click_file:Ce}=(0,f.kZ)(),[Se]=(0,r.ok)(),Me=(0,f._A)(),$e=n.useRef(null),[ze,De]=(0,o.fp)(a.AG.to_running_files),[Ne,Pe]=(0,o.fp)(a.AG.file_page),[Ee]=(0,o.fp)(a.AG.blank_search_mode),[,Fe]=(0,o.fp)(a.AG.prompt_card),[Ie,Xe]=(0,o.fp)(a.AG.blank_search_mode_for_temp),Re=(0,f.oT)(),Ke="1"===Se.get("chat_open"),He=be(A.oV.ai_agent_page);(0,n.useEffect)(()=>{Ge?.user_data&&Ke&&!He&&Re("chat_open",null)},[Ke,He,Ge]);const[Le,Ue]=(0,o.fp)(a.AG.studio_chat_width),Ye=n.useRef(null),[Be,Oe]=(0,n.useState)(!1),[Ze,We]=(0,n.useState)(void 0),Te=(0,f.dN)(),[Ve,qe]=(0,o.fp)(a.AG.ai_chat_session_by_cwd),Je=function(){const[e,t]=(0,o.fp)(a.AG.user_base_info),{t:i}=(0,w.Bd)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.router_jump),h=(0,r.Zp)(),{initUserInfo:m}=(0,n.useContext)(v.F),[x,y]=(0,o.fp)(a.AG.nowFileList),[j,C]=(0,o.fp)(a.AG.showPrompt),[M,$]=(0,o.fp)(a.AG.fileShellShow),[z,D]=(0,o.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory;const o=[{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:o},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,N.jsx)("span",{style:(0,R.ok)(z),children:i("srchbln")}),v:"blank_search_mode"}]}];x?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),s(A.oV.code_resource)&&w.push({r:i("add_rot"),v:"code_resource"}),s(A.oV.http_proxy)&&w.push({r:i("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,f.LL)([...e.user_data.quick_cmd],w),n.items=w,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/setting/customer_router/")}if("http_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:d.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",$({show:!0,path:(0,_.GG)("file",(0,_.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return D(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(F.s.user_save_private_attr,{type:e,...t}),await m(),C({data:void 0,overlay:!1,type:"",show:!1}),h((0,_.vX)())},C({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}}(),Qe=async()=>{const e=new j.Nd;e.dir_path=`${(0,_.GG)("file",(0,_.vX)())}`,k.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,f.Ys)(e);for(const e of t.failed_file_list)(0,f.V$)(e);De(new Set(t.running_file_list))}}),await k.ws.sendData(G.HK.workflow_realtime,e)},et=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,x.v7)(i.size),Ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Qe()})),i.name===j.SB&&(t=!0);for(const i of e.folders??[])Ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",i.name===j.SB&&(t=!0);je(t)},tt=n.useRef(null),it=async e=>{if(!0===se){if(tt.current!==e){tt.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});ae(t?.data??null)}catch(e){ae(null)}}}else ae(null)},nt=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if(Ee||Ie)return;let t;if(it(e),Ge.user_data.file_list_pagination_mode===A.yM.pagination){if(V!==e){if(V=e,1!==Ne.page_num)return void Pe({page_size:Ne.page_size,page_num:1})}else if(Ne.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:Ne.page_num,page_size:Ne.page_size}),t.code!==p.m.Success)return;const i=t.data;return et(i),i.files?.length?(ie(e=>{const t=(0,L.cloneDeep)(1===Ne.page_num?i.files:[...e?.files??[],...i.files]),n={...e,files:t};return(0,f.yC)(n,Ge.user_data.dir_show_type),n}),void(T=t.data)):void Pe({page_size:Ne.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==p.m.Success)return;const i=t.data;(0,f.yC)(i,Ge.user_data.dir_show_type),et(t.data),ie(t.data),T=t.data};(0,n.useEffect)(()=>async()=>{De(new Set)},[]);const st=()=>{je(!1),(()=>{const e=Se.get("preview_file_name"),t=Se.get("preview_mode");if(!e||!t)return!1;const n=(0,_.GG)("file",(0,_.vX)());if($e.current===n+e)return!0;$e.current=n+e;const s=()=>Me(null);return"md"===t?(i({url:l.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:s}),!0):"log"===t?(m({show:!0,fileName:e,encoding:Se.get("preview_log_enc")??"utf8",wrap:Se.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?(M({path:(0,Y.IO)((0,_.vX)(),e),name:e,close:s}),!0):(Ce({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||(t({open:!1}),q({open:!1}),i({}),m({show:!1}),M({}),z({}),D({}),P({}),I({}),X({}),nt())};(0,n.useEffect)(()=>{st()},[Q,Ne]),(0,n.useEffect)(()=>{ne>0&&nt()},[ne]);const ot=n.useRef(!1);(0,n.useEffect)(()=>{if(null!==se)return ot.current?void(!0===se?it((0,_.GG)("file",(0,_.vX)())):ae(null)):(ot.current=!0,void(!0===se&&null===oe&&it((0,_.GG)("file",(0,_.vX)()))))},[se]);const at=e=>{e.target===e.currentTarget&&(de([]),pe([]))},lt=n.useCallback((0,L.throttle)(e=>{const t=Ye.current;if(!t||!t.parentElement)return;const i=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),s=n.right-e.clientX,o=Math.min(Math.max(s,320),.7*n.width);Ue(parseFloat((o/i).toFixed(2)))},32),[]),rt=()=>{Oe(!1),document.removeEventListener("pointermove",lt)},ct=(0,N.jsxs)("div",{className:"file-list-main",children:[(0,N.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(de([]),pe([]),Ge.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Pe({page_size:Ne.page_size,page_num:1})}},input_path_enter:e=>{var t;de([]),pe([]),ie({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?ee(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let n=e.length-1-t;n>=0;n--)if(e[n]===i)return e.substring(0,n+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,_.vX)(),e)):(e=e.replace(0===(t=Ge.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),ee(e))}}),oe&&(0,N.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:oe.color},children:[(0,N.jsx)("span",{className:"material-icons",style:{color:oe.color},children:"cloud"}),(0,N.jsx)("span",{children:[oe.credential_note,oe.account_note||(B.C1.find(e=>e.value===oe.driver)?.title??oe.driver),oe.name].filter(Boolean).join(" - ")}),oe.readonly&&(0,N.jsx)("span",{className:"mount-readonly-tag",children:J("只读")})]}),Ge.user_data.file_list_pagination_mode===A.yM.pagination?(0,N.jsx)(C.$J,{handleContextMenu:Je,clickBlank:at,list:te.files}):(0,N.jsx)(C.t$,{handleContextMenu:Je,file_list:te.files,folder_list:te.folders,clickBlank:at})]});return(0,N.jsxs)(n.Fragment,{children:[(0,N.jsx)(c.aZ,{children:(0,N.jsx)(h.$Z,{handleEnterPress:async()=>{if(Ee||Ie){if(de([]),pe([]),!ue||!ue.trim())return void ie({files:[],folders:[]});const e=(0,_.GG)("file",(0,_.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ue.trim()});if(t.code!==p.m.Success)return;const i=t.data;return(0,f.yC)(i,Ge.user_data.dir_show_type),et(i),ie(i),void(T=i)}if(!T)return;de([]),pe([]);const e=[],t=[];for(const t of T.files??[])t.name.includes(ue)&&e.push(t);for(const e of T.folders??[])e.name.includes(ue)&&t.push(e);ie({files:e,folders:t})},placeholder:J("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,_.GG)("file",(0,_.vX)());Fe({open:!0,title:J("深搜"),context_div:(0,N.jsx)(E,{base_path:e})})},handleInputChange:e=>{me(e)},max_width:"25em"})}),(0,N.jsxs)(c.aZ,{position:"right",children:[be(A.oV.ai_agent_page)&&(0,N.jsx)($.rA,{icon:"smart_toy",title:J("AI 聊天"),selected:Ke,onClick:()=>Re("chat_open",!Ke?"1":null)}),(0,N.jsx)("div",{className:"mobile-context-btn",children:(0,N.jsx)($.rA,{icon:"more_horiz",title:J("右键"),onClick:()=>{const e=ce[ce.length-1];if(void 0!==e){const t=[...te.folders??[],...te.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],n=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},o=new b.ik;o.path=(0,Y.IO)((0,_.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===u.Iw.folder?u.Iw.folder:(0,b.uL)(t.name),o.size=t.origin_size,re({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};Je(e)}}})}),(0,N.jsx)(H,{})]}),(0,N.jsxs)("div",{className:"file-list-split"+(Ke?" file-list-split--chat":""),children:[ct,Ke&&(0,N.jsxs)(n.Fragment,{children:[(0,N.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Ye,onPointerDown:e=>{e.preventDefault(),Oe(!0),document.addEventListener("pointermove",lt),document.addEventListener("pointerup",rt,{once:!0})}}),(0,N.jsx)("div",{className:"studio-chat-panel",style:{width:`${Le}em`},children:(0,N.jsx)(n.Suspense,{fallback:null,children:(0,N.jsx)(W,{inline_header:!0,sync_url:!1,file_cwd_path:Te(),session_id:Ze??(dt=Te(),a.AG.get_ai_chat_session(Ve,dt)),on_session_change:e=>{We(e),((e,t)=>{qe({...Ve,[e]:t})})(Te(),e)}})})})]})]}),Be&&(0,N.jsx)("div",{className:"shell__overlay",onPointerUp:rt}),we&&(0,N.jsx)(O,{}),ge.open&&(0,N.jsx)(Z,{})]});var dt}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9299],{47374(e,t,i){i.d(t,{e:()=>p});var n=i(96540),s=i(61973),o=i(64694),a=i(34289),l=i(61443),r=i(75725),c=i(22022),d=i(85997),_=i(74848);function p(e){let t=(0,s.zy)();const[i,p]=(0,n.useState)([]),[f,h]=(0,n.useState)("/"),[u,m]=(0,n.useState)(void 0),{t:w,i18n:v}=(0,c.Bd)();n.useEffect(()=>{let t="",i=(0,a.vX)().split("/");i=i.filter(e=>e);const n=i.indexOf(e.baseRoute),s=[];if(-1!=n){t=(0,o.IO)(i.slice(0,n),e.baseRoute);const a=i.slice(n+1);for(let e=0;e<a.length;e++){const i=a[e];s.push({value:i,href:0===e?`${t}${i}/`:(0,o.IO)(s[e-1].href,i)})}h(t),p(s)}},[t]);const g=t=>{t.stopPropagation(),e.clickFun(t)};return(0,_.jsx)("div",{className:"breadcrumbs",onClick:e=>{m(void 0!==u?void 0:"")},children:(0,_.jsx)(n.Fragment,{children:void 0===u?(0,_.jsxs)(n.Fragment,{children:[(0,_.jsx)("span",{className:"chevron",children:(0,_.jsx)(s.N_,{to:f,onClick:g,children:(0,_.jsx)(d.In,{icon:"home"})})}),i.map((e,t)=>(0,_.jsxs)("span",{className:"chevron",children:[(0,_.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,_.jsx)(s.N_,{to:e.href,onClick:g,children:decodeURIComponent(e.value)})]},t))]}):(0,_.jsx)(r.QM,{click:()=>{m(void 0)},children:(0,_.jsx)(l.Sm,{width:"100%",placeholder:w("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),m(void 0)}})})})})}},77481(e,t,i){i.d(t,{S:()=>l,X:()=>a});var n=i(96540),s=i(61443),o=i(74848);function a(e){const[t,i]=n.useState([]),a=(0,n.useRef)(-1),[l,r]=(0,n.useState)(-1),[c,d]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?i(Array.isArray(e.children)?e.children:[e.children]):i(e.rows)},[e.rows,e.children]);const _=()=>{a.current=-1,r(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,i)=>{const n=!!e.filter&&(e.filter.column??0)===i;let a=t;if(n){const i=e.filter,n=i.options.find(e=>e.value===i.value);null!=i.value&&n&&(a=`${t} (${n.label})`)}return(0,o.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,o.jsx)(s.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:a}):t},i)})})}),(0,o.jsx)("tbody",{children:t.map((t,i)=>{const n=!!e.onRowDrag;return(0,o.jsx)("tr",{className:n?(l===i?"row-dragging":"")+(c===i?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(a.current=i,r(i),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||a.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(i))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=a.current,i=c;_(),t<0||i<0||t===i||e.onRowDrag?.(t,i)})())},onDragEnd:_,children:t.map((i,n)=>{const s=n===t.length-1?"small":"";return(0,o.jsx)("td",{className:s,style:{width:e.width??"auto"},children:i},n)})},i)})})]})}function l(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},19299(e,t,i){i.r(t),i.d(t,{default:()=>q});var n=i(96540),s=i(47374),o=i(34843),a=i(82893),l=i(14284),r=i(61973),c=i(4412),d=i(89824),_=i(34289),p=i(53459),f=i(99214),h=i(61443),u=i(47022),m=i(62042),w=i(22022),v=i(7523),g=i(78247),x=i(88815),y=i(6960),j=i(47071),k=i(14944),G=i(92275),A=i(23430);var b=i(34251),C=i(60096),S=i(87361),M=i(76559),$=i(85997),z=i(77481),D=i(70447),N=i(74848);const P=500;function E(e){const{t}=(0,w.Bd)(),i=(0,r.Zp)(),[,s]=(0,o.fp)(a.AG.prompt_card),[l,c]=(0,n.useState)(""),[d,_]=(0,n.useState)(!1),[p,f]=(0,n.useState)([]),[u,m]=(0,n.useState)(0),[v,g]=(0,n.useState)(!1),x=(0,n.useMemo)(()=>new M.I(window.location.host,"file_deep_search"),[]),y=(0,n.useRef)(!1),j=decodeURIComponent(e.base_path);(0,n.useEffect)(()=>{let e=[],t=null;const i=()=>{if(t=null,y.current||!e.length)return;const i=e;e=[],m(e=>e+i.length),f(e=>e.length>=P?e:[...e,...i].slice(0,P))},n=()=>{y.current||_(!1)};return x.addMsg(G.HK.file_deep_search_data,n=>{y.current||(e.push(...n.context??[]),null===t&&(t=setTimeout(i,100)))}),x.addMsg(G.HK.file_deep_search_end,()=>{y.current||(i(),_(!1))}),x.on_message("close",n),()=>{y.current=!0,clearTimeout(t),x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),x.off_message("close",n),x.close()}},[]);const k=()=>{const t=l.trim();if(!t||d)return;f([]),m(0),g(!0),_(!0);const i={param_path:e.base_path,keyword:t};x.sendData(G.HK.file_deep_search,i).catch(()=>{})},A=e=>{let t=e.is_dir?e.path:e.path.slice(0,e.path.lastIndexOf("/")+1);t.endsWith("/")||(t+="/"),s({open:!1}),i(S.o.file+t.split("/").map(encodeURIComponent).join("/"))};return(0,N.jsxs)("div",{className:"file-deep-search",children:[(0,N.jsxs)("div",{className:"file-deep-search__bar",children:[(0,N.jsx)(h.$Z,{icon:"search",value:l,placeholder:t("搜文件名"),handleInputChange:e=>c(e),handleEnterPress:k}),(0,N.jsx)("button",{className:"button button--flat",onClick:d?()=>{x.sendData(G.HK.file_deep_search_cancel,{}).catch(()=>{}),_(!1)}:k,children:t(d?"取消":"搜索")})]}),(0,N.jsxs)("div",{className:"file-deep-search__hint",children:[(0,N.jsxs)("span",{children:[t("范围"),":",j]}),u>0&&(0,N.jsx)("span",{className:"file-deep-search__count",children:u>P?`${t("已显示")} 500 / ${u}`:`${u}`})]}),(0,N.jsxs)("div",{className:"file-deep-search__body",children:[p.length>0&&(0,N.jsx)(z.X,{headers:[t("名称"),t("路径"),""],rows:p.map(e=>{const i=e.path.slice(0,e.path.lastIndexOf("/")+1);return[e.is_dir?(0,N.jsx)("span",{className:"file-deep-search__dir",children:e.name}):e.name,(0,N.jsx)(D.xP,{context:i}),(0,N.jsx)($.rA,{icon:"folder_open",title:t("打开所在目录"),onClick:()=>A(e)})]})}),d&&(0,N.jsxs)("div",{className:"file-deep-search__empty",children:[(0,N.jsx)("span",{className:"chat-session-running",title:t("搜索中")}),t("搜索中")]}),!d&&u>P&&(0,N.jsx)("div",{className:"file-deep-search__more",children:t("结果过多")}),!d&&0===p.length&&(0,N.jsx)("div",{className:"file-deep-search__empty",children:t(v?"无匹配":"输入后搜")})]})]})}var F=i(23496),I=i(12730),X=i(75725),R=i(40505);let K={};function H(){const{t:e}=(0,w.Bd)();let t=(0,r.zy)();const i=(0,r.Zp)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.nowFileList),[h,x]=(0,o.fp)(a.AG.uploadFiles),[y,j]=(0,o.fp)(a.AG.showPrompt),[C,M]=(0,o.fp)(a.AG.selectedFileList),[z,P]=(0,o.fp)(a.AG.copyedFileList),[E,F]=(0,o.fp)(a.AG.cutedFileList),[R,H]=(0,o.fp)(a.AG.selectedFileList),[L,U]=(0,o.fp)(a.AG.clickFileList),[Y,B]=(0,o.fp)(a.AG.fileShellShow),[O]=(0,o.fp)(a.AG.current_mount),[Z,W]=(0,o.fp)(a.AG.file_root_list),[T,V]=(0,o.fp)(a.AG.file_root_index),[q,J]=(0,n.useState)(void 0),[Q,ee]=(0,n.useState)(""),[te,ie]=(0,o.fp)(a.AG.workflow_show),[ne,se]=(0,o.fp)(a.AG.workflow_realtime_show),[oe,ae]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:le}=(0,n.useContext)(v.F),[re,ce]=(0,o.fp)(a.AG.user_base_info),{click_file:de}=(0,f.kZ)(),[_e,pe]=(0,o.fp)(a.AG.prompt_card),fe=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type!==u.Iw.folder?1:0),0),[c]),he=(0,n.useMemo)(()=>c.files.reduce((e,t)=>e+(t.type===u.Iw.folder?1:0),0)+(c.folders?.length??0),[c]);function ue(e){(0,m.SK)(e)}(0,n.useEffect)(()=>{K={}},[t]),(0,n.useEffect)(()=>()=>{B({show:!1,path:""})},[]);const me=(0,f.Vs)(),we=t=>{pe({open:!0,title:e("信息"),context_div:(0,N.jsxs)("div",{style:{maxWidth:"25rem"},children:[(0,N.jsx)(X.Yh,{left:e("挂载位置磁盘"),right:t?.total_size}),(0,N.jsx)(X.Yh,{left:`${e("磁盘剩余")}`,right:t?.left_size}),(0,N.jsx)(X.Yh,{left:`${e("文件系统")}`,right:t?.fs_type}),(0,N.jsx)(X.Yh,{left:`${e("文件夹数")}`,right:he}),(0,N.jsx)(X.Yh,{left:`${e("文件数")}`,right:fe}),(0,N.jsx)(X.Yh,{left:`${e("当前位置")}`,right:(0,N.jsx)(D.xP,{context:t?.now_absolute_path})})]}),cancel:()=>{k.ws.removeMsg(G.HK.file_info)}})};return(0,N.jsxs)(n.Fragment,{children:[C.length>0&&(0,N.jsx)($.rA,{icon:"delete",title:e("删除"),onClick:()=>{j({show:!0,type:d.PromptEnum.FilesDelete,overlay:!0,data:{}})}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_copy",title:e("复制"),onClick:function(){const e=(0,f.ib)(c,C);P(e.map(e=>(0,f.Ok)(e.name))),F([]),ue("已复制")}}),C.length>0&&(0,N.jsx)($.rA,{icon:"content_cut",title:e("剪切"),onClick:function(){const e=(0,f.ib)(c,C);F(e.map(e=>(0,f.Ok)(e.name))),P([]),ue("已剪切")}}),(z.length>0||E.length>0)&&(0,N.jsx)($.rA,{onClick:function(){j({show:!0,type:d.PromptEnum.Confirm,overlay:!0,data:{}})},icon:"content_paste",title:e("粘贴到此处"),tip:z.length+E.length}),C.length>0&&(0,N.jsx)($.rA,{icon:"download",title:e("下载"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=encodeURIComponent((0,f.Ok)(i.name))}const t=l.$M.getDownloadUrl(e);window.open(t)}}),C.length>0&&(0,N.jsx)($.rA,{icon:"compress",title:e("压缩"),onClick:function(){const e=(0,f.ib)(c,C);for(let t=0;t<e.length;t++){const i=e[t];e[t]=(0,f.Ok)(i.name)}e&&0!==e.length?j({show:!0,type:d.PromptEnum.Compress,overlay:!0,data:{files:e}}):(0,m.zN)("没有选中")}}),1===C.length&&(0,N.jsx)($.rA,{icon:"edit_attributes",title:e("重命名"),onClick:function(){j({show:!0,type:d.PromptEnum.FileRename,overlay:!0,data:{}})}}),oe&&(0,N.jsx)($.rA,{icon:"api",title:"workflow",onClick:()=>{ie(!te)}}),!O&&(0,N.jsx)($.rA,{icon:"terminal",title:"shell",onClick:function(){Y.show?B({show:!1,path:""}):B({show:!0,path:(0,_.GG)("file",(0,_.vX)())})}}),s(A.oV.share_file)&&(0,N.jsx)($.rA,{icon:"share",title:e("文件分享"),onClick:()=>{i(`${S.o.share_list_setting_page}`)}}),(0,N.jsx)($.rA,{icon:"grid_view",title:e("切换样式"),onClick:me}),(0,N.jsx)($.rA,{icon:"create_new_folder",title:e("创建文件夹"),onClick:function(){j({show:!0,type:d.PromptEnum.DirNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,N.jsx)($.rA,{icon:"note_add",title:e("创建文本文件"),onClick:function(){j({show:!0,type:d.PromptEnum.FileNew,overlay:!0,data:{dir:(0,_.GG)("file",(0,_.vX)())}})}}),(0,N.jsx)($.rA,{icon:"upload_file",title:e("上传"),onClick:()=>{j({show:!0,type:d.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let i=!!t[0].webkitRelativePath;const n=[],s=new Set;for(let e=0;e<t.length;e++){const o=t[e],a=i?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=a,i&&s.add((0,I.S)(a)),n.push(o)}const o=[];if(i)for(const e of s)o.push({isDir:!0,fullPath:e,name:e});o.push(...n),x(o),j({show:!0,type:d.PromptEnum.FilesUpload,overlay:!1,data:{}})}}})}}),(0,N.jsx)($.rA,{icon:"info",title:e("信息"),onClick:async()=>{let e;if(!K.now_absolute_path){k.ws.addMsg(G.HK.file_info,t=>{const i=t.context;e&&(K={...K,...i},k.ws.removeMsg(G.HK.file_info),we(K))});const t=await k.ws.sendData(G.HK.file_info,{type:u.Iw.folder,path:(0,_.GG)("file",(0,_.vX)())});e=t.context,K=e,we(K)}we(K)}}),(0,N.jsx)($.rA,{icon:"more_vert",title:e("切换目录"),onClick:t=>{const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory,n.items=Z,n.item_pre_value=T,n.textClick=async t=>{if(-1===t)return i(`${S.o.setting_private_env_setting}`),j({data:void 0,overlay:!1,type:"",show:!1}),void(0,m.N9)(e("请配置 文件夹路径"));(async e=>{V(e),await l.$M.post("base_switch",{root_index:e}),await le(),i("/file/"),H([]),U([])})(t),j({data:void 0,overlay:!1,type:"",show:!1})},j({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}})]})}var L=i(2543),U=i(21499),Y=i(64694),B=i(17903);const O=n.lazy(()=>Promise.all([i.e(7856),i.e(6349),i.e(3659)]).then(i.bind(i,63659))),Z=n.lazy(()=>Promise.all([i.e(7856),i.e(1636)]).then(i.bind(i,81636))),W=n.lazy(()=>Promise.all([i.e(4946),i.e(2626),i.e(892),i.e(9334),i.e(6104)]).then(i.bind(i,69857)));let T,V="";function q(){const[e,t]=(0,o.fp)(a.AG.editorSetting),[,i]=(0,o.fp)(a.AG.md_editor),[,m]=(0,o.fp)(a.AG.log_viewer),[,M]=(0,o.fp)(a.AG.image_editor),[,z]=(0,o.fp)(a.AG.markdown),[,D]=(0,o.fp)(a.AG.excalidraw_editor),[,P]=(0,o.fp)(a.AG.mind_editor),[,I]=(0,o.fp)(a.AG.timeline_editor),[,X]=(0,o.fp)(a.AG.excel_editor),[K,q]=(0,o.fp)(a.AG.file_preview),{t:J}=(0,w.Bd)();let Q=(0,r.zy)();const ee=(0,r.Zp)(),[te,ie]=(0,o.fp)(a.AG.nowFileList),[ne]=(0,o.fp)(a.AG.file_list_refresh),[se]=(0,o.fp)(a.AG.mount_enabled),[oe,ae]=(0,o.fp)(a.AG.current_mount),[le,re]=(0,o.fp)(a.AG.showPrompt),[ce,de]=(0,o.fp)(a.AG.selectedFileList),[_e,pe]=(0,o.fp)(a.AG.clickFileList),[fe,he]=(0,o.fp)(a.AG.fileShellShow),[ue,me]=(0,n.useState)(""),[we,ve]=(0,o.fp)(a.AG.workflow_show),[ge,xe]=(0,o.fp)(a.AG.workflow_realtime_show),[ye,je]=(0,o.fp)(a.AG.work_flow_show),{initUserInfo:ke}=(0,n.useContext)(v.F),[Ge,Ae]=(0,o.fp)(a.AG.user_base_info),{check_user_auth:be}=(0,g.MH)(),{click_file:Ce}=(0,f.kZ)(),[Se]=(0,r.ok)(),Me=(0,f._A)(),$e=n.useRef(null),[ze,De]=(0,o.fp)(a.AG.to_running_files),[Ne,Pe]=(0,o.fp)(a.AG.file_page),[Ee]=(0,o.fp)(a.AG.blank_search_mode),[,Fe]=(0,o.fp)(a.AG.prompt_card),[Ie,Xe]=(0,o.fp)(a.AG.blank_search_mode_for_temp),Re=(0,f.oT)(),Ke="1"===Se.get("chat_open"),He=be(A.oV.ai_agent_page);(0,n.useEffect)(()=>{Ge?.user_data&&Ke&&!He&&Re("chat_open",null)},[Ke,He,Ge]);const[Le,Ue]=(0,o.fp)(a.AG.studio_chat_width),Ye=n.useRef(null),[Be,Oe]=(0,n.useState)(!1),[Ze,We]=(0,n.useState)(void 0),Te=(0,f.dN)(),[Ve,qe]=(0,o.fp)(a.AG.ai_chat_session_by_cwd),Je=function(){const[e,t]=(0,o.fp)(a.AG.user_base_info),{t:i}=(0,w.Bd)(),{check_user_auth:s}=(0,g.MH)(),[c,p]=(0,o.fp)(a.AG.router_jump),h=(0,r.Zp)(),{initUserInfo:m}=(0,n.useContext)(v.F),[x,y]=(0,o.fp)(a.AG.nowFileList),[j,C]=(0,o.fp)(a.AG.showPrompt),[M,$]=(0,o.fp)(a.AG.fileShellShow),[z,D]=(0,o.fp)(a.AG.blank_search_mode);return t=>{t.preventDefault(),t.stopPropagation();const n=new b.ik;n.x=t.clientX,n.y=t.clientY,n.type=u.Iw.directory;const o=[{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max),children:i("时间逆序")}),v:A.t8.time_minx_max},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_max_min),children:i("时间顺序")}),v:A.t8.time_max_min}],a=[{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max),children:i("大小顺序")}),v:A.t8.size_min_max},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_max_min),children:i("大小逆序")}),v:A.t8.size_max_min}],r=[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.file_list_pagination_mode||e.user_data.file_list_pagination_mode===A.yM.all),children:i("全部加载文件")}),v:A.yM.all},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.file_list_pagination_mode===A.yM.pagination),children:i("scrll_l")}),v:A.yM.pagination}],c=[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.file_time_show_type||e.user_data.file_time_show_type===A.KD.current),children:i("最近时间")}),v:A.KD.current},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.file_time_show_type===A.KD.time),children:i("准确时间")}),v:A.KD.time}],w=[{r:i("文件列表展示"),items:[{r:i("文件排序"),v:"",items:[{r:(0,N.jsx)("span",{style:(0,R.ok)(!e.user_data.dir_show_type),children:i("系统默认")}),v:A.t8.defualt},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.name),children:i("名字")}),v:A.t8.name},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.time_minx_max||e.user_data.dir_show_type===A.t8.time_max_min),children:i("修改时间")}),v:!1,items:o},{r:(0,N.jsx)("span",{style:(0,R.ok)(e.user_data.dir_show_type===A.t8.size_min_max||e.user_data.dir_show_type===A.t8.size_max_min),children:i("文件大小")}),v:!1,items:a}]},{r:i("文件加载方式"),v:"",items:r},{r:i("时间展示"),v:"",items:c},{r:i("缩放调整"),v:"zoom_adjust"},{r:(0,N.jsx)("span",{style:(0,R.ok)(z),children:i("srchbln")}),v:"blank_search_mode"}]}];x?.folders?.find(e=>".git"===e.name)&&w.push({r:i("查看Git提交"),v:"git_page"}),s(A.oV.code_resource)&&w.push({r:i("add_rot"),v:"code_resource"}),s(A.oV.http_proxy)&&w.push({r:i("dl_here"),v:"http_resource"}),e?.user_data?.quick_cmd&&(0,f.LL)([...e.user_data.quick_cmd],w),n.items=w,n.textClick=async e=>{if(console.log(e),!1===e)return;const t={};if("gcfg_dir_config"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.gcfg_page}/${encodeURIComponent(e)}`)}if("git_page"===e){const e=(0,_.GG)("file",(0,_.vX)());return C({data:void 0,overlay:!1,type:"",show:!1}),void h(`${S.o.git_page}/${encodeURIComponent(e)}`)}if("code_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({page_self_router_api_data:[`/api/${Date.now()}`,e.context.now_absolute_path]}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/setting/customer_router/")}if("http_resource"===e){const e=await k.ws.sendData(G.HK.file_info,{path:(0,_.GG)("file",(0,_.vX)())});return p({http_download_map_path:e.context.now_absolute_path}),C({data:void 0,overlay:!1,type:"",show:!1}),void h("/proxy/http/")}if("zoom_adjust"===e)return C({data:void 0,overlay:!1,type:"",show:!1}),void setTimeout(()=>{C({show:!0,type:d.PromptEnum.ZoomAdjust,overlay:!1,data:{}})},0);if("object"==typeof e&&"quick_cmd"===e.tag){let t=e.cmd;t&&(t.endsWith("\r")||(t+="\r",$({show:!0,path:(0,_.GG)("file",(0,_.vX)()),cmd:t})))}else{if("blank_search_mode"===e)return D(!z),void C({data:void 0,overlay:!1,type:"",show:!1});if(e===A.yM.all||e===A.yM.pagination)t.is_pagination_mode=!0;else if(e===A.KD.current||e===A.KD.time)t.is_file_show_type=!0;else{if(e!==A.t8.defualt&&e!==A.t8.name&&e!==A.t8.size_max_min&&e!==A.t8.size_min_max&&e!==A.t8.time_max_min&&e!==A.t8.time_minx_max)return;t.is_dir_list_type=!0}}await l.wm.post(F.s.user_save_private_attr,{type:e,...t}),await m(),C({data:void 0,overlay:!1,type:"",show:!1}),h((0,_.vX)())},C({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:n})}}(),Qe=async()=>{const e=new j.Nd;e.dir_path=`${(0,_.GG)("file",(0,_.vX)())}`,k.ws.addMsg(G.HK.workflow_realtime,e=>{const t=e.context;if(e.context){for(const e of t.sucess_file_list)(0,f.Ys)(e);for(const e of t.failed_file_list)(0,f.V$)(e);De(new Set(t.running_file_list))}}),await k.ws.sendData(G.HK.workflow_realtime,e)},et=async e=>{let t=!1;for(const i of e.files??[])i.origin_size=i.size,i.size=(0,x.v7)(i.size),Ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",t||!i.name.endsWith(".workflow.yml")&&!i.name.endsWith(".act")||(t=!0,Promise.resolve().then(()=>{Qe()})),i.name===j.SB&&(t=!0);for(const i of e.folders??[])Ge.user_data.file_time_show_type===A.KD.time?i.show_mtime=i.mtime?(0,U.Yq)(i.mtime):"":i.show_mtime=i.mtime?(0,y.s)(i.mtime):"",i.name===j.SB&&(t=!0);je(t)},tt=n.useRef(null),it=async e=>{if(!0===se){if(tt.current!==e){tt.current=e;try{const t=await l.$M.post("file/mount_info",{param_path:e});ae(t?.data??null)}catch(e){ae(null)}}}else ae(null)},nt=async()=>{const e=(0,_.GG)("file",(0,_.vX)());if(Ee||Ie)return;let t;if(it(e),Ge.user_data.file_list_pagination_mode===A.yM.pagination){if(V!==e){if(V=e,1!==Ne.page_num)return void Pe({page_size:Ne.page_size,page_num:1})}else if(Ne.page_num<0)return;if(t=await l.$M.post("file_get_page",{param_path:e,page_num:Ne.page_num,page_size:Ne.page_size}),t.code!==p.m.Success)return;const i=t.data;return et(i),i.files?.length?(ie(e=>{const t=(0,L.cloneDeep)(1===Ne.page_num?i.files:[...e?.files??[],...i.files]),n={...e,files:t};return(0,f.yC)(n,Ge.user_data.dir_show_type),n}),void(T=t.data)):void Pe({page_size:Ne.page_size,page_num:-1})}if(t=await l.$M.get(e),t.code!==p.m.Success)return;const i=t.data;(0,f.yC)(i,Ge.user_data.dir_show_type),et(t.data),ie(t.data),T=t.data};(0,n.useEffect)(()=>async()=>{De(new Set)},[]);const st=()=>{je(!1),(()=>{const e=Se.get("preview_file_name"),t=Se.get("preview_mode");if(!e||!t)return!1;const n=(0,_.GG)("file",(0,_.vX)());if($e.current===n+e)return!0;$e.current=n+e;const s=()=>Me(null);return"md"===t?(i({url:l.$M.getDownloadUrl(`${encodeURIComponent(n)}${e}`),path:`${n}${e}`,name:e,close:s}),!0):"log"===t?(m({show:!0,fileName:e,encoding:Se.get("preview_log_enc")??"utf8",wrap:Se.get("preview_log_wrap")??"wrap",close:s}),!0):"image_edit"===t?(M({path:(0,Y.IO)((0,_.vX)(),e),name:e,close:s}),!0):(Ce({name:e,opt_shell:!0,..."text"===t?{model:"text"}:{},close:s}),!0)})()||(t({open:!1}),q({open:!1}),i({}),m({show:!1}),M({}),z({}),D({}),P({}),I({}),X({}),nt())};(0,n.useEffect)(()=>{st()},[Q,Ne]),(0,n.useEffect)(()=>{ne>0&&nt()},[ne]);const ot=n.useRef(!1);(0,n.useEffect)(()=>{if(null!==se)return ot.current?void(!0===se?it((0,_.GG)("file",(0,_.vX)())):ae(null)):(ot.current=!0,void(!0===se&&null===oe&&it((0,_.GG)("file",(0,_.vX)()))))},[se]);const at=e=>{e.target===e.currentTarget&&(de([]),pe([]))},lt=n.useCallback((0,L.throttle)(e=>{const t=Ye.current;if(!t||!t.parentElement)return;const i=parseFloat(getComputedStyle(t).fontSize),n=t.parentElement.getBoundingClientRect(),s=n.right-e.clientX,o=Math.min(Math.max(s,320),.7*n.width);Ue(parseFloat((o/i).toFixed(2)))},32),[]),rt=()=>{Oe(!1),document.removeEventListener("pointermove",lt)},ct=(0,N.jsxs)("div",{className:"file-list-main",children:[(0,N.jsx)(s.e,{baseRoute:"file",clickFun:function(){if(de([]),pe([]),Ge.user_data.file_list_pagination_mode===A.yM.pagination){const e=document.getElementById("listing");e&&(e.scrollTop=0),Pe({page_size:Ne.page_size,page_num:1})}},input_path_enter:e=>{var t;de([]),pe([]),ie({files:[],folders:[]}),!function(e){return"string"==typeof e&&0!==e.length&&(/^[a-zA-Z]:[\\\/]/.test(e)||/^\\\\[^\\/]+[\\/]/.test(e)||/^\//.test(e))}(e)?ee(function(e,t){let i=function(e){let t="\\";for(const i of e)if("/"===i||"\\"===i){t=i;break}return t}(e);if("."===t)return e;if(".."===t){if(e.length>1){let t=e[e.length-1]===i?1:0;for(let n=e.length-1-t;n>=0;n--)if(e[n]===i)return e.substring(0,n+1)}return e}return e.endsWith(i)&&t.startsWith(i)?e.slice(0,-1)+t:e.endsWith(i)||t.startsWith(i)?e+t:e+i+t}((0,_.vX)(),e)):(e=e.replace(0===(t=Ge.user_data).folder_item_now||void 0===t.folder_item_now?t.cwd:t.folder_items[t.folder_item_now-1].path,""),ee(e))}}),oe&&(0,N.jsxs)("div",{className:"mount-tip-bar",style:{borderLeftColor:oe.color},children:[(0,N.jsx)("span",{className:"material-icons",style:{color:oe.color},children:"cloud"}),(0,N.jsx)("span",{children:[oe.credential_note,oe.account_note||(B.C1.find(e=>e.value===oe.driver)?.title??oe.driver),oe.name].filter(Boolean).join(" - ")}),oe.readonly&&(0,N.jsx)("span",{className:"mount-readonly-tag",children:J("只读")})]}),Ge.user_data.file_list_pagination_mode===A.yM.pagination?(0,N.jsx)(C.$J,{handleContextMenu:Je,clickBlank:at,list:te.files}):(0,N.jsx)(C.t$,{handleContextMenu:Je,file_list:te.files,folder_list:te.folders,clickBlank:at})]});return(0,N.jsxs)(n.Fragment,{children:[(0,N.jsx)(c.aZ,{children:(0,N.jsx)(h.$Z,{handleEnterPress:async()=>{if(Ee||Ie){if(de([]),pe([]),!ue||!ue.trim())return void ie({files:[],folders:[]});const e=(0,_.GG)("file",(0,_.vX)()),t=await l.$M.post("file_get_page",{param_path:e,page_num:1,page_size:1e4,search:ue.trim()});if(t.code!==p.m.Success)return;const i=t.data;return(0,f.yC)(i,Ge.user_data.dir_show_type),et(i),ie(i),void(T=i)}if(!T)return;de([]),pe([]);const e=[],t=[];for(const t of T.files??[])t.name.includes(ue)&&e.push(t);for(const e of T.folders??[])e.name.includes(ue)&&t.push(e);ie({files:e,folders:t})},placeholder:J("搜索当前目录"),icon:"search",value:"",mobile_hidden:!0,handleIconClick:()=>{const e=(0,_.GG)("file",(0,_.vX)());Fe({open:!0,title:J("深搜"),context_div:(0,N.jsx)(E,{base_path:e})})},handleInputChange:e=>{me(e)},max_width:"25em"})}),(0,N.jsxs)(c.aZ,{position:"right",children:[be(A.oV.ai_agent_page)&&(0,N.jsx)($.rA,{icon:"smart_toy",title:J("AI 聊天"),selected:Ke,onClick:()=>Re("chat_open",!Ke?"1":null)}),(0,N.jsx)("div",{className:"mobile-context-btn",children:(0,N.jsx)($.rA,{icon:"more_horiz",title:J("右键"),onClick:()=>{const e=ce[ce.length-1];if(void 0!==e){const t=[...te.folders??[],...te.files??[]][e];if(t){const i=document.querySelectorAll(".item")[e],n=i?i.getBoundingClientRect():{left:window.innerWidth/2,bottom:100},s={preventDefault:()=>{},stopPropagation:()=>{},clientX:n.left+10,clientY:n.bottom??100},o=new b.ik;o.path=(0,Y.IO)((0,_.vX)(),t.name),o.filename=t.name,o.x=s.clientX,o.y=s.clientY,o.type=t.type===u.Iw.folder?u.Iw.folder:(0,b.uL)(t.name),o.size=t.origin_size,re({show:!0,type:d.PromptEnum.FileMenu,overlay:!1,data:o})}}else{const e={preventDefault:()=>{},stopPropagation:()=>{},clientX:window.innerWidth/2,clientY:window.innerHeight/2};Je(e)}}})}),(0,N.jsx)(H,{})]}),(0,N.jsxs)("div",{className:"file-list-split"+(Ke?" file-list-split--chat":""),children:[ct,Ke&&(0,N.jsxs)(n.Fragment,{children:[(0,N.jsx)("div",{className:"studio__divider studio__divider--chat",ref:Ye,onPointerDown:e=>{e.preventDefault(),Oe(!0),document.addEventListener("pointermove",lt),document.addEventListener("pointerup",rt,{once:!0})}}),(0,N.jsx)("div",{className:"studio-chat-panel",style:{width:`${Le}em`},children:(0,N.jsx)(n.Suspense,{fallback:null,children:(0,N.jsx)(W,{inline_header:!0,sync_url:!1,file_cwd_path:Te(),session_id:Ze??(dt=Te(),a.AG.get_ai_chat_session(Ve,dt)),on_session_change:e=>{We(e),((e,t)=>{qe({...Ve,[e]:t})})(Te(),e)}})})})]})]}),Be&&(0,N.jsx)("div",{className:"shell__overlay",onPointerUp:rt}),we&&(0,N.jsx)(O,{}),ge.open&&(0,N.jsx)(Z,{})]});var dt}}}]);
|
package/build/dist/dark.css
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
--background: #121212;
|
|
4
4
|
--surfacePrimary: #1e1e1e;
|
|
5
5
|
--surfaceSecondary: #2d2d2d;
|
|
6
|
-
--divider: rgba(255, 255, 255, 0.12);
|
|
7
|
-
/* 深色下边框和悬浮态必须用白色透明,否则沿用根部的黑色值,在深色背景上几乎不可见 */
|
|
8
|
-
--borderPrimary: rgba(255, 255, 255, 0.12);
|
|
9
|
-
--borderSecondary: rgba(255, 255, 255, 0.2);
|
|
10
|
-
--hover: rgba(255, 255, 255, 0.08);
|
|
11
|
-
/* 聊天气泡:用户气泡用中性实色,深色背景上有明确厚度 */
|
|
12
|
-
--chat-user-bg: #2f2f2f;
|
|
6
|
+
--divider: rgba(255, 255, 255, 0.12);
|
|
7
|
+
/* 深色下边框和悬浮态必须用白色透明,否则沿用根部的黑色值,在深色背景上几乎不可见 */
|
|
8
|
+
--borderPrimary: rgba(255, 255, 255, 0.12);
|
|
9
|
+
--borderSecondary: rgba(255, 255, 255, 0.2);
|
|
10
|
+
--hover: rgba(255, 255, 255, 0.08);
|
|
11
|
+
/* 聊天气泡:用户气泡用中性实色,深色背景上有明确厚度 */
|
|
12
|
+
--chat-user-bg: #2f2f2f;
|
|
13
13
|
--chat-user-text: inherit;
|
|
14
14
|
--icon: #ffffff;
|
|
15
15
|
--textPrimary: rgba(255, 255, 255, 0.87);
|
|
@@ -336,13 +336,13 @@ table th {
|
|
|
336
336
|
color: var(--primary);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
/* 气泡配色与形状统一由 chat.css 控制,这里不再覆盖外层容器,
|
|
340
|
-
否则会给 .chat-message 再铺一层背景,和内部气泡叠成双层 */
|
|
341
|
-
.chat-message.bot::before {
|
|
342
|
-
background: var(--primary);
|
|
343
|
-
opacity: 0.6;
|
|
344
|
-
transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
|
|
345
|
-
}
|
|
339
|
+
/* 气泡配色与形状统一由 chat.css 控制,这里不再覆盖外层容器,
|
|
340
|
+
否则会给 .chat-message 再铺一层背景,和内部气泡叠成双层 */
|
|
341
|
+
.chat-message.bot::before {
|
|
342
|
+
background: var(--primary);
|
|
343
|
+
opacity: 0.6;
|
|
344
|
+
transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
|
|
345
|
+
}
|
|
346
346
|
|
|
347
347
|
|
|
348
348
|
/* 暗黑模式 - AI 执行中最后一个气泡头像呼吸 */
|
|
@@ -537,10 +537,6 @@ table th {
|
|
|
537
537
|
.chat-session-item small {
|
|
538
538
|
color: var(--textSecondary);
|
|
539
539
|
}
|
|
540
|
-
.chat-session-source {
|
|
541
|
-
color: var(--icon-purple);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
540
|
/* ===== 暗黑模式 - 模型选择器 ===== */
|
|
545
541
|
.model-selector-dropdown {
|
|
546
542
|
border-color: var(--divider);
|
|
@@ -638,16 +634,6 @@ table th {
|
|
|
638
634
|
color: var(--textSecondary);
|
|
639
635
|
}
|
|
640
636
|
|
|
641
|
-
.menu-select-popup {
|
|
642
|
-
background: var(--surfacePrimary);
|
|
643
|
-
border-radius: var(--border-radius);
|
|
644
|
-
box-shadow: var(--shadow-lg);
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.menu-select-item:hover {
|
|
648
|
-
background:var(--primary-light);
|
|
649
|
-
border-radius: var(--border-radius-sm);
|
|
650
|
-
}
|
|
651
637
|
|
|
652
638
|
.usage-stats-popup {
|
|
653
639
|
background: var(--surfacePrimary);
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
--background: #121212;
|
|
4
4
|
--surfacePrimary: #1e1e1e;
|
|
5
5
|
--surfaceSecondary: #2d2d2d;
|
|
6
|
-
--divider: rgba(255, 255, 255, 0.12);
|
|
7
|
-
/* 深色下边框和悬浮态必须用白色透明,否则沿用根部的黑色值,在深色背景上几乎不可见 */
|
|
8
|
-
--borderPrimary: rgba(255, 255, 255, 0.12);
|
|
9
|
-
--borderSecondary: rgba(255, 255, 255, 0.2);
|
|
10
|
-
--hover: rgba(255, 255, 255, 0.08);
|
|
11
|
-
/* 聊天气泡:用户气泡用中性实色,深色背景上有明确厚度 */
|
|
12
|
-
--chat-user-bg: #333537;
|
|
6
|
+
--divider: rgba(255, 255, 255, 0.12);
|
|
7
|
+
/* 深色下边框和悬浮态必须用白色透明,否则沿用根部的黑色值,在深色背景上几乎不可见 */
|
|
8
|
+
--borderPrimary: rgba(255, 255, 255, 0.12);
|
|
9
|
+
--borderSecondary: rgba(255, 255, 255, 0.2);
|
|
10
|
+
--hover: rgba(255, 255, 255, 0.08);
|
|
11
|
+
/* 聊天气泡:用户气泡用中性实色,深色背景上有明确厚度 */
|
|
12
|
+
--chat-user-bg: #333537;
|
|
13
13
|
--chat-user-text: inherit;
|
|
14
14
|
--icon: #ffffff;
|
|
15
15
|
--textPrimary: rgba(255, 255, 255, 0.87);
|
|
@@ -332,13 +332,13 @@ table th {
|
|
|
332
332
|
color: var(--primary);
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
/* 气泡配色与形状统一由 chat.css 控制,这里不再覆盖外层容器,
|
|
336
|
-
否则会给 .chat-message 再铺一层背景,和内部气泡叠成双层 */
|
|
337
|
-
.chat-message.bot::before {
|
|
338
|
-
background: var(--primary);
|
|
339
|
-
opacity: 0.6;
|
|
340
|
-
transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
|
|
341
|
-
}
|
|
335
|
+
/* 气泡配色与形状统一由 chat.css 控制,这里不再覆盖外层容器,
|
|
336
|
+
否则会给 .chat-message 再铺一层背景,和内部气泡叠成双层 */
|
|
337
|
+
.chat-message.bot::before {
|
|
338
|
+
background: var(--primary);
|
|
339
|
+
opacity: 0.6;
|
|
340
|
+
transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
|
|
341
|
+
}
|
|
342
342
|
|
|
343
343
|
|
|
344
344
|
/* Google 暗黑模式 - AI 执行中最后一个气泡头像呼吸 */
|
|
@@ -542,10 +542,6 @@ table th {
|
|
|
542
542
|
.chat-session-item small {
|
|
543
543
|
color: var(--textSecondary);
|
|
544
544
|
}
|
|
545
|
-
.chat-session-source {
|
|
546
|
-
color: var(--icon-purple);
|
|
547
|
-
}
|
|
548
|
-
|
|
549
545
|
/* ===== Google 暗黑模式 - 模型选择器 ===== */
|
|
550
546
|
.model-selector-dropdown {
|
|
551
547
|
border-color: var(--divider);
|
|
@@ -645,14 +641,8 @@ table th {
|
|
|
645
641
|
|
|
646
642
|
/* ===== Google 暗黑模式 - 保留原 google-dark 的其他内容 ===== */
|
|
647
643
|
|
|
648
|
-
.menu-select-popup {
|
|
649
|
-
background: var(--surfacePrimary);
|
|
650
|
-
border-radius: var(--border-radius);
|
|
651
|
-
box-shadow: var(--shadow-lg);
|
|
652
|
-
}
|
|
653
644
|
|
|
654
|
-
.
|
|
655
|
-
background:var(--primary-light);
|
|
645
|
+
.menu_select {
|
|
656
646
|
border-radius: var(--border-radius-sm);
|
|
657
647
|
}
|
|
658
648
|
|
package/build/dist/google.css
CHANGED
|
@@ -44,7 +44,6 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
|
|
48
47
|
body {
|
|
49
48
|
background: var(--background);
|
|
50
49
|
color: var(--textPrimary);
|
|
@@ -287,7 +286,7 @@ table th {
|
|
|
287
286
|
}
|
|
288
287
|
|
|
289
288
|
.dropdown_item {
|
|
290
|
-
background: var(--surfacePrimary)
|
|
289
|
+
/*background: var(--surfacePrimary);*/
|
|
291
290
|
margin: 0;
|
|
292
291
|
border-radius: var(--border-radius-sm);
|
|
293
292
|
}
|
|
@@ -328,8 +327,8 @@ table th {
|
|
|
328
327
|
color: var(--primary);
|
|
329
328
|
}
|
|
330
329
|
|
|
331
|
-
/* 气泡形状统一由 chat.css 控制 */
|
|
332
|
-
.chat-input-area textarea {
|
|
330
|
+
/* 气泡形状统一由 chat.css 控制 */
|
|
331
|
+
.chat-input-area textarea {
|
|
333
332
|
background: var(--surfacePrimary);
|
|
334
333
|
border-radius: var(--border-radius);
|
|
335
334
|
}
|
|
@@ -383,14 +382,7 @@ table th {
|
|
|
383
382
|
border-color: rgba(0, 0, 0, 0.28);
|
|
384
383
|
}
|
|
385
384
|
|
|
386
|
-
.
|
|
387
|
-
background: var(--surfacePrimary);
|
|
388
|
-
border-radius: var(--border-radius);
|
|
389
|
-
box-shadow: var(--shadow-lg);
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
.menu-select-item:hover {
|
|
393
|
-
background:var(--primary-light);
|
|
385
|
+
.menu_select {
|
|
394
386
|
border-radius: var(--border-radius-sm);
|
|
395
387
|
}
|
|
396
388
|
|
|
@@ -1708,4 +1700,4 @@ nav::-webkit-scrollbar {
|
|
|
1708
1700
|
nav:hover::-webkit-scrollbar-thumb {
|
|
1709
1701
|
background: var(--divider);
|
|
1710
1702
|
border-radius: 4px;
|
|
1711
|
-
}
|
|
1703
|
+
}
|
package/build/dist/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><base href="/"><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.
|
|
1
|
+
<!doctype html><html lang="en"><head><base href="/"><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>{{{web_site_title}}}</title><link rel="icon" href="{{{logo_favicon}}}"/><script defer="defer" src="main.cc7cfac98131b3544b23.js"></script></head><body><div id="root"></div></body><script id="pre_code" type="text/template">return {{{Windows_FileCat}}};</script><script>window.EXCALIDRAW_ASSET_PATH = "/";window.FileCat;</script></html>
|