@nextclaw/ui 0.15.25 → 0.15.27
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 +34 -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-FK7tikI1.js → api-a_GaOFc7.js} +6 -6
- package/dist/assets/appearance-settings-page-DlGXLgff.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-CocdcIko.js → channels-list-page-BEEk4Uc9.js} +2 -2
- package/dist/assets/chat-page-DUQXXqQm.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-ps1Aod3g.js +1 -0
- package/dist/assets/confirm-dialog-DJSUNG33.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--zagjHic.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-CaYdVVeO.js → dist-BkTYNzm_.js} +1 -1
- package/dist/assets/{dist-BH7W5yCi.js → dist-DkR7_Dpl.js} +1 -1
- package/dist/assets/doc-browser-DahzJEWj.js +1 -0
- package/dist/assets/doc-browser-Q67TOGVS.js +1 -0
- package/dist/assets/doc-browser-context-BQim8SqD.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-0c0aw_bl.js → form-actions-B2-bpFie.js} +1 -1
- 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-Ba_o5fu9.js +109 -0
- package/dist/assets/index-DSLK7zgR.css +1 -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-DyXZU92l.js +1 -0
- package/dist/assets/{map-CcZzEoz6.js → map-BKnQyvd0.js} +1 -1
- package/dist/assets/mcp-marketplace-page-B0dBE5CV.js +1 -0
- package/dist/assets/mcp-marketplace-page-w8panjZG.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-rrhFaque.js +1 -0
- package/dist/assets/{navigation-link-CVy0_kVl.js → navigation-link-mpHFXwRr.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-Dhb4KuMH.js +1 -0
- package/dist/assets/provider-scoped-model-input-CFsfWEt9.js +1 -0
- package/dist/assets/providers-config-page-D-TYFZsF.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-BlXwvOLo.js +8 -0
- package/dist/assets/{refresh-cw-j2bl79Ea.js → refresh-cw-JFuyDj_P.js} +1 -1
- package/dist/assets/remote-BwVv_Qq-.js +1 -0
- package/dist/assets/{requirementDiagram-TGXJPOKE-CyVUzEX5.js → requirementDiagram-TGXJPOKE-BiXNX1NN.js} +1 -1
- package/dist/assets/rotate-cw-DjbbiIW_.js +1 -0
- package/dist/assets/runtime-config-page-Br9j9Vxe.js +1 -0
- package/dist/assets/{sankeyDiagram-HTMAVEWB-JK6bFmYB.js → sankeyDiagram-HTMAVEWB-qzDeLztW.js} +1 -1
- package/dist/assets/{save-BKNrtK81.js → save-BL8P8CLX.js} +1 -1
- package/dist/assets/{search-CkOm65W_.js → search-bZL75Pgc.js} +1 -1
- package/dist/assets/search-config-page-B3fvzMd1.js +1 -0
- package/dist/assets/secrets-config-page-ClwTxtXd.js +3 -0
- package/dist/assets/security-config-DmJw9QZA.js +1 -0
- package/dist/assets/{select-Ea7ffKCE.js → select-rUZ8nIZu.js} +2 -2
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-BR5IokXV.js → sequenceDiagram-DBY2YBRQ-BtRbPQtL.js} +1 -1
- package/dist/assets/{settings-2-CtyN3m_V.js → settings-2-BI4SCkxQ.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-SxG_YnMA.js → sizeCapture-X5ZJPWSS-CMYvM3SL.js} +1 -1
- package/dist/assets/skeleton-CVmEPG43.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-C9l4xsKp.js → tag-chip-BdI_yIOA.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-BcEayhV6.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 +6 -6
- package/src/app/components/layout/app-layout.tsx +38 -2
- package/src/app/hooks/__tests__/use-app-event-consumers.test.ts +20 -0
- package/src/app/hooks/use-app-event-consumers.ts +21 -0
- package/src/app/presenters/app.presenter.ts +6 -0
- package/src/features/apps/components/__tests__/app-packages-panel.test.tsx +312 -0
- package/src/features/apps/components/__tests__/apps-panel.test.tsx +58 -0
- package/src/features/apps/components/app-artwork.tsx +49 -0
- package/src/features/apps/components/app-marketplace-catalog.tsx +332 -0
- package/src/features/apps/components/app-marketplace-cover.tsx +64 -0
- package/src/features/apps/components/app-marketplace-detail.tsx +161 -0
- package/src/features/apps/components/app-marketplace-dialog.tsx +152 -0
- package/src/features/apps/components/app-marketplace-operation.tsx +84 -0
- package/src/features/apps/components/app-package-card.tsx +417 -0
- package/src/features/apps/components/app-packages-panel.tsx +373 -0
- package/src/features/apps/components/apps-panel.tsx +31 -23
- package/src/features/apps/hooks/use-app-marketplace.test.ts +144 -0
- package/src/features/apps/hooks/use-app-marketplace.ts +65 -0
- package/src/features/apps/hooks/use-app-packages.ts +114 -0
- package/src/features/apps/index.ts +1 -0
- package/src/features/apps/managers/__tests__/app-package-operation-settlement.manager.test.ts +81 -0
- package/src/features/apps/managers/app-package-operation-settlement.manager.ts +80 -0
- package/src/features/apps/services/app-marketplace.service.ts +223 -0
- package/src/features/apps/types/app-marketplace.types.ts +75 -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 +49 -1
- package/src/features/chat/features/conversation/components/__tests__/session-conversation-input.streaming.test.tsx +68 -7
- package/src/features/chat/features/conversation/components/session-conversation-area.tsx +25 -4
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +3 -0
- package/src/features/chat/features/conversation/components/session-queued-input-rows.tsx +24 -14
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-controller.test.tsx +53 -0
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-run-queue.test.tsx +18 -0
- package/src/features/chat/features/conversation/hooks/use-chat-composer-reference-intent.ts +4 -1
- package/src/features/chat/features/conversation/hooks/use-session-conversation-controller.ts +126 -32
- package/src/features/chat/features/conversation/hooks/use-session-run-queue.ts +12 -2
- 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 +84 -1
- package/src/features/chat/features/input/utils/chat-composer-token-protocol.utils.ts +10 -0
- package/src/features/chat/features/input/utils/chat-inline-token-composer.utils.ts +148 -0
- package/src/features/chat/features/input/utils/chat-inline-token.utils.ts +55 -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/message/hooks/use-chat-inline-token-actions.ts +8 -1
- package/src/features/chat/features/workspace/components/__tests__/chat-session-workspace-panel-content.test.tsx +155 -18
- 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 +80 -62
- package/src/features/chat/features/workspace/components/chat-session-workspace-panel-content.tsx +9 -2
- package/src/features/chat/features/workspace/components/project-files/workspace-directory-tree.tsx +83 -13
- package/src/features/chat/features/workspace/components/project-files/workspace-project-tree-view.tsx +93 -0
- package/src/features/chat/features/workspace/hooks/use-workspace-explorer-layout.ts +8 -11
- package/src/features/chat/features/workspace/hooks/use-workspace-file-actions.ts +68 -46
- package/src/features/chat/features/workspace/stores/__tests__/workspace-project-tree.store.test.ts +38 -0
- package/src/features/chat/features/workspace/stores/workspace-project-tree.store.ts +160 -0
- package/src/features/chat/index.ts +2 -1
- package/src/features/chat/managers/__tests__/chat-composer-intent.manager.test.ts +29 -0
- package/src/features/chat/managers/chat-composer-intent.manager.ts +29 -2
- package/src/features/chat/managers/chat-draft-intent.manager.ts +18 -2
- package/src/features/chat/presenters/chat.presenter.ts +2 -2
- package/src/features/chat/stores/__tests__/chat-thread.store.test.ts +6 -0
- package/src/features/chat/stores/chat-thread.store.ts +6 -0
- 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/components/__tests__/panel-apps-list.test.tsx +1 -1
- package/src/features/panel-apps/components/panel-apps-list.tsx +1 -6
- 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/__tests__/right-panel-resource-uri.utils.test.ts +34 -0
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +36 -4
- package/src/features/service-apps/components/service-apps-panel.tsx +3 -17
- 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/platforms/desktop/components/desktop-app-shell.tsx +5 -0
- package/src/platforms/mobile/components/mobile-app-shell.tsx +9 -1
- package/src/shared/components/actions/__tests__/navigation-link.test.tsx +12 -0
- package/src/shared/components/actions/navigation-link.tsx +6 -3
- package/src/shared/components/doc-browser/__tests__/doc-browser.test.tsx +34 -0
- package/src/shared/components/doc-browser/doc-browser-tab-strip.tsx +5 -0
- package/src/shared/components/doc-browser/doc-browser.tsx +11 -1
- package/src/shared/components/doc-browser/managers/doc-browser.manager.ts +13 -0
- 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/tabs.tsx +24 -1
- package/src/shared/hooks/use-server-path-watch.ts +42 -0
- package/src/shared/hooks/use-system-object-references.ts +22 -0
- package/src/shared/lib/api/server-path/server-path.types.ts +10 -0
- package/src/shared/lib/api/types.ts +13 -0
- package/src/shared/lib/api/utils/server-path.utils.ts +10 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +17 -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 +82 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +3 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +19 -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 +82 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +3 -0
- package/vite.config.ts +32 -1
- package/dist/assets/appearance-settings-page-BYbvl2wj.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-C5E-LLVd.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-CA_a0AJ5.js +0 -1
- package/dist/assets/confirm-dialog-CxZfenjK.js +0 -5
- package/dist/assets/cynefin-VYW2F7L2-BWg7U2UD.js +0 -1
- package/dist/assets/desktop-update-config-BEKC8Ly9.js +0 -1
- package/dist/assets/doc-browser-Cl2ldE3f.js +0 -1
- package/dist/assets/doc-browser-DXCSd63E.js +0 -1
- package/dist/assets/doc-browser-context-FDPs3gJf.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/gitGraph-TEB2WS4Q-DPxNwsFd.js +0 -1
- package/dist/assets/i18n-provider-DkITJNz8.js +0 -1
- package/dist/assets/index-CQ2LcI2p.css +0 -1
- package/dist/assets/index-CrdfvBVg.js +0 -107
- package/dist/assets/info-DKCQHKI2-DNlNGH90.js +0 -1
- package/dist/assets/loader-circle-DHtUxCIA.js +0 -1
- package/dist/assets/mcp-marketplace-page-Bc_jI5iH.js +0 -9
- package/dist/assets/mcp-marketplace-page-CzCieD9r.js +0 -1
- package/dist/assets/model-config-page-C4jw-pcj.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-CG1RwZQq.js +0 -1
- package/dist/assets/provider-scoped-model-input-CmH4BFvc.js +0 -1
- package/dist/assets/providers-config-page-CJQjwzaw.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-DjFBVA0n.js +0 -8
- package/dist/assets/remote-BIlpD3yL.js +0 -1
- package/dist/assets/rotate-cw-bKG8zH8M.js +0 -1
- package/dist/assets/runtime-config-page-B_x2Glz5.js +0 -1
- package/dist/assets/search-config-page-BaIijtmO.js +0 -1
- package/dist/assets/secrets-config-page-CJjtdFAl.js +0 -3
- package/dist/assets/security-config-DB8apj09.js +0 -1
- package/dist/assets/skeleton-Bt6zxcAB.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/wardley-OPB4EBWU-CoWturk0.js +0 -1
- package/dist/assets/x-CowtCu9Z.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,152 @@
|
|
|
1
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import type { AppPackageOperationView, AppPackageView } from '@nextclaw/client-sdk';
|
|
3
|
+
import { ArrowLeft, ShieldCheck } from 'lucide-react';
|
|
4
|
+
import {
|
|
5
|
+
AppMarketplaceCatalog,
|
|
6
|
+
type MarketplaceFilter,
|
|
7
|
+
} from '@/features/apps/components/app-marketplace-catalog';
|
|
8
|
+
import { MarketplaceDetail } from '@/features/apps/components/app-marketplace-detail';
|
|
9
|
+
import { findLatestAppPackageOperation } from '@/features/apps/components/app-marketplace-operation';
|
|
10
|
+
import {
|
|
11
|
+
useAppMarketplace,
|
|
12
|
+
useAppMarketplaceDetail,
|
|
13
|
+
} from '@/features/apps/hooks/use-app-marketplace';
|
|
14
|
+
import { buildLocaleFallbacks } from '@/features/marketplace';
|
|
15
|
+
import {
|
|
16
|
+
Dialog,
|
|
17
|
+
DialogContent,
|
|
18
|
+
} from '@/shared/components/ui/dialog';
|
|
19
|
+
import { getLanguage, t } from '@/shared/lib/i18n';
|
|
20
|
+
|
|
21
|
+
const HIDDEN_ENGINEERING_APPS = new Set([
|
|
22
|
+
'nextclaw.starter-card',
|
|
23
|
+
'nextclaw.validation-task-board',
|
|
24
|
+
]);
|
|
25
|
+
|
|
26
|
+
export function AppMarketplaceDialog({
|
|
27
|
+
error,
|
|
28
|
+
installedPackages,
|
|
29
|
+
isStarting,
|
|
30
|
+
onInstall,
|
|
31
|
+
onOpenChange,
|
|
32
|
+
onUpdate,
|
|
33
|
+
open,
|
|
34
|
+
operations,
|
|
35
|
+
startingSource,
|
|
36
|
+
}: {
|
|
37
|
+
error: Error | null;
|
|
38
|
+
installedPackages: AppPackageView[];
|
|
39
|
+
isStarting: boolean;
|
|
40
|
+
onInstall: (source: string, registryUrl: string) => void;
|
|
41
|
+
onOpenChange: (open: boolean) => void;
|
|
42
|
+
onUpdate: (appId: string) => void;
|
|
43
|
+
open: boolean;
|
|
44
|
+
operations: AppPackageOperationView[];
|
|
45
|
+
startingSource?: string;
|
|
46
|
+
}) {
|
|
47
|
+
const [filter, setFilter] = useState<MarketplaceFilter>('all');
|
|
48
|
+
const [search, setSearch] = useState('');
|
|
49
|
+
const [debouncedSearch, setDebouncedSearch] = useState('');
|
|
50
|
+
const [selectedSlug, setSelectedSlug] = useState<string | null>(null);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const timer = window.setTimeout(() => setDebouncedSearch(search.trim()), 250);
|
|
53
|
+
return () => window.clearTimeout(timer);
|
|
54
|
+
}, [search]);
|
|
55
|
+
const marketplaceParams = useMemo(() => ({
|
|
56
|
+
q: debouncedSearch || undefined,
|
|
57
|
+
featured: filter === 'featured' ? true : undefined,
|
|
58
|
+
tags: filter === 'personal'
|
|
59
|
+
? ['personal', 'productivity', 'notes', 'calendar']
|
|
60
|
+
: undefined,
|
|
61
|
+
tag: filter === 'local'
|
|
62
|
+
? 'local'
|
|
63
|
+
: undefined,
|
|
64
|
+
sort: debouncedSearch ? 'relevance' as const : 'featured' as const,
|
|
65
|
+
}), [debouncedSearch, filter]);
|
|
66
|
+
const marketplace = useAppMarketplace(marketplaceParams, open);
|
|
67
|
+
const detail = useAppMarketplaceDetail(selectedSlug, open);
|
|
68
|
+
const installedById = useMemo(
|
|
69
|
+
() => new Map(installedPackages.map((entry) => [entry.id, entry])),
|
|
70
|
+
[installedPackages],
|
|
71
|
+
);
|
|
72
|
+
const localeFallbacks = buildLocaleFallbacks(getLanguage() === 'zh' ? 'zh-CN' : 'en-US');
|
|
73
|
+
const items = useMemo(
|
|
74
|
+
() => (marketplace.data?.items ?? []).filter(
|
|
75
|
+
(item) => !HIDDEN_ENGINEERING_APPS.has(item.appId),
|
|
76
|
+
),
|
|
77
|
+
[marketplace.data?.items],
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const closeDialog = (nextOpen: boolean) => {
|
|
81
|
+
if (!nextOpen) setSelectedSlug(null);
|
|
82
|
+
onOpenChange(nextOpen);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Dialog open={open} onOpenChange={closeDialog}>
|
|
87
|
+
<DialogContent className="flex h-dvh w-screen max-w-none flex-col gap-0 overflow-hidden rounded-none border-0 bg-background/95 p-0 shadow-[0_32px_100px_rgba(0,0,0,0.24)] backdrop-blur-xl [&>button.absolute]:top-[max(1rem,env(safe-area-inset-top))] sm:h-[min(680px,calc(100dvh-4rem))] sm:w-[min(920px,calc(100vw-3rem))] sm:max-w-none sm:rounded-2xl sm:border sm:border-border/55">
|
|
88
|
+
{selectedSlug ? (
|
|
89
|
+
<>
|
|
90
|
+
<MarketplaceDetailHeader onBack={() => setSelectedSlug(null)} />
|
|
91
|
+
<div className="custom-scrollbar min-h-0 flex-1 overflow-y-auto bg-background">
|
|
92
|
+
<MarketplaceDetail
|
|
93
|
+
detail={detail.data}
|
|
94
|
+
error={detail.error instanceof Error ? detail.error : null}
|
|
95
|
+
installedPackage={detail.data ? installedById.get(detail.data.appId) : undefined}
|
|
96
|
+
isLoading={detail.isLoading}
|
|
97
|
+
isStarting={isStarting && detail.data?.install.spec === startingSource}
|
|
98
|
+
localeFallbacks={localeFallbacks}
|
|
99
|
+
onInstall={onInstall}
|
|
100
|
+
onUpdate={onUpdate}
|
|
101
|
+
operation={detail.data
|
|
102
|
+
? findLatestAppPackageOperation(operations, detail.data.appId, detail.data.install.spec)
|
|
103
|
+
: undefined}
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</>
|
|
107
|
+
) : (
|
|
108
|
+
<AppMarketplaceCatalog
|
|
109
|
+
error={error}
|
|
110
|
+
filter={filter}
|
|
111
|
+
installedById={installedById}
|
|
112
|
+
isError={marketplace.isError}
|
|
113
|
+
isFetchingNextPage={marketplace.isFetchingNextPage}
|
|
114
|
+
isLoading={marketplace.isLoading}
|
|
115
|
+
isStarting={isStarting}
|
|
116
|
+
items={items}
|
|
117
|
+
localeFallbacks={localeFallbacks}
|
|
118
|
+
onFilterChange={setFilter}
|
|
119
|
+
onInstall={onInstall}
|
|
120
|
+
onLoadMore={() => void marketplace.fetchNextPage()}
|
|
121
|
+
onSearchChange={setSearch}
|
|
122
|
+
onSelect={setSelectedSlug}
|
|
123
|
+
onUpdate={onUpdate}
|
|
124
|
+
operations={operations}
|
|
125
|
+
hasNextPage={marketplace.hasNextPage}
|
|
126
|
+
search={search}
|
|
127
|
+
startingSource={startingSource}
|
|
128
|
+
/>
|
|
129
|
+
)}
|
|
130
|
+
<div className="flex items-start gap-2 border-t border-border/60 bg-muted/25 px-5 pb-[max(.75rem,env(safe-area-inset-bottom))] pt-3 text-[11px] leading-4 text-muted-foreground sm:px-6 sm:pb-3">
|
|
131
|
+
<ShieldCheck className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
|
132
|
+
<span>{t('appPackagesMarketplaceTrustHint')}</span>
|
|
133
|
+
</div>
|
|
134
|
+
</DialogContent>
|
|
135
|
+
</Dialog>
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function MarketplaceDetailHeader({ onBack }: { onBack: () => void }) {
|
|
140
|
+
return (
|
|
141
|
+
<div className="border-b border-border/60 bg-card px-4 pb-3 pt-[max(.75rem,env(safe-area-inset-top))] sm:px-5 sm:pt-3">
|
|
142
|
+
<button
|
|
143
|
+
type="button"
|
|
144
|
+
onClick={onBack}
|
|
145
|
+
className="inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border"
|
|
146
|
+
>
|
|
147
|
+
<ArrowLeft className="h-4 w-4" />
|
|
148
|
+
{t('appPackagesBackToMarketplace')}
|
|
149
|
+
</button>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { AppPackageOperationView } from '@nextclaw/client-sdk';
|
|
2
|
+
import { Check, LoaderCircle } from 'lucide-react';
|
|
3
|
+
import { Button } from '@/shared/components/ui/button';
|
|
4
|
+
import { t } from '@/shared/lib/i18n';
|
|
5
|
+
import { cn } from '@/shared/lib/utils';
|
|
6
|
+
|
|
7
|
+
export function MarketplaceInstallButton({
|
|
8
|
+
active,
|
|
9
|
+
canUpdate,
|
|
10
|
+
failed,
|
|
11
|
+
installed,
|
|
12
|
+
isStarting,
|
|
13
|
+
onAction,
|
|
14
|
+
operation,
|
|
15
|
+
}: {
|
|
16
|
+
active: boolean;
|
|
17
|
+
canUpdate: boolean;
|
|
18
|
+
failed: boolean;
|
|
19
|
+
installed: boolean;
|
|
20
|
+
isStarting: boolean;
|
|
21
|
+
onAction: () => void;
|
|
22
|
+
operation?: AppPackageOperationView;
|
|
23
|
+
}) {
|
|
24
|
+
return (
|
|
25
|
+
<Button
|
|
26
|
+
type="button"
|
|
27
|
+
size="sm"
|
|
28
|
+
variant={installed && !canUpdate || active ? 'secondary' : 'default'}
|
|
29
|
+
disabled={installed && !canUpdate || active || isStarting}
|
|
30
|
+
onClick={onAction}
|
|
31
|
+
className="shrink-0 rounded-full px-4"
|
|
32
|
+
>
|
|
33
|
+
{installed && !canUpdate ? (
|
|
34
|
+
<><Check className="mr-1.5 h-3.5 w-3.5" />{t('appPackagesMarketplaceInstalled')}</>
|
|
35
|
+
) : active || isStarting ? (
|
|
36
|
+
<><LoaderCircle className="mr-1.5 h-3.5 w-3.5 animate-spin" />{operation ? operationStatusLabel(operation) : t('appPackagesPreparing')}</>
|
|
37
|
+
) : canUpdate ? t('appPackagesUpdate') : failed ? t('appPackagesRetry') : t('appPackagesInstall')}
|
|
38
|
+
</Button>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function OperationProgress({ operation }: { operation: AppPackageOperationView }) {
|
|
43
|
+
const progress = Math.max(4, Math.round((operation.completedSteps / operation.totalSteps) * 100));
|
|
44
|
+
const failed = operation.status === 'failed' || operation.status === 'interrupted';
|
|
45
|
+
return (
|
|
46
|
+
<div className="mt-2" role={failed ? 'alert' : 'status'} aria-live="polite">
|
|
47
|
+
<div className="h-1 overflow-hidden rounded-full bg-muted">
|
|
48
|
+
<div
|
|
49
|
+
className={cn('h-full rounded-full transition-[width] duration-300', failed ? 'bg-destructive' : 'bg-primary')}
|
|
50
|
+
style={{ width: failed ? '100%' : `${progress}%` }}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
<p className={cn('mt-1.5 truncate text-[11px]', failed ? 'text-destructive' : 'text-muted-foreground')}>
|
|
54
|
+
{failed ? operation.error ?? t('appPackagesActionFailed') : operationStatusLabel(operation)}
|
|
55
|
+
</p>
|
|
56
|
+
</div>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function findLatestAppPackageOperation(
|
|
61
|
+
operations: AppPackageOperationView[],
|
|
62
|
+
appId: string,
|
|
63
|
+
source: string,
|
|
64
|
+
): AppPackageOperationView | undefined {
|
|
65
|
+
return operations.find((entry) => entry.appId === appId || entry.source === source);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function operationStatusLabel(operation: AppPackageOperationView): string {
|
|
69
|
+
switch (operation.status) {
|
|
70
|
+
case 'queued': return t('appPackagesPreparing');
|
|
71
|
+
case 'resolving': return t('appPackagesResolving');
|
|
72
|
+
case 'downloading': return t('appPackagesDownloading');
|
|
73
|
+
case 'verifying': return t('appPackagesVerifying');
|
|
74
|
+
case 'installing': return operation.action === 'rollback'
|
|
75
|
+
? t('appPackagesSwitchingVersion')
|
|
76
|
+
: operation.action === 'uninstall'
|
|
77
|
+
? t('appPackagesUninstalling')
|
|
78
|
+
: t('appPackagesInstalling');
|
|
79
|
+
case 'finalizing': return t('appPackagesFinalizing');
|
|
80
|
+
case 'succeeded': return t('appPackagesCompleted');
|
|
81
|
+
case 'failed':
|
|
82
|
+
case 'interrupted': return t('appPackagesActionFailed');
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { AppPackageOperationView, AppPackageView } from '@nextclaw/client-sdk';
|
|
3
|
+
import {
|
|
4
|
+
AlertCircle,
|
|
5
|
+
AppWindow,
|
|
6
|
+
Bookmark,
|
|
7
|
+
CalendarDays,
|
|
8
|
+
Check,
|
|
9
|
+
CheckSquare2,
|
|
10
|
+
ChevronRight,
|
|
11
|
+
MoreHorizontal,
|
|
12
|
+
NotebookText,
|
|
13
|
+
RefreshCw,
|
|
14
|
+
RotateCcw,
|
|
15
|
+
Server,
|
|
16
|
+
Trash2,
|
|
17
|
+
LoaderCircle,
|
|
18
|
+
type LucideIcon,
|
|
19
|
+
} from 'lucide-react';
|
|
20
|
+
import { AppArtwork } from '@/features/apps/components/app-artwork';
|
|
21
|
+
import { isAppPackageOperationActive } from '@/features/apps/hooks/use-app-packages';
|
|
22
|
+
import type { PanelAppEntryView } from '@/shared/lib/api';
|
|
23
|
+
import { Button } from '@/shared/components/ui/button';
|
|
24
|
+
import { Card } from '@/shared/components/ui/card';
|
|
25
|
+
import {
|
|
26
|
+
Dialog,
|
|
27
|
+
DialogContent,
|
|
28
|
+
DialogDescription,
|
|
29
|
+
DialogFooter,
|
|
30
|
+
DialogHeader,
|
|
31
|
+
DialogTitle,
|
|
32
|
+
} from '@/shared/components/ui/dialog';
|
|
33
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@/shared/components/ui/popover';
|
|
34
|
+
import { getLanguage, t } from '@/shared/lib/i18n';
|
|
35
|
+
import { cn } from '@/shared/lib/utils';
|
|
36
|
+
|
|
37
|
+
export function AppPackageCard({
|
|
38
|
+
appPackage,
|
|
39
|
+
isPending,
|
|
40
|
+
operation,
|
|
41
|
+
onDisable,
|
|
42
|
+
onEnable,
|
|
43
|
+
onOpenPanelApp,
|
|
44
|
+
onRollback,
|
|
45
|
+
onUninstall,
|
|
46
|
+
onUpdate,
|
|
47
|
+
panelApps,
|
|
48
|
+
}: {
|
|
49
|
+
appPackage: AppPackageView;
|
|
50
|
+
isPending: boolean;
|
|
51
|
+
operation?: AppPackageOperationView;
|
|
52
|
+
onDisable: () => void;
|
|
53
|
+
onEnable: () => void;
|
|
54
|
+
onOpenPanelApp: (entry: PanelAppEntryView) => void;
|
|
55
|
+
onRollback: (version: string) => void;
|
|
56
|
+
onUninstall: (purgeData: boolean) => void;
|
|
57
|
+
onUpdate: () => void;
|
|
58
|
+
panelApps: PanelAppEntryView[];
|
|
59
|
+
}) {
|
|
60
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
61
|
+
const [uninstallOpen, setUninstallOpen] = useState(false);
|
|
62
|
+
const [purgeData, setPurgeData] = useState(false);
|
|
63
|
+
const panelComponents = appPackage.components.filter((component) => component.kind === 'panel');
|
|
64
|
+
const serviceCount = appPackage.components.length - panelComponents.length;
|
|
65
|
+
const rollbackVersions = appPackage.installedVersions.filter(
|
|
66
|
+
(version) => version !== appPackage.activeVersion,
|
|
67
|
+
);
|
|
68
|
+
const displayName = readLocalizedText(appPackage.name, appPackage.nameI18n) ?? appPackage.id;
|
|
69
|
+
const displayDescription = readLocalizedText(
|
|
70
|
+
appPackage.description,
|
|
71
|
+
appPackage.descriptionI18n,
|
|
72
|
+
);
|
|
73
|
+
const operationActive = operation ? isAppPackageOperationActive(operation.status) : false;
|
|
74
|
+
const pending = isPending || operationActive;
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<Card surface="flat" hover={false} className="overflow-hidden border-border/60 shadow-[0_1px_2px_rgba(0,0,0,0.025)]">
|
|
78
|
+
<div className="flex items-start gap-3.5 px-4 pb-3.5 pt-4">
|
|
79
|
+
<AppArtwork icon={appPackage.icon} name={displayName} />
|
|
80
|
+
<div className="min-w-0 flex-1">
|
|
81
|
+
<div className="flex min-w-0 items-center gap-2">
|
|
82
|
+
<h2 className="truncate text-sm font-semibold text-foreground">{displayName}</h2>
|
|
83
|
+
<span className={cn(
|
|
84
|
+
'shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium',
|
|
85
|
+
appPackage.enabled
|
|
86
|
+
? 'bg-emerald-500/10 text-emerald-700 dark:text-emerald-300'
|
|
87
|
+
: 'bg-muted text-muted-foreground',
|
|
88
|
+
)}>
|
|
89
|
+
{appPackage.enabled ? t('appPackagesEnabled') : t('appPackagesAvailable')}
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
{displayDescription ? (
|
|
93
|
+
<p className="mt-1 line-clamp-2 text-xs leading-5 text-muted-foreground">
|
|
94
|
+
{displayDescription}
|
|
95
|
+
</p>
|
|
96
|
+
) : null}
|
|
97
|
+
<div className="mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground/75">
|
|
98
|
+
<span>v{appPackage.activeVersion}</span>
|
|
99
|
+
{appPackage.builtIn ? <span>{t('appPackagesBuiltIn')}</span> : null}
|
|
100
|
+
{serviceCount > 0 ? (
|
|
101
|
+
<span className="inline-flex items-center gap-1">
|
|
102
|
+
<Server className="h-3 w-3" />
|
|
103
|
+
{t('appPackagesLocalService')}
|
|
104
|
+
</span>
|
|
105
|
+
) : null}
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="flex shrink-0 items-center gap-1">
|
|
109
|
+
<Button
|
|
110
|
+
type="button"
|
|
111
|
+
size="sm"
|
|
112
|
+
variant={appPackage.enabled ? 'outline' : 'default'}
|
|
113
|
+
disabled={pending}
|
|
114
|
+
onClick={appPackage.enabled ? onDisable : onEnable}
|
|
115
|
+
>
|
|
116
|
+
{renderPrimaryActionLabel({
|
|
117
|
+
enabled: appPackage.enabled,
|
|
118
|
+
isPending,
|
|
119
|
+
operation,
|
|
120
|
+
operationActive,
|
|
121
|
+
})}
|
|
122
|
+
</Button>
|
|
123
|
+
<Popover open={menuOpen} onOpenChange={setMenuOpen}>
|
|
124
|
+
<PopoverTrigger asChild>
|
|
125
|
+
<button
|
|
126
|
+
type="button"
|
|
127
|
+
aria-label={t('appPackagesMoreActions')}
|
|
128
|
+
title={t('appPackagesMoreActions')}
|
|
129
|
+
disabled={pending}
|
|
130
|
+
className="rounded-full p-2 text-muted-foreground transition-colors hover:bg-[var(--interaction-hover)] hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:opacity-50"
|
|
131
|
+
>
|
|
132
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
133
|
+
</button>
|
|
134
|
+
</PopoverTrigger>
|
|
135
|
+
<PopoverContent align="end" className="w-52 rounded-xl p-1.5">
|
|
136
|
+
<AppPackageMenuItem
|
|
137
|
+
icon={RefreshCw}
|
|
138
|
+
label={t('appPackagesCheckUpdate')}
|
|
139
|
+
onClick={() => {
|
|
140
|
+
setMenuOpen(false);
|
|
141
|
+
onUpdate();
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
{rollbackVersions.map((version) => (
|
|
145
|
+
<AppPackageMenuItem
|
|
146
|
+
key={version}
|
|
147
|
+
icon={RotateCcw}
|
|
148
|
+
label={`${t('appPackagesRollback')} v${version}`}
|
|
149
|
+
onClick={() => {
|
|
150
|
+
setMenuOpen(false);
|
|
151
|
+
onRollback(version);
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
))}
|
|
155
|
+
<AppPackageMenuItem
|
|
156
|
+
destructive
|
|
157
|
+
icon={Trash2}
|
|
158
|
+
label={t('appPackagesUninstall')}
|
|
159
|
+
onClick={() => {
|
|
160
|
+
setMenuOpen(false);
|
|
161
|
+
setUninstallOpen(true);
|
|
162
|
+
}}
|
|
163
|
+
/>
|
|
164
|
+
</PopoverContent>
|
|
165
|
+
</Popover>
|
|
166
|
+
</div>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
{operation && (operationActive || operation.status === 'failed' || operation.status === 'interrupted') ? (
|
|
170
|
+
<PackageOperationStatus operation={operation} />
|
|
171
|
+
) : null}
|
|
172
|
+
|
|
173
|
+
{panelComponents.length > 0 ? (
|
|
174
|
+
<div className="border-t border-border/60 bg-muted/20 p-2">
|
|
175
|
+
<div className="grid grid-cols-2 gap-1.5">
|
|
176
|
+
{panelComponents.map((component) => {
|
|
177
|
+
const panelApp = panelApps.find((entry) => entry.appId === component.id);
|
|
178
|
+
const Icon = resolveComponentIcon(component.id);
|
|
179
|
+
const componentTitle = readLocalizedText(component.title, component.titleI18n)
|
|
180
|
+
?? component.id;
|
|
181
|
+
return (
|
|
182
|
+
<button
|
|
183
|
+
key={component.id}
|
|
184
|
+
type="button"
|
|
185
|
+
disabled={!appPackage.enabled || !panelApp || pending}
|
|
186
|
+
onClick={() => panelApp && onOpenPanelApp({
|
|
187
|
+
...panelApp,
|
|
188
|
+
title: componentTitle,
|
|
189
|
+
description: readLocalizedText(
|
|
190
|
+
component.description,
|
|
191
|
+
component.descriptionI18n,
|
|
192
|
+
),
|
|
193
|
+
})}
|
|
194
|
+
className="group flex min-w-0 items-center gap-2 rounded-lg px-2.5 py-2 text-left transition-colors hover:bg-[var(--interaction-hover)] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border disabled:cursor-default disabled:opacity-55"
|
|
195
|
+
title={!appPackage.enabled ? t('appPackagesEnableToOpen') : componentTitle}
|
|
196
|
+
>
|
|
197
|
+
<span className="flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-card text-muted-foreground shadow-sm ring-1 ring-border/60">
|
|
198
|
+
<ComponentIcon icon={component.icon} fallback={Icon} />
|
|
199
|
+
</span>
|
|
200
|
+
<span className="min-w-0 flex-1 truncate text-xs font-medium text-foreground">
|
|
201
|
+
{componentTitle}
|
|
202
|
+
</span>
|
|
203
|
+
{appPackage.enabled ? (
|
|
204
|
+
<ChevronRight className="h-3.5 w-3.5 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5" />
|
|
205
|
+
) : null}
|
|
206
|
+
</button>
|
|
207
|
+
);
|
|
208
|
+
})}
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
) : null}
|
|
212
|
+
|
|
213
|
+
<Dialog open={uninstallOpen} onOpenChange={setUninstallOpen}>
|
|
214
|
+
<DialogContent className="max-w-md [&>:last-child]:hidden">
|
|
215
|
+
<DialogHeader>
|
|
216
|
+
<DialogTitle>{t('appPackagesUninstallTitle')}</DialogTitle>
|
|
217
|
+
<DialogDescription>{t('appPackagesUninstallDescription')}</DialogDescription>
|
|
218
|
+
</DialogHeader>
|
|
219
|
+
<div className="mt-4 grid gap-2">
|
|
220
|
+
<DataChoice
|
|
221
|
+
checked={!purgeData}
|
|
222
|
+
description={t('appPackagesKeepDataDescription')}
|
|
223
|
+
label={t('appPackagesKeepData')}
|
|
224
|
+
onClick={() => setPurgeData(false)}
|
|
225
|
+
/>
|
|
226
|
+
<DataChoice
|
|
227
|
+
checked={purgeData}
|
|
228
|
+
destructive
|
|
229
|
+
description={t('appPackagesDeleteDataDescription')}
|
|
230
|
+
label={t('appPackagesDeleteData')}
|
|
231
|
+
onClick={() => setPurgeData(true)}
|
|
232
|
+
/>
|
|
233
|
+
</div>
|
|
234
|
+
<DialogFooter className="mt-5 gap-2 sm:gap-0">
|
|
235
|
+
<Button type="button" variant="outline" onClick={() => setUninstallOpen(false)}>
|
|
236
|
+
{t('cancel')}
|
|
237
|
+
</Button>
|
|
238
|
+
<Button
|
|
239
|
+
type="button"
|
|
240
|
+
variant="destructive"
|
|
241
|
+
onClick={() => {
|
|
242
|
+
onUninstall(purgeData);
|
|
243
|
+
setUninstallOpen(false);
|
|
244
|
+
}}
|
|
245
|
+
>
|
|
246
|
+
{t('appPackagesUninstall')}
|
|
247
|
+
</Button>
|
|
248
|
+
</DialogFooter>
|
|
249
|
+
</DialogContent>
|
|
250
|
+
</Dialog>
|
|
251
|
+
</Card>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function renderPrimaryActionLabel({
|
|
256
|
+
enabled,
|
|
257
|
+
isPending,
|
|
258
|
+
operation,
|
|
259
|
+
operationActive,
|
|
260
|
+
}: {
|
|
261
|
+
enabled: boolean;
|
|
262
|
+
isPending: boolean;
|
|
263
|
+
operation?: AppPackageOperationView;
|
|
264
|
+
operationActive: boolean;
|
|
265
|
+
}) {
|
|
266
|
+
if (operationActive) {
|
|
267
|
+
return (
|
|
268
|
+
<>
|
|
269
|
+
<LoaderCircle className="mr-1.5 h-3.5 w-3.5 animate-spin" />
|
|
270
|
+
{operation ? operationLabel(operation) : t('appPackagesWorking')}
|
|
271
|
+
</>
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
if (isPending) return t('appPackagesWorking');
|
|
275
|
+
return enabled ? t('appPackagesDisable') : t('appPackagesEnable');
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function DataChoice({
|
|
279
|
+
checked,
|
|
280
|
+
description,
|
|
281
|
+
destructive = false,
|
|
282
|
+
label,
|
|
283
|
+
onClick,
|
|
284
|
+
}: {
|
|
285
|
+
checked: boolean;
|
|
286
|
+
description: string;
|
|
287
|
+
destructive?: boolean;
|
|
288
|
+
label: string;
|
|
289
|
+
onClick: () => void;
|
|
290
|
+
}) {
|
|
291
|
+
return (
|
|
292
|
+
<button
|
|
293
|
+
type="button"
|
|
294
|
+
aria-pressed={checked}
|
|
295
|
+
onClick={onClick}
|
|
296
|
+
className={cn(
|
|
297
|
+
'flex items-start gap-3 rounded-xl border px-3 py-3 text-left transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-border',
|
|
298
|
+
checked ? 'border-foreground/25 bg-muted/55' : 'border-border/60 hover:bg-muted/35',
|
|
299
|
+
)}
|
|
300
|
+
>
|
|
301
|
+
<span className={cn(
|
|
302
|
+
'mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border',
|
|
303
|
+
checked ? 'border-foreground bg-foreground text-background' : 'border-border',
|
|
304
|
+
)}>
|
|
305
|
+
{checked ? <Check className="h-2.5 w-2.5" /> : null}
|
|
306
|
+
</span>
|
|
307
|
+
<span>
|
|
308
|
+
<span className={cn('block text-sm font-medium', destructive ? 'text-destructive' : 'text-foreground')}>{label}</span>
|
|
309
|
+
<span className="mt-0.5 block text-xs leading-5 text-muted-foreground">{description}</span>
|
|
310
|
+
</span>
|
|
311
|
+
</button>
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function AppPackageMenuItem({
|
|
316
|
+
destructive = false,
|
|
317
|
+
icon: Icon,
|
|
318
|
+
label,
|
|
319
|
+
onClick,
|
|
320
|
+
}: {
|
|
321
|
+
destructive?: boolean;
|
|
322
|
+
icon: LucideIcon;
|
|
323
|
+
label: string;
|
|
324
|
+
onClick: () => void;
|
|
325
|
+
}) {
|
|
326
|
+
return (
|
|
327
|
+
<button
|
|
328
|
+
type="button"
|
|
329
|
+
onClick={onClick}
|
|
330
|
+
className={cn(
|
|
331
|
+
'flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left text-sm transition-colors',
|
|
332
|
+
destructive
|
|
333
|
+
? 'text-destructive hover:bg-destructive/10'
|
|
334
|
+
: 'text-muted-foreground hover:bg-[var(--interaction-hover)] hover:text-accent-foreground',
|
|
335
|
+
)}
|
|
336
|
+
>
|
|
337
|
+
<Icon className="h-4 w-4 shrink-0" />
|
|
338
|
+
<span>{label}</span>
|
|
339
|
+
</button>
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function ComponentIcon({
|
|
344
|
+
fallback: Fallback,
|
|
345
|
+
icon,
|
|
346
|
+
}: {
|
|
347
|
+
fallback: LucideIcon;
|
|
348
|
+
icon?: string;
|
|
349
|
+
}) {
|
|
350
|
+
if (icon && (
|
|
351
|
+
icon.startsWith('data:') ||
|
|
352
|
+
icon.startsWith('/') ||
|
|
353
|
+
icon.startsWith('http://') ||
|
|
354
|
+
icon.startsWith('https://')
|
|
355
|
+
)) {
|
|
356
|
+
return <img src={icon} alt="" className="h-4 w-4 rounded object-cover" />;
|
|
357
|
+
}
|
|
358
|
+
if (icon) {
|
|
359
|
+
return <span className="text-sm leading-none">{icon}</span>;
|
|
360
|
+
}
|
|
361
|
+
return <Fallback className="h-3.5 w-3.5" />;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
function PackageOperationStatus({ operation }: { operation: AppPackageOperationView }) {
|
|
365
|
+
const failed = operation.status === 'failed' || operation.status === 'interrupted';
|
|
366
|
+
const progress = Math.max(4, Math.round((operation.completedSteps / operation.totalSteps) * 100));
|
|
367
|
+
return (
|
|
368
|
+
<div className="border-t border-border/50 px-4 py-2.5" role={failed ? 'alert' : 'status'} aria-live="polite">
|
|
369
|
+
<div className="flex items-center gap-2 text-[11px]">
|
|
370
|
+
{failed ? <AlertCircle className="h-3.5 w-3.5 text-destructive" /> : <LoaderCircle className="h-3.5 w-3.5 animate-spin text-primary" />}
|
|
371
|
+
<span className={failed ? 'text-destructive' : 'text-muted-foreground'}>
|
|
372
|
+
{failed ? operation.error ?? t('appPackagesActionFailed') : operationLabel(operation)}
|
|
373
|
+
</span>
|
|
374
|
+
</div>
|
|
375
|
+
<div className="mt-2 h-1 overflow-hidden rounded-full bg-muted">
|
|
376
|
+
<div
|
|
377
|
+
className={cn('h-full rounded-full transition-[width] duration-300', failed ? 'bg-destructive' : 'bg-primary')}
|
|
378
|
+
style={{ width: failed ? '100%' : `${progress}%` }}
|
|
379
|
+
/>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
function operationLabel(operation: AppPackageOperationView): string {
|
|
386
|
+
switch (operation.status) {
|
|
387
|
+
case 'queued': return t('appPackagesPreparing');
|
|
388
|
+
case 'resolving': return t('appPackagesResolving');
|
|
389
|
+
case 'downloading': return t('appPackagesDownloading');
|
|
390
|
+
case 'verifying': return t('appPackagesVerifying');
|
|
391
|
+
case 'installing': return operation.action === 'rollback'
|
|
392
|
+
? `${t('appPackagesSwitchingVersion')} ${operation.targetVersion ? `v${operation.targetVersion}` : ''}`.trim()
|
|
393
|
+
: operation.action === 'uninstall'
|
|
394
|
+
? t('appPackagesUninstalling')
|
|
395
|
+
: t('appPackagesInstalling');
|
|
396
|
+
case 'finalizing': return t('appPackagesFinalizing');
|
|
397
|
+
case 'succeeded': return t('appPackagesCompleted');
|
|
398
|
+
case 'failed':
|
|
399
|
+
case 'interrupted': return t('appPackagesActionFailed');
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function resolveComponentIcon(componentId: string): LucideIcon {
|
|
404
|
+
if (componentId.endsWith('-todos')) return CheckSquare2;
|
|
405
|
+
if (componentId.endsWith('-notes')) return NotebookText;
|
|
406
|
+
if (componentId.endsWith('-favorites')) return Bookmark;
|
|
407
|
+
if (componentId.endsWith('-calendar')) return CalendarDays;
|
|
408
|
+
return AppWindow;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function readLocalizedText(
|
|
412
|
+
fallback: string | undefined,
|
|
413
|
+
localized: Record<string, string> | undefined,
|
|
414
|
+
): string | undefined {
|
|
415
|
+
const languageTag = getLanguage() === 'zh' ? 'zh-CN' : 'en-US';
|
|
416
|
+
return localized?.[languageTag] ?? fallback;
|
|
417
|
+
}
|