@desktalk/core 0.1.0-alpha.2 → 0.1.0-alpha.3

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.
Files changed (72) hide show
  1. package/dist/frontend/assets/{frontend-DzPuSfWJ.js → frontend-BGrAEoc-.js} +2 -2
  2. package/dist/frontend/assets/{frontend-DzPuSfWJ.js.map → frontend-BGrAEoc-.js.map} +1 -1
  3. package/dist/frontend/assets/{frontend-Dn0dKARf.js → frontend-BWgJC5kX.js} +2 -2
  4. package/dist/frontend/assets/{frontend-Dn0dKARf.js.map → frontend-BWgJC5kX.js.map} +1 -1
  5. package/dist/frontend/assets/{frontend-yvqb_XNo.js → frontend-CTdbpot-.js} +2 -2
  6. package/dist/frontend/assets/{frontend-yvqb_XNo.js.map → frontend-CTdbpot-.js.map} +1 -1
  7. package/dist/frontend/assets/{frontend-BAknU-ge.js → frontend-CwxhooMD.js} +3 -3
  8. package/dist/frontend/assets/frontend-CwxhooMD.js.map +1 -0
  9. package/dist/frontend/assets/{frontend-DpmnQ1w4.js → frontend-DRTe8-9o.js} +3 -3
  10. package/dist/frontend/assets/frontend-DRTe8-9o.js.map +1 -0
  11. package/dist/frontend/assets/frontend-Dz_8vRz5.js +547 -0
  12. package/dist/frontend/assets/frontend-Dz_8vRz5.js.map +1 -0
  13. package/dist/frontend/assets/{frontend-0mUhlxkg.js → frontend-vY_f4fVI.js} +2 -2
  14. package/dist/frontend/assets/{frontend-0mUhlxkg.js.map → frontend-vY_f4fVI.js.map} +1 -1
  15. package/dist/frontend/assets/{highlighted-body-TPN3WLV5-BheGZsYG.js → highlighted-body-TPN3WLV5-CRT7miki.js} +2 -2
  16. package/dist/frontend/assets/{highlighted-body-TPN3WLV5-BheGZsYG.js.map → highlighted-body-TPN3WLV5-CRT7miki.js.map} +1 -1
  17. package/dist/frontend/assets/index-CI5Mxo87.js +1863 -0
  18. package/dist/frontend/assets/index-CI5Mxo87.js.map +1 -0
  19. package/dist/frontend/assets/index-D6_VuNyY.css +1 -0
  20. package/dist/frontend/index.html +3 -2
  21. package/dist/frontend/logo.png +0 -0
  22. package/dist/i18n/manifest.json +268 -0
  23. package/dist/i18n/zh-CN.json +53 -0
  24. package/dist/i18n/zh.json +60 -0
  25. package/dist/server/auth-routes.d.ts.map +1 -1
  26. package/dist/server/auth-routes.js +2 -2
  27. package/dist/server/auth-routes.js.map +1 -1
  28. package/dist/server/index.d.ts.map +1 -1
  29. package/dist/server/index.js +14 -5
  30. package/dist/server/index.js.map +1 -1
  31. package/dist/server/thumbnail-routes.d.ts +3 -0
  32. package/dist/server/thumbnail-routes.d.ts.map +1 -0
  33. package/dist/server/thumbnail-routes.js +97 -0
  34. package/dist/server/thumbnail-routes.js.map +1 -0
  35. package/dist/services/ai/edit-history.d.ts +3 -7
  36. package/dist/services/ai/edit-history.d.ts.map +1 -1
  37. package/dist/services/ai/edit-history.js +145 -76
  38. package/dist/services/ai/edit-history.js.map +1 -1
  39. package/dist/services/ai/edit-tool.js +1 -1
  40. package/dist/services/ai/edit-tool.js.map +1 -1
  41. package/dist/services/ai/layout-tool.d.ts +8 -0
  42. package/dist/services/ai/layout-tool.d.ts.map +1 -0
  43. package/dist/services/ai/layout-tool.js +105 -0
  44. package/dist/services/ai/layout-tool.js.map +1 -0
  45. package/dist/services/ai/manual-pages/desktop-layout.md +34 -0
  46. package/dist/services/ai/manual-pages/desktop-windows.md +2 -0
  47. package/dist/services/ai/manual-pages/index.d.ts.map +1 -1
  48. package/dist/services/ai/manual-pages/index.js +9 -2
  49. package/dist/services/ai/manual-pages/index.js.map +1 -1
  50. package/dist/services/ai/pi-session-service.d.ts.map +1 -1
  51. package/dist/services/ai/pi-session-service.js +4 -0
  52. package/dist/services/ai/pi-session-service.js.map +1 -1
  53. package/dist/services/ai/redo-edit-tool.js +1 -1
  54. package/dist/services/ai/redo-edit-tool.js.map +1 -1
  55. package/dist/services/ai/undo-edit-tool.js +1 -1
  56. package/dist/services/ai/undo-edit-tool.js.map +1 -1
  57. package/dist/services/file-thumbnail.d.ts +20 -0
  58. package/dist/services/file-thumbnail.d.ts.map +1 -0
  59. package/dist/services/file-thumbnail.js +102 -0
  60. package/dist/services/file-thumbnail.js.map +1 -0
  61. package/dist/services/onboarding-config.d.ts +1 -1
  62. package/dist/services/onboarding-config.d.ts.map +1 -1
  63. package/dist/services/onboarding-config.js +10 -2
  64. package/dist/services/onboarding-config.js.map +1 -1
  65. package/package.json +11 -10
  66. package/dist/frontend/assets/frontend-B1Lvc6Rl.js +0 -413
  67. package/dist/frontend/assets/frontend-B1Lvc6Rl.js.map +0 -1
  68. package/dist/frontend/assets/frontend-BAknU-ge.js.map +0 -1
  69. package/dist/frontend/assets/frontend-DpmnQ1w4.js.map +0 -1
  70. package/dist/frontend/assets/index-BAa2HQwc.css +0 -1
  71. package/dist/frontend/assets/index-BEaTx9Vu.js +0 -1863
  72. package/dist/frontend/assets/index-BEaTx9Vu.js.map +0 -1
@@ -0,0 +1,547 @@
1
+ import{W as rn,a as an,u as P,c as on,A as ln,b as Y}from"./index-CI5Mxo87.js";var m=window.React,Q=m;m.Children;m.Component;m.Fragment;m.Profiler;m.PureComponent;m.StrictMode;m.Suspense;m.cloneElement;m.createContext;m.createElement;m.createRef;m.forwardRef;m.isValidElement;m.lazy;m.memo;m.startTransition;var x=m.useCallback;m.useContext;m.useDebugValue;m.useDeferredValue;var Z=m.useEffect;m.useId;m.useImperativeHandle;m.useInsertionEffect;m.useLayoutEffect;var sn=m.useMemo;m.useReducer;var V=m.useRef;m.useState;m.useSyncExternalStore;m.useTransition;m.version;var Le=window.ReactDOM,cn=Le.createRoot;Le.hydrateRoot;var dn=function(n){return typeof n=="function"},pn=function(n){dn(n)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof n));var t=V(n);t.current=sn(function(){return n},[n]);var r=V(void 0);return r.current||(r.current=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t.current.apply(this,o)}),r.current},O=pn,Me=n=>{let t;const r=new Set,o=(y,F)=>{const _=typeof y=="function"?y(t):y;if(!Object.is(_,t)){const g=t;t=F??(typeof _!="object"||_===null)?_:Object.assign({},t,_),r.forEach(C=>C(t,g))}},a=()=>t,u={setState:o,getState:a,getInitialState:()=>w,subscribe:y=>(r.add(y),()=>r.delete(y))},w=t=n(o,a,u);return u},un=n=>n?Me(n):Me,mn=n=>n;function d(n,t=mn){const r=Q.useSyncExternalStore(n.subscribe,Q.useCallback(()=>t(n.getState()),[n,t]),Q.useCallback(()=>t(n.getInitialState()),[n,t]));return Q.useDebugValue(r),r}var K={breadcrumb:"FileBreadcrumb_breadcrumb",breadcrumbSegment:"FileBreadcrumb_breadcrumbSegment",breadcrumbSegmentActive:"FileBreadcrumb_breadcrumbSegment FileBreadcrumb_breadcrumbSegmentActive",breadcrumbSeparator:"FileBreadcrumb_breadcrumbSeparator"},te=window.__desktalk_jsx_runtime,i=te.jsx,p=te.jsxs;te.jsxDEV;te.Fragment;function fn({currentPath:n,onNavigate:t}){const r=n==="."?[]:n.split("/").filter(Boolean);return p("div",{className:K.breadcrumb,children:[i("button",{className:r.length===0?K.breadcrumbSegmentActive:K.breadcrumbSegment,onClick:()=>t("."),children:"~"}),r.map((o,a)=>{const u=r.slice(0,a+1).join("/"),w=a===r.length-1;return p(Q.Fragment,{children:[i("span",{className:K.breadcrumbSeparator,children:"/"}),i("button",{className:w?K.breadcrumbSegmentActive:K.breadcrumbSegment,onClick:()=>t(u),children:o})]},u)})]})}var M={sortIndicator:"FileList_sortIndicator",fileTable:"FileList_fileTable",fileTableHead:"FileList_fileTableHead",colName:"FileList_colName",colSize:"FileList_colSize",colModified:"FileList_colModified",fileRow:"FileList_fileRow",fileRowSelected:"FileList_fileRow FileList_fileRowSelected",fileName:"FileList_fileName",fileIcon:"FileList_fileIcon",fileNameText:"FileList_fileNameText",fileSize:"FileList_fileSize",fileModified:"FileList_fileModified",fileListScroll:"FileList_fileListScroll",emptyState:"FileList_emptyState",emptyStateHint:"FileList_emptyStateHint",renameInput:"FileList_renameInput"};function vn(n){return n===null?"--":n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function hn(n){const t=new Date(n),r=new Date,o=t.toLocaleString("default",{month:"short"}),a=t.getDate();return t.getFullYear()!==r.getFullYear()?`${o} ${a}, ${t.getFullYear()}`:`${o} ${a}`}function se(n){if(n.type==="directory")return"📁";const t=n.name.includes(".")?n.name.slice(n.name.lastIndexOf(".")).toLowerCase():"";return new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp",".ico"]).has(t)?"🖼️":new Set([".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h"]).has(t)?"📝":t===".json"?"{}":t===".md"?"📝":"📄"}function xn(n,t,r){const o=[...n];return o.sort((a,u)=>{if(a.type!==u.type)return a.type==="directory"?-1:1;let w=0;switch(t){case"name":w=a.name.localeCompare(u.name);break;case"size":w=(a.size??-1)-(u.size??-1);break;case"modifiedAt":w=a.modifiedAt.localeCompare(u.modifiedAt);break}return r==="asc"?w:-w}),o}function wn({entries:n,sortColumn:t,sortDirection:r,selectedPath:o,renamingPath:a,renameValue:u,isUploading:w=!1,onSort:y,onSelect:F,onOpen:_,onContextMenu:g,onRenameChange:C,onRenameSubmit:L,onRenameCancel:h}){const R=V(null),G=xn(n,t,r);Z(()=>{if(!a||!R.current)return;const s=n.find(z=>z.path===a);if(!s)return;const f=R.current,k=s.type==="file"?s.name.lastIndexOf("."):-1,A=k>0?k:s.name.length;f.focus(),f.setSelectionRange(0,A)},[n,a]);const S=x(s=>{s.key==="Enter"?L():s.key==="Escape"&&h()},[L,h]);function b(s){return t!==s?null:i("span",{className:M.sortIndicator,children:r==="asc"?"▲":"▼"})}return n.length===0?p("div",{className:M.emptyState,children:[i("div",{children:"This directory is empty."}),i("div",{className:M.emptyStateHint,children:w?"Uploading files...":"Drag files here to upload them to this folder."})]}):i("div",{className:M.fileListScroll,children:p("table",{className:M.fileTable,children:[i("thead",{className:M.fileTableHead,children:p("tr",{children:[p("th",{className:M.colName,onClick:()=>y("name"),children:["Name",b("name")]}),p("th",{className:M.colSize,onClick:()=>y("size"),children:["Size",b("size")]}),p("th",{className:M.colModified,onClick:()=>y("modifiedAt"),children:["Modified",b("modifiedAt")]})]})}),i("tbody",{children:G.map(s=>p("tr",{className:o===s.path?M.fileRowSelected:M.fileRow,onClick:()=>F(s),onDoubleClick:()=>_(s),onContextMenu:f=>g(f,s),children:[i("td",{children:p("div",{className:M.fileName,children:[i("span",{className:M.fileIcon,children:se(s)}),a===s.path?i("input",{ref:R,className:M.renameInput,type:"text",value:u,onChange:f=>C(f.target.value),onKeyDown:S,onBlur:()=>{L()},autoFocus:!0}):i("span",{className:M.fileNameText,children:s.name})]})}),i("td",{className:M.fileSize,children:vn(s.size)}),i("td",{className:M.fileModified,children:hn(s.modifiedAt)})]},s.path))})]})})}var T={grid:"FileGrid_grid",item:"FileGrid_item",itemSelected:"FileGrid_itemSelected",iconWrapper:"FileGrid_iconWrapper",thumbnail:"FileGrid_thumbnail",icon:"FileGrid_icon",fallbackIcon:"FileGrid_fallbackIcon",nameWrapper:"FileGrid_nameWrapper",name:"FileGrid_name",renameInput:"FileGrid_renameInput",empty:"FileGrid_empty",emptyTitle:"FileGrid_emptyTitle",emptyHint:"FileGrid_emptyHint"};function gn(n){const t=n.lastIndexOf(".");return t>=0?n.slice(t).toLowerCase():""}var bn=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".bmp"]);function yn(n){return bn.has(gn(n))}function Fn(n){return yn(n.name)?`/api/files/thumbnail?path=${encodeURIComponent(n.path)}&size=96`:null}var _n=({entries:n,selectedPath:t,renamingPath:r,renameValue:o,onSelect:a,onOpen:u,onContextMenu:w,onRenameChange:y,onRenameSubmit:F,onRenameCancel:_})=>{const g=V(null);Z(()=>{r&&g.current&&(g.current.focus(),g.current.select())},[r]);const C=h=>{h.key==="Enter"?F():h.key==="Escape"&&_()},L=()=>{_()};return n.length===0?p("div",{className:T.empty,children:[i("div",{className:T.emptyTitle,children:"Folder is empty"}),i("div",{className:T.emptyHint,children:"Drop files here to upload"})]}):i("div",{className:T.grid,children:n.map(h=>{const R=t===h.path,G=r===h.path,S=h.type==="directory"?null:Fn(h);return p("div",{className:`${T.item} ${R?T.itemSelected:""}`,onClick:()=>a(h),onDoubleClick:()=>u(h),onContextMenu:b=>w(b,h),children:[i("div",{className:T.iconWrapper,children:S?i("img",{src:S,alt:h.name,className:T.thumbnail,loading:"lazy",onError:b=>{b.target.style.display="none";const s=b.target.parentElement;if(s){const f=document.createElement("span");f.className=T.fallbackIcon,f.textContent=se(h),s.appendChild(f)}}}):i("span",{className:T.icon,children:se(h)})}),i("div",{className:T.nameWrapper,children:G?i("input",{ref:g,className:T.renameInput,value:o,onChange:b=>y(b.target.value),onKeyDown:C,onBlur:L,onClick:b=>b.stopPropagation(),onDoubleClick:b=>b.stopPropagation()}):i("span",{className:T.name,title:h.name,children:h.name})})]},h.path)})})},c={previewPanel:"FilePreview_previewPanel",previewHeader:"FilePreview_previewHeader",previewTitle:"FilePreview_previewTitle",previewCloseBtn:"FilePreview_previewCloseBtn",previewBody:"FilePreview_previewBody",previewCode:"FilePreview_previewCode",previewMeta:"FilePreview_previewMeta",previewMetaRow:"FilePreview_previewMetaRow",previewMetaLabel:"FilePreview_previewMetaLabel",previewMetaValue:"FilePreview_previewMetaValue",previewPlaceholder:"FilePreview_previewPlaceholder"};function Ce(n){return n===null?"--":n<1024?`${n} bytes`:n<1024*1024?`${(n/1024).toFixed(2)} KB`:`${(n/(1024*1024)).toFixed(2)} MB`}function Mn(n){return n!==null&&n.startsWith("image/")}function Cn(n){return n===null?!1:n.startsWith("text/")||n==="application/json"||n==="application/xml"}function Nn({entry:n,content:t,loading:r,onClose:o}){if(!n)return i("div",{className:c.previewPanel,children:i("div",{className:c.previewPlaceholder,children:"Select a file to preview"})});const a=()=>r?i("div",{className:c.previewPlaceholder,children:"Loading..."}):n.type==="directory"?p("div",{className:c.previewMeta,children:[p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Type"}),i("span",{className:c.previewMetaValue,children:"Directory"})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Path"}),i("span",{className:c.previewMetaValue,children:n.path})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Last Modified"}),i("span",{className:c.previewMetaValue,children:new Date(n.modifiedAt).toLocaleString()})]})]}):Mn(n.mimeType)&&t?n.mimeType==="image/svg+xml"?i("div",{className:c.previewBody,dangerouslySetInnerHTML:{__html:t}}):p("div",{className:c.previewMeta,children:[p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Type"}),i("span",{className:c.previewMetaValue,children:n.mimeType})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Size"}),i("span",{className:c.previewMetaValue,children:Ce(n.size)})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Last Modified"}),i("span",{className:c.previewMetaValue,children:new Date(n.modifiedAt).toLocaleString()})]})]}):Cn(n.mimeType)&&t!==null?i("pre",{className:c.previewCode,children:t}):p("div",{className:c.previewMeta,children:[p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Name"}),i("span",{className:c.previewMetaValue,children:n.name})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Type"}),i("span",{className:c.previewMetaValue,children:n.mimeType??"Unknown"})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Size"}),i("span",{className:c.previewMetaValue,children:Ce(n.size)})]}),p("div",{className:c.previewMetaRow,children:[i("span",{className:c.previewMetaLabel,children:"Last Modified"}),i("span",{className:c.previewMetaValue,children:new Date(n.modifiedAt).toLocaleString()})]})]});return p("div",{className:c.previewPanel,children:[p("div",{className:c.previewHeader,children:[i("span",{className:c.previewTitle,children:n.name}),i("button",{className:c.previewCloseBtn,onClick:o,title:"Close preview",children:"✕"})]}),i("div",{className:c.previewBody,children:a()})]})}var Ln=50,Sn=200;function kn({children:n,currentPath:t,onNavigated:r,onFileCreated:o,onDirectoryCreated:a,onDeleted:u,onRenamed:w,onRefresh:y}){const F=P("files.create"),_=P("files.delete"),g=P("files.rename"),C=P("files.list"),L=x(async s=>{const f=s?.limit!=null?Number(s.limit):Ln,k=Math.max(1,Math.min(f,Sn));return await C({path:t,limit:k})},[C,t]),h=x(async s=>{const f=s?.path||".";r(f)},[r]),R=x(async s=>{const f=s?.name||"";if(!f)return;const k=t==="."?f:`${t}/${f}`,A=s?.content??"",z=await F({path:k,type:"file",content:A});return o(z),z},[F,t,o]),G=x(async s=>{const f=s?.name||"";if(!f)return;const k=t==="."?f:`${t}/${f}`,A=await F({path:k,type:"directory"});return a(A),A},[F,t,a]),S=x(async s=>{const f=s?.path||"";f&&(await _({path:f}),u(f))},[_,u]),b=x(async s=>{const f=s?.path||"",k=s?.newName||"";if(!f||!k)return;const A=await g({path:f,newName:k});return w(A),A},[g,w]);return p(ln,{children:[i(Y,{name:"List Files",description:"List files and directories in the current folder. Returns up to limit entries (default 50, max 200).",params:{limit:{type:"number",description:"Maximum number of entries to return (default 50, max 200)",required:!1}},handler:L}),i(Y,{name:"Navigate",description:"Navigate to a directory",params:{path:{type:"string",description:"Directory path to navigate to",required:!0}},handler:h}),i(Y,{name:"Create File",description:"Create a new file in the current directory",params:{name:{type:"string",description:"File name",required:!0},content:{type:"string",description:"File content",required:!1}},handler:R}),i(Y,{name:"Create Directory",description:"Create a new directory in the current directory",params:{name:{type:"string",description:"Directory name",required:!0}},handler:G}),i(Y,{name:"Delete",description:"Delete a file or directory",params:{path:{type:"string",description:"Path of file or directory to delete",required:!0}},handler:S}),i(Y,{name:"Rename",description:"Rename a file or directory",params:{path:{type:"string",description:"Current path",required:!0},newName:{type:"string",description:"New name",required:!0}},handler:b}),n]})}var H={contextMenu:"ContextMenu_contextMenu",contextMenuList:"ContextMenu_contextMenuList",contextMenuItem:"ContextMenu_contextMenuItem",contextMenuSubmenuTrigger:"ContextMenu_contextMenuSubmenuTrigger",contextSubmenu:"ContextMenu_contextSubmenu",contextMenuChevron:"ContextMenu_contextMenuChevron",contextMenuDanger:"ContextMenu_contextMenuItem ContextMenu_contextMenuDanger"};function Pn({x:n,y:t,actions:r,onClose:o}){const a=V(null),u=x(F=>{a.current&&!a.current.contains(F.target)&&o()},[o]);Z(()=>(document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}),[u]);const w={left:n,top:t},y=(F,_=!1)=>i("div",{className:_?H.contextSubmenu:H.contextMenuList,children:F.map((g,C)=>{const L=g.danger?H.contextMenuDanger:H.contextMenuItem;return g.children&&g.children.length>0?p("div",{className:H.contextMenuSubmenuTrigger,children:[p("button",{type:"button",className:L,children:[i("span",{children:g.label}),i("span",{className:H.contextMenuChevron,children:"▸"})]}),y(g.children,!0)]},`${g.label}-${C}`):i("button",{type:"button",className:L,onClick:()=>{g.handler?.(),o()},children:g.label},`${g.label}-${C}`)})});return i("div",{ref:a,className:H.contextMenu,style:w,children:y(r)})}var An={currentPath:".",history:["."],historyIndex:0,entries:[],sortColumn:"name",sortDirection:"asc",viewMode:"list",isDragActive:!1,isUploading:!1,miniAppManifests:[],selectedPath:null,previewEntry:null,previewContent:null,previewLoading:!1,renamingPath:null,renameValue:"",contextMenu:null};function le(){return{selectedPath:null,previewEntry:null,previewContent:null,previewLoading:!1,contextMenu:null}}function Tn(){return un((n,t)=>({...An,setEntries(r){n({entries:r})},setSortColumn(r){n({sortColumn:r})},setSortDirection(r){n({sortDirection:r})},setViewMode(r){n({viewMode:r})},setDragActive(r){n({isDragActive:r})},setUploading(r){n({isUploading:r})},setMiniAppManifests(r){n({miniAppManifests:r})},setSelectedPath(r){n({selectedPath:r})},setPreviewEntry(r){n({previewEntry:r})},setPreviewContent(r){n({previewContent:r})},setPreviewLoading(r){n({previewLoading:r})},setRenameValue(r){n({renameValue:r})},setContextMenu(r){n({contextMenu:r})},startRename(r,o){n({renamingPath:r,renameValue:o})},stopRename(){n({renamingPath:null,renameValue:""})},closePreview(){n({previewEntry:null,previewContent:null,previewLoading:!1})},navigateTo(r){const{history:o,historyIndex:a}=t(),u=[...o.slice(0,a+1),r];n({currentPath:r,history:u,historyIndex:u.length-1,...le()})},goBack(){const{history:r,historyIndex:o}=t();if(o<=0)return;const a=o-1;n({currentPath:r[a],historyIndex:a,...le()})},goForward(){const{history:r,historyIndex:o}=t();if(o>=r.length-1)return;const a=o+1;n({currentPath:r[a],historyIndex:a,...le()})}}))}var N={root:"FileExplorerApp_root",navBar:"FileExplorerApp_navBar",navBtn:"FileExplorerApp_navBtn",body:"FileExplorerApp_body",fileListPanel:"FileExplorerApp_fileListPanel",fileListDropZone:"FileExplorerApp_fileListDropZone",dropOverlay:"FileExplorerApp_dropOverlay",dropOverlayCard:"FileExplorerApp_dropOverlayCard",dropOverlayTitle:"FileExplorerApp_dropOverlayTitle",dropOverlayHint:"FileExplorerApp_dropOverlayHint",viewToggle:"FileExplorerApp_viewToggle",viewToggleBtn:"FileExplorerApp_viewToggleBtn",viewToggleBtnActive:"FileExplorerApp_viewToggleBtnActive"},En=["player","preview","text-edit"];function Bn(n){const t=new Set(n.filter(o=>o.type==="directory").map(o=>o.name.toLowerCase()));if(!t.has("new folder"))return"New folder";let r=2;for(;t.has(`new folder ${r}`);)r+=1;return`New folder ${r}`}function Dn(n){const t=n.toLowerCase();if(t.startsWith("."))return t;const r=t.lastIndexOf(".");return r>=0?t.slice(r):null}function Rn(n,t){if(n.type!=="file")return!1;const r=t.fileAssociations;if(!r)return!1;const o=Dn(n.name),a=o!==null&&r.extensions?.some(w=>w.toLowerCase()===o),u=n.mimeType!==null&&r.mimeTypes?.some(w=>w===n.mimeType);return!!(a||u)}function Se(n,t){return t.filter(r=>Rn(n,r))}function Ne(n,t){const r=Se(n,t);for(const o of En){const a=r.find(u=>u.id===o);if(a)return a}return r[0]??null}function zn(){const n=V(null);n.current||(n.current=Tn());const t=n.current,r=d(t,e=>e.currentPath),o=d(t,e=>e.history),a=d(t,e=>e.historyIndex),u=d(t,e=>e.entries),w=d(t,e=>e.sortColumn),y=d(t,e=>e.sortDirection),F=d(t,e=>e.viewMode),_=d(t,e=>e.isDragActive),g=d(t,e=>e.isUploading),C=d(t,e=>e.miniAppManifests),L=d(t,e=>e.selectedPath),h=d(t,e=>e.previewEntry),R=d(t,e=>e.previewContent),G=d(t,e=>e.previewLoading),S=d(t,e=>e.renamingPath),b=d(t,e=>e.renameValue),s=d(t,e=>e.contextMenu),f=d(t,e=>e.setEntries),k=d(t,e=>e.setSortColumn),A=d(t,e=>e.setSortDirection),z=d(t,e=>e.setViewMode),X=d(t,e=>e.setDragActive),ce=d(t,e=>e.setUploading),de=d(t,e=>e.setMiniAppManifests),I=d(t,e=>e.setSelectedPath),re=d(t,e=>e.setPreviewEntry),ee=d(t,e=>e.setPreviewContent),ie=d(t,e=>e.setPreviewLoading),pe=d(t,e=>e.setRenameValue),$=d(t,e=>e.setContextMenu),ue=d(t,e=>e.startRename),J=d(t,e=>e.stopRename),ne=d(t,e=>e.closePreview),W=d(t,e=>e.navigateTo),ke=d(t,e=>e.goBack),Pe=d(t,e=>e.goForward),Ae=P("files.list"),me=P("files.read"),Te=P("files.delete"),Ee=P("files.rename"),Be=P("files.create"),De=P("files.copy"),Re=P("files.move"),ze=P("files.upload"),fe=P("prefs.get"),ve=P("prefs.set"),U=V(null),ae=V(!1),q=on(),Ie=a>0,$e=a<o.length-1,Oe=x(e=>new Promise((l,v)=>{const E=new FileReader;E.onerror=()=>v(new Error(`Failed to read file: ${e.name}`)),E.onload=()=>{const B=E.result;if(typeof B!="string"){v(new Error(`Failed to read file: ${e.name}`));return}const _e=B.indexOf(",");l(_e>=0?B.slice(_e+1):B)},E.readAsDataURL(e)}),[]),j=O(async e=>{try{const l=await Ae({path:e});f(l)}catch(l){console.error("Failed to list directory:",l),f([])}});Z(()=>{j(r)},[r,j]),Z(()=>{let e=!1;return(async()=>{try{const l=await fetch("/api/miniapps");if(!l.ok)throw new Error(`Failed to load MiniApps (${l.status})`);const v=await l.json();e||de(v)}catch(l){console.error("Failed to load MiniApps:",l)}})(),()=>{e=!0}},[de]),Z(()=>{(async()=>{try{const e=await fe();e.viewMode&&z(e.viewMode)}catch(e){console.error("Failed to load preferences:",e)}})()},[fe,z]);const D=O(()=>{j(r)}),Ve=x(e=>{w===e?A(y==="asc"?"desc":"asc"):(k(e),A("asc"))},[k,A,w,y]),he=x(e=>{z(e),ve({viewMode:e})},[z,ve]),xe=x(e=>{I(e.path),$(null)},[$,I]),oe=x(async e=>{re(e),ie(!0),ee(null);try{const l=await me({path:e.path});ee(l.content)}catch(l){console.error("Failed to read file:",l),ee(null)}finally{ie(!1)}},[me,ee,re,ie]),we=x(async e=>{if(e.type==="directory"){W(e.path);return}const l=Ne(e,C);if(l){q(l.id,{path:e.path});return}await oe(e)},[C,W,oe,q]),ge=x((e,l)=>{e.preventDefault(),I(l.path),$({x:e.clientX,y:e.clientY,entry:l})},[$,I]),Ge=x(e=>{e.target.closest("tr")||(e.preventDefault(),I(null),$({x:e.clientX,y:e.clientY,entry:null}))},[$,I]),je=x(()=>{$(null)},[$]),be=O(async()=>{if(ae.current)return;if(!S||!b.trim()){J(),await j(r);return}const e=u.find(v=>v.path===S),l=b.trim();if(e&&e.name===l){J();return}ae.current=!0;try{const v=await Ee({path:S,newName:l});await j(r),L===S&&I(v.path),h?.path===S&&re(v)}catch(v){console.error("Failed to rename:",v),await j(r)}finally{ae.current=!1,J()}}),ye=x(()=>{J()},[J]),He=O(async()=>{const e=Bn(u),l=r==="."?e:`${r}/${e}`;try{const v=await Be({path:l,type:"directory"});await j(r),I(v.path),ue(v.path,v.name)}catch(v){console.error("Failed to create directory:",v)}}),We=x(()=>{q("terminal",{cwd:r})},[r,q]),Ue=O(async e=>{try{await Te({path:e}),h?.path===e&&ne(),L===e&&I(null),D()}catch(l){console.error("Failed to delete:",l)}}),qe=x(e=>{U.current={path:e,mode:"copy"}},[]),Ye=x(e=>{U.current={path:e,mode:"cut"}},[]),Ke=O(async()=>{if(!U.current)return;const{path:e,mode:l}=U.current,v=e.includes("/")?e.split("/").pop():e,E=r==="."?v:`${r}/${v}`;try{l==="copy"?await De({source:e,destination:E}):(await Re({source:e,destination:E}),U.current=null),D()}catch(B){console.error(`Failed to ${l}:`,B)}}),Ze=x(e=>{Array.from(e.dataTransfer.types).includes("Files")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy",X(!0))},[X]),Xe=x(e=>{const l=e.relatedTarget;l&&e.currentTarget.contains(l)||X(!1)},[X]),Je=O(async e=>{if(!Array.from(e.dataTransfer.types).includes("Files"))return;e.preventDefault(),X(!1);const l=Array.from(e.dataTransfer.files).filter(v=>v.size>=0);if(l.length!==0){ce(!0);try{await Promise.all(l.map(async v=>{const E=await Oe(v),B=r==="."?v.name:`${r}/${v.name}`;await ze({path:B,contentBase64:E})})),D()}catch(v){console.error("Failed to upload dropped files:",v)}finally{ce(!1)}}}),Qe=O(e=>{if(e===null)return[{label:"New folder",handler:()=>{He()}},{label:"Open in Terminal",handler:We}];const l=[];if(e.type==="directory")l.push({label:"Open",handler:()=>W(e.path)});else{const v=Se(e,C),E=Ne(e,C);l.push({label:"Open",handler:()=>{if(E){q(E.id,{path:e.path});return}oe(e)}}),v.length>0&&l.push({label:"Open with",children:v.map(B=>({label:B.name,handler:()=>q(B.id,{path:e.path})}))})}return l.push({label:"Rename",handler:()=>ue(e.path,e.name)}),l.push({label:"Copy",handler:()=>qe(e.path)}),l.push({label:"Cut",handler:()=>Ye(e.path)}),U.current&&l.push({label:"Paste here",handler:Ke}),l.push({label:"Delete",danger:!0,handler:()=>Ue(e.path)}),l}),en=x(e=>{W(e)},[W]),Fe=x(()=>{D()},[D]),nn=x(e=>{h?.path===e&&ne(),D()},[ne,h,D]),tn=x(()=>{D()},[D]);return i(kn,{currentPath:r,onNavigated:en,onFileCreated:Fe,onDirectoryCreated:Fe,onDeleted:nn,onRenamed:tn,onRefresh:D,children:p("div",{className:N.root,children:[p("div",{className:N.navBar,children:[i("button",{className:N.navBtn,onClick:ke,disabled:!Ie,title:"Back",children:"◀"}),i("button",{className:N.navBtn,onClick:Pe,disabled:!$e,title:"Forward",children:"▶"}),i(fn,{currentPath:r,onNavigate:W}),p("div",{className:N.viewToggle,children:[i("button",{className:`${N.viewToggleBtn} ${F==="list"?N.viewToggleBtnActive:""}`,onClick:()=>he("list"),title:"List view",children:"☰"}),i("button",{className:`${N.viewToggleBtn} ${F==="icon"?N.viewToggleBtnActive:""}`,onClick:()=>he("icon"),title:"Icon view",children:"▤"})]})]}),p("div",{className:N.body,children:[i("div",{className:N.fileListPanel,children:p("div",{className:N.fileListDropZone,onContextMenu:Ge,onDragOver:Ze,onDragLeave:Xe,onDrop:Je,children:[F==="list"?i(wn,{entries:u,sortColumn:w,sortDirection:y,selectedPath:L,renamingPath:S,renameValue:b,isUploading:g,onSort:Ve,onSelect:xe,onOpen:we,onContextMenu:ge,onRenameChange:pe,onRenameSubmit:be,onRenameCancel:ye}):i(_n,{entries:u,selectedPath:L,renamingPath:S,renameValue:b,onSelect:xe,onOpen:we,onContextMenu:ge,onRenameChange:pe,onRenameSubmit:be,onRenameCancel:ye}),_&&i("div",{className:N.dropOverlay,children:p("div",{className:N.dropOverlayCard,children:[i("div",{className:N.dropOverlayTitle,children:"Drop files to upload"}),i("div",{className:N.dropOverlayHint,children:"Files will be added to this folder."})]})})]})}),h&&i(Nn,{entry:h,content:R,loading:G,onClose:ne})]}),s&&i(Pn,{x:s.x,y:s.y,actions:Qe(s.entry),onClose:je})]})})}function $n(n){const t=cn(n.root);return t.render(i(rn,{windowId:n.windowId,children:i(an,{miniAppId:n.miniAppId,children:i(zn,{})})})),{deactivate(){t.unmount()}}}(()=>{if(typeof document>"u")return;const n="desktalk-style-desktalk-miniapp-file-explorer-1a999pn";if(document.getElementById(n))return;const t=document.createElement("style");t.id=n,t.textContent=`/* src/components/FileBreadcrumb.module.css */
2
+ .FileBreadcrumb_breadcrumb {
3
+ display: flex;
4
+ flex: 1;
5
+ align-items: center;
6
+ gap: 2px;
7
+ overflow: hidden;
8
+ font-size: 13px;
9
+ }
10
+ .FileBreadcrumb_breadcrumbSegment {
11
+ padding: 2px 6px;
12
+ border: none;
13
+ border-radius: 4px;
14
+ background: none;
15
+ color: var(--dt-text-muted);
16
+ cursor: pointer;
17
+ font-family: inherit;
18
+ font-size: 13px;
19
+ transition: background 0.1s, color 0.1s;
20
+ white-space: nowrap;
21
+ }
22
+ .FileBreadcrumb_breadcrumbSegment:hover {
23
+ background: var(--dt-surface-hover);
24
+ color: var(--dt-text);
25
+ }
26
+ .FileBreadcrumb_breadcrumbSegmentActive {
27
+ color: var(--dt-text);
28
+ font-weight: 500;
29
+ }
30
+ .FileBreadcrumb_breadcrumbSeparator {
31
+ color: var(--dt-text-muted);
32
+ font-size: 11px;
33
+ opacity: 0.5;
34
+ }
35
+
36
+ /* src/components/FileList.module.css */
37
+ .FileList_sortIndicator {
38
+ margin-left: 4px;
39
+ font-size: 10px;
40
+ }
41
+ .FileList_fileTable {
42
+ width: 100%;
43
+ border-collapse: collapse;
44
+ table-layout: fixed;
45
+ }
46
+ .FileList_fileTableHead {
47
+ position: sticky;
48
+ top: 0;
49
+ z-index: 1;
50
+ background: var(--dt-window-body);
51
+ }
52
+ .FileList_fileTableHead th {
53
+ padding: 8px 12px;
54
+ border-bottom: 1px solid var(--dt-border);
55
+ color: var(--dt-text-muted);
56
+ cursor: pointer;
57
+ font-size: 11px;
58
+ font-weight: 600;
59
+ letter-spacing: 0.03em;
60
+ text-align: left;
61
+ text-transform: uppercase;
62
+ transition: color 0.15s;
63
+ -webkit-user-select: none;
64
+ user-select: none;
65
+ }
66
+ .FileList_fileTableHead th:hover {
67
+ color: var(--dt-text);
68
+ }
69
+ .FileList_colName {
70
+ width: auto;
71
+ }
72
+ .FileList_colSize {
73
+ width: 90px;
74
+ }
75
+ .FileList_colModified {
76
+ width: 110px;
77
+ }
78
+ .FileList_fileRow {
79
+ cursor: pointer;
80
+ transition: background 0.1s;
81
+ }
82
+ .FileList_fileRow:hover {
83
+ background: var(--dt-surface-hover);
84
+ }
85
+ .FileList_fileRowSelected {
86
+ background: var(--dt-surface);
87
+ }
88
+ .FileList_fileRow td {
89
+ padding: 6px 12px;
90
+ border-bottom: 1px solid var(--dt-border);
91
+ font-size: 13px;
92
+ overflow: hidden;
93
+ text-overflow: ellipsis;
94
+ white-space: nowrap;
95
+ }
96
+ .FileList_fileName {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+ }
101
+ .FileList_fileIcon {
102
+ flex-shrink: 0;
103
+ font-size: 16px;
104
+ }
105
+ .FileList_fileNameText {
106
+ overflow: hidden;
107
+ text-overflow: ellipsis;
108
+ white-space: nowrap;
109
+ }
110
+ .FileList_fileSize {
111
+ color: var(--dt-text-muted);
112
+ font-size: 12px;
113
+ }
114
+ .FileList_fileModified {
115
+ color: var(--dt-text-muted);
116
+ font-size: 12px;
117
+ }
118
+ .FileList_fileListScroll {
119
+ flex: 1;
120
+ overflow-y: auto;
121
+ }
122
+ .FileList_emptyState {
123
+ display: flex;
124
+ height: 100%;
125
+ min-height: 220px;
126
+ flex-direction: column;
127
+ align-items: center;
128
+ justify-content: center;
129
+ gap: 8px;
130
+ padding: 48px 16px;
131
+ color: var(--dt-text-muted);
132
+ font-size: 13px;
133
+ text-align: center;
134
+ }
135
+ .FileList_emptyStateHint {
136
+ max-width: 320px;
137
+ color: var(--dt-text-muted);
138
+ font-size: 12px;
139
+ line-height: 1.5;
140
+ }
141
+ .FileList_renameInput {
142
+ width: 100%;
143
+ padding: 2px 6px;
144
+ border: 1px solid var(--dt-accent);
145
+ border-radius: 4px;
146
+ background: var(--dt-surface);
147
+ color: var(--dt-text);
148
+ font-family: inherit;
149
+ font-size: 13px;
150
+ outline: none;
151
+ }
152
+
153
+ /* src/components/FileGrid.module.css */
154
+ .FileGrid_grid {
155
+ display: grid;
156
+ grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
157
+ gap: 12px;
158
+ padding: 16px;
159
+ overflow-y: auto;
160
+ flex: 1;
161
+ }
162
+ .FileGrid_item {
163
+ display: flex;
164
+ flex-direction: column;
165
+ align-items: center;
166
+ padding: 8px;
167
+ border-radius: 8px;
168
+ cursor: pointer;
169
+ transition: background 0.15s;
170
+ }
171
+ .FileGrid_item:hover {
172
+ background: var(--dt-surface-hover);
173
+ }
174
+ .FileGrid_itemSelected {
175
+ background: var(--dt-accent-subtle, color-mix(in srgb, var(--dt-accent) 15%, transparent));
176
+ }
177
+ .FileGrid_itemSelected:hover {
178
+ background: var(--dt-accent-subtle-hover, color-mix(in srgb, var(--dt-accent) 25%, transparent));
179
+ }
180
+ .FileGrid_iconWrapper {
181
+ width: 96px;
182
+ height: 96px;
183
+ display: flex;
184
+ align-items: center;
185
+ justify-content: center;
186
+ margin-bottom: 8px;
187
+ position: relative;
188
+ }
189
+ .FileGrid_thumbnail {
190
+ width: 96px;
191
+ height: 96px;
192
+ object-fit: cover;
193
+ border-radius: 8px;
194
+ background: var(--dt-surface);
195
+ }
196
+ .FileGrid_icon {
197
+ font-size: 48px;
198
+ line-height: 1;
199
+ }
200
+ .FileGrid_fallbackIcon {
201
+ font-size: 48px;
202
+ line-height: 1;
203
+ position: absolute;
204
+ }
205
+ .FileGrid_nameWrapper {
206
+ width: 100%;
207
+ text-align: center;
208
+ }
209
+ .FileGrid_name {
210
+ display: block;
211
+ max-width: 100%;
212
+ overflow: hidden;
213
+ text-overflow: ellipsis;
214
+ white-space: nowrap;
215
+ font-size: 13px;
216
+ color: var(--dt-text);
217
+ word-break: break-all;
218
+ }
219
+ .FileGrid_renameInput {
220
+ width: 100%;
221
+ padding: 4px 8px;
222
+ border: 1px solid var(--dt-accent);
223
+ border-radius: 4px;
224
+ background: var(--dt-surface);
225
+ color: var(--dt-text);
226
+ font-size: 13px;
227
+ text-align: center;
228
+ outline: none;
229
+ }
230
+ .FileGrid_empty {
231
+ display: flex;
232
+ flex: 1;
233
+ flex-direction: column;
234
+ align-items: center;
235
+ justify-content: center;
236
+ gap: 8px;
237
+ color: var(--dt-text-muted);
238
+ }
239
+ .FileGrid_emptyTitle {
240
+ font-size: 15px;
241
+ font-weight: 500;
242
+ }
243
+ .FileGrid_emptyHint {
244
+ font-size: 13px;
245
+ }
246
+
247
+ /* src/components/FilePreview.module.css */
248
+ .FilePreview_previewPanel {
249
+ display: flex;
250
+ width: 360px;
251
+ min-width: 280px;
252
+ flex-direction: column;
253
+ overflow: hidden;
254
+ border-left: 1px solid var(--dt-border);
255
+ }
256
+ .FilePreview_previewHeader {
257
+ display: flex;
258
+ flex-shrink: 0;
259
+ align-items: center;
260
+ justify-content: space-between;
261
+ gap: 8px;
262
+ padding: 10px 14px;
263
+ border-bottom: 1px solid var(--dt-border);
264
+ }
265
+ .FilePreview_previewTitle {
266
+ overflow: hidden;
267
+ font-size: 14px;
268
+ font-weight: 600;
269
+ text-overflow: ellipsis;
270
+ white-space: nowrap;
271
+ }
272
+ .FilePreview_previewCloseBtn {
273
+ display: flex;
274
+ width: 24px;
275
+ height: 24px;
276
+ flex-shrink: 0;
277
+ align-items: center;
278
+ justify-content: center;
279
+ padding: 0;
280
+ border: none;
281
+ border-radius: 4px;
282
+ background: none;
283
+ color: var(--dt-text-muted);
284
+ cursor: pointer;
285
+ font-size: 14px;
286
+ transition: background 0.15s, color 0.15s;
287
+ }
288
+ .FilePreview_previewCloseBtn:hover {
289
+ background: var(--dt-surface-hover);
290
+ color: var(--dt-text);
291
+ }
292
+ .FilePreview_previewBody {
293
+ flex: 1;
294
+ overflow-y: auto;
295
+ padding: 14px;
296
+ }
297
+ .FilePreview_previewCode {
298
+ overflow-x: auto;
299
+ margin: 0;
300
+ padding: 0;
301
+ border: none;
302
+ background: transparent;
303
+ color: var(--dt-text);
304
+ font-family: var(--font-mono);
305
+ font-size: 12px;
306
+ line-height: 1.6;
307
+ white-space: pre-wrap;
308
+ word-break: break-all;
309
+ }
310
+ .FilePreview_previewImage {
311
+ max-width: 100%;
312
+ border-radius: 6px;
313
+ }
314
+ .FilePreview_previewMeta {
315
+ display: flex;
316
+ flex-direction: column;
317
+ gap: 12px;
318
+ }
319
+ .FilePreview_previewMetaRow {
320
+ display: flex;
321
+ flex-direction: column;
322
+ gap: 2px;
323
+ }
324
+ .FilePreview_previewMetaLabel {
325
+ color: var(--dt-text-muted);
326
+ font-size: 11px;
327
+ font-weight: 600;
328
+ letter-spacing: 0.03em;
329
+ text-transform: uppercase;
330
+ }
331
+ .FilePreview_previewMetaValue {
332
+ font-size: 13px;
333
+ }
334
+ .FilePreview_previewPlaceholder {
335
+ display: flex;
336
+ height: 100%;
337
+ align-items: center;
338
+ justify-content: center;
339
+ color: var(--dt-text-muted);
340
+ font-size: 13px;
341
+ }
342
+
343
+ /* src/components/ContextMenu.module.css */
344
+ .ContextMenu_contextMenu {
345
+ position: fixed;
346
+ z-index: 1000;
347
+ min-width: 160px;
348
+ border: 1px solid var(--dt-border);
349
+ border-radius: 8px;
350
+ background: var(--dt-surface);
351
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
352
+ }
353
+ .ContextMenu_contextMenuList {
354
+ padding: 4px 0;
355
+ }
356
+ .ContextMenu_contextMenuItem {
357
+ display: flex;
358
+ align-items: center;
359
+ width: 100%;
360
+ padding: 7px 14px;
361
+ border: none;
362
+ background: none;
363
+ color: var(--dt-text);
364
+ cursor: pointer;
365
+ font-family: inherit;
366
+ font-size: 13px;
367
+ text-align: left;
368
+ transition: background 0.1s;
369
+ }
370
+ .ContextMenu_contextMenuItem:hover {
371
+ background: var(--dt-surface-hover);
372
+ }
373
+ .ContextMenu_contextMenuSubmenuTrigger {
374
+ position: relative;
375
+ }
376
+ .ContextMenu_contextSubmenu {
377
+ position: absolute;
378
+ top: -5px;
379
+ left: calc(100% - 2px);
380
+ z-index: 1001;
381
+ display: none;
382
+ min-width: 160px;
383
+ padding: 4px 0;
384
+ border: 1px solid var(--dt-border);
385
+ border-radius: 8px;
386
+ background: var(--dt-surface);
387
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
388
+ }
389
+ .ContextMenu_contextMenuSubmenuTrigger:hover > .ContextMenu_contextSubmenu {
390
+ display: block;
391
+ }
392
+ .ContextMenu_contextMenuChevron {
393
+ margin-left: auto;
394
+ color: var(--dt-text-muted);
395
+ font-size: 11px;
396
+ }
397
+ .ContextMenu_contextMenuSeparator {
398
+ margin: 4px 0;
399
+ border: none;
400
+ border-top: 1px solid var(--dt-border);
401
+ }
402
+ .ContextMenu_contextMenuDanger {
403
+ color: var(--dt-danger, #e55);
404
+ }
405
+
406
+ /* src/FileExplorerApp.module.css */
407
+ .FileExplorerApp_root {
408
+ display: flex;
409
+ height: 100%;
410
+ flex-direction: column;
411
+ overflow: hidden;
412
+ background: var(--dt-window-body);
413
+ color: var(--dt-text);
414
+ font-family: var(--font-sans);
415
+ }
416
+ .FileExplorerApp_navBar {
417
+ display: flex;
418
+ flex-shrink: 0;
419
+ align-items: center;
420
+ gap: 8px;
421
+ padding: 8px 12px;
422
+ border-bottom: 1px solid var(--dt-border);
423
+ }
424
+ .FileExplorerApp_navBtn {
425
+ display: flex;
426
+ width: 28px;
427
+ height: 28px;
428
+ flex-shrink: 0;
429
+ align-items: center;
430
+ justify-content: center;
431
+ padding: 0;
432
+ border: 1px solid var(--dt-border);
433
+ border-radius: 6px;
434
+ background: var(--dt-surface);
435
+ color: var(--dt-text);
436
+ cursor: pointer;
437
+ font-size: 14px;
438
+ line-height: 1;
439
+ transition:
440
+ background 0.15s,
441
+ border-color 0.15s,
442
+ color 0.15s;
443
+ }
444
+ .FileExplorerApp_navBtn:hover:not(:disabled) {
445
+ border-color: var(--dt-accent);
446
+ background: var(--dt-surface-hover);
447
+ color: var(--dt-accent);
448
+ }
449
+ .FileExplorerApp_navBtn:disabled {
450
+ cursor: default;
451
+ opacity: 0.35;
452
+ }
453
+ .FileExplorerApp_body {
454
+ display: flex;
455
+ flex: 1;
456
+ overflow: hidden;
457
+ }
458
+ .FileExplorerApp_fileListPanel {
459
+ display: flex;
460
+ flex: 1;
461
+ min-width: 0;
462
+ flex-direction: column;
463
+ overflow: hidden;
464
+ }
465
+ .FileExplorerApp_fileListDropZone {
466
+ position: relative;
467
+ display: flex;
468
+ flex: 1;
469
+ min-height: 0;
470
+ flex-direction: column;
471
+ }
472
+ .FileExplorerApp_dropOverlay {
473
+ position: absolute;
474
+ inset: 0;
475
+ z-index: 2;
476
+ display: flex;
477
+ align-items: center;
478
+ justify-content: center;
479
+ background: color-mix(in srgb, var(--dt-window-body) 76%, transparent);
480
+ pointer-events: none;
481
+ }
482
+ .FileExplorerApp_dropOverlayCard {
483
+ display: flex;
484
+ min-width: 260px;
485
+ max-width: 360px;
486
+ flex-direction: column;
487
+ gap: 6px;
488
+ padding: 18px 20px;
489
+ border: 1px dashed var(--dt-accent);
490
+ border-radius: 14px;
491
+ background: color-mix(in srgb, var(--dt-surface) 92%, white 8%);
492
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
493
+ text-align: center;
494
+ }
495
+ .FileExplorerApp_dropOverlayTitle {
496
+ color: var(--dt-text);
497
+ font-size: 15px;
498
+ font-weight: 600;
499
+ }
500
+ .FileExplorerApp_dropOverlayHint {
501
+ color: var(--dt-text-muted);
502
+ font-size: 12px;
503
+ line-height: 1.5;
504
+ }
505
+ .FileExplorerApp_viewToggle {
506
+ display: flex;
507
+ gap: 4px;
508
+ margin-left: auto;
509
+ padding-left: 8px;
510
+ border-left: 1px solid var(--dt-border);
511
+ }
512
+ .FileExplorerApp_viewToggleBtn {
513
+ display: flex;
514
+ width: 28px;
515
+ height: 28px;
516
+ flex-shrink: 0;
517
+ align-items: center;
518
+ justify-content: center;
519
+ padding: 0;
520
+ border: 1px solid var(--dt-border);
521
+ border-radius: 6px;
522
+ background: var(--dt-surface);
523
+ color: var(--dt-text);
524
+ cursor: pointer;
525
+ font-size: 16px;
526
+ line-height: 1;
527
+ transition:
528
+ background 0.15s,
529
+ border-color 0.15s,
530
+ color 0.15s;
531
+ }
532
+ .FileExplorerApp_viewToggleBtn:hover {
533
+ border-color: var(--dt-accent);
534
+ background: var(--dt-surface-hover);
535
+ color: var(--dt-accent);
536
+ }
537
+ .FileExplorerApp_viewToggleBtnActive {
538
+ border-color: var(--dt-accent);
539
+ background: var(--dt-accent);
540
+ color: white;
541
+ }
542
+ .FileExplorerApp_viewToggleBtnActive:hover {
543
+ background: var(--dt-accent-hover, var(--dt-accent));
544
+ }
545
+ /*# sourceMappingURL=frontend.css.map */
546
+ `,document.head.appendChild(t)})();export{$n as activate};
547
+ //# sourceMappingURL=frontend-Dz_8vRz5.js.map