cognova 0.2.13 → 0.2.15
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/-mGU8_Hv.js +1 -0
- package/.output/public/_nuxt/0GqCtQ9S.js +1 -0
- package/.output/public/_nuxt/{DFpmIy6J.js → 1wCoXZ14.js} +1 -1
- package/.output/public/_nuxt/2J1KxdHv.js +1 -0
- package/.output/public/_nuxt/6VDUZECX.js +1 -0
- package/.output/public/_nuxt/{C7m9zGMG.js → 8WMJQbWG.js} +1 -1
- package/.output/public/_nuxt/9Rw88G6h.js +1 -0
- package/.output/public/_nuxt/{BjsKx597.js → B-yW4SD3.js} +1 -1
- package/.output/public/_nuxt/B20jNAhm.js +1 -0
- package/.output/public/_nuxt/B3OpTH_e.js +1 -0
- package/.output/public/_nuxt/B9Y3_B5G.js +1 -0
- package/.output/public/_nuxt/B9_vmatf.js +1 -0
- package/.output/public/_nuxt/B9o6sFST.js +1 -0
- package/.output/public/_nuxt/{CseYuM6E.js → BAY3_Hrq.js} +1 -1
- package/.output/public/_nuxt/{B_9zJTqe.js → BD5rPkc2.js} +3 -3
- package/.output/public/_nuxt/BGYoW3kO.js +1 -0
- package/.output/public/_nuxt/BHUy5EAj.js +1 -0
- package/.output/public/_nuxt/BLdMRpJD.js +1 -0
- package/.output/public/_nuxt/{D6tVZcRs.js → BOCn_SGf.js} +12 -12
- package/.output/public/_nuxt/BQi8LIrn.js +1 -0
- package/.output/public/_nuxt/BS1t375R.js +1 -0
- package/.output/public/_nuxt/BTGeP1bA.js +1 -0
- package/.output/public/_nuxt/{pdYvpiud.js → BVYYP4eQ.js} +5 -5
- package/.output/public/_nuxt/BWQ7zE01.js +1 -0
- package/.output/public/_nuxt/BWqJInD3.js +1 -0
- package/.output/public/_nuxt/BXdQ9ASJ.js +1 -0
- package/.output/public/_nuxt/{DQhm-UPG.js → BXxZokD_.js} +2 -2
- package/.output/public/_nuxt/BZ7DAtPi.js +1 -0
- package/.output/public/_nuxt/BZm9w7en.js +1 -0
- package/.output/public/_nuxt/B_hNqC64.js +1 -0
- package/.output/public/_nuxt/Be47YE2L.js +1 -0
- package/.output/public/_nuxt/BgIS9_ti.js +39 -0
- package/.output/public/_nuxt/BgavRUl_.js +1 -0
- package/.output/public/_nuxt/Bh0yGTzr.js +1 -0
- package/.output/public/_nuxt/BhhMUror.js +1 -0
- package/.output/public/_nuxt/Bj5e7QPz.js +1 -0
- package/.output/public/_nuxt/{9kAKMaPC.js → Bnn59-FS.js} +1 -1
- package/.output/public/_nuxt/BoCU3mWu.js +1 -0
- package/.output/public/_nuxt/Br6epbzY.js +1 -0
- package/.output/public/_nuxt/Br81Sr2R.js +1 -0
- package/.output/public/_nuxt/BrkEOLHu.js +9 -0
- package/.output/public/_nuxt/BtrNCc2S.js +1 -0
- package/.output/public/_nuxt/BxsQlbgl.js +1 -0
- package/.output/public/_nuxt/BzrhNhdT.js +1 -0
- package/.output/public/_nuxt/{B-DMcEU9.js → C-78dDNd.js} +1 -1
- package/.output/public/_nuxt/C1oaoi1p.js +1 -0
- package/.output/public/_nuxt/C2-_hcwB.js +1 -0
- package/.output/public/_nuxt/{TxMdabnL.js → C2Gh3qqr.js} +1 -1
- package/.output/public/_nuxt/C2OHaW6l.js +1 -0
- package/.output/public/_nuxt/C3szZmvA.js +1 -0
- package/.output/public/_nuxt/C3xzleKP.js +1 -0
- package/.output/public/_nuxt/C4sG6rdW.js +1 -0
- package/.output/public/_nuxt/C5Cu9Fx6.js +1 -0
- package/.output/public/_nuxt/{LRO7YHoH.js → C5gfF7J1.js} +1 -1
- package/.output/public/_nuxt/C6Eoiclo.js +1 -0
- package/.output/public/_nuxt/C7hFztZL.js +1 -0
- package/.output/public/_nuxt/CAVUAxNU.js +2 -0
- package/.output/public/_nuxt/{CiNxIhaq.js → CCeM5lW2.js} +1 -1
- package/.output/public/_nuxt/CDcQ31Eh.js +1 -0
- package/.output/public/_nuxt/CHbHVtCy.js +1 -0
- package/.output/public/_nuxt/CHnVFnBW.js +1 -0
- package/.output/public/_nuxt/CLNcmNQS.js +1 -0
- package/.output/public/_nuxt/{D7N3EZ-I.js → CPwCTHun.js} +1 -1
- package/.output/public/_nuxt/{CFmvNggn.js → CS8SdmH2.js} +1 -1
- package/.output/public/_nuxt/CTGm_mc8.js +1 -0
- package/.output/public/_nuxt/{DNcOC5zj.js → CTQFGHjS.js} +1 -1
- package/.output/public/_nuxt/{B0nzD8Sk.js → CVVtVzXC.js} +1 -1
- package/.output/public/_nuxt/CZNOaqeX.js +1 -0
- package/.output/public/_nuxt/C_A_NkeC.js +2 -0
- package/.output/public/_nuxt/{CGplHfmR.js → C_doutX-.js} +1 -1
- package/.output/public/_nuxt/{BrX-PnSK.js → CbDLhrNA.js} +2 -2
- package/.output/public/_nuxt/CePKCqSb.js +1 -0
- package/.output/public/_nuxt/Cet4T_yO.js +1 -0
- package/.output/public/_nuxt/{C6OSRpRd.js → CjJPkhbc.js} +1 -1
- package/.output/public/_nuxt/CkZT4LGq.js +1 -0
- package/.output/public/_nuxt/CkrW8sGL.js +1 -0
- package/.output/public/_nuxt/Co0UxVsx.js +1 -0
- package/.output/public/_nuxt/CqS0zXYQ.js +1 -0
- package/.output/public/_nuxt/CskGv_Km.js +1 -0
- package/.output/public/_nuxt/{DuzpliIL.js → CuvkTsqs.js} +1 -1
- package/.output/public/_nuxt/{B2wI_pYg.js → CxMuZEwX.js} +1 -1
- package/.output/public/_nuxt/{9O1MXkck.js → CxSijT71.js} +8 -8
- package/.output/public/_nuxt/Cywo6tZI.js +1 -0
- package/.output/public/_nuxt/D1reIfpX.js +1 -0
- package/.output/public/_nuxt/D1uV2uir.js +1 -0
- package/.output/public/_nuxt/{BWuL2CzO.js → D2edadpd.js} +1 -1
- package/.output/public/_nuxt/D3cEeQh7.js +1 -0
- package/.output/public/_nuxt/D41A2mE2.js +1 -0
- package/.output/public/_nuxt/D49P2RhG.js +1 -0
- package/.output/public/_nuxt/D867g6Ds.js +1 -0
- package/.output/public/_nuxt/DEFWIjWl.js +1 -0
- package/.output/public/_nuxt/DFTEBTzZ.js +1 -0
- package/.output/public/_nuxt/{-HePz7lp.js → DHRexj9X.js} +2 -2
- package/.output/public/_nuxt/DL4EpgqQ.js +1 -0
- package/.output/public/_nuxt/DLHnP6tw.js +1 -0
- package/.output/public/_nuxt/DM20WaLq.js +1 -0
- package/.output/public/_nuxt/{B8DFEjxA.js → DNAMjHbb.js} +1 -1
- package/.output/public/_nuxt/{CLkkdThv.js → DP8t9VWs.js} +24 -24
- package/.output/public/_nuxt/DTR31rjp.js +1 -0
- package/.output/public/_nuxt/{Bc8bTnkd.js → DTlSLSo1.js} +3 -3
- package/.output/public/_nuxt/{DowkFZ2V.js → DVdnhfXT.js} +1 -1
- package/.output/public/_nuxt/{DvHS7_h2.js → DZikIgHK.js} +1 -1
- package/.output/public/_nuxt/D_YGqvw_.js +1 -0
- package/.output/public/_nuxt/D_k1YwXm.js +1 -0
- package/.output/public/_nuxt/Daf2MbWG.js +7 -0
- package/.output/public/_nuxt/DcJ0GstJ.js +1 -0
- package/.output/public/_nuxt/DcYKh6QA.js +1 -0
- package/.output/public/_nuxt/DhN3_DYH.js +1 -0
- package/.output/public/_nuxt/DhSvBSt3.js +1 -0
- package/.output/public/_nuxt/DhlIWT8K.js +1 -0
- package/.output/public/_nuxt/DjsqyRqt.js +1 -0
- package/.output/public/_nuxt/DpSM97eH.js +1 -0
- package/.output/public/_nuxt/DqR9SdeU.js +1 -0
- package/.output/public/_nuxt/DqmQtg6Y.js +1 -0
- package/.output/public/_nuxt/Dsuag_iW.js +1 -0
- package/.output/public/_nuxt/Dtr_0IbE.js +1 -0
- package/.output/public/_nuxt/DwrmFEZN.js +1 -0
- package/.output/public/_nuxt/DxE8r3r4.js +1 -0
- package/.output/public/_nuxt/G_CsVlOR.js +1 -0
- package/.output/public/_nuxt/Gyw_2f6x.js +1 -0
- package/.output/public/_nuxt/HStC1ZyE.js +1 -0
- package/.output/public/_nuxt/Hh9mv0Ek.js +1 -0
- package/.output/public/_nuxt/LR0kCjbe.js +1 -0
- package/.output/public/_nuxt/MYeLvJGV.js +1 -0
- package/.output/public/_nuxt/NKs0EGrh.js +1 -0
- package/.output/public/_nuxt/PY5EGujn.js +1 -0
- package/.output/public/_nuxt/PamJNol9.js +1 -0
- package/.output/public/_nuxt/RlvwEbHv.js +1 -0
- package/.output/public/_nuxt/{BghuwIGa.js → TNpdJOlc.js} +1 -1
- package/.output/public/_nuxt/TSYrPbLR.js +1 -0
- package/.output/public/_nuxt/U-eBrbR4.js +1 -0
- package/.output/public/_nuxt/UuqXScSw.js +1 -0
- package/.output/public/_nuxt/V04-MrLN.js +1 -0
- package/.output/public/_nuxt/X0o5GcBb.js +1 -0
- package/.output/public/_nuxt/XQNzmQy9.js +1 -0
- package/.output/public/_nuxt/Y59XKprr.js +1 -0
- package/.output/public/_nuxt/YZQjZgsH.js +1 -0
- package/.output/public/_nuxt/_-TGPiLQ.js +1 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/7c42ae85-1cae-45f0-8cb9-ad3a10165c2c.json +1 -0
- package/.output/public/_nuxt/dashboard.ByJQ-Wzh.css +1 -0
- package/.output/public/_nuxt/entry.ZJxWCrU6.css +1 -0
- package/.output/public/_nuxt/{D12qPplu.js → hCeWb_38.js} +1 -1
- package/.output/public/_nuxt/{sBzyvWMJ.js → hrPTRWjM.js} +1 -1
- package/.output/public/_nuxt/jC4pIK1p.js +1 -0
- package/.output/public/_nuxt/jTT1R-Vz.js +1 -0
- package/.output/public/_nuxt/{CRRw0Thu.js → kkAMoB43.js} +1 -1
- package/.output/public/_nuxt/{h_bXa-f2.js → mzM4BGtv.js} +1 -1
- package/.output/public/_nuxt/o-s8JBm2.js +1 -0
- package/.output/public/_nuxt/pwJTkIQ4.js +1 -0
- package/.output/public/_nuxt/{BL1mkqgd.js → rIgg2Arf.js} +3 -3
- package/.output/public/_nuxt/subdxgSQ.js +1 -0
- package/.output/public/_nuxt/t8B72leH.js +1 -0
- package/.output/public/_nuxt/vCFAHwdt.js +1 -0
- package/.output/public/_nuxt/z-MP0bB7.js +1 -0
- package/.output/server/chunks/build/CodeIcon-CWD5HcV7.mjs +1 -1
- package/.output/server/chunks/build/DropdownMenu-BBrV9nXz.mjs +1 -1
- package/.output/server/chunks/build/{EditorToolbar-DIfb5arC.mjs → EditorToolbar-B9OwSI5e.mjs} +3 -3
- package/.output/server/chunks/build/{EditorToolbar-DIfb5arC.mjs.map → EditorToolbar-B9OwSI5e.mjs.map} +1 -1
- package/.output/server/chunks/build/Img-CWLmvN1t.mjs +1 -1
- package/.output/server/chunks/build/MDC-Dx0YPDhe.mjs +1 -1
- package/.output/server/chunks/build/Select-BB1oLrCD.mjs +1 -1
- package/.output/server/chunks/build/SelectMenu-DPssg6zD.mjs +1 -1
- package/.output/server/chunks/build/Table-DCwTlhCj.mjs +1 -1
- package/.output/server/chunks/build/Tooltip-TRyl6dje.mjs +1 -1
- package/.output/server/chunks/build/Tree-DUhXKd8y.mjs +1 -1
- package/.output/server/chunks/build/{_id_-DN00UDdO.mjs → _id_-CwBeklIM.mjs} +296 -430
- package/.output/server/chunks/build/_id_-CwBeklIM.mjs.map +1 -0
- package/.output/server/chunks/build/{_name_-BnS_KEfX.mjs → _name_-D7MtW4Vu.mjs} +2 -2
- package/.output/server/chunks/build/{_name_-BnS_KEfX.mjs.map → _name_-D7MtW4Vu.mjs.map} +1 -1
- package/.output/server/chunks/build/{_uuid_-DfJaumTE.mjs → _uuid_-lvG92ein.mjs} +4 -4
- package/.output/server/chunks/build/{_uuid_-DfJaumTE.mjs.map → _uuid_-lvG92ein.mjs.map} +1 -1
- package/.output/server/chunks/build/account-LDZ4TL6x.mjs +513 -0
- package/.output/server/chunks/build/account-LDZ4TL6x.mjs.map +1 -0
- package/.output/server/chunks/build/app-CGhRZPNT.mjs +252 -0
- package/.output/server/chunks/build/app-CGhRZPNT.mjs.map +1 -0
- package/.output/server/chunks/build/{chat-m4-n9vC6.mjs → chat-BphuYhvA.mjs} +18 -27
- package/.output/server/chunks/build/chat-BphuYhvA.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/cookie-C_iulBi6.mjs +1 -1
- package/.output/server/chunks/build/{dashboard-CiVTAZuF.mjs → dashboard-nDujDyOg.mjs} +55 -16
- package/.output/server/chunks/build/{dashboard-CiVTAZuF.mjs.map → dashboard-nDujDyOg.mjs.map} +1 -1
- package/.output/server/chunks/build/{docs-ChGwOPg5.mjs → docs-Bwucwp0r.mjs} +664 -592
- package/.output/server/chunks/build/docs-Bwucwp0r.mjs.map +1 -0
- package/.output/server/chunks/build/fetch-BB7Qzkwe.mjs +1 -1
- package/.output/server/chunks/build/{hooks-D328DcO6.mjs → hooks-D6PmTth8.mjs} +19 -29
- package/.output/server/chunks/build/hooks-D6PmTth8.mjs.map +1 -0
- package/.output/server/chunks/build/{index-CAnGTRlu.mjs → index-CJkn2jiM.mjs} +2 -2
- package/.output/server/chunks/build/{index-CAnGTRlu.mjs.map → index-CJkn2jiM.mjs.map} +1 -1
- package/.output/server/chunks/build/index-CxDxc9fm.mjs +1 -1
- package/.output/server/chunks/build/index-Cz9Y6NwN.mjs +723 -0
- package/.output/server/chunks/build/index-Cz9Y6NwN.mjs.map +1 -0
- package/.output/server/chunks/build/index-hwhuKhuZ.mjs +76 -0
- package/.output/server/chunks/build/index-hwhuKhuZ.mjs.map +1 -0
- package/.output/server/chunks/build/integrations-D5JWURiJ.mjs +1499 -0
- package/.output/server/chunks/build/integrations-D5JWURiJ.mjs.map +1 -0
- package/.output/server/chunks/build/{library-Aeg7_Lsb.mjs → library-DxRdgP6X.mjs} +2 -2
- package/.output/server/chunks/build/{library-Aeg7_Lsb.mjs.map → library-DxRdgP6X.mjs.map} +1 -1
- package/.output/server/chunks/build/{login-DnnElTl2.mjs → login-BmER_VoU.mjs} +2 -2
- package/.output/server/chunks/build/{login-DnnElTl2.mjs.map → login-BmER_VoU.mjs.map} +1 -1
- package/.output/server/chunks/build/manage-secrets-BWzqc_-f.mjs +669 -0
- package/.output/server/chunks/build/manage-secrets-BWzqc_-f.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +65 -34
- package/.output/server/chunks/build/server.mjs.map +1 -1
- package/.output/server/chunks/build/settings-neokAVE5.mjs +154 -0
- package/.output/server/chunks/build/settings-neokAVE5.mjs.map +1 -0
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/build/{tasks-DnAFqbtt.mjs → tasks-CnpIQNpS.mjs} +27 -37
- package/.output/server/chunks/build/tasks-CnpIQNpS.mjs.map +1 -0
- package/.output/server/chunks/build/{useAgents-DHEXiFSc.mjs → useAgents-nmbkB9-_.mjs} +5 -26
- package/.output/server/chunks/build/useAgents-nmbkB9-_.mjs.map +1 -0
- package/.output/server/chunks/build/{view-n2sYa4Zh.mjs → view-mb0ISqfM.mjs} +3 -3
- package/.output/server/chunks/build/{view-n2sYa4Zh.mjs.map → view-mb0ISqfM.mjs.map} +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +1000 -858
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get.mjs +17 -2
- package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +21 -3
- package/.output/server/chunks/routes/api/index.get3.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +10 -9
- package/.output/server/chunks/routes/api/index.get4.mjs.map +1 -1
- package/.output/server/chunks/routes/api/index.get9.mjs +10 -8
- package/.output/server/chunks/routes/api/index.get9.mjs.map +1 -1
- package/.output/server/chunks/routes/api/memory/search.get.mjs +10 -5
- package/.output/server/chunks/routes/api/memory/search.get.mjs.map +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/app/components/AssistantPanel.client.vue +16 -314
- package/app/components/agents/AgentCard.vue +111 -0
- package/app/components/agents/AgentInfoCard.vue +54 -0
- package/app/components/agents/AgentRunHistory.vue +103 -0
- package/app/components/agents/AgentRunModal.vue +1 -24
- package/app/components/agents/AgentStatsCards.vue +1 -26
- package/app/components/assistant/AssistantChat.vue +156 -0
- package/app/components/assistant/AssistantTerminal.client.vue +178 -0
- package/app/components/chat/ConversationList.vue +2 -12
- package/app/components/files/FileTree.vue +23 -202
- package/app/components/files/FileTreeModals.vue +226 -0
- package/app/components/hooks/HookStatsCards.vue +1 -6
- package/app/components/hooks/ToolBreakdownTable.vue +1 -6
- package/app/components/search/DashboardSearch.vue +38 -1
- package/app/components/tasks/TaskCard.vue +2 -7
- package/app/components/tasks/TaskDetail.vue +4 -9
- package/app/composables/useSearch.ts +21 -11
- package/app/layouts/dashboard.vue +1 -1
- package/app/pages/agents/[id].vue +6 -197
- package/app/pages/agents/index.vue +9 -142
- package/app/pages/settings/account.vue +243 -0
- package/app/pages/settings/app.vue +230 -0
- package/app/pages/settings/index.vue +12 -0
- package/app/pages/settings/integrations.vue +794 -0
- package/app/pages/settings/manage-secrets.vue +295 -0
- package/app/pages/settings.vue +20 -1581
- package/dist/cli/index.js +676 -212
- package/package.json +1 -1
- package/server/api/agents/index.get.ts +20 -1
- package/server/api/conversations/index.get.ts +23 -5
- package/server/api/documents/index.get.ts +11 -9
- package/server/api/memory/search.get.ts +11 -6
- package/server/api/tasks/index.get.ts +11 -9
- package/server/drizzle/migrations/0016_full_text_search.sql +127 -0
- package/server/drizzle/migrations/meta/_journal.json +7 -0
- package/shared/types/index.ts +7 -1
- package/shared/utils/formatting.ts +105 -0
- package/.output/public/_nuxt/4ALIM-zZ.js +0 -1
- package/.output/public/_nuxt/5sUbkh_6.js +0 -16
- package/.output/public/_nuxt/6bB8Ev7a.js +0 -1
- package/.output/public/_nuxt/7rT1DCe2.js +0 -1
- package/.output/public/_nuxt/B2PqR2Vu.js +0 -1
- package/.output/public/_nuxt/B5FuOh7E.js +0 -1
- package/.output/public/_nuxt/B6om4MW2.js +0 -1
- package/.output/public/_nuxt/B7ikW4eF.js +0 -1
- package/.output/public/_nuxt/B9kWNcU7.js +0 -1
- package/.output/public/_nuxt/BAZ8sewA.js +0 -1
- package/.output/public/_nuxt/BCPwL4ma.js +0 -1
- package/.output/public/_nuxt/BCrlmHh_.js +0 -1
- package/.output/public/_nuxt/BD-AFJWW.js +0 -1
- package/.output/public/_nuxt/BGcQMReV.js +0 -1
- package/.output/public/_nuxt/BNJJSRKh.js +0 -1
- package/.output/public/_nuxt/BNeeERBt.js +0 -1
- package/.output/public/_nuxt/BSJb5amZ.js +0 -1
- package/.output/public/_nuxt/BSsaE9Db.js +0 -1
- package/.output/public/_nuxt/BVO3XpHT.js +0 -1
- package/.output/public/_nuxt/B_Lr1vlV.js +0 -1
- package/.output/public/_nuxt/Bl0qBhCG.js +0 -1
- package/.output/public/_nuxt/Bl43dkDq.js +0 -1
- package/.output/public/_nuxt/BnMTFF5R.js +0 -1
- package/.output/public/_nuxt/BtV7oNn3.js +0 -1
- package/.output/public/_nuxt/BvFYnRMR.js +0 -1
- package/.output/public/_nuxt/BvTUBUNN.js +0 -1
- package/.output/public/_nuxt/ByLsRRoQ.js +0 -1
- package/.output/public/_nuxt/C1LcEMwB.js +0 -1
- package/.output/public/_nuxt/C2IiXp9N.js +0 -2
- package/.output/public/_nuxt/C796kFT9.js +0 -1
- package/.output/public/_nuxt/C8AtdrMH.js +0 -1
- package/.output/public/_nuxt/CAWbHTgy.js +0 -1
- package/.output/public/_nuxt/CJPrV25_.js +0 -1
- package/.output/public/_nuxt/CKKEWapF.js +0 -1
- package/.output/public/_nuxt/CNjv28J2.js +0 -1
- package/.output/public/_nuxt/CT8s4rqa.js +0 -1
- package/.output/public/_nuxt/CZSOrxUy.js +0 -1
- package/.output/public/_nuxt/CaNEL9JC.js +0 -39
- package/.output/public/_nuxt/CbTLg9oX.js +0 -1
- package/.output/public/_nuxt/CfCXpVn5.js +0 -1
- package/.output/public/_nuxt/ChmNlvWR.js +0 -1
- package/.output/public/_nuxt/Ck0QYdxe.js +0 -1
- package/.output/public/_nuxt/Ckb0pu4-.js +0 -1
- package/.output/public/_nuxt/CkwPRs1D.js +0 -1
- package/.output/public/_nuxt/CmEJg8C6.js +0 -2
- package/.output/public/_nuxt/CmL_vMJD.js +0 -1
- package/.output/public/_nuxt/Cq8zPxkT.js +0 -1
- package/.output/public/_nuxt/CxRnB4NC.js +0 -1
- package/.output/public/_nuxt/D0zMyG8n.js +0 -1
- package/.output/public/_nuxt/D1XYB283.js +0 -1
- package/.output/public/_nuxt/D2NxqyzW.js +0 -1
- package/.output/public/_nuxt/D5xyrvFu.js +0 -1
- package/.output/public/_nuxt/D8iBB0Py.js +0 -1
- package/.output/public/_nuxt/D8oIH8m1.js +0 -1
- package/.output/public/_nuxt/DB2zZev7.js +0 -1
- package/.output/public/_nuxt/DBrOAqkm.js +0 -1
- package/.output/public/_nuxt/DDXDFweK.js +0 -1
- package/.output/public/_nuxt/DFZkCmLQ.js +0 -1
- package/.output/public/_nuxt/DKZmgHNU.js +0 -1
- package/.output/public/_nuxt/DR8tGJhL.js +0 -1
- package/.output/public/_nuxt/DVAEVTjy.js +0 -1
- package/.output/public/_nuxt/DVqrPkCJ.js +0 -1
- package/.output/public/_nuxt/DWZ9ieYa.js +0 -1
- package/.output/public/_nuxt/DWj6VsZv.js +0 -1
- package/.output/public/_nuxt/DXJ9PxCv.js +0 -1
- package/.output/public/_nuxt/D_ziPROx.js +0 -1
- package/.output/public/_nuxt/Da2vwoYG.js +0 -1
- package/.output/public/_nuxt/Ddz3HcBB.js +0 -1
- package/.output/public/_nuxt/DgYei0bK.js +0 -1
- package/.output/public/_nuxt/Di_3GV_R.js +0 -1
- package/.output/public/_nuxt/Djog1f_e.js +0 -1
- package/.output/public/_nuxt/Dkap2-Pj.js +0 -7
- package/.output/public/_nuxt/DlJe_sHk.js +0 -1
- package/.output/public/_nuxt/DlPOQpH_.js +0 -1
- package/.output/public/_nuxt/DmYWMtVA.js +0 -1
- package/.output/public/_nuxt/DmxKU7sH.js +0 -1
- package/.output/public/_nuxt/DsodHRrQ.js +0 -1
- package/.output/public/_nuxt/DwSY6_2U.js +0 -1
- package/.output/public/_nuxt/DypJaSm-.js +0 -1
- package/.output/public/_nuxt/DzKaXH6P.js +0 -1
- package/.output/public/_nuxt/FK-jSuOT.js +0 -1
- package/.output/public/_nuxt/Fc2JsQt4.js +0 -1
- package/.output/public/_nuxt/IYCBGuRS.js +0 -1
- package/.output/public/_nuxt/NrRzUJNY.js +0 -1
- package/.output/public/_nuxt/OeVS0Rsb.js +0 -1
- package/.output/public/_nuxt/OlF0QnKF.js +0 -1
- package/.output/public/_nuxt/QuAoqY7t.js +0 -1
- package/.output/public/_nuxt/RlXHkmOd.js +0 -9
- package/.output/public/_nuxt/WZnvL9Dh.js +0 -1
- package/.output/public/_nuxt/ZvG7a1W3.js +0 -1
- package/.output/public/_nuxt/aPNZBVrG.js +0 -1
- package/.output/public/_nuxt/builds/meta/495aca73-bfa5-456e-b96a-f02e009c72d3.json +0 -1
- package/.output/public/_nuxt/dashboard.BxCOkJwt.css +0 -1
- package/.output/public/_nuxt/entry.C_udkZt9.css +0 -1
- package/.output/public/_nuxt/evY81hM3.js +0 -1
- package/.output/public/_nuxt/i6QBzaEi.js +0 -1
- package/.output/public/_nuxt/iTVKJ1kw.js +0 -1
- package/.output/public/_nuxt/j92uR3uR.js +0 -1
- package/.output/public/_nuxt/jdUkeAj_.js +0 -1
- package/.output/public/_nuxt/jeRvcMHU.js +0 -1
- package/.output/public/_nuxt/kuv0zpKq.js +0 -1
- package/.output/public/_nuxt/l3lKQs7b.js +0 -1
- package/.output/public/_nuxt/qIgZ7OXa.js +0 -1
- package/.output/public/_nuxt/qcVwZv8e.js +0 -1
- package/.output/public/_nuxt/ru8fqqWs.js +0 -1
- package/.output/public/_nuxt/sgmhgpCS.js +0 -1
- package/.output/public/_nuxt/y2jv0da-.js +0 -1
- package/.output/public/_nuxt/yyS4-kAX.js +0 -1
- package/.output/public/_nuxt/zIoBLBHF.js +0 -1
- package/.output/public/_nuxt/zpazwPgx.js +0 -1
- package/.output/server/chunks/build/_id_-DN00UDdO.mjs.map +0 -1
- package/.output/server/chunks/build/chat-m4-n9vC6.mjs.map +0 -1
- package/.output/server/chunks/build/docs-ChGwOPg5.mjs.map +0 -1
- package/.output/server/chunks/build/hooks-D328DcO6.mjs.map +0 -1
- package/.output/server/chunks/build/index-C9PuieXh.mjs +0 -820
- package/.output/server/chunks/build/index-C9PuieXh.mjs.map +0 -1
- package/.output/server/chunks/build/settings-B2KXoGcz.mjs +0 -3232
- package/.output/server/chunks/build/settings-B2KXoGcz.mjs.map +0 -1
- package/.output/server/chunks/build/tasks-DnAFqbtt.mjs.map +0 -1
- package/.output/server/chunks/build/useAgents-DHEXiFSc.mjs.map +0 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { _ as _sfc_main$1$1, a as _sfc_main$
|
|
1
|
+
import { _ as _sfc_main$1$1, a as _sfc_main$6 } from './DashboardNavbar-Cpq8yKA0.mjs';
|
|
2
2
|
import { _ as _sfc_main$9 } from './Input-CV2hlBHo.mjs';
|
|
3
3
|
import { _ as _sfc_main$a } from './Separator-CYbxFNTe.mjs';
|
|
4
4
|
import { _ as _sfc_main$1$2, a as _sfc_main$b } from './Tree-DUhXKd8y.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import { _ as _sfc_main$
|
|
7
|
-
import { _ as _sfc_main$
|
|
8
|
-
import { defineComponent, mergeProps, withCtx, createVNode, unref, createBlock, createCommentVNode, openBlock, createTextVNode, ref, computed, isRef, toDisplayString,
|
|
5
|
+
import { z as useRoute, g as _sfc_main$d, _ as _sfc_main$8$1, b as useLocale, e as useAppConfig, t as tv, i as useToast, W as __nuxt_component_3$1 } from './server.mjs';
|
|
6
|
+
import { _ as _sfc_main$f } from './Modal-Z_SoWhh-.mjs';
|
|
7
|
+
import { _ as _sfc_main$g } from './Card-G40WAFiH.mjs';
|
|
8
|
+
import { defineComponent, mergeProps, withCtx, createVNode, unref, createBlock, createCommentVNode, openBlock, createTextVNode, ref, computed, isRef, toDisplayString, withAsyncContext, mergeModels, useModel, watch, withKeys, useSSRContext } from 'vue';
|
|
9
9
|
import { ssrRenderAttrs, ssrRenderComponent, ssrRenderClass, ssrInterpolate } from 'vue/server-renderer';
|
|
10
10
|
import { useForwardProps } from 'reka-ui';
|
|
11
11
|
import { useDebounceFn, reactiveOmit } from '@vueuse/core';
|
|
12
12
|
import { u as useDashboard } from './DashboardSidebarToggle-Chnqv04k.mjs';
|
|
13
|
-
import { _ as _sfc_main$
|
|
14
|
-
import { _ as _sfc_main$
|
|
15
|
-
import { _ as _sfc_main$
|
|
13
|
+
import { _ as _sfc_main$7 } from './ColorModeButton-CiS8E1tc.mjs';
|
|
14
|
+
import { _ as _sfc_main$8 } from './Drawer-zOHju6ul.mjs';
|
|
15
|
+
import { _ as _sfc_main$c } from './Switch-GWdksmY6.mjs';
|
|
16
16
|
import { _ as _sfc_main$h } from './FormField-Caux_FCv.mjs';
|
|
17
17
|
import { _ as _sfc_main$i } from './SelectMenu-DPssg6zD.mjs';
|
|
18
18
|
import { _ as _sfc_main$j } from './InputTags-VS4G6txn.mjs';
|
|
19
|
-
import { _ as _sfc_main$1$3, a as _sfc_main$
|
|
20
|
-
import { _ as __nuxt_component_5, u as useCopyToClipboard } from './useCopyToClipboard-vi6FYyyZ.mjs';
|
|
21
|
-
import {
|
|
19
|
+
import { _ as _sfc_main$1$3, a as _sfc_main$e } from './EditorToolbar-B9OwSI5e.mjs';
|
|
20
|
+
import { _ as __nuxt_component_5$1, u as useCopyToClipboard } from './useCopyToClipboard-vi6FYyyZ.mjs';
|
|
21
|
+
import { ar as isMarkdownFile, as as detectLanguage } from '../nitro/nitro.mjs';
|
|
22
22
|
import { u as useFetch } from './fetch-BB7Qzkwe.mjs';
|
|
23
23
|
import { u as usePreferences } from './usePreferences-DH1QjxOj.mjs';
|
|
24
24
|
import 'reka-ui/namespaced';
|
|
@@ -90,506 +90,72 @@ import '@iconify/utils';
|
|
|
90
90
|
import 'consola';
|
|
91
91
|
import '@vue/shared';
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const selectedFile = ref(null);
|
|
96
|
-
const loading = ref(false);
|
|
97
|
-
const error = ref(null);
|
|
98
|
-
const searchQuery = ref("");
|
|
99
|
-
function fileEntryToTreeItem(entry, expandRoot = false) {
|
|
100
|
-
const icon = entry.type === "directory" ? void 0 : getFileIcon(entry.name);
|
|
101
|
-
return {
|
|
102
|
-
id: entry.path,
|
|
103
|
-
label: entry.name,
|
|
104
|
-
icon,
|
|
105
|
-
path: entry.path,
|
|
106
|
-
type: entry.type,
|
|
107
|
-
defaultExpanded: expandRoot,
|
|
108
|
-
children: entry.children?.map((child) => fileEntryToTreeItem(child))
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function getFileIcon(filename) {
|
|
112
|
-
const ext = filename.split(".").pop()?.toLowerCase();
|
|
113
|
-
switch (ext) {
|
|
114
|
-
case "md":
|
|
115
|
-
return "i-lucide-file-text";
|
|
116
|
-
case "ts":
|
|
117
|
-
case "tsx":
|
|
118
|
-
return "i-lucide-file-code";
|
|
119
|
-
case "js":
|
|
120
|
-
case "jsx":
|
|
121
|
-
return "i-lucide-file-code";
|
|
122
|
-
case "vue":
|
|
123
|
-
return "i-lucide-file-code";
|
|
124
|
-
case "json":
|
|
125
|
-
return "i-lucide-file-json";
|
|
126
|
-
case "css":
|
|
127
|
-
case "scss":
|
|
128
|
-
return "i-lucide-file-code";
|
|
129
|
-
case "png":
|
|
130
|
-
case "jpg":
|
|
131
|
-
case "jpeg":
|
|
132
|
-
case "gif":
|
|
133
|
-
case "svg":
|
|
134
|
-
return "i-lucide-file-image";
|
|
135
|
-
default:
|
|
136
|
-
return "i-lucide-file";
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
async function loadTree(path = "/") {
|
|
140
|
-
loading.value = true;
|
|
141
|
-
error.value = null;
|
|
142
|
-
try {
|
|
143
|
-
const response = await $fetch("/api/fs/list", {
|
|
144
|
-
query: { path, recursive: "true" }
|
|
145
|
-
});
|
|
146
|
-
items.value = response.data.map((entry) => fileEntryToTreeItem(entry, true));
|
|
147
|
-
} catch (e) {
|
|
148
|
-
error.value = "Failed to load file tree";
|
|
149
|
-
console.error("Failed to load file tree:", e);
|
|
150
|
-
} finally {
|
|
151
|
-
loading.value = false;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
async function readFile(path) {
|
|
155
|
-
try {
|
|
156
|
-
const response = await $fetch("/api/fs/read", {
|
|
157
|
-
method: "POST",
|
|
158
|
-
body: { path }
|
|
159
|
-
});
|
|
160
|
-
return response.data;
|
|
161
|
-
} catch (e) {
|
|
162
|
-
console.error("Failed to read file:", e);
|
|
163
|
-
throw e;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async function writeFile(path, content) {
|
|
167
|
-
try {
|
|
168
|
-
const response = await $fetch("/api/fs/write", {
|
|
169
|
-
method: "POST",
|
|
170
|
-
body: { path, content }
|
|
171
|
-
});
|
|
172
|
-
return response.data;
|
|
173
|
-
} catch (e) {
|
|
174
|
-
console.error("Failed to write file:", e);
|
|
175
|
-
throw e;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
async function createFile(parentPath, filename) {
|
|
179
|
-
const path = parentPath === "/" ? `/${filename}` : `${parentPath}/${filename}`;
|
|
180
|
-
await writeFile(path, "");
|
|
181
|
-
await loadTree();
|
|
182
|
-
return path;
|
|
183
|
-
}
|
|
184
|
-
async function createFolder(parentPath, foldername) {
|
|
185
|
-
const path = parentPath === "/" ? `/${foldername}` : `${parentPath}/${foldername}`;
|
|
186
|
-
try {
|
|
187
|
-
await $fetch("/api/fs/mkdir", {
|
|
188
|
-
method: "POST",
|
|
189
|
-
body: { path }
|
|
190
|
-
});
|
|
191
|
-
await loadTree();
|
|
192
|
-
return path;
|
|
193
|
-
} catch (e) {
|
|
194
|
-
console.error("Failed to create folder:", e);
|
|
195
|
-
throw e;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function renameItem(oldPath, newName) {
|
|
199
|
-
const parts = oldPath.split("/");
|
|
200
|
-
parts.pop();
|
|
201
|
-
const newPath = [...parts, newName].join("/");
|
|
202
|
-
try {
|
|
203
|
-
await $fetch("/api/fs/rename", {
|
|
204
|
-
method: "POST",
|
|
205
|
-
body: { oldPath, newPath }
|
|
206
|
-
});
|
|
207
|
-
await loadTree();
|
|
208
|
-
return newPath;
|
|
209
|
-
} catch (e) {
|
|
210
|
-
console.error("Failed to rename:", e);
|
|
211
|
-
throw e;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
async function deleteItem(path) {
|
|
215
|
-
try {
|
|
216
|
-
await $fetch("/api/fs/delete", {
|
|
217
|
-
method: "POST",
|
|
218
|
-
body: { path }
|
|
219
|
-
});
|
|
220
|
-
if (selectedFile.value === path) {
|
|
221
|
-
selectedFile.value = null;
|
|
222
|
-
}
|
|
223
|
-
await loadTree();
|
|
224
|
-
} catch (e) {
|
|
225
|
-
console.error("Failed to delete:", e);
|
|
226
|
-
throw e;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
async function moveItem(sourcePath, destinationPath) {
|
|
230
|
-
try {
|
|
231
|
-
const response = await $fetch("/api/fs/move", {
|
|
232
|
-
method: "POST",
|
|
233
|
-
body: { sourcePath, destinationPath }
|
|
234
|
-
});
|
|
235
|
-
await loadTree();
|
|
236
|
-
return response.data.newPath;
|
|
237
|
-
} catch (e) {
|
|
238
|
-
console.error("Failed to move:", e);
|
|
239
|
-
throw e;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
const filteredItems = computed(() => {
|
|
243
|
-
if (!searchQuery.value) return items.value;
|
|
244
|
-
const query = searchQuery.value.toLowerCase();
|
|
245
|
-
function filterTree(items2) {
|
|
246
|
-
return items2.reduce((acc, item) => {
|
|
247
|
-
const matches = item.label.toLowerCase().includes(query);
|
|
248
|
-
const filteredChildren = item.children ? filterTree(item.children) : [];
|
|
249
|
-
if (matches || filteredChildren.length > 0) {
|
|
250
|
-
acc.push({
|
|
251
|
-
...item,
|
|
252
|
-
children: filteredChildren.length > 0 ? filteredChildren : item.children,
|
|
253
|
-
defaultExpanded: filteredChildren.length > 0 || matches
|
|
254
|
-
});
|
|
255
|
-
}
|
|
256
|
-
return acc;
|
|
257
|
-
}, []);
|
|
258
|
-
}
|
|
259
|
-
return filterTree(items.value);
|
|
260
|
-
});
|
|
261
|
-
return {
|
|
262
|
-
items,
|
|
263
|
-
filteredItems,
|
|
264
|
-
selectedFile,
|
|
265
|
-
loading,
|
|
266
|
-
error,
|
|
267
|
-
searchQuery,
|
|
268
|
-
loadTree,
|
|
269
|
-
readFile,
|
|
270
|
-
writeFile,
|
|
271
|
-
createFile,
|
|
272
|
-
createFolder,
|
|
273
|
-
renameItem,
|
|
274
|
-
deleteItem,
|
|
275
|
-
moveItem
|
|
276
|
-
};
|
|
277
|
-
}
|
|
278
|
-
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
279
|
-
__name: "FileTree",
|
|
93
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
94
|
+
__name: "FileTreeModals",
|
|
280
95
|
__ssrInlineRender: true,
|
|
281
|
-
|
|
96
|
+
props: /* @__PURE__ */ mergeModels({
|
|
97
|
+
contextTarget: {}
|
|
98
|
+
}, {
|
|
99
|
+
"showNewFile": { type: Boolean, ...{ required: true } },
|
|
100
|
+
"showNewFileModifiers": {},
|
|
101
|
+
"showNewFolder": { type: Boolean, ...{ required: true } },
|
|
102
|
+
"showNewFolderModifiers": {},
|
|
103
|
+
"showRename": { type: Boolean, ...{ required: true } },
|
|
104
|
+
"showRenameModifiers": {},
|
|
105
|
+
"showDelete": { type: Boolean, ...{ required: true } },
|
|
106
|
+
"showDeleteModifiers": {}
|
|
107
|
+
}),
|
|
108
|
+
emits: /* @__PURE__ */ mergeModels(["createFile", "createFolder", "rename", "delete"], ["update:showNewFile", "update:showNewFolder", "update:showRename", "update:showDelete"]),
|
|
282
109
|
setup(__props, { emit: __emit }) {
|
|
110
|
+
const showNewFile = useModel(__props, "showNewFile");
|
|
111
|
+
const showNewFolder = useModel(__props, "showNewFolder");
|
|
112
|
+
const showRename = useModel(__props, "showRename");
|
|
113
|
+
const showDelete = useModel(__props, "showDelete");
|
|
114
|
+
const props = __props;
|
|
283
115
|
const emit = __emit;
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
event.dataTransfer.effectAllowed = "move";
|
|
301
|
-
event.dataTransfer.setData("text/plain", item.path);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
function handleDragOver(event, item) {
|
|
305
|
-
if (!draggedItem.value) return;
|
|
306
|
-
if (item.type !== "directory") return;
|
|
307
|
-
if (draggedItem.value.path === item.path) return;
|
|
308
|
-
if (item.path.startsWith(draggedItem.value.path + "/")) return;
|
|
309
|
-
event.preventDefault();
|
|
310
|
-
dropTarget.value = item;
|
|
116
|
+
const newItemName = ref("");
|
|
117
|
+
watch(showRename, (open) => {
|
|
118
|
+
if (open && props.contextTarget)
|
|
119
|
+
newItemName.value = props.contextTarget.label;
|
|
120
|
+
});
|
|
121
|
+
watch(showNewFile, (open) => {
|
|
122
|
+
if (open) newItemName.value = "";
|
|
123
|
+
});
|
|
124
|
+
watch(showNewFolder, (open) => {
|
|
125
|
+
if (open) newItemName.value = "";
|
|
126
|
+
});
|
|
127
|
+
function handleCreateFile() {
|
|
128
|
+
if (!newItemName.value.trim()) return;
|
|
129
|
+
emit("createFile", newItemName.value.trim());
|
|
130
|
+
showNewFile.value = false;
|
|
131
|
+
newItemName.value = "";
|
|
311
132
|
}
|
|
312
|
-
function
|
|
313
|
-
|
|
133
|
+
function handleCreateFolder() {
|
|
134
|
+
if (!newItemName.value.trim()) return;
|
|
135
|
+
emit("createFolder", newItemName.value.trim());
|
|
136
|
+
showNewFolder.value = false;
|
|
137
|
+
newItemName.value = "";
|
|
314
138
|
}
|
|
315
|
-
function
|
|
316
|
-
|
|
317
|
-
|
|
139
|
+
function handleRename() {
|
|
140
|
+
if (!newItemName.value.trim()) return;
|
|
141
|
+
emit("rename", newItemName.value.trim());
|
|
142
|
+
showRename.value = false;
|
|
143
|
+
newItemName.value = "";
|
|
318
144
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
try {
|
|
323
|
-
await moveItem(draggedItem.value.path, item.path);
|
|
324
|
-
} catch {
|
|
325
|
-
}
|
|
326
|
-
draggedItem.value = null;
|
|
327
|
-
dropTarget.value = null;
|
|
328
|
-
}
|
|
329
|
-
const contextMenuTarget = ref(null);
|
|
330
|
-
const showNewFileModal = ref(false);
|
|
331
|
-
const showNewFolderModal = ref(false);
|
|
332
|
-
const showRenameModal = ref(false);
|
|
333
|
-
const showDeleteConfirm = ref(false);
|
|
334
|
-
const newItemName = ref("");
|
|
335
|
-
const contextMenuItems = computed(() => [
|
|
336
|
-
[{
|
|
337
|
-
label: "New File",
|
|
338
|
-
icon: "i-lucide-file-plus",
|
|
339
|
-
onSelect: () => {
|
|
340
|
-
newItemName.value = "";
|
|
341
|
-
showNewFileModal.value = true;
|
|
342
|
-
}
|
|
343
|
-
}, {
|
|
344
|
-
label: "New Folder",
|
|
345
|
-
icon: "i-lucide-folder-plus",
|
|
346
|
-
onSelect: () => {
|
|
347
|
-
newItemName.value = "";
|
|
348
|
-
showNewFolderModal.value = true;
|
|
349
|
-
}
|
|
350
|
-
}],
|
|
351
|
-
[{
|
|
352
|
-
label: "Rename",
|
|
353
|
-
icon: "i-lucide-pencil",
|
|
354
|
-
onSelect: () => {
|
|
355
|
-
if (contextMenuTarget.value) {
|
|
356
|
-
newItemName.value = contextMenuTarget.value.label;
|
|
357
|
-
showRenameModal.value = true;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}, {
|
|
361
|
-
label: "Delete",
|
|
362
|
-
icon: "i-lucide-trash-2",
|
|
363
|
-
color: "error",
|
|
364
|
-
onSelect: () => {
|
|
365
|
-
showDeleteConfirm.value = true;
|
|
366
|
-
}
|
|
367
|
-
}]
|
|
368
|
-
]);
|
|
369
|
-
function handleSelect(item) {
|
|
370
|
-
if (item.type === "file") {
|
|
371
|
-
selectedFile.value = item.path;
|
|
372
|
-
emit("select", item.path);
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
async function handleCreateFile() {
|
|
376
|
-
if (!newItemName.value.trim()) return;
|
|
377
|
-
const parentPath = contextMenuTarget.value?.type === "directory" ? contextMenuTarget.value.path : "/";
|
|
378
|
-
let filename = newItemName.value.trim();
|
|
379
|
-
if (!filename.includes(".")) {
|
|
380
|
-
filename += ".md";
|
|
381
|
-
}
|
|
382
|
-
try {
|
|
383
|
-
const path = await createFile(parentPath, filename);
|
|
384
|
-
selectedFile.value = path;
|
|
385
|
-
emit("select", path);
|
|
386
|
-
} catch {
|
|
387
|
-
}
|
|
388
|
-
showNewFileModal.value = false;
|
|
389
|
-
newItemName.value = "";
|
|
390
|
-
}
|
|
391
|
-
async function handleCreateFolder() {
|
|
392
|
-
if (!newItemName.value.trim()) return;
|
|
393
|
-
const parentPath = contextMenuTarget.value?.type === "directory" ? contextMenuTarget.value.path : "/";
|
|
394
|
-
try {
|
|
395
|
-
await createFolder(parentPath, newItemName.value.trim());
|
|
396
|
-
} catch {
|
|
397
|
-
}
|
|
398
|
-
showNewFolderModal.value = false;
|
|
399
|
-
newItemName.value = "";
|
|
400
|
-
}
|
|
401
|
-
async function handleRename() {
|
|
402
|
-
if (!contextMenuTarget.value || !newItemName.value.trim()) return;
|
|
403
|
-
try {
|
|
404
|
-
await renameItem(contextMenuTarget.value.path, newItemName.value.trim());
|
|
405
|
-
} catch {
|
|
406
|
-
}
|
|
407
|
-
showRenameModal.value = false;
|
|
408
|
-
newItemName.value = "";
|
|
409
|
-
}
|
|
410
|
-
async function handleDelete() {
|
|
411
|
-
if (!contextMenuTarget.value) return;
|
|
412
|
-
try {
|
|
413
|
-
await deleteItem(contextMenuTarget.value.path);
|
|
414
|
-
} catch {
|
|
415
|
-
}
|
|
416
|
-
showDeleteConfirm.value = false;
|
|
145
|
+
function handleDelete() {
|
|
146
|
+
emit("delete");
|
|
147
|
+
showDelete.value = false;
|
|
417
148
|
}
|
|
418
149
|
return (_ctx, _push, _parent, _attrs) => {
|
|
419
|
-
const
|
|
420
|
-
const
|
|
421
|
-
const _component_UContextMenu = _sfc_main$1$2;
|
|
150
|
+
const _component_UModal = _sfc_main$f;
|
|
151
|
+
const _component_UCard = _sfc_main$g;
|
|
422
152
|
const _component_UIcon = _sfc_main$d;
|
|
423
|
-
const
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
const _component_UButton = _sfc_main$8;
|
|
427
|
-
_push(`<div${ssrRenderAttrs(mergeProps({ class: "h-full flex flex-col" }, _attrs))}><div class="-mt-1 pb-2">`);
|
|
428
|
-
_push(ssrRenderComponent(_component_UInput, {
|
|
429
|
-
modelValue: unref(searchQuery),
|
|
430
|
-
"onUpdate:modelValue": ($event) => isRef(searchQuery) ? searchQuery.value = $event : null,
|
|
431
|
-
placeholder: "Search files...",
|
|
432
|
-
icon: "i-lucide-search",
|
|
433
|
-
size: "sm",
|
|
434
|
-
class: "w-full"
|
|
435
|
-
}, null, _parent));
|
|
436
|
-
_push(`</div>`);
|
|
437
|
-
_push(ssrRenderComponent(_component_USeparator, { class: "mt-2" }, null, _parent));
|
|
438
|
-
_push(ssrRenderComponent(_component_UContextMenu, {
|
|
439
|
-
items: unref(contextMenuItems),
|
|
440
|
-
class: "flex-1 h-full overflow-auto p-2",
|
|
441
|
-
onContextmenu: ($event) => contextMenuTarget.value = null
|
|
442
|
-
}, {
|
|
443
|
-
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
444
|
-
if (_push2) {
|
|
445
|
-
if (unref(loading)) {
|
|
446
|
-
_push2(`<div class="flex items-center justify-center py-8"${_scopeId}>`);
|
|
447
|
-
_push2(ssrRenderComponent(_component_UIcon, {
|
|
448
|
-
name: "i-lucide-loader-2",
|
|
449
|
-
class: "size-6 animate-spin text-dimmed"
|
|
450
|
-
}, null, _parent2, _scopeId));
|
|
451
|
-
_push2(`</div>`);
|
|
452
|
-
} else if (unref(filteredItems).length === 0) {
|
|
453
|
-
_push2(`<div class="h-full min-h-32 flex flex-col items-center justify-center text-dimmed text-sm"${_scopeId}>`);
|
|
454
|
-
_push2(ssrRenderComponent(_component_UIcon, {
|
|
455
|
-
name: "i-lucide-folder-open",
|
|
456
|
-
class: "size-8 mx-auto mb-2 opacity-50"
|
|
457
|
-
}, null, _parent2, _scopeId));
|
|
458
|
-
_push2(`<p${_scopeId}>No files found</p><p class="text-xs mt-1"${_scopeId}> Right-click to create a file </p></div>`);
|
|
459
|
-
} else {
|
|
460
|
-
_push2(ssrRenderComponent(_component_UTree, {
|
|
461
|
-
items: unref(filteredItems),
|
|
462
|
-
"get-key": (item) => item.id,
|
|
463
|
-
color: "primary",
|
|
464
|
-
"expanded-icon": "i-lucide-folder-open",
|
|
465
|
-
"collapsed-icon": "i-lucide-folder",
|
|
466
|
-
onSelect: (_e, item) => handleSelect(item)
|
|
467
|
-
}, {
|
|
468
|
-
item: withCtx(({ item, expanded }, _push3, _parent3, _scopeId2) => {
|
|
469
|
-
if (_push3) {
|
|
470
|
-
_push3(`<div class="${ssrRenderClass([{
|
|
471
|
-
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
472
|
-
}, "flex items-center gap-2 w-full"])}" draggable="true"${_scopeId2}>`);
|
|
473
|
-
if (item.children?.length) {
|
|
474
|
-
_push3(ssrRenderComponent(_component_UIcon, {
|
|
475
|
-
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
476
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
477
|
-
}, null, _parent3, _scopeId2));
|
|
478
|
-
} else if (item.icon) {
|
|
479
|
-
_push3(ssrRenderComponent(_component_UIcon, {
|
|
480
|
-
name: item.icon,
|
|
481
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
482
|
-
}, null, _parent3, _scopeId2));
|
|
483
|
-
} else {
|
|
484
|
-
_push3(ssrRenderComponent(_component_UIcon, {
|
|
485
|
-
name: "i-lucide-file",
|
|
486
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
487
|
-
}, null, _parent3, _scopeId2));
|
|
488
|
-
}
|
|
489
|
-
_push3(`<span class="truncate"${_scopeId2}>${ssrInterpolate(item.label)}</span></div>`);
|
|
490
|
-
} else {
|
|
491
|
-
return [
|
|
492
|
-
createVNode("div", {
|
|
493
|
-
class: ["flex items-center gap-2 w-full", {
|
|
494
|
-
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
495
|
-
}],
|
|
496
|
-
draggable: "true",
|
|
497
|
-
onContextmenu: ($event) => contextMenuTarget.value = item,
|
|
498
|
-
onDragstart: ($event) => handleDragStart($event, item),
|
|
499
|
-
onDragover: ($event) => handleDragOver($event, item),
|
|
500
|
-
onDragleave: handleDragLeave,
|
|
501
|
-
onDragend: handleDragEnd,
|
|
502
|
-
onDrop: ($event) => handleDrop($event, item)
|
|
503
|
-
}, [
|
|
504
|
-
item.children?.length ? (openBlock(), createBlock(_component_UIcon, {
|
|
505
|
-
key: 0,
|
|
506
|
-
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
507
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
508
|
-
}, null, 8, ["name"])) : item.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
509
|
-
key: 1,
|
|
510
|
-
name: item.icon,
|
|
511
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
512
|
-
}, null, 8, ["name"])) : (openBlock(), createBlock(_component_UIcon, {
|
|
513
|
-
key: 2,
|
|
514
|
-
name: "i-lucide-file",
|
|
515
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
516
|
-
})),
|
|
517
|
-
createVNode("span", { class: "truncate" }, toDisplayString(item.label), 1)
|
|
518
|
-
], 42, ["onContextmenu", "onDragstart", "onDragover", "onDrop"])
|
|
519
|
-
];
|
|
520
|
-
}
|
|
521
|
-
}),
|
|
522
|
-
_: 1
|
|
523
|
-
}, _parent2, _scopeId));
|
|
524
|
-
}
|
|
525
|
-
} else {
|
|
526
|
-
return [
|
|
527
|
-
unref(loading) ? (openBlock(), createBlock("div", {
|
|
528
|
-
key: 0,
|
|
529
|
-
class: "flex items-center justify-center py-8"
|
|
530
|
-
}, [
|
|
531
|
-
createVNode(_component_UIcon, {
|
|
532
|
-
name: "i-lucide-loader-2",
|
|
533
|
-
class: "size-6 animate-spin text-dimmed"
|
|
534
|
-
})
|
|
535
|
-
])) : unref(filteredItems).length === 0 ? (openBlock(), createBlock("div", {
|
|
536
|
-
key: 1,
|
|
537
|
-
class: "h-full min-h-32 flex flex-col items-center justify-center text-dimmed text-sm"
|
|
538
|
-
}, [
|
|
539
|
-
createVNode(_component_UIcon, {
|
|
540
|
-
name: "i-lucide-folder-open",
|
|
541
|
-
class: "size-8 mx-auto mb-2 opacity-50"
|
|
542
|
-
}),
|
|
543
|
-
createVNode("p", null, "No files found"),
|
|
544
|
-
createVNode("p", { class: "text-xs mt-1" }, " Right-click to create a file ")
|
|
545
|
-
])) : (openBlock(), createBlock(_component_UTree, {
|
|
546
|
-
key: 2,
|
|
547
|
-
items: unref(filteredItems),
|
|
548
|
-
"get-key": (item) => item.id,
|
|
549
|
-
color: "primary",
|
|
550
|
-
"expanded-icon": "i-lucide-folder-open",
|
|
551
|
-
"collapsed-icon": "i-lucide-folder",
|
|
552
|
-
onSelect: (_e, item) => handleSelect(item)
|
|
553
|
-
}, {
|
|
554
|
-
item: withCtx(({ item, expanded }) => [
|
|
555
|
-
createVNode("div", {
|
|
556
|
-
class: ["flex items-center gap-2 w-full", {
|
|
557
|
-
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
558
|
-
}],
|
|
559
|
-
draggable: "true",
|
|
560
|
-
onContextmenu: ($event) => contextMenuTarget.value = item,
|
|
561
|
-
onDragstart: ($event) => handleDragStart($event, item),
|
|
562
|
-
onDragover: ($event) => handleDragOver($event, item),
|
|
563
|
-
onDragleave: handleDragLeave,
|
|
564
|
-
onDragend: handleDragEnd,
|
|
565
|
-
onDrop: ($event) => handleDrop($event, item)
|
|
566
|
-
}, [
|
|
567
|
-
item.children?.length ? (openBlock(), createBlock(_component_UIcon, {
|
|
568
|
-
key: 0,
|
|
569
|
-
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
570
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
571
|
-
}, null, 8, ["name"])) : item.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
572
|
-
key: 1,
|
|
573
|
-
name: item.icon,
|
|
574
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
575
|
-
}, null, 8, ["name"])) : (openBlock(), createBlock(_component_UIcon, {
|
|
576
|
-
key: 2,
|
|
577
|
-
name: "i-lucide-file",
|
|
578
|
-
class: "size-4 shrink-0 text-dimmed"
|
|
579
|
-
})),
|
|
580
|
-
createVNode("span", { class: "truncate" }, toDisplayString(item.label), 1)
|
|
581
|
-
], 42, ["onContextmenu", "onDragstart", "onDragover", "onDrop"])
|
|
582
|
-
]),
|
|
583
|
-
_: 1
|
|
584
|
-
}, 8, ["items", "get-key", "onSelect"]))
|
|
585
|
-
];
|
|
586
|
-
}
|
|
587
|
-
}),
|
|
588
|
-
_: 1
|
|
589
|
-
}, _parent));
|
|
153
|
+
const _component_UInput = _sfc_main$9;
|
|
154
|
+
const _component_UButton = _sfc_main$8$1;
|
|
155
|
+
_push(`<!--[-->`);
|
|
590
156
|
_push(ssrRenderComponent(_component_UModal, {
|
|
591
|
-
open:
|
|
592
|
-
"onUpdate:open": ($event) =>
|
|
157
|
+
open: showNewFile.value,
|
|
158
|
+
"onUpdate:open": ($event) => showNewFile.value = $event
|
|
593
159
|
}, {
|
|
594
160
|
content: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
595
161
|
if (_push2) {
|
|
@@ -620,7 +186,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
620
186
|
_push3(ssrRenderComponent(_component_UButton, {
|
|
621
187
|
color: "neutral",
|
|
622
188
|
variant: "ghost",
|
|
623
|
-
onClick: ($event) =>
|
|
189
|
+
onClick: ($event) => showNewFile.value = false
|
|
624
190
|
}, {
|
|
625
191
|
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
626
192
|
if (_push4) {
|
|
@@ -652,7 +218,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
652
218
|
createVNode(_component_UButton, {
|
|
653
219
|
color: "neutral",
|
|
654
220
|
variant: "ghost",
|
|
655
|
-
onClick: ($event) =>
|
|
221
|
+
onClick: ($event) => showNewFile.value = false
|
|
656
222
|
}, {
|
|
657
223
|
default: withCtx(() => [
|
|
658
224
|
createTextVNode(" Cancel ")
|
|
@@ -709,7 +275,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
709
275
|
createVNode(_component_UButton, {
|
|
710
276
|
color: "neutral",
|
|
711
277
|
variant: "ghost",
|
|
712
|
-
onClick: ($event) =>
|
|
278
|
+
onClick: ($event) => showNewFile.value = false
|
|
713
279
|
}, {
|
|
714
280
|
default: withCtx(() => [
|
|
715
281
|
createTextVNode(" Cancel ")
|
|
@@ -741,8 +307,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
741
307
|
_: 1
|
|
742
308
|
}, _parent));
|
|
743
309
|
_push(ssrRenderComponent(_component_UModal, {
|
|
744
|
-
open:
|
|
745
|
-
"onUpdate:open": ($event) =>
|
|
310
|
+
open: showNewFolder.value,
|
|
311
|
+
"onUpdate:open": ($event) => showNewFolder.value = $event
|
|
746
312
|
}, {
|
|
747
313
|
content: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
748
314
|
if (_push2) {
|
|
@@ -773,7 +339,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
773
339
|
_push3(ssrRenderComponent(_component_UButton, {
|
|
774
340
|
color: "neutral",
|
|
775
341
|
variant: "ghost",
|
|
776
|
-
onClick: ($event) =>
|
|
342
|
+
onClick: ($event) => showNewFolder.value = false
|
|
777
343
|
}, {
|
|
778
344
|
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
779
345
|
if (_push4) {
|
|
@@ -805,7 +371,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
805
371
|
createVNode(_component_UButton, {
|
|
806
372
|
color: "neutral",
|
|
807
373
|
variant: "ghost",
|
|
808
|
-
onClick: ($event) =>
|
|
374
|
+
onClick: ($event) => showNewFolder.value = false
|
|
809
375
|
}, {
|
|
810
376
|
default: withCtx(() => [
|
|
811
377
|
createTextVNode(" Cancel ")
|
|
@@ -862,7 +428,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
862
428
|
createVNode(_component_UButton, {
|
|
863
429
|
color: "neutral",
|
|
864
430
|
variant: "ghost",
|
|
865
|
-
onClick: ($event) =>
|
|
431
|
+
onClick: ($event) => showNewFolder.value = false
|
|
866
432
|
}, {
|
|
867
433
|
default: withCtx(() => [
|
|
868
434
|
createTextVNode(" Cancel ")
|
|
@@ -894,8 +460,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
894
460
|
_: 1
|
|
895
461
|
}, _parent));
|
|
896
462
|
_push(ssrRenderComponent(_component_UModal, {
|
|
897
|
-
open:
|
|
898
|
-
"onUpdate:open": ($event) =>
|
|
463
|
+
open: showRename.value,
|
|
464
|
+
"onUpdate:open": ($event) => showRename.value = $event
|
|
899
465
|
}, {
|
|
900
466
|
content: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
901
467
|
if (_push2) {
|
|
@@ -926,7 +492,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
926
492
|
_push3(ssrRenderComponent(_component_UButton, {
|
|
927
493
|
color: "neutral",
|
|
928
494
|
variant: "ghost",
|
|
929
|
-
onClick: ($event) =>
|
|
495
|
+
onClick: ($event) => showRename.value = false
|
|
930
496
|
}, {
|
|
931
497
|
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
932
498
|
if (_push4) {
|
|
@@ -958,7 +524,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
958
524
|
createVNode(_component_UButton, {
|
|
959
525
|
color: "neutral",
|
|
960
526
|
variant: "ghost",
|
|
961
|
-
onClick: ($event) =>
|
|
527
|
+
onClick: ($event) => showRename.value = false
|
|
962
528
|
}, {
|
|
963
529
|
default: withCtx(() => [
|
|
964
530
|
createTextVNode(" Cancel ")
|
|
@@ -1015,7 +581,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1015
581
|
createVNode(_component_UButton, {
|
|
1016
582
|
color: "neutral",
|
|
1017
583
|
variant: "ghost",
|
|
1018
|
-
onClick: ($event) =>
|
|
584
|
+
onClick: ($event) => showRename.value = false
|
|
1019
585
|
}, {
|
|
1020
586
|
default: withCtx(() => [
|
|
1021
587
|
createTextVNode(" Cancel ")
|
|
@@ -1047,8 +613,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1047
613
|
_: 1
|
|
1048
614
|
}, _parent));
|
|
1049
615
|
_push(ssrRenderComponent(_component_UModal, {
|
|
1050
|
-
open:
|
|
1051
|
-
"onUpdate:open": ($event) =>
|
|
616
|
+
open: showDelete.value,
|
|
617
|
+
"onUpdate:open": ($event) => showDelete.value = $event
|
|
1052
618
|
}, {
|
|
1053
619
|
content: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1054
620
|
if (_push2) {
|
|
@@ -1079,7 +645,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1079
645
|
_push3(ssrRenderComponent(_component_UButton, {
|
|
1080
646
|
color: "neutral",
|
|
1081
647
|
variant: "ghost",
|
|
1082
|
-
onClick: ($event) =>
|
|
648
|
+
onClick: ($event) => showDelete.value = false
|
|
1083
649
|
}, {
|
|
1084
650
|
default: withCtx((_3, _push4, _parent4, _scopeId3) => {
|
|
1085
651
|
if (_push4) {
|
|
@@ -1114,7 +680,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1114
680
|
createVNode(_component_UButton, {
|
|
1115
681
|
color: "neutral",
|
|
1116
682
|
variant: "ghost",
|
|
1117
|
-
onClick: ($event) =>
|
|
683
|
+
onClick: ($event) => showDelete.value = false
|
|
1118
684
|
}, {
|
|
1119
685
|
default: withCtx(() => [
|
|
1120
686
|
createTextVNode(" Cancel ")
|
|
@@ -1136,81 +702,587 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
1136
702
|
}),
|
|
1137
703
|
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
1138
704
|
if (_push3) {
|
|
1139
|
-
_push3(`<p${_scopeId2}> Are you sure you want to delete <strong${_scopeId2}>${ssrInterpolate(
|
|
1140
|
-
if (
|
|
705
|
+
_push3(`<p${_scopeId2}> Are you sure you want to delete <strong${_scopeId2}>${ssrInterpolate(__props.contextTarget?.label)}</strong>? </p>`);
|
|
706
|
+
if (__props.contextTarget?.type === "directory") {
|
|
1141
707
|
_push3(`<p class="text-sm text-dimmed mt-1"${_scopeId2}> This will delete all files and folders inside. </p>`);
|
|
1142
708
|
} else {
|
|
1143
|
-
_push3(`<!---->`);
|
|
709
|
+
_push3(`<!---->`);
|
|
710
|
+
}
|
|
711
|
+
} else {
|
|
712
|
+
return [
|
|
713
|
+
createVNode("p", null, [
|
|
714
|
+
createTextVNode(" Are you sure you want to delete "),
|
|
715
|
+
createVNode("strong", null, toDisplayString(__props.contextTarget?.label), 1),
|
|
716
|
+
createTextVNode("? ")
|
|
717
|
+
]),
|
|
718
|
+
__props.contextTarget?.type === "directory" ? (openBlock(), createBlock("p", {
|
|
719
|
+
key: 0,
|
|
720
|
+
class: "text-sm text-dimmed mt-1"
|
|
721
|
+
}, " This will delete all files and folders inside. ")) : createCommentVNode("", true)
|
|
722
|
+
];
|
|
723
|
+
}
|
|
724
|
+
}),
|
|
725
|
+
_: 1
|
|
726
|
+
}, _parent2, _scopeId));
|
|
727
|
+
} else {
|
|
728
|
+
return [
|
|
729
|
+
createVNode(_component_UCard, null, {
|
|
730
|
+
header: withCtx(() => [
|
|
731
|
+
createVNode("div", { class: "flex items-center gap-2 text-error" }, [
|
|
732
|
+
createVNode(_component_UIcon, {
|
|
733
|
+
name: "i-lucide-trash-2",
|
|
734
|
+
class: "size-5"
|
|
735
|
+
}),
|
|
736
|
+
createVNode("span", { class: "font-semibold" }, "Delete")
|
|
737
|
+
])
|
|
738
|
+
]),
|
|
739
|
+
footer: withCtx(() => [
|
|
740
|
+
createVNode("div", { class: "flex justify-end gap-2" }, [
|
|
741
|
+
createVNode(_component_UButton, {
|
|
742
|
+
color: "neutral",
|
|
743
|
+
variant: "ghost",
|
|
744
|
+
onClick: ($event) => showDelete.value = false
|
|
745
|
+
}, {
|
|
746
|
+
default: withCtx(() => [
|
|
747
|
+
createTextVNode(" Cancel ")
|
|
748
|
+
]),
|
|
749
|
+
_: 1
|
|
750
|
+
}, 8, ["onClick"]),
|
|
751
|
+
createVNode(_component_UButton, {
|
|
752
|
+
color: "error",
|
|
753
|
+
onClick: handleDelete
|
|
754
|
+
}, {
|
|
755
|
+
default: withCtx(() => [
|
|
756
|
+
createTextVNode(" Delete ")
|
|
757
|
+
]),
|
|
758
|
+
_: 1
|
|
759
|
+
})
|
|
760
|
+
])
|
|
761
|
+
]),
|
|
762
|
+
default: withCtx(() => [
|
|
763
|
+
createVNode("p", null, [
|
|
764
|
+
createTextVNode(" Are you sure you want to delete "),
|
|
765
|
+
createVNode("strong", null, toDisplayString(__props.contextTarget?.label), 1),
|
|
766
|
+
createTextVNode("? ")
|
|
767
|
+
]),
|
|
768
|
+
__props.contextTarget?.type === "directory" ? (openBlock(), createBlock("p", {
|
|
769
|
+
key: 0,
|
|
770
|
+
class: "text-sm text-dimmed mt-1"
|
|
771
|
+
}, " This will delete all files and folders inside. ")) : createCommentVNode("", true)
|
|
772
|
+
]),
|
|
773
|
+
_: 1
|
|
774
|
+
})
|
|
775
|
+
];
|
|
776
|
+
}
|
|
777
|
+
}),
|
|
778
|
+
_: 1
|
|
779
|
+
}, _parent));
|
|
780
|
+
_push(`<!--]-->`);
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
785
|
+
_sfc_main$5.setup = (props, ctx) => {
|
|
786
|
+
const ssrContext = useSSRContext();
|
|
787
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/files/FileTreeModals.vue");
|
|
788
|
+
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
789
|
+
};
|
|
790
|
+
const __nuxt_component_5 = Object.assign(_sfc_main$5, { __name: "FilesFileTreeModals" });
|
|
791
|
+
function useFileTree() {
|
|
792
|
+
const items = ref([]);
|
|
793
|
+
const selectedFile = ref(null);
|
|
794
|
+
const loading = ref(false);
|
|
795
|
+
const error = ref(null);
|
|
796
|
+
const searchQuery = ref("");
|
|
797
|
+
function fileEntryToTreeItem(entry, expandRoot = false) {
|
|
798
|
+
const icon = entry.type === "directory" ? void 0 : getFileIcon(entry.name);
|
|
799
|
+
return {
|
|
800
|
+
id: entry.path,
|
|
801
|
+
label: entry.name,
|
|
802
|
+
icon,
|
|
803
|
+
path: entry.path,
|
|
804
|
+
type: entry.type,
|
|
805
|
+
defaultExpanded: expandRoot,
|
|
806
|
+
children: entry.children?.map((child) => fileEntryToTreeItem(child))
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function getFileIcon(filename) {
|
|
810
|
+
const ext = filename.split(".").pop()?.toLowerCase();
|
|
811
|
+
switch (ext) {
|
|
812
|
+
case "md":
|
|
813
|
+
return "i-lucide-file-text";
|
|
814
|
+
case "ts":
|
|
815
|
+
case "tsx":
|
|
816
|
+
return "i-lucide-file-code";
|
|
817
|
+
case "js":
|
|
818
|
+
case "jsx":
|
|
819
|
+
return "i-lucide-file-code";
|
|
820
|
+
case "vue":
|
|
821
|
+
return "i-lucide-file-code";
|
|
822
|
+
case "json":
|
|
823
|
+
return "i-lucide-file-json";
|
|
824
|
+
case "css":
|
|
825
|
+
case "scss":
|
|
826
|
+
return "i-lucide-file-code";
|
|
827
|
+
case "png":
|
|
828
|
+
case "jpg":
|
|
829
|
+
case "jpeg":
|
|
830
|
+
case "gif":
|
|
831
|
+
case "svg":
|
|
832
|
+
return "i-lucide-file-image";
|
|
833
|
+
default:
|
|
834
|
+
return "i-lucide-file";
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
async function loadTree(path = "/") {
|
|
838
|
+
loading.value = true;
|
|
839
|
+
error.value = null;
|
|
840
|
+
try {
|
|
841
|
+
const response = await $fetch("/api/fs/list", {
|
|
842
|
+
query: { path, recursive: "true" }
|
|
843
|
+
});
|
|
844
|
+
items.value = response.data.map((entry) => fileEntryToTreeItem(entry, true));
|
|
845
|
+
} catch (e) {
|
|
846
|
+
error.value = "Failed to load file tree";
|
|
847
|
+
console.error("Failed to load file tree:", e);
|
|
848
|
+
} finally {
|
|
849
|
+
loading.value = false;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
async function readFile(path) {
|
|
853
|
+
try {
|
|
854
|
+
const response = await $fetch("/api/fs/read", {
|
|
855
|
+
method: "POST",
|
|
856
|
+
body: { path }
|
|
857
|
+
});
|
|
858
|
+
return response.data;
|
|
859
|
+
} catch (e) {
|
|
860
|
+
console.error("Failed to read file:", e);
|
|
861
|
+
throw e;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
async function writeFile(path, content) {
|
|
865
|
+
try {
|
|
866
|
+
const response = await $fetch("/api/fs/write", {
|
|
867
|
+
method: "POST",
|
|
868
|
+
body: { path, content }
|
|
869
|
+
});
|
|
870
|
+
return response.data;
|
|
871
|
+
} catch (e) {
|
|
872
|
+
console.error("Failed to write file:", e);
|
|
873
|
+
throw e;
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
async function createFile(parentPath, filename) {
|
|
877
|
+
const path = parentPath === "/" ? `/${filename}` : `${parentPath}/${filename}`;
|
|
878
|
+
await writeFile(path, "");
|
|
879
|
+
await loadTree();
|
|
880
|
+
return path;
|
|
881
|
+
}
|
|
882
|
+
async function createFolder(parentPath, foldername) {
|
|
883
|
+
const path = parentPath === "/" ? `/${foldername}` : `${parentPath}/${foldername}`;
|
|
884
|
+
try {
|
|
885
|
+
await $fetch("/api/fs/mkdir", {
|
|
886
|
+
method: "POST",
|
|
887
|
+
body: { path }
|
|
888
|
+
});
|
|
889
|
+
await loadTree();
|
|
890
|
+
return path;
|
|
891
|
+
} catch (e) {
|
|
892
|
+
console.error("Failed to create folder:", e);
|
|
893
|
+
throw e;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
async function renameItem(oldPath, newName) {
|
|
897
|
+
const parts = oldPath.split("/");
|
|
898
|
+
parts.pop();
|
|
899
|
+
const newPath = [...parts, newName].join("/");
|
|
900
|
+
try {
|
|
901
|
+
await $fetch("/api/fs/rename", {
|
|
902
|
+
method: "POST",
|
|
903
|
+
body: { oldPath, newPath }
|
|
904
|
+
});
|
|
905
|
+
await loadTree();
|
|
906
|
+
return newPath;
|
|
907
|
+
} catch (e) {
|
|
908
|
+
console.error("Failed to rename:", e);
|
|
909
|
+
throw e;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
async function deleteItem(path) {
|
|
913
|
+
try {
|
|
914
|
+
await $fetch("/api/fs/delete", {
|
|
915
|
+
method: "POST",
|
|
916
|
+
body: { path }
|
|
917
|
+
});
|
|
918
|
+
if (selectedFile.value === path) {
|
|
919
|
+
selectedFile.value = null;
|
|
920
|
+
}
|
|
921
|
+
await loadTree();
|
|
922
|
+
} catch (e) {
|
|
923
|
+
console.error("Failed to delete:", e);
|
|
924
|
+
throw e;
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
async function moveItem(sourcePath, destinationPath) {
|
|
928
|
+
try {
|
|
929
|
+
const response = await $fetch("/api/fs/move", {
|
|
930
|
+
method: "POST",
|
|
931
|
+
body: { sourcePath, destinationPath }
|
|
932
|
+
});
|
|
933
|
+
await loadTree();
|
|
934
|
+
return response.data.newPath;
|
|
935
|
+
} catch (e) {
|
|
936
|
+
console.error("Failed to move:", e);
|
|
937
|
+
throw e;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
const filteredItems = computed(() => {
|
|
941
|
+
if (!searchQuery.value) return items.value;
|
|
942
|
+
const query = searchQuery.value.toLowerCase();
|
|
943
|
+
function filterTree(items2) {
|
|
944
|
+
return items2.reduce((acc, item) => {
|
|
945
|
+
const matches = item.label.toLowerCase().includes(query);
|
|
946
|
+
const filteredChildren = item.children ? filterTree(item.children) : [];
|
|
947
|
+
if (matches || filteredChildren.length > 0) {
|
|
948
|
+
acc.push({
|
|
949
|
+
...item,
|
|
950
|
+
children: filteredChildren.length > 0 ? filteredChildren : item.children,
|
|
951
|
+
defaultExpanded: filteredChildren.length > 0 || matches
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
return acc;
|
|
955
|
+
}, []);
|
|
956
|
+
}
|
|
957
|
+
return filterTree(items.value);
|
|
958
|
+
});
|
|
959
|
+
return {
|
|
960
|
+
items,
|
|
961
|
+
filteredItems,
|
|
962
|
+
selectedFile,
|
|
963
|
+
loading,
|
|
964
|
+
error,
|
|
965
|
+
searchQuery,
|
|
966
|
+
loadTree,
|
|
967
|
+
readFile,
|
|
968
|
+
writeFile,
|
|
969
|
+
createFile,
|
|
970
|
+
createFolder,
|
|
971
|
+
renameItem,
|
|
972
|
+
deleteItem,
|
|
973
|
+
moveItem
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
977
|
+
__name: "FileTree",
|
|
978
|
+
__ssrInlineRender: true,
|
|
979
|
+
emits: ["select"],
|
|
980
|
+
setup(__props, { emit: __emit }) {
|
|
981
|
+
const emit = __emit;
|
|
982
|
+
const {
|
|
983
|
+
filteredItems,
|
|
984
|
+
selectedFile,
|
|
985
|
+
loading,
|
|
986
|
+
searchQuery,
|
|
987
|
+
createFile,
|
|
988
|
+
createFolder,
|
|
989
|
+
renameItem,
|
|
990
|
+
deleteItem,
|
|
991
|
+
moveItem
|
|
992
|
+
} = useFileTree();
|
|
993
|
+
const draggedItem = ref(null);
|
|
994
|
+
const dropTarget = ref(null);
|
|
995
|
+
function handleDragStart(event, item) {
|
|
996
|
+
draggedItem.value = item;
|
|
997
|
+
if (event.dataTransfer) {
|
|
998
|
+
event.dataTransfer.effectAllowed = "move";
|
|
999
|
+
event.dataTransfer.setData("text/plain", item.path);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
function handleDragOver(event, item) {
|
|
1003
|
+
if (!draggedItem.value) return;
|
|
1004
|
+
if (item.type !== "directory") return;
|
|
1005
|
+
if (draggedItem.value.path === item.path) return;
|
|
1006
|
+
if (item.path.startsWith(draggedItem.value.path + "/")) return;
|
|
1007
|
+
event.preventDefault();
|
|
1008
|
+
dropTarget.value = item;
|
|
1009
|
+
}
|
|
1010
|
+
function handleDragLeave() {
|
|
1011
|
+
dropTarget.value = null;
|
|
1012
|
+
}
|
|
1013
|
+
function handleDragEnd() {
|
|
1014
|
+
draggedItem.value = null;
|
|
1015
|
+
dropTarget.value = null;
|
|
1016
|
+
}
|
|
1017
|
+
async function handleDrop(event, item) {
|
|
1018
|
+
event.preventDefault();
|
|
1019
|
+
if (!draggedItem.value || item.type !== "directory") return;
|
|
1020
|
+
try {
|
|
1021
|
+
await moveItem(draggedItem.value.path, item.path);
|
|
1022
|
+
} catch {
|
|
1023
|
+
}
|
|
1024
|
+
draggedItem.value = null;
|
|
1025
|
+
dropTarget.value = null;
|
|
1026
|
+
}
|
|
1027
|
+
const contextMenuTarget = ref(null);
|
|
1028
|
+
const showNewFileModal = ref(false);
|
|
1029
|
+
const showNewFolderModal = ref(false);
|
|
1030
|
+
const showRenameModal = ref(false);
|
|
1031
|
+
const showDeleteConfirm = ref(false);
|
|
1032
|
+
const contextMenuItems = computed(() => [
|
|
1033
|
+
[{
|
|
1034
|
+
label: "New File",
|
|
1035
|
+
icon: "i-lucide-file-plus",
|
|
1036
|
+
onSelect: () => {
|
|
1037
|
+
showNewFileModal.value = true;
|
|
1038
|
+
}
|
|
1039
|
+
}, {
|
|
1040
|
+
label: "New Folder",
|
|
1041
|
+
icon: "i-lucide-folder-plus",
|
|
1042
|
+
onSelect: () => {
|
|
1043
|
+
showNewFolderModal.value = true;
|
|
1044
|
+
}
|
|
1045
|
+
}],
|
|
1046
|
+
[{
|
|
1047
|
+
label: "Rename",
|
|
1048
|
+
icon: "i-lucide-pencil",
|
|
1049
|
+
onSelect: () => {
|
|
1050
|
+
if (contextMenuTarget.value)
|
|
1051
|
+
showRenameModal.value = true;
|
|
1052
|
+
}
|
|
1053
|
+
}, {
|
|
1054
|
+
label: "Delete",
|
|
1055
|
+
icon: "i-lucide-trash-2",
|
|
1056
|
+
color: "error",
|
|
1057
|
+
onSelect: () => {
|
|
1058
|
+
showDeleteConfirm.value = true;
|
|
1059
|
+
}
|
|
1060
|
+
}]
|
|
1061
|
+
]);
|
|
1062
|
+
function handleSelect(item) {
|
|
1063
|
+
if (item.type === "file") {
|
|
1064
|
+
selectedFile.value = item.path;
|
|
1065
|
+
emit("select", item.path);
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
async function handleCreateFile(name) {
|
|
1069
|
+
const parentPath = contextMenuTarget.value?.type === "directory" ? contextMenuTarget.value.path : "/";
|
|
1070
|
+
let filename = name;
|
|
1071
|
+
if (!filename.includes("."))
|
|
1072
|
+
filename += ".md";
|
|
1073
|
+
try {
|
|
1074
|
+
const path = await createFile(parentPath, filename);
|
|
1075
|
+
selectedFile.value = path;
|
|
1076
|
+
emit("select", path);
|
|
1077
|
+
} catch {
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
async function handleCreateFolder(name) {
|
|
1081
|
+
const parentPath = contextMenuTarget.value?.type === "directory" ? contextMenuTarget.value.path : "/";
|
|
1082
|
+
try {
|
|
1083
|
+
await createFolder(parentPath, name);
|
|
1084
|
+
} catch {
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
async function handleRename(name) {
|
|
1088
|
+
if (!contextMenuTarget.value) return;
|
|
1089
|
+
try {
|
|
1090
|
+
await renameItem(contextMenuTarget.value.path, name);
|
|
1091
|
+
} catch {
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
async function handleDelete() {
|
|
1095
|
+
if (!contextMenuTarget.value) return;
|
|
1096
|
+
try {
|
|
1097
|
+
await deleteItem(contextMenuTarget.value.path);
|
|
1098
|
+
} catch {
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return (_ctx, _push, _parent, _attrs) => {
|
|
1102
|
+
const _component_UInput = _sfc_main$9;
|
|
1103
|
+
const _component_USeparator = _sfc_main$a;
|
|
1104
|
+
const _component_UContextMenu = _sfc_main$1$2;
|
|
1105
|
+
const _component_UIcon = _sfc_main$d;
|
|
1106
|
+
const _component_UTree = _sfc_main$b;
|
|
1107
|
+
const _component_FilesFileTreeModals = __nuxt_component_5;
|
|
1108
|
+
_push(`<div${ssrRenderAttrs(mergeProps({ class: "h-full flex flex-col" }, _attrs))}><div class="-mt-1 pb-2">`);
|
|
1109
|
+
_push(ssrRenderComponent(_component_UInput, {
|
|
1110
|
+
modelValue: unref(searchQuery),
|
|
1111
|
+
"onUpdate:modelValue": ($event) => isRef(searchQuery) ? searchQuery.value = $event : null,
|
|
1112
|
+
placeholder: "Search files...",
|
|
1113
|
+
icon: "i-lucide-search",
|
|
1114
|
+
size: "sm",
|
|
1115
|
+
class: "w-full"
|
|
1116
|
+
}, null, _parent));
|
|
1117
|
+
_push(`</div>`);
|
|
1118
|
+
_push(ssrRenderComponent(_component_USeparator, { class: "mt-2" }, null, _parent));
|
|
1119
|
+
_push(ssrRenderComponent(_component_UContextMenu, {
|
|
1120
|
+
items: unref(contextMenuItems),
|
|
1121
|
+
class: "flex-1 h-full overflow-auto p-2",
|
|
1122
|
+
onContextmenu: ($event) => contextMenuTarget.value = null
|
|
1123
|
+
}, {
|
|
1124
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
1125
|
+
if (_push2) {
|
|
1126
|
+
if (unref(loading)) {
|
|
1127
|
+
_push2(`<div class="flex items-center justify-center py-8"${_scopeId}>`);
|
|
1128
|
+
_push2(ssrRenderComponent(_component_UIcon, {
|
|
1129
|
+
name: "i-lucide-loader-2",
|
|
1130
|
+
class: "size-6 animate-spin text-dimmed"
|
|
1131
|
+
}, null, _parent2, _scopeId));
|
|
1132
|
+
_push2(`</div>`);
|
|
1133
|
+
} else if (unref(filteredItems).length === 0) {
|
|
1134
|
+
_push2(`<div class="h-full min-h-32 flex flex-col items-center justify-center text-dimmed text-sm"${_scopeId}>`);
|
|
1135
|
+
_push2(ssrRenderComponent(_component_UIcon, {
|
|
1136
|
+
name: "i-lucide-folder-open",
|
|
1137
|
+
class: "size-8 mx-auto mb-2 opacity-50"
|
|
1138
|
+
}, null, _parent2, _scopeId));
|
|
1139
|
+
_push2(`<p${_scopeId}>No files found</p><p class="text-xs mt-1"${_scopeId}> Right-click to create a file </p></div>`);
|
|
1140
|
+
} else {
|
|
1141
|
+
_push2(ssrRenderComponent(_component_UTree, {
|
|
1142
|
+
items: unref(filteredItems),
|
|
1143
|
+
"get-key": (item) => item.id,
|
|
1144
|
+
color: "primary",
|
|
1145
|
+
"expanded-icon": "i-lucide-folder-open",
|
|
1146
|
+
"collapsed-icon": "i-lucide-folder",
|
|
1147
|
+
onSelect: (_e, item) => handleSelect(item)
|
|
1148
|
+
}, {
|
|
1149
|
+
item: withCtx(({ item, expanded }, _push3, _parent3, _scopeId2) => {
|
|
1150
|
+
if (_push3) {
|
|
1151
|
+
_push3(`<div class="${ssrRenderClass([{
|
|
1152
|
+
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
1153
|
+
}, "flex items-center gap-2 w-full"])}" draggable="true"${_scopeId2}>`);
|
|
1154
|
+
if (item.children?.length) {
|
|
1155
|
+
_push3(ssrRenderComponent(_component_UIcon, {
|
|
1156
|
+
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
1157
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1158
|
+
}, null, _parent3, _scopeId2));
|
|
1159
|
+
} else if (item.icon) {
|
|
1160
|
+
_push3(ssrRenderComponent(_component_UIcon, {
|
|
1161
|
+
name: item.icon,
|
|
1162
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1163
|
+
}, null, _parent3, _scopeId2));
|
|
1164
|
+
} else {
|
|
1165
|
+
_push3(ssrRenderComponent(_component_UIcon, {
|
|
1166
|
+
name: "i-lucide-file",
|
|
1167
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1168
|
+
}, null, _parent3, _scopeId2));
|
|
1169
|
+
}
|
|
1170
|
+
_push3(`<span class="truncate"${_scopeId2}>${ssrInterpolate(item.label)}</span></div>`);
|
|
1171
|
+
} else {
|
|
1172
|
+
return [
|
|
1173
|
+
createVNode("div", {
|
|
1174
|
+
class: ["flex items-center gap-2 w-full", {
|
|
1175
|
+
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
1176
|
+
}],
|
|
1177
|
+
draggable: "true",
|
|
1178
|
+
onContextmenu: ($event) => contextMenuTarget.value = item,
|
|
1179
|
+
onDragstart: ($event) => handleDragStart($event, item),
|
|
1180
|
+
onDragover: ($event) => handleDragOver($event, item),
|
|
1181
|
+
onDragleave: handleDragLeave,
|
|
1182
|
+
onDragend: handleDragEnd,
|
|
1183
|
+
onDrop: ($event) => handleDrop($event, item)
|
|
1184
|
+
}, [
|
|
1185
|
+
item.children?.length ? (openBlock(), createBlock(_component_UIcon, {
|
|
1186
|
+
key: 0,
|
|
1187
|
+
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
1188
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1189
|
+
}, null, 8, ["name"])) : item.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
1190
|
+
key: 1,
|
|
1191
|
+
name: item.icon,
|
|
1192
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1193
|
+
}, null, 8, ["name"])) : (openBlock(), createBlock(_component_UIcon, {
|
|
1194
|
+
key: 2,
|
|
1195
|
+
name: "i-lucide-file",
|
|
1196
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1197
|
+
})),
|
|
1198
|
+
createVNode("span", { class: "truncate" }, toDisplayString(item.label), 1)
|
|
1199
|
+
], 42, ["onContextmenu", "onDragstart", "onDragover", "onDrop"])
|
|
1200
|
+
];
|
|
1144
1201
|
}
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
createVNode("strong", null, toDisplayString(unref(contextMenuTarget)?.label), 1),
|
|
1150
|
-
createTextVNode("? ")
|
|
1151
|
-
]),
|
|
1152
|
-
unref(contextMenuTarget)?.type === "directory" ? (openBlock(), createBlock("p", {
|
|
1153
|
-
key: 0,
|
|
1154
|
-
class: "text-sm text-dimmed mt-1"
|
|
1155
|
-
}, " This will delete all files and folders inside. ")) : createCommentVNode("", true)
|
|
1156
|
-
];
|
|
1157
|
-
}
|
|
1158
|
-
}),
|
|
1159
|
-
_: 1
|
|
1160
|
-
}, _parent2, _scopeId));
|
|
1202
|
+
}),
|
|
1203
|
+
_: 1
|
|
1204
|
+
}, _parent2, _scopeId));
|
|
1205
|
+
}
|
|
1161
1206
|
} else {
|
|
1162
1207
|
return [
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1208
|
+
unref(loading) ? (openBlock(), createBlock("div", {
|
|
1209
|
+
key: 0,
|
|
1210
|
+
class: "flex items-center justify-center py-8"
|
|
1211
|
+
}, [
|
|
1212
|
+
createVNode(_component_UIcon, {
|
|
1213
|
+
name: "i-lucide-loader-2",
|
|
1214
|
+
class: "size-6 animate-spin text-dimmed"
|
|
1215
|
+
})
|
|
1216
|
+
])) : unref(filteredItems).length === 0 ? (openBlock(), createBlock("div", {
|
|
1217
|
+
key: 1,
|
|
1218
|
+
class: "h-full min-h-32 flex flex-col items-center justify-center text-dimmed text-sm"
|
|
1219
|
+
}, [
|
|
1220
|
+
createVNode(_component_UIcon, {
|
|
1221
|
+
name: "i-lucide-folder-open",
|
|
1222
|
+
class: "size-8 mx-auto mb-2 opacity-50"
|
|
1223
|
+
}),
|
|
1224
|
+
createVNode("p", null, "No files found"),
|
|
1225
|
+
createVNode("p", { class: "text-xs mt-1" }, " Right-click to create a file ")
|
|
1226
|
+
])) : (openBlock(), createBlock(_component_UTree, {
|
|
1227
|
+
key: 2,
|
|
1228
|
+
items: unref(filteredItems),
|
|
1229
|
+
"get-key": (item) => item.id,
|
|
1230
|
+
color: "primary",
|
|
1231
|
+
"expanded-icon": "i-lucide-folder-open",
|
|
1232
|
+
"collapsed-icon": "i-lucide-folder",
|
|
1233
|
+
onSelect: (_e, item) => handleSelect(item)
|
|
1234
|
+
}, {
|
|
1235
|
+
item: withCtx(({ item, expanded }) => [
|
|
1236
|
+
createVNode("div", {
|
|
1237
|
+
class: ["flex items-center gap-2 w-full", {
|
|
1238
|
+
"bg-primary/10 rounded": unref(dropTarget)?.path === item.path
|
|
1239
|
+
}],
|
|
1240
|
+
draggable: "true",
|
|
1241
|
+
onContextmenu: ($event) => contextMenuTarget.value = item,
|
|
1242
|
+
onDragstart: ($event) => handleDragStart($event, item),
|
|
1243
|
+
onDragover: ($event) => handleDragOver($event, item),
|
|
1244
|
+
onDragleave: handleDragLeave,
|
|
1245
|
+
onDragend: handleDragEnd,
|
|
1246
|
+
onDrop: ($event) => handleDrop($event, item)
|
|
1247
|
+
}, [
|
|
1248
|
+
item.children?.length ? (openBlock(), createBlock(_component_UIcon, {
|
|
1249
|
+
key: 0,
|
|
1250
|
+
name: expanded ? "i-lucide-folder-open" : "i-lucide-folder",
|
|
1251
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1252
|
+
}, null, 8, ["name"])) : item.icon ? (openBlock(), createBlock(_component_UIcon, {
|
|
1253
|
+
key: 1,
|
|
1254
|
+
name: item.icon,
|
|
1255
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1256
|
+
}, null, 8, ["name"])) : (openBlock(), createBlock(_component_UIcon, {
|
|
1257
|
+
key: 2,
|
|
1258
|
+
name: "i-lucide-file",
|
|
1259
|
+
class: "size-4 shrink-0 text-dimmed"
|
|
1260
|
+
})),
|
|
1261
|
+
createVNode("span", { class: "truncate" }, toDisplayString(item.label), 1)
|
|
1262
|
+
], 42, ["onContextmenu", "onDragstart", "onDragover", "onDrop"])
|
|
1206
1263
|
]),
|
|
1207
1264
|
_: 1
|
|
1208
|
-
})
|
|
1265
|
+
}, 8, ["items", "get-key", "onSelect"]))
|
|
1209
1266
|
];
|
|
1210
1267
|
}
|
|
1211
1268
|
}),
|
|
1212
1269
|
_: 1
|
|
1213
1270
|
}, _parent));
|
|
1271
|
+
_push(ssrRenderComponent(_component_FilesFileTreeModals, {
|
|
1272
|
+
"show-new-file": unref(showNewFileModal),
|
|
1273
|
+
"onUpdate:showNewFile": ($event) => isRef(showNewFileModal) ? showNewFileModal.value = $event : null,
|
|
1274
|
+
"show-new-folder": unref(showNewFolderModal),
|
|
1275
|
+
"onUpdate:showNewFolder": ($event) => isRef(showNewFolderModal) ? showNewFolderModal.value = $event : null,
|
|
1276
|
+
"show-rename": unref(showRenameModal),
|
|
1277
|
+
"onUpdate:showRename": ($event) => isRef(showRenameModal) ? showRenameModal.value = $event : null,
|
|
1278
|
+
"show-delete": unref(showDeleteConfirm),
|
|
1279
|
+
"onUpdate:showDelete": ($event) => isRef(showDeleteConfirm) ? showDeleteConfirm.value = $event : null,
|
|
1280
|
+
"context-target": unref(contextMenuTarget),
|
|
1281
|
+
onCreateFile: handleCreateFile,
|
|
1282
|
+
onCreateFolder: handleCreateFolder,
|
|
1283
|
+
onRename: handleRename,
|
|
1284
|
+
onDelete: handleDelete
|
|
1285
|
+
}, null, _parent));
|
|
1214
1286
|
_push(`</div>`);
|
|
1215
1287
|
};
|
|
1216
1288
|
}
|
|
@@ -1271,7 +1343,7 @@ const _sfc_main$3 = {
|
|
|
1271
1343
|
} });
|
|
1272
1344
|
const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.dashboardSidebarCollapse || {} }));
|
|
1273
1345
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1274
|
-
_push(ssrRenderComponent(_sfc_main$8, mergeProps({
|
|
1346
|
+
_push(ssrRenderComponent(_sfc_main$8$1, mergeProps({
|
|
1275
1347
|
...unref(buttonProps),
|
|
1276
1348
|
"icon": props.icon || (unref(sidebarCollapsed) ? unref(appConfig).ui.icons.panelOpen : unref(appConfig).ui.icons.panelClose),
|
|
1277
1349
|
"aria-label": unref(sidebarCollapsed) ? unref(t)("dashboardSidebarCollapse.expand") : unref(t)("dashboardSidebarCollapse.collapse"),
|
|
@@ -1636,14 +1708,14 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1636
1708
|
}
|
|
1637
1709
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1638
1710
|
const _component_UIcon = _sfc_main$d;
|
|
1639
|
-
const _component_USwitch = _sfc_main$
|
|
1640
|
-
const _component_UButton = _sfc_main$8;
|
|
1711
|
+
const _component_USwitch = _sfc_main$c;
|
|
1712
|
+
const _component_UButton = _sfc_main$8$1;
|
|
1641
1713
|
const _component_EditorDocumentMetadata = __nuxt_component_3;
|
|
1642
1714
|
const _component_UEditor = _sfc_main$1$3;
|
|
1643
|
-
const _component_UEditorToolbar = _sfc_main$
|
|
1715
|
+
const _component_UEditorToolbar = _sfc_main$e;
|
|
1644
1716
|
const _component_ClientOnly = __nuxt_component_3$1;
|
|
1645
|
-
const _component_EditorCodeEditorFallback = __nuxt_component_5;
|
|
1646
|
-
const _component_UModal = _sfc_main$
|
|
1717
|
+
const _component_EditorCodeEditorFallback = __nuxt_component_5$1;
|
|
1718
|
+
const _component_UModal = _sfc_main$f;
|
|
1647
1719
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "h-full flex flex-col" }, _attrs))}><div class="border-b border-default py-2 flex items-center justify-between"><div class="flex items-center gap-2 text-sm text-dimmed min-w-0">`);
|
|
1648
1720
|
_push(ssrRenderComponent(_component_UIcon, {
|
|
1649
1721
|
name: "i-lucide-file-text",
|
|
@@ -1975,11 +2047,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1975
2047
|
return (_ctx, _push, _parent, _attrs) => {
|
|
1976
2048
|
const _component_UDashboardPanel = _sfc_main$1$1;
|
|
1977
2049
|
const _component_FilesFileTree = __nuxt_component_1;
|
|
1978
|
-
const _component_UDashboardNavbar = _sfc_main$
|
|
2050
|
+
const _component_UDashboardNavbar = _sfc_main$6;
|
|
1979
2051
|
const _component_UDashboardSidebarCollapse = _sfc_main$3;
|
|
1980
|
-
const _component_UColorModeButton = _sfc_main$
|
|
1981
|
-
const _component_UDrawer = _sfc_main$
|
|
1982
|
-
const _component_UButton = _sfc_main$8;
|
|
2052
|
+
const _component_UColorModeButton = _sfc_main$7;
|
|
2053
|
+
const _component_UDrawer = _sfc_main$8;
|
|
2054
|
+
const _component_UButton = _sfc_main$8$1;
|
|
1983
2055
|
const _component_UIcon = _sfc_main$d;
|
|
1984
2056
|
const _component_EditorDocumentEditor = __nuxt_component_8;
|
|
1985
2057
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "flex flex-1 min-w-0" }, _attrs))}>`);
|
|
@@ -2203,4 +2275,4 @@ _sfc_main.setup = (props, ctx) => {
|
|
|
2203
2275
|
};
|
|
2204
2276
|
|
|
2205
2277
|
export { _sfc_main as default };
|
|
2206
|
-
//# sourceMappingURL=docs-
|
|
2278
|
+
//# sourceMappingURL=docs-Bwucwp0r.mjs.map
|