@nextclaw/ui 0.15.24 → 0.15.26
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/CHANGELOG.md +39 -0
- package/dist/assets/{abnfDiagram-VRR7QNED-DvTjgVMf.js → abnfDiagram-VRR7QNED-BcFJp_1X.js} +1 -1
- package/dist/assets/{aiden0z-pptx-renderer.es-C1nfBAXR.js → aiden0z-pptx-renderer.es-Dp2ezlQn.js} +1 -1
- package/dist/assets/{api-BxPNDp30.js → api-CK3Fro7z.js} +6 -6
- package/dist/assets/appearance-settings-page-zqwWO8Dy.js +1 -0
- package/dist/assets/{arc-BvhODBXv.js → arc-CkgyPMyW.js} +1 -1
- package/dist/assets/architecture-TIHT7OUA-DO2x53FK.js +1 -0
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-BKO9RgNS.js → architectureDiagram-ZJ3FMSHR-CMd4cIjI.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-DHpDXy7D.js → blockDiagram-677ZJIJ3-Bz3tbhet.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-BG_iQnDr.js → c4Diagram-LMCZKHZV-D9hFNAGv.js} +1 -1
- package/dist/assets/channel-nBvMaVyP.js +1 -0
- package/dist/assets/{channels-list-page-DRaNWAxC.js → channels-list-page-CVCZBlCL.js} +2 -2
- package/dist/assets/chat-page-D4wehRTz.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-CJgqFDS4.js +1 -0
- package/dist/assets/{chunk-32BRIVSS-DR9M0LLx.js → chunk-32BRIVSS-7NrjEITq.js} +1 -1
- package/dist/assets/{chunk-52WLFC77-698iC3BB.js → chunk-52WLFC77-viIcqj9q.js} +1 -1
- package/dist/assets/{chunk-5FCAYU7R-DikTj9Ey.js → chunk-5FCAYU7R-Vsu4J-VM.js} +1 -1
- package/dist/assets/{chunk-5HE753X5-ko0o7_q0.js → chunk-5HE753X5-C-w6CQZK.js} +1 -1
- package/dist/assets/{chunk-5JV3BV7I-CEHufhgo.js → chunk-5JV3BV7I-CuKgJQ4W.js} +1 -1
- package/dist/assets/{chunk-5TONJI2A-CGgno1cu.js → chunk-5TONJI2A-CYeiWZKb.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-DkiB4cUQ.js → chunk-5VM5RSS4-DRCbfwIn.js} +1 -1
- package/dist/assets/{chunk-7BUUIJ7U-DzptcytQ.js → chunk-7BUUIJ7U-BvydOcm3.js} +1 -1
- package/dist/assets/{chunk-BIQX33UG-DMRSQJvT.js → chunk-BIQX33UG-RlppOXKo.js} +1 -1
- package/dist/assets/{chunk-C7G6YPKG-Bw1BwwuY.js → chunk-C7G6YPKG-DAizzYwr.js} +1 -1
- package/dist/assets/{chunk-CQNSW5MT-C0z6eHBk.js → chunk-CQNSW5MT-5eChJHca.js} +1 -1
- package/dist/assets/{chunk-CYSBUYHQ-ByPyAouO.js → chunk-CYSBUYHQ-YHPr53fv.js} +1 -1
- package/dist/assets/{chunk-EMLP6XTP-CJlAXWZg.js → chunk-EMLP6XTP-CK4D7Hz5.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-Dqq4zKJu.js → chunk-EX3LRPZG-BmlDFIRW.js} +1 -1
- package/dist/assets/{chunk-FWX5IMBZ-B0SNoCmi.js → chunk-FWX5IMBZ-D0ksHZZ9.js} +2 -2
- package/dist/assets/{chunk-HOUHSVGY-DG_GJih_.js → chunk-HOUHSVGY-DPkq8FCm.js} +1 -1
- package/dist/assets/{chunk-ICXQ74PX-Drxk_6bE.js → chunk-ICXQ74PX-FAatv5fC.js} +1 -1
- package/dist/assets/{chunk-JG7HCLWE-DdLFPpnd.js → chunk-JG7HCLWE-DLkIi4F7.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-B8M4G76F.js → chunk-JWPE2WC7-DawOjNE3.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-XP6FJHY_.js → chunk-MOJQB5TN-Di52TorW.js} +1 -1
- package/dist/assets/{chunk-MOZMSUNE-C_6x18Qw.js → chunk-MOZMSUNE-PfyK9w1-.js} +1 -1
- package/dist/assets/{chunk-OGEWGWER-N25BzCmG.js → chunk-OGEWGWER-C3jdH3Ty.js} +1 -1
- package/dist/assets/{chunk-OSBZ3O6U-ASDEm7y0.js → chunk-OSBZ3O6U-CecHo-f0.js} +1 -1
- package/dist/assets/{chunk-PUDLZKDR-CTlvAcn7.js → chunk-PUDLZKDR-f3IJh3sN.js} +1 -1
- package/dist/assets/{chunk-Q4XR5HBZ-Da9BWfB6.js → chunk-Q4XR5HBZ-DQFeUPxZ.js} +1 -1
- package/dist/assets/{chunk-QBLGF6JB-Bi6RpTJO.js → chunk-QBLGF6JB-BhUeG0y2.js} +1 -1
- package/dist/assets/{chunk-R7FJI6CG-DkMsSPvK.js → chunk-R7FJI6CG-C3XpZ-2u.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-DZp0eU-j.js → chunk-RYQCIY6F-CAqa5klQ.js} +1 -1
- package/dist/assets/{chunk-U6XO7XAA-vfinDSrj.js → chunk-U6XO7XAA-D_WXezeD.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-C9Nksccs.js → chunk-V7JOEXUC-CZ70oOtp.js} +1 -1
- package/dist/assets/chunk-VAUOI2AC-BGvh3yIx.js +1 -0
- package/dist/assets/{chunk-VR4S4FIN-Xv6zfwXs.js → chunk-VR4S4FIN-B7AHEYYk.js} +1 -1
- package/dist/assets/{chunk-WYO6CB5R-mOJNzbWl.js → chunk-WYO6CB5R-Dn9To_OI.js} +2 -2
- package/dist/assets/chunk-XXDRQBXY-DaBxG5gs.js +1 -0
- package/dist/assets/{chunk-YOTPTUD7-1-aKSu4o.js → chunk-YOTPTUD7-BYEgRBk3.js} +1 -1
- package/dist/assets/{chunk-ZGVPDNZ5-OJ8veMpK.js → chunk-ZGVPDNZ5-C6YtZDU0.js} +1 -1
- package/dist/assets/{chunk-ZIRB5QZD-SR_Nq_PP.js → chunk-ZIRB5QZD-DMuYtnHF.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-P6N03G2R.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-B1_uLvMv.js +1 -0
- package/dist/assets/config-split-page-CceNFvlY.js +1 -0
- package/dist/assets/confirm-dialog-CWeNYWZY.js +5 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-NjVgz2Bw.js → cose-bilkent-JH36ORCC-Bc2Ex5Y3.js} +1 -1
- package/dist/assets/cynefin-VYW2F7L2-B-H8Qp-n.js +1 -0
- package/dist/assets/{cynefinDiagram-TSTJHNR4-B_17LDqD.js → cynefinDiagram-TSTJHNR4-DVysQoGz.js} +1 -1
- package/dist/assets/{dagre-CMe101gk.js → dagre-CMhQ1cAG.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-qo8nLb3B.js → dagre-VKFMJZFB-RYyWpPJZ.js} +1 -1
- package/dist/assets/desktop-update-config-Dirc3bpt.js +1 -0
- package/dist/assets/{diagram-FQU43EPY-Ba3XIklC.js → diagram-FQU43EPY-BD6KONdF.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-CG45TcUx.js → diagram-G47NLZAW-CGB2ptRR.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-2F2HrwV-.js → diagram-NH7WQ7WH-DnkOI6cU.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-CXfWH9NZ.js → diagram-OA4YK3LP-DF82RZ7P.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-CH_4yepc.js → diagram-WEI45ONY-Be2v7Ck9.js} +1 -1
- package/dist/assets/{dist-B4Pf5X3Q.js → dist-AYxkFx2B.js} +1 -1
- package/dist/assets/{dist-DHEWkGWX.js → dist-D9xtGgdL.js} +1 -1
- package/dist/assets/doc-browser-4Sud6dWw.js +1 -0
- package/dist/assets/doc-browser-D4x_yH5F.js +1 -0
- package/dist/assets/doc-browser-context-Cb7Z0j90.js +1 -0
- package/dist/assets/{docx-preview-CoM4JK7_.js → docx-preview-BqwAjrj3.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-BwiG4Ea1.js → ebnfDiagram-CCIWWBDH-CP98OYk8.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-BML3hpnQ.js → erDiagram-Q63AITRT-ZLlx8xfs.js} +1 -1
- package/dist/assets/eventmodeling-45OFAUF4-YVtShyFA.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-BeKXabVO.js +1 -0
- package/dist/assets/form-actions-B2q4jgjE.js +1 -0
- package/dist/assets/{ganttDiagram-NO4QXBWP-80enfWbD.js → ganttDiagram-NO4QXBWP-DXCDjHR2.js} +1 -1
- package/dist/assets/gitGraph-TEB2WS4Q-jTSiBj-p.js +1 -0
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-CVLqXr-b.js → gitGraphDiagram-IHSO6WYX-l2HWrTJp.js} +1 -1
- package/dist/assets/index-CdyTsSBu.css +1 -0
- package/dist/assets/index-Das_bw2h.js +107 -0
- package/dist/assets/info-DKCQHKI2-BIporNWb.js +1 -0
- package/dist/assets/{infoDiagram-FWYZ7A6U-Dyvs2t0i.js → infoDiagram-FWYZ7A6U-D-DjX-bn.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-sSnxDKfh.js → ishikawaDiagram-FXEZZL3T-y_Xy128F.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-D22V71Mf.js → journeyDiagram-5HDEW3XC-DJn5xYcQ.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-D3ds0p-g.js → kanban-definition-HUTT4EX6-DJVIOR21.js} +1 -1
- package/dist/assets/{line-CbyFs065.js → line-Cos7PIOj.js} +1 -1
- package/dist/assets/{linear-4DKtnZBS.js → linear-BtDLqtzF.js} +1 -1
- package/dist/assets/loader-circle-CpmBdaon.js +1 -0
- package/dist/assets/{map-CcZzEoz6.js → map-BKnQyvd0.js} +1 -1
- package/dist/assets/mcp-marketplace-page-CdOY3Sop.js +1 -0
- package/dist/assets/mcp-marketplace-page-DvjrfqEt.js +9 -0
- package/dist/assets/{mermaid-parser.core-DPmMOjXD.js → mermaid-parser.core-XUNZhr2W.js} +2 -2
- package/dist/assets/{mermaid.core-BSf-ddRa.js → mermaid.core-ySrvolIe.js} +3 -3
- package/dist/assets/{mindmap-definition-LN4V7U3C-BUTwWPyx.js → mindmap-definition-LN4V7U3C-BypL9tei.js} +1 -1
- package/dist/assets/model-config-page-DfOLyQqR.js +1 -0
- package/dist/assets/{navigation-link-CAFOcXNg.js → navigation-link-MiiyoIjH.js} +2 -2
- package/dist/assets/{ordinal-BgLYtOZE.js → ordinal-CxxVWxYU.js} +1 -1
- package/dist/assets/packet-7NZHBO7P-CuFMADV0.js +1 -0
- package/dist/assets/{pegDiagram-2B236MQR-BEu_ZBjc.js → pegDiagram-2B236MQR-D-U2KBGv.js} +1 -1
- package/dist/assets/pie-RZYD4A2V-XUeIXhM9.js +1 -0
- package/dist/assets/{pieDiagram-ENE6RG2P-CAwAwuBd.js → pieDiagram-ENE6RG2P-CBi3GusJ.js} +1 -1
- package/dist/assets/plus-C8FkjpSZ.js +1 -0
- package/dist/assets/provider-scoped-model-input-DXzjr5l0.js +1 -0
- package/dist/assets/providers-config-page-CaO8WfZH.js +1 -0
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-CwE6F-_2.js → quadrantDiagram-ABIIQ3AL-H0ZuvnZL.js} +1 -1
- package/dist/assets/radar-I7S5WNFK-D-NNGh1k.js +1 -0
- package/dist/assets/railroad-3IZDKUUU-C67_uDaM.js +1 -0
- package/dist/assets/railroad-abnf-AHOZXSZD-BZ8Yflnd.js +1 -0
- package/dist/assets/railroad-ebnf-EBAXGLYW-B7zO7RoK.js +1 -0
- package/dist/assets/railroad-peg-LSFZ7HO6-R63PTgLz.js +1 -0
- package/dist/assets/{railroadDiagram-RFXS5EU6-xgLekU3B.js → railroadDiagram-RFXS5EU6-D7Y2EqSd.js} +1 -1
- package/dist/assets/react-C8XFFvuz.js +8 -0
- package/dist/assets/{refresh-cw-CWDp_JnN.js → refresh-cw-a2VVeeAF.js} +1 -1
- package/dist/assets/remote-BJHXa4mB.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-CyVUzEX5.js → requirementDiagram-TGXJPOKE-BiXNX1NN.js} +1 -1
- package/dist/assets/rotate-cw-DJ7UF3F2.js +1 -0
- package/dist/assets/runtime-config-page-BuA4A02z.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-JK6bFmYB.js → sankeyDiagram-HTMAVEWB-qzDeLztW.js} +1 -1
- package/dist/assets/{save-Cnr71JON.js → save-CGm23Yww.js} +1 -1
- package/dist/assets/{search-CCX11X2m.js → search-CH2t--sH.js} +1 -1
- package/dist/assets/search-config-page-BAmYqoAz.js +1 -0
- package/dist/assets/secrets-config-page-BlPOuql_.js +3 -0
- package/dist/assets/security-config-CbDiY2xr.js +1 -0
- package/dist/assets/{select-DvwBu99K.js → select-DnxxDpcV.js} +2 -2
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-BR5IokXV.js → sequenceDiagram-DBY2YBRQ-BtRbPQtL.js} +1 -1
- package/dist/assets/{settings-2-Dmv6zMne.js → settings-2-agnMYc8a.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-SxG_YnMA.js → sizeCapture-X5ZJPWSS-CMYvM3SL.js} +1 -1
- package/dist/assets/skeleton-XpqeWL62.js +1 -0
- package/dist/assets/{src-vgz8E_-O.js → src-Bw-mzbQb.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-DD4OoYhn.js → stateDiagram-2N3HPSRC-BJ-mFeOz.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BE-HqxOK.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-BWkFeyCT.js → swimlanes-5IMT3BWC-BsucVOO2.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-Dr1H9LJH.js +8 -0
- package/dist/assets/{tag-chip-gMPvx7n_.js → tag-chip-CPOc8b2N.js} +1 -1
- package/dist/assets/{timeline-definition-FHXFAJF6-VTRPy6KA.js → timeline-definition-FHXFAJF6-Bicewlzo.js} +1 -1
- package/dist/assets/treeView-QDETBFTQ-npJ5dbqS.js +1 -0
- package/dist/assets/treemap-6X3UGDF4-pYrBx6oa.js +1 -0
- package/dist/assets/{vennDiagram-L72KCM5P-Bvk42Pek.js → vennDiagram-L72KCM5P-BxOOnO9x.js} +1 -1
- package/dist/assets/wardley-OPB4EBWU-CmSRKLR8.js +1 -0
- package/dist/assets/{wardleyDiagram-EHGQE667-DOFjx2s3.js → wardleyDiagram-EHGQE667-Cl7NltMv.js} +1 -1
- package/dist/assets/x-odTHAtLZ.js +1 -0
- package/dist/assets/{xychartDiagram-FW5EYKEG-DY5yRTUc.js → xychartDiagram-FW5EYKEG-DiMIxQ7N.js} +1 -1
- package/dist/index.html +21 -22
- package/package.json +8 -8
- package/src/features/apps/components/__tests__/app-packages-panel.test.tsx +234 -0
- package/src/features/apps/components/app-marketplace-dialog.tsx +262 -0
- package/src/features/apps/components/app-package-card.tsx +268 -0
- package/src/features/apps/components/app-packages-panel.tsx +301 -0
- package/src/features/apps/components/apps-panel.tsx +11 -4
- package/src/features/apps/hooks/use-app-marketplace.ts +95 -0
- package/src/features/apps/hooks/use-app-packages.ts +59 -0
- package/src/features/chat/components/chat-sidebar-list-mode-switch.tsx +27 -4
- package/src/features/chat/components/layout/__tests__/chat-sidebar-session-area.test.tsx +36 -5
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +12 -13
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-area.test.tsx +79 -2
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +4 -4
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +26 -5
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +3 -0
- package/src/features/chat/features/conversation/hooks/use-system-object-reference-select.ts +27 -0
- package/src/features/chat/features/conversation/utils/session-message-composer.utils.ts +5 -0
- package/src/features/chat/features/input/hooks/__tests__/use-chat-input-surface-state.test.tsx +102 -0
- package/src/features/chat/features/input/hooks/use-chat-input-surface-state.ts +71 -120
- package/src/features/chat/features/input/input-surface-plugins/__tests__/context-reference-plugin.test.ts +265 -18
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.types.ts +7 -2
- package/src/features/chat/features/input/input-surface-plugins/chat-input-product-plugin-adapters.utils.ts +124 -0
- package/src/features/chat/features/input/input-surface-plugins/context-reference-items.utils.ts +99 -15
- package/src/features/chat/features/input/input-surface-plugins/context-reference-plugin.utils.ts +143 -139
- package/src/features/chat/features/input/input-surface-plugins/panel-app-input-surface-items.utils.ts +116 -0
- package/src/features/chat/features/input/input-surface-plugins/slash-command-plugin.utils.ts +1 -1
- package/src/features/chat/features/input/utils/__tests__/chat-inline-token.utils.test.ts +53 -1
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +5 -0
- package/src/features/chat/features/input/utils/chat-inline-token-composer.utils.ts +134 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +30 -101
- package/src/features/chat/features/input/utils/chat-system-object-reference.utils.test.ts +44 -0
- package/src/features/chat/features/input/utils/chat-system-object-reference.utils.ts +46 -0
- package/src/features/chat/features/ncp/hooks/__tests__/use-hydrated-ncp-agent.test.tsx +40 -3
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.selection.test.tsx +66 -0
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-file-preview.test.tsx +13 -1
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +653 -90
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-text-selection.test.tsx +12 -8
- package/src/features/chat/features/workspace/components/chat-session-workspace-directory-browser.tsx +401 -288
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-breadcrumbs.tsx +54 -35
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +79 -148
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +156 -94
- package/src/features/chat/features/workspace/components/project-files/__tests__/workspace-directory-entry-menu.test.tsx +50 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-entry-menu.tsx +209 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +459 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-new-folder-tree-item.tsx +112 -0
- package/src/features/chat/features/workspace/components/project-files/workspace-project-files-toolbar.tsx +64 -0
- package/src/features/chat/features/workspace/hooks/use-workspace-explorer-layout.ts +85 -0
- package/src/features/chat/features/workspace/hooks/use-workspace-file-actions.ts +357 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-path-mutation.utils.ts +58 -0
- package/src/features/chat/features/workspace/utils/chat-workspace-file-tab.utils.ts +23 -22
- package/src/features/chat/features/workspace/utils/chat-workspace-panel-layout.utils.ts +13 -4
- package/src/features/chat/index.ts +1 -1
- package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +86 -60
- package/src/features/chat/managers/__tests__/chat-thread.manager.test.ts +103 -99
- package/src/features/chat/managers/chat-composer-intent.manager.ts +37 -33
- package/src/features/chat/managers/chat-draft-intent.manager.ts +18 -2
- package/src/features/chat/managers/chat-thread.manager.ts +132 -128
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +26 -40
- package/src/features/chat/stores/chat-thread.store.ts +53 -74
- package/src/features/inbox/components/inbox-reader-dialog.test.tsx +38 -5
- package/src/features/inbox/components/inbox-reader-dialog.tsx +5 -3
- package/src/features/inbox/managers/inbox.manager.test.ts +28 -3
- package/src/features/inbox/managers/inbox.manager.ts +14 -4
- package/src/features/inbox/pages/inbox-page.test.ts +121 -2
- package/src/features/inbox/pages/inbox-page.tsx +5 -3
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +85 -1
- package/src/features/marketplace/hooks/__tests__/use-marketplace.test.tsx +44 -1
- package/src/features/marketplace/hooks/use-marketplace-item-actions.ts +23 -2
- package/src/features/marketplace/hooks/use-marketplace.ts +10 -0
- package/src/features/marketplace/index.ts +4 -0
- package/src/features/panel-apps/index.ts +5 -1
- package/src/features/panel-apps/utils/__tests__/panel-app-doc-browser.utils.test.ts +13 -6
- package/src/features/panel-apps/utils/panel-app-doc-browser.utils.tsx +6 -3
- package/src/features/right-panel-resources/index.ts +1 -0
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +7 -4
- package/src/features/system-status/components/__tests__/desktop-update-config.test.tsx +20 -1
- package/src/features/system-status/components/desktop-update-config.tsx +14 -13
- package/src/features/system-status/managers/__tests__/runtime-update.manager.test.ts +99 -0
- package/src/features/system-status/managers/runtime-update.manager.ts +22 -0
- package/src/features/system-status/stores/runtime-update.store.ts +1 -0
- package/src/shared/components/resizable-right-panel/__tests__/resizable-right-panel.test.tsx +35 -38
- package/src/shared/components/resizable-right-panel/resizable-right-panel.tsx +25 -19
- package/src/shared/components/ui/actions/__tests__/icon-action-button.test.tsx +15 -0
- package/src/shared/components/ui/actions/icon-action-button.tsx +4 -2
- package/src/shared/components/ui/context-menu/__tests__/context-menu.test.tsx +60 -34
- package/src/shared/components/ui/context-menu/context-menu.tsx +95 -68
- package/src/shared/hooks/use-system-object-references.ts +22 -0
- package/src/shared/lib/api/managers/client.manager.ts +31 -17
- package/src/shared/lib/api/server-path/server-path.types.ts +66 -0
- package/src/shared/lib/api/types.ts +155 -116
- package/src/shared/lib/api/utils/server-path.utils.ts +35 -11
- package/src/shared/lib/i18n/locales/en-US/chat.json +58 -9
- package/src/shared/lib/i18n/locales/en-US/desktop-update.json +7 -4
- package/src/shared/lib/i18n/locales/en-US/doc-browser.json +40 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +3 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +60 -11
- package/src/shared/lib/i18n/locales/zh-CN/desktop-update.json +7 -4
- package/src/shared/lib/i18n/locales/zh-CN/doc-browser.json +40 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +3 -0
- package/dist/assets/appearance-settings-page-DpVJjvkB.js +0 -1
- package/dist/assets/architecture-TIHT7OUA-Bjp9jf0h.js +0 -1
- package/dist/assets/channel-5T3pdR-s.js +0 -1
- package/dist/assets/chat-page-BuFDmG5_.js +0 -1
- package/dist/assets/chunk-2Q5K7J3B-DTZ3tGfE.js +0 -1
- package/dist/assets/chunk-VAUOI2AC-HLGIHQ6k.js +0 -1
- package/dist/assets/chunk-XXDRQBXY-Dl0m6Ni-.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-DcDnzGNX.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-BKXKMzKM.js +0 -1
- package/dist/assets/config-split-page-BVWVDbvG.js +0 -1
- package/dist/assets/confirm-dialog-mA2iVzxh.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +0 -1
- package/dist/assets/desktop-update-config-DyQb1LXr.js +0 -1
- package/dist/assets/doc-browser-CtO_HtRy.js +0 -1
- package/dist/assets/doc-browser-context-CuGI6PQc.js +0 -1
- package/dist/assets/doc-browser-eMUagyBV.js +0 -1
- package/dist/assets/eventmodeling-45OFAUF4-SB-J4tpq.js +0 -1
- package/dist/assets/flowDiagram-23GEKE2U-BQ_u-eLM.js +0 -1
- package/dist/assets/form-actions-BOfIyG3O.js +0 -1
- package/dist/assets/gitGraph-TEB2WS4Q-DPxNwsFd.js +0 -1
- package/dist/assets/index-BjBdWHV1.js +0 -107
- package/dist/assets/index-DmpmjAGQ.css +0 -1
- package/dist/assets/info-DKCQHKI2-DNlNGH90.js +0 -1
- package/dist/assets/loader-circle-Df8wF2Pr.js +0 -1
- package/dist/assets/mcp-marketplace-page-DI49IKxp.js +0 -1
- package/dist/assets/mcp-marketplace-page-ofDqbOIF.js +0 -9
- package/dist/assets/model-config-page-D73Tu3jW.js +0 -1
- package/dist/assets/packet-7NZHBO7P-BpeiqkBZ.js +0 -1
- package/dist/assets/pie-RZYD4A2V-Cy1yxsPd.js +0 -1
- package/dist/assets/plus-DVU5RLCS.js +0 -1
- package/dist/assets/provider-scoped-model-input-BaJJJYMX.js +0 -1
- package/dist/assets/providers-config-page-BL6IRVBm.js +0 -1
- package/dist/assets/radar-I7S5WNFK-CEcPKCj8.js +0 -1
- package/dist/assets/railroad-3IZDKUUU-CW38eNDs.js +0 -1
- package/dist/assets/railroad-abnf-AHOZXSZD-ByrylcXf.js +0 -1
- package/dist/assets/railroad-ebnf-EBAXGLYW-CNB6GwP-.js +0 -1
- package/dist/assets/railroad-peg-LSFZ7HO6-x6hnqlBG.js +0 -1
- package/dist/assets/react-BC_orpAj.js +0 -8
- package/dist/assets/remote-T24O58lH.js +0 -1
- package/dist/assets/rotate-cw-BqhwSV5p.js +0 -1
- package/dist/assets/runtime-config-page-CXUx017t.js +0 -1
- package/dist/assets/search-config-page-BB6d5gT7.js +0 -1
- package/dist/assets/secrets-config-page-DYsDeT9K.js +0 -3
- package/dist/assets/security-config-CVPgqL7G.js +0 -1
- package/dist/assets/skeleton-C5tWata3.js +0 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-ZC6dFORv.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-CRkh51Im.js +0 -8
- package/dist/assets/treeView-QDETBFTQ-Bw0DSCH7.js +0 -1
- package/dist/assets/treemap-6X3UGDF4-DFWBFcfh.js +0 -1
- package/dist/assets/use-confirm-dialog-D_3-QpZU.js +0 -1
- package/dist/assets/wardley-OPB4EBWU-CoWturk0.js +0 -1
- package/dist/assets/x-BEWSqeux.js +0 -1
- /package/dist/assets/{array-NADKd9aU.js → array-BQVzeGRt.js} +0 -0
- /package/dist/assets/{chunk-KEIR6QF5-BuyuzJJL.js → chunk-KEIR6QF5-f9psyCXK.js} +0 -0
- /package/dist/assets/{chunk-Y2CYZVJY-D_B2ZRNt.js → chunk-Y2CYZVJY-D1mAU_Po.js} +0 -0
- /package/dist/assets/{config-hints-BcfVUMij.js → config-hints-nV5HPOvq.js} +0 -0
- /package/dist/assets/{cytoscape.esm-BANTlgza.js → cytoscape.esm-0uDtdD0l.js} +0 -0
- /package/dist/assets/{defaultLocale-C4_L0aEs.js → defaultLocale-DSWXGgt0.js} +0 -0
- /package/dist/assets/{dist-DAPEIJbz.js → dist--ta5rX12.js} +0 -0
- /package/dist/assets/{graphlib-ChqXg0dI.js → graphlib-CQ6QV4yP.js} +0 -0
- /package/dist/assets/{host-capabilities-D9C4CBK5.js → host-capabilities-Tk038i04.js} +0 -0
- /package/dist/assets/{init-D8wZg9xq.js → init-Y6h9jGtZ.js} +0 -0
- /package/dist/assets/{jszip.min-CkbBfwAQ.js → jszip.min-8hyJpgpx.js} +0 -0
- /package/dist/assets/{katex-TZJFa0J_.js → katex-ARhY9PS1.js} +0 -0
- /package/dist/assets/{middleware-B3k-TSmZ.js → middleware-DXsbf9xI.js} +0 -0
- /package/dist/assets/{path-DodfxcX7.js → path-10BjdyLh.js} +0 -0
- /package/dist/assets/{rough.esm-CUaa1Rbe.js → rough.esm-DxgC_14r.js} +0 -0
- /package/dist/assets/{xlsx-CxByi7bR.js → xlsx-DrDuDNAa.js} +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { copyText } from "@nextclaw/agent-chat-ui";
|
|
2
|
+
import {
|
|
3
|
+
Copy,
|
|
4
|
+
Download,
|
|
5
|
+
ExternalLink,
|
|
6
|
+
FilePlus2,
|
|
7
|
+
FolderPlus,
|
|
8
|
+
LocateFixed,
|
|
9
|
+
MessageSquarePlus,
|
|
10
|
+
Pencil,
|
|
11
|
+
Trash2,
|
|
12
|
+
Upload,
|
|
13
|
+
} from "lucide-react";
|
|
14
|
+
import { toast } from "sonner";
|
|
15
|
+
import type {
|
|
16
|
+
RefreshDirectory,
|
|
17
|
+
WorkspaceDirectoryActionTarget,
|
|
18
|
+
} from "@/features/chat/features/workspace/hooks/use-workspace-file-actions";
|
|
19
|
+
import type { ContextMenuGroup } from "@/shared/components/ui/context-menu/context-menu";
|
|
20
|
+
import type { ServerPathEntryView } from "@/shared/lib/api";
|
|
21
|
+
import { t } from "@/shared/lib/i18n";
|
|
22
|
+
|
|
23
|
+
export async function copyWorkspacePath(path: string) {
|
|
24
|
+
const copied = await copyText(path);
|
|
25
|
+
toast[copied ? "success" : "error"](
|
|
26
|
+
t(copied ? "chatCodeCopied" : "chatWorkspaceCopyPathFailed"),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function buildWorkspaceEntryContextMenuGroups({
|
|
31
|
+
busy,
|
|
32
|
+
downloadUrl,
|
|
33
|
+
entry,
|
|
34
|
+
onAddToChat,
|
|
35
|
+
onCreateFolder,
|
|
36
|
+
onCreateFile,
|
|
37
|
+
onDelete,
|
|
38
|
+
onOpen,
|
|
39
|
+
onRenameRequest,
|
|
40
|
+
onRevealPath,
|
|
41
|
+
onUpload,
|
|
42
|
+
ownCreateTarget,
|
|
43
|
+
parentRefresh,
|
|
44
|
+
relativePath,
|
|
45
|
+
}: {
|
|
46
|
+
busy: boolean;
|
|
47
|
+
downloadUrl: string | null;
|
|
48
|
+
entry: ServerPathEntryView;
|
|
49
|
+
onAddToChat?: (entry: ServerPathEntryView, relativePath: string) => void;
|
|
50
|
+
onCreateFolder?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
51
|
+
onCreateFile?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
52
|
+
onDelete?: (entry: ServerPathEntryView, refresh: RefreshDirectory) => void;
|
|
53
|
+
onOpen: () => void;
|
|
54
|
+
onRenameRequest?: () => void;
|
|
55
|
+
onRevealPath?: (path: string) => void;
|
|
56
|
+
onUpload?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
57
|
+
ownCreateTarget: WorkspaceDirectoryActionTarget;
|
|
58
|
+
parentRefresh: RefreshDirectory;
|
|
59
|
+
relativePath: string | null;
|
|
60
|
+
}): ContextMenuGroup[] {
|
|
61
|
+
const isDirectory = entry.kind === "directory";
|
|
62
|
+
const openGroup: ContextMenuGroup = {
|
|
63
|
+
key: "open",
|
|
64
|
+
items: [
|
|
65
|
+
{
|
|
66
|
+
key: "open",
|
|
67
|
+
label: t("chatWorkspaceOpen"),
|
|
68
|
+
icon: <ExternalLink className="h-4 w-4" />,
|
|
69
|
+
onSelect: onOpen,
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
const manageGroup: ContextMenuGroup = {
|
|
74
|
+
key: "manage",
|
|
75
|
+
items: isDirectory
|
|
76
|
+
? [
|
|
77
|
+
...(onCreateFile
|
|
78
|
+
? [
|
|
79
|
+
{
|
|
80
|
+
key: "new-file",
|
|
81
|
+
label: t("chatWorkspaceNewFile"),
|
|
82
|
+
icon: <FilePlus2 className="h-4 w-4" />,
|
|
83
|
+
disabled: busy,
|
|
84
|
+
restoreFocus: false,
|
|
85
|
+
onSelect: () => onCreateFile(ownCreateTarget),
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
: []),
|
|
89
|
+
...(onCreateFolder
|
|
90
|
+
? [
|
|
91
|
+
{
|
|
92
|
+
key: "new-folder",
|
|
93
|
+
label: t("chatWorkspaceNewFolder"),
|
|
94
|
+
icon: <FolderPlus className="h-4 w-4" />,
|
|
95
|
+
disabled: busy,
|
|
96
|
+
restoreFocus: false,
|
|
97
|
+
onSelect: () => onCreateFolder(ownCreateTarget),
|
|
98
|
+
},
|
|
99
|
+
]
|
|
100
|
+
: []),
|
|
101
|
+
...(onUpload
|
|
102
|
+
? [
|
|
103
|
+
{
|
|
104
|
+
key: "upload",
|
|
105
|
+
label: t("chatWorkspaceUploadFilesHere"),
|
|
106
|
+
icon: <Upload className="h-4 w-4" />,
|
|
107
|
+
disabled: busy,
|
|
108
|
+
restoreFocus: false,
|
|
109
|
+
onSelect: () => onUpload(ownCreateTarget),
|
|
110
|
+
},
|
|
111
|
+
]
|
|
112
|
+
: []),
|
|
113
|
+
]
|
|
114
|
+
: [],
|
|
115
|
+
};
|
|
116
|
+
const nextclawGroup: ContextMenuGroup = {
|
|
117
|
+
key: "nextclaw",
|
|
118
|
+
items: [
|
|
119
|
+
...(relativePath && onAddToChat
|
|
120
|
+
? [
|
|
121
|
+
{
|
|
122
|
+
key: "add-to-chat",
|
|
123
|
+
label: t("chatWorkspaceAddToChat"),
|
|
124
|
+
icon: <MessageSquarePlus className="h-4 w-4" />,
|
|
125
|
+
restoreFocus: false,
|
|
126
|
+
onSelect: () => onAddToChat(entry, relativePath),
|
|
127
|
+
},
|
|
128
|
+
]
|
|
129
|
+
: []),
|
|
130
|
+
...(downloadUrl
|
|
131
|
+
? [
|
|
132
|
+
{
|
|
133
|
+
key: "download",
|
|
134
|
+
label: t("chatWorkspaceDownloadFile"),
|
|
135
|
+
icon: <Download className="h-4 w-4" />,
|
|
136
|
+
href: downloadUrl,
|
|
137
|
+
download: entry.name,
|
|
138
|
+
},
|
|
139
|
+
]
|
|
140
|
+
: []),
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
const pathGroup: ContextMenuGroup = {
|
|
144
|
+
key: "path",
|
|
145
|
+
items: [
|
|
146
|
+
...(onRevealPath
|
|
147
|
+
? [
|
|
148
|
+
{
|
|
149
|
+
key: "reveal",
|
|
150
|
+
label: t("chatWorkspaceRevealInFileManager"),
|
|
151
|
+
icon: <LocateFixed className="h-4 w-4" />,
|
|
152
|
+
onSelect: () => onRevealPath(entry.path),
|
|
153
|
+
},
|
|
154
|
+
]
|
|
155
|
+
: []),
|
|
156
|
+
{
|
|
157
|
+
key: "copy-path",
|
|
158
|
+
label: t("chatWorkspaceCopyPath"),
|
|
159
|
+
icon: <Copy className="h-4 w-4" />,
|
|
160
|
+
onSelect: () => void copyWorkspacePath(entry.path),
|
|
161
|
+
},
|
|
162
|
+
...(relativePath
|
|
163
|
+
? [
|
|
164
|
+
{
|
|
165
|
+
key: "copy-relative-path",
|
|
166
|
+
label: t("chatWorkspaceCopyRelativePath"),
|
|
167
|
+
icon: <Copy className="h-4 w-4" />,
|
|
168
|
+
onSelect: () => void copyWorkspacePath(relativePath),
|
|
169
|
+
},
|
|
170
|
+
]
|
|
171
|
+
: []),
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
const renameGroup: ContextMenuGroup = {
|
|
175
|
+
key: "rename",
|
|
176
|
+
items: onRenameRequest
|
|
177
|
+
? [
|
|
178
|
+
{
|
|
179
|
+
key: "rename",
|
|
180
|
+
label: t("chatWorkspaceRename"),
|
|
181
|
+
icon: <Pencil className="h-4 w-4" />,
|
|
182
|
+
disabled: busy,
|
|
183
|
+
restoreFocus: false,
|
|
184
|
+
onSelect: onRenameRequest,
|
|
185
|
+
},
|
|
186
|
+
]
|
|
187
|
+
: [],
|
|
188
|
+
};
|
|
189
|
+
const dangerGroup: ContextMenuGroup = {
|
|
190
|
+
key: "danger",
|
|
191
|
+
items: onDelete
|
|
192
|
+
? [
|
|
193
|
+
{
|
|
194
|
+
key: "delete",
|
|
195
|
+
label: t("chatWorkspaceDelete"),
|
|
196
|
+
icon: <Trash2 className="h-4 w-4" />,
|
|
197
|
+
destructive: true,
|
|
198
|
+
disabled: busy,
|
|
199
|
+
restoreFocus: false,
|
|
200
|
+
onSelect: () => onDelete(entry, parentRefresh),
|
|
201
|
+
},
|
|
202
|
+
]
|
|
203
|
+
: [],
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
return isDirectory
|
|
207
|
+
? [nextclawGroup, manageGroup, pathGroup, renameGroup, dangerGroup]
|
|
208
|
+
: [openGroup, nextclawGroup, pathGroup, renameGroup, dangerGroup];
|
|
209
|
+
}
|
package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx
ADDED
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
|
2
|
+
import type { ChatFileOpenActionViewModel } from '@nextclaw/agent-chat-ui';
|
|
3
|
+
import {
|
|
4
|
+
ChevronDown,
|
|
5
|
+
ChevronRight,
|
|
6
|
+
Check,
|
|
7
|
+
Folder,
|
|
8
|
+
FolderOpen,
|
|
9
|
+
MoreHorizontal,
|
|
10
|
+
X,
|
|
11
|
+
} from 'lucide-react';
|
|
12
|
+
import type {
|
|
13
|
+
RefreshDirectory,
|
|
14
|
+
WorkspaceDirectoryActionTarget,
|
|
15
|
+
WorkspaceTreeSelection,
|
|
16
|
+
} from '@/features/chat/features/workspace/hooks/use-workspace-file-actions';
|
|
17
|
+
import { FileTypeIcon } from '@/shared/components/file-type-icon';
|
|
18
|
+
import { IconActionButton } from '@/shared/components/ui/actions/icon-action-button';
|
|
19
|
+
import { Input } from '@/shared/components/ui/input';
|
|
20
|
+
import {
|
|
21
|
+
ContextMenu,
|
|
22
|
+
ContextMenuTrigger,
|
|
23
|
+
} from '@/shared/components/ui/context-menu/context-menu';
|
|
24
|
+
import { useServerPathBrowse } from '@/shared/hooks/use-server-path-browse';
|
|
25
|
+
import { buildServerPathContentUrl, type ServerPathEntryView } from '@/shared/lib/api';
|
|
26
|
+
import { t } from '@/shared/lib/i18n';
|
|
27
|
+
import { cn } from '@/shared/lib/utils';
|
|
28
|
+
import { buildWorkspaceEntryContextMenuGroups } from '@/features/chat/features/workspace/components/project-files/workspace-directory-entry-menu';
|
|
29
|
+
|
|
30
|
+
export { copyWorkspacePath } from '@/features/chat/features/workspace/components/project-files/workspace-directory-entry-menu';
|
|
31
|
+
|
|
32
|
+
type WorkspaceDirectoryTreeActionProps = {
|
|
33
|
+
activeRelativePath: string | null;
|
|
34
|
+
busy: boolean;
|
|
35
|
+
collapseVersion: number;
|
|
36
|
+
createTarget: WorkspaceDirectoryActionTarget | null;
|
|
37
|
+
onAddToChat?: (entry: ServerPathEntryView, relativePath: string) => void;
|
|
38
|
+
onCreateFolder?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
39
|
+
onCreateFile?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
40
|
+
onDelete?: (entry: ServerPathEntryView, refresh: RefreshDirectory) => void;
|
|
41
|
+
onRename?: (entry: ServerPathEntryView, name: string, refresh: RefreshDirectory) => Promise<unknown>;
|
|
42
|
+
onRevealComplete: () => void;
|
|
43
|
+
onSelect: (selection: WorkspaceTreeSelection) => void;
|
|
44
|
+
onUpload?: (target: WorkspaceDirectoryActionTarget) => void;
|
|
45
|
+
renderCreateFolder: (level: number) => ReactNode;
|
|
46
|
+
revealPath: string | null;
|
|
47
|
+
selectedPath: string | null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
function buildEntryLabel(entry: ServerPathEntryView): string {
|
|
51
|
+
const actionLabel = entry.kind === 'directory' ? t('chatWorkspaceOpenDirectory') : t('chatWorkspaceOpenFile');
|
|
52
|
+
return `${actionLabel}: ${entry.name}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readErrorMessage(error: unknown): string {
|
|
56
|
+
return error instanceof Error ? error.message : String(error);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function readBrowseError(browseQuery: ReturnType<typeof useServerPathBrowse>): string | null {
|
|
60
|
+
return browseQuery.error ? readErrorMessage(browseQuery.error) : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function EntryIcon({
|
|
64
|
+
fileName,
|
|
65
|
+
isDirectory,
|
|
66
|
+
isExpanded,
|
|
67
|
+
}: {
|
|
68
|
+
fileName: string;
|
|
69
|
+
isDirectory: boolean;
|
|
70
|
+
isExpanded: boolean;
|
|
71
|
+
}) {
|
|
72
|
+
if (!isDirectory) {
|
|
73
|
+
return <FileTypeIcon fileName={fileName} />;
|
|
74
|
+
}
|
|
75
|
+
return isExpanded ? (
|
|
76
|
+
<FolderOpen className="h-4 w-4 shrink-0 text-amber-500" />
|
|
77
|
+
) : (
|
|
78
|
+
<Folder className="h-4 w-4 shrink-0 text-amber-500" />
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function WorkspaceDirectoryTreeChildren({
|
|
83
|
+
browseQuery,
|
|
84
|
+
level,
|
|
85
|
+
onFileOpen,
|
|
86
|
+
onRevealPath,
|
|
87
|
+
parentCreateTarget,
|
|
88
|
+
parentRelativePath,
|
|
89
|
+
...actions
|
|
90
|
+
}: WorkspaceDirectoryTreeActionProps & {
|
|
91
|
+
browseQuery: ReturnType<typeof useServerPathBrowse>;
|
|
92
|
+
level: number;
|
|
93
|
+
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
94
|
+
onRevealPath?: (path: string) => void;
|
|
95
|
+
parentCreateTarget: WorkspaceDirectoryActionTarget;
|
|
96
|
+
parentRelativePath: string | null;
|
|
97
|
+
}) {
|
|
98
|
+
const entries = browseQuery.data?.entries ?? [];
|
|
99
|
+
const errorMessage = readBrowseError(browseQuery);
|
|
100
|
+
const statusStyle = { paddingLeft: `${36 + level * 14}px` };
|
|
101
|
+
|
|
102
|
+
if (browseQuery.isLoading && !browseQuery.data) {
|
|
103
|
+
return (
|
|
104
|
+
<div className="h-7 truncate pr-2 text-[11px] leading-7 text-gray-400" style={statusStyle}>
|
|
105
|
+
{t('chatWorkspaceLoadingDirectory')}
|
|
106
|
+
</div>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
if (errorMessage && !browseQuery.data) {
|
|
110
|
+
return (
|
|
111
|
+
<div className="h-7 truncate pr-2 text-[11px] leading-7 text-rose-600" style={statusStyle} title={errorMessage}>
|
|
112
|
+
{t('chatWorkspaceDirectoryLoadFailed')}
|
|
113
|
+
</div>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
if (entries.length === 0) {
|
|
117
|
+
return (
|
|
118
|
+
<div className="h-7 truncate pr-2 text-[11px] leading-7 text-gray-400" style={statusStyle}>
|
|
119
|
+
{t('chatWorkspaceDirectoryEmpty')}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
return entries.map((entry) => (
|
|
124
|
+
<WorkspaceDirectoryTreeEntry
|
|
125
|
+
key={entry.path}
|
|
126
|
+
{...actions}
|
|
127
|
+
browseParentRefresh={() => browseQuery.refetch()}
|
|
128
|
+
entry={entry}
|
|
129
|
+
level={level + 1}
|
|
130
|
+
onFileOpen={onFileOpen}
|
|
131
|
+
onRevealPath={onRevealPath}
|
|
132
|
+
parentCreateTarget={parentCreateTarget}
|
|
133
|
+
relativePath={parentRelativePath ? `${parentRelativePath}/${entry.name}` : null}
|
|
134
|
+
/>
|
|
135
|
+
));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function useWorkspaceEntryRename({
|
|
139
|
+
entry,
|
|
140
|
+
onRename,
|
|
141
|
+
refresh,
|
|
142
|
+
}: {
|
|
143
|
+
entry: ServerPathEntryView;
|
|
144
|
+
onRename?: WorkspaceDirectoryTreeActionProps['onRename'];
|
|
145
|
+
refresh: RefreshDirectory;
|
|
146
|
+
}) {
|
|
147
|
+
const [active, setActive] = useState(false);
|
|
148
|
+
const [name, setName] = useState(entry.name);
|
|
149
|
+
const [error, setError] = useState<string | null>(null);
|
|
150
|
+
const cancel = () => setActive(false);
|
|
151
|
+
const start = () => {
|
|
152
|
+
setName(entry.name);
|
|
153
|
+
setError(null);
|
|
154
|
+
setActive(true);
|
|
155
|
+
};
|
|
156
|
+
const updateName = (value: string) => {
|
|
157
|
+
setName(value);
|
|
158
|
+
setError(null);
|
|
159
|
+
};
|
|
160
|
+
const submit = async () => {
|
|
161
|
+
const normalizedName = name.trim();
|
|
162
|
+
if (
|
|
163
|
+
!onRename ||
|
|
164
|
+
!normalizedName ||
|
|
165
|
+
normalizedName === '.' ||
|
|
166
|
+
normalizedName === '..' ||
|
|
167
|
+
normalizedName.includes('/') ||
|
|
168
|
+
normalizedName.includes('\\')
|
|
169
|
+
) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (normalizedName === entry.name) {
|
|
173
|
+
cancel();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
try {
|
|
177
|
+
await onRename(entry, normalizedName, refresh);
|
|
178
|
+
cancel();
|
|
179
|
+
} catch (renameError) {
|
|
180
|
+
setError(`${t('chatWorkspaceRenameFailed')}: ${readErrorMessage(renameError)}`);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
return { active, cancel, error, name, start, submit, updateName };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function readWorkspaceTreeEntrySelection(
|
|
187
|
+
activeRelativePath: string | null,
|
|
188
|
+
relativePath: string | null,
|
|
189
|
+
selectedPath: string | null,
|
|
190
|
+
entryPath: string,
|
|
191
|
+
): readonly [active: boolean, selected: boolean] {
|
|
192
|
+
const active = !selectedPath && activeRelativePath !== null && activeRelativePath === relativePath;
|
|
193
|
+
return [active, selectedPath === null ? active : selectedPath === entryPath];
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function isWorkspaceTreeEntryExpanded(
|
|
197
|
+
manuallyExpanded: boolean,
|
|
198
|
+
isDirectory: boolean,
|
|
199
|
+
activeRelativePath: string | null,
|
|
200
|
+
relativePath: string | null,
|
|
201
|
+
selectedPath: string | null,
|
|
202
|
+
): boolean {
|
|
203
|
+
return (
|
|
204
|
+
manuallyExpanded ||
|
|
205
|
+
Boolean(!selectedPath && isDirectory && relativePath && activeRelativePath?.startsWith(`${relativePath}/`))
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function WorkspaceDirectoryTreeEntry({
|
|
210
|
+
activeRelativePath,
|
|
211
|
+
browseParentRefresh,
|
|
212
|
+
busy,
|
|
213
|
+
collapseVersion,
|
|
214
|
+
createTarget,
|
|
215
|
+
entry,
|
|
216
|
+
level,
|
|
217
|
+
onAddToChat,
|
|
218
|
+
onCreateFolder,
|
|
219
|
+
onCreateFile,
|
|
220
|
+
onDelete,
|
|
221
|
+
onRename,
|
|
222
|
+
onFileOpen,
|
|
223
|
+
onRevealComplete,
|
|
224
|
+
onRevealPath,
|
|
225
|
+
onSelect,
|
|
226
|
+
onUpload,
|
|
227
|
+
parentCreateTarget,
|
|
228
|
+
relativePath,
|
|
229
|
+
renderCreateFolder,
|
|
230
|
+
revealPath,
|
|
231
|
+
selectedPath,
|
|
232
|
+
}: WorkspaceDirectoryTreeActionProps & {
|
|
233
|
+
browseParentRefresh: RefreshDirectory;
|
|
234
|
+
entry: ServerPathEntryView;
|
|
235
|
+
level: number;
|
|
236
|
+
onFileOpen: (action: ChatFileOpenActionViewModel) => void;
|
|
237
|
+
onRevealPath?: (path: string) => void;
|
|
238
|
+
parentCreateTarget: WorkspaceDirectoryActionTarget;
|
|
239
|
+
relativePath: string | null;
|
|
240
|
+
}) {
|
|
241
|
+
const rowRef = useRef<HTMLDivElement | null>(null);
|
|
242
|
+
const entryButtonRef = useRef<HTMLButtonElement | null>(null);
|
|
243
|
+
const isDirectory = entry.kind === 'directory';
|
|
244
|
+
const [manuallyExpanded, setIsExpanded] = useState(false);
|
|
245
|
+
const isExpanded = isWorkspaceTreeEntryExpanded(
|
|
246
|
+
manuallyExpanded,
|
|
247
|
+
isDirectory,
|
|
248
|
+
activeRelativePath,
|
|
249
|
+
relativePath,
|
|
250
|
+
selectedPath,
|
|
251
|
+
);
|
|
252
|
+
const rename = useWorkspaceEntryRename({
|
|
253
|
+
entry,
|
|
254
|
+
onRename,
|
|
255
|
+
refresh: browseParentRefresh,
|
|
256
|
+
});
|
|
257
|
+
useEffect(() => {
|
|
258
|
+
if (collapseVersion > 0) setIsExpanded(false);
|
|
259
|
+
}, [collapseVersion]);
|
|
260
|
+
const browseQuery = useServerPathBrowse({
|
|
261
|
+
path: entry.path,
|
|
262
|
+
includeFiles: true,
|
|
263
|
+
enabled: isDirectory && isExpanded,
|
|
264
|
+
});
|
|
265
|
+
const refreshDirectory = browseQuery.refetch;
|
|
266
|
+
const downloadUrl = isDirectory ? null : buildServerPathContentUrl(entry.path);
|
|
267
|
+
const ownCreateTarget = useMemo<WorkspaceDirectoryActionTarget>(
|
|
268
|
+
() =>
|
|
269
|
+
isDirectory
|
|
270
|
+
? {
|
|
271
|
+
label: entry.name,
|
|
272
|
+
path: entry.path,
|
|
273
|
+
refresh: () => refreshDirectory(),
|
|
274
|
+
expand: () => setIsExpanded(true),
|
|
275
|
+
}
|
|
276
|
+
: parentCreateTarget,
|
|
277
|
+
[entry.name, entry.path, isDirectory, parentCreateTarget, refreshDirectory],
|
|
278
|
+
);
|
|
279
|
+
const selection = useMemo<WorkspaceTreeSelection>(
|
|
280
|
+
() => ({ path: entry.path, createTarget: ownCreateTarget }),
|
|
281
|
+
[entry.path, ownCreateTarget],
|
|
282
|
+
);
|
|
283
|
+
const [activeSelected, selected] = readWorkspaceTreeEntrySelection(
|
|
284
|
+
activeRelativePath,
|
|
285
|
+
relativePath,
|
|
286
|
+
selectedPath,
|
|
287
|
+
entry.path,
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
useLayoutEffect(() => {
|
|
291
|
+
if (activeSelected) rowRef.current?.scrollIntoView?.({ block: 'nearest' });
|
|
292
|
+
}, [activeSelected]);
|
|
293
|
+
|
|
294
|
+
useLayoutEffect(() => {
|
|
295
|
+
if (revealPath !== entry.path) return;
|
|
296
|
+
rowRef.current?.scrollIntoView?.({ block: 'nearest' });
|
|
297
|
+
onSelect(selection);
|
|
298
|
+
entryButtonRef.current?.focus();
|
|
299
|
+
onRevealComplete();
|
|
300
|
+
}, [entry.path, onRevealComplete, onSelect, revealPath, selection]);
|
|
301
|
+
|
|
302
|
+
const activateEntry = () => {
|
|
303
|
+
onSelect(selection);
|
|
304
|
+
if (isDirectory) setIsExpanded(!isExpanded);
|
|
305
|
+
else onFileOpen({ path: entry.path, label: entry.name, viewMode: 'preview' });
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
const contextMenuGroups = buildWorkspaceEntryContextMenuGroups({
|
|
309
|
+
busy,
|
|
310
|
+
downloadUrl,
|
|
311
|
+
entry,
|
|
312
|
+
onAddToChat,
|
|
313
|
+
onCreateFolder,
|
|
314
|
+
onCreateFile,
|
|
315
|
+
onDelete,
|
|
316
|
+
onOpen: activateEntry,
|
|
317
|
+
onRenameRequest: onRename ? rename.start : undefined,
|
|
318
|
+
onRevealPath,
|
|
319
|
+
onUpload,
|
|
320
|
+
ownCreateTarget,
|
|
321
|
+
parentRefresh: browseParentRefresh,
|
|
322
|
+
relativePath,
|
|
323
|
+
});
|
|
324
|
+
return (
|
|
325
|
+
<div
|
|
326
|
+
role="treeitem"
|
|
327
|
+
aria-expanded={isDirectory ? isExpanded : undefined}
|
|
328
|
+
aria-label={buildEntryLabel(entry)}
|
|
329
|
+
aria-selected={selected}
|
|
330
|
+
>
|
|
331
|
+
<ContextMenu groups={contextMenuGroups} label={t('chatWorkspaceFileContextMenu')}>
|
|
332
|
+
<div
|
|
333
|
+
ref={rowRef}
|
|
334
|
+
data-workspace-tree-entry=""
|
|
335
|
+
className={cn(
|
|
336
|
+
'group flex h-[26px] w-full min-w-0 items-center text-gray-700 transition-colors hover:bg-gray-100 focus-within:bg-gray-100',
|
|
337
|
+
selected ? 'bg-primary/10' : null,
|
|
338
|
+
entry.hidden ? 'opacity-65' : null,
|
|
339
|
+
)}
|
|
340
|
+
style={{ paddingLeft: `${6 + level * 12}px` }}
|
|
341
|
+
onContextMenu={() => onSelect(selection)}
|
|
342
|
+
>
|
|
343
|
+
{rename.active ? (
|
|
344
|
+
<form
|
|
345
|
+
className="flex h-full min-w-0 flex-1 items-center gap-1"
|
|
346
|
+
onSubmit={(event) => {
|
|
347
|
+
event.preventDefault();
|
|
348
|
+
void rename.submit();
|
|
349
|
+
}}
|
|
350
|
+
>
|
|
351
|
+
<Input
|
|
352
|
+
autoFocus
|
|
353
|
+
aria-label={t('chatWorkspaceRenameName')}
|
|
354
|
+
className="h-6 min-w-0 flex-1 px-1.5 text-xs"
|
|
355
|
+
value={rename.name}
|
|
356
|
+
onChange={(event) => rename.updateName(event.target.value)}
|
|
357
|
+
onKeyDown={(event) => {
|
|
358
|
+
if (event.key === 'Escape') {
|
|
359
|
+
event.preventDefault();
|
|
360
|
+
rename.cancel();
|
|
361
|
+
}
|
|
362
|
+
}}
|
|
363
|
+
/>
|
|
364
|
+
<IconActionButton
|
|
365
|
+
icon={<Check className="h-3.5 w-3.5" />}
|
|
366
|
+
label={t('chatWorkspaceRename')}
|
|
367
|
+
size="sm"
|
|
368
|
+
onClick={() => void rename.submit()}
|
|
369
|
+
/>
|
|
370
|
+
<IconActionButton
|
|
371
|
+
icon={<X className="h-3.5 w-3.5" />}
|
|
372
|
+
label={t('cancel')}
|
|
373
|
+
size="sm"
|
|
374
|
+
onClick={rename.cancel}
|
|
375
|
+
/>
|
|
376
|
+
</form>
|
|
377
|
+
) : (
|
|
378
|
+
<button
|
|
379
|
+
ref={entryButtonRef}
|
|
380
|
+
type="button"
|
|
381
|
+
aria-label={entry.name}
|
|
382
|
+
className="flex h-full min-w-0 flex-1 items-center gap-1 text-left text-[13px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-border"
|
|
383
|
+
onClick={activateEntry}
|
|
384
|
+
onKeyDown={(event) => {
|
|
385
|
+
if (event.key === 'F2' && onRename) {
|
|
386
|
+
event.preventDefault();
|
|
387
|
+
rename.start();
|
|
388
|
+
}
|
|
389
|
+
}}
|
|
390
|
+
>
|
|
391
|
+
<span className="inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center text-gray-400">
|
|
392
|
+
{isDirectory ? (
|
|
393
|
+
isExpanded ? (
|
|
394
|
+
<ChevronDown className="h-3.5 w-3.5" />
|
|
395
|
+
) : (
|
|
396
|
+
<ChevronRight className="h-3.5 w-3.5" />
|
|
397
|
+
)
|
|
398
|
+
) : null}
|
|
399
|
+
</span>
|
|
400
|
+
<EntryIcon fileName={entry.name} isDirectory={isDirectory} isExpanded={isExpanded} />
|
|
401
|
+
<span className="min-w-0 flex-1 truncate" title={entry.name}>
|
|
402
|
+
{entry.name}
|
|
403
|
+
</span>
|
|
404
|
+
</button>
|
|
405
|
+
)}
|
|
406
|
+
{!rename.active ? (
|
|
407
|
+
<ContextMenuTrigger>
|
|
408
|
+
<IconActionButton
|
|
409
|
+
className="mr-1 opacity-0 pointer-events-none group-hover:pointer-events-auto group-hover:opacity-100 group-focus-within:pointer-events-auto group-focus-within:opacity-100 data-[context-menu-open]:pointer-events-auto data-[context-menu-open]:opacity-100"
|
|
410
|
+
icon={<MoreHorizontal className="h-3.5 w-3.5" />}
|
|
411
|
+
label={t('chatWorkspaceMoreActionsFor').replace('{name}', entry.name)}
|
|
412
|
+
size="sm"
|
|
413
|
+
tooltipSide="left"
|
|
414
|
+
onClick={() => onSelect(selection)}
|
|
415
|
+
/>
|
|
416
|
+
</ContextMenuTrigger>
|
|
417
|
+
) : null}
|
|
418
|
+
</div>
|
|
419
|
+
</ContextMenu>
|
|
420
|
+
{rename.error ? (
|
|
421
|
+
<p
|
|
422
|
+
role="alert"
|
|
423
|
+
className="py-1 pr-2 text-[11px] text-destructive"
|
|
424
|
+
style={{ paddingLeft: `${36 + level * 14}px` }}
|
|
425
|
+
>
|
|
426
|
+
{rename.error}
|
|
427
|
+
</p>
|
|
428
|
+
) : null}
|
|
429
|
+
{isDirectory && isExpanded ? (
|
|
430
|
+
<div role="group">
|
|
431
|
+
{createTarget?.path === entry.path ? renderCreateFolder(level + 1) : null}
|
|
432
|
+
<WorkspaceDirectoryTreeChildren
|
|
433
|
+
activeRelativePath={activeRelativePath}
|
|
434
|
+
browseQuery={browseQuery}
|
|
435
|
+
busy={busy}
|
|
436
|
+
collapseVersion={collapseVersion}
|
|
437
|
+
createTarget={createTarget}
|
|
438
|
+
level={level}
|
|
439
|
+
onAddToChat={onAddToChat}
|
|
440
|
+
onCreateFolder={onCreateFolder}
|
|
441
|
+
onCreateFile={onCreateFile}
|
|
442
|
+
onDelete={onDelete}
|
|
443
|
+
onRename={onRename}
|
|
444
|
+
onFileOpen={onFileOpen}
|
|
445
|
+
onRevealComplete={onRevealComplete}
|
|
446
|
+
onRevealPath={onRevealPath}
|
|
447
|
+
onSelect={onSelect}
|
|
448
|
+
onUpload={onUpload}
|
|
449
|
+
parentCreateTarget={ownCreateTarget}
|
|
450
|
+
parentRelativePath={relativePath}
|
|
451
|
+
renderCreateFolder={renderCreateFolder}
|
|
452
|
+
revealPath={revealPath}
|
|
453
|
+
selectedPath={selectedPath}
|
|
454
|
+
/>
|
|
455
|
+
</div>
|
|
456
|
+
) : null}
|
|
457
|
+
</div>
|
|
458
|
+
);
|
|
459
|
+
}
|