@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,373 @@
|
|
|
1
|
+
import { useMemo, useState, type FormEvent } from 'react';
|
|
2
|
+
import type { AppPackageOperationView, AppPackageView } from '@nextclaw/client-sdk';
|
|
3
|
+
import { LoaderCircle, PackagePlus, RefreshCw, ShieldCheck, Store } from 'lucide-react';
|
|
4
|
+
import { AppArtwork } from '@/features/apps/components/app-artwork';
|
|
5
|
+
import type { PanelAppEntryView } from '@/shared/lib/api';
|
|
6
|
+
import { useAppPresenter } from '@/app/components/app-presenter-provider';
|
|
7
|
+
import { AppMarketplaceDialog } from '@/features/apps/components/app-marketplace-dialog';
|
|
8
|
+
import { AppPackageCard } from '@/features/apps/components/app-package-card';
|
|
9
|
+
import {
|
|
10
|
+
useAppPackageMutation,
|
|
11
|
+
useAppPackageOperationSettlement,
|
|
12
|
+
useAppPackageOperations,
|
|
13
|
+
useAppPackages,
|
|
14
|
+
isAppPackageOperationActive,
|
|
15
|
+
type AppPackageMutationInput,
|
|
16
|
+
} from '@/features/apps/hooks/use-app-packages';
|
|
17
|
+
import {
|
|
18
|
+
useGrantPanelAppClient,
|
|
19
|
+
usePanelApps,
|
|
20
|
+
useRecordPanelAppOpened,
|
|
21
|
+
} from '@/features/panel-apps';
|
|
22
|
+
import { Button } from '@/shared/components/ui/button';
|
|
23
|
+
import {
|
|
24
|
+
Dialog,
|
|
25
|
+
DialogContent,
|
|
26
|
+
DialogDescription,
|
|
27
|
+
DialogFooter,
|
|
28
|
+
DialogHeader,
|
|
29
|
+
DialogTitle,
|
|
30
|
+
} from '@/shared/components/ui/dialog';
|
|
31
|
+
import { Input } from '@/shared/components/ui/input';
|
|
32
|
+
import { Skeleton } from '@/shared/components/ui/skeleton';
|
|
33
|
+
import { t } from '@/shared/lib/i18n';
|
|
34
|
+
|
|
35
|
+
export function AppPackagesPanel({
|
|
36
|
+
onOpenPanelApp,
|
|
37
|
+
}: {
|
|
38
|
+
onOpenPanelApp: (entry: PanelAppEntryView) => void;
|
|
39
|
+
}) {
|
|
40
|
+
const appPackages = useAppPackages();
|
|
41
|
+
const appPackageOperations = useAppPackageOperations();
|
|
42
|
+
const panelApps = usePanelApps();
|
|
43
|
+
const lifecycle = useAppPackageMutation();
|
|
44
|
+
const recordOpened = useRecordPanelAppOpened();
|
|
45
|
+
const grantClient = useGrantPanelAppClient();
|
|
46
|
+
const presenter = useAppPresenter();
|
|
47
|
+
const [installOpen, setInstallOpen] = useState(false);
|
|
48
|
+
const [installSource, setInstallSource] = useState('');
|
|
49
|
+
const [marketplaceOpen, setMarketplaceOpen] = useState(false);
|
|
50
|
+
|
|
51
|
+
const operations = useMemo(
|
|
52
|
+
() => appPackageOperations.data?.entries ?? [],
|
|
53
|
+
[appPackageOperations.data?.entries],
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
useAppPackageOperationSettlement({
|
|
57
|
+
isLoaded: Boolean(appPackageOperations.data),
|
|
58
|
+
operations,
|
|
59
|
+
refetchPackages: appPackages.refetch,
|
|
60
|
+
refetchPanels: panelApps.refetch,
|
|
61
|
+
settlementManager: presenter.appPackageOperationSettlementManager,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const runMutation = (input: AppPackageMutationInput, onSuccess?: () => void) => {
|
|
65
|
+
lifecycle.reset();
|
|
66
|
+
lifecycle.mutate(input, { onSuccess });
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const openPanelApp = async (entry: PanelAppEntryView) => {
|
|
70
|
+
if (entry.clientDeclared && !entry.clientGranted) {
|
|
71
|
+
const allowed = await presenter.serviceActionAuthorizationManager.requestAuthorization({
|
|
72
|
+
panelAppId: entry.appId,
|
|
73
|
+
actions: [{
|
|
74
|
+
actionId: 'nextclaw.client',
|
|
75
|
+
actionTitle: t('panelAppsClientGrantTitle'),
|
|
76
|
+
actionDescription: t('panelAppsClientGrantDescription'),
|
|
77
|
+
risk: 'dangerous',
|
|
78
|
+
}],
|
|
79
|
+
});
|
|
80
|
+
if (!allowed) return;
|
|
81
|
+
await grantClient.mutateAsync(entry.appId);
|
|
82
|
+
}
|
|
83
|
+
try {
|
|
84
|
+
onOpenPanelApp(await recordOpened.mutateAsync(entry.id));
|
|
85
|
+
} catch {
|
|
86
|
+
onOpenPanelApp(entry);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const submitInstall = (event: FormEvent) => {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
const source = installSource.trim();
|
|
93
|
+
if (!source) return;
|
|
94
|
+
runMutation({ action: 'install', source }, () => {
|
|
95
|
+
setInstallOpen(false);
|
|
96
|
+
setInstallSource('');
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const refetch = () => {
|
|
101
|
+
void appPackages.refetch();
|
|
102
|
+
void appPackageOperations.refetch();
|
|
103
|
+
void panelApps.refetch();
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div className="@container flex h-full min-h-0 flex-col bg-card text-card-foreground">
|
|
108
|
+
<div className="flex min-h-12 shrink-0 items-center justify-end gap-1 border-b border-border/70 px-4 py-2">
|
|
109
|
+
<button
|
|
110
|
+
type="button"
|
|
111
|
+
onClick={refetch}
|
|
112
|
+
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"
|
|
113
|
+
title={t('appPackagesRefresh')}
|
|
114
|
+
aria-label={t('appPackagesRefresh')}
|
|
115
|
+
>
|
|
116
|
+
<RefreshCw className="h-3.5 w-3.5" />
|
|
117
|
+
</button>
|
|
118
|
+
<Button
|
|
119
|
+
type="button"
|
|
120
|
+
size="sm"
|
|
121
|
+
variant="outline"
|
|
122
|
+
onClick={() => {
|
|
123
|
+
lifecycle.reset();
|
|
124
|
+
setMarketplaceOpen(true);
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
<Store className="mr-1.5 h-3.5 w-3.5" />
|
|
128
|
+
{t('appPackagesBrowse')}
|
|
129
|
+
</Button>
|
|
130
|
+
<Button
|
|
131
|
+
type="button"
|
|
132
|
+
size="sm"
|
|
133
|
+
variant="outline"
|
|
134
|
+
onClick={() => {
|
|
135
|
+
lifecycle.reset();
|
|
136
|
+
setInstallOpen(true);
|
|
137
|
+
}}
|
|
138
|
+
>
|
|
139
|
+
<PackagePlus className="mr-1.5 h-3.5 w-3.5" />
|
|
140
|
+
{t('appPackagesInstall')}
|
|
141
|
+
</Button>
|
|
142
|
+
</div>
|
|
143
|
+
|
|
144
|
+
<div className="custom-scrollbar min-h-0 flex-1 overflow-y-auto">
|
|
145
|
+
<div className="mx-auto w-full max-w-3xl p-3 sm:p-5">
|
|
146
|
+
<div className="mb-4 px-1">
|
|
147
|
+
<h1 className="text-base font-semibold tracking-tight text-foreground">{t('appPackagesLibraryTitle')}</h1>
|
|
148
|
+
<p className="mt-1 text-xs leading-5 text-muted-foreground">
|
|
149
|
+
{t('appPackagesLibraryDescription')}
|
|
150
|
+
</p>
|
|
151
|
+
</div>
|
|
152
|
+
|
|
153
|
+
{lifecycle.isError ? (
|
|
154
|
+
<div role="alert" className="mb-3 rounded-xl bg-destructive/8 px-3 py-2.5 text-xs leading-5 text-destructive ring-1 ring-destructive/15">
|
|
155
|
+
{lifecycle.error instanceof Error ? lifecycle.error.message : t('appPackagesActionFailed')}
|
|
156
|
+
</div>
|
|
157
|
+
) : null}
|
|
158
|
+
|
|
159
|
+
<AppPackageLibrary
|
|
160
|
+
error={getPackageLoadError(appPackages.error, panelApps.error)}
|
|
161
|
+
isLoading={appPackages.isLoading || panelApps.isLoading}
|
|
162
|
+
isPending={lifecycle.isPending}
|
|
163
|
+
mutationAppId={'appId' in (lifecycle.variables ?? {})
|
|
164
|
+
? (lifecycle.variables as { appId: string }).appId
|
|
165
|
+
: undefined}
|
|
166
|
+
packages={appPackages.data?.entries ?? []}
|
|
167
|
+
panelApps={panelApps.data?.entries ?? []}
|
|
168
|
+
operations={operations}
|
|
169
|
+
onInstall={() => setInstallOpen(true)}
|
|
170
|
+
onMutate={runMutation}
|
|
171
|
+
onOpenPanelApp={(entry) => void openPanelApp(entry)}
|
|
172
|
+
/>
|
|
173
|
+
</div>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<AppMarketplaceDialog
|
|
177
|
+
error={lifecycle.error instanceof Error ? lifecycle.error : null}
|
|
178
|
+
installedPackages={appPackages.data?.entries ?? []}
|
|
179
|
+
startingSource={lifecycle.variables?.action === 'install'
|
|
180
|
+
? lifecycle.variables.source
|
|
181
|
+
: undefined}
|
|
182
|
+
isStarting={lifecycle.isPending}
|
|
183
|
+
operations={operations}
|
|
184
|
+
open={marketplaceOpen}
|
|
185
|
+
onOpenChange={setMarketplaceOpen}
|
|
186
|
+
onInstall={(source, registryUrl) => runMutation({
|
|
187
|
+
action: 'install',
|
|
188
|
+
source,
|
|
189
|
+
registryUrl,
|
|
190
|
+
})}
|
|
191
|
+
onUpdate={(appId) => runMutation({ action: 'update', appId })}
|
|
192
|
+
/>
|
|
193
|
+
|
|
194
|
+
<Dialog open={installOpen} onOpenChange={setInstallOpen}>
|
|
195
|
+
<DialogContent className="max-w-md [&>:last-child]:hidden">
|
|
196
|
+
<form onSubmit={submitInstall}>
|
|
197
|
+
<DialogHeader>
|
|
198
|
+
<DialogTitle>{t('appPackagesInstallTitle')}</DialogTitle>
|
|
199
|
+
<DialogDescription>{t('appPackagesInstallDescription')}</DialogDescription>
|
|
200
|
+
</DialogHeader>
|
|
201
|
+
<div className="mt-4 space-y-3">
|
|
202
|
+
<Input
|
|
203
|
+
autoFocus
|
|
204
|
+
value={installSource}
|
|
205
|
+
onChange={(event) => setInstallSource(event.target.value)}
|
|
206
|
+
placeholder={t('appPackagesInstallPlaceholder')}
|
|
207
|
+
aria-label={t('appPackagesInstallSource')}
|
|
208
|
+
/>
|
|
209
|
+
<div className="flex items-start gap-2 rounded-xl bg-muted/60 px-3 py-2.5 text-xs leading-5 text-muted-foreground">
|
|
210
|
+
<ShieldCheck className="mt-0.5 h-3.5 w-3.5 shrink-0" />
|
|
211
|
+
<span>{t('appPackagesInstallTrustHint')}</span>
|
|
212
|
+
</div>
|
|
213
|
+
{lifecycle.isError ? (
|
|
214
|
+
<p role="alert" className="text-xs text-destructive">
|
|
215
|
+
{lifecycle.error instanceof Error ? lifecycle.error.message : t('appPackagesActionFailed')}
|
|
216
|
+
</p>
|
|
217
|
+
) : null}
|
|
218
|
+
</div>
|
|
219
|
+
<DialogFooter className="mt-5 gap-2 sm:gap-0">
|
|
220
|
+
<Button type="button" variant="outline" onClick={() => setInstallOpen(false)}>
|
|
221
|
+
{t('cancel')}
|
|
222
|
+
</Button>
|
|
223
|
+
<Button type="submit" disabled={!installSource.trim() || lifecycle.isPending}>
|
|
224
|
+
{lifecycle.isPending ? t('appPackagesInstalling') : t('appPackagesInstall')}
|
|
225
|
+
</Button>
|
|
226
|
+
</DialogFooter>
|
|
227
|
+
</form>
|
|
228
|
+
</DialogContent>
|
|
229
|
+
</Dialog>
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function AppPackageLibrary({
|
|
235
|
+
error,
|
|
236
|
+
isLoading,
|
|
237
|
+
isPending,
|
|
238
|
+
mutationAppId,
|
|
239
|
+
onInstall,
|
|
240
|
+
onMutate,
|
|
241
|
+
onOpenPanelApp,
|
|
242
|
+
packages,
|
|
243
|
+
panelApps,
|
|
244
|
+
operations,
|
|
245
|
+
}: {
|
|
246
|
+
error?: string;
|
|
247
|
+
isLoading: boolean;
|
|
248
|
+
isPending: boolean;
|
|
249
|
+
mutationAppId?: string;
|
|
250
|
+
onInstall: () => void;
|
|
251
|
+
onMutate: (input: AppPackageMutationInput) => void;
|
|
252
|
+
onOpenPanelApp: (entry: PanelAppEntryView) => void;
|
|
253
|
+
packages: AppPackageView[];
|
|
254
|
+
panelApps: PanelAppEntryView[];
|
|
255
|
+
operations: AppPackageOperationView[];
|
|
256
|
+
}) {
|
|
257
|
+
if (isLoading) {
|
|
258
|
+
return (
|
|
259
|
+
<div className="space-y-2.5" aria-label={t('appPackagesLoading')}>
|
|
260
|
+
<Skeleton className="h-44 w-full rounded-2xl" />
|
|
261
|
+
<Skeleton className="h-32 w-full rounded-2xl" />
|
|
262
|
+
</div>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
if (error) {
|
|
266
|
+
return (
|
|
267
|
+
<div className="rounded-xl border border-destructive/20 bg-destructive/5 px-4 py-4 text-sm text-destructive">
|
|
268
|
+
{error}
|
|
269
|
+
</div>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
if (packages.length === 0) {
|
|
273
|
+
const activeInstalls = operations.filter((entry) =>
|
|
274
|
+
entry.action === 'install' && isAppPackageOperationActive(entry.status));
|
|
275
|
+
if (activeInstalls.length > 0) {
|
|
276
|
+
return <div className="space-y-2.5">{activeInstalls.map((operation) => (
|
|
277
|
+
<PendingInstallCard key={operation.id} operation={operation} />
|
|
278
|
+
))}</div>;
|
|
279
|
+
}
|
|
280
|
+
return (
|
|
281
|
+
<div className="flex flex-col items-center rounded-2xl border border-dashed border-border px-6 py-10 text-center">
|
|
282
|
+
<PackagePlus className="h-7 w-7 text-muted-foreground" />
|
|
283
|
+
<h2 className="mt-3 text-sm font-semibold text-foreground">{t('appPackagesEmptyTitle')}</h2>
|
|
284
|
+
<p className="mt-1 max-w-sm text-xs leading-5 text-muted-foreground">
|
|
285
|
+
{t('appPackagesEmptyDescription')}
|
|
286
|
+
</p>
|
|
287
|
+
<Button type="button" size="sm" className="mt-4" onClick={onInstall}>
|
|
288
|
+
{t('appPackagesInstall')}
|
|
289
|
+
</Button>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
}
|
|
293
|
+
return (
|
|
294
|
+
<div className="space-y-2.5">
|
|
295
|
+
{operations.filter((entry) =>
|
|
296
|
+
entry.action === 'install' &&
|
|
297
|
+
isAppPackageOperationActive(entry.status) &&
|
|
298
|
+
!packages.some((appPackage) => appPackage.id === entry.appId),
|
|
299
|
+
).map((operation) => (
|
|
300
|
+
<PendingInstallCard key={operation.id} operation={operation} />
|
|
301
|
+
))}
|
|
302
|
+
{packages.map((appPackage) => (
|
|
303
|
+
<AppPackageCard
|
|
304
|
+
key={appPackage.id}
|
|
305
|
+
appPackage={appPackage}
|
|
306
|
+
panelApps={panelApps.filter((entry) => entry.packageId === appPackage.id)}
|
|
307
|
+
isPending={isPending && mutationAppId === appPackage.id}
|
|
308
|
+
operation={operations.find((entry) =>
|
|
309
|
+
entry.appId === appPackage.id && (
|
|
310
|
+
isAppPackageOperationActive(entry.status) ||
|
|
311
|
+
entry.status === 'failed' ||
|
|
312
|
+
entry.status === 'interrupted'
|
|
313
|
+
))}
|
|
314
|
+
onEnable={() => onMutate({ action: 'enable', appId: appPackage.id })}
|
|
315
|
+
onDisable={() => onMutate({ action: 'disable', appId: appPackage.id })}
|
|
316
|
+
onUpdate={() => onMutate({ action: 'update', appId: appPackage.id })}
|
|
317
|
+
onRollback={(version) => onMutate({
|
|
318
|
+
action: 'rollback',
|
|
319
|
+
appId: appPackage.id,
|
|
320
|
+
version,
|
|
321
|
+
})}
|
|
322
|
+
onUninstall={(purgeData) => onMutate({
|
|
323
|
+
action: 'uninstall',
|
|
324
|
+
appId: appPackage.id,
|
|
325
|
+
purgeData,
|
|
326
|
+
})}
|
|
327
|
+
onOpenPanelApp={onOpenPanelApp}
|
|
328
|
+
/>
|
|
329
|
+
))}
|
|
330
|
+
</div>
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function PendingInstallCard({ operation }: { operation: AppPackageOperationView }) {
|
|
335
|
+
const label = operation.appId ?? operation.source ?? t('appPackagesInstall');
|
|
336
|
+
const progress = Math.max(4, Math.round((operation.completedSteps / operation.totalSteps) * 100));
|
|
337
|
+
return (
|
|
338
|
+
<div className="rounded-xl border border-border/60 bg-card px-4 py-3.5 shadow-[0_1px_2px_rgba(0,0,0,0.025)]" role="status" aria-live="polite">
|
|
339
|
+
<div className="flex items-center gap-3">
|
|
340
|
+
<AppArtwork name={label} />
|
|
341
|
+
<div className="min-w-0 flex-1">
|
|
342
|
+
<p className="truncate text-sm font-semibold text-foreground">{label}</p>
|
|
343
|
+
<p className="mt-0.5 flex items-center gap-1.5 text-xs text-muted-foreground">
|
|
344
|
+
<LoaderCircle className="h-3.5 w-3.5 animate-spin" />
|
|
345
|
+
{operationProgressLabel(operation)}
|
|
346
|
+
</p>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
<div className="ml-14 mt-2 h-1 overflow-hidden rounded-full bg-muted">
|
|
350
|
+
<div className="h-full rounded-full bg-primary transition-[width] duration-300" style={{ width: `${progress}%` }} />
|
|
351
|
+
</div>
|
|
352
|
+
</div>
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
function operationProgressLabel(operation: AppPackageOperationView): string {
|
|
357
|
+
switch (operation.status) {
|
|
358
|
+
case 'queued': return t('appPackagesPreparing');
|
|
359
|
+
case 'resolving': return t('appPackagesResolving');
|
|
360
|
+
case 'downloading': return t('appPackagesDownloading');
|
|
361
|
+
case 'verifying': return t('appPackagesVerifying');
|
|
362
|
+
case 'installing': return t('appPackagesInstalling');
|
|
363
|
+
case 'finalizing': return t('appPackagesFinalizing');
|
|
364
|
+
case 'succeeded': return t('appPackagesCompleted');
|
|
365
|
+
case 'failed':
|
|
366
|
+
case 'interrupted': return operation.error ?? t('appPackagesActionFailed');
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function getPackageLoadError(...errors: unknown[]): string | undefined {
|
|
371
|
+
const error = errors.find((candidate): candidate is Error => candidate instanceof Error);
|
|
372
|
+
return error?.message || (errors.some(Boolean) ? t('appPackagesLoadFailed') : undefined);
|
|
373
|
+
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AppWindow, Server } from 'lucide-react';
|
|
1
|
+
import { AppWindow, Boxes, Server } from 'lucide-react';
|
|
2
2
|
import type { PanelAppEntryView } from '@/shared/lib/api';
|
|
3
|
+
import { AppPackagesPanel } from '@/features/apps/components/app-packages-panel';
|
|
3
4
|
import { PanelAppsList } from '@/features/panel-apps';
|
|
4
5
|
import { ServiceAppsPanel } from '@/features/service-apps';
|
|
5
6
|
import { Tabs, TabsList, TabsTrigger } from '@/shared/components/ui/tabs';
|
|
6
7
|
import { t } from '@/shared/lib/i18n';
|
|
7
8
|
|
|
8
|
-
export type AppsPanelTab = 'panel-apps' | 'service-apps';
|
|
9
|
+
export type AppsPanelTab = 'apps' | 'panel-apps' | 'service-apps';
|
|
9
10
|
|
|
10
11
|
export function AppsPanel({
|
|
11
12
|
activeTab,
|
|
@@ -16,28 +17,35 @@ export function AppsPanel({
|
|
|
16
17
|
onActiveTabChange: (tab: AppsPanelTab) => void;
|
|
17
18
|
onOpenPanelApp: (entry: PanelAppEntryView) => void;
|
|
18
19
|
}) {
|
|
19
|
-
const headerTabs = (
|
|
20
|
-
<Tabs value={activeTab} onValueChange={(value) => onActiveTabChange(value as AppsPanelTab)}>
|
|
21
|
-
<TabsList className="grid h-auto w-[min(340px,100%)] grid-cols-2 rounded-lg bg-gray-100/70 p-0.5">
|
|
22
|
-
<TabsTrigger value="panel-apps" className="gap-1.5 px-2 py-1.5 text-xs">
|
|
23
|
-
<AppWindow className="h-3.5 w-3.5" />
|
|
24
|
-
{t('panelAppsTitle')}
|
|
25
|
-
</TabsTrigger>
|
|
26
|
-
<TabsTrigger value="service-apps" className="gap-1.5 px-2 py-1.5 text-xs">
|
|
27
|
-
<Server className="h-3.5 w-3.5" />
|
|
28
|
-
{t('serviceAppsTitle')}
|
|
29
|
-
</TabsTrigger>
|
|
30
|
-
</TabsList>
|
|
31
|
-
</Tabs>
|
|
32
|
-
);
|
|
33
|
-
|
|
34
20
|
return (
|
|
35
|
-
<div className="h-full min-h-0 bg-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
21
|
+
<div className="flex h-full min-h-0 flex-col bg-card text-card-foreground">
|
|
22
|
+
<nav className="shrink-0 border-b border-border/70 px-4 py-3" aria-label={t('appsTitle')}>
|
|
23
|
+
<Tabs value={activeTab} onValueChange={(value) => onActiveTabChange(value as AppsPanelTab)}>
|
|
24
|
+
<TabsList className="grid h-auto w-full max-w-[390px] grid-cols-3 rounded-lg bg-muted/70 p-0.5">
|
|
25
|
+
<TabsTrigger value="apps" className="min-w-0 gap-1.5 px-2 py-1.5 text-xs">
|
|
26
|
+
<Boxes className="h-3.5 w-3.5 shrink-0" />
|
|
27
|
+
<span className="truncate">{t('appsTitle')}</span>
|
|
28
|
+
</TabsTrigger>
|
|
29
|
+
<TabsTrigger value="panel-apps" className="min-w-0 gap-1.5 px-2 py-1.5 text-xs">
|
|
30
|
+
<AppWindow className="h-3.5 w-3.5 shrink-0" />
|
|
31
|
+
<span className="truncate">{t('panelAppsTitle')}</span>
|
|
32
|
+
</TabsTrigger>
|
|
33
|
+
<TabsTrigger value="service-apps" className="min-w-0 gap-1.5 px-2 py-1.5 text-xs">
|
|
34
|
+
<Server className="h-3.5 w-3.5 shrink-0" />
|
|
35
|
+
<span className="truncate">{t('serviceAppsTitle')}</span>
|
|
36
|
+
</TabsTrigger>
|
|
37
|
+
</TabsList>
|
|
38
|
+
</Tabs>
|
|
39
|
+
</nav>
|
|
40
|
+
<div className="min-h-0 flex-1">
|
|
41
|
+
{activeTab === 'apps' ? (
|
|
42
|
+
<AppPackagesPanel onOpenPanelApp={onOpenPanelApp} />
|
|
43
|
+
) : activeTab === 'panel-apps' ? (
|
|
44
|
+
<PanelAppsList onOpenPanelApp={onOpenPanelApp} />
|
|
45
|
+
) : (
|
|
46
|
+
<ServiceAppsPanel />
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
41
49
|
</div>
|
|
42
50
|
);
|
|
43
51
|
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { AppMarketplaceItemView } from './use-app-marketplace';
|
|
2
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
|
|
4
|
+
const app: AppMarketplaceItemView = {
|
|
5
|
+
id: 'app-personal-organizer',
|
|
6
|
+
slug: 'personal-organizer',
|
|
7
|
+
appId: 'nextclaw.personal-organizer',
|
|
8
|
+
name: '个人空间',
|
|
9
|
+
summary: 'A calm personal space.',
|
|
10
|
+
summaryI18n: { en: 'A calm personal space.' },
|
|
11
|
+
tags: ['personal'],
|
|
12
|
+
latestVersion: '0.1.1',
|
|
13
|
+
featured: true,
|
|
14
|
+
publisher: { id: 'nextclaw', name: 'NextClaw' },
|
|
15
|
+
install: {
|
|
16
|
+
kind: 'registry' as const,
|
|
17
|
+
spec: 'nextclaw.personal-organizer',
|
|
18
|
+
registry: 'https://apps-registry.nextclaw.io/api/v1/apps/registry/',
|
|
19
|
+
},
|
|
20
|
+
webUrl: 'https://apps.nextclaw.io/apps/personal-organizer',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
afterEach(() => {
|
|
24
|
+
vi.resetModules();
|
|
25
|
+
vi.unstubAllEnvs();
|
|
26
|
+
vi.unstubAllGlobals();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('withDevPreviewCover', () => {
|
|
30
|
+
it('uses an explicitly configured preview cover for a known official app', async () => {
|
|
31
|
+
vi.stubEnv('VITE_APP_MARKETPLACE_PREVIEW_COVER_BASE_URL', 'http://127.0.0.1:4178/covers/');
|
|
32
|
+
const { withDevPreviewCover } = await import('./use-app-marketplace');
|
|
33
|
+
|
|
34
|
+
expect(withDevPreviewCover(app).coverUrl).toBe(
|
|
35
|
+
'http://127.0.0.1:4178/covers/personal-organizer.webp',
|
|
36
|
+
);
|
|
37
|
+
expect(withDevPreviewCover(app).coverPreview).toBe(true);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('keeps a Registry cover as the canonical source', async () => {
|
|
41
|
+
vi.stubEnv('VITE_APP_MARKETPLACE_PREVIEW_COVER_BASE_URL', 'http://127.0.0.1:4178/covers');
|
|
42
|
+
const { withDevPreviewCover } = await import('./use-app-marketplace');
|
|
43
|
+
const registryCover = 'https://apps-registry.nextclaw.io/cover.webp';
|
|
44
|
+
|
|
45
|
+
expect(withDevPreviewCover({ ...app, coverUrl: registryCover }).coverUrl).toBe(registryCover);
|
|
46
|
+
expect(withDevPreviewCover({ ...app, coverUrl: registryCover }).coverPreview).toBeUndefined();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('does not guess preview assets for third-party apps', async () => {
|
|
50
|
+
vi.stubEnv('VITE_APP_MARKETPLACE_PREVIEW_COVER_BASE_URL', 'http://127.0.0.1:4178/covers');
|
|
51
|
+
const { withDevPreviewCover } = await import('./use-app-marketplace');
|
|
52
|
+
|
|
53
|
+
expect(withDevPreviewCover({
|
|
54
|
+
...app,
|
|
55
|
+
publisher: { id: 'third-party', name: 'Third Party' },
|
|
56
|
+
}).coverUrl).toBeUndefined();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('fetchAppMarketplace', () => {
|
|
61
|
+
it('uses the cursor catalog endpoint and preserves pagination metadata', async () => {
|
|
62
|
+
const fetchMock = vi.fn(async (_input: string | URL | Request, _init?: RequestInit) => new Response(JSON.stringify({
|
|
63
|
+
ok: true,
|
|
64
|
+
data: {
|
|
65
|
+
items: [app],
|
|
66
|
+
hasMore: true,
|
|
67
|
+
nextCursor: 'cursor-2',
|
|
68
|
+
query: 'notes',
|
|
69
|
+
tag: 'personal',
|
|
70
|
+
sort: 'relevance',
|
|
71
|
+
},
|
|
72
|
+
}), { status: 200 }));
|
|
73
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
74
|
+
const { fetchAppMarketplace } = await import('./use-app-marketplace');
|
|
75
|
+
|
|
76
|
+
await expect(fetchAppMarketplace({
|
|
77
|
+
q: 'notes',
|
|
78
|
+
tag: 'personal',
|
|
79
|
+
cursor: 'cursor-1',
|
|
80
|
+
limit: 24,
|
|
81
|
+
})).resolves.toMatchObject({
|
|
82
|
+
hasMore: true,
|
|
83
|
+
nextCursor: 'cursor-2',
|
|
84
|
+
items: [app],
|
|
85
|
+
});
|
|
86
|
+
expect(fetchMock).toHaveBeenCalledWith(
|
|
87
|
+
expect.stringContaining('/api/v2/apps/items?'),
|
|
88
|
+
expect.any(Object),
|
|
89
|
+
);
|
|
90
|
+
const requestUrl = fetchMock.mock.calls[0]?.[0];
|
|
91
|
+
expect(requestUrl).toBeTypeOf('string');
|
|
92
|
+
const url = new URL(String(requestUrl));
|
|
93
|
+
expect(Object.fromEntries(url.searchParams)).toMatchObject({
|
|
94
|
+
q: 'notes',
|
|
95
|
+
tag: 'personal',
|
|
96
|
+
cursor: 'cursor-1',
|
|
97
|
+
limit: '24',
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it('uses the legacy catalog only when the server explicitly does not support v2', async () => {
|
|
102
|
+
const fetchMock = vi.fn()
|
|
103
|
+
.mockResolvedValueOnce(new Response(null, { status: 404 }))
|
|
104
|
+
.mockResolvedValueOnce(new Response(JSON.stringify({
|
|
105
|
+
ok: true,
|
|
106
|
+
data: { items: [app], page: 1, pageSize: 100, total: 1, totalPages: 1 },
|
|
107
|
+
}), { status: 200 }));
|
|
108
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
109
|
+
const { fetchAppMarketplace } = await import('./use-app-marketplace');
|
|
110
|
+
|
|
111
|
+
await expect(fetchAppMarketplace({ tags: ['personal'], limit: 24 })).resolves.toMatchObject({
|
|
112
|
+
hasMore: false,
|
|
113
|
+
items: [app],
|
|
114
|
+
});
|
|
115
|
+
expect(fetchMock).toHaveBeenCalledTimes(2);
|
|
116
|
+
expect(fetchMock.mock.calls[1]?.[0]).toContain('/api/v1/apps/items?');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('does not hide a v2 server failure behind the compatibility path', async () => {
|
|
120
|
+
const fetchMock = vi.fn(async () => new Response(null, { status: 500 }));
|
|
121
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
122
|
+
const { fetchAppMarketplace } = await import('./use-app-marketplace');
|
|
123
|
+
|
|
124
|
+
await expect(fetchAppMarketplace()).rejects.toThrow('Marketplace request failed (500)');
|
|
125
|
+
expect(fetchMock).toHaveBeenCalledTimes(1);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('forwards cancellation through both v2 and its explicit compatibility request', async () => {
|
|
129
|
+
const controller = new AbortController();
|
|
130
|
+
const fetchMock = vi.fn()
|
|
131
|
+
.mockResolvedValueOnce(new Response(null, { status: 404 }))
|
|
132
|
+
.mockResolvedValueOnce(new Response(JSON.stringify({
|
|
133
|
+
ok: true,
|
|
134
|
+
data: { items: [app], page: 1, pageSize: 100, total: 1, totalPages: 1 },
|
|
135
|
+
}), { status: 200 }));
|
|
136
|
+
vi.stubGlobal('fetch', fetchMock);
|
|
137
|
+
const { fetchAppMarketplace } = await import('./use-app-marketplace');
|
|
138
|
+
|
|
139
|
+
await fetchAppMarketplace({}, controller.signal);
|
|
140
|
+
|
|
141
|
+
expect(fetchMock.mock.calls[0]?.[1]).toMatchObject({ signal: controller.signal });
|
|
142
|
+
expect(fetchMock.mock.calls[1]?.[1]).toMatchObject({ signal: controller.signal });
|
|
143
|
+
});
|
|
144
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useInfiniteQuery, useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import {
|
|
4
|
+
fetchAppMarketplace,
|
|
5
|
+
fetchAppMarketplaceDetail,
|
|
6
|
+
withDevPreviewCover,
|
|
7
|
+
} from '@/features/apps/services/app-marketplace.service';
|
|
8
|
+
import type {
|
|
9
|
+
AppMarketplaceCatalogParams,
|
|
10
|
+
AppMarketplaceItemView,
|
|
11
|
+
AppMarketplaceListView,
|
|
12
|
+
} from '@/features/apps/types/app-marketplace.types';
|
|
13
|
+
|
|
14
|
+
export { fetchAppMarketplace, withDevPreviewCover };
|
|
15
|
+
export type {
|
|
16
|
+
AppMarketplaceCatalogParams,
|
|
17
|
+
AppMarketplaceCatalogView,
|
|
18
|
+
AppMarketplaceDetailView,
|
|
19
|
+
AppMarketplaceItemView,
|
|
20
|
+
AppMarketplaceListView,
|
|
21
|
+
} from '@/features/apps/types/app-marketplace.types';
|
|
22
|
+
|
|
23
|
+
const APP_MARKETPLACE_QUERY_KEY = ['app-marketplace', 'v3'] as const;
|
|
24
|
+
|
|
25
|
+
export function useAppMarketplace(params: AppMarketplaceCatalogParams, enabled: boolean) {
|
|
26
|
+
const query = useInfiniteQuery({
|
|
27
|
+
queryKey: [...APP_MARKETPLACE_QUERY_KEY, params],
|
|
28
|
+
initialPageParam: undefined as string | undefined,
|
|
29
|
+
queryFn: async ({ pageParam, signal }) => await fetchAppMarketplace({
|
|
30
|
+
...params,
|
|
31
|
+
cursor: pageParam,
|
|
32
|
+
limit: 24,
|
|
33
|
+
}, signal),
|
|
34
|
+
getNextPageParam: (lastPage) => lastPage.nextCursor,
|
|
35
|
+
enabled,
|
|
36
|
+
retry: 1,
|
|
37
|
+
staleTime: 5 * 60 * 1000,
|
|
38
|
+
});
|
|
39
|
+
const data = useMemo<AppMarketplaceListView | undefined>(() => {
|
|
40
|
+
if (!query.data) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const byId = new Map<string, AppMarketplaceItemView>();
|
|
44
|
+
for (const page of query.data.pages) {
|
|
45
|
+
for (const item of page.items) {
|
|
46
|
+
byId.set(item.id, item);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
items: [...byId.values()],
|
|
51
|
+
hasMore: query.data.pages.at(-1)?.hasMore ?? false,
|
|
52
|
+
};
|
|
53
|
+
}, [query.data]);
|
|
54
|
+
return { ...query, data };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function useAppMarketplaceDetail(slug: string | null, enabled: boolean) {
|
|
58
|
+
return useQuery({
|
|
59
|
+
queryKey: ['app-marketplace-detail', 'v2', slug],
|
|
60
|
+
queryFn: async ({ signal }) => await fetchAppMarketplaceDetail(slug ?? '', signal),
|
|
61
|
+
enabled: enabled && Boolean(slug),
|
|
62
|
+
retry: 1,
|
|
63
|
+
staleTime: 5 * 60 * 1000,
|
|
64
|
+
});
|
|
65
|
+
}
|