@objectstack/console 17.6.0 → 17.7.0
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 +428 -0
- package/dist/.objectstack-injection.json +2 -2
- package/dist/.objectui-sha +1 -1
- package/dist/assets/{ActionResultDialog-4kHDGnT3.js → ActionResultDialog-ChYnuROr.js} +3 -3
- package/dist/assets/{AiPendingActionsPage-JjOddm0h.js → AiPendingActionsPage-Dh3-i4BB.js} +1 -1
- package/dist/assets/{ApiConsolePage-BgS26lbp.js → ApiConsolePage-CKYEqlMs.js} +1 -1
- package/dist/assets/{AppDocsIndex-BDoH5ECM.js → AppDocsIndex-B5Tky2xg.js} +1 -1
- package/dist/assets/{AppManagementPage-CCgKmNTj.js → AppManagementPage-ZwyvnHpM.js} +1 -1
- package/dist/assets/ApprovalsInboxPage-DD4fe0Em.js +1 -0
- package/dist/assets/AuditLogPage-Sed6iMqP.js +1 -0
- package/dist/assets/BookPage-DYjUsQIc.js +1 -0
- package/dist/assets/{ComponentNavView-B5g9c6fx.js → ComponentNavView-DrlxM4SY.js} +1 -1
- package/dist/assets/CreateViewDialog-Cp72x_O7.js +1 -0
- package/dist/assets/{DashboardView-BOcovpPd.js → DashboardView-juicRxcP.js} +1 -1
- package/dist/assets/DocPage-CxJaQ-pC.js +1 -0
- package/dist/assets/{DocsIndex-DwW2QsYY.js → DocsIndex-LALVtIVR.js} +1 -1
- package/dist/assets/{DocsLayout-D63StSgd.js → DocsLayout-BAwlJQQf.js} +1 -1
- package/dist/assets/{DocsSlug-CP9fcabi.js → DocsSlug-CkF1E-Zs.js} +1 -1
- package/dist/assets/ExpressionProvider-Dr0e99r1.js +1 -0
- package/dist/assets/FlowRunsPage-R3W3t2s4.js +1 -0
- package/dist/assets/{IntegrationsPage-DvG0x0Nb.js → IntegrationsPage-DIuFLEbF.js} +2 -2
- package/dist/assets/InterfaceListPage-BfoCldGu.js +1 -0
- package/dist/assets/{MarketplaceInstalledPage-B7KETQG2.js → MarketplaceInstalledPage-DyjhcUNB.js} +1 -1
- package/dist/assets/MarketplacePackagePage-BbO27Pgs.js +4 -0
- package/dist/assets/MarketplacePage-DO2_b64U.js +1 -0
- package/dist/assets/{MetadataInspector-EP0I3-Kq.js → MetadataInspector-BQyu9pOE.js} +1 -1
- package/dist/assets/ObjectDataPage-DIY-yefK.js +1 -0
- package/dist/assets/PageView-C-qWu3Jw.js +1 -0
- package/dist/assets/ProfilePage-Qp8DL8CF.js +1 -0
- package/dist/assets/{PublicFormsPage-D3uCTR-8.js → PublicFormsPage-D3AT2EH9.js} +1 -1
- package/dist/assets/RecordDetailView-B3XBEgk2.js +3 -0
- package/dist/assets/{RecordFormPage-kiJI-ieF.js → RecordFormPage-CcoZfUJ3.js} +1 -1
- package/dist/assets/ReportDefaultInspector-DVcWM6sh.js +1 -0
- package/dist/assets/ReportView-pJCFptzp.js +2 -0
- package/dist/assets/RuntimeDraftBar-DObTyFu2.js +1 -0
- package/dist/assets/SchemaForm-BWSWYMLE.js +3 -0
- package/dist/assets/SearchResultsPage-ChVIzFob.js +1 -0
- package/dist/assets/{SettingsHub-DP1mrzEN.js → SettingsHub-CPP9FDe8.js} +1 -1
- package/dist/assets/{SettingsView-u7mc6pcc.js → SettingsView-CrHAROu9.js} +1 -1
- package/dist/assets/{SkeletonDetail-DIwlbHTr.js → SkeletonDetail-CP-35B8x.js} +1 -1
- package/dist/assets/{af-DPUgkQl0.js → af-Bhbso4Pg.js} +1 -1
- package/dist/assets/ai-BAPiCsNk.js +3 -0
- package/dist/assets/app-shell-eager-leaves-D9tgfJOe.js +1 -0
- package/dist/assets/{ar-B-6GTIRU.js → ar-DG8TAFtm.js} +1 -1
- package/dist/assets/{ar-DZ-wEl298ti.js → ar-DZ-BtSien-d.js} +1 -1
- package/dist/assets/{ar-EG-YBT90_S0.js → ar-EG-DpXC0zoY.js} +1 -1
- package/dist/assets/{ar-MA-3uT-EYh6.js → ar-MA-D1qVJLyE.js} +1 -1
- package/dist/assets/{ar-SA-SiQsjhhc.js → ar-SA-BIYKNgv8.js} +1 -1
- package/dist/assets/{ar-TN-CfzXjKzS.js → ar-TN-mUR5Mq3s.js} +1 -1
- package/dist/assets/{az-BqAfcNza.js → az-B7IqwHGK.js} +1 -1
- package/dist/assets/{be-CQgWXa9_.js → be-CnZyPaSX.js} +1 -1
- package/dist/assets/{be-tarask-BmNg0Sir.js → be-tarask--uMMCC7l.js} +1 -1
- package/dist/assets/{bg-D3evgRuS.js → bg-CZwuirtY.js} +1 -1
- package/dist/assets/{bn-uItkARwm.js → bn-BbOX0r-z.js} +1 -1
- package/dist/assets/{bs-DueReOpO.js → bs-B5W75cYR.js} +1 -1
- package/dist/assets/{ca-Cr3AHktR.js → ca-Be69LdIM.js} +1 -1
- package/dist/assets/{ckb-CTi5BET7.js → ckb-B-nKM1Vn.js} +1 -1
- package/dist/assets/{createDerive-CjN1i5vn.js → createDerive-CynsXU-B.js} +1 -1
- package/dist/assets/{cs-43mFX9jr.js → cs-qHngxH7l.js} +1 -1
- package/dist/assets/{cy-BBSkg3F8.js → cy-DscO2Pgf.js} +1 -1
- package/dist/assets/{da-C5oA5qcs.js → da-vibkaLMF.js} +1 -1
- package/dist/assets/data-adapter-BDsrq0TX.js +2 -0
- package/dist/assets/{de-AT-CApxwJzu.js → de-AT--JneEuBw.js} +1 -1
- package/dist/assets/{de-CPtbLlAf.js → de-BCT78XYW.js} +1 -1
- package/dist/assets/default-inspector-registry-Dktr6x_q.js +1 -0
- package/dist/assets/dist-yh3dYtHt.js +14 -0
- package/dist/assets/drillUrlFilters-N0RngQg6.js +1 -0
- package/dist/assets/{el-Dto2xBQU.js → el-Cl0y9T2b.js} +1 -1
- package/dist/assets/en-AU-By42tTB7.js +1 -0
- package/dist/assets/{en-CA-DKuJPN1U.js → en-CA-BqEEoj-Y.js} +1 -1
- package/dist/assets/en-GB-Cx8B9nkB.js +1 -0
- package/dist/assets/en-IE-CX9nv6uO.js +1 -0
- package/dist/assets/en-IN-ByGSBHa4.js +1 -0
- package/dist/assets/en-NZ-BPMwa2ZN.js +1 -0
- package/dist/assets/en-ZA-lj_N4R6c.js +1 -0
- package/dist/assets/{eo-BL8JXIWd.js → eo-oOXROuhF.js} +1 -1
- package/dist/assets/{es-BnoaNxsu.js → es-EudscwjH.js} +1 -1
- package/dist/assets/{et-tPYLNenO.js → et-CB-5LLh6.js} +1 -1
- package/dist/assets/{eu-CUBG6bT0.js → eu-B4-hcseX.js} +1 -1
- package/dist/assets/{fa-IR-Rr2d9xSs.js → fa-IR-CogavcMJ.js} +1 -1
- package/dist/assets/{fi-B0NVIZsV.js → fi-CIBE0mYa.js} +1 -1
- package/dist/assets/{formatLong-1-gt9bpo.js → formatLong-qqgm7lV1.js} +1 -1
- package/dist/assets/{fr-CA-CBDvLXFg.js → fr-CA-BugXMutW.js} +1 -1
- package/dist/assets/{fr-BbhHek8e.js → fr-CDReXYWW.js} +1 -1
- package/dist/assets/{fr-CH-WPNmwPn7.js → fr-CH-fiTiB6X1.js} +1 -1
- package/dist/assets/framework-CAuH4h0L.js +35 -0
- package/dist/assets/{fy-DvOBbvEF.js → fy-t_GzIAg_.js} +1 -1
- package/dist/assets/{gd-BQPiTPX5.js → gd-CSncIxtN.js} +1 -1
- package/dist/assets/getIcon-BDkBRQFw.js +1 -0
- package/dist/assets/{gl-BJCXK8uO.js → gl-_138Mj2S.js} +1 -1
- package/dist/assets/{gu-CctPRz3V.js → gu-COfH-YUT.js} +1 -1
- package/dist/assets/{he-CVFMk6p2.js → he-BXL4lOKY.js} +1 -1
- package/dist/assets/{hi-Ba30-RwS.js → hi-kXuYI0TJ.js} +1 -1
- package/dist/assets/{highlighted-body-OFNGDK62-BQ57IrBV.js → highlighted-body-OFNGDK62-CK7x7Gzm.js} +1 -1
- package/dist/assets/{hr-BZUqTbZs.js → hr-DAOsQWzI.js} +1 -1
- package/dist/assets/{ht-BLe05tPx.js → ht-Ch8SKz8p.js} +1 -1
- package/dist/assets/{hu-2CQ_Mkww.js → hu-q6W_rWPT.js} +1 -1
- package/dist/assets/{hy-CclcPG4H.js → hy-0M8OmwnM.js} +1 -1
- package/dist/assets/{i18n-BnUsCaSC.js → i18n-DTfZonAM.js} +3 -3
- package/dist/assets/i18n-locale-ar-O6rs-Cir.js +4 -0
- package/dist/assets/i18n-locale-de-CMc1jk4a.js +4 -0
- package/dist/assets/i18n-locale-en-CbRQO81h.js +4 -0
- package/dist/assets/i18n-locale-es-t47nyoCX.js +4 -0
- package/dist/assets/i18n-locale-fr-E425EqJM.js +4 -0
- package/dist/assets/i18n-locale-ja-y_fk77fz.js +4 -0
- package/dist/assets/i18n-locale-ko-CdnY2uCg.js +4 -0
- package/dist/assets/i18n-locale-pt-BaUOXS6y.js +4 -0
- package/dist/assets/i18n-locale-ru-pFlhX9wg.js +4 -0
- package/dist/assets/i18n-locale-zh-Dkj4ROTN.js +4 -0
- package/dist/assets/i18n-runtime-CdWyaiOD.js +1 -0
- package/dist/assets/{id-6JLB8s-f.js → id-BM_H1_jv.js} +1 -1
- package/dist/assets/index-ocmkyCt6.js +19 -0
- package/dist/assets/index-v2Ijn9Gr.css +2 -0
- package/dist/assets/{infrastructure-Cc34lEqb.js → infrastructure-CSnL6ntj.js} +2 -2
- package/dist/assets/integration-7NqwVHuJ.js +1 -0
- package/dist/assets/{is-to0CWzm1.js → is-B_7jXZfS.js} +1 -1
- package/dist/assets/isSameWeek-D90tBsli.js +1 -0
- package/dist/assets/{it-ea0B8Ujp.js → it-CBM0J9cD.js} +1 -1
- package/dist/assets/{it-CH-DhdfjP5Z.js → it-CH-BQltCNsR.js} +1 -1
- package/dist/assets/{ja-B1bzkgDW.js → ja-DBjnsx21.js} +1 -1
- package/dist/assets/{ja-Hira-CMrY5hXO.js → ja-Hira-BZfSmj1i.js} +1 -1
- package/dist/assets/{ka-DKSXLnXP.js → ka-HwpuKgUY.js} +1 -1
- package/dist/assets/{kk-DHwMv8Dn.js → kk-DLKA9paj.js} +1 -1
- package/dist/assets/{km-tpLG1xNr.js → km-BU5kermq.js} +1 -1
- package/dist/assets/{kn-MLreVnHA.js → kn-BNFqbCoi.js} +1 -1
- package/dist/assets/{ko-CI0DBazn.js → ko-D8n4uMqQ.js} +1 -1
- package/dist/assets/{lb-CmL572Xe.js → lb-B1empQ7m.js} +1 -1
- package/dist/assets/{lt-DRtUOLdw.js → lt-gMukpK3G.js} +1 -1
- package/dist/assets/{lv-COSHgkOP.js → lv-D2O5AnsZ.js} +1 -1
- package/dist/assets/{match-BQoOW8Cj.js → match-BTF6WqJh.js} +1 -1
- package/dist/assets/{match-B-ergJQb.js → match-Cyum2eeW.js} +1 -1
- package/dist/assets/{match-dfBS0YSQ.js → match-ScHH8kYk.js} +1 -1
- package/dist/assets/mermaid-GHXKKRXX-D4H6EVJQ.js +1 -0
- package/dist/assets/metadata-admin-CEhVmXFv.js +9 -0
- package/dist/assets/{mk-B0IH_YL_.js → mk-D-Zl0xVN.js} +1 -1
- package/dist/assets/{mn-P-QdQ2n3.js → mn-jJbTslgD.js} +1 -1
- package/dist/assets/{ms-CtyEOINy.js → ms-CUuJHLA4.js} +1 -1
- package/dist/assets/{mt-DfuZ2HRm.js → mt-yIcbfxKY.js} +1 -1
- package/dist/assets/{nb-2Hp-5Tnt.js → nb-D9WNypoj.js} +1 -1
- package/dist/assets/{nl-BE-mmxbfNoR.js → nl-BE-B1vKiw2h.js} +1 -1
- package/dist/assets/{nl-CZ_nLREz.js → nl-DC7b5e90.js} +1 -1
- package/dist/assets/{nn-ccWhYsNa.js → nn-uP4yJ9s0.js} +1 -1
- package/dist/assets/{oc-z504BFRV.js → oc-DHTqadJI.js} +1 -1
- package/dist/assets/{pl-DeQ7ASt-.js → pl-Bxnnizf5.js} +1 -1
- package/dist/assets/plugin-calendar-b7C35ANT.js +1 -0
- package/dist/assets/plugin-charts-b-yVtmdI.js +7 -0
- package/dist/assets/{plugin-chatbot-Ck47EhDX.js → plugin-chatbot-D1KW_oIO.js} +8 -8
- package/dist/assets/plugin-dashboard-DTkPoPEb.js +6 -0
- package/dist/assets/plugin-form-UIRm-FpQ.js +1 -0
- package/dist/assets/plugin-gantt-9dtc8zzX.js +63 -0
- package/dist/assets/plugin-grid-Cp4RKtMJ.js +10 -0
- package/dist/assets/plugin-kanban-B2JOPZIJ.js +1 -0
- package/dist/assets/plugin-map-CBJcVJYk.js +1 -0
- package/dist/assets/{plugin-markdown-BOkHcir_.js → plugin-markdown-CNlDzqP-.js} +1 -1
- package/dist/assets/plugin-report-IZzgQb-Q.js +59 -0
- package/dist/assets/plugin-timeline-DsmtjcJ3.js +1 -0
- package/dist/assets/plugin-tree-DTRPBdhe.js +1 -0
- package/dist/assets/plugin-view-D9ixsNDG.js +1 -0
- package/dist/assets/plugins-views-CnvkdSJK.js +3 -0
- package/dist/assets/{pt-BR-D80_lPYF.js → pt-BR-D416seHT.js} +1 -1
- package/dist/assets/{pt-CJJ1RmXd.js → pt-DwHBy9_c.js} +1 -1
- package/dist/assets/{ro-EuFb2TCj.js → ro-DDf1X3Np.js} +1 -1
- package/dist/assets/{ru-CMaVQScp.js → ru-8eM3mcgK.js} +1 -1
- package/dist/assets/{runtime-metadata-persistence-ClOTznqa.js → runtime-metadata-persistence-DX29lQ62.js} +1 -1
- package/dist/assets/{se-DsfdKLdF.js → se-D4JvQeRX.js} +1 -1
- package/dist/assets/{sk-BNV9omI8.js → sk-DvpgttGI.js} +1 -1
- package/dist/assets/{sl-DJS_nINU.js → sl-B3gCZ-_a.js} +1 -1
- package/dist/assets/{sq-HEgjcbHe.js → sq-CVaTmL0V.js} +1 -1
- package/dist/assets/{sr-CO0CFu4X.js → sr-CnH5Ffyz.js} +1 -1
- package/dist/assets/{sr-Latn-eE1Idzey.js → sr-Latn-Dw9w61q6.js} +1 -1
- package/dist/assets/src-BUry7633.js +2 -0
- package/dist/assets/{src-BU7L2v4J.js → src-DMDT5a27.js} +1 -1
- package/dist/assets/src-ZxH3AOCu.js +16 -0
- package/dist/assets/{studioEntry-WeMfaSGn.js → studioEntry-DAqcBFtr.js} +1 -1
- package/dist/assets/{submitRedirect-C2lfZSHt.js → submitRedirect-iy0oOi7I.js} +1 -1
- package/dist/assets/{sv-5uTzgQT3.js → sv-CU7wdxyK.js} +1 -1
- package/dist/assets/{ta-BzgdkBZG.js → ta-DPH6q0HR.js} +1 -1
- package/dist/assets/{te-Ct_pl7ZJ.js → te-BSaThkGV.js} +1 -1
- package/dist/assets/{th-DouAlk0-.js → th-NXP8_Qb8.js} +1 -1
- package/dist/assets/{tr-3XNBsI40.js → tr-DDXoH663.js} +1 -1
- package/dist/assets/types-zod-ChJ30y25.js +1 -0
- package/dist/assets/{ug-B9n24h9G.js → ug-Guus6pPe.js} +1 -1
- package/dist/assets/ui-components-D8wcRNrt.js +37 -0
- package/dist/assets/ui-layout-BYO3rRIl.js +1 -0
- package/dist/assets/{uk-DCAenByf.js → uk-uiy4vsp8.js} +1 -1
- package/dist/assets/use-book-data-DFTswcKm.js +1 -0
- package/dist/assets/{useActionModal-Blp4rhOk.js → useActionModal-h52Z5Pkl.js} +1 -1
- package/dist/assets/useCanAuthorMetadata-TDrVrYGB.js +1 -0
- package/dist/assets/useDatasetCatalog-BOd0Ybr1.js +1 -0
- package/dist/assets/{useNavTargetLabel-BOJncjIb.js → useNavTargetLabel-D8lRdb6O.js} +1 -1
- package/dist/assets/useOpenRecordList-C7oqUD3F.js +1 -0
- package/dist/assets/{usePackageL10n-Ci9uVkRZ.js → usePackageL10n-Jl2XiF2F.js} +1 -1
- package/dist/assets/{useSettingsLabel-CeMnMWsh.js → useSettingsLabel-CSpBDTdy.js} +1 -1
- package/dist/assets/{uz-Cyrl-JSeHEqu-.js → uz-Cyrl-Cmb5bvbf.js} +1 -1
- package/dist/assets/{uz-DT3s9bZS.js → uz-DJWxoTz4.js} +1 -1
- package/dist/assets/vendor-objectstack-C4eD5dbT.js +139 -0
- package/dist/assets/{vi-D2p-h6bY.js → vi-Bb3QoIJC.js} +1 -1
- package/dist/assets/{zh-CN-DHOKqAit.js → zh-CN-C-Hts1ZR.js} +1 -1
- package/dist/assets/{zh-HK-D4iIPY7I.js → zh-HK-CtBAZ_ZS.js} +1 -1
- package/dist/assets/{zh-TW-gORQ_tZh.js → zh-TW-B7DDahD-.js} +1 -1
- package/dist/chunk-membership.json +28 -26
- package/dist/eager-closure.json +107 -101
- package/dist/index.html +4 -4
- package/dist/sdui.manifest.json +486 -63
- package/package.json +1 -1
- package/dist/assets/ApprovalsInboxPage-C6S1vk0X.js +0 -1
- package/dist/assets/AuditLogPage-v2dKXMuk.js +0 -1
- package/dist/assets/BookPage-DwFMcTSN.js +0 -1
- package/dist/assets/CreateViewDialog-D3l-tYHM.js +0 -1
- package/dist/assets/DocPage-B6AkH5WI.js +0 -1
- package/dist/assets/ExpressionProvider-CrL6jhVq.js +0 -1
- package/dist/assets/FlowRunsPage-CxdaiUyk.js +0 -1
- package/dist/assets/InterfaceListPage-C4wPYohR.js +0 -1
- package/dist/assets/MarketplacePackagePage-CfgKDpNH.js +0 -4
- package/dist/assets/MarketplacePage-DNEyU5AE.js +0 -1
- package/dist/assets/ObjectDataPage-CykEm9MD.js +0 -1
- package/dist/assets/PageView-C6u86tni.js +0 -1
- package/dist/assets/ProfilePage-C3SjXMzi.js +0 -1
- package/dist/assets/RecordDetailView-DgR_zhP4.js +0 -3
- package/dist/assets/ReportDefaultInspector-BIinF0EQ.js +0 -1
- package/dist/assets/ReportView-BREO-ADE.js +0 -2
- package/dist/assets/RuntimeDraftBar-BCWfd2yS.js +0 -1
- package/dist/assets/SchemaForm-C4uMMZ13.js +0 -3
- package/dist/assets/SearchResultsPage-C6Hw_Lpn.js +0 -1
- package/dist/assets/ai-DPBykF2N.js +0 -3
- package/dist/assets/app-shell-eager-leaves-Cf2bM6uT.js +0 -1
- package/dist/assets/data-adapter-Cymvlczj.js +0 -1
- package/dist/assets/default-inspector-registry-Bs6GBn00.js +0 -1
- package/dist/assets/dist-BF-ssUpn.js +0 -14
- package/dist/assets/drillUrlFilters-hi-2d3DW.js +0 -1
- package/dist/assets/en-AU-FVwCiDJO.js +0 -1
- package/dist/assets/en-GB-DQ_y5VbJ.js +0 -1
- package/dist/assets/en-IE-DaXOhsZW.js +0 -1
- package/dist/assets/en-IN-CnRZnAom.js +0 -1
- package/dist/assets/en-NZ-CBZLEToK.js +0 -1
- package/dist/assets/en-ZA-BE59v0wZ.js +0 -1
- package/dist/assets/framework-DFR4HNtj.js +0 -35
- package/dist/assets/getIcon-Cfwf-Egt.js +0 -1
- package/dist/assets/i18n-locale-ar-92O_xtDZ.js +0 -4
- package/dist/assets/i18n-locale-de-T5ic3yH9.js +0 -4
- package/dist/assets/i18n-locale-en-rxr7WJYl.js +0 -4
- package/dist/assets/i18n-locale-es-D_WOifJ_.js +0 -4
- package/dist/assets/i18n-locale-fr-3cvyjMkp.js +0 -4
- package/dist/assets/i18n-locale-ja-DXlIkB8I.js +0 -4
- package/dist/assets/i18n-locale-ko-DngRpS45.js +0 -4
- package/dist/assets/i18n-locale-pt-BkPaFCqZ.js +0 -4
- package/dist/assets/i18n-locale-ru-E5wLh-y6.js +0 -4
- package/dist/assets/i18n-locale-zh-BL4_Yand.js +0 -4
- package/dist/assets/i18n-runtime-97_bDVjP.js +0 -1
- package/dist/assets/index-Cadlh4t_.css +0 -2
- package/dist/assets/index-D98sa5GF.js +0 -20
- package/dist/assets/integration-CeAF4JFT.js +0 -1
- package/dist/assets/isSameWeek-DBXaA1Gd.js +0 -1
- package/dist/assets/mermaid-GHXKKRXX-Bb17TtNP.js +0 -1
- package/dist/assets/metadata-admin-CABUxbJl.js +0 -9
- package/dist/assets/plugin-calendar-Cn5HaZU8.js +0 -1
- package/dist/assets/plugin-charts-B6RcFWbo.js +0 -7
- package/dist/assets/plugin-dashboard-DjEx8e5Y.js +0 -6
- package/dist/assets/plugin-form-CLDvL0up.js +0 -1
- package/dist/assets/plugin-gantt-CrVrxVdi.js +0 -63
- package/dist/assets/plugin-grid-D2rmQEW_.js +0 -11
- package/dist/assets/plugin-kanban-BUNHFfIC.js +0 -1
- package/dist/assets/plugin-map-y-7RQQC5.js +0 -1
- package/dist/assets/plugin-report-mT3jpna0.js +0 -59
- package/dist/assets/plugin-timeline-B1EF83D3.js +0 -1
- package/dist/assets/plugin-tree-MTHUt3_S.js +0 -1
- package/dist/assets/plugin-view-DHJI-ahf.js +0 -1
- package/dist/assets/plugins-views-CfkgqD30.js +0 -3
- package/dist/assets/src-BUtIBFDA.js +0 -1
- package/dist/assets/src-C0eXlKtx.js +0 -16
- package/dist/assets/types-zod-DXpXw10W.js +0 -1
- package/dist/assets/ui-components-D6cEVg0T.js +0 -37
- package/dist/assets/ui-layout-DgVDuPEM.js +0 -1
- package/dist/assets/use-book-data-CwRldFxP.js +0 -1
- package/dist/assets/useCanAuthorMetadata-BxCMgFRf.js +0 -1
- package/dist/assets/useOpenRecordList-BrwJFojQ.js +0 -1
- package/dist/assets/vendor-objectstack-DFqu45yM.js +0 -138
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{p as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{p as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{At as i,Dt as a,Et as o,kn as s}from"./ui-components-D8wcRNrt.js";import{G as c,I as l,W as u,h as d}from"./framework-CAuH4h0L.js";import{w as f}from"./i18n-runtime-CdWyaiOD.js";import{r as p}from"./vendor-ui-utils-DIUdEYii.js";import{t as m}from"./vendor-icon-layout-dashboard-wba2hvZp.js";import{a as h}from"./ExpressionProvider-Dr0e99r1.js";import{t as g}from"./useActionModal-h52Z5Pkl.js";import{t as _}from"./preferLocal-DEJV3KIq.js";import{n as v}from"./utils-MjUhYVsx.js";import{n as y,t as b}from"./MetadataInspector-BQyu9pOE.js";import{n as x}from"./plugin-dashboard-DTkPoPEb.js";import{t as S}from"./useOpenRecordList-C7oqUD3F.js";var C=n();function w({cards:e=6}){return(0,C.jsxs)(`div`,{className:`w-full space-y-6 p-4 sm:p-6`,children:[(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(s,{className:`h-7 w-56`}),(0,C.jsx)(s,{className:`h-4 w-80`})]}),(0,C.jsx)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:Array.from({length:4}).map((e,t)=>(0,C.jsxs)(`div`,{className:`rounded-lg border p-4 space-y-2`,children:[(0,C.jsx)(s,{className:`h-4 w-20`}),(0,C.jsx)(s,{className:`h-8 w-24`}),(0,C.jsx)(s,{className:`h-3 w-16`})]},`stat-${t}`))}),(0,C.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:e}).map((e,t)=>(0,C.jsxs)(`div`,{className:`rounded-lg border p-4 space-y-3`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,C.jsx)(s,{className:`h-5 w-32`}),(0,C.jsx)(s,{className:`h-5 w-5 rounded-full`})]}),(0,C.jsx)(s,{className:`h-40 w-full`}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(s,{className:`h-3 w-16`}),(0,C.jsx)(s,{className:`h-3 w-12`})]})]},`widget-${t}`))})]})}var T=e(r(),1);function E(){d({objectName:`*`})}function D({dataSource:e}){let n=S(),{dashboardName:r}=t(),{showDebug:s}=y(),d=u(),{t:D}=f(),[O,k]=(0,T.useState)(!0),{modalHandler:A,modalElement:j}=g(d),M=(0,T.useMemo)(()=>({export_dashboard_pdf:async()=>{p.info(D(`dashboardActions.printDialogOpening`));try{return window.print(),{success:!0}}catch(e){return p.error(D(`dashboardActions.exportFailed`,{message:e?.message||String(e)})),{success:!1,error:e?.message||String(e)}}},forecast_dashboard:async()=>(p.info(D(`dashboardActions.forecastSoon`)),{success:!0})}),[D]);(0,T.useEffect)(()=>{k(!0),queueMicrotask(()=>k(!1))},[r]);let{dashboards:N,objects:P}=c(),{app:F}=h(),I=_(N,r,F?._packageId),L=(0,T.useMemo)(()=>new Set((P||[]).map(e=>e?.name).filter(Boolean)),[P]),R=(0,T.useMemo)(()=>{if(!I||L.size===0)return I;let e=I.widgets;if(!Array.isArray(e)||e.length===0)return I;let t=e.filter(e=>{let t=e?.requiresObject??e?.object;return!t||L.has(t)});return t.length===e.length?I:{...I,widgets:t}},[I,L]);return O?(0,C.jsx)(w,{}):I?(0,C.jsxs)(`div`,{className:`flex flex-col h-full overflow-hidden bg-background`,children:[(0,C.jsx)(`div`,{className:`flex flex-col sm:flex-row justify-between sm:items-center gap-3 sm:gap-4 p-4 sm:p-6 border-b shrink-0`,children:(0,C.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(()=>{let e=v(I.label,D)||I.name;return(0,C.jsx)(`h1`,{className:`text-lg sm:text-xl md:text-2xl font-bold tracking-tight truncate`,children:e})})(),(()=>{let e=(R||I).description??I.description,t=v(e,D);return t?(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:t}):null})()]})}),(0,C.jsxs)(`div`,{className:`flex-1 overflow-hidden flex flex-col sm:flex-row relative`,children:[(0,C.jsx)(`div`,{className:`flex-1 min-w-0 overflow-auto p-2 sm:p-4 md:p-6`,children:(0,C.jsx)(l,{value:{openRecordList:n},children:(0,C.jsx)(x,{schema:R,localized:!0,dataSource:e,modalHandler:A,scriptHandlers:M,onRefresh:E,hideHeaderText:!0})})}),(0,C.jsx)(b,{open:s,sections:[{title:`Dashboard Configuration`,data:R}]})]}),j]}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,C.jsxs)(o,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(m,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(i,{children:D(`empty.dashboardNotFound`)}),(0,C.jsx)(a,{children:D(`empty.dashboardNotFoundDescription`,{name:r})})]})})}export{D as DashboardView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,d as n,p as r,r as i,t as a,v as o}from"./vendor-react-BggL7APJ.js";import{W as s}from"./framework-CAuH4h0L.js";import{w as c}from"./i18n-runtime-CdWyaiOD.js";import{t as l}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as u}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as d}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as f}from"./vendor-icon-file-question-mark-CDRVvH3W.js";import{t as p}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as m}from"./vendor-icon-menu-9YHQR0RT.js";import"./src-ZxH3AOCu.js";import{t as h}from"./DocShell-Bzl3QS30.js";import{a as g,i as _,n as v,u as y}from"./use-book-data-DFTswcKm.js";import{r as b,t as x}from"./plugin-markdown-CNlDzqP-.js";import{n as S}from"./BookPage-DYjUsQIc.js";var C=e(o(),1),w=/(^```[^\n]*\n[\s\S]*?\n```[ \t]*$|^~~~[^\n]*\n[\s\S]*?\n~~~[ \t]*$)/m,T=/(`[^`\n]+`)/,E=/\]\((?:\.\/)?([a-z][a-z0-9_]*)\.md(#[^)\s]*)?\)/g;function D(e){return e.split(T).map((e,t)=>t%2==1?e:e.replace(E,`](/docs/$1$2)`)).join(``)}function O(e){let t=[],n=e;for(;;){let e=w.exec(n);if(!e||e.index===void 0)return t.push(D(n)),t.join(``);t.push(D(n.slice(0,e.index)),e[0]),n=n.slice(e.index+e[0].length)}}var k=a();function A({book:e,activeDoc:t,docHref:n}){return(0,k.jsxs)(`nav`,{"aria-label":e.label??e.name,className:`text-sm`,children:[e.label?(0,k.jsx)(`div`,{className:`mb-3 px-2 text-sm font-semibold text-foreground`,children:e.label}):null,(0,k.jsx)(`div`,{className:`space-y-5`,children:e.groups.map(e=>(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 px-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e.label}),(0,k.jsx)(`ul`,{className:`space-y-0.5`,children:e.entries.map((e,r)=>{if(e.separator)return(0,k.jsx)(`li`,{className:`my-1.5 border-t border-border/60`,"aria-hidden":!0},`sep-${r}`);if(e.href)return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1.5 rounded px-2 py-1 text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:e.label??e.href}),(0,k.jsx)(d,{className:`h-3 w-3 shrink-0 opacity-60`})]})},`ext-${r}`);if(!e.doc)return null;let a=e.doc===t;return(0,k.jsx)(`li`,{children:(0,k.jsx)(i,{to:n(e.doc),"aria-current":a?`page`:void 0,className:`block truncate rounded px-2 py-1 transition ${a?`bg-primary/10 font-medium text-foreground`:`text-muted-foreground hover:bg-muted/50 hover:text-foreground`}`,children:e.label??e.doc})},e.doc)})})]},e.key))})]})}function j(){let{slug:e,name:i,appName:a}=r(),o=n(),d=s(),{t:w}=c(),[T,E]=(0,C.useState)(null),[D,j]=(0,C.useState)(`loading`),[M,N]=(0,C.useState)(``);(0,C.useEffect)(()=>{let e=!1;async function t(){if(i&&d){j(`loading`);try{let t=await d.getClient().meta.getItem(`doc`,i,a?{packageId:a}:void 0),n=t?.item??t?.data??t;if(e)return;n&&typeof n.content==`string`?(E({name:i,label:n.label,content:n.content}),j(`ready`)):j(`missing`)}catch(t){if(e)return;let n=t?.httpStatus;if(n===401||n===403){N(t?.message??``),j(`refused`);return}n===404||/not found/i.test(t?.message??``)?j(`missing`):(N(t?.message??`Failed to load documentation`),j(`error`))}}}return t(),()=>{e=!0}},[i,a,d]);let P=(0,C.useCallback)(e=>{document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`start`}),window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${e}`)},[]),F=(0,C.useCallback)(e=>{if(e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0)return;let t=e.target.closest(`a`)?.getAttribute(`href`);t&&(t.startsWith(`/docs/`)?(e.preventDefault(),o(t)):t.startsWith(`#`)&&(e.preventDefault(),P(decodeURIComponent(t.slice(1)))))},[o,P]),I=(0,C.useCallback)((e,t)=>{e.defaultPrevented||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||(e.preventDefault(),P(t))},[P]),L=(0,C.useMemo)(()=>b(T?.content??``),[T?.content]),R=w(`help.onThisPage`,{defaultValue:`On this page`}),{books:z,docs:B}=v(),V=a?`/apps/${a}/docs`:`/docs`,H=(0,C.useMemo)(()=>{let t=z.find(t=>g(t)===e);return t?y(t,B):null},[z,B,e]),U=(0,C.useCallback)(t=>`${V}/${e}/${t}`,[V,e]),W=(0,C.useMemo)(()=>e&&!H?_(e,z):null,[e,H,z]);return W&&i?(0,k.jsx)(t,{to:`${V}/${g(W)}/${i}`,replace:!0}):D===`loading`?(0,k.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,k.jsx)(p,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):D===`missing`?(0,k.jsx)(h,{breadcrumb:i,children:(0,k.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,k.jsx)(f,{className:`h-10 w-10 text-muted-foreground`}),(0,k.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,k.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No document named `,(0,k.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:i}),` is installed. It may belong to a package that is not installed, or it was removed in a newer version.`]})]})}):D===`refused`?(0,k.jsx)(S,{name:i,message:M}):D===`error`?(0,k.jsx)(h,{breadcrumb:i,children:(0,k.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,k.jsx)(u,{className:`h-10 w-10 text-destructive`}),(0,k.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:M})]})}):(0,k.jsxs)(h,{breadcrumb:T?.label??i,children:[H?(0,k.jsxs)(`details`,{className:`group mx-auto max-w-6xl px-4 pt-4 sm:px-6 lg:hidden`,children:[(0,k.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-2 rounded-md border bg-muted/30 px-3 py-2 text-sm font-medium [&::-webkit-details-marker]:hidden`,children:[(0,k.jsx)(m,{className:`h-4 w-4 text-muted-foreground`}),(0,k.jsx)(`span`,{className:`truncate`,children:H.label??`Contents`}),(0,k.jsx)(l,{className:`ml-auto h-4 w-4 text-muted-foreground transition-transform group-open:rotate-180`})]}),(0,k.jsx)(`div`,{className:`mt-2 rounded-md border p-3`,children:(0,k.jsx)(A,{book:H,activeDoc:i,docHref:U})})]}):null,(0,k.jsxs)(`div`,{className:`mx-auto flex gap-8 p-4 sm:p-6 ${H?`max-w-6xl`:`max-w-5xl`}`,children:[H?(0,k.jsx)(`aside`,{className:`hidden w-56 shrink-0 lg:block`,children:(0,k.jsx)(`nav`,{className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto pr-1`,children:(0,k.jsx)(A,{book:H,activeDoc:i,docHref:U})})}):null,(0,k.jsx)(`article`,{className:`min-w-0 max-w-3xl flex-1 [&_h1]:scroll-mt-24 [&_h2]:scroll-mt-24 [&_h3]:scroll-mt-24`,onClick:F,children:(0,k.jsx)(x,{schema:{type:`markdown`,content:O(T?.content??``)}})}),L.length>=3?(0,k.jsx)(`aside`,{className:`hidden xl:block w-56 shrink-0`,children:(0,k.jsxs)(`nav`,{"aria-label":R,className:`sticky top-20 max-h-[calc(100vh-6rem)] overflow-auto`,children:[(0,k.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:R}),(0,k.jsx)(`ul`,{className:`border-l border-border text-sm`,children:L.map(e=>(0,k.jsx)(`li`,{style:{paddingLeft:(e.depth-2)*12},children:(0,k.jsx)(`a`,{href:`#${e.id}`,onClick:t=>I(t,e.id),className:`-ml-px block border-l border-transparent py-0.5 pl-3 text-muted-foreground hover:border-primary hover:text-foreground`,children:e.text})},e.id))})]})}):null]})]})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{r as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{t as i}from"./vendor-icon-book-open-DKPXYwQK.js";import{t as a}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as o}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as s}from"./DocShell-Bzl3QS30.js";import{n as c,o as l}from"./use-book-data-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{r as t,t as n,v as r}from"./vendor-react-BggL7APJ.js";import{t as i}from"./vendor-icon-book-open-DKPXYwQK.js";import{t as a}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as o}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as s}from"./DocShell-Bzl3QS30.js";import{n as c,o as l}from"./use-book-data-DFTswcKm.js";var u=e(r(),1),d=n();function f(){let{books:e,docs:n,state:r,error:f}=c(),p=(0,u.useMemo)(()=>l(e,n),[e,n]);return r===`loading`?(0,d.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,d.jsx)(o,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})}):r===`error`?(0,d.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,d.jsx)(a,{className:`h-10 w-10 text-destructive`}),(0,d.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Failed to load documentation`}),(0,d.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:f})]}):(0,d.jsx)(s,{children:(0,d.jsxs)(`div`,{className:`mx-auto max-w-4xl p-4 sm:p-6`,children:[(0,d.jsxs)(`header`,{className:`mb-6`,children:[(0,d.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Documentation`}),(0,d.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Books and guides from your installed packages.`})]}),p.length===0?(0,d.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-16 text-center text-muted-foreground`,children:[(0,d.jsx)(i,{className:`h-10 w-10`}),(0,d.jsxs)(`p`,{className:`text-sm`,children:[`No documentation is installed. Packages ship docs as flat`,(0,d.jsx)(`code`,{className:`mx-1 rounded bg-muted px-1 py-0.5`,children:`src/docs/*.md`}),`files, organised by a `,(0,d.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`book`}),` (ADR-0046).`]})]}):(0,d.jsx)(`ul`,{className:`grid items-stretch gap-3 sm:grid-cols-2`,children:p.map(e=>(0,d.jsx)(`li`,{className:`h-full`,children:(0,d.jsxs)(t,{to:`/docs/${e.slug}`,className:`flex h-full items-start gap-3 rounded-md border border-border p-3 hover:bg-muted/50`,children:[(0,d.jsx)(i,{className:`mt-0.5 h-5 w-5 shrink-0 text-muted-foreground`}),(0,d.jsxs)(`div`,{className:`min-w-0`,children:[(0,d.jsx)(`div`,{className:`text-sm font-semibold`,children:e.label}),e.description?(0,d.jsx)(`div`,{className:`mt-0.5 line-clamp-2 text-xs text-muted-foreground`,children:e.description}):e.subtitle?(0,d.jsx)(`div`,{className:`mt-0.5 truncate font-mono text-[11px] text-muted-foreground/70`,children:e.subtitle}):null,(0,d.jsxs)(`div`,{className:`mt-1 text-xs text-muted-foreground/80`,children:[e.docCount,` `,e.docCount===1?`article`:`articles`]})]})]})},e.name))})]})})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,t}from"./vendor-react-BggL7APJ.js";import{r as n,t as r}from"./use-book-data-
|
|
1
|
+
import{o as e,t}from"./vendor-react-BggL7APJ.js";import{r as n,t as r}from"./use-book-data-DFTswcKm.js";var i=t();function a(){let t=n();return(0,i.jsx)(r.Provider,{value:t,children:(0,i.jsx)(e,{})})}export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{a as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{W as a}from"./framework-CAuH4h0L.js";import{t as o}from"./vendor-icon-file-question-mark-CDRVvH3W.js";import{t as s}from"./vendor-icon-loader-circle-D3PsuVaD.js";import"./src-ZxH3AOCu.js";import{t as c}from"./DocShell-Bzl3QS30.js";import{a as l,c as u,i as d,n as f}from"./use-book-data-DFTswcKm.js";import{n as p,t as m}from"./BookPage-DYjUsQIc.js";var h=e(i(),1),g=r();async function _(e,t,n){for(let r of[`doc`,`book`])try{return await e.meta.getItem(r,t,n),null}catch(e){let t=e?.httpStatus;if(t===401||t===403)return e?.message??``;if(t!==404)return null}return null}function v(){let{slug:e,appName:r}=n(),{books:i,docs:v,state:y}=f(),b=a(),x=y===`ready`&&!!e&&!i.some(t=>l(t)===e)&&!v.some(t=>t.name===e)&&!d(e,i),[S,C]=(0,h.useState)(null);if((0,h.useEffect)(()=>{if(!x||!e||!b)return;let t=!1;return _(b.getClient(),e,r?{packageId:r}:void 0).then(n=>{t||C({slug:e,refusal:n})}),()=>{t=!0}},[x,e,r,b]),y===`loading`||x&&b&&S?.slug!==e)return(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center p-10 text-muted-foreground`,children:(0,g.jsx)(s,{className:`h-5 w-5 animate-spin`,"aria-label":`Loading documentation`})});if(e&&i.some(t=>l(t)===e))return(0,g.jsx)(m,{});let w=r?`/apps/${r}/docs`:`/docs`,T=e?u(e,i,v):null;if(T&&e&&v.some(t=>t.name===e))return(0,g.jsx)(t,{to:`${w}/${l(T)}/${e}`,replace:!0});let E=e?d(e,i):null;if(E)return(0,g.jsx)(t,{to:`${w}/${l(E)}`,replace:!0});let D=S!==null&&S.slug===e?S.refusal:null;return D===null?T&&e?(0,g.jsx)(t,{to:`${w}/${l(T)}/${e}`,replace:!0}):(0,g.jsx)(c,{breadcrumb:e,children:(0,g.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col items-center gap-3 p-10 text-center`,children:[(0,g.jsx)(o,{className:`h-10 w-10 text-muted-foreground`}),(0,g.jsx)(`h1`,{className:`text-lg font-semibold`,children:`Documentation not found`}),(0,g.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`No book or document named `,(0,g.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:e}),` is installed.`]})]})}):(0,g.jsx)(p,{name:e,message:D})}export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{xt as r}from"./vendor-objectstack-C4eD5dbT.js";import{et as i}from"./ui-components-D8wcRNrt.js";import{Mt as a,_t as o,pi as s,yr as c}from"./framework-CAuH4h0L.js";var l=e(n(),1),u=t(),d=(0,l.createContext)(null);function f({user:e={},features:t={},permissions:n}={}){let r=s(e,n);return{current_user:r,user:r,ctx:{user:r},os:{user:r},features:t}}var p=new WeakMap;function m(e){let t=p.get(e);if(t===void 0){try{t=r(e)}catch(e){console.error(`[object-ui] current_user.can(object, verb) is not bound: the permissions payload was refused — ${e instanceof Error?e.message:String(e)}`),t=null}p.set(e,t)}return t??void 0}function h(){let{isLoaded:e,effectiveObjects:t}=i();return e&&t?m(t):void 0}function g(e={}){return new c(f(e))}function _({children:e,user:t={},app:n={},data:r={},features:i={}}){let o=h(),s=(0,l.useMemo)(()=>({user:t,app:n,data:r,features:i,evaluator:g({user:t,features:i,permissions:o})}),[t,n,r,i,o]),c=(0,l.useMemo)(()=>f({user:t,features:i,permissions:o}),[t,i,o]);return(0,u.jsx)(d.Provider,{value:s,children:(0,u.jsx)(a,{scope:c,children:e})})}function v(){let e=(0,l.useContext)(d);if(!e){let e={user:{},features:{}};return{...e,app:{},data:{},evaluator:g(e)}}return e}var y=`app-shell:visible`;function b(e,t,n=`visible`){if(e==null||e===!0||e===`true`)return!0;if(e===!1||e===`false`)return!1;let r=t=>o(y,void 0,n,e,t,`app-shell`);try{return t.evaluateCondition(e,{onFault:r})}catch(e){return r(e),!0}}function x(e,t){return e?.hidden!==!0&&b(e?.visibleWhen,t,`visibleWhen`)}export{v as a,x as i,g as n,h as o,b as r,_ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{a as r}from"./infrastructure-CSnL6ntj.js";import{$n as i,Fn as a,Gr as o,Hn as s,Hr as c,Mn as l,Nn as u,Pn as d,Ur as f,Vr as p,Wr as m,Yn as h,Zt as g,an as _,bi as v,cn as y,ii as b,in as x,jn as S,kn as C,nn as w,on as T,rn as E,sn as D}from"./ui-components-D8wcRNrt.js";import{G as O,W as k}from"./framework-CAuH4h0L.js";import{t as A}from"./i18n-runtime-CdWyaiOD.js";import{t as j}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as M}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as N}from"./vendor-icon-circle-x-Nkh1Yr7N.js";import{t as P}from"./vendor-icon-clock-CTLnah0r.js";import{t as F}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as I}from"./vendor-icon-play-BfFoh-7G.js";import{t as L}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as R}from"./vendor-icon-workflow-B9ASq0nN.js";import"./src-ZxH3AOCu.js";import{O as z}from"./RecordDetailView-B3XBEgk2.js";var B=e(n(),1),V=t();function H({status:e}){let t={success:{icon:M,cls:`text-emerald-600 border-emerald-300`},completed:{icon:M,cls:`text-emerald-600 border-emerald-300`},failed:{icon:N,cls:`text-red-600 border-red-300`},error:{icon:N,cls:`text-red-600 border-red-300`},running:{icon:F,cls:`text-blue-600 border-blue-300 animate-pulse`},pending:{icon:P,cls:`text-amber-600 border-amber-300`},paused:{icon:P,cls:`text-amber-600 border-amber-300`},skipped:{icon:j,cls:`text-muted-foreground`}}[e]??{icon:j,cls:`text-muted-foreground`},n=t.icon;return(0,V.jsxs)(b,{variant:`outline`,className:`text-[10px] font-mono inline-flex items-center gap-1 ${t.cls}`,children:[(0,V.jsx)(n,{className:`h-3 w-3`}),e]})}function U(e,t){if(!e)return`—`;try{return new Date(e).toLocaleString(t)}catch{return e}}function W(e,t){switch(t){case`number`:{if(e===``)return;let t=Number(e);return Number.isNaN(t)?e:t}case`boolean`:return e===`true`;case`object`:case`list`:case`array`:if(e.trim()===``)return;try{return JSON.parse(e)}catch{return e}default:return e}}function G({data:e}){return(0,V.jsx)(`pre`,{className:`rounded border bg-muted/30 p-2 text-xs font-mono overflow-auto whitespace-pre-wrap break-all max-h-96`,children:JSON.stringify(e,null,2)})}function K(){let e=k()?.getClient?.(),[t,n]=(0,B.useState)([]),[r,i]=(0,B.useState)(!0),[a,s]=(0,B.useState)(null),[l,u]=(0,B.useState)(``),[d,h]=(0,B.useState)(0),g=(0,B.useCallback)(async()=>{if(!e?.meta?.getItems){s(`meta.getItems is not available on this client`),i(!1);return}i(!0),s(null);try{let t=await e.meta.getItems(`flow`),r=(Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[]).map(e=>({name:e?.spec?.name??e?.name,label:e?.spec?.label,spec:e?.spec??e,updatedAt:e?.updatedAt??e?.updated_at})).filter(e=>e.name);n(r),!l&&r.length>0&&u(r[0].name)}catch(e){s(e?.message??String(e))}finally{i(!1)}},[e,l]);(0,B.useEffect)(()=>{g()},[g]);let _=(0,B.useMemo)(()=>t.find(e=>e.name===l)??null,[t,l]);return(0,V.jsxs)(`div`,{className:`flex flex-col gap-4 p-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,V.jsx)(R,{className:`h-5 w-5`}),`Flow Runs`]}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Pick a flow, trigger a test run with sample inputs, and inspect recent run history`})]}),(0,V.jsxs)(p,{children:[(0,V.jsx)(m,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(o,{className:`text-base`,children:`Flow`}),(0,V.jsx)(f,{children:`Select a flow definition to test`})]}),(0,V.jsxs)(v,{variant:`outline`,size:`sm`,onClick:g,disabled:r,children:[(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2 ${r?`animate-spin`:``}`}),`Refresh`]})]})}),(0,V.jsxs)(c,{children:[r&&(0,V.jsx)(C,{className:`h-9 w-72`}),a&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:a}),!r&&!a&&t.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No flow definitions found.`}),!r&&!a&&t.length>0&&(0,V.jsx)(`select`,{value:l,onChange:e=>u(e.target.value),className:`flex h-9 w-full max-w-md rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring`,children:t.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.label?`${e.label} (${e.name})`:e.name},e.name))})]})]}),_&&(0,V.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,V.jsx)(q,{client:e,flow:_.spec,onExecuted:()=>h(e=>e+1)}),(0,V.jsx)(J,{client:e,flowName:_.name,refreshKey:d})]})]})}function q({client:e,flow:t,onExecuted:n}){let a=(0,B.useMemo)(()=>(t?.variables??[]).filter(e=>e?.isInput),[t]),s=k(),{objects:l}=O(),u=(0,B.useMemo)(()=>r(),[]),[d,_]=(0,B.useState)({}),[x,S]=(0,B.useState)(!1),[C,w]=(0,B.useState)(null),[T,E]=(0,B.useState)(null),[D,A]=(0,B.useState)(null);(0,B.useEffect)(()=>{_({}),w(null),E(null),A(null)},[t?.name]);let j=(e,t)=>_(n=>({...n,[e]:t}));return(0,V.jsxs)(p,{children:[(0,V.jsxs)(m,{className:`pb-3`,children:[(0,V.jsx)(o,{className:`text-base`,children:`Test Run`}),(0,V.jsx)(f,{children:`Provide input values and invoke the flow`})]}),(0,V.jsxs)(c,{className:`space-y-3`,children:[a.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This flow declares no input variables. Click Run to invoke with no parameters.`}),a.map(e=>(0,V.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,V.jsxs)(i,{htmlFor:`var-${e.name}`,className:`flex items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),(0,V.jsx)(b,{variant:`outline`,className:`text-[10px] font-mono`,children:e.type})]}),e.type===`boolean`?(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(y,{id:`var-${e.name}`,checked:d[e.name]===`true`,onCheckedChange:t=>j(e.name,t?`true`:`false`)}),(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d[e.name]===`true`?`true`:`false`})]}):e.type===`object`||e.type===`list`||e.type===`array`?(0,V.jsx)(g,{id:`var-${e.name}`,placeholder:`JSON ${e.type}`,value:d[e.name]??``,onChange:t=>j(e.name,t.target.value),className:`font-mono text-xs min-h-[80px]`}):(0,V.jsx)(h,{id:`var-${e.name}`,type:e.type===`number`?`number`:`text`,value:d[e.name]??``,onChange:t=>j(e.name,t.target.value)})]},e.name)),(0,V.jsx)(`div`,{className:`pt-1`,children:(0,V.jsxs)(v,{onClick:async()=>{if(!e?.automation?.execute){E(`automation.execute is not available on this client`);return}S(!0),E(null),w(null),A(null);try{let r={};for(let e of a){let t=d[e.name];t!==void 0&&(r[e.name]=W(t,e.type))}let i=await e.automation.execute(t.name,{params:r});w(i),i?.status===`paused`&&i?.screen&&i?.runId&&A({flowName:t.name,flowLabel:i.flowLabel,runId:i.runId,screen:i.screen}),n?.()}catch(e){E(e?.message??String(e))}finally{S(!1)}},disabled:x,size:`sm`,children:[x?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(I,{className:`h-3.5 w-3.5 mr-2`}),x?`Running…`:`Run Flow`]})}),(C||T)&&(0,V.jsxs)(`div`,{className:`pt-2 border-t mt-2 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium`,children:[T||C?.success===!1?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(N,{className:`h-4 w-4 text-red-500`}),` Failed`]}):C?.status===`paused`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(P,{className:`h-4 w-4 text-amber-500`}),` Waiting for input`]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(M,{className:`h-4 w-4 text-emerald-500`}),` Result`]}),typeof C?.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono`,children:[C.durationMs,` ms`]})]}),T&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:T}),C?.status===`paused`&&C?.screen&&C?.runId&&!D&&(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`This run is paused at screen `,(0,V.jsx)(`span`,{className:`font-mono`,children:C.screen.nodeId}),`.`]}),(0,V.jsx)(v,{size:`sm`,variant:`outline`,onClick:()=>A({flowName:t.name,flowLabel:C.flowLabel,runId:C.runId,screen:C.screen}),children:`Continue run`})]}),C&&(0,V.jsx)(G,{data:C})]})]}),(0,V.jsx)(z,{state:D,authFetch:u,baseUrl:``,dataSource:s,objects:l,onClose:()=>{A(null),n?.()},onComplete:()=>{A(null),n?.()}})]})}function J({client:e,flowName:t,refreshKey:n}){let r=A(),[i,h]=(0,B.useState)([]),[g,y]=(0,B.useState)(!0),[O,k]=(0,B.useState)(null),[j,M]=(0,B.useState)(null),[N,P]=(0,B.useState)(null),[I,R]=(0,B.useState)(!1),[z,W]=(0,B.useState)(null),K=(0,B.useCallback)(async()=>{if(!e?.automation?.listRuns){k(`automation.listRuns is not available on this client`),y(!1);return}y(!0),k(null);try{let n=await e.automation.listRuns(t,{limit:20}),r=Array.isArray(n)?n:n?.items??n?.runs??[];h(r)}catch(e){k(e?.message??String(e))}finally{y(!1)}},[e,t]);(0,B.useEffect)(()=>{K()},[K,n]);let q=async n=>{M(n),P(null),W(null),R(!0);try{let r=await e.automation.getRun(t,n);P(r?.run??r)}catch(e){W(e?.message??String(e))}finally{R(!1)}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(p,{children:[(0,V.jsx)(m,{className:`pb-3`,children:(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(o,{className:`text-base`,children:`Recent Runs`}),(0,V.jsx)(f,{className:`font-mono text-xs`,children:t})]}),(0,V.jsxs)(v,{variant:`outline`,size:`sm`,onClick:K,disabled:g,children:[g?(0,V.jsx)(F,{className:`h-3.5 w-3.5 mr-2 animate-spin`}):(0,V.jsx)(L,{className:`h-3.5 w-3.5 mr-2`}),`Refresh`]})]})}),(0,V.jsxs)(c,{children:[g&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(C,{className:`h-8 w-full`}),(0,V.jsx)(C,{className:`h-8 w-full`}),(0,V.jsx)(C,{className:`h-8 w-full`})]}),!g&&O&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:O}),!g&&!O&&i.length===0&&(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-6 text-center`,children:`No runs yet. Use the Test Run panel to invoke this flow.`}),!g&&!O&&i.length>0&&(0,V.jsxs)(w,{children:[(0,V.jsx)(T,{children:(0,V.jsxs)(D,{children:[(0,V.jsx)(_,{children:`Run`}),(0,V.jsx)(_,{children:`Status`}),(0,V.jsx)(_,{children:`Started`}),(0,V.jsx)(_,{className:`text-right`,children:`Duration`})]})}),(0,V.jsx)(E,{children:i.map(e=>(0,V.jsxs)(D,{className:`cursor-pointer`,onClick:()=>q(e.id),children:[(0,V.jsxs)(x,{className:`font-mono text-xs`,children:[e.id.slice(0,12),`…`]}),(0,V.jsx)(x,{children:(0,V.jsx)(H,{status:e.status})}),(0,V.jsx)(x,{className:`text-xs text-muted-foreground`,children:U(e.startedAt,r)}),(0,V.jsx)(x,{className:`text-right font-mono text-xs`,children:typeof e.durationMs==`number`?`${e.durationMs} ms`:`—`})]},e.id))})]})]})]}),(0,V.jsx)(S,{open:!!j,onOpenChange:e=>{e||(M(null),P(null))},children:(0,V.jsxs)(l,{side:`right`,className:`w-full sm:max-w-2xl p-0 flex flex-col`,children:[(0,V.jsxs)(d,{className:`p-4 border-b`,children:[(0,V.jsxs)(a,{className:`font-mono text-sm break-all`,children:[`Run `,j]}),(0,V.jsx)(u,{children:N&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,V.jsx)(H,{status:N.status}),typeof N.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono`,children:[N.durationMs,` ms`]}),(0,V.jsx)(`span`,{className:`text-xs`,children:U(N.startedAt,r)})]})})]}),(0,V.jsxs)(s,{className:`flex-1 p-4`,children:[I&&(0,V.jsxs)(`div`,{className:`space-y-2`,children:[(0,V.jsx)(C,{className:`h-16 w-full`}),(0,V.jsx)(C,{className:`h-16 w-full`}),(0,V.jsx)(C,{className:`h-16 w-full`})]}),z&&(0,V.jsx)(`p`,{className:`text-sm text-red-500 font-mono break-all`,children:z}),!I&&N&&(0,V.jsx)(`div`,{className:`space-y-3`,children:Array.isArray(N.steps)&&N.steps.length>0?N.steps.map((e,t)=>(0,V.jsxs)(`div`,{className:`rounded-md border p-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:[`#`,t+1]}),(0,V.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.nodeLabel||e.nodeId}),e.nodeType&&(0,V.jsx)(b,{variant:`outline`,className:`text-[10px] font-mono`,children:e.nodeType}),(0,V.jsx)(H,{status:e.status}),typeof e.durationMs==`number`&&(0,V.jsxs)(b,{variant:`secondary`,className:`text-[10px] font-mono ml-auto`,children:[e.durationMs,` ms`]})]}),e.input!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Input`}),(0,V.jsx)(G,{data:e.input})]}),e.output!==void 0&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Output`}),(0,V.jsx)(G,{data:e.output})]}),e.error&&(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-red-500 mb-1`,children:`Error`}),(0,V.jsx)(G,{data:e.error})]})]},`${e.nodeId}-${t}`)):(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground mb-1`,children:`Run`}),(0,V.jsx)(G,{data:N})]})})]})]})})]})}export{K as FlowRunsPage};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{Fr as a,Gr as o,Hr as s,Ir as c,Mr as l,Nr as u,Pr as d,Ur as f,Vr as p,Wr as m,Yn as h,bi as g,ci as _,ii as v,jr as y,li as b,ui as x}from"./ui-components-D8wcRNrt.js";import{t as S}from"./vendor-icon-bot-B9KkwkON.js";import{t as C}from"./vendor-icon-check-vpu9Zukp.js";import{t as w}from"./vendor-icon-copy-B5M-KdZo.js";import{t as T}from"./vendor-icon-database-C8JGjSkn.js";import{t as E}from"./vendor-icon-download-C3csYSaD.js";import{t as D}from"./vendor-icon-key-round-hQwGYgPA.js";import{t as O}from"./vendor-icon-plug-CL1O_4J3.js";import{t as k}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{t as A}from"./vendor-icon-terminal-Cgjziqoo.js";import"./src-ZxH3AOCu.js";import{D as j}from"./default-inspector-registry-Dktr6x_q.js";var M=e(i(),1),N=`objectstack`,P=`Query and modify data in an ObjectStack app over MCP — discover objects, read and filter records, and create/update/delete under your own permissions and row-level security. Use when the user wants to inspect or change data in their ObjectStack environment.`,F=`<YOUR_ENV_MCP_URL>`;function I(e={}){let t=e.mcpUrl?.trim()||F,n=e.envName?.trim();return`---
|
|
2
2
|
name: ${N}
|
|
3
3
|
description: ${P}
|
|
4
4
|
---
|
|
@@ -79,4 +79,4 @@ create/update payload.
|
|
|
79
79
|
3. \`query_records\` to read / verify current state.
|
|
80
80
|
4. \`create_record\` / \`update_record\` / \`delete_record\` to make changes,
|
|
81
81
|
confirming destructive steps with the user.
|
|
82
|
-
`}var L=r();function R(){let[e,t]=(0,M.useState)(!1);return[e,e=>{navigator.clipboard?.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}]}function z({value:e,label:t}){let[n,r]=R();return(0,L.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>r(e),"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function B(){let e=typeof window<`u`?window.location.origin:``,[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(null),[y,T]=(0,M.useState)(`Agent key`),[O,A]=(0,M.useState)(!1),[N,P]=(0,M.useState)(null),[F,B]=(0,M.useState)(null),[V,H]=(0,M.useState)(!1),[U,W]=R();(0,M.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await(await fetch(`/api/v1/discovery`,{credentials:`include`})).json().catch(()=>({})),a=r?.data?.routes?.mcp??r?.routes?.mcp;if(t)return;a?(n(a.startsWith(`http`)?a:`${e}${a}`),i(!0)):i(!1)}catch{t||i(!1)}})(),()=>{t=!0}},[e]);let G=async()=>{A(!0),P(null);try{let e=await fetch(`/api/v1/keys`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({name:y.trim()||`Agent key`})}),t=await e.json().catch(()=>({})),n=t?.data;if(!e.ok)throw Error(j(t)??`Request failed (${e.status})`);if(!n?.key)throw Error(`The request succeeded but the response carried no API key. Nothing failed in transit — inspect the response body of POST /api/v1/keys.`);B(n),H(!0)}catch(e){P(e?.message??`Failed to generate key`)}finally{A(!1)}},K=()=>{let e=I({mcpUrl:t??void 0}),n=new Blob([e],{type:`text/markdown;charset=utf-8`}),r=document.createElement(`a`);r.href=URL.createObjectURL(n),r.download=`SKILL.md`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)},q=t??`${e}/api/v1/mcp`;return(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2`,children:[(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(S,{className:`size-4`}),` Connect an AI agent (MCP)`]}),(0,L.jsx)(c,{className:`text-xs`,children:`Every app in this environment is an agent-ready toolset. Connect Claude, Cursor, Codex or any MCP client — one connection covers all your apps (new ones appear automatically).`})]}),(0,L.jsxs)(m,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`MCP endpoint`}),r===!1?(0,L.jsxs)(b,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsx)(v,{children:`MCP is not enabled for this environment`}),(0,L.jsxs)(g,{className:`text-xs`,children:[`Connecting agents is opt-in. An admin can enable it by setting`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`OS_MCP_SERVER_ENABLED=true`}),`. You can still generate a key and download the skill below.`]})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:q}),(0,L.jsx)(z,{value:q,label:`MCP URL`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(D,{className:`size-3.5`}),` API key`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(l,{value:y,onChange:e=>T(e.target.value),placeholder:`Key name (e.g. Claude desktop)`,className:`h-8 max-w-xs text-sm`}),(0,L.jsx)(x,{type:`button`,size:`sm`,onClick:G,disabled:O,children:O?`Generating…`:`Generate key`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The key acts as you (your permissions + row-level security). Shown once — copy it immediately. Revoke anytime from the API Keys list.`}),N&&(0,L.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:N})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`Agent skill (portable)`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:K,children:[(0,L.jsx)(E,{className:`size-4`}),` Download SKILL.md`]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Works with any skills-capable agent (Claude, Codex, Gemini, Cursor…).`})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed`,children:[(0,L.jsx)(`div`,{className:`mb-1 font-medium`,children:`Connect in 3 steps`}),(0,L.jsxs)(`ol`,{className:`list-decimal space-y-0.5 pl-4 text-muted-foreground`,children:[(0,L.jsx)(`li`,{children:`Add a remote MCP server pointing at the endpoint above.`}),(0,L.jsxs)(`li`,{children:[`Set the header `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key: <your key>`}),` (a session Bearer is `,(0,L.jsx)(`em`,{children:`not`}),` an API key).`]}),(0,L.jsxs)(`li`,{children:[`Drop in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`SKILL.md`}),` so the agent knows how to drive your data.`]})]})]})]}),(0,L.jsx)(a,{open:V,onOpenChange:H,children:(0,L.jsxs)(_,{children:[(0,L.jsxs)(f,{children:[(0,L.jsxs)(s,{className:`flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Your new API key`]}),(0,L.jsxs)(u,{children:[`Copy this now — for your security it will `,(0,L.jsx)(`strong`,{children:`not be shown again`}),`.`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 break-all rounded bg-muted px-2 py-2 font-mono text-xs`,children:F?.key}),(0,L.jsxs)(x,{type:`button`,variant:`secondary`,size:`sm`,className:`gap-1.5`,onClick:()=>F&&W(F.key),children:[U?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),U?`Copied`:`Copy`]})]}),(0,L.jsxs)(b,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsxs)(g,{className:`text-xs`,children:[`Send it as `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key`}),`. It carries your permissions — store it like a password and revoke it if leaked.`]})]})]}),(0,L.jsx)(d,{children:(0,L.jsx)(x,{type:`button`,onClick:()=>H(!1),children:`Done`})})]})})]})}var V={GET:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`,POST:`bg-blue-500/10 text-blue-700 dark:text-blue-400`,PATCH:`bg-amber-500/10 text-amber-700 dark:text-amber-400`,DELETE:`bg-red-500/10 text-red-700 dark:text-red-400`};function H({value:e,label:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(x,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>{navigator.clipboard?.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function U(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,a=typeof window<`u`?window.location.origin:``,[s,l]=(0,M.useState)([]),[u,d]=(0,M.useState)(!0),[f,g]=(0,M.useState)(null);(0,M.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch(`/api/v1/meta/object`,{credentials:`include`});if(!t.ok)throw Error(`meta/object ${t.status}`);let n=await t.json(),r=n?.data??n?.items??n??[],i=(Array.isArray(r)?r:[]).map(e=>({name:String(e.name??``),label:e.label||void 0})).filter(e=>e.name&&!e.name.startsWith(`sys_`));e||l(i)}catch(t){e||g(t?.message??`failed to load objects`)}finally{e||d(!1)}})(),()=>{e=!0}},[]);let _=s[0]?.name??`your_object`,v=(0,M.useMemo)(()=>`# List ${_} records\ncurl "${a}/api/v1/data/${_}?$top=10" \\\n -H "x-api-key: <YOUR_API_KEY>"`,[a,_]),b=e=>[{method:`GET`,path:`/api/v1/data/${e}`,desc:`List / query`},{method:`POST`,path:`/api/v1/data/${e}`,desc:`Create`},{method:`GET`,path:`/api/v1/data/${e}/:id`,desc:`Read one`},{method:`PATCH`,path:`/api/v1/data/${e}/:id`,desc:`Update`},{method:`DELETE`,path:`/api/v1/data/${e}/:id`,desc:`Delete`}];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(O,{className:`size-5 text-primary`}),` Integrations & APIs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Every object you build is instantly a REST API. Drive your app from code or an agent.`})]}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2`,children:[(0,L.jsx)(h,{className:`text-base`,children:`Base URL`}),(0,L.jsx)(c,{className:`text-xs`,children:`This environment's API root.`})]}),(0,L.jsxs)(m,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:[a,`/api/v1`]}),(0,L.jsx)(H,{value:`${a}/api/v1`,label:`base URL`})]})]}),(0,L.jsx)(B,{}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(T,{className:`size-4`}),` REST endpoints`]}),(0,L.jsx)(c,{className:`text-xs`,children:`Auto-generated CRUD for every published object (OData query params on list).`})]}),(0,L.jsxs)(x,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>e(`${i}/developer/api-console`),children:[(0,L.jsx)(A,{className:`size-4`}),` Open API Console`]})]}),(0,L.jsxs)(m,{className:`flex flex-col gap-4`,children:[u&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading objects…`}),f&&(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Couldn't load objects: `,f]}),!u&&!f&&s.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No business objects yet — build one with the AI assistant, publish it, and it appears here as an API.`}),s.map(e=>(0,L.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-sm`,children:e.label||e.name}),(0,L.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:e.name})]}),(0,L.jsx)(`div`,{className:`divide-y`,children:b(e.name).map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5`,children:[(0,L.jsx)(y,{className:`w-16 justify-center font-mono text-[10px] ${V[e.method]??``}`,children:e.method}),(0,L.jsx)(`code`,{className:`flex-1 truncate font-mono text-xs`,children:e.path}),(0,L.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground sm:inline`,children:e.desc})]},e.method+e.path))})]},e.name))]})]}),(0,L.jsxs)(o,{children:[(0,L.jsx)(p,{className:`pb-2`,children:(0,L.jsxs)(h,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Authentication`]})}),(0,L.jsxs)(m,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`p`,{children:[`In the console you're already authenticated — use `,(0,L.jsx)(`strong`,{children:`Open API Console`}),` above to call these endpoints now.`]}),(0,L.jsxs)(`p`,{children:[`For external programs and AI agents, generate a `,(0,L.jsx)(`strong`,{children:`self-serve API key`}),` in the `,(0,L.jsx)(`strong`,{children:`Connect an AI agent`}),` section above. Send it as the`,` `,(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:`x-api-key`}),` header; it runs under your permissions and row-level security, and is revocable.`]})]})]}),(0,L.jsxs)(o,{children:[(0,L.jsxs)(p,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsx)(h,{className:`text-base`,children:`Sample (cURL)`}),(0,L.jsx)(H,{value:v,label:`cURL sample`})]}),(0,L.jsx)(m,{children:(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs leading-relaxed`,children:v})})]})]})}export{U as IntegrationsPage};
|
|
82
|
+
`}var L=r();function R(){let[e,t]=(0,M.useState)(!1);return[e,e=>{navigator.clipboard?.writeText(e),t(!0),setTimeout(()=>t(!1),1500)}]}function z({value:e,label:t}){let[n,r]=R();return(0,L.jsxs)(g,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>r(e),"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function B(){let e=typeof window<`u`?window.location.origin:``,[t,n]=(0,M.useState)(null),[r,i]=(0,M.useState)(null),[v,T]=(0,M.useState)(`Agent key`),[O,A]=(0,M.useState)(!1),[N,P]=(0,M.useState)(null),[F,B]=(0,M.useState)(null),[V,H]=(0,M.useState)(!1),[U,W]=R();(0,M.useEffect)(()=>{let t=!1;return(async()=>{try{let r=await(await fetch(`/api/v1/discovery`,{credentials:`include`})).json().catch(()=>({})),a=r?.data?.routes?.mcp??r?.routes?.mcp;if(t)return;a?(n(a.startsWith(`http`)?a:`${e}${a}`),i(!0)):i(!1)}catch{t||i(!1)}})(),()=>{t=!0}},[e]);let G=async()=>{A(!0),P(null);try{let e=await fetch(`/api/v1/keys`,{method:`POST`,credentials:`include`,headers:{"content-type":`application/json`},body:JSON.stringify({name:v.trim()||`Agent key`})}),t=await e.json().catch(()=>({})),n=t?.data;if(!e.ok)throw Error(j(t)??`Request failed (${e.status})`);if(!n?.key)throw Error(`The request succeeded but the response carried no API key. Nothing failed in transit — inspect the response body of POST /api/v1/keys.`);B(n),H(!0)}catch(e){P(e?.message??`Failed to generate key`)}finally{A(!1)}},K=()=>{let e=I({mcpUrl:t??void 0}),n=new Blob([e],{type:`text/markdown;charset=utf-8`}),r=document.createElement(`a`);r.href=URL.createObjectURL(n),r.download=`SKILL.md`,document.body.appendChild(r),r.click(),r.remove(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)},q=t??`${e}/api/v1/mcp`;return(0,L.jsxs)(p,{children:[(0,L.jsxs)(m,{className:`pb-2`,children:[(0,L.jsxs)(o,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(S,{className:`size-4`}),` Connect an AI agent (MCP)`]}),(0,L.jsx)(f,{className:`text-xs`,children:`Every app in this environment is an agent-ready toolset. Connect Claude, Cursor, Codex or any MCP client — one connection covers all your apps (new ones appear automatically).`})]}),(0,L.jsxs)(s,{className:`flex flex-col gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`MCP endpoint`}),r===!1?(0,L.jsxs)(_,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsx)(x,{children:`MCP is not enabled for this environment`}),(0,L.jsxs)(b,{className:`text-xs`,children:[`Connecting agents is opt-in. An admin can enable it by setting`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`OS_MCP_SERVER_ENABLED=true`}),`. You can still generate a key and download the skill below.`]})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:q}),(0,L.jsx)(z,{value:q,label:`MCP URL`})]})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,L.jsx)(D,{className:`size-3.5`}),` API key`]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(h,{value:v,onChange:e=>T(e.target.value),placeholder:`Key name (e.g. Claude desktop)`,className:`h-8 max-w-xs text-sm`}),(0,L.jsx)(g,{type:`button`,size:`sm`,onClick:G,disabled:O,children:O?`Generating…`:`Generate key`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`The key acts as you (your permissions + row-level security). Shown once — copy it immediately. Revoke anytime from the API Keys list.`}),N&&(0,L.jsx)(`p`,{className:`mt-1 text-xs text-destructive`,children:N})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-xs font-medium text-muted-foreground`,children:`Agent skill (portable)`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(g,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:K,children:[(0,L.jsx)(E,{className:`size-4`}),` Download SKILL.md`]}),(0,L.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Works with any skills-capable agent (Claude, Codex, Gemini, Cursor…).`})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-muted/30 p-3 text-xs leading-relaxed`,children:[(0,L.jsx)(`div`,{className:`mb-1 font-medium`,children:`Connect in 3 steps`}),(0,L.jsxs)(`ol`,{className:`list-decimal space-y-0.5 pl-4 text-muted-foreground`,children:[(0,L.jsx)(`li`,{children:`Add a remote MCP server pointing at the endpoint above.`}),(0,L.jsxs)(`li`,{children:[`Set the header `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key: <your key>`}),` (a session Bearer is `,(0,L.jsx)(`em`,{children:`not`}),` an API key).`]}),(0,L.jsxs)(`li`,{children:[`Drop in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`SKILL.md`}),` so the agent knows how to drive your data.`]})]})]})]}),(0,L.jsx)(y,{open:V,onOpenChange:H,children:(0,L.jsxs)(l,{children:[(0,L.jsxs)(a,{children:[(0,L.jsxs)(c,{className:`flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Your new API key`]}),(0,L.jsxs)(u,{children:[`Copy this now — for your security it will `,(0,L.jsx)(`strong`,{children:`not be shown again`}),`.`]})]}),(0,L.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`code`,{className:`flex-1 break-all rounded bg-muted px-2 py-2 font-mono text-xs`,children:F?.key}),(0,L.jsxs)(g,{type:`button`,variant:`secondary`,size:`sm`,className:`gap-1.5`,onClick:()=>F&&W(F.key),children:[U?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),U?`Copied`:`Copy`]})]}),(0,L.jsxs)(_,{children:[(0,L.jsx)(k,{className:`size-4`}),(0,L.jsxs)(b,{className:`text-xs`,children:[`Send it as `,(0,L.jsx)(`code`,{className:`font-mono`,children:`x-api-key`}),`. It carries your permissions — store it like a password and revoke it if leaked.`]})]})]}),(0,L.jsx)(d,{children:(0,L.jsx)(g,{type:`button`,onClick:()=>H(!1),children:`Done`})})]})})]})}var V={GET:`bg-emerald-500/10 text-emerald-700 dark:text-emerald-400`,POST:`bg-blue-500/10 text-blue-700 dark:text-blue-400`,PATCH:`bg-amber-500/10 text-amber-700 dark:text-amber-400`,DELETE:`bg-red-500/10 text-red-700 dark:text-red-400`};function H({value:e,label:t}){let[n,r]=(0,M.useState)(!1);return(0,L.jsxs)(g,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 gap-1.5 px-2 text-xs`,onClick:()=>{navigator.clipboard?.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},"aria-label":`Copy ${t??`value`}`,children:[n?(0,L.jsx)(C,{className:`size-3.5`}):(0,L.jsx)(w,{className:`size-3.5`}),n?`Copied`:`Copy`]})}function U(){let e=t(),{appName:r}=n(),i=r?`/apps/${r}`:``,a=typeof window<`u`?window.location.origin:``,[c,l]=(0,M.useState)([]),[u,d]=(0,M.useState)(!0),[h,_]=(0,M.useState)(null);(0,M.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch(`/api/v1/meta/object`,{credentials:`include`});if(!t.ok)throw Error(`meta/object ${t.status}`);let n=await t.json(),r=n?.data??n?.items??n??[],i=(Array.isArray(r)?r:[]).map(e=>({name:String(e.name??``),label:e.label||void 0})).filter(e=>e.name&&!e.name.startsWith(`sys_`));e||l(i)}catch(t){e||_(t?.message??`failed to load objects`)}finally{e||d(!1)}})(),()=>{e=!0}},[]);let y=c[0]?.name??`your_object`,b=(0,M.useMemo)(()=>`# List ${y} records\ncurl "${a}/api/v1/data/${y}?$top=10" \\\n -H "x-api-key: <YOUR_API_KEY>"`,[a,y]),x=e=>[{method:`GET`,path:`/api/v1/data/${e}`,desc:`List / query`},{method:`POST`,path:`/api/v1/data/${e}`,desc:`Create`},{method:`GET`,path:`/api/v1/data/${e}/:id`,desc:`Read one`},{method:`PATCH`,path:`/api/v1/data/${e}/:id`,desc:`Update`},{method:`DELETE`,path:`/api/v1/data/${e}/:id`,desc:`Delete`}];return(0,L.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight flex items-center gap-2`,children:[(0,L.jsx)(O,{className:`size-5 text-primary`}),` Integrations & APIs`]}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:`Every object you build is instantly a REST API. Drive your app from code or an agent.`})]}),(0,L.jsxs)(p,{children:[(0,L.jsxs)(m,{className:`pb-2`,children:[(0,L.jsx)(o,{className:`text-base`,children:`Base URL`}),(0,L.jsx)(f,{className:`text-xs`,children:`This environment's API root.`})]}),(0,L.jsxs)(s,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`code`,{className:`flex-1 truncate rounded bg-muted px-2 py-1.5 font-mono text-xs`,children:[a,`/api/v1`]}),(0,L.jsx)(H,{value:`${a}/api/v1`,label:`base URL`})]})]}),(0,L.jsx)(B,{}),(0,L.jsxs)(p,{children:[(0,L.jsxs)(m,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(o,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(T,{className:`size-4`}),` REST endpoints`]}),(0,L.jsx)(f,{className:`text-xs`,children:`Auto-generated CRUD for every published object (OData query params on list).`})]}),(0,L.jsxs)(g,{type:`button`,variant:`outline`,size:`sm`,className:`gap-1.5`,onClick:()=>e(`${i}/developer/api-console`),children:[(0,L.jsx)(A,{className:`size-4`}),` Open API Console`]})]}),(0,L.jsxs)(s,{className:`flex flex-col gap-4`,children:[u&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading objects…`}),h&&(0,L.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`Couldn't load objects: `,h]}),!u&&!h&&c.length===0&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No business objects yet — build one with the AI assistant, publish it, and it appears here as an API.`}),c.map(e=>(0,L.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 border-b px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`font-medium text-sm`,children:e.label||e.name}),(0,L.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground`,children:e.name})]}),(0,L.jsx)(`div`,{className:`divide-y`,children:x(e.name).map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1.5`,children:[(0,L.jsx)(v,{className:`w-16 justify-center font-mono text-[10px] ${V[e.method]??``}`,children:e.method}),(0,L.jsx)(`code`,{className:`flex-1 truncate font-mono text-xs`,children:e.path}),(0,L.jsx)(`span`,{className:`hidden shrink-0 text-xs text-muted-foreground sm:inline`,children:e.desc})]},e.method+e.path))})]},e.name))]})]}),(0,L.jsxs)(p,{children:[(0,L.jsx)(m,{className:`pb-2`,children:(0,L.jsxs)(o,{className:`text-base flex items-center gap-2`,children:[(0,L.jsx)(D,{className:`size-4`}),` Authentication`]})}),(0,L.jsxs)(s,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`p`,{children:[`In the console you're already authenticated — use `,(0,L.jsx)(`strong`,{children:`Open API Console`}),` above to call these endpoints now.`]}),(0,L.jsxs)(`p`,{children:[`For external programs and AI agents, generate a `,(0,L.jsx)(`strong`,{children:`self-serve API key`}),` in the `,(0,L.jsx)(`strong`,{children:`Connect an AI agent`}),` section above. Send it as the`,` `,(0,L.jsx)(`code`,{className:`font-mono text-xs`,children:`x-api-key`}),` header; it runs under your permissions and row-level security, and is revocable.`]})]})]}),(0,L.jsxs)(p,{children:[(0,L.jsxs)(m,{className:`pb-2 flex flex-row items-center justify-between`,children:[(0,L.jsx)(o,{className:`text-base`,children:`Sample (cURL)`}),(0,L.jsx)(H,{value:b,label:`cURL sample`})]}),(0,L.jsx)(s,{children:(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded bg-muted p-3 font-mono text-xs leading-relaxed`,children:b})})]})]})}export{U as IntegrationsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,t as r,v as i}from"./vendor-react-BggL7APJ.js";import{p as a}from"./infrastructure-CSnL6ntj.js";import{At as o,Dt as s,Et as c,bt as l}from"./ui-components-D8wcRNrt.js";import{Fi as u,G as d,Ir as f,W as p,gt as m,st as h}from"./framework-CAuH4h0L.js";import{w as g}from"./i18n-runtime-CdWyaiOD.js";import{t as _}from"./vendor-icon-database-C8JGjSkn.js";import{t as v}from"./RecordDetailView-B3XBEgk2.js";import{t as y}from"./plugins-views-CnvkdSJK.js";var b=e(i(),1),x=[`single`,`group`,`isolated`];function S(e){return e===`group`||e===`isolated`}function C(){let{getAuthConfig:e}=a(),[t,n]=(0,b.useState)(void 0);return(0,b.useEffect)(()=>{let t=!1;return e?.().then(e=>{if(t)return;let r=e?.features?.tenancyPosture;r&&x.includes(r)&&n(r)}).catch(()=>{}),()=>{t=!0}},[e]),t}var w=`uf_`;function T(e){let t={};return e.forEach((e,n)=>{if(n.startsWith(w)&&e!==``){let r=n.slice(3);t[r]=e.split(`,`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}}),Object.keys(t).length>0?t:void 0}function E(e,t){let n=new URLSearchParams(e);for(let[e,r]of Object.entries(t)){let t=w+e;r&&r.length>0?n.set(t,r.map(e=>encodeURIComponent(String(e))).join(`,`)):n.delete(t)}return n}var D=r();function O(e){return Array.isArray(e?.columns)&&e.columns.length>0}function ee(e,t){let n=e?.listViews||e?.list_views||{},r=(t?[n[`${e?.name}.${t}`],n[t],...t==="default"||t===`list`?[e?.list]:[]]:[e?.list,...Object.values(n)]).filter(Boolean);return r.find(O)??r[0]}function k(e,t){let n=n=>t?.orgAttribution&&e?.fields?.organization_id&&!n.includes(`organization_id`)?[...n,`organization_id`]:n,r=e?.highlightFields;if(Array.isArray(r)&&r.length>0)return n(f(e,r.filter(t=>e.fields?.[t])));let i=e?.fields;return i&&typeof i==`object`?n(f(e,Object.entries(i).filter(([e,t])=>t&&!t.hidden&&!u(e,t)).map(([e])=>e)).slice(0,6)):[]}function A(e,t){let n=e?.fields;if(n&&typeof n==`object`)return Object.entries(n).find(([e,n])=>n&&!n.hidden&&!u(e,n)&&t(e,n))?.[0]}var j=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),M=new Set([`date`,`datetime`,`time`]),N=new Set([`image`,`file`,`attachment`,`avatar`,`photo`]);function P(e){let t=A(e,(e,t)=>j.has(t.type))??A(e,e=>/status|stage|state|priority|category|kind/i.test(e));return t?{groupByField:t}:void 0}function F(e){return A(e,(e,t)=>M.has(t.type))??A(e,e=>/date|due|start|end|deadline|schedule/i.test(e))}function I(e){let t=F(e);return t?{startDateField:t}:void 0}function L(e){let t=A(e,(e,t)=>N.has(t.type));return t?{coverField:t}:void 0}var R=new Set([`location`,`geo`,`geolocation`,`geopoint`,`point`]);function z(e){let t=A(e,(e,t)=>M.has(t.type)&&/start|begin|kickoff/i.test(e))??A(e,(e,t)=>M.has(t.type));if(!t)return;let n=A(e,(e,n)=>M.has(n.type)&&e!==t&&/end|due|finish|deadline|close/i.test(e))??A(e,(e,n)=>M.has(n.type)&&e!==t);if(!n)return;let r=A(e,(e,t)=>(t.type===`number`||t.type===`percent`)&&/progress|percent|complete/i.test(e));return{startDateField:t,endDateField:n,...r?{progressField:r}:{}}}function B(e){let t=A(e,(e,t)=>R.has(t.type))??A(e,e=>/location|address|geo|coords?|place|venue/i.test(e));if(t)return{locationField:t}}function V({page:e,className:r,onConfigChange:i,reserveEditAffordance:a}){let{t:u}=g(),{objects:f}=d(),x=p(),S=t(),[w,A]=n(),j=C()===`group`,[M]=b.useState(()=>T(new URLSearchParams(window.location.search))),N=b.useCallback(e=>{A(t=>E(t,e),{replace:!0})},[A]),F=e?.interfaceConfig||{},R=b.useMemo(()=>(f||[]).find(e=>e.name===F.source),[f,F.source]),V=b.useMemo(()=>ee(R,F.sourceView),[R,F.sourceView]),H=F.recordAction===`page`||F.recordAction===`modal`||F.recordAction===`none`?F.recordAction:`drawer`,U=b.useCallback(e=>`/apps/${window.location.pathname.split(`/`)[2]||``}/${F.source}/record/${encodeURIComponent(String(e))}`,[F.source]),W=h({navigation:{mode:H===`none`?`none`:H},objectName:F.source,onNavigate:e=>S(U(e))}),G=w.get(`recordId`),te=b.useCallback((e,t)=>{if(H===`none`)return;let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(U(n),`_blank`);return}if((H===`drawer`||H===`modal`)&&n!=null){A(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t});return}W.handleClick(e,t)},[H,U,W,A]),ne=b.useCallback(()=>{A(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[A]);b.useEffect(()=>{G&&!W.isOpen?W.open({id:G}):!G&&W.isOpen&&W.close()},[G]);let K=R?.name,q=!!V&&!O(V),J=V?.name??(F.sourceView?`${F.source}.${F.sourceView}`:void 0),[Y,X]=b.useState(null);b.useEffect(()=>{let e=!1;if(X(null),K&&F.source&&q&&J)return(async()=>{try{let t=x,n=null;if(typeof t?.listViewOverrides==`function`)try{n=(await t.listViewOverrides(F.source))?.[J]??null}catch{}!O(n)&&typeof t?.getView==`function`&&(n=await t.getView(F.source,J)),!e&&n&&typeof n==`object`&&X(n)}catch{}})(),()=>{e=!0}},[K,F.source,F.sourceView,q,J,x]);let Z=b.useMemo(()=>Y?{...V,...Y}:V,[V,Y]),re=JSON.stringify(Z??null),Q=b.useMemo(()=>{if(!R)return;let e=Z||{},t=F.appearance??e.appearance,n=t?.allowedVisualizations||[],r=new Set(n),i=F.userActions||{},a=e.options&&typeof e.options==`object`&&!Array.isArray(e.options)?e.options:{},o=e=>r.has(e)&&a[e]===void 0,s=e.kanban??(o(`kanban`)?P(R):void 0),c=e.calendar??(o(`calendar`)?I(R):void 0),l=e.timeline??(o(`timeline`)?I(R):void 0),u=e.gallery??(o(`gallery`)?L(R):void 0),d=e.gantt??(o(`gantt`)?z(R):void 0),f=e.options?.map??(r.has(`map`)?B(R):void 0),p=[...Array.isArray(e.filter)?e.filter:[],...Array.isArray(F.filterBy)?F.filterBy:[]],m=!O(F)&&O(e),h=O(F)?F.columns:m?e.columns:k(R,{orgAttribution:j}),g=Array.isArray(F.sort)&&F.sort.length?F.sort:e.sort;return{type:`list-view`,objectName:R.name,viewType:n[0]??e.type??`grid`,columns:h,...m&&e.hiddenFields!==void 0?{hiddenFields:e.hiddenFields}:{},...m&&e.fieldOrder!==void 0?{fieldOrder:e.fieldOrder}:{},...p.length?{filter:p}:{},...g?.length?{sort:g}:{},grouping:e.grouping,rowColor:e.rowColor,pagination:e.pagination,searchableFields:e.searchableFields,emptyState:e.emptyState,kanban:s,calendar:c,gallery:u,timeline:l,gantt:d,...e.map?{map:e.map}:{},...e.tree===void 0?{}:{tree:e.tree},...e.chart===void 0?{}:{chart:e.chart},...f||e.options?{options:{...e.options??{},...f?{map:f}:{}}}:{},userFilters:F.userFilters??e.userFilters,appearance:t,showViewSwitcher:n.length>1,showRecordCount:F.showRecordCount,allowPrinting:F.allowPrinting,addRecord:F.addRecord,userActions:{search:i.search!==!1,sort:i.sort!==!1,filter:i.filter===!0,rowHeight:i.rowHeight===!0,group:i.group===!0,hideFields:i.hideFields===!0,rowColor:i.rowColor===!0},allowExport:!1,inlineEdit:i.editInline===!0}},[K,re,F,j]);if(!R||!Q)return(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,D.jsxs)(c,{children:[(0,D.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,D.jsx)(_,{className:`h-6 w-6 text-muted-foreground`})}),(0,D.jsx)(o,{children:u(`empty.objectNotFound`,{defaultValue:`Object Not Found`})}),(0,D.jsx)(s,{children:u(`empty.interfacePageSourceMissing`,{defaultValue:`This interface page references "{{name}}", which is not available.`,name:F.source||`?`})})]})});let $=Array.isArray(F.buttons)&&F.buttons.length?F.buttons.map(e=>(R.actions||[]).find(t=>t?.name===e)).filter(Boolean).map(e=>({...e,locations:[`list_toolbar`]})):[],ie={type:`action:bar`,location:`list_toolbar`,actions:$,size:`sm`,variant:`outline`};return(0,D.jsxs)(`div`,{className:r??`h-full flex flex-col`,"data-testid":`interface-list-page`,children:[(0,D.jsxs)(`div`,{className:`pl-4 pt-4 pb-2 shrink-0 flex items-start justify-between gap-3 ${a?`pr-12`:`pr-4`}`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`h1`,{className:`text-lg font-semibold leading-tight`,children:typeof e.label==`string`?e.label:e.name}),typeof e.description==`string`&&e.description&&(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:e.description})]}),$.length>0&&(0,D.jsx)(`div`,{className:`shrink-0`,"data-testid":`interface-page-buttons`,children:(0,D.jsx)(m,{schema:ie})})]}),(0,D.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:(0,D.jsx)(y,{schema:Q,dataSource:x,userFilterSelections:M,onUserFilterSelectionsChange:N,onSortChange:i?e=>i({sort:e}):void 0,onColumnStateChange:i?e=>{e?.order?.length&&i({columns:e.order})}:void 0,onRowClick:H===`none`?void 0:te})}),W.isOverlay&&(0,D.jsx)(l,{...W,setIsOpen:e=>{e||ne()},title:typeof e.label==`string`?e.label:F.source||`Record`,children:e=>(0,D.jsx)(v,{objectNameOverride:F.source,recordIdOverride:String(e?.id??e?._id??G??``),embedded:!0,dataSource:x,objects:f,onEdit:()=>{}})})]})}export{P as a,S as c,L as i,C as l,I as n,E as o,k as r,T as s,V as t};
|
package/dist/assets/{MarketplaceInstalledPage-B7KETQG2.js → MarketplaceInstalledPage-DyjhcUNB.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r}from"./vendor-react-BggL7APJ.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,p as n,t as r}from"./vendor-react-BggL7APJ.js";import{bi as i}from"./ui-components-D8wcRNrt.js";import{w as a}from"./i18n-runtime-CdWyaiOD.js";import{t as o}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as s}from"./vendor-icon-store-CwiX9Ffi.js";import{t as c}from"./app-shell-eager-leaves-D9tgfJOe.js";var l=e({MarketplaceInstalledPage:()=>d}),u=r();function d(){let e=t(),{appName:r}=n(),{t:l}=a(),d=r?`/apps/${r}`:``;return(0,u.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6 max-w-5xl`,children:[(0,u.jsxs)(i,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>e(`${d}/system/marketplace`),children:[(0,u.jsx)(o,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),l(`marketplace.back`)]}),(0,u.jsxs)(`div`,{children:[(0,u.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,u.jsx)(s,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,u.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:l(`marketplace.installedTitle`)})]}),(0,u.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,dangerouslySetInnerHTML:{__html:l(`marketplace.installedSubtitle`)}})]}),(0,u.jsx)(c,{})]})}export{l as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{d as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee}from"./infrastructure-CSnL6ntj.js";import{$n as o,Bn as te,Br as s,Fr as ne,Gr as re,Hr as ie,Ir as ae,Ln as oe,Mr as se,Nr as ce,Pr as le,Rn as ue,Vn as de,Vr as fe,Wr as pe,bi as c,er as me,ii as l,jr as he,kn as u,lr as ge,rr as d,tr as _e,zn as ve}from"./ui-components-D8wcRNrt.js";import{G as ye,xi as f}from"./framework-CAuH4h0L.js";import{t as be,w as xe}from"./i18n-runtime-CdWyaiOD.js";import{t as Se}from"./vendor-icon-arrow-left-DmGEbpkA.js";import{t as Ce}from"./vendor-icon-boxes-D-Ov3dJw.js";import{t as p}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as we}from"./vendor-icon-circle-arrow-up-bx9jlxK3.js";import{t as m}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as h}from"./vendor-icon-code-xml-C9EWHSC8.js";import{t as Te}from"./vendor-icon-database-C8JGjSkn.js";import{t as Ee}from"./vendor-icon-download-C3csYSaD.js";import{t as De}from"./vendor-icon-ellipsis-BjiiCS3N.js";import{t as Oe}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as g}from"./vendor-icon-folder-tree-BQ1wv9bt.js";import{t as _}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as ke}from"./vendor-icon-network-6ADGC5P5.js";import{t as Ae}from"./vendor-icon-package-B6zAlWd3.js";import{t as v}from"./vendor-icon-shield-alert-CJYtPI9w.js";import{t as y}from"./vendor-icon-shield-check-CdDzbial.js";import{t as je}from"./vendor-icon-trash-BLsWkwB9.js";import{t as b}from"./vendor-icon-webhook-B43SyK1w.js";import{t as Me}from"./assistantBus-DoNtw1Tf.js";import{M as Ne,_ as Pe,a as Fe,c as Ie,f as Le,g as Re,h as ze,i as Be,k as x,l as Ve,n as He,o as Ue,r as We,s as Ge,u as Ke,v as qe,y as Je}from"./app-shell-eager-leaves-D9tgfJOe.js";import{i as Ye,n as Xe,r as Ze,t as Qe}from"./usePackageL10n-Jl2XiF2F.js";var S=e(a(),1),C=i();function w(e){let t=e.replace(/\r\n/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`),n=[],r=0;for(;r<t.length;){let e=t[r];if(e.startsWith("```")){let i=e.slice(3).trim();r++;let a=[];for(;r<t.length&&!t[r].startsWith("```");)a.push(t[r]),r++;r++,n.push({type:`code`,text:a.join(`
|
|
4
|
+
`),lang:i});continue}let i=/^(#{1,3})\s+(.*)$/.exec(e);if(i){let e=i[1].length;n.push({type:`h${e}`,text:i[2].trim()}),r++;continue}if(/^[-*]\s+/.test(e)){let e=[];for(;r<t.length&&/^[-*]\s+/.test(t[r]);)e.push(t[r].replace(/^[-*]\s+/,``)),r++;n.push({type:`ul`,items:e});continue}if(/^\d+\.\s+/.test(e)){let e=[];for(;r<t.length&&/^\d+\.\s+/.test(t[r]);)e.push(t[r].replace(/^\d+\.\s+/,``)),r++;n.push({type:`ol`,items:e});continue}if(!e.trim()){r++;continue}let a=[];for(;r<t.length&&t[r].trim()&&!/^#{1,3}\s+/.test(t[r])&&!/^[-*]\s+/.test(t[r])&&!/^\d+\.\s+/.test(t[r])&&!t[r].startsWith("```");)a.push(t[r]),r++;n.push({type:`p`,text:a.join(` `)})}return n}function T(e){let t=[],n=e,r=0,i=[{re:/`([^`]+)`/,render:e=>(0,C.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[0.85em]`,children:e[1]},`k${r++}`)},{re:/\*\*([^*]+)\*\*/,render:e=>(0,C.jsx)(`strong`,{className:`font-semibold text-foreground`,children:e[1]},`k${r++}`)},{re:/\*([^*]+)\*/,render:e=>(0,C.jsx)(`em`,{children:e[1]},`k${r++}`)},{re:/\[([^\]]+)\]\(([^)]+)\)/,render:e=>(0,C.jsx)(`a`,{href:e[2],target:`_blank`,rel:`noopener noreferrer`,className:`text-violet-600 underline-offset-2 hover:underline dark:text-violet-400`,children:e[1]},`k${r++}`)}];for(;n;){let e=-1,r=null,a=null;for(let t of i){let i=t.re.exec(n);i&&(e===-1||i.index<e)&&(e=i.index,r=i,a=t)}if(!r||!a){t.push(n);break}e>0&&t.push(n.slice(0,e)),t.push(a.render(r)),n=n.slice(e+r[0].length)}return(0,C.jsx)(C.Fragment,{children:t.map((e,t)=>(0,C.jsx)(S.Fragment,{children:e},t))})}function $e({source:e,className:t}){let n=w(e);return(0,C.jsx)(`div`,{className:`flex flex-col gap-4 text-sm leading-relaxed text-foreground/90 ${t??``}`,children:n.map((e,t)=>{switch(e.type){case`h1`:return(0,C.jsx)(`h2`,{className:`mt-2 text-xl font-bold tracking-tight`,children:T(e.text??``)},t);case`h2`:return(0,C.jsx)(`h3`,{className:`mt-3 text-base font-semibold tracking-tight`,children:T(e.text??``)},t);case`h3`:return(0,C.jsx)(`h4`,{className:`mt-2 text-sm font-semibold tracking-tight text-foreground/80`,children:T(e.text??``)},t);case`p`:return(0,C.jsx)(`p`,{children:T(e.text??``)},t);case`ul`:return(0,C.jsx)(`ul`,{className:`ml-1 flex list-none flex-col gap-1.5`,children:(e.items??[]).map((e,t)=>(0,C.jsxs)(`li`,{className:`flex gap-2`,children:[(0,C.jsx)(`span`,{"aria-hidden":`true`,className:`mt-1.5 inline-block h-1.5 w-1.5 shrink-0 rounded-full bg-violet-500/70`}),(0,C.jsx)(`span`,{children:T(e)})]},t))},t);case`ol`:return(0,C.jsx)(`ol`,{className:`ml-5 flex list-decimal flex-col gap-1.5 marker:text-muted-foreground`,children:(e.items??[]).map((e,t)=>(0,C.jsx)(`li`,{className:`pl-1`,children:T(e)},t))},t);case`code`:return(0,C.jsx)(`pre`,{className:`overflow-x-auto rounded-lg border bg-muted/40 p-3 text-xs leading-relaxed`,children:(0,C.jsx)(`code`,{className:`font-mono`,children:e.text})},t)}return null})})}var et={node:`In-process · full trust`,sandbox:`Sandboxed`,worker:`Out-of-process`};function E({icon:e,label:t,items:n}){return!n||n.length===0?null:(0,C.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,C.jsx)(e,{className:`h-3.5 w-3.5 mt-0.5 text-muted-foreground shrink-0`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsx)(`div`,{className:`text-xs font-medium`,children:t}),(0,C.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-0.5`,children:n.map(e=>(0,C.jsx)(`code`,{className:`font-mono text-[11px] px-1 py-0.5 rounded bg-muted break-all`,children:e},e))})]})]})}function tt({version:e}){let{t}=xe();if(!e?.contains_code)return null;let n=e.permissions??{},r=(n.services?.length??0)+(n.hooks?.length??0)+(n.network?.length??0)+(n.fs?.length??0)>0;return(0,C.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 p-3 space-y-3 text-sm`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,C.jsx)(h,{className:`h-4 w-4 text-amber-600 shrink-0`,"aria-hidden":`true`}),t(`marketplace.disclosure.containsCode`,{defaultValue:`This package contains code`})]}),(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[e.runtime&&(0,C.jsx)(l,{variant:`outline`,children:t(`marketplace.disclosure.runtime.${e.runtime}`,{defaultValue:et[e.runtime]})}),e.platform_verified?(0,C.jsxs)(l,{variant:`outline`,className:`gap-1 border-green-500/40 text-green-700 dark:text-green-400`,children:[(0,C.jsx)(y,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.reviewed`,{defaultValue:`Reviewed & approved`})]}):(0,C.jsxs)(l,{variant:`outline`,className:`gap-1 border-amber-500/40 text-amber-700 dark:text-amber-400`,children:[(0,C.jsx)(v,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.unreviewed`,{defaultValue:`Not yet reviewed`})]}),e.signed&&(0,C.jsxs)(l,{variant:`outline`,className:`gap-1`,children:[(0,C.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`}),t(`marketplace.disclosure.signed`,{defaultValue:`Signed`})]})]}),r?(0,C.jsxs)(`div`,{className:`space-y-2`,children:[(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t(`marketplace.disclosure.grantsIntro`,{defaultValue:`This package requests:`})}),(0,C.jsx)(E,{icon:Ce,label:t(`marketplace.disclosure.services`,{defaultValue:`Platform services`}),items:n.services??void 0}),(0,C.jsx)(E,{icon:b,label:t(`marketplace.disclosure.hooks`,{defaultValue:`Lifecycle hooks`}),items:n.hooks??void 0}),(0,C.jsx)(E,{icon:ke,label:t(`marketplace.disclosure.network`,{defaultValue:`Network access`}),items:n.network??void 0}),(0,C.jsx)(E,{icon:g,label:t(`marketplace.disclosure.fs`,{defaultValue:`Filesystem access`}),items:n.fs??void 0}),(0,C.jsx)(`div`,{className:`text-[11px] text-muted-foreground/80 leading-snug`,children:t(`marketplace.disclosure.notEnforced`,{defaultValue:`Recorded at install, and re-confirmed if a later version asks for more — but the runtime does not yet restrict the package to this list.`})})]}):(0,C.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:t(`marketplace.disclosure.noPermissions`,{defaultValue:`Requests no special permissions.`})})]})}var D=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/;function O(e){let t=D.exec(e.trim());return t?{core:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:t[4]?t[4].split(`.`):[]}:null}var k=/^\d+$/;function nt(e,t){let n=k.test(e),r=k.test(t);return n&&r?Math.sign(Number(e)-Number(t)):n?-1:r?1:e<t?-1:+(e>t)}function A(e,t){let n=O(e),r=O(t);if(!n||!r)return null;for(let e=0;e<3;e+=1)if(n.core[e]!==r.core[e])return n.core[e]<r.core[e]?-1:1;if(n.prerelease.length===0||r.prerelease.length===0)return n.prerelease.length===r.prerelease.length?0:n.prerelease.length===0?1:-1;let i=Math.min(n.prerelease.length,r.prerelease.length);for(let e=0;e<i;e+=1){let t=nt(n.prerelease[e],r.prerelease[e]);if(t!==0)return t}return n.prerelease.length===r.prerelease.length?0:n.prerelease.length<r.prerelease.length?-1:1}function rt(e,t){return A(e,t)===1}var j=t({MarketplacePackagePage:()=>M});function M(){let e=n(),{packageId:t,appName:i}=r(),{isAdmin:a,isResolved:Ce}=ee(),{t:h,language:g}=xe(),ke=be(),v={describe:e=>h(e.anchor===`guest`?`marketplace.suggestedBindings.promptGuest`:`marketplace.suggestedBindings.promptEveryone`,{set:e.permission_set_name}),confirm:h(`marketplace.suggestedBindings.confirm`),confirming:h(`marketplace.suggestedBindings.confirming`),dismiss:h(`marketplace.suggestedBindings.dismiss`),confirmedToast:e=>h(`marketplace.suggestedBindings.confirmedToast`,{set:e.permission_set_name,anchor:e.anchor}),dismissedToast:e=>h(`marketplace.suggestedBindings.dismissedToast`,{set:e.permission_set_name})},y=i?`/apps/${i}`:``,{refresh:b}=ye(),w=Ne(),[T,et]=(0,S.useState)(null),[E,D]=(0,S.useState)(w),[O,k]=(0,S.useState)(null),[nt,A]=(0,S.useState)(!1),[j,M]=(0,S.useState)([]),[it,N]=(0,S.useState)(!1),[P,F]=(0,S.useState)(null),[I,at]=(0,S.useState)(``),[ot,st]=(0,S.useState)({}),[ct,lt]=(0,S.useState)(!1),[ut,dt]=(0,S.useState)(!1),[L,ft]=(0,S.useState)(!1),[R,z]=(0,S.useState)(null),[B,pt]=(0,S.useState)(null),[V,H]=(0,S.useState)(null),[U,W]=(0,S.useState)(null),[G,K]=(0,S.useState)(null),[mt,ht]=(0,S.useState)(!1),[gt,_t]=(0,S.useState)([]),[vt,q]=(0,S.useState)(!1),[J,Y]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(!x().features.installLocal||!w||!a)return;let e=!1;return(async()=>{let t=await Le();e||_t(t)})(),()=>{e=!0}},[t,J,w,a]),(0,S.useEffect)(()=>{if(!t||!w||!a)return;let e=x().defaultEnvironmentId??``,n=!1;return(async()=>{let r=await Fe(t,e);!n&&r&&(H(r),pt(r.version))})(),()=>{n=!0}},[t,w,a]),(0,S.useEffect)(()=>{let e=!1;return(async()=>{if(t&&w&&a){D(!0),k(null);try{let n=await Ue(t);e||et(n)}catch(t){e||k(t?.message??String(t))}finally{e||D(!1)}}})(),()=>{e=!0}},[t,w,a]);let yt=async()=>{A(!0),z(null),F(null);let e=x().defaultEnvironmentId;if(e){N(!1),at(e),M([]);return}N(!0);try{let[e,n]=await Promise.all([Ve(),Ke()]),r=e.filter(e=>{let t=e.organization_id;return t?n.has(String(t)):!1});M(r),st({});let i=t;i&&Promise.all(r.map(async e=>{try{let t=await Fe(i,e.id);return t?[e.id,t.version]:null}catch{return null}})).then(e=>{let t={};for(let n of e)n&&(t[n[0]]=n[1]);st(t)}),e.length>0&&r.length===0?F(h(`marketplace.install.noPermission`)):r.length===1&&at(r[0].id)}catch(e){let t=e?.status;F(t===401||t===403?h(`marketplace.install.signInFirst`):e?.message??String(e))}finally{N(!1)}},bt=async()=>{if(t&&I){ft(!0),z(null);try{let e=(await Ie({packageId:t,environmentId:I,seedSampleData:ct}))?.installation?.version??T?.package?.latest_version?.version??T?.versions?.[0]?.version??``;pt(e||`installed`);try{let e=x().defaultEnvironmentId||I;if(e){let n=await Fe(t,e);n&&H(n)}}catch{}let n=x().defaultEnvironmentId;if(!n||n===I)try{if(typeof sessionStorage<`u`)for(let e of Object.keys(sessionStorage))e.startsWith(`objectui:metadata:`)&&sessionStorage.removeItem(e);await b()}catch{}z({ok:!0,message:h(`marketplace.install.success`)}),Me()}catch(e){z({ok:!1,message:e?.message??String(e)})}finally{ft(!1)}}},xt=async()=>{if(t){q(!0),Y(null);try{let e=await Ge({packageId:t});try{await b(`app`)}catch{}Y({ok:!0,message:h(`marketplace.install.localSuccess`,{version:e.version,name:T?.package?Qe(T.package,g).displayName:e.manifestId})}),Me()}catch(e){e?.code;let t=e?.message??String(e);f(e,`MANIFEST_CONFLICT`)?t=h(`marketplace.install.localManifestConflict`,{message:t}):f(e,`UNAUTHENTICATED`)?t=h(`marketplace.install.localUnauthorized`):f(e,`MARKETPLACE_UNAVAILABLE`)&&(t=h(`marketplace.install.localMarketplaceUnavailable`)),Y({ok:!1,message:t})}finally{q(!1)}}},St=async()=>{if($&&confirm(h(`marketplace.uninstall.confirm`,{manifestId:$.manifestId,version:$.version}))){q(!0),Y(null);try{await Je($.manifestId);try{await b(`app`)}catch{}Y({ok:!0,message:h(`marketplace.uninstall.successInDetail`,{manifestId:$.manifestId})})}catch(e){Y({ok:!1,message:e?.message??String(e)})}finally{q(!1)}}},Ct=async()=>{if(V){W(`reseed`),K(null);try{let e=await qe(V.installationId);e.ok?(H({...V,withSampleData:!0}),K({ok:!0,text:h(`marketplace.detail.reseedQueued`)})):f(e,`ENVIRONMENT_KERNEL_UNAVAILABLE`)?(ht(!0),K({ok:!1,text:h(`marketplace.detail.sampleDataKernelUnavailable`)})):K({ok:!1,text:e.error||`Re-seed failed`})}finally{W(null)}}},wt=async()=>{if(V&&confirm(h(`marketplace.detail.purgeConfirm`))){W(`purge`),K(null);try{let e=await Re(V.installationId);if(e.ok){H({...V,withSampleData:!1});let t=e.deleted??0;K({ok:!0,text:t>0?h(`marketplace.detail.purgeSuccess`,{count:t}):h(`marketplace.detail.purgeNoData`)})}else f(e,`ENVIRONMENT_KERNEL_UNAVAILABLE`)?(ht(!0),K({ok:!1,text:h(`marketplace.detail.sampleDataKernelUnavailable`)})):K({ok:!1,text:e.error||`Purge failed`})}finally{W(null)}}},Tt=async()=>{if($){W(`reseed`),K(null);try{let e=await Pe($.manifestId);_t(e=>e.map(e=>e.manifestId===$.manifestId?{...e,withSampleData:!0}:e));let t=e.inserted??0,n=e.updated??0,r=e.errors??0,i=h(`marketplace.detail.reseedLocalSuccess`,{inserted:t,updated:n});K(r>0?{ok:!1,text:`${i} ${h(`marketplace.detail.reseedPartialErrors`,{count:r})}`}:{ok:!0,text:i})}catch(e){K({ok:!1,text:e?.message||`Re-seed failed`})}finally{W(null)}}},Et=async()=>{if($&&confirm(h(`marketplace.detail.purgeConfirm`))){W(`purge`),K(null);try{let e=await ze($.manifestId);_t(e=>e.map(e=>e.manifestId===$.manifestId?{...e,withSampleData:!1}:e));let t=e.deleted??0;K({ok:!0,text:t>0?h(`marketplace.detail.purgeSuccess`,{count:t}):h(`marketplace.detail.purgeNoData`)})}catch(e){K({ok:!1,text:e?.message||`Purge failed`})}finally{W(null)}}};if(!w)return(0,C.jsx)(Xe,{});if(!Ce)return(0,C.jsx)(Ze,{});if(!a)return(0,C.jsx)(We,{});if(E)return(0,C.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,C.jsx)(u,{className:`h-8 w-32`}),(0,C.jsx)(u,{className:`h-16 w-full`}),(0,C.jsx)(u,{className:`h-64 w-full`})]});if(O||!T)return(0,C.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,C.jsxs)(c,{variant:`ghost`,size:`sm`,onClick:()=>e(`${y}/system/marketplace`),children:[(0,C.jsx)(Se,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),h(`marketplace.back`)]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm`,children:[(0,C.jsx)(p,{className:`h-4 w-4 mt-0.5 text-destructive`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`div`,{className:`font-medium text-destructive`,children:h(`marketplace.load.packageFailed`)}),(0,C.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:O??h(`marketplace.load.notFound`)})]})]})]});let X=T.package,Z=Qe(X,g),Q=X.latest_version?.version??T.versions[0]?.version??null,$=gt.find(e=>e.manifestId===X.manifest_id)??null,Dt=!!X.latest_version?.contains_code,Ot=!!B&&!!Q&&rt(Q,B),kt=x().features.installLocal,At=!Q||vt||L||!kt&&!!B&&!Ot,jt=kt?{label:h(vt?`marketplace.action.working`:$?`marketplace.action.reinstall`:`marketplace.action.install`),onClick:xt}:{label:L?h(`marketplace.action.installing`):B?Ot?h(`marketplace.action.updateTo`,{defaultValue:`Update`}):h(`marketplace.action.installed`,{defaultValue:`Installed`}):h(`marketplace.action.installToCloud`),onClick:yt},Mt=X.category?h(`marketplace.category.${X.category}`,{defaultValue:X.category}):null;return(0,C.jsxs)(`div`,{className:`mx-auto w-full max-w-6xl flex flex-col gap-6 p-4 sm:p-6`,children:[(0,C.jsxs)(c,{variant:`ghost`,size:`sm`,className:`self-start -ml-2 text-muted-foreground hover:text-foreground`,onClick:()=>e(`${y}/system/marketplace`),children:[(0,C.jsx)(Se,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),h(`marketplace.back`)]}),(0,C.jsxs)(`div`,{className:`flex items-start gap-5 flex-wrap sm:flex-nowrap rounded-2xl border bg-gradient-to-br from-primary/5 via-background to-background p-6 sm:p-8`,children:[(0,C.jsx)(Ye,{iconUrl:X.icon_url,displayName:Z.displayName,manifestId:X.manifest_id,className:`h-20 w-20 rounded-2xl shadow-sm ring-1 ring-border shrink-0`,initialClassName:`text-3xl font-bold`}),(0,C.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,C.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,C.jsx)(`h1`,{className:`text-2xl sm:text-3xl font-bold tracking-tight truncate`,children:Z.displayName||X.manifest_id}),X.homepage_url&&(0,C.jsxs)(`a`,{href:X.homepage_url,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,title:h(`marketplace.detail.homepage`),children:[(0,C.jsx)(Oe,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),(0,C.jsx)(`span`,{className:`hidden sm:inline`,children:h(`marketplace.detail.homepage`)})]})]}),(0,C.jsxs)(`div`,{className:`text-sm text-muted-foreground mt-2 flex flex-wrap items-center gap-1.5`,children:[(0,C.jsx)(`code`,{className:`font-mono text-xs px-1.5 py-0.5 rounded bg-muted`,children:X.manifest_id}),Q&&(0,C.jsx)(l,{variant:`outline`,children:h(`marketplace.versionBadge`,{version:Q})}),X.publisher&&X.publisher!==`private`&&(0,C.jsx)(l,{variant:X.publisher===`objectstack`?`default`:`secondary`,children:X.publisher}),Mt&&(0,C.jsx)(l,{variant:`outline`,children:Mt}),X.license&&(0,C.jsx)(l,{variant:`outline`,className:`font-normal`,children:X.license}),$&&(0,C.jsxs)(l,{variant:`default`,className:`bg-green-600 hover:bg-green-600 gap-1`,children:[(0,C.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`}),h(`marketplace.detail.installedV`,{version:$.version})]}),!$&&B&&(0,C.jsxs)(l,{variant:`default`,className:`bg-green-600 hover:bg-green-600 gap-1`,children:[(0,C.jsx)(m,{className:`h-3 w-3`,"aria-hidden":`true`}),h(`marketplace.detail.installedV`,{version:B})]}),Ot&&(0,C.jsxs)(l,{variant:`default`,className:`bg-amber-500 hover:bg-amber-500 gap-1`,children:[(0,C.jsx)(we,{className:`h-3 w-3`,"aria-hidden":`true`}),h(`marketplace.detail.updateAvailable`,{defaultValue:`Update available`}),` → v`,Q]})]}),Z.description&&(0,C.jsx)(`p`,{className:`text-sm sm:text-base text-foreground/80 mt-3 max-w-2xl leading-relaxed`,children:Z.description})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 self-start`,children:[(0,C.jsxs)(c,{onClick:jt.onClick,disabled:At,size:`lg`,className:`min-w-[8rem]`,children:[(0,C.jsx)(Ee,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),jt.label]}),$&&(0,C.jsxs)(me,{children:[(0,C.jsx)(ge,{asChild:!0,children:(0,C.jsx)(c,{variant:`outline`,size:`lg`,className:`px-2.5`,"aria-label":h(`marketplace.detail.moreOptions`),children:(0,C.jsx)(De,{className:`h-4 w-4`,"aria-hidden":`true`})})}),(0,C.jsxs)(_e,{align:`end`,className:`w-56`,children:[(0,C.jsxs)(d,{onSelect:Tt,disabled:U!==null,children:[U===`reseed`?(0,C.jsx)(_,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,C.jsx)(Te,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),$.withSampleData?h(`marketplace.detail.reseedAgain`):h(`marketplace.detail.addSampleData`)]}),(0,C.jsxs)(d,{onSelect:Et,disabled:U!==null||!$.withSampleData,className:`text-destructive focus:text-destructive`,children:[U===`purge`?(0,C.jsx)(_,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,C.jsx)(je,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),h(`marketplace.detail.purgeSampleData`)]}),(0,C.jsxs)(d,{onSelect:St,disabled:vt,className:`text-destructive focus:text-destructive`,children:[(0,C.jsx)(je,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),h(`marketplace.detail.uninstallFromRuntime`)]})]})]}),!$&&V&&!x().cloudUrl&&(0,C.jsxs)(me,{children:[(0,C.jsx)(ge,{asChild:!0,children:(0,C.jsx)(c,{variant:`outline`,size:`lg`,className:`px-2.5`,"aria-label":h(`marketplace.detail.moreOptions`),children:(0,C.jsx)(De,{className:`h-4 w-4`,"aria-hidden":`true`})})}),(0,C.jsxs)(_e,{align:`end`,className:`w-56`,children:[(0,C.jsxs)(d,{onSelect:Ct,disabled:U!==null||mt,children:[U===`reseed`?(0,C.jsx)(_,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,C.jsx)(Te,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),V.withSampleData?h(`marketplace.detail.reseedAgain`):h(`marketplace.detail.addSampleData`)]}),(0,C.jsxs)(d,{onSelect:wt,disabled:U!==null||mt||!V.withSampleData,className:`text-destructive focus:text-destructive`,children:[U===`purge`?(0,C.jsx)(_,{className:`h-4 w-4 mr-2 animate-spin`,"aria-hidden":`true`}):(0,C.jsx)(je,{className:`h-4 w-4 mr-2`,"aria-hidden":`true`}),h(`marketplace.detail.purgeSampleData`)]})]})]})]})]}),G&&(0,C.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border p-3 text-sm ${G.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:[G.ok?(0,C.jsx)(m,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}):(0,C.jsx)(p,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,C.jsx)(`div`,{className:`flex-1`,children:G.text}),(0,C.jsx)(`button`,{type:`button`,className:`text-xs underline opacity-60 hover:opacity-100`,onClick:()=>K(null),children:h(`marketplace.action.dismiss`)})]}),J&&(0,C.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-md border p-3 text-sm whitespace-pre-wrap ${J.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:[J.ok?(0,C.jsx)(m,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}):(0,C.jsx)(p,{className:`h-4 w-4 mt-0.5 shrink-0`,"aria-hidden":`true`}),(0,C.jsxs)(`div`,{className:`flex-1`,children:[J.message,J.ok&&(0,C.jsx)(He,{packageId:X.manifest_id,strings:v,className:`mt-2`})]}),(0,C.jsx)(`button`,{type:`button`,className:`text-xs underline opacity-60 hover:opacity-100`,onClick:()=>Y(null),children:h(`marketplace.action.dismiss`)})]}),(0,C.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-3`,children:[(0,C.jsx)(`div`,{className:`lg:col-span-2 space-y-4`,children:(0,C.jsxs)(fe,{children:[(0,C.jsx)(pe,{children:(0,C.jsx)(re,{className:`text-base`,children:h(`marketplace.detail.about`)})}),(0,C.jsx)(ie,{children:Z.readme?(0,C.jsx)($e,{source:Z.readme}):(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h(`marketplace.detail.noReadme`)})})]})}),(0,C.jsx)(`div`,{className:`space-y-4`,children:(0,C.jsxs)(fe,{children:[(0,C.jsx)(pe,{children:(0,C.jsx)(re,{className:`text-base`,children:h(`marketplace.detail.versions`)})}),(0,C.jsx)(ie,{children:T.versions.length===0?(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h(`marketplace.detail.noApprovedVersions`)}):(0,C.jsx)(`ul`,{className:`space-y-3`,children:T.versions.map(e=>(0,C.jsxs)(`li`,{className:`space-y-1 text-sm`,children:[(0,C.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,C.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,C.jsx)(Ae,{className:`h-3.5 w-3.5 text-muted-foreground`,"aria-hidden":`true`}),(0,C.jsxs)(`code`,{className:`font-mono`,children:[`v`,e.version]}),e.is_prerelease&&(0,C.jsx)(l,{variant:`outline`,className:`text-xs`,children:h(`marketplace.detail.prerelease`)})]}),(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.published_at?new Date(e.published_at).toLocaleDateString(ke):`—`})]}),e.release_notes&&e.release_notes.trim()&&(0,C.jsx)(`p`,{className:`whitespace-pre-line pl-5 text-xs text-muted-foreground`,children:e.release_notes.trim()})]},e.id))})})]})})]}),(0,C.jsx)(he,{open:nt,onOpenChange:e=>{A(e),e||(z(null),dt(!1))},children:(0,C.jsxs)(se,{children:[(0,C.jsxs)(ne,{children:[(0,C.jsx)(ae,{children:h(`marketplace.install.dialogTitle`,{name:Z.displayName||X.manifest_id})}),(0,C.jsx)(ce,{children:x().defaultEnvironmentId?h(`marketplace.install.dialogDescCurrent`,{host:typeof window<`u`?window.location.host:``}):h(`marketplace.install.dialogDescPicker`)})]}),it?(0,C.jsx)(u,{className:`h-10 w-full`}):P?(0,C.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/5 p-3 text-sm space-y-2`,children:[(0,C.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,C.jsx)(p,{className:`h-4 w-4 mt-0.5 text-amber-600`,"aria-hidden":`true`}),(0,C.jsx)(`div`,{className:`flex-1`,children:P})]}),Be()?(0,C.jsx)(`a`,{href:Be(),target:`_blank`,rel:`noopener noreferrer`,children:(0,C.jsxs)(c,{variant:`outline`,size:`sm`,className:`w-full`,children:[(0,C.jsx)(Oe,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),h(`marketplace.action.openOnCloud`)]})}):null]}):x().defaultEnvironmentId?(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(s,{id:`seed`,checked:ct,onCheckedChange:e=>lt(e===!0)}),(0,C.jsx)(o,{htmlFor:`seed`,className:`text-sm font-normal cursor-pointer`,children:h(`marketplace.install.includeSampleData`)})]}):j.length===0?(0,C.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:h(`marketplace.install.noEnvs`)}):(0,C.jsxs)(`div`,{className:`space-y-4`,children:[(0,C.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,C.jsx)(o,{htmlFor:`env-select`,children:h(`marketplace.install.environment`)}),(0,C.jsxs)(oe,{value:I,onValueChange:at,children:[(0,C.jsx)(te,{id:`env-select`,children:(0,C.jsx)(de,{placeholder:h(`marketplace.install.environmentPlaceholder`)})}),(0,C.jsx)(ue,{children:j.map(e=>{let t=ot[e.id],n=!!t&&!!Q&&rt(Q,t);return(0,C.jsxs)(ve,{value:e.id,children:[e.display_name||e.hostname||e.id,e.plan&&(0,C.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,e.plan]}),t&&(n?(0,C.jsxs)(`span`,{className:`text-amber-600`,children:[` · `,h(`marketplace.install.updateTo`,{defaultValue:`Update → v{{version}}`,version:Q})]}):(0,C.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,h(`marketplace.install.installedVersion`,{defaultValue:`Installed v{{version}}`,version:t})]}))]},e.id)})})]})]}),(0,C.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,C.jsx)(s,{id:`seed`,checked:ct,onCheckedChange:e=>lt(e===!0)}),(0,C.jsx)(o,{htmlFor:`seed`,className:`text-sm font-normal cursor-pointer`,children:h(`marketplace.install.includeSampleData`)})]})]}),Dt&&!P&&(0,C.jsxs)(`div`,{className:`space-y-3`,children:[(0,C.jsx)(tt,{version:X.latest_version}),(0,C.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,C.jsx)(s,{id:`ack-perms`,checked:ut,onCheckedChange:e=>dt(e===!0)}),(0,C.jsx)(o,{htmlFor:`ack-perms`,className:`text-sm font-normal cursor-pointer leading-snug`,children:h(`marketplace.disclosure.acknowledge`,{defaultValue:`I understand this package runs code and grants the permissions above.`})})]})]}),R&&(0,C.jsx)(`div`,{className:`rounded-md border p-3 text-sm ${R.ok?`border-green-500/30 bg-green-500/5 text-green-700`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:R.message}),R?.ok===!0&&x().defaultEnvironmentId&&x().defaultEnvironmentId===I&&(0,C.jsx)(He,{packageId:X.manifest_id,strings:v}),(0,C.jsxs)(le,{children:[(0,C.jsx)(c,{variant:`outline`,onClick:()=>A(!1),children:h(`marketplace.action.close`)}),!P&&(0,C.jsx)(c,{onClick:bt,disabled:!I||L||R?.ok===!0||Dt&&!ut,children:h(L?`marketplace.action.installing`:`marketplace.action.install`)})]})]})})]})}export{j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{d as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as ee}from"./infrastructure-CSnL6ntj.js";import{Gr as o,Hr as s,Ur as c,Vr as l,Wr as u,Yn as d,bi as f,ii as p,kn as m}from"./ui-components-D8wcRNrt.js";import{t as h,w as g}from"./i18n-runtime-CdWyaiOD.js";import{t as te}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as _}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as v}from"./vendor-icon-package-B6zAlWd3.js";import{t as ne}from"./vendor-icon-refresh-ccw-QRCaXN-I.js";import{t as re}from"./vendor-icon-search-B2Uqtp_W.js";import{t as ie}from"./vendor-icon-settings-CYQ7xc_F.js";import{t as y}from"./vendor-icon-store-CwiX9Ffi.js";import{t as ae}from"./assistantBus-DoNtw1Tf.js";import{M as oe,c as b,d as x,f as se,k as ce,m as le,p as ue,r as de,s as fe,x as S}from"./app-shell-eager-leaves-D9tgfJOe.js";import{i as C,n as w,r as T,t as E}from"./usePackageL10n-Jl2XiF2F.js";var D=t({MarketplacePage:()=>A}),O=e(a(),1),k=i();function pe(){let{t:e}=g(),t=h();return n=>{if(!n)return``;let r=new Date(n);if(Number.isNaN(r.getTime()))return``;let i=Math.floor((Date.now()-r.getTime())/864e5);if(i<1)return e(`marketplace.relativeTime.today`);try{let e=new Intl.RelativeTimeFormat(t,{numeric:`auto`});return i<30?e.format(-i,`day`):i<365?e.format(-Math.floor(i/30),`month`):e.format(-Math.floor(i/365),`year`)}catch{return i<30?e(`marketplace.relativeTime.daysAgo`,{count:i}):i<365?e(`marketplace.relativeTime.monthsAgo`,{count:Math.floor(i/30)}):e(`marketplace.relativeTime.yearsAgo`,{count:Math.floor(i/365)})}}}function A(){let e=n(),{appName:t}=r(),{isAdmin:i,isResolved:a}=ee(),{t:h,language:D}=g(),A=pe(),j=t?`/apps/${t}`:``,M=oe(),N=S(),[P,F]=(0,O.useState)([]),[I,L]=(0,O.useState)(M),[R,z]=(0,O.useState)(null),[B,me]=(0,O.useState)(``),[V,H]=(0,O.useState)(``),[U,he]=(0,O.useState)([]),[W,ge]=(0,O.useState)([]),[G,K]=(0,O.useState)(null),[q,J]=(0,O.useState)(null),[_e,ve]=(0,O.useState)(new Set),Y=(0,O.useMemo)(()=>{let e=new Map;for(let t of U)e.set(t.manifestId,t);return e},[U]),X=async()=>{L(!0),z(null);try{let[e,t,n,r]=await Promise.all([ue({limit:100}),se(),le(),x()]);F(e.items??[]),he(t),ge(n.items??[]);let i=new Set;for(let e of t)i.add(e.manifestId);for(let e of r.items)i.add(e.manifestId);ve(i)}catch(e){z(e?.message??String(e)),F([])}finally{L(!1)}};(0,O.useEffect)(()=>{M&&X()},[M]);let ye=async e=>{K(e.id),J(null);try{ce().features.installLocal?await fe({packageId:e.manifest_id||e.id,versionId:`latest`}):await b({packageId:e.id,environmentId:``,seedSampleData:!0}),J({ok:!0,text:h(`marketplace.org.installed`,{defaultValue:`Installed ${e.display_name}`,name:e.display_name})}),await X(),ae()}catch(e){J({ok:!1,text:e?.message??String(e)})}finally{K(null)}},Z=(0,O.useMemo)(()=>{let e=new Set;for(let t of P)t.category&&e.add(t.category);return Array.from(e).sort()},[P]),Q=e=>{let t=`marketplace.category.${e}`,n=h(t,{defaultValue:e});return n===t?e:n},$=(0,O.useMemo)(()=>{let e=B.trim().toLowerCase();return P.filter(t=>{if(V&&t.category!==V)return!1;if(!e)return!0;let n=E(t,D);return`${n.displayName} ${t.manifest_id} ${n.description??``}`.toLowerCase().includes(e)})},[P,B,V,D]);return M?a?i?(0,k.jsxs)(`div`,{className:`flex flex-col gap-6 p-4 sm:p-6`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(y,{className:`h-6 w-6 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:h(`marketplace.title`)})]}),(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:h(`marketplace.subtitle`)})]}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(f,{variant:`outline`,size:`sm`,onClick:()=>e(`${j}/system/marketplace/installed`),children:[(0,k.jsx)(ie,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),U.length>0?h(`marketplace.installedCount`,{count:U.length}):h(`marketplace.installed`)]}),(0,k.jsxs)(f,{variant:`outline`,size:`sm`,onClick:()=>void X(),disabled:I,children:[(0,k.jsx)(ne,{className:`h-4 w-4 mr-1.5`,"aria-hidden":`true`}),h(`marketplace.refresh`)]})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3`,children:[(0,k.jsxs)(`div`,{className:`relative flex-1`,children:[(0,k.jsx)(re,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`,"aria-hidden":`true`}),(0,k.jsx)(d,{value:B,onChange:e=>me(e.target.value),placeholder:h(`marketplace.searchPlaceholder`),className:`pl-9`,"aria-label":h(`marketplace.searchAria`)})]}),Z.length>0&&(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,k.jsx)(f,{size:`sm`,variant:V===``?`default`:`outline`,onClick:()=>H(``),children:h(`marketplace.all`)}),Z.map(e=>(0,k.jsx)(f,{size:`sm`,variant:V===e?`default`:`outline`,onClick:()=>H(e),children:Q(e)},e))]})]}),R&&(0,k.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-destructive/30 bg-destructive/5 p-4 text-sm`,children:[(0,k.jsx)(te,{className:`h-4 w-4 mt-0.5 text-destructive`,"aria-hidden":`true`}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-medium text-destructive`,children:h(`marketplace.load.failed`)}),(0,k.jsx)(`div`,{className:`text-muted-foreground mt-1`,children:R}),(0,k.jsx)(`div`,{className:`text-xs text-muted-foreground mt-2`,"data-testid":`marketplace-load-hint`,children:N?h(`marketplace.load.failedHintConfigured`,{url:N}):h(`marketplace.load.failedHintSameOrigin`)})]})]}),W.length>0&&(0,k.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(y,{className:`h-5 w-5 text-primary`,"aria-hidden":`true`}),(0,k.jsx)(`h2`,{className:`text-sm font-semibold`,children:h(`marketplace.org.heading`,{defaultValue:`Your organization`})}),(0,k.jsx)(p,{variant:`secondary`,className:`text-xs`,children:W.length})]}),q&&(0,k.jsx)(`div`,{className:`rounded-md border p-3 text-sm ${q.ok?`border-green-500/30 bg-green-500/5 text-green-700 dark:text-green-400`:`border-destructive/30 bg-destructive/5 text-destructive`}`,children:q.text}),(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:W.map(e=>{let t=_e.has(e.manifest_id);return(0,k.jsxs)(l,{className:`flex flex-col`,"data-testid":`org-card-${e.manifest_id}`,children:[(0,k.jsxs)(u,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:e.icon_url,displayName:e.display_name,manifestId:e.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(o,{className:`text-base truncate`,children:e.display_name}),(0,k.jsx)(c,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:e.manifest_id})})]}),e.visibility&&(0,k.jsx)(p,{variant:`outline`,className:`shrink-0 text-xs`,children:e.visibility})]}),(0,k.jsxs)(s,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:e.description||h(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[e.latest_version&&(0,k.jsxs)(p,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(v,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.versionBadge`,{version:e.latest_version})]}),(0,k.jsx)(`div`,{className:`ml-auto`,children:t?(0,k.jsxs)(p,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.org.installedBadge`,{defaultValue:`Installed`})]}):(0,k.jsx)(f,{size:`sm`,onClick:()=>void ye(e),disabled:G===e.id,children:G===e.id?h(`marketplace.org.installing`,{defaultValue:`Installing…`}):h(`marketplace.org.install`,{defaultValue:`Install`})})})]})]})]},e.id)})}),(0,k.jsx)(`div`,{className:`border-b pt-2`})]}),I&&P.length===0?(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:Array.from({length:6}).map((e,t)=>(0,k.jsxs)(l,{children:[(0,k.jsxs)(u,{className:`pb-2`,children:[(0,k.jsx)(m,{className:`h-10 w-10 rounded-lg mb-2`}),(0,k.jsx)(m,{className:`h-5 w-3/4`}),(0,k.jsx)(m,{className:`h-4 w-1/2 mt-1`})]}),(0,k.jsx)(s,{children:(0,k.jsx)(m,{className:`h-12 w-full`})})]},t))}):$.length===0?(0,k.jsx)(`div`,{className:`text-center py-12 text-sm text-muted-foreground`,children:P.length===0?h(`marketplace.noApprovedYet`):h(`marketplace.noMatchFilters`)}):(0,k.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:$.map(t=>{let n=Y.get(t.manifest_id),r=E(t,D);return(0,k.jsxs)(l,{className:`cursor-pointer transition-colors hover:bg-accent/50 flex flex-col`,onClick:()=>e(`${j}/system/marketplace/${t.id}`),role:`link`,tabIndex:0,onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),e(`${j}/system/marketplace/${t.id}`))},"data-testid":`marketplace-card-${t.manifest_id}`,children:[(0,k.jsxs)(u,{className:`flex flex-row items-start gap-3 pb-2`,children:[(0,k.jsx)(C,{iconUrl:t.icon_url,displayName:r.displayName,manifestId:t.manifest_id}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(o,{className:`text-base truncate`,children:r.displayName}),(0,k.jsx)(c,{className:`text-xs truncate`,children:(0,k.jsx)(`code`,{className:`font-mono`,children:t.manifest_id})})]}),t.publisher&&t.publisher!==`private`&&(0,k.jsx)(p,{variant:t.publisher===`objectstack`?`default`:`secondary`,className:`shrink-0`,children:t.publisher})]}),(0,k.jsxs)(s,{className:`flex-1 flex flex-col gap-2`,children:[(0,k.jsx)(`p`,{className:`text-sm text-muted-foreground line-clamp-2`,children:r.description||h(`marketplace.noDescription`)}),(0,k.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-2 flex-wrap`,children:[n&&(0,k.jsxs)(p,{variant:`default`,className:`text-xs bg-green-600 hover:bg-green-600`,children:[(0,k.jsx)(_,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.installedBadge`,{version:n.version})]}),t.latest_version?.version&&(0,k.jsxs)(p,{variant:`outline`,className:`text-xs`,children:[(0,k.jsx)(v,{className:`h-3 w-3 mr-1`,"aria-hidden":`true`}),h(`marketplace.versionBadge`,{version:t.latest_version.version})]}),t.category&&(0,k.jsx)(p,{variant:`outline`,className:`text-xs`,children:Q(t.category)}),t.latest_version?.published_at&&(0,k.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:A(t.latest_version.published_at)})]})]})]},t.id)})})]}):(0,k.jsx)(de,{}):(0,k.jsx)(T,{}):(0,k.jsx)(w,{})}export{D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import"./ui-components-
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import"./ui-components-D8wcRNrt.js";import{Xn as r}from"./framework-CAuH4h0L.js";import{w as i}from"./i18n-runtime-CdWyaiOD.js";import{t as a}from"./vendor-icon-check-vpu9Zukp.js";import{t as o}from"./vendor-icon-chevron-down-BEf_jTEE.js";import{t as s}from"./vendor-icon-chevron-right-DbnKwHYQ.js";import{t as c}from"./vendor-icon-copy-B5M-KdZo.js";var l=e(n(),1),u=t();function d({sections:e,open:t}){let{t:n}=i(),[r,d]=(0,l.useState)([`0`]),[f,p]=(0,l.useState)(null);if(!t)return null;let m=async(e,t)=>{try{await navigator.clipboard.writeText(JSON.stringify(e,null,2)),p(t),setTimeout(()=>p(null),2e3)}catch(e){console.error(`Failed to copy:`,e)}},h=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,u.jsxs)(`div`,{className:`w-80 border-l bg-background p-0 overflow-hidden flex flex-col shrink-0 z-20 transition-all`,children:[(0,u.jsxs)(`div`,{className:`px-4 py-3 border-b bg-muted/5 flex items-center justify-between`,children:[(0,u.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:n(`layout.metadata.panelTitle`)}),(0,u.jsx)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:n(`layout.metadata.jsonBadge`)})]}),(0,u.jsx)(`div`,{className:`flex-1 overflow-auto`,children:e.map((e,t)=>{let i=String(t),l=r.includes(i),d=f===t;return(0,u.jsxs)(`div`,{className:`border-b last:border-b-0`,children:[(0,u.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 hover:bg-muted/5 transition-colors`,children:[(0,u.jsxs)(`button`,{type:`button`,onClick:()=>h(i),className:`flex-1 flex items-center justify-between text-left`,children:[(0,u.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:e.title}),l?(0,u.jsx)(o,{className:`h-3 w-3 text-muted-foreground ml-2`}):(0,u.jsx)(s,{className:`h-3 w-3 text-muted-foreground ml-2`})]}),(0,u.jsx)(`button`,{type:`button`,onClick:()=>m(e.data,t),className:`p-1 hover:bg-muted rounded transition-colors ml-2`,title:n(`layout.metadata.copyJson`),children:d?(0,u.jsx)(a,{className:`h-3 w-3 text-green-600`}):(0,u.jsx)(c,{className:`h-3 w-3 text-muted-foreground`})})]}),l&&(0,u.jsx)(`div`,{className:`px-4 pb-4`,children:(0,u.jsx)(`div`,{className:`relative rounded-md border border-border/50 bg-muted/5 overflow-hidden`,children:(0,u.jsx)(`pre`,{className:`text-[11px] leading-relaxed p-3 overflow-auto max-h-96 font-mono text-foreground/90`,children:JSON.stringify(e.data,null,2)})})})]},t)})})]})}function f(){let e=(0,l.useMemo)(()=>{try{return typeof window<`u`&&r(window.location.search).enabled}catch{return!1}},[]),[t,n]=(0,l.useState)(e);return{showDebug:t,toggleDebug:()=>n(e=>!e)}}export{f as n,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{d as t,m as n,p as r,t as i,v as a}from"./vendor-react-BggL7APJ.js";import{f as o,p as ee}from"./infrastructure-CSnL6ntj.js";import{Pi as s,Zi as c}from"./vendor-objectstack-C4eD5dbT.js";import{$ as te,At as l,Dt as u,Et as d,bi as f,bt as p,et as m}from"./ui-components-D8wcRNrt.js";import{It as h,Un as ne,ii as re,st as ie}from"./framework-CAuH4h0L.js";import{f as ae,w as oe}from"./i18n-runtime-CdWyaiOD.js";import{a as se}from"./data-adapter-BDsrq0TX.js";import{r as ce}from"./vendor-ui-utils-DIUdEYii.js";import{t as le}from"./vendor-icon-database-C8JGjSkn.js";import{t as ue}from"./vendor-icon-lock-B_psRnly.js";import{t as de}from"./vendor-icon-plus-BlfcDDsa.js";import{t as fe}from"./vendor-icon-save-CuavGNuU.js";import{t as pe}from"./vendor-icon-x-CcLtgRNL.js";import{l as me,o as he,p as ge,u as _e}from"./createDerive-CynsXU-B.js";import{t as ve}from"./RecordDetailView-B3XBEgk2.js";import{a as ye,i as be,l as xe,n as Se,o as Ce,r as we,s as Te}from"./InterfaceListPage-BfoCldGu.js";import{t as Ee}from"./getIcon-BDkBRQFw.js";import{n as g,r as De,t as Oe}from"./CreateViewDialog-Cp72x_O7.js";import{a as ke,n as Ae,r as _,t as v}from"./drillUrlFilters-N0RngQg6.js";import{t as y}from"./plugins-views-CnvkdSJK.js";import{o as b,t as x}from"./runtime-metadata-persistence-DX29lQ62.js";var S=e(a(),1),C=i(),je=new Set([`select`,`multiselect`,`radio`,`enum`,`boolean`]),Me=4,w={"=":`eq`,...Object.fromEntries(Object.entries(v).map(([e,t])=>[t,e]))};function T(e){let t=[];for(let[n,r,i]of e){let e={field:n,operator:c(w[r]??r)};i!==void 0&&(e.value=i);let a=s.safeParse(e);if(!a.success){console.warn(`[ObjectDataPage] Dropped URL filter on "${n}" from the saved view: operator "${r}" has no canonical ViewFilterRule form.`);continue}t.push(a.data)}return t}function Ne(e,t,n){return g(e,{fallbackColumns:t,filter:T(n)})}function E({dataSource:e,objects:i}){let{appName:a,objectName:s}=r(),{t:c}=oe(),{objectLabel:g,fieldLabel:v}=ae(),w=t(),[T,E]=n(),{can:D,getObjectApiOperations:O}=m(),{canRead:k}=te(s??``),{user:A,activeOrganization:j}=ee(),{isAdmin:M}=o(),N=he(),P=xe()===`group`,F=ge(),[Pe,I]=S.useState(!1),L=S.useMemo(()=>(i||[]).find(e=>e.name===s),[i,s]),[Fe]=S.useState(()=>Te(new URLSearchParams(window.location.search))),Ie=S.useCallback(e=>{E(t=>Ce(t,e),{replace:!0})},[E]),R=Array.from(T.entries()).filter(([e])=>e.startsWith(`filter[`)).map(([e,t])=>`${e}=${t}`).join(`&`),z=S.useMemo(()=>{let e=ke(new URLSearchParams(R)),t=e.filter(([e])=>k(e));if(t.length<e.length){let t=e.filter(([e])=>!k(e)).map(([e])=>e);console.warn(`[ObjectDataPage] Dropped URL filter(s) on unreadable field(s): ${t.join(`, `)}`)}return ne(t,{currentUserId:A?.id??null,currentOrgId:j?.id??null})},[R,k,A?.id,j?.id]),Le=S.useMemo(()=>_(z),[z]),Re=S.useCallback(e=>{E(t=>Ae(new URLSearchParams(t),e))},[E]),B=S.useMemo(()=>we(L,{orgAttribution:P}).filter(e=>k(e)),[L,k,P]),V=S.useMemo(()=>{let e=L?.fields;if(!e||typeof e!=`object`)return;let t=Object.entries(e).filter(([e,t])=>t&&!t.hidden&&je.has(t.type)&&k(e)).slice(0,Me).map(([e])=>({field:e}));return t.length>0?{element:`dropdown`,fields:t}:void 0},[L,k]),H=S.useCallback(e=>`/apps/${a}/${s}/record/${encodeURIComponent(String(e))}`,[a,s]),U=ie({navigation:{mode:`drawer`},objectName:s??``,onNavigate:e=>w(H(e))}),W=T.get(`recordId`),ze=S.useCallback((e,t)=>{let n=e?.id??e?._id;if(t&&(t.metaKey||t.ctrlKey||t.button===1)&&n!=null){window.open(H(n),`_blank`);return}n!=null&&E(e=>{let t=new URLSearchParams(e);return t.set(`recordId`,String(n)),t})},[H,E]),Be=S.useCallback(()=>{E(e=>{let t=new URLSearchParams(e);return t.delete(`recordId`),t})},[E]);S.useEffect(()=>{W&&!U.isOpen?U.open({id:W}):!W&&U.isOpen&&U.close()},[W]);let G=S.useMemo(()=>ye(L),[L]),K=S.useMemo(()=>Se(L),[L]),q=S.useMemo(()=>be(L),[L]),J=S.useMemo(()=>{let e=[`grid`];return G&&e.push(`kanban`),K&&e.push(`calendar`),q&&e.push(`gallery`),e},[G,K,q]),Y=S.useMemo(()=>{if(L)return{type:`list-view`,objectName:L.name,viewType:`grid`,columns:B,...z.length?{filter:z}:{},kanban:G,calendar:K,gallery:q,userFilters:V,appearance:{allowedVisualizations:J},showViewSwitcher:J.length>1,userActions:{search:!0,sort:!0,filter:!0,rowHeight:!0,group:!0,hideFields:!0},showRecordCount:!0}},[L,B,z,G,K,q,V,J]),X=S.useCallback(async t=>{try{let n=Ne(t,B,z),r=b(s??``,n,{name:t.name,label:t.label}),i=await x(`view`,r.name,r,{metadataClient:N,dataSource:e,objectName:s});if(i){let e=F?``:`?${me}=${_e}`;w(`../view/${i}${e}`,{relative:`path`})}return!0}catch(e){return console.error(`[ObjectDataPage] Failed to save view:`,e),ce.error(c(`form.saveError`),{description:se(e),classNames:{description:`whitespace-pre-line`}}),!1}},[B,z,N,e,w,s,F,c]),Z=S.useMemo(()=>re(L,L?O(L.name):void 0),[L,O]),Q=!!L&&Z.create&&D(L.name,`create`),$=Q?Z.createPredicates:void 0,Ve=h($?.visibleWhen??!0,null,{fallback:!1,warnOnError:!0,label:`builtin:create:visibleWhen`}),He=h($?.disabledWhen,null,{fallback:!1,warnOnError:!0,label:`builtin:create:disabledWhen`}),Ue=$?.disabledWhen!=null&&He;return L?D(L.name,`read`)?(0,C.jsxs)(`div`,{className:`h-full flex flex-col bg-background min-w-0 overflow-hidden`,"data-testid":`object-data-page`,children:[(0,C.jsx)(`div`,{className:`hidden sm:block`,children:(0,C.jsx)(De,{title:(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,C.jsx)(`span`,{className:`truncate`,children:g(L)}),(0,C.jsx)(`span`,{className:`rounded border px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:c(`console.objectData.badge`,{defaultValue:`Data`})})]}),subtitle:c(`console.objectData.description`,{defaultValue:`URL-defined data slice — not bound to any saved view.`}),icon:S.createElement(Ee(L?.icon),{className:`h-4 w-4`}),actions:(0,C.jsxs)(C.Fragment,{children:[Q&&Ve&&(0,C.jsxs)(f,{size:`sm`,onClick:()=>w(`../new`,{relative:`path`}),disabled:Ue,className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-new-button`,children:[(0,C.jsx)(de,{className:`h-4 w-4`}),(0,C.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectView.new`)})]}),M&&(0,C.jsxs)(f,{size:`sm`,variant:`outline`,onClick:()=>I(!0),className:`shadow-none gap-1.5 h-8 sm:h-9`,"data-testid":`object-data-save-as-view`,children:[(0,C.jsx)(fe,{className:`h-4 w-4`}),(0,C.jsx)(`span`,{className:`hidden sm:inline`,children:c(`console.objectData.saveAsView`,{defaultValue:`Save as view`})})]})]})})}),z.length>0&&(0,C.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 border-b px-3 sm:px-4 py-2 shrink-0`,"data-testid":`object-data-filter-chips`,children:[(0,C.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:c(`console.objectData.filteredBy`,{defaultValue:`Filtered by`})}),Le.map(({field:e,text:t,textKey:n})=>(0,C.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full border bg-muted/40 px-2 py-0.5 text-xs`,children:[(0,C.jsx)(`span`,{className:`font-medium`,children:v(L.name,e,e)}),(0,C.jsx)(`span`,{className:`text-muted-foreground`,children:n?c(n):t}),(0,C.jsx)(`button`,{type:`button`,onClick:()=>Re(e),className:`ml-0.5 rounded-full hover:bg-muted p-0.5`,"aria-label":c(`console.objectData.removeFilter`,{defaultValue:`Remove filter {{field}}`,field:e}),"data-testid":`object-data-remove-filter-${e}`,children:(0,C.jsx)(pe,{className:`h-3 w-3`})})]},e))]}),(0,C.jsx)(`div`,{className:`flex-1 min-h-0 overflow-auto`,children:Y&&(0,C.jsx)(y,{schema:Y,dataSource:e,userFilterSelections:Fe,onUserFilterSelectionsChange:Ie,onRowClick:ze})}),U.isOverlay&&(0,C.jsx)(p,{...U,setIsOpen:e=>{e||Be()},title:g(L),children:t=>(0,C.jsx)(ve,{objectNameOverride:L.name,recordIdOverride:String(t?.id??t?._id??W??``),embedded:!0,dataSource:e,objects:i,onEdit:()=>{}})}),M&&(0,C.jsx)(Oe,{open:Pe,onOpenChange:I,onCreate:X,objectDef:L})]}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`object-data-403`,children:(0,C.jsxs)(d,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(ue,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(l,{children:c(`console.objectData.noAccessTitle`,{defaultValue:`Access denied`})}),(0,C.jsx)(u,{children:c(`console.objectData.noAccess`,{defaultValue:`You do not have permission to view this data.`})})]})}):(0,C.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,C.jsxs)(d,{children:[(0,C.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,C.jsx)(le,{className:`h-6 w-6 text-muted-foreground`})}),(0,C.jsx)(l,{children:c(`console.objectView.objectNotFound`)}),(0,C.jsx)(u,{children:c(`console.objectView.objectNotFoundDescription`,{objectName:s})})]})})}export{E as ObjectDataPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,m as t,p as n,t as r,u as i}from"./vendor-react-BggL7APJ.js";import{f as a}from"./infrastructure-CSnL6ntj.js";import{At as o,Dt as s,Et as c,yt as l}from"./ui-components-D8wcRNrt.js";import{G as u,W as d,ct as f,gt as p,h as m}from"./framework-CAuH4h0L.js";import{w as h}from"./i18n-runtime-CdWyaiOD.js";import{t as g}from"./vendor-icon-file-text-7BKAVNof.js";import{t as _}from"./vendor-icon-pencil-CMubUBjW.js";import{a as v}from"./ExpressionProvider-Dr0e99r1.js";import{w as y}from"./RecordDetailView-B3XBEgk2.js";import{t as b}from"./preferLocal-DEJV3KIq.js";import{t as x}from"./InterfaceListPage-BfoCldGu.js";import{t as S}from"./useCanAuthorMetadata-TDrVrYGB.js";import{n as C,t as w}from"./MetadataInspector-BQyu9pOE.js";var T=Object.freeze({});function E(e,t,n){let r=new Set(t.map(e=>e?.name).filter(e=>typeof e==`string`&&e!==``)),i=(t,n)=>e&&r.has(t)&&n!=null&&n!==``?`/apps/${e}/${t}/record/${encodeURIComponent(String(n))}`:null;return{resolve:()=>T,recordHref:i,openRecord:(e,t)=>{let r=i(e,t);r&&n(r)}}}var D=r();function O(){m({objectName:`*`})}function k(){let{t:r}=h(),{pageName:m}=n(),[T]=t(),{showDebug:k}=C(),A=e(),j=i(),{isAdmin:M}=a(),N=S(),{pages:P,objects:F,getTypeStatus:I}=u(),{app:L}=v(),R=d(),z=b(P,m,L?._packageId);if(!z){let e=I?.(`page`);return e===`idle`||e===`loading`?(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,"data-testid":`page-loading`,children:(0,D.jsx)(l,{className:`h-5 w-5 text-muted-foreground`})}):(0,D.jsx)(`div`,{className:`h-full flex items-center justify-center p-8`,children:(0,D.jsxs)(c,{children:[(0,D.jsx)(`div`,{className:`mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-muted`,children:(0,D.jsx)(g,{className:`h-6 w-6 text-muted-foreground`})}),(0,D.jsx)(o,{children:r(`empty.pageNotFound`)}),(0,D.jsx)(s,{children:r(`empty.pageNotFoundDescription`,{name:m})})]})})}let B=Object.fromEntries(T.entries()),V=j.pathname.match(/\/apps\/([^/]+)/)?.[1],H=M&&N&&!!V&&!!m,U=()=>{H&&A(`/apps/${V}/metadata/page/${encodeURIComponent(m)}`)},W=E(V,F??[],A);return(0,D.jsx)(y,{dataSource:R,objects:F,onRefresh:O,children:(0,D.jsxs)(`div`,{className:`flex flex-row h-full w-full overflow-hidden relative`,children:[(0,D.jsxs)(`div`,{className:`flex-1 overflow-auto h-full relative`,children:[H&&(0,D.jsx)(`button`,{type:`button`,onClick:U,className:`absolute right-3 top-3 z-30 inline-flex h-7 w-7 items-center justify-center rounded-md border border-input bg-background/90 text-muted-foreground shadow-sm backdrop-blur hover:bg-accent hover:text-accent-foreground`,"data-testid":`page-edit-in-studio-button`,title:r(`common.editInStudio`,{defaultValue:`Edit in studio`}),"aria-label":r(`common.editInStudio`,{defaultValue:`Edit in studio`}),children:(0,D.jsx)(_,{className:`h-3.5 w-3.5`})}),z.interfaceConfig?.source?(0,D.jsx)(x,{page:z,reserveEditAffordance:H}):(0,D.jsx)(f,{value:W,children:(0,D.jsx)(p,{schema:{...z,type:z.type||`page`,pageType:z.type,context:{params:B}}})})]}),(0,D.jsx)(w,{open:k,sections:[{title:`Page Configuration`,data:z}]})]})})}export{k as PageView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{o as r,p as i}from"./infrastructure-CSnL6ntj.js";import{$n as a,Di as o,Gr as s,Hr as c,Ur as l,Vr as u,Wr as d,Yn as f,ai as p,bi as m,ci as h,et as g,ii as _,li as v,oi as y,si as b}from"./ui-components-D8wcRNrt.js";import{W as x,a as S,o as C}from"./framework-CAuH4h0L.js";import{w}from"./i18n-runtime-CdWyaiOD.js";import{t as T}from"./vendor-icon-circle-alert-D1XTr_X9.js";import{t as E}from"./vendor-icon-circle-check-Bq3OcFQN.js";import{t as D}from"./vendor-icon-globe-BaOanPH5.js";import{t as O}from"./vendor-icon-loader-circle-D3PsuVaD.js";import{t as k}from"./vendor-icon-lock-B_psRnly.js";import{t as A}from"./vendor-icon-upload-BZ3rElxe.js";import{t as j}from"./vendor-icon-user-IWwlLQut.js";import{t as M}from"./vendor-icon-x-CcLtgRNL.js";var N=e(n(),1),P=t();function F(){let{t:e}=w(),{user:t,updateUser:n,isLoading:g,changePassword:x,setInitialPassword:S,hasLocalPassword:C}=i(),{upload:D}=o(),[k,F]=(0,N.useState)(t?.name??``),[I,L]=(0,N.useState)(!1),[B,V]=(0,N.useState)(null),H=(0,N.useRef)(null),[U,W]=(0,N.useState)(!1),[G,K]=(0,N.useState)(null);return(0,N.useEffect)(()=>{F(t?.name??``)},[t?.name]),t?(0,P.jsxs)(`div`,{className:`flex flex-col gap-4 sm:gap-6 p-4 sm:p-6 max-w-2xl`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`h1`,{className:`text-xl sm:text-2xl font-bold tracking-tight`,children:e(`profile.title`,{defaultValue:`Profile`})}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:e(`profile.subtitle`,{defaultValue:`Manage your account settings`})})]}),(0,P.jsx)(u,{children:(0,P.jsxs)(c,{className:`pt-6`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,P.jsxs)(p,{className:`h-16 w-16`,children:[(0,P.jsx)(b,{src:t.image??void 0,alt:t.name??`User`}),(0,P.jsx)(y,{className:`text-lg bg-primary text-primary-foreground`,children:r(t)})]}),(0,P.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(`p`,{className:`text-lg font-semibold truncate`,children:t.name??`User`}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground truncate`,children:t.email}),(0,P.jsx)(_,{variant:`secondary`,className:`mt-1`,children:t.role??`member`})]}),(0,P.jsxs)(`div`,{className:`flex flex-col gap-2 shrink-0`,children:[(0,P.jsx)(`input`,{ref:H,type:`file`,accept:`image/*`,className:`hidden`,onChange:async e=>{let t=e.target.files?.[0];if(H.current&&(H.current.value=``),t){W(!0),K(null);try{let e=await D(t);await n({image:e.url})}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}}},"data-testid":`profile-avatar-file`}),(0,P.jsxs)(m,{type:`button`,variant:`outline`,size:`sm`,disabled:U,onClick:()=>H.current?.click(),"data-testid":`profile-avatar-upload-btn`,children:[U?(0,P.jsx)(O,{className:`mr-2 h-4 w-4 animate-spin`}):(0,P.jsx)(A,{className:`mr-2 h-4 w-4`}),t.image?e(`profile.avatar.replace`,{defaultValue:`Replace`}):e(`profile.avatar.upload`,{defaultValue:`Upload`})]}),t.image&&(0,P.jsxs)(m,{type:`button`,variant:`ghost`,size:`sm`,disabled:U,onClick:async()=>{W(!0),K(null);try{await n({image:null})}catch(e){K(e instanceof Error?e.message:String(e))}finally{W(!1)}},"data-testid":`profile-avatar-remove-btn`,children:[(0,P.jsx)(M,{className:`mr-2 h-4 w-4`}),e(`profile.avatar.remove`,{defaultValue:`Remove`})]})]})]}),G&&(0,P.jsxs)(h,{variant:`destructive`,className:`mt-4`,children:[(0,P.jsx)(T,{className:`h-4 w-4`}),(0,P.jsx)(v,{children:G})]})]})}),(0,P.jsxs)(u,{children:[(0,P.jsxs)(d,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(j,{className:`h-4 w-4 text-muted-foreground`}),(0,P.jsx)(s,{className:`text-base sm:text-lg`,children:e(`profile.info.title`,{defaultValue:`Personal Information`})})]}),(0,P.jsx)(l,{children:e(`profile.info.description`,{defaultValue:`Update your name and view account details`})})]}),(0,P.jsx)(c,{children:(0,P.jsxs)(`form`,{onSubmit:async e=>{e.preventDefault(),V(null),L(!1);try{await n({name:k}),L(!0)}catch(e){V(e instanceof Error?e.message:String(e))}},className:`space-y-4`,children:[B&&(0,P.jsxs)(h,{variant:`destructive`,children:[(0,P.jsx)(T,{className:`h-4 w-4`}),(0,P.jsx)(v,{children:B})]}),I&&(0,P.jsxs)(h,{children:[(0,P.jsx)(E,{className:`h-4 w-4 text-green-600`}),(0,P.jsx)(v,{className:`text-green-800 dark:text-green-400`,children:e(`profile.info.saved`,{defaultValue:`Profile updated successfully.`})})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`profile-name`,children:e(`profile.info.name`,{defaultValue:`Name`})}),(0,P.jsx)(f,{id:`profile-name`,type:`text`,value:k,onChange:e=>F(e.target.value),required:!0,"aria-required":`true`,disabled:g})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`profile-email`,children:e(`profile.info.email`,{defaultValue:`Email`})}),(0,P.jsx)(f,{id:`profile-email`,type:`email`,value:t.email,disabled:!0,className:`bg-muted text-muted-foreground`}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`profile.info.emailImmutable`,{defaultValue:`Email cannot be changed.`})})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{children:e(`profile.info.role`,{defaultValue:`Role`})}),(0,P.jsx)(f,{type:`text`,value:t.role??`member`,disabled:!0,className:`bg-muted text-muted-foreground`})]}),(0,P.jsx)(m,{type:`submit`,disabled:g,className:`w-full sm:w-auto`,children:g?e(`profile.saving`,{defaultValue:`Saving…`}):e(`profile.info.save`,{defaultValue:`Save Changes`})})]})})]}),(0,P.jsx)(R,{userId:t.id}),(0,P.jsx)(z,{changePassword:x,setInitialPassword:S,hasLocalPassword:C})]}):null}function I(e){try{let t=new Intl.DisplayNames([e],{type:`language`}).of(e);return!t||t===e?e:t.charAt(0).toLocaleUpperCase(e)+t.slice(1)}catch{return e}}var L=``;function R({userId:e}){let{t,offerableLanguages:n}=w(),r=x(),{checkField:i}=g(),[o,f]=(0,N.useState)(null),[p,_]=(0,N.useState)(L),[y,b]=(0,N.useState)(!1),[O,k]=(0,N.useState)(!1),[A,j]=(0,N.useState)(!1),[M,F]=(0,N.useState)(null),[R,z]=(0,N.useState)(null);(0,N.useEffect)(()=>{if(!r||!e)return;let t=!1;return r.findOne(`sys_user`,e).then(e=>{if(t)return;let n=e?.locale,r=typeof n==`string`&&n.length>0?n:L;f(r),_(r),b(!0)}).catch(e=>{t||console.warn(`[profile] Could not read your language preference:`,e)}),()=>{t=!0}},[r,e]);let B=(0,N.useMemo)(()=>{let e=n??[];return o&&o.length>0&&!e.includes(o)?[o,...e]:[...e]},[n,o]);if(!r||!y||n===null)return null;let V=i(`sys_user`,`locale`,`write`),H=p!==(o??L);return(0,P.jsxs)(u,{children:[(0,P.jsxs)(d,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(D,{className:`h-4 w-4 text-muted-foreground`}),(0,P.jsx)(s,{className:`text-base sm:text-lg`,children:t(`profile.language.title`,{defaultValue:`Language`})})]}),(0,P.jsx)(l,{children:t(`profile.language.description`,{defaultValue:`The language used for notifications and messages sent to you. The interface language is chosen separately, from the globe menu.`})})]}),(0,P.jsx)(c,{children:(0,P.jsxs)(`form`,{onSubmit:async t=>{t.preventDefault(),F(null),z(null),j(!1),k(!0);try{await r.update(`sys_user`,e,{locale:p===L?null:p}),f(p),j(!0)}catch(e){let t=S(e)?.find(e=>e.field===`locale`);t&&t.message?z(t.message):F(C(e)??(e instanceof Error?e.message:String(e)))}finally{k(!1)}},className:`space-y-4 max-w-md`,children:[M&&(0,P.jsxs)(h,{variant:`destructive`,children:[(0,P.jsx)(T,{className:`h-4 w-4`}),(0,P.jsx)(v,{children:M})]}),A&&(0,P.jsxs)(h,{children:[(0,P.jsx)(E,{className:`h-4 w-4 text-green-600`}),(0,P.jsx)(v,{className:`text-green-800 dark:text-green-400`,children:t(`profile.language.saved`,{defaultValue:`Language preference updated.`})})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`profile-language`,children:t(`profile.language.label`,{defaultValue:`Preferred language`})}),(0,P.jsxs)(`select`,{id:`profile-language`,"data-testid":`profile-language-select`,value:p,onChange:e=>{_(e.target.value),z(null),j(!1)},disabled:!V||O,"aria-invalid":R?!0:void 0,"aria-describedby":R?`profile-language-error`:void 0,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,children:[(0,P.jsx)(`option`,{value:L,children:t(`profile.language.systemDefault`,{defaultValue:`Use the deployment default`})}),B.map(e=>(0,P.jsx)(`option`,{value:e,children:I(e)},e))]}),R&&(0,P.jsx)(`p`,{id:`profile-language-error`,className:`text-sm text-destructive`,children:R}),!V&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`profile.language.readOnly`,{defaultValue:`Your administrator manages the language for your account.`})})]}),V&&(0,P.jsx)(m,{type:`submit`,disabled:O||!H,className:`w-full sm:w-auto`,children:O?t(`profile.saving`,{defaultValue:`Saving…`}):t(`profile.language.save`,{defaultValue:`Save`})})]})})]})}function z({changePassword:e,setInitialPassword:t,hasLocalPassword:n,highlight:r,onPasswordSet:i}){let{t:o}=w(),[p,g]=(0,N.useState)(null),[_,y]=(0,N.useState)(``),[b,x]=(0,N.useState)(``),[S,C]=(0,N.useState)(``),[D,O]=(0,N.useState)(!1),[A,j]=(0,N.useState)(null),[M,F]=(0,N.useState)(null);(0,N.useEffect)(()=>{let e=!1;return n().then(t=>{e||g(t)}).catch(()=>{e||g(!1)}),()=>{e=!0}},[n]);let I=()=>{y(``),x(``),C(``)},L=async n=>{if(n.preventDefault(),j(null),F(null),b.length<8){j(o(`profile.password.tooShort`,{defaultValue:`Password must be at least 8 characters`}));return}if(b!==S){j(o(`profile.password.mismatch`,{defaultValue:`Passwords do not match`}));return}O(!0);try{if(p){if(!_){j(o(`profile.password.enterCurrent`,{defaultValue:`Enter your current password`})),O(!1);return}await e(_,b),F(o(`profile.password.changed`,{defaultValue:`Password changed.`}))}else await t(b),F(o(`profile.password.localSet`,{defaultValue:`Local password set. You can now sign in with email and password on this environment.`})),g(!0),i?.();I()}catch(e){j(e instanceof Error?e.message:String(e))}finally{O(!1)}},R=p===null;return(0,P.jsxs)(u,{className:r?`ring-2 ring-amber-300 dark:ring-amber-700`:void 0,children:[(0,P.jsxs)(d,{children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(k,{className:`h-4 w-4 text-muted-foreground`}),(0,P.jsx)(s,{className:`text-base sm:text-lg`,children:p?o(`profile.password.changeTitle`,{defaultValue:`Change Password`}):o(`profile.password.setTitle`,{defaultValue:`Set Local Password`})})]}),(0,P.jsx)(l,{children:p?o(`profile.password.changeDescription`,{defaultValue:`Update the password you use to sign in to this environment.`}):o(`profile.password.setDescription`,{defaultValue:`You signed in via single sign-on. Set a local password to also sign in with email and password on this environment.`})})]}),(0,P.jsx)(c,{children:(0,P.jsxs)(`form`,{onSubmit:L,className:`space-y-4 max-w-md`,children:[p&&(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`current-password`,children:o(`profile.password.current`,{defaultValue:`Current password`})}),(0,P.jsx)(f,{id:`current-password`,type:`password`,autoComplete:`current-password`,value:_,onChange:e=>y(e.target.value),disabled:D||R,required:!0})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`new-password`,children:p?o(`profile.password.new`,{defaultValue:`New password`}):o(`profile.password.password`,{defaultValue:`Password`})}),(0,P.jsx)(f,{id:`new-password`,type:`password`,autoComplete:`new-password`,value:b,onChange:e=>x(e.target.value),disabled:D||R,minLength:8,required:!0})]}),(0,P.jsxs)(`div`,{className:`space-y-2`,children:[(0,P.jsx)(a,{htmlFor:`confirm-password`,children:o(`profile.password.confirm`,{defaultValue:`Confirm password`})}),(0,P.jsx)(f,{id:`confirm-password`,type:`password`,autoComplete:`new-password`,value:S,onChange:e=>C(e.target.value),disabled:D||R,minLength:8,required:!0})]}),A&&(0,P.jsxs)(h,{variant:`destructive`,children:[(0,P.jsx)(T,{className:`h-4 w-4`}),(0,P.jsx)(v,{children:A})]}),M&&(0,P.jsxs)(h,{children:[(0,P.jsx)(E,{className:`h-4 w-4`}),(0,P.jsx)(v,{children:M})]}),(0,P.jsx)(m,{type:`submit`,disabled:D||R,className:`w-full sm:w-auto`,children:D?o(`profile.saving`,{defaultValue:`Saving…`}):p?o(`profile.password.changeAction`,{defaultValue:`Change password`}):o(`profile.password.setAction`,{defaultValue:`Set password`})})]})})]})}export{F as ProfilePage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{Ar as r,At as i,Br as a,Fr as o,Hr as ee,Jn as s,Mr as c,Nr as l,Pr as u,Qn as d,Ur as te,Vr as ne,Wr as re,an as ie,in as f,jr as p,nn as ae,on as m,ri as oe,rn as h,tn as se,yi as g}from"./ui-components-D6cEVg0T.js";import{K as ce}from"./framework-DFR4HNtj.js";import{r as _}from"./vendor-ui-utils-DIUdEYii.js";import{t as le}from"./vendor-icon-code-xml-C9EWHSC8.js";import{t as ue}from"./vendor-icon-copy-B5M-KdZo.js";import{t as de}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as fe}from"./vendor-icon-link-2-EAo0juhN.js";import{t as pe}from"./vendor-icon-plus-BlfcDDsa.js";import{t as me}from"./vendor-icon-rectangle-ellipsis-CAvWLjnI.js";import{t as he}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as ge}from"./vendor-icon-settings-2-BHIWdy1J.js";import"./src-C0eXlKtx.js";import{t as _e}from"./submitRedirect-C2lfZSHt.js";var v=e(n(),1),y=t();function ve(e){return e?e.replace(/^\/+/,``).match(/^forms\/([^/?#]+)/i)?.[1]??null:null}function b(e){return e.trim().toLowerCase().replace(/[^a-z0-9-_]+/g,`-`).replace(/^-+|-+$/g,``)}function x(){let e=ce()?.getClient?.(),[t,n]=(0,v.useState)([]),[x,ye]=(0,v.useState)([]),[S,C]=(0,v.useState)(!0),[w,T]=(0,v.useState)(null),[be,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(!1),[xe,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),[I,L]=(0,v.useState)(``),[R,z]=(0,v.useState)(`thank-you`),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(``),[K,q]=(0,v.useState)(null),[J,Y]=(0,v.useState)(!1),X=async()=>{if(!e?.meta?.getItems){T(`meta.getItems is not available on this client`),C(!1);return}C(!0),T(null);try{let t=await e.meta.getItems(`view`),r=Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[],i=[],a=[];for(let e of r){let t=e?.spec??e;if(!(t?.sections||t?.groups||t?.form||t?.type===`simple`||t?.type===`tabbed`||t?.type===`wizard`||t?.viewType===`form`))continue;let n=t?.sharing,r=n?.publicLink,o=ve(r);n?.allowAnonymous&&o&&r?i.push({name:t?.name??e?.name,label:t?.label,object:t?.object,slug:o,publicLink:r,updatedAt:e?.updatedAt??e?.updated_at,spec:t}):a.push({name:t?.name??e?.name,label:t?.label,object:t?.object,spec:t})}n(i),ye(a)}catch(e){T(e?.message??String(e))}finally{C(!1)}};(0,v.useEffect)(()=>{X()},[]);let Se=typeof window<`u`?window.location.origin:``,Z=e=>`${Se}/console/f/${e}`,Ce=e=>`<iframe src="${Z(e)}" width="100%" height="640" frameborder="0" style="border:0;"></iframe>`,we=e=>`<iframe\n src={\`${Z(e)}\`}\n title="Public form"\n style={{ width: '100%', height: 640, border: 0 }}\n/>`,Q=async(e,t)=>{try{await navigator.clipboard.writeText(t),_.success(`Copied ${e}`)}catch{_.error(`Clipboard unavailable`)}},Te=async()=>{if(!D||!k)return;let t=x.find(e=>e.name===D);if(!t)return;let n=b(k);if(!n){_.error(`Invalid slug`);return}let r={...t.spec,sharing:{...t.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${n}`}};M(!0);try{await e.meta.saveItem(`view`,t.name,r),_.success(`Published ${t.name}`),E(!1),O(``),A(``),await X()}catch(e){_.error(`Publish failed: ${e?.message??e}`)}finally{M(!1)}},Ee=e=>{F(e),L(e.slug);let t=e.spec?.submitBehavior,n=t?.kind??`thank-you`;z(n),V(t?.title??``),U(t?.message??``),G(t?.url??``),q(null),N(!0)},De=async()=>{if(!P)return;let t=b(I);if(!t){_.error(`Invalid slug`);return}q(null);let n;switch(R){case`thank-you`:n={kind:`thank-you`},B&&(n.title=B),H&&(n.message=H);break;case`redirect`:{let e=_e(W);if(!e.ok){q(e.refusal);return}n={kind:`redirect`,url:e.url};break}case`continue`:case`next-record`:n={kind:R}}let r={...P.spec,sharing:{...P.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${t}`},submitBehavior:n};Y(!0);try{await e.meta.saveItem(`view`,P.name,r),_.success(`Saved ${P.name}`),N(!1),F(null),await X()}catch(e){_.error(`Save failed: ${e?.message??e}`)}finally{Y(!1)}},$=t.length>0;return(0,y.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4 md:p-6 overflow-auto`,children:[(0,y.jsxs)(a,{children:[(0,y.jsxs)(te,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(re,{className:`flex items-center gap-2`,children:[(0,y.jsx)(me,{className:`h-4 w-4`}),`Public Forms`]}),(0,y.jsx)(ee,{children:`Forms anyone can fill out — no login required. Publish a form to get a shareable link; submissions land directly in the bound object.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(g,{variant:`default`,size:`sm`,onClick:()=>E(!0),disabled:x.length===0,title:x.length===0?`No non-public FormViews available`:`Publish a FormView`,children:[(0,y.jsx)(pe,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Publish form…`})]}),(0,y.jsxs)(g,{variant:`outline`,size:`sm`,onClick:X,disabled:S,children:[(0,y.jsx)(he,{className:`h-3.5 w-3.5 ${S?`animate-spin`:``}`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Refresh`})]})]})]}),(0,y.jsxs)(ne,{children:[w&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:w}),!S&&!$&&(0,y.jsxs)(`div`,{className:`rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground`,children:[(0,y.jsx)(`p`,{className:`font-medium text-foreground`,children:`No public forms yet`}),(0,y.jsxs)(`p`,{className:`mt-1`,children:[`Click `,(0,y.jsx)(`strong`,{children:`Publish form…`}),` above to share an existing form, or build a new one in Views & Apps and mark it public.`]})]}),$&&(0,y.jsxs)(se,{children:[(0,y.jsx)(ie,{children:(0,y.jsxs)(m,{children:[(0,y.jsx)(f,{children:`Name`}),(0,y.jsx)(f,{children:`Object`}),(0,y.jsx)(f,{children:`Slug`}),(0,y.jsx)(f,{children:`Public URL`}),(0,y.jsx)(f,{className:`text-right`,children:`Actions`})]})}),(0,y.jsx)(ae,{children:t.map(e=>{let t=Z(e.slug);return(0,y.jsxs)(m,{children:[(0,y.jsx)(h,{children:(0,y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,y.jsx)(`span`,{className:`font-medium`,children:e.label??e.name}),(0,y.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})}),(0,y.jsx)(h,{children:e.object?(0,y.jsx)(oe,{variant:`secondary`,children:e.object}):(0,y.jsx)(i,{})}),(0,y.jsx)(h,{children:(0,y.jsx)(`code`,{className:`text-xs`,children:e.slug})}),(0,y.jsx)(h,{children:(0,y.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-primary underline-offset-2 hover:underline`,children:[t,(0,y.jsx)(de,{className:`h-3 w-3`})]})}),(0,y.jsx)(h,{className:`text-right`,children:(0,y.jsxs)(`div`,{className:`inline-flex gap-1`,children:[(0,y.jsx)(g,{variant:`ghost`,size:`sm`,title:`Copy URL`,onClick:()=>Q(`URL`,t),children:(0,y.jsx)(fe,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(g,{variant:`ghost`,size:`sm`,title:`Copy <iframe> embed`,onClick:()=>Q(`iframe snippet`,Ce(e.slug)),children:(0,y.jsx)(le,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(g,{variant:`ghost`,size:`sm`,title:`Copy React snippet`,onClick:()=>Q(`React snippet`,we(e.slug)),children:(0,y.jsx)(ue,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(g,{variant:`ghost`,size:`sm`,title:`Edit sharing & post-submit behavior`,onClick:()=>Ee(e),children:(0,y.jsx)(ge,{className:`h-3.5 w-3.5`})})]})})]},e.name)})})]})]})]}),(0,y.jsx)(r,{open:be,onOpenChange:E,children:(0,y.jsxs)(p,{className:`sm:max-w-md`,children:[(0,y.jsxs)(u,{children:[(0,y.jsx)(o,{children:`Publish a FormView`}),(0,y.jsxs)(c,{children:[`Pick an existing FormView and turn it into a public form by enabling `,(0,y.jsx)(`code`,{className:`text-xs`,children:`sharing.allowAnonymous`}),` `,`and setting `,(0,y.jsx)(`code`,{className:`text-xs`,children:`publicLink`}),`.`]})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`publish-view`,children:`FormView`}),(0,y.jsxs)(`select`,{id:`publish-view`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:D,onChange:e=>O(e.target.value),children:[(0,y.jsx)(`option`,{value:``,children:`— Select a FormView —`}),x.map(e=>(0,y.jsxs)(`option`,{value:e.name,children:[e.label??e.name,` (`,e.name,`) `,e.object?`· ${e.object}`:``]},e.name))]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`publish-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(s,{id:`publish-slug`,placeholder:`contact-us`,value:k,onChange:e=>A(e.target.value)})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, digits, dashes and underscores only.`})]})]}),(0,y.jsxs)(l,{children:[(0,y.jsx)(g,{variant:`ghost`,onClick:()=>E(!1),disabled:j,children:`Cancel`}),(0,y.jsx)(g,{onClick:Te,disabled:j||!D||!k,children:j?`Publishing…`:`Publish`})]})]})}),(0,y.jsx)(r,{open:xe,onOpenChange:N,children:(0,y.jsxs)(p,{className:`sm:max-w-lg`,children:[(0,y.jsxs)(u,{children:[(0,y.jsx)(o,{children:P?`Edit ${P.label??P.name}`:`Edit form`}),(0,y.jsx)(c,{children:`Configure the public URL and what happens after submit.`})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`edit-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(s,{id:`edit-slug`,value:I,onChange:e=>L(e.target.value)})]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`edit-behavior`,children:`After submit`}),(0,y.jsxs)(`select`,{id:`edit-behavior`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:R,onChange:e=>{z(e.target.value),q(null)},children:[(0,y.jsx)(`option`,{value:`thank-you`,children:`Show a thank-you panel`}),(0,y.jsx)(`option`,{value:`redirect`,children:`Redirect to a URL`}),(0,y.jsx)(`option`,{value:`continue`,children:`Reset for another response`}),(0,y.jsx)(`option`,{value:`next-record`,children:`Advance to next record (internal queues)`})]})]}),R===`thank-you`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`edit-tytitle`,children:`Title`}),(0,y.jsx)(s,{id:`edit-tytitle`,placeholder:`Thanks!`,value:B,onChange:e=>V(e.target.value)})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`edit-tymsg`,children:`Message`}),(0,y.jsx)(s,{id:`edit-tymsg`,placeholder:`Your submission has been received.`,value:H,onChange:e=>U(e.target.value)})]})]}),R===`redirect`&&(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(d,{htmlFor:`edit-url`,children:`Redirect URL`}),(0,y.jsx)(s,{id:`edit-url`,type:`text`,placeholder:`/thanks`,value:W,onChange:e=>{G(e.target.value),q(null)},"aria-invalid":K?!0:void 0,"aria-describedby":K?`edit-url-refusal`:`edit-url-hint`}),K?(0,y.jsx)(`p`,{id:`edit-url-refusal`,role:`alert`,className:`text-xs text-destructive`,children:K}):(0,y.jsxs)(`p`,{id:`edit-url-hint`,className:`text-xs text-muted-foreground`,children:[`An in-app path, starting with `,(0,y.jsx)(`code`,{children:`/`}),` — interpolate a field of the submitted record as `,(0,y.jsx)(`code`,{children:`{{record.field_name}}`}),`. To send the browser out of the app, use an app navigation item instead.`]})]})]}),(0,y.jsxs)(l,{children:[(0,y.jsx)(g,{variant:`ghost`,onClick:()=>N(!1),disabled:J,children:`Cancel`}),(0,y.jsx)(g,{onClick:De,disabled:J||!I,children:J?`Saving…`:`Save`})]})]})})]})}export{x as PublicFormsPage};
|
|
1
|
+
import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t,v as n}from"./vendor-react-BggL7APJ.js";import{$n as r,Fr as i,Gr as a,Hr as o,Ir as s,Mr as c,Nr as l,Pr as u,Ur as ee,Vr as te,Wr as ne,Yn as d,an as f,bi as p,ii as re,in as m,jr as h,jt as ie,nn as ae,on as oe,rn as se,sn as g}from"./ui-components-D8wcRNrt.js";import{W as ce}from"./framework-CAuH4h0L.js";import{r as _}from"./vendor-ui-utils-DIUdEYii.js";import{t as le}from"./vendor-icon-code-xml-C9EWHSC8.js";import{t as ue}from"./vendor-icon-copy-B5M-KdZo.js";import{t as de}from"./vendor-icon-external-link-SBKz5x6R.js";import{t as fe}from"./vendor-icon-link-2-EAo0juhN.js";import{t as pe}from"./vendor-icon-plus-BlfcDDsa.js";import{t as me}from"./vendor-icon-rectangle-ellipsis-CAvWLjnI.js";import{t as he}from"./vendor-icon-refresh-cw-BGjSPEfJ.js";import{t as ge}from"./vendor-icon-settings-2-BHIWdy1J.js";import"./src-ZxH3AOCu.js";import{t as _e}from"./submitRedirect-iy0oOi7I.js";var v=e(n(),1),y=t();function ve(e){return e?e.replace(/^\/+/,``).match(/^forms\/([^/?#]+)/i)?.[1]??null:null}function b(e){return e.trim().toLowerCase().replace(/[^a-z0-9-_]+/g,`-`).replace(/^-+|-+$/g,``)}function x(){let e=ce()?.getClient?.(),[t,n]=(0,v.useState)([]),[x,ye]=(0,v.useState)([]),[S,C]=(0,v.useState)(!0),[w,T]=(0,v.useState)(null),[be,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(!1),[xe,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),[I,L]=(0,v.useState)(``),[R,z]=(0,v.useState)(`thank-you`),[B,V]=(0,v.useState)(``),[H,U]=(0,v.useState)(``),[W,G]=(0,v.useState)(``),[K,q]=(0,v.useState)(null),[J,Y]=(0,v.useState)(!1),X=async()=>{if(!e?.meta?.getItems){T(`meta.getItems is not available on this client`),C(!1);return}C(!0),T(null);try{let t=await e.meta.getItems(`view`),r=Array.isArray(t)?t:Array.isArray(t?.items)?t.items:[],i=[],a=[];for(let e of r){let t=e?.spec??e;if(!(t?.sections||t?.groups||t?.form||t?.type===`simple`||t?.type===`tabbed`||t?.type===`wizard`||t?.viewType===`form`))continue;let n=t?.sharing,r=n?.publicLink,o=ve(r);n?.allowAnonymous&&o&&r?i.push({name:t?.name??e?.name,label:t?.label,object:t?.object,slug:o,publicLink:r,updatedAt:e?.updatedAt??e?.updated_at,spec:t}):a.push({name:t?.name??e?.name,label:t?.label,object:t?.object,spec:t})}n(i),ye(a)}catch(e){T(e?.message??String(e))}finally{C(!1)}};(0,v.useEffect)(()=>{X()},[]);let Se=typeof window<`u`?window.location.origin:``,Z=e=>`${Se}/console/f/${e}`,Ce=e=>`<iframe src="${Z(e)}" width="100%" height="640" frameborder="0" style="border:0;"></iframe>`,we=e=>`<iframe\n src={\`${Z(e)}\`}\n title="Public form"\n style={{ width: '100%', height: 640, border: 0 }}\n/>`,Q=async(e,t)=>{try{await navigator.clipboard.writeText(t),_.success(`Copied ${e}`)}catch{_.error(`Clipboard unavailable`)}},Te=async()=>{if(!D||!k)return;let t=x.find(e=>e.name===D);if(!t)return;let n=b(k);if(!n){_.error(`Invalid slug`);return}let r={...t.spec,sharing:{...t.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${n}`}};M(!0);try{await e.meta.saveItem(`view`,t.name,r),_.success(`Published ${t.name}`),E(!1),O(``),A(``),await X()}catch(e){_.error(`Publish failed: ${e?.message??e}`)}finally{M(!1)}},Ee=e=>{F(e),L(e.slug);let t=e.spec?.submitBehavior,n=t?.kind??`thank-you`;z(n),V(t?.title??``),U(t?.message??``),G(t?.url??``),q(null),N(!0)},De=async()=>{if(!P)return;let t=b(I);if(!t){_.error(`Invalid slug`);return}q(null);let n;switch(R){case`thank-you`:n={kind:`thank-you`},B&&(n.title=B),H&&(n.message=H);break;case`redirect`:{let e=_e(W);if(!e.ok){q(e.refusal);return}n={kind:`redirect`,url:e.url};break}case`continue`:case`next-record`:n={kind:R}}let r={...P.spec,sharing:{...P.spec.sharing??{},enabled:!0,allowAnonymous:!0,publicLink:`/forms/${t}`},submitBehavior:n};Y(!0);try{await e.meta.saveItem(`view`,P.name,r),_.success(`Saved ${P.name}`),N(!1),F(null),await X()}catch(e){_.error(`Save failed: ${e?.message??e}`)}finally{Y(!1)}},$=t.length>0;return(0,y.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4 md:p-6 overflow-auto`,children:[(0,y.jsxs)(te,{children:[(0,y.jsxs)(ne,{className:`flex flex-row items-start justify-between gap-4 space-y-0`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsxs)(a,{className:`flex items-center gap-2`,children:[(0,y.jsx)(me,{className:`h-4 w-4`}),`Public Forms`]}),(0,y.jsx)(ee,{children:`Forms anyone can fill out — no login required. Publish a form to get a shareable link; submissions land directly in the bound object.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsxs)(p,{variant:`default`,size:`sm`,onClick:()=>E(!0),disabled:x.length===0,title:x.length===0?`No non-public FormViews available`:`Publish a FormView`,children:[(0,y.jsx)(pe,{className:`h-3.5 w-3.5`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Publish form…`})]}),(0,y.jsxs)(p,{variant:`outline`,size:`sm`,onClick:X,disabled:S,children:[(0,y.jsx)(he,{className:`h-3.5 w-3.5 ${S?`animate-spin`:``}`}),(0,y.jsx)(`span`,{className:`ml-1.5`,children:`Refresh`})]})]})]}),(0,y.jsxs)(o,{children:[w&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/10 p-3 text-sm text-destructive`,children:w}),!S&&!$&&(0,y.jsxs)(`div`,{className:`rounded-md border border-dashed p-6 text-center text-sm text-muted-foreground`,children:[(0,y.jsx)(`p`,{className:`font-medium text-foreground`,children:`No public forms yet`}),(0,y.jsxs)(`p`,{className:`mt-1`,children:[`Click `,(0,y.jsx)(`strong`,{children:`Publish form…`}),` above to share an existing form, or build a new one in Views & Apps and mark it public.`]})]}),$&&(0,y.jsxs)(ae,{children:[(0,y.jsx)(oe,{children:(0,y.jsxs)(g,{children:[(0,y.jsx)(f,{children:`Name`}),(0,y.jsx)(f,{children:`Object`}),(0,y.jsx)(f,{children:`Slug`}),(0,y.jsx)(f,{children:`Public URL`}),(0,y.jsx)(f,{className:`text-right`,children:`Actions`})]})}),(0,y.jsx)(se,{children:t.map(e=>{let t=Z(e.slug);return(0,y.jsxs)(g,{children:[(0,y.jsx)(m,{children:(0,y.jsxs)(`div`,{className:`flex flex-col`,children:[(0,y.jsx)(`span`,{className:`font-medium`,children:e.label??e.name}),(0,y.jsx)(`code`,{className:`text-xs text-muted-foreground`,children:e.name})]})}),(0,y.jsx)(m,{children:e.object?(0,y.jsx)(re,{variant:`secondary`,children:e.object}):(0,y.jsx)(ie,{})}),(0,y.jsx)(m,{children:(0,y.jsx)(`code`,{className:`text-xs`,children:e.slug})}),(0,y.jsx)(m,{children:(0,y.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-xs text-primary underline-offset-2 hover:underline`,children:[t,(0,y.jsx)(de,{className:`h-3 w-3`})]})}),(0,y.jsx)(m,{className:`text-right`,children:(0,y.jsxs)(`div`,{className:`inline-flex gap-1`,children:[(0,y.jsx)(p,{variant:`ghost`,size:`sm`,title:`Copy URL`,onClick:()=>Q(`URL`,t),children:(0,y.jsx)(fe,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(p,{variant:`ghost`,size:`sm`,title:`Copy <iframe> embed`,onClick:()=>Q(`iframe snippet`,Ce(e.slug)),children:(0,y.jsx)(le,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(p,{variant:`ghost`,size:`sm`,title:`Copy React snippet`,onClick:()=>Q(`React snippet`,we(e.slug)),children:(0,y.jsx)(ue,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(p,{variant:`ghost`,size:`sm`,title:`Edit sharing & post-submit behavior`,onClick:()=>Ee(e),children:(0,y.jsx)(ge,{className:`h-3.5 w-3.5`})})]})})]},e.name)})})]})]})]}),(0,y.jsx)(h,{open:be,onOpenChange:E,children:(0,y.jsxs)(c,{className:`sm:max-w-md`,children:[(0,y.jsxs)(i,{children:[(0,y.jsx)(s,{children:`Publish a FormView`}),(0,y.jsxs)(l,{children:[`Pick an existing FormView and turn it into a public form by enabling `,(0,y.jsx)(`code`,{className:`text-xs`,children:`sharing.allowAnonymous`}),` `,`and setting `,(0,y.jsx)(`code`,{className:`text-xs`,children:`publicLink`}),`.`]})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`publish-view`,children:`FormView`}),(0,y.jsxs)(`select`,{id:`publish-view`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:D,onChange:e=>O(e.target.value),children:[(0,y.jsx)(`option`,{value:``,children:`— Select a FormView —`}),x.map(e=>(0,y.jsxs)(`option`,{value:e.name,children:[e.label??e.name,` (`,e.name,`) `,e.object?`· ${e.object}`:``]},e.name))]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`publish-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(d,{id:`publish-slug`,placeholder:`contact-us`,value:k,onChange:e=>A(e.target.value)})]}),(0,y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Lowercase letters, digits, dashes and underscores only.`})]})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(p,{variant:`ghost`,onClick:()=>E(!1),disabled:j,children:`Cancel`}),(0,y.jsx)(p,{onClick:Te,disabled:j||!D||!k,children:j?`Publishing…`:`Publish`})]})]})}),(0,y.jsx)(h,{open:xe,onOpenChange:N,children:(0,y.jsxs)(c,{className:`sm:max-w-lg`,children:[(0,y.jsxs)(i,{children:[(0,y.jsx)(s,{children:P?`Edit ${P.label??P.name}`:`Edit form`}),(0,y.jsx)(l,{children:`Configure the public URL and what happens after submit.`})]}),(0,y.jsxs)(`div`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`edit-slug`,children:`URL slug`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs text-muted-foreground whitespace-nowrap`,children:`/console/f/`}),(0,y.jsx)(d,{id:`edit-slug`,value:I,onChange:e=>L(e.target.value)})]})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`edit-behavior`,children:`After submit`}),(0,y.jsxs)(`select`,{id:`edit-behavior`,className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm`,value:R,onChange:e=>{z(e.target.value),q(null)},children:[(0,y.jsx)(`option`,{value:`thank-you`,children:`Show a thank-you panel`}),(0,y.jsx)(`option`,{value:`redirect`,children:`Redirect to a URL`}),(0,y.jsx)(`option`,{value:`continue`,children:`Reset for another response`}),(0,y.jsx)(`option`,{value:`next-record`,children:`Advance to next record (internal queues)`})]})]}),R===`thank-you`&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`edit-tytitle`,children:`Title`}),(0,y.jsx)(d,{id:`edit-tytitle`,placeholder:`Thanks!`,value:B,onChange:e=>V(e.target.value)})]}),(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`edit-tymsg`,children:`Message`}),(0,y.jsx)(d,{id:`edit-tymsg`,placeholder:`Your submission has been received.`,value:H,onChange:e=>U(e.target.value)})]})]}),R===`redirect`&&(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(r,{htmlFor:`edit-url`,children:`Redirect URL`}),(0,y.jsx)(d,{id:`edit-url`,type:`text`,placeholder:`/thanks`,value:W,onChange:e=>{G(e.target.value),q(null)},"aria-invalid":K?!0:void 0,"aria-describedby":K?`edit-url-refusal`:`edit-url-hint`}),K?(0,y.jsx)(`p`,{id:`edit-url-refusal`,role:`alert`,className:`text-xs text-destructive`,children:K}):(0,y.jsxs)(`p`,{id:`edit-url-hint`,className:`text-xs text-muted-foreground`,children:[`An in-app path, starting with `,(0,y.jsx)(`code`,{children:`/`}),` — interpolate a field of the submitted record as `,(0,y.jsx)(`code`,{children:`{{record.field_name}}`}),`. To send the browser out of the app, use an app navigation item instead.`]})]})]}),(0,y.jsxs)(u,{children:[(0,y.jsx)(p,{variant:`ghost`,onClick:()=>N(!1),disabled:J,children:`Cancel`}),(0,y.jsx)(p,{onClick:De,disabled:J||!I,children:J?`Saving…`:`Save`})]})]})})]})}export{x as PublicFormsPage};
|