@abtnode/webapp 1.16.45-beta-20250618-073451-6e48fb62 → 1.16.45-beta-20250624-134945-a23c15fc
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/blocklet.js +1 -1
- package/blocklet.yml +1 -1
- package/dist/assets/{AdapterDayjs-Cf6af3xk.js → AdapterDayjs-cf9EXlHB.js} +1 -1
- package/dist/assets/{Add-BFsFN1Gy.js → Add-ClzfE4cH.js} +1 -1
- package/dist/assets/{ArrowDropDown-CejcJzkX.js → ArrowDropDown-CJ2MJgn5.js} +1 -1
- package/dist/assets/{Autocomplete-PeF181FR.js → Autocomplete-CayznxGz.js} +1 -1
- package/dist/assets/{Breadcrumbs-B6YSRzTf.js → Breadcrumbs-C9QQGBOd.js} +1 -1
- package/dist/assets/{ButtonGroup-BzAT8pGA.js → ButtonGroup-B3J8Qdyl.js} +1 -1
- package/dist/assets/{CSSTransition-Byi2ne4y.js → CSSTransition-Cz8SmnJv.js} +1 -1
- package/dist/assets/{CallMerge-CaTZFXVq.js → CallMerge-B6RVJ3nX.js} +1 -1
- package/dist/assets/{CardContent-Dk0Md6L4.js → CardContent-Cg4RjHpv.js} +1 -1
- package/dist/assets/{ChevronLeft-CDs40tmH.js → ChevronLeft-BNmKlc1J.js} +1 -1
- package/dist/assets/{ChevronRight-CFfmouwT.js → ChevronRight-DRPUyxAK.js} +1 -1
- package/dist/assets/{Clear-CmPKgcDo.js → Clear-C1AC1AtD.js} +1 -1
- package/dist/assets/{Close-C8GsrnLa.js → Close-DRWGcKKl.js} +1 -1
- package/dist/assets/{Community-D1NMDj2P.js → Community-BPBk9hGT.js} +1 -1
- package/dist/assets/{Delete-CiU1bEBu.js → Delete-CcdfJXTL.js} +1 -1
- package/dist/assets/{DeleteOutline-reI_idEa.js → DeleteOutline-US18RBQ-.js} +1 -1
- package/dist/assets/{Done-BFMi5HXU.js → Done-DoaEDHCG.js} +1 -1
- package/dist/assets/{Edit-BvogU5l2.js → Edit-CJQK4atN.js} +1 -1
- package/dist/assets/{ErrorOutline-CLZmnhnI.js → ErrorOutline-CR7yRjZc.js} +1 -1
- package/dist/assets/{HelpOutline-hZN36iob.js → HelpOutline-DIMDDIpO.js} +1 -1
- package/dist/assets/{Holiday-CVr2LMMz.js → Holiday-DwuuABxa.js} +1 -1
- package/dist/assets/{Launch-BVKqak_-.js → Launch-CSu1nrjk.js} +1 -1
- package/dist/assets/{Link-C4o8Tfyg.js → Link-CBIXUB_y.js} +1 -1
- package/dist/assets/{ListItemButton-D2V2qgeT.js → ListItemButton-FKXnIc0i.js} +1 -1
- package/dist/assets/{ListSubheader-BSK-B-Hs.js → ListSubheader-Cawr8223.js} +1 -1
- package/dist/assets/{LoadingButton-VMcNYQ8q.js → LoadingButton-CRKt-OT1.js} +1 -1
- package/dist/assets/{LockIcon-C58tNgx9.js → LockIcon-CnYrREef.js} +1 -1
- package/dist/assets/{Meeting-ocx742Wk.js → Meeting-COxcunCf.js} +1 -1
- package/dist/assets/{MoreHoriz-CPdB-acW.js → MoreHoriz-JIt9gEw_.js} +1 -1
- package/dist/assets/{MoreVert-BZT8paNd.js → MoreVert-CjjkmApl.js} +1 -1
- package/dist/assets/{OffSick-a8D-sUdt.js → OffSick-Dlf0wRCP.js} +1 -1
- package/dist/assets/{OpenInNew-DJsi1NWq.js → OpenInNew-D-RnzHyt.js} +1 -1
- package/dist/assets/{Public-DSbGTo8s.js → Public-DQrPVGw9.js} +1 -1
- package/dist/assets/{Refresh-BK_aBn8t.js → Refresh-g_ze8RC-.js} +1 -1
- package/dist/assets/{SchemaReference.es-BYITplvj.js → SchemaReference.es-Bs4TGph_.js} +1 -1
- package/dist/assets/{Search-DGRuo7t-.js → Search-DmfQzntI.js} +1 -1
- package/dist/assets/{Slider-CS-gjd3v.js → Slider-C7KUHAl4.js} +1 -1
- package/dist/assets/{Stepper-ZCO4EB3o.js → Stepper-ECw_WCHI.js} +1 -1
- package/dist/assets/{Switch-CG3jQlg3.js → Switch-D1aSf0Rk.js} +1 -1
- package/dist/assets/{TableRow-Cyof88VP.js → TableRow-CL8yhyVQ.js} +1 -1
- package/dist/assets/{TableSearch-CxutcmoF.js → TableSearch-CxUE73Wm.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-Dldk8U9s.js → ToggleButtonGroup-BADZ1hmi.js} +1 -1
- package/dist/assets/{Verified-DVQjMky2.js → Verified-CoaucJDJ.js} +1 -1
- package/dist/assets/{VerifiedUser-350MitWy.js → VerifiedUser-CGiTKpYb.js} +1 -1
- package/dist/assets/{ViewColumn-BSxTQVZ-.js → ViewColumn-DVO6c2uh.js} +1 -1
- package/dist/assets/{ViewList-BEu0UPsS.js → ViewList-CaLfZh_J.js} +1 -1
- package/dist/assets/{WorkingRemotely-BEw6X98n.js → WorkingRemotely-CIlCJe_n.js} +1 -1
- package/dist/assets/{_createAggregator-Djv2-ovu.js → _createAggregator-DKh4oPcE.js} +1 -1
- package/dist/assets/{actions-LyrEo_Cb.js → actions-D0cYymRM.js} +1 -1
- package/dist/assets/{actions-DNqu-9QQ.js → actions-DMblPsrA.js} +1 -1
- package/dist/assets/{agreement-Cc4wdZqi.js → agreement-CmpcKfmG.js} +1 -1
- package/dist/assets/api-D8CXYVbD.js +1 -0
- package/dist/assets/{appearance-BkddHlmf.js → appearance-CC06pu2W.js} +1 -1
- package/dist/assets/ar-BN95HEFs.js +7 -0
- package/dist/assets/{audit-logs-EkgBhSvA.js → audit-logs-D9nHuKQm.js} +1 -1
- package/dist/assets/{base-chart-C63mtC4Z.js → base-chart-DHzZnb2L.js} +1 -1
- package/dist/assets/{blocklet-BzkaFDNW.js → blocklet-C56CLqfn.js} +1 -1
- package/dist/assets/{brace-fold.es-CyCMNzH4.js → brace-fold.es-WYquVZ0Q.js} +1 -1
- package/dist/assets/{chain-DJhIX7OW.js → chain-DKfcWWlC.js} +1 -1
- package/dist/assets/{click-to-copy-CYaDSQoy.js → click-to-copy-CiS9u8Lz.js} +1 -1
- package/dist/assets/cloneDeep-fDhnQcTQ.js +1 -0
- package/dist/assets/{closebrackets.es-DvIy3kAL.js → closebrackets.es-BTFbO_zS.js} +1 -1
- package/dist/assets/{codemirror.es-BtJVhvPq.js → codemirror.es-bTfvwT0x.js} +1 -1
- package/dist/assets/{collapse-BhbkfN99.js → collapse-De1M4hZU.js} +1 -1
- package/dist/assets/{comment.es-BWJma_ss.js → comment.es-CfIJpCF-.js} +1 -1
- package/dist/assets/{config-navigation-DfmuKS6F.js → config-navigation-NKWvqO8O.js} +3 -3
- package/dist/assets/{connect-to-CorUs381.js → connect-to-B4CwZqBJ.js} +1 -1
- package/dist/assets/de-BmXl3Jnb.js +7 -0
- package/dist/assets/{delete-confirm-D2071wW2.js → delete-confirm-Ca6B5KxO.js} +1 -1
- package/dist/assets/{detail-BgptcQe2.js → detail-B0kwpZJg.js} +3 -3
- package/dist/assets/{dialog.es-DNRuZxpL.js → dialog.es-b4YsH3yO.js} +1 -1
- package/dist/assets/{domains-Dw6WVrfK.js → domains-DfM0llnu.js} +1 -1
- package/dist/assets/{download-mU0RETFZ.js → download-D2RXPhXc.js} +1 -1
- package/dist/assets/emotion-react.browser.esm-CyqIkV2y.js +1 -0
- package/dist/assets/es-C0fHeuzj.js +9 -0
- package/dist/assets/{foldgutter.es-BfaddajE.js → foldgutter.es-Bmzc1lAn.js} +1 -1
- package/dist/assets/fr-CO0NFjy0.js +7 -0
- package/dist/assets/{get-safe-url-COP_ZxQz.js → get-safe-url-Dsy-huUv.js} +1 -1
- package/dist/assets/{get-safe-url-DS1bGOO2.js → get-safe-url-DuYpuHQJ.js} +1 -1
- package/dist/assets/getValidReactChildren-BhCPp8PX.js +1 -0
- package/dist/assets/hi-Cms3dwY-.js +5 -0
- package/dist/assets/{hint.es-DhVyUt1d.js → hint.es-D3enHBIe.js} +1 -1
- package/dist/assets/{hint.es2-uDqXrloM.js → hint.es2-D_8pEhNZ.js} +1 -1
- package/dist/assets/id-Bo8dj7EE.js +7 -0
- package/dist/assets/{iframe-D-LcA3MK.js → iframe-JzwQis4I.js} +1 -1
- package/dist/assets/{index-CdU6oLkY.js → index--aogETCe.js} +1 -1
- package/dist/assets/{index-DOsDgrew.js → index-1fDaH0GR.js} +3 -3
- package/dist/assets/{index-oBJqRsld.js → index-8TfE60DJ.js} +1 -1
- package/dist/assets/{index-qfTOhIhQ.js → index-B8Ac-C82.js} +1 -1
- package/dist/assets/{index-C0dOEsU4.js → index-BOaWHm3y.js} +1 -1
- package/dist/assets/{index-B0UMNJnN.js → index-BR_N19sK.js} +1 -1
- package/dist/assets/{index-BhAPLn1b.js → index-BVHtC5Hk.js} +1 -1
- package/dist/assets/{index-DbTX57bM.js → index-BcLnPbZ_.js} +1 -1
- package/dist/assets/index-Bmgy-F8w.js +550 -0
- package/dist/assets/{index-CeNoqA4g.js → index-Bp85PVE7.js} +1 -1
- package/dist/assets/{index-DU-OQYbG.js → index-Br9fC4wn.js} +1 -1
- package/dist/assets/{index-B8IA5mbU.js → index-BsTEuRio.js} +6 -6
- package/dist/assets/{index-QU1qCf8F.js → index-Bv0UYgtN.js} +1 -1
- package/dist/assets/{index-B-SlNWYL.js → index-BwtBZueg.js} +1 -1
- package/dist/assets/{index-CZ5-hnEn.js → index-C-gpDEaK.js} +1 -1
- package/dist/assets/{index-BIgkt_q9.js → index-C-wwh49Y.js} +1 -1
- package/dist/assets/{index-BZMWcUCX.js → index-C40_ZUH_.js} +1 -1
- package/dist/assets/{index-Cb3Huyfb.js → index-CEkzM2Hy.js} +1 -1
- package/dist/assets/{index-DUIS5TWY.js → index-CEwaV1Oe.js} +1 -1
- package/dist/assets/{index-oc5ucOuy.js → index-CHr_TiKg.js} +1 -1
- package/dist/assets/{index-DVrUurys.js → index-CPkjKWDT.js} +1 -1
- package/dist/assets/{index-C9oR1oH6.js → index-CUf9smnR.js} +1 -1
- package/dist/assets/{index-czhxiIDF.js → index-CbpkZm_D.js} +1 -1
- package/dist/assets/{index-BcbNijWK.js → index-Ci6qo3N4.js} +1 -1
- package/dist/assets/{index-CCINW9gm.js → index-CuCDUbks.js} +3 -3
- package/dist/assets/{index-C9buY914.js → index-D651LXXD.js} +1 -1
- package/dist/assets/{index-CFkoE5Gw.js → index-DJfwuANq.js} +1 -1
- package/dist/assets/{index-C5ZlPR3p.js → index-DPPR0A8j.js} +5 -5
- package/dist/assets/{index-Cy666DOY.js → index-DdKwcnDa.js} +1 -1
- package/dist/assets/{index-P1DlwKGv.js → index-Diry1rOC.js} +1 -1
- package/dist/assets/{index-fHnSssqp.js → index-DmqHgbIB.js} +1 -1
- package/dist/assets/index-DqZUR6e0.js +120 -0
- package/dist/assets/index-DtQb3yWv.js +1 -0
- package/dist/assets/{index-rZ1SBrH_.js → index-DuyB74pI.js} +1 -1
- package/dist/assets/{index-zsz18EZU.js → index-Dy6Ndspk.js} +1 -1
- package/dist/assets/{index-4aFZazff.js → index-DzIW7WPn.js} +1 -1
- package/dist/assets/{index-BRvaeUvs.js → index-QAr8nKeC.js} +3 -3
- package/dist/assets/{index-BblGFvvF.js → index-Xeh4Hy1K.js} +1 -1
- package/dist/assets/{index-BJQjXoNM.js → index-YHRJ5Z9D.js} +1 -1
- package/dist/assets/{index-LcQ1y9fq.js → index-f3wryxsZ.js} +1 -1
- package/dist/assets/{index-5OOYkflw.js → index-hpqdONWL.js} +1 -1
- package/dist/assets/{index-CW7SH6ZA.js → index-mJjX2o0I.js} +1 -1
- package/dist/assets/{index-CHPEHw0Y.js → index-mWC0dxsG.js} +1 -1
- package/dist/assets/{index-BOH-YtOs.js → index-p0Tn5q9W.js} +1 -1
- package/dist/assets/{index-BkRO05--.js → index-pLwCyBIW.js} +1 -1
- package/dist/assets/{index-D6ARqm6f.js → index-qPfSbb8F.js} +1 -1
- package/dist/assets/{index-DNITJyFR.js → index-uhXfBcTY.js} +1 -1
- package/dist/assets/{index.esm-F8b32K2k.js → index.esm-BeKnx9US.js} +1 -1
- package/dist/assets/{info-addon.es-CPDzNYQ-.js → info-addon.es-DcDBZCZ9.js} +1 -1
- package/dist/assets/{info.es-B-z85utp.js → info.es-CMDl0oHG.js} +1 -1
- package/dist/assets/{install-from-url-BNqF6NV-.js → install-from-url-T6jdS-sd.js} +1 -1
- package/dist/assets/{invitation-qmFlHZV_.js → invitation-BQpAoUra.js} +1 -1
- package/dist/assets/is-path-prefix-equal-DAINokq6.js +1 -0
- package/dist/assets/{item-DuGkpxdL.js → item-zzpJhUAv.js} +1 -1
- package/dist/assets/ja-zaAhH8mE.js +9 -0
- package/dist/assets/{javascript.es-DwEw3iuE.js → javascript.es-rVaecCeY.js} +1 -1
- package/dist/assets/{jump-to-line.es-BaO-Qct6.js → jump-to-line.es-fZd9SPeK.js} +1 -1
- package/dist/assets/{jump.es-DEVhkMqg.js → jump.es-C2i0yVn0.js} +1 -1
- package/dist/assets/ko-CoZQ7a7T.js +9 -0
- package/dist/assets/{lint.es-DNf7-y3f.js → lint.es-T7Eyo8Ee.js} +1 -1
- package/dist/assets/{lint.es2-CkGacl6V.js → lint.es2-D9w-DqTv.js} +1 -1
- package/dist/assets/{lint.es3-ddr9rdgz.js → lint.es3-BR3fJTRU.js} +1 -1
- package/dist/assets/{list-header-DL9A5VcR.js → list-header-BHP30ooa.js} +1 -1
- package/dist/assets/{log-JH4lXNVE.js → log-BPS1ovHk.js} +1 -1
- package/dist/assets/{lottie-react.esm-Dr-WheMr.js → lottie-react.esm-BHwF6ttF.js} +1 -1
- package/dist/assets/{matchbrackets.es-XuVMbpLz.js → matchbrackets.es-B45wj5E9.js} +1 -1
- package/dist/assets/{memory-C_p3X92I.js → memory-CNHjW2ab.js} +1 -1
- package/dist/assets/{metric-CB_GPXBA.js → metric-BcRet1lX.js} +1 -1
- package/dist/assets/{mode.es-Dqrxjy1v.js → mode.es-BLJK3yl5.js} +1 -1
- package/dist/assets/{mode.es2-VNAXkQps.js → mode.es2-hlIytxg7.js} +1 -1
- package/dist/assets/{mode.es3-BN6h3Bus.js → mode.es3-CVTYL_Rp.js} +1 -1
- package/dist/assets/omit-Difyap46.js +1 -0
- package/dist/assets/{onlineParser.es-D4el_PBT.js → onlineParser.es-D7LXCAe9.js} +1 -1
- package/dist/assets/{overview-BXzzQmbs.js → overview-Dl1-aEub.js} +1 -1
- package/dist/assets/{permission-JEjDz9i9.js → permission-syQYMJDU.js} +1 -1
- package/dist/assets/{preference-QWJp9UJS.js → preference-Bjp0l-rP.js} +3 -3
- package/dist/assets/pt-D4wJ-rZD.js +5 -0
- package/dist/assets/{raf-schd.esm-D-4-98oh.js → raf-schd.esm-D4X3rkFT.js} +1 -1
- package/dist/assets/refType-Bi7lNIS6.js +1 -0
- package/dist/assets/{resource-dialog-BSxf3l0v.js → resource-dialog-Bj4Rm8z8.js} +4 -4
- package/dist/assets/ru-CmWrzb7M.js +5 -0
- package/dist/assets/{runtime-DFh8uNkc.js → runtime-DHGpU07w.js} +1 -1
- package/dist/assets/sdk--zV5g1Ng.js +1 -0
- package/dist/assets/{search.es-CvgIaw00.js → search.es-DEh8WYav.js} +1 -1
- package/dist/assets/{searchcursor.es-OCU4Stl-.js → searchcursor.es-BHK3Udfj.js} +1 -1
- package/dist/assets/{service-C2aUE-9d.js → service-BLsXGeBF.js} +1 -1
- package/dist/assets/{shorten-label-DEXH98Sk.js → shorten-label-rkbgI37z.js} +1 -1
- package/dist/assets/{show-hint.es-Ddp99Kzq.js → show-hint.es-TLn5XERt.js} +1 -1
- package/dist/assets/{simple-select-DtUilbs1.js → simple-select-CqR13Ja_.js} +1 -1
- package/dist/assets/{spaces-C01mORkW.js → spaces-DLzKX3Ra.js} +1 -1
- package/dist/assets/{status-DaQfjPiw.js → status-CtyoZCac.js} +1 -1
- package/dist/assets/{status-DwmHBBa8.js → status-CyZk73aw.js} +1 -1
- package/dist/assets/{sublime.es-D01aXBye.js → sublime.es-B7ROfjSt.js} +1 -1
- package/dist/assets/{switch-control-BUF_yGeD.js → switch-control-DRItWC8V.js} +1 -1
- package/dist/assets/{table-icons-C5qrNAvA.js → table-icons-CN1Rmj7L.js} +1 -1
- package/dist/assets/{team-BcbX_cMl.js → team-7oU1sdtL.js} +1 -1
- package/dist/assets/th-DkqBkRH_.js +5 -0
- package/dist/assets/{toLower-GSZ9DJJ3.js → toLower-BetQNSka.js} +1 -1
- package/dist/assets/toUpper-CnLEnHph.js +1 -0
- package/dist/assets/{traffic-CTPgH40k.js → traffic-BXrg_wx7.js} +1 -1
- package/dist/assets/{url-evaluation-DmRIkzYe.js → url-evaluation-PNUzVXFG.js} +1 -1
- package/dist/assets/{url-join-BSWLYThb.js → url-join-BT4uwgMW.js} +1 -1
- package/dist/assets/{use-mobile-DU80Jj4U.js → use-mobile-DaylDy56.js} +1 -1
- package/dist/assets/{use-mobile-DxY5BxAJ.js → use-mobile-zJMHEWPE.js} +1 -1
- package/dist/assets/{useAsync-Ct1xKput.js → useAsync-8QQYXZ2o.js} +1 -1
- package/dist/assets/{useAsyncRetry-Bis_hMS7.js → useAsyncRetry-CGk8Cu9u.js} +1 -1
- package/dist/assets/{useLocalStorage-CRy7LFYG.js → useLocalStorage-DdJoK4w7.js} +1 -1
- package/dist/assets/{useThemeProps-C3mE_-3Z.js → useThemeProps-Rte_NmVE.js} +1 -1
- package/dist/assets/{util-Ctz_J-u1.js → util-DlhHM2MK.js} +1 -1
- package/dist/assets/vi-D4Y0EZ10.js +5 -0
- package/dist/assets/{wait-container-Der-CqPb.js → wait-container-BPSvZhQ4.js} +1 -1
- package/dist/assets/{withStyles-DWhl0Lx-.js → withStyles-D2YScWal.js} +1 -1
- package/dist/assets/{without-wallet-Bmmbgqin.js → without-wallet-CXyXy2KB.js} +1 -1
- package/dist/assets/wrap-locale-kaXbWMUB.js +1 -0
- package/dist/assets/{zh-DJTjvgj8.js → zh-CXbCDXZ8.js} +1 -1
- package/dist/assets/zh-tw-DaTNZcVC.js +9 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +1 -1
- package/dist/assets/api-CSrxJE-w.js +0 -1
- package/dist/assets/ar-DLXKKOGO.js +0 -7
- package/dist/assets/cloneDeep-C6XYSA9m.js +0 -1
- package/dist/assets/de-CnbmrteH.js +0 -7
- package/dist/assets/emotion-react.browser.esm-CSjORkdU.js +0 -1
- package/dist/assets/es-C7oXJBWv.js +0 -9
- package/dist/assets/fr-DzleTcLj.js +0 -7
- package/dist/assets/getValidReactChildren-CxwCdnNW.js +0 -1
- package/dist/assets/hi-B24wH0bs.js +0 -5
- package/dist/assets/id-BIjW1vW9.js +0 -7
- package/dist/assets/index-DCo8_mUx.js +0 -1
- package/dist/assets/index-DrxRISPM.js +0 -120
- package/dist/assets/index-Dyvb9fH4.js +0 -521
- package/dist/assets/is-path-prefix-equal-lgGkNkcR.js +0 -1
- package/dist/assets/ja-mu0bc5Fx.js +0 -9
- package/dist/assets/ko-CSWdQF8q.js +0 -9
- package/dist/assets/omit-Bc4_KMtF.js +0 -1
- package/dist/assets/pt-Odg8daEV.js +0 -5
- package/dist/assets/refType-Dqlqmha-.js +0 -1
- package/dist/assets/ru-OkiNIvy3.js +0 -5
- package/dist/assets/sdk-DtMj7H7_.js +0 -1
- package/dist/assets/th-esLoaeiE.js +0 -5
- package/dist/assets/toUpper-BPMwwnP-.js +0 -1
- package/dist/assets/vi-BF6u6-98.js +0 -5
- package/dist/assets/wrap-locale-rE7v3anU.js +0 -1
- package/dist/assets/zh-tw-B7cFexwg.js +0 -9
|
@@ -0,0 +1,550 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CuCDUbks.js","./index-BsTEuRio.js","./index-Cp6LwWOU.css","./url-join-BT4uwgMW.js","./index-DJfwuANq.js","./_createAggregator-DKh4oPcE.js","./index-Xeh4Hy1K.js","./resource-dialog-Bj4Rm8z8.js","./index-DdKwcnDa.js","./index-BcLnPbZ_.js","./index-qPfSbb8F.js","./use-mobile-DaylDy56.js","./ListItemButton-FKXnIc0i.js","./index-YHRJ5Z9D.js","./emotion-react.browser.esm-CyqIkV2y.js","./index-hpqdONWL.js","./Switch-D1aSf0Rk.js","./index-Dy6Ndspk.js","./TableRow-CL8yhyVQ.js","./useThemeProps-Rte_NmVE.js","./ViewColumn-DVO6c2uh.js","./Search-DmfQzntI.js","./Clear-C1AC1AtD.js","./Delete-CcdfJXTL.js","./MoreVert-CjjkmApl.js","./TableSearch-CxUE73Wm.js","./url-evaluation-PNUzVXFG.js","./index-DmqHgbIB.js","./OpenInNew-D-RnzHyt.js","./index-BJHGOv7L.js","./index-BojVbZw0.js","./HelpOutline-DIMDDIpO.js","./index-BVHtC5Hk.js","./ButtonGroup-B3J8Qdyl.js","./getValidReactChildren-BhCPp8PX.js","./toUpper-CnLEnHph.js","./index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bX as Vo,j as t,f7 as Yo,hP as Ko,l6 as Ho,aQ as ft,aR as ht,m as z,br as X,N as C,aC as Ce,P as s,A as L,am as gt,r as d,e as ve,bF as qe,b as H,J as B,Y as Ft,bE as Ye,t as Z,n as $,Z as ae,l7 as Xo,a5 as ee,a_ as go,k as oe,D as xt,x as He,bC as Zo,F as D,fj as Yn,b9 as Qo,b6 as Jo,gO as er,gP as tr,e3 as nr,C as me,fS as or,w as rr,aA as Kn,v as sr,l8 as ir,l9 as ar,B as pe,la as lr,$ as cr,a0 as dr,lb as xo,bs as yo,V as Se,dH as ur,dU as pr,aE as mr,aF as fr,hw as hr,aG as gr,aI as J,aT as xr,cR as yr,H as Co,bq as Cr,a1 as jr,O as at,aH as jo,b2 as Vt,lc as vr,b3 as je,aD as Hn,cP as br,k4 as Sr,af as Fe,aP as vo,bW as Yt,cA as Rr,g as yt,ld as wr,be as Tr,z as bo,aZ as zt,T as Er,aX as Ve,R as Bt,W as Pr,bG as So,gM as kr,cv as _r,aL as Ir,bx as Ur,aW as Dr,ep as Nr,fY as Xn,le as Zn,hd as Qn,X as Jn,G as lt,cO as Lr,he as Br,bV as Or,k5 as Mr}from"./index-BsTEuRio.js";import{E as $r}from"./index-BcLnPbZ_.js";import{e as Ar,f as qr,g as Fr,u as Kt,a as zr}from"./actions-DMblPsrA.js";import{S as Gr}from"./switch-control-DRItWC8V.js";import{u as fe}from"./blocklet-C56CLqfn.js";import{P as Gt,w as Ct}from"./permission-syQYMJDU.js";import{d as Ro}from"./Edit-CJQK4atN.js";import{T as Wr,M as Vr,t as Yr}from"./table-icons-CN1Rmj7L.js";import{s as Kr,R as dt,F as Hr,L as Xr,d as Zr,B as Qr}from"./preference-Bjp0l-rP.js";import{C as eo}from"./click-to-copy-CiS9u8Lz.js";import{S as Ot}from"./index-BVHtC5Hk.js";import{d as Jr}from"./Add-ClzfE4cH.js";import{d as Ht}from"./Link-CBIXUB_y.js";import{c as es,C as ts,b as ns,s as wo,e as os,j as rs,d as To,a as ss,A as is,B as as,f as ls,S as cs}from"./item-zzpJhUAv.js";import{u as ds,a as us,P as Eo,L as to,A as ps,S as ms}from"./index-CHr_TiKg.js";import{u as fs,C as hs,D as gs,a as xs,b as ys}from"./connect-to-B4CwZqBJ.js";import{C as Cs,u as js,A as vs}from"./agreement-CmpcKfmG.js";import{d as bs}from"./Done-DoaEDHCG.js";import{A as Ss,a as Rs,d as ws,b as Ts}from"./collapse-De1M4hZU.js";import{C as Es,L as Ps}from"./LockIcon-CnYrREef.js";import{I as Po,a as ks,f as _s,B as Is}from"./install-from-url-T6jdS-sd.js";import{a as no}from"./api-D8CXYVbD.js";import{v as ko,e as Us,a as ut}from"./util-DlhHM2MK.js";import{u as _o}from"./use-mobile-zJMHEWPE.js";import{d as Ds}from"./ArrowDropDown-CJ2MJgn5.js";import{_ as Ns}from"./useLocalStorage-DdJoK4w7.js";import{d as jt}from"./Delete-CcdfJXTL.js";import{d as Io}from"./Launch-CSu1nrjk.js";import{D as Ls}from"./delete-confirm-Ca6B5KxO.js";import{W as Ke,R as Bs,a as oo}from"./url-evaluation-PNUzVXFG.js";import{B as Uo}from"./status-CyZk73aw.js";import{A as Do}from"./actions-D0cYymRM.js";import{I as Mt}from"./index-DuyB74pI.js";import{t as Os}from"./toUpper-CnLEnHph.js";import{S as Ms}from"./Switch-D1aSf0Rk.js";import{a as $s}from"./team-7oU1sdtL.js";import"./MoreVert-CjjkmApl.js";import"./get-safe-url-Dsy-huUv.js";import"./ButtonGroup-B3J8Qdyl.js";import"./getValidReactChildren-BhCPp8PX.js";import"./index-hpqdONWL.js";import"./raf-schd.esm-D4X3rkFT.js";import"./index-BR_N19sK.js";import"./ViewColumn-DVO6c2uh.js";import"./CSSTransition-Cz8SmnJv.js";import"./index-DdKwcnDa.js";import"./Clear-C1AC1AtD.js";import"./ChevronRight-DRPUyxAK.js";import"./ChevronLeft-BNmKlc1J.js";import"./Search-DmfQzntI.js";import"./omit-Difyap46.js";import"./index-DJfwuANq.js";import"./index-Xeh4Hy1K.js";import"./iframe-JzwQis4I.js";import"./Autocomplete-CayznxGz.js";import"./ListSubheader-Cawr8223.js";import"./Verified-CoaucJDJ.js";import"./VerifiedUser-CGiTKpYb.js";import"./DeleteOutline-US18RBQ-.js";import"./url-join-BT4uwgMW.js";import"./Close-DRWGcKKl.js";import"./index-DmqHgbIB.js";import"./OpenInNew-D-RnzHyt.js";import"./index-BJHGOv7L.js";import"./index-BojVbZw0.js";import"./HelpOutline-DIMDDIpO.js";import"./spaces-DLzKX3Ra.js";import"./index-Bv0UYgtN.js";import"./cloneDeep-fDhnQcTQ.js";import"./without-wallet-CXyXy2KB.js";import"./ListItemButton-FKXnIc0i.js";import"./Stepper-ECw_WCHI.js";import"./is-path-prefix-equal-DAINokq6.js";import"./MoreHoriz-JIt9gEw_.js";const As=Vo(t.jsx("path",{d:"M14.17 5 19 9.83V19H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V9.83c0-.53-.21-1.04-.59-1.41l-4.83-4.83c-.37-.38-.88-.59-1.41-.59M7 15h10v2H7zm0-4h10v2H7zm0-4h7v2H7z"}),"TextSnippetOutlined");function ro(e,o){var n={};return o=Yo(o),Ko(e,function(a,r,i){Ho(n,r,o(a,r,i))}),n}var Xt={},qs=ht;Object.defineProperty(Xt,"__esModule",{value:!0});var No=Xt.default=void 0,Fs=qs(ft()),zs=t;No=Xt.default=(0,Fs.default)((0,zs.jsx)("path",{d:"M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1-2.73 2.71-2.73 7.08 0 9.79s7.15 2.71 9.88 0C18.32 15.65 19 14.08 19 12.1h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58s9.14-3.47 12.65 0L21 3zM12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8z"}),"Update");var Zt={},Gs=ht;Object.defineProperty(Zt,"__esModule",{value:!0});var Qt=Zt.default=void 0,Ws=Gs(ft()),Vs=t;Qt=Zt.default=(0,Ws.default)((0,Vs.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");function Jt({children:e,...o}){var x;const{t:n}=z(),{api:a}=X(),{blocklet:r}=fe(),i=(x=r==null?void 0:r.settings)==null?void 0:x.autoCheckUpdate,f=async h=>{await a.updateAutoCheckUpdate({input:{did:r.meta.did,autoCheckUpdate:h}})},c=async()=>{try{const h=!(i!=null&&i.enabled);await f({enabled:h}),L.success(n(h?"storage.spaces.autoCheckUpdate.enabled":"storage.spaces.autoCheckUpdate.disabled"))}catch(h){L.error(h.message)}},u=!!(i!=null&&i.enabled);return t.jsxs(C,{display:"flex",flexDirection:"row",alignItems:"center",children:[e,t.jsx(Ce,{title:n("storage.spaces.autoCheckUpdate.title"),arrow:!0,placement:"right",children:t.jsx("div",{children:t.jsx(Gr,{checked:u,onChange:c,name:"enableWelcomePage",style:{...o.style,zoom:.8}})})})]})}Jt.propTypes={children:s.any};Jt.defaultProps={children:null};function so(e){function o({sx:n,...a}){return t.jsx(e,{...a,sx:{color:"text.primary",...n}})}return o}const Ys={...ro(Yr,so),...ro(Ar,so)},Ks=(e,o)=>{let{description:n}=e;return(Object.values(H.CHAIN_PROP_MAP).includes(e.key)||B.isEnvShareable(e))&&(n?n=`${n} (${o("blocklet.config.sharedToAllComponents")})`:n=o("blocklet.config.sharedToAllComponents")),n&&t.jsx("div",{style:{marginLeft:12},children:n})},$t=(e,o,n=[])=>!(n!=null&&n.length)&&!e.custom&&!["CHAIN_ID","CHAIN_HOST"].includes(e.key)&&!o.meta.environments.find(a=>a.name===e.key)&&o.children.every(a=>!a.meta.environments.find(r=>r.name===e.key))?!0:e.custom,io=e=>[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)?!0:!(e.startsWith("BLOCKLET_")||e.startsWith("COMPONENT_")),At=e=>[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(e)===!1;function en({blocklet:e,ancestors:o}){const n=X(),{palette:a}=gt(),{inService:r}=n,{t:i}=d.useContext(ve),f=[...o.map(m=>m.meta.did),e.meta.did],c=()=>L.success(i("blocklet.config.changedTip")),u=m=>$t(m,e,o);if(qe(e.status)||e.status==="unknown"&&qe(e.status))return null;const x=m=>new Promise(async(p,v)=>{if(!m.key.trim()||!m.value.trim()){L.error(i("blocklet.config.environment.keyValueRequired")),v();return}if(io(m.key)===!1){L.error(i("blocklet.config.environment.invalidKey")),v();return}m.custom=At(m.key);try{const R=await n.api.configBlocklet({input:{did:f,configs:[m]}});c(R.blocklet),p()}catch(R){L.error(ae(R)),v()}}),h=(m,p)=>new Promise(async(v,R)=>{if(m.required&&(!m.key.trim()||!m.value.trim())){L.error(i("blocklet.config.environment.keyValueRequired")),R();return}if(io(m.key)===!1){L.error(i("blocklet.config.environment.invalidKey")),R();return}if(m.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE){const N=Xo(m);if(N){L.error(N),R();return}}const j=[{...m,value:m.secure&&m.value==="__encrypted__"?"":m.value}];if(m.key!==p.key){if(!$t(m,e,o)){L.error("Only key of custom env can be changed"),R();return}j.push({key:p.key,custom:At(m.key)})}try{const N=await n.api.configBlocklet({input:{did:f,configs:j}});c(N.blocklet),v()}catch(N){L.error(ae(N)),R()}}),l=m=>new Promise(async(p,v)=>{if(m.required){L.error(i("blocklet.config.environment.deleteForbidden")),v();return}if(!$t(m,e,o)){L.error("Only key of custom env can be changed"),v();return}try{const R=await n.api.configBlocklet({input:{did:f,configs:[{key:m.key,custom:At(m.key)}]}});c(R.blocklet),p()}catch(R){L.error(ae(R)),v()}}),S=(e.configs||[]).filter(m=>!H.BLOCKLET_CONFIGURABLE_KEY[m.key]||[H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_CLUSTER_SIZE].includes(m.key)),y=B.getSharedConfigObj(o[0],e),g=B.getComponentMissingConfigs(e,o[0]),T=S.map(m=>({...m,value:Object.values(H.CHAIN_PROP_MAP).includes(m.key)&&Object.keys(y).includes(m.key)?y[m.key]:y[m.key]||m.value})),w=T.some(m=>m.key&&m.key.startsWith("BWA_")),k={onRowAdd:x,onRowUpdate:h,onRowDelete:l,isDeletable:u},b=()=>[{title:i("common.key"),field:"key",initialEditValue:"",width:"30%",render:m=>t.jsx(eo,{value:m.value,style:{color:m.required&&!m.value?a.error.main:a.text.primary,fontWeight:m.required?"bold":"normal"},children:m.key}),editComponent:m=>{const{value:p,rowData:v,onChange:R}=m;return t.jsx(ao,{children:t.jsx(Z,{fullWidth:!0,size:"small",InputProps:{readOnly:u(v)===!1},value:Kr.escapeTag(p),onChange:j=>R(j.target.value),variant:"outlined",label:"Key",placeholder:i("blocklet.config.environment.key"),margin:"dense",autoFocus:!0})})}},{title:i("common.value"),field:"value",initialEditValue:"",width:"calc((100% - (96px + 30%)) / 1)",render:m=>m.value?m.secure?"******":t.jsx(eo,{unstyled:!0,value:m.value,style:{wordBreak:"break-all"},children:m.value}):null,editComponent:m=>{const{value:p,rowData:v,onChange:R}=m;return t.jsxs(ao,{children:[t.jsx(Z,{fullWidth:!0,size:"small",value:p==="__encrypted__"?"":p,onChange:j=>R(j.target.value),variant:"outlined",label:i("common.value"),placeholder:i("blocklet.config.environment.value"),margin:"dense"}),Ks(v,i)]})}}];return t.jsxs(Hs,{children:[!!g.length&&t.jsx(Ft,{severity:"error",style:{marginTop:24},children:i("blocklet.config.missingRequired")}),w&&t.jsx(Ft,{severity:"info",children:i("blocklet.config.environment.tip")}),t.jsx(Gt,{permission:r?"":"mutate_blocklets",role:r?Ye:[],children:m=>t.jsx(Wr,{className:"config-table",children:t.jsx(Vr,{title:t.jsx(C,{fontWeight:"bold",children:i("common.environments")}),columns:b(),icons:Ys,options:{emptyRowsWhenPaging:!1,actionsColumnIndex:-1,tableLayout:"auto",maxBodyHeight:"100%",paging:!1,search:!1,actionsCellStyle:{padding:"0",textAlign:"right",width:"80px"}},localization:{header:{actions:i("common.actions")},body:{emptyDataSourceMessage:i("common.noData")}},data:T,editable:m?k:{}})})})]})}en.propTypes={blocklet:s.object.isRequired,ancestors:s.array};en.defaultProps={ancestors:[]};const Hs=$.div`
|
|
3
|
+
.config-table {
|
|
4
|
+
margin-bottom: 24px;
|
|
5
|
+
position: relative;
|
|
6
|
+
.hide-control {
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 10px;
|
|
9
|
+
left: 200px;
|
|
10
|
+
@media (max-width: ${e=>e.theme.breakpoints.values.sm}px) {
|
|
11
|
+
left: 160px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.MuiToolbar-root {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.MuiTableRow-head {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&.hide-header {
|
|
24
|
+
.MuiToolbar-root {
|
|
25
|
+
display: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.accordion {
|
|
31
|
+
margin-bottom: 16px;
|
|
32
|
+
&:last-of-type {
|
|
33
|
+
margin-bottom: 0;
|
|
34
|
+
}
|
|
35
|
+
padding: 8px 0 8px 0px;
|
|
36
|
+
&.MuiAccordion-root {
|
|
37
|
+
background: transparent;
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
border: 1px solid #ddd;
|
|
40
|
+
border-radius: 4px;
|
|
41
|
+
&::before,
|
|
42
|
+
&::after {
|
|
43
|
+
height: 0;
|
|
44
|
+
}
|
|
45
|
+
.MuiAccordionSummary-root {
|
|
46
|
+
padding-left: 0;
|
|
47
|
+
}
|
|
48
|
+
.accordion-title {
|
|
49
|
+
font-weight: bold;
|
|
50
|
+
padding-left: 16px;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`,ao=$.div`
|
|
55
|
+
height: 60px;
|
|
56
|
+
`;function vt({open:e,onClose:o,hiddenChildren:n,blocklet:a,ancestors:r,children:i}){const[f,c]=d.useState(!1),{t:u}=z(),x=u("environmentFor",{name:B.getDisplayName(a,!0)});if(qe(a.status)||a.status==="unknown"&&qe(a.status))return null;const h=()=>{o==null||o(),c(!1)},l=y=>{y.stopPropagation(),c(!0)};let S=null;return n||(S=typeof i=="function"?i({open:l}):t.jsx(ee,{onClick:l,"data-cy":"action-config-component",children:t.jsx(Ro,{})})),t.jsxs(t.Fragment,{children:[S,(e||f)&&t.jsx(Xs,{open:!0,fullWidth:!0,maxWidth:"md",title:x,onClose:h,PaperProps:{style:{minHeight:"auto",backgroundImage:"none"}},children:t.jsxs(go,{gap:0,children:[t.jsx(oe,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:u("description.environment",{name:B.getDisplayName(a,!0)})}),t.jsx(en,{blocklet:a,ancestors:r})]})})]})}vt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,children:s.any,open:s.bool,onClose:s.func,hiddenChildren:s.bool};vt.defaultProps={ancestors:[],children:null,open:!1,onClose:null,hiddenChildren:!1};const Xs=$(xt)`
|
|
57
|
+
.MuiDialogContent-root {
|
|
58
|
+
padding-top: 0;
|
|
59
|
+
padding-bottom: 24px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.MuiToolbar-root {
|
|
63
|
+
padding-right: 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.ux-dialog_closeButton {
|
|
67
|
+
margin: 0;
|
|
68
|
+
}
|
|
69
|
+
`;var tn={},Zs=ht;Object.defineProperty(tn,"__esModule",{value:!0});var Lo=tn.default=void 0,Qs=Zs(ft()),Js=t;Lo=tn.default=(0,Qs.default)((0,Js.jsx)("path",{d:"M5 20h14v-2H5zm0-10h4v6h6v-6h4l-7-7z"}),"Upload");const ei=d.lazy(()=>Zo(()=>import("./index-CuCDUbks.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url).then(e=>({default:e.Uploader}))),ti="/blocklet/component/upload",lo=[".html",".htm",".tgz",".zip"];var ho;const ni=Number((ho=window.env)==null?void 0:ho.MAX_UPLOAD_FILE_SIZE)||D.MAX_UPLOAD_FILE_SIZE,oi=ni*1024*1024;function nn({did:e,prefix:o,headers:n,onUploaded:a,open:r,onClose:i}){const{t:f,locale:c}=z(),u=d.useRef(null),x=d.useCallback(h=>{const{status:l,data:S}=h;if(l===200){a(S);return}L.error(f("blocklet.component.addComponentTip.uploadFailed"))},[a,f]);return d.useEffect(()=>{var h,l;r?(h=u.current)==null||h.open():(l=u.current)==null||l.close()},[r]),t.jsx(ri,{id:`component-uploader-${e}`,children:t.jsx(ei,{ref:u,locale:c,popup:!0,onUploadFinish:x,plugins:[],onClose:i,installerProps:{disabled:!0},apiPathProps:{uploader:He(o,ti,e),disableMediaKitPrefix:!0,disableMediaKitStatus:!0},coreProps:{restrictions:{allowedFileTypes:lo,maxFileSize:oi,maxNumberOfFiles:1}},tusProps:{headers:n},dashboardProps:{note:f("blocklet.component.addComponentTip.allowedFileTypes",{types:lo.map(h=>h.replace(".","")).join(", ")})}})},`component-uploader-${e}`)}nn.propTypes={did:s.string.isRequired,prefix:s.string.isRequired,open:s.bool,headers:s.func,onUploaded:s.func,onClose:s.func};nn.defaultProps={open:!1,headers:()=>({}),onUploaded:Yn,onClose:Yn};const ri=Qo("div")`
|
|
70
|
+
.uploader-wrapper {
|
|
71
|
+
display: inline-flex;
|
|
72
|
+
position: relative;
|
|
73
|
+
font-size: 0px;
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
&.enabled {
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
}
|
|
78
|
+
&::after {
|
|
79
|
+
display: none;
|
|
80
|
+
}
|
|
81
|
+
&.enabled::after {
|
|
82
|
+
display: block;
|
|
83
|
+
opacity: 1;
|
|
84
|
+
position: absolute;
|
|
85
|
+
bottom: 0;
|
|
86
|
+
background: rgba(0, 0, 0, 0.3);
|
|
87
|
+
left: 0;
|
|
88
|
+
right: 0;
|
|
89
|
+
height: 2.2em;
|
|
90
|
+
color: white;
|
|
91
|
+
text-align: center;
|
|
92
|
+
font-size: 12px;
|
|
93
|
+
line-height: 2em;
|
|
94
|
+
transition: opacity 0.3s ease;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`,on={description:s.string,editing:s.bool,onChange:s.func,required:s.bool,value:s.any,componentProps:s.object,render:s.func,renderFormItem:s.func};function rn({editing:e,value:o,onChange:n}){const[a,r]=d.useState(!1),i=d.useRef(),f=d.useRef(o);d.useEffect(()=>{let l=null;return e&&(l=setTimeout(()=>{r(!0)},50)),()=>{clearTimeout(l)}},[e]);const c=l=>{f.current=l,n(l)},u=()=>{r(!1),n(f.current)},x=t.jsx(C,{className:"form-item-input slot",px:1,children:t.jsxs(C,{display:"flex",alignItems:"center",children:[o,o!=="auto"&&t.jsx("div",{style:{marginLeft:4,backgroundColor:o,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),h=t.jsxs(C,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:u,children:[t.jsx(C,{display:"flex",alignItems:"center",onClick:()=>r(!0),children:t.jsx("div",{ref:i,style:{flexShrink:0,marginLeft:"8px",backgroundColor:o,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:o==="auto"?"default":"pointer"}})}),t.jsx(Jo,{open:a,anchorEl:i.current,onClose:()=>r(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:t.jsx(Es,{color:o,onChange:l=>c(l.hex)})})]});return e?h:x}rn.propTypes=on;function sn({editing:e,description:o,value:n,onChange:a,componentProps:r,...i}){const{placeholder:f}=r,c=d.useRef(n),{t:u}=d.useContext(ve),x=l=>{l.key==="Enter"&&a(c.current,"confirm")},h=l=>{c.current=l,a(l)};return e?t.jsx(Z,{style:{flex:1},fullWidth:!0,value:n,onChange:l=>{l.persist(),h(l.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:o||f,onKeyDown:x,...i}):t.jsx(C,{px:1,className:"form-item-input slot",children:n||t.jsx("span",{className:"placeholder",children:u("common.requiredInputPlaceholder",{name:o||f})})})}sn.propTypes=on;sn.defaultProps={componentProps:{}};function an({editing:e,value:o,onChange:n,componentProps:a,...r}){const{blocklet:i}=a,f=o==="auto"?er.getPassportColorFromDid(i.appDid):o;return t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:tr({title:"Owner",issuer:B.getDisplayName(i),issuerDid:i.appDid,ownerName:"Your Name",ownerDid:i.appDid,preferredColor:o||"auto"})}}),t.jsx(rn,{...r,editing:e,value:e?f:o,onChange:n,componentProps:a})]})}an.propTypes={...on,componentProps:s.shape({blocklet:s.object.isRequired}).isRequired};an.defaultProps={};const si=nr`
|
|
98
|
+
0%, 100% {
|
|
99
|
+
transform: scale(1) translateX(0);
|
|
100
|
+
}
|
|
101
|
+
50% {
|
|
102
|
+
transform: scale(1.05) translateX(-3px);
|
|
103
|
+
}
|
|
104
|
+
25%, 75% {
|
|
105
|
+
transform: scale(1.1) translateX(3px);
|
|
106
|
+
}
|
|
107
|
+
`,ii={input:sn,color:rn,passport:an,uploader:e=>t.jsx(Xr,{...e.componentProps})};function ai(e,{editing:o=!1}){const{componentType:n="input",render:a,renderFormItem:r}=e;return o&&r?r:!o&&a?a:ii[n==null?void 0:n.toLowerCase()]}bt.propTypes={item:s.object.isRequired,findEditingItem:s.func.isRequired,getItemValue:s.func.isRequired,onFormItemChange:s.func.isRequired,onFocusOut:s.func.isRequired,disabled:s.bool,loading:s.bool,onCancel:s.func,formValues:s.object.isRequired};bt.defaultProps={disabled:!1,loading:!1,onCancel:()=>{}};function bt({item:e,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,disabled:i,loading:f,onCancel:c,formValues:u}){var R;const{key:x,description:h,required:l,solo:S=!1,hidden:y=!1,componentProps:g={},skipButtonDisabled:T=!1}=e;if(y)return null;const w=o(x),{editing:k,shaking:b}=w??{},m=n(e,{editing:k}),p=ai(e,{editing:k}),v={inputProps:{"data-cy":"schema-form-item-component"},key:x,description:h,editing:k,value:m,onChange:(j,N="change")=>a(e,j,N),componentProps:g,skipButtonDisabled:T,onBlur:()=>r(e)};return e.componentType==="collapse"&&((R=e.children)==null?void 0:R.length)>0?t.jsxs(Ss,{children:[t.jsx(Rs,{expandIcon:t.jsx(ws,{fontSize:"small"}),"aria-controls":"panel1-content",id:"panel1-header",children:e.description}),t.jsx(Ts,{children:e.children.map(j=>t.jsx(bt,{item:j,findEditingItem:o,getItemValue:n,onFormItemChange:a,onFocusOut:r,formValues:u,disabled:i,loading:f,onCancel:c},j.key))})]}):t.jsxs(C,{className:"form-item",children:[!S&&t.jsxs(C,{className:"form-item-label",sx:{color:l&&!m?"error.main":"text.secondary"},children:[h,l&&t.jsx(dt,{})]}),t.jsxs(C,{className:"form-item-body",children:[t.jsx(C,{className:"form-item-input","data-cy":"schema-form-item-edit",sx:{textAlign:S?"center":"left"},style:{cursor:"text"},onClick:()=>{i||w!=null&&w.edited||T||a(e,u[x],"edit")},children:t.jsx(p,{...v})}),!S&&t.jsx(C,{className:"form-item-action",style:{marginLeft:0},children:k?t.jsxs(t.Fragment,{children:[w.edited?t.jsx(ee,{"data-cy":"schema-form-item-confirm",onClick:()=>{a(e,m,"confirm")},disabled:i||f,sx:{animation:b?`${si} 0.5s linear`:"none"},style:{paddingRight:4},size:"large",children:f?t.jsx(me,{size:24}):t.jsx(bs,{})}):null,t.jsx(ee,{"data-cy":"schema-form-item-cancel",onClick:()=>c(e),style:{paddingLeft:w.edited?4:8},disabled:i||f,size:"large",children:t.jsx(or,{})})]}):null})]})]},x)}function ln({schema:e,loading:o,value:n,defaultValue:a,onChange:r,style:i,disabled:f}){const c=Object.prototype.toString.call(n)==="[object Object]",[u,x]=d.useState([]),[h,l]=d.useState(c?n:a),S=d.useMemo(()=>e.length===1,[e]),y=d.useCallback(p=>u.find(v=>v.key===p),[u]);d.useEffect(()=>{var p;S&&((p=e[0])!=null&&p.required)&&x([{key:e[0].key,editing:!0,initialValue:a[e[0].key]}])},[e,S,a]);const g=d.useCallback(p=>{x(v=>v.find(j=>j.key===p.key)?v.map(j=>j.key===p.key?p:{...j}):[p].concat(v))},[]),T=d.useCallback((p,v,R)=>{const{key:j,secure:N}=p,O=y(j)??{...p};O.editing=!0;const Y=h[j]!==v;O.edited=v&&O.initialValue!==v,O.initialValue=a[j];const U={...h,[j]:v};Y&&l(U),r({[j]:v},{allValues:U,action:R,currentItem:p}),R==="confirm"&&N&&l({...h,[j]:"__encrypted__"}),R==="confirm"&&(O.initialValue=h[j]),["confirm","cancel"].includes(R)&&(O.editing=!1,O.edited=!1),g(O)},[a,h,r,g,y]),w=d.useCallback((p,{editing:v=!1})=>{const{key:R}=p,j=c?n[R]:h[R];return j==="__encrypted__"?v?"":"******":j},[c,n,h]),k=d.useCallback(p=>{const v=y(p.key);v&&T(p,v.initialValue,"cancel")},[y,T]),b=d.useCallback(p=>{const v=y(p.key);!v||!v.edited||(v.shaking=!0,g(v),setTimeout(()=>{v.shaking=!1,g(v)},500))},[y,g]),m=d.useCallback(p=>{const v=y(p.key);!v||!v.edited?k(p):b(p)},[y,b,k]);return t.jsx(li,{className:"form",style:i,children:e==null?void 0:e.map(p=>{const{hidden:v=!1}=p;return v?null:t.jsx(bt,{item:p,findEditingItem:y,getItemValue:w,onFormItemChange:T,onFocusOut:m,formValues:h,disabled:f,loading:o,onCancel:k})})})}ln.propTypes={schema:s.array.isRequired,loading:s.bool,onChange:s.func.isRequired,value:s.object,defaultValue:s.object,style:s.object,disabled:s.bool};ln.defaultProps={loading:!1,value:void 0,defaultValue:{},style:{},disabled:!1};const li=$(Hr)``;function cn({meta:e,onCancel:o,mode:n,handlePaySuccess:a}){const{t:r,locale:i}=z(),{info:f}=X(),c=rr(f),[u,x]=d.useState(null),h=new URL(e==null?void 0:e.registryUrl).origin,l=B.getDisplayName({meta:e}),S=async(g,T)=>{const w=({downloadTokenList:m})=>{a({downloadTokenList:m})},k=m=>{L.error(m),o(m)};function b(m){return ar(()=>no.get(m).then(async({data:p})=>{const v=p==null?void 0:p.downloadTokenList;if(p.status==="succeed"){if(v&&v.length)await w({downloadTokenList:v});else return await k(r("blocklet.component.missDownloadTokenTip")),!0;return!0}return p.status==="error"?(console.error("vc error: ",p),await k(p==null?void 0:p.error),!0):!1}),{interval:1e3})}if(n==="purchase"&&u){const{statusUrl:m}=ir(u);await b(m)}else await w({downloadTokenList:g.downloadTokenList&&T(g.downloadTokenList)})};if(d.useEffect(()=>{if(n==="purchase"){const g=new URL(h);g.pathname="/api/did/verify-purchase-blocklet/token",g.searchParams.set("serverDid",f.did),g.searchParams.set("blockletDid",e==null?void 0:e.did);try{no.get(g.href).then(({data:T})=>{const w=`${T.url}`;x(w)})}catch(T){console.error("get next workflow url error: ",T)}}return()=>{x(null)}},[n]),n==="purchase"&&!u)return"";const y={verify:{action:"verify-purchase-blocklet",checkFn:Kn.create({baseURL:h}).get,extraParams:{serverDid:f.did,blockletDid:e==null?void 0:e.did},messages:{title:r("store.purchase.verify.auth.title",{name:l}),scan:r("store.purchase.verify.auth.scan"),confirm:r("store.purchase.verify.auth.confirm"),success:r("store.purchase.verify.auth.success")}},purchase:{action:"acquire-asset",checkFn:Kn.create({baseURL:He(h,"/store")}).get,extraParams:{factory:e.nftFactory,nw:u},messages:{title:r("store.purchase.auth.title",{name:l}),scan:r("store.purchase.auth.scan"),confirm:r("store.purchase.auth.confirm"),success:t.jsxs(t.Fragment,{children:[t.jsx("p",{children:r("store.purchase.auth.success")}),t.jsx("p",{children:r("blocklet.component.purchaseComponentSecondCheckTip")})]})}}};return t.jsx(sr,{open:!0,locale:i,popup:!1,saveConnect:!1,className:"connect",baseUrl:h,onSuccess:S,cancelWhenScanned:o,onClose:o,checkTimeout:60*5e3,webWalletUrl:c,disableClose:!0,showDownload:!1,...y[n]})}cn.propTypes={...es,handlePaySuccess:s.func,mode:s.oneOf(["verify","purchase"]).isRequired};cn.defaultProps={handlePaySuccess:()=>{}};const dn=d.forwardRef(({mode:e,...o},n)=>{const[a,r]=d.useState(e!=="both"?e:"verify"),[i,f]=d.useState(e!=="both"?2:1),c=x=>{x!==a&&r(x)},u=()=>{a&&i!==2&&f(2)};return d.useImperativeHandle(n,()=>({onNext:u,getCurrentStep:()=>i})),i===1?t.jsx("div",{style:{maxWidth:520},children:t.jsx(ts,{action:a,onNext:null,onSelect:c})}):t.jsx(cn,{...o,mode:a})});dn.propTypes={mode:s.oneOf(["both","verify","purchase"]).isRequired,ref:s.any};dn.defaultProps={ref:{}};const ci=dn;function di({...e}){return t.jsx(pe,{className:"bottom-button",variant:"contained",color:"primary",...e})}function un({blocklet:e,onStartNow:o,children:n,disabled:a}){const{t:r}=z(),i=_o();return!e||lr(e.meta)?t.jsx(ui,{children:n}):t.jsxs(pi,{isMobile:i,children:[t.jsx(di,{className:"start-now",variant:"contained",color:"primary",disabled:a,onClick:()=>o(),children:r("setup.startNow")}),t.jsx(C,{display:"flex",alignItems:"center",children:n})]})}un.propTypes={blocklet:s.object,onStartNow:s.func,children:s.any,disabled:s.bool};un.defaultProps={blocklet:null,onStartNow:()=>{},children:null,disabled:!1};const ui=$(C)`
|
|
108
|
+
width: 100%;
|
|
109
|
+
margin-top: auto;
|
|
110
|
+
padding-top: 24px;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
.bottom-button {
|
|
115
|
+
min-width: 200px;
|
|
116
|
+
}
|
|
117
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
118
|
+
.bottom-button {
|
|
119
|
+
width: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`,pi=$(C)`
|
|
123
|
+
padding-top: 24px;
|
|
124
|
+
margin-top: auto;
|
|
125
|
+
width: 100%;
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
justify-content: space-between;
|
|
129
|
+
.start-now {
|
|
130
|
+
min-width: 140px;
|
|
131
|
+
}
|
|
132
|
+
.bottom-button {
|
|
133
|
+
min-width: 120px;
|
|
134
|
+
}
|
|
135
|
+
${e=>e.theme.breakpoints.down("lg")} {
|
|
136
|
+
width: 100%;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
${e=>e.theme.breakpoints.down("md")} {
|
|
140
|
+
.start-now {
|
|
141
|
+
min-width: inherit;
|
|
142
|
+
}
|
|
143
|
+
.bottom-button {
|
|
144
|
+
min-width: 100px;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
${e=>e.isMobile} {
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
gap: '32px',
|
|
151
|
+
}}
|
|
152
|
+
`;function pn({blockletMeta:e,onEndpointUpdate:o}){var c;const n=_o(),{blocklet:a}=fe(),{updateSpaceGateway:r,loading:i,hasStorageEndpoint:f}=fs();return d.useEffect(()=>{o==null||o()},[a]),i?t.jsx(cr,{relative:"parent",children:t.jsx(me,{})}):t.jsxs(mi,{children:[t.jsx(C,{width:n?"360px":"720px",children:f?t.jsx(hs,{}):t.jsx(gs,{})}),((c=e==null?void 0:e.capabilities)==null?void 0:c.didSpace)==="required"&&t.jsx(un,{mt:8,children:t.jsx(xs,{onConnect:r})})]})}pn.propTypes={blockletMeta:s.any.isRequired,onEndpointUpdate:dr.func};pn.defaultProps={onEndpointUpdate:()=>{}};const mi=$(Cs)`
|
|
153
|
+
height: 100%;
|
|
154
|
+
overflow-y: auto;
|
|
155
|
+
padding-bottom: 32px;
|
|
156
|
+
overflow-x: hidden;
|
|
157
|
+
`;function mn({onChange:e,loading:o,children:n,extra:a,stores:r,storageKey:i}){const{t:f}=z(),{info:c,inService:u}=X(),{blocklet:x}=fe(),[h,l]=d.useState(!1),S=d.useRef(null),[y,g]=d.useState(),[T,w]=Ns(i||"tmp"),[k,b]=i?[T,w]:[y,g],{storeList:m,teamDid:p}=xo({fromBlocklet:u,blocklet:x,nodeInfo:c}),v=yo([...r.map(j=>({...j,protected:!0})),...m],"url"),R=k&&v.find(j=>k===j.url)||v[0];return t.jsxs(t.Fragment,{children:[t.jsxs(fi,{children:[t.jsx(pe,{ref:S,color:"primary","data-cy":"add-component-select-store",endIcon:t.jsx(Ds,{color:"primary"}),onClick:()=>{l(!0)},style:{padding:"0 2px"},children:t.jsx(oe,{color:"primary",children:R.name})}),t.jsx(oe,{color:"primary",children:a})]}),t.jsxs(Z,{id:"mui-registry-select",select:!0,autoComplete:"off",variant:"outlined",name:"did",helperText:f("blocklet.component.selectRegistryTip"),"data-cy":"component-registry-select",fullWidth:!0,value:R,autoFocus:!0,onChange:j=>{const N=j.target.value;b(N.url),e(N)},SelectProps:{open:h,MenuProps:{anchorEl:S.current},renderValue:j=>j==null?void 0:j.name,onClose:()=>{l(!1)}},style:{display:"none"},margin:"normal",children:[v==null?void 0:v.map(j=>t.jsx(Se,{sx:{width:"400px",maxWidth:"90vw"},value:j,"data-cy":j.url,children:t.jsx(ns,{teamDid:p,store:j,onDelete:()=>{var N;k===j.url&&b((N=v[0])==null?void 0:N.url)}})},j.url)),!wo.isInServerlessMode(c)&&t.jsx(os,{disabled:o,storeList:v,teamDid:p,onAdd:j=>{b(j)}})]}),n({currentRegistry:R})]})}mn.propTypes={onChange:s.func,loading:s.bool,children:s.any.isRequired,extra:s.node,storageKey:s.string,stores:s.arrayOf(s.shape({name:s.string.isRequired,url:s.string.isRequired}))};mn.defaultProps={onChange:()=>{},loading:!1,extra:"",stores:[],storageKey:""};const fi=$.div`
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: space-between;
|
|
160
|
+
align-items: center;
|
|
161
|
+
margin-bottom: 16px;
|
|
162
|
+
|
|
163
|
+
span {
|
|
164
|
+
font-size: 16px;
|
|
165
|
+
color: ${e=>e.theme.palette.text.primary};
|
|
166
|
+
// font-weight: bold;
|
|
167
|
+
}
|
|
168
|
+
`,hi={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm0 10a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1zm10 0a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1zm0-8h6m-3-3v6"/>'},gi={width:24,height:24,body:'<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="m17 10l-2-6m-8 6l2-6m4 16H7.244a3 3 0 0 1-2.965-2.544l-1.255-7.152A2 2 0 0 1 5.001 8H19a2 2 0 0 1 1.977 2.304"/><path d="M10 14a2 2 0 1 0 4 0a2 2 0 0 0-4 0m11 1h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3H17m2 0v1m0-8v1"/></g>'},xi={width:24,height:24,body:'<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m7 11l5-5l5 5M7 17l5-5l5 5"/>'},yi=(e,o)=>He(o,`/blocklets/${e.did}`),co=({blocklet:e,attribute:o,value:n})=>e._formatted?e._formatted[o]:n,Ci=e=>e.inStore&&B.isFreeBlocklet(e)===!1;function fn({blocklet:e,blocklets:o,handleButtonClick:n,endpoint:a,serverVersion:r}){var w,k;const{t:i}=z();let f=He(a,gr(e.did,e.logo||""));try{const b=new URL(f);b.searchParams.set("v",e.version||+new Date),f=b.href}catch{}const[c,u]=d.useState(!1),x=async()=>{try{u(!0),await n({meta:e,registryUrl:a,blocklets:o})}catch(b){L.error(b.message)}finally{u(!1)}},{blocklet:h}=fe(),l=()=>((h==null?void 0:h.children)||[]).find(p=>p.meta.bundleDid===e.did).meta.version,y=(()=>{const b=((h==null?void 0:h.children)||[]).find(m=>m.meta.bundleDid===e.did);if(b){try{const m=b.meta.version,p=e.version;if(xr.gt(p,m))return"upgrade"}catch{return"install"}return"disable"}return"install"})(),g=(w=e.requirements)==null?void 0:w.server,T=[];return y==="upgrade"?T.push({key:"upgrade",icon:t.jsx(J,{icon:xi,color:"success.light",width:20,height:20},"version"),title:`${l()} -> ${e.version}`,align:"right",color:"success.light",maxWidth:300,text:t.jsx(C,{sx:{fontWeight:"bold"},children:i("blocklet.component.upgradeAvailable")})}):y==="disable"?T.push({key:"disable",icon:t.jsx(J,{icon:hi,color:"text.disabled",width:20,height:20},"disable"),align:"right",maxWidth:300,color:"text.disabled",text:i("blocklet.component.installed")}):Ci(e)&&T.push({key:"purchase",icon:t.jsx(J,{icon:gi,color:"primary.main",width:20,height:20},"purchase"),align:"right",maxWidth:300,color:"primary.main",text:i("blocklet.component.needBuy")}),t.jsx(ji,{title:co({blocklet:e,attribute:"title",value:e.title||e.name}),did:e.did,description:co({blocklet:e,attribute:"description",value:e.description}),cover:e.logo?f:"",version:e.version,onButtonClick:null,"data-cy":"install-blocklet",sx:y!=="disable"?{"&:hover, && *":{cursor:"pointer"}}:{"&:after, &:before":{content:'""',opacity:"0 !important"}},onMainClick:y==="disable"?void 0:x,icons:(k=e.docker)!=null&&k.image?[{key:"docker",icon:t.jsx(C,{display:"flex",color:"primary.main",children:t.jsx(J,{icon:To})}),title:i("blocklet.dockerImage")}]:[],official:e.isOfficial?{tooltip:i("blocklet.component.isOfficial")}:void 0,download:e.stats.downloads,status:T,button:t.jsx(ss,{serverVersion:r,requirementVersion:g,size:"small",children:t.jsx("div",{style:{display:"flex",alignItems:"center"},children:t.jsx(is,{children:t.jsx(pe,{size:"small",disabled:c,variant:"outlined",color:"primary",onClick:b=>{b.preventDefault(),b.stopPropagation();const m=yi(e,a);m&&window.open(m,"_blank","noopener,noreferrer")},children:i("common.detail")},e.did)})})})})}fn.propTypes={blocklet:s.object.isRequired,blocklets:s.array,handleButtonClick:s.func,endpoint:s.string,serverVersion:s.string};fn.defaultProps={handleButtonClick:null,endpoint:"",blocklets:[],serverVersion:""};function hn({handleButtonClick:e,handleSearchSelect:o,storeUrl:n,handleBlockletRender:a,extraFilter:r,serverVersion:i,resourceType:f,resourceDid:c,showResourcesSwitch:u,showCategory:x,compact:h,...l}){const S=gt(),{locale:y}=z(),[g,T]=d.useState(!1),[w,k]=d.useState({}),b=v=>{k(v)},m=n,p=d.useMemo(()=>ur(S,{palette:{background:{default:S.palette.background.paper}}}),[S]);return d.useEffect(()=>{k({showResources:!0,resourceType:f,resourceDid:c})},[m,f,c]),d.useEffect(()=>{T(!0),k({showResources:!0,resourceType:f,resourceDid:c})},[]),t.jsx(pr,{theme:p,children:t.jsx(mr,{FallbackComponent:fr,resetKeys:[m],children:t.jsxs(C,{...l,sx:hr({overflow:"auto",".title-bar + div":{height:"unset"}},l.sx),children:[g&&t.jsx(rs,{showCategory:x,showResourcesSwitch:u,blockletRender:v=>{const R={...v,handleButtonClick:e,endpoint:m};return a({...v,defaultRender:t.jsx(fn,{...R})})},compact:h,minItemWidth:300,baseSearch:!0,endpoint:m,locale:y,onFilterChange:b,onSearchSelect:o,filters:w,extraFilter:r,serverVersion:i,fetchCategoryDelay:500}),t.jsx(C,{sx:{mt:2},children:" "})]})})})}hn.propTypes={storeUrl:s.string.isRequired,handleButtonClick:s.func,handleSearchSelect:s.func,handleBlockletRender:s.func,extraFilter:s.func,serverVersion:s.string,resourceType:s.string,resourceDid:s.string,showResourcesSwitch:s.bool,showCategory:s.bool,compact:s.bool};hn.defaultProps={handleButtonClick:null,handleSearchSelect:null,handleBlockletRender:null,extraFilter:void 0,serverVersion:"",resourceType:"",resourceDid:"",showResourcesSwitch:!0,showCategory:!0,compact:!1};const ji=$(as)`
|
|
169
|
+
.ms-highlight {
|
|
170
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
171
|
+
}
|
|
172
|
+
`,gn=d.forwardRef(({meta:e,isMobile:o,onStepChange:n},a)=>{const r=gt(),{steps:i,activeStep:f,setActiveStepByKey:c,setActiveStepByIndex:u}=ds(),{t:x,locale:h}=z(),l=i[f];return d.useEffect(()=>{n(f)},[n,f]),d.useImperativeHandle(a,()=>({setActiveStepByKey:c,setActiveStepByIndex:u})),t.jsx(bi,{component:"div",className:o?"mobileStyle":"",sx:{height:"calc(100% - 56px)","&>div>div>div:first-of-type":{flex:{md:1}}},children:t.jsx(us,{locale:h,blockletMeta:{title:" ",...e},pcWidth:"100%",pcHeight:"100%",logoUrl:e&&e.logo&&e.registryUrl?yr({did:e.did,version:e.version,baseUrl:e.registryUrl,logoPath:e.logo}):null,theme:r,stepTip:x("blocklet.component.add"),children:t.jsx(vi,{children:typeof(l==null?void 0:l.body)=="function"?l.body():l==null?void 0:l.body})})})});gn.propTypes={meta:s.any,onStepChange:s.func.isRequired,isMobile:s.bool.isRequired};gn.defaultProps={meta:null};const uo=e=>e.isMobile?`
|
|
173
|
+
height: calc(100vh - 56px - 64px - 48px);
|
|
174
|
+
`:"",vi=$.div`
|
|
175
|
+
width: 100%;
|
|
176
|
+
height: 100%;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
justify-content: flex-start;
|
|
180
|
+
align-items: flex-start;
|
|
181
|
+
|
|
182
|
+
.bottom-button {
|
|
183
|
+
min-width: 200px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// blocklet-select-side
|
|
187
|
+
aside {
|
|
188
|
+
width: 140px;
|
|
189
|
+
}
|
|
190
|
+
`,bi=$(C)`
|
|
191
|
+
${({className:e})=>e==="mobileStyle"?`
|
|
192
|
+
& > div{
|
|
193
|
+
height: 100%;
|
|
194
|
+
}
|
|
195
|
+
.root-header {
|
|
196
|
+
.app-name-content {
|
|
197
|
+
display: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// content-panel
|
|
202
|
+
.root-header + div{
|
|
203
|
+
padding-top: 0;
|
|
204
|
+
position: relative;
|
|
205
|
+
& > div {
|
|
206
|
+
padding-top: 0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
header + div {
|
|
211
|
+
padding-top: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
header {
|
|
215
|
+
.header-title {
|
|
216
|
+
margin-left: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.header-title-name {
|
|
220
|
+
max-width: 100% !important;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
.app-content {
|
|
224
|
+
padding: 0!important;
|
|
225
|
+
}
|
|
226
|
+
`:`
|
|
227
|
+
position: relative;
|
|
228
|
+
.ll-container { // 通过 Launcher Layout 组件约定的 .ll-container class 自定义 Layout 样式
|
|
229
|
+
width: 100%;
|
|
230
|
+
height: 100%;
|
|
231
|
+
border-radius: 0;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.root-header {
|
|
235
|
+
z-index: auto !important;
|
|
236
|
+
position: fixed !important;
|
|
237
|
+
}
|
|
238
|
+
& > div {
|
|
239
|
+
height: 100%;
|
|
240
|
+
width: 100%;
|
|
241
|
+
max-width: 100%;
|
|
242
|
+
& > div {
|
|
243
|
+
max-height: unset !important;
|
|
244
|
+
max-width: 100%;
|
|
245
|
+
& > div {
|
|
246
|
+
// left-panel
|
|
247
|
+
&:first-of-type {
|
|
248
|
+
padding: 0;
|
|
249
|
+
width: 20%;
|
|
250
|
+
min-width: 180px;
|
|
251
|
+
|
|
252
|
+
& > div:first-of-type {
|
|
253
|
+
display: none;
|
|
254
|
+
}
|
|
255
|
+
// step
|
|
256
|
+
& > div:last-child {
|
|
257
|
+
// margin-top: 32px;
|
|
258
|
+
margin-top: 0;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// right-panel
|
|
262
|
+
&:last-child {
|
|
263
|
+
padding-top: 0;
|
|
264
|
+
padding-right: 0px;
|
|
265
|
+
overflow-y: hidden;
|
|
266
|
+
.app-content {
|
|
267
|
+
padding: 0 0 24px 0;
|
|
268
|
+
}
|
|
269
|
+
.button-container {
|
|
270
|
+
padding-right: 0;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
`}
|
|
278
|
+
|
|
279
|
+
& .ll-container {
|
|
280
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
& .app-overview {
|
|
284
|
+
margin-left: 0 !important;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
& .flex-justify-center {
|
|
288
|
+
display: flex;
|
|
289
|
+
justify-content: center;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
& .flex-align-center {
|
|
293
|
+
display: flex;
|
|
294
|
+
height: 100%;
|
|
295
|
+
align-items: center;
|
|
296
|
+
${e=>uo(e)}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
& .agreement-wrapper {
|
|
300
|
+
${e=>uo(e)}
|
|
301
|
+
max-height: 60vh;
|
|
302
|
+
.eula-trigger {
|
|
303
|
+
padding-right: 0;
|
|
304
|
+
}
|
|
305
|
+
.next-button {
|
|
306
|
+
display: none;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
& .connect {
|
|
311
|
+
background: white;
|
|
312
|
+
}
|
|
313
|
+
`,Si=gn,Ri=(e,o)=>{var n;return(n=((e==null?void 0:e.children)||[]).find(a=>a.mountPoint===o))==null?void 0:n.meta},wi=e=>e.inStore&&B.isFreeBlocklet(e)===!1,Ti=e=>{var o;return[H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED,H.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes((o=e==null?void 0:e.capabilities)==null?void 0:o.didSpace)},qt=e=>{var o,n;return((n=(o=e==null?void 0:e.configs)==null?void 0:o.find(a=>a.key===H.BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_SPACE_ENDPOINT))==null?void 0:n.value)||null},Ei=e=>(e.environments||[]).some(o=>o.required),po=(e,o)=>e==null?void 0:e.some(n=>n.required&&!o[n.key]),Pi=({params:e,blocklet:o,t:n})=>{const a=e.title||e.name;return a?((o==null?void 0:o.children)||[]).find(i=>i.meta.bundleDid===e.bundleDid)?n("blocklet.component.upgradeNext",{name:a}):n("blocklet.component.addNext",{name:a}):n("common.next")},mo=({componentDid:e,timeout:o=1e3,manual:n=!1}={})=>{setTimeout(()=>{window.parent.postMessage({event:"component.installed",componentDid:e,manual:n},"*")},o)};function xn({onClose:e,mode:o,stores:n,resourceType:a,resourceDid:r,storageKey:i,inDialog:f,selectedMeta:c,storeUrl:u,showResourcesSwitch:x,showFromUrl:h,enableRunBackground:l,showCategory:S,installFromUrlParams:y}){var Nn,Ln,Bn,On,Qe,Mn,Je,$n,An,qn;const{t:g,locale:T}=z(),[w,k]=d.useState(!1),[b,m]=d.useState(null),[p,v]=d.useState(""),[R,j]=d.useState(""),{api:N,ws:{useSubscription:O},inService:he,info:Y}=X(),{blocklet:U,actions:{refreshBlocklet:Re}}=fe(),[Q,De]=d.useState(null),[Ne,ge]=d.useState(!1),we={bundleDid:"",componentDid:"",componentName:"",pathPrefix:"",name:"",title:"",configsList:[],configsValue:{},hasMissRequiredConfigs:!1,hasEnvironmentsStep:!1,hasRequiredEnvironments:!1,requirePurchase:!1,didSpaceIsRequiredSetup:null,installResultProps:{},purchaseResultProps:{},showFromUrlDialog:!1,isUpload:!1,upgradeDid:""},[_,W]=d.useState(we),[K,Te]=d.useState(0),F=d.useRef({}),be=d.useRef({}),le=d.useRef({}),E=Co(P=>P.breakpoints.down("md")),V=Cr(),[re,Ee]=d.useState(!0),{meta:A}=F.current,Le=js(A),ce=d.useRef(!1),G=P=>W(I=>({...I,...P}));d.useEffect(()=>{if(_.pathPrefix){const{errMsg:P}=Dn({..._,pathPrefix:_.pathPrefix,locale:T});v(P)}},[_.pathPrefix]),d.useEffect(()=>{K===0&&W(we)},[K]);const ke=()=>{const P=qt(U)??"";G({didSpaceEndpoint:P})},ze=()=>{var P;return(P=F==null?void 0:F.current)!=null&&P.meta?B.getDisplayName(F.current):""},Be=()=>{k(!1),W({}),ce.current=!1,F.current={},e()},Pt=P=>{const I=M=>{G({installResultProps:{variant:"error",title:ze(),subTitle:P,footer:t.jsx(pe,{className:"bottom-button",disabled:M,"data-cy":"retry-install-component",onClick:async()=>{I(!0),await Un(F.current.installInput)},children:t.jsxs(C,{display:"flex",alignItems:"center",children:[M&&t.jsx(me,{size:16,style:{marginRight:8}}),g("common.retry")]})})}})};I()},Ze=P=>I=>{var M,q;(((M=I==null?void 0:I.meta)==null?void 0:M.did)||(I==null?void 0:I.meta))===((q=U==null?void 0:U.meta)==null?void 0:q.did)&&P(I)},Ao=()=>{mo({timeout:0,componentDid:V.componentDid,manual:!0}),Be(),setTimeout(()=>{const P=document.getElementsByClassName("dashboard-main")[0];P&&(P.scrollTop=P.scrollHeight)},200)};O(H.BlockletEvents.componentInstalled,Ze(()=>{G({installResultProps:{variant:"success",title:ze(),subTitle:g("blocklet.component.installSuccessTip")}}),mo({componentDid:V.componentDid})}),[(Nn=U==null?void 0:U.meta)==null?void 0:Nn.did]),O(H.BlockletEvents.statusChange,Ze(()=>{const P=qt(U);G(I=>({...I,didSpaceEndpoint:P}))}),[(Ln=U==null?void 0:U.meta)==null?void 0:Ln.did]),O(H.BlockletEvents.downloadFailed,Ze(()=>{ce.current=!1,Pt(g("blocklet.component.installComponentError"))}),[(Bn=U==null?void 0:U.meta)==null?void 0:Bn.did]),O(H.BlockletEvents.installFailed,Ze(()=>{ce.current=!1,Pt(g("blocklet.component.installComponentError"))}),[(On=U==null?void 0:U.meta)==null?void 0:On.did]);const de=[],In=P=>((U==null?void 0:U.children)||[]).find(I=>I.meta.did===P),Un=async P=>{var nt,$e;ce.current=!0;const{pathPrefix:I,bundleDid:M,title:q,componentName:te="",componentDid:Pe=""}=_,_e=((nt=F.current)==null?void 0:nt.meta)||{},{configs:Oe=[],registryUrl:ye,inStore:Me,inputUrl:We,dist:_t}=_e,et=($e=F.current)==null?void 0:$e.downloadTokenList,tt=We||(Me?Hn(ye,M,_t):"");k(!0);const ne={rootDid:U.meta.did,url:tt,mountPoint:I?je(I):`/${je(_e.title||_e.name)}`,title:q,name:te,did:_.isUpload&&_.upgradeDid?_.upgradeDid:Pe,dist:{tarball:"",integrity:""},onlyRequired:!re,..._.hasEnvironmentsStep&&Oe.length>0?{configs:Oe.map(ue=>({...ue,value:_.configsValue[ue.key]||""}))}:{},...et?{downloadTokenList:et}:{},...P};try{if(await N.installComponent({input:ne}),ye){const{teamDid:ue,storeList:Ie}=xo({fromBlocklet:he,nodeInfo:Y,blocklet:U}),{isNew:It,decoded:Ut}=br(ye,Ie);It&&await N.addBlockletStore({input:{teamDid:ue,url:Ut}})}G({installResultProps:{}}),Re({showError:!1,attachRuntimeInfo:!1})}catch(ue){const Ie=ae(ue);L.error(Ie),console.error("installComponent error: ",ue),Pt(Ie)}finally{k(!1),F.current.installInput=ne}},Dn=P=>{const I=ko({params:{...P,did:P.bundleDid},blocklets:[U],blocklet:U,locale:T,isUpload:_.isUpload});let M=I;const q=Ri(U,_.pathPrefix);if(I==="overwrite"&&q&&q.did!==P.bundleDid?(G({upgradeDid:q.did}),M=""):(G({upgradeDid:""}),M=I),M){const te=In(P.bundleDid),Pe=Us({params:{...P,did:P.bundleDid},blocklet:U});if(te&&te.mountPoint===Pe)return{errMsg:""}}return{errMsg:M}},xe=async P=>{var M,q;const{errMsg:I}=Dn({..._,locale:T});v(I),K===de.length-2&&!ce.current&&await Un(P),(q=(M=be.current)==null?void 0:M.setActiveStepByIndex)==null||q.call(M,te=>te+1)},Ge=()=>{var P,I;(I=(P=be.current)==null?void 0:P.setActiveStepByIndex)==null||I.call(P,M=>M-1)},qo=()=>{const{pathPrefix:P,bundleDid:I,title:M,componentName:q="",componentDid:te=""}=_,{meta:Pe={}}=F.current||{},{registryUrl:_e,inStore:Oe,inputUrl:ye,dist:Me}=Pe,We=Oe?Hn(_e,I,Me):ye;De({meta:Pe,installOpts:{type:"component",rootDid:U.meta.did,mountPoint:P,url:We,title:M,name:q,did:te}})},Fo=P=>{ge(!1),G({purchaseResultProps:{variant:"error",title:ze(),subTitle:P,style:{paddingTop:120},footer:t.jsx(pe,{className:"bottom-button","data-cy":"retry-purchase-component",onClick:()=>{G({purchaseResultProps:{}})},children:g("common.retry")})}})},zo=({downloadTokenList:P})=>{F.current.downloadTokenList=P,ge(!1),xe()},kt=({chooseParams:P=F.current,componentDid:I,isInit:M=!1,isUpload:q=!1})=>{var Fn,zn,Gn,Wn;const{meta:te,registryUrl:Pe,inStore:_e,inputUrl:Oe}=P,{did:ye,title:Me,name:We}=te,_t=(((Fn=U.settings)==null?void 0:Fn.children)||[]).filter(ie=>ie.status==="deleted"&&ie.meta.bundleDid===ye),et=I||"",tt=(zn=te.environments)==null?void 0:zn.map(ie=>{const{name:Dt,validation:ot,...rt}=ie,Nt={validation:Sr(ot)?"":ot};return{...rt,key:Dt,...Nt}});F.current={...P,meta:{...te,configs:tt,registryUrl:Pe,inStore:_e,inputUrl:Oe}};let ne={};if(M){const ie=[U],Dt=tt||[],ot=[],rt=yo(vr([...Dt,...ot]),"key").filter(Ae=>!!Ae.key).sort((Ae,st)=>Ae.required&&!st.required?-1:st.required&&!Ae.required?1:0),Nt=B.getSharedConfigObj(ie[0],{configs:rt}),Lt={},Vn=rt.map(Ae=>{const{default:st,key:it,...Wo}=Ae;return Lt[it]=Nt[it]||st,{...Wo,key:it,hidden:!!H.BLOCKLET_CONFIGURABLE_KEY[it]}});ne={...ne,configsList:Vn,configsValue:Lt,hasMissRequiredConfigs:po(Vn,Lt)}}const nt=U.children.some(ie=>ie.mountPoint==="/"),$e=_t.find(ie=>ie.meta.bundleDid===ye),ue=U.children.find(ie=>ie.meta.bundleDid===ye);ne.title=Me||"",$e?ne={...ne,pathPrefix:$e.mountPoint||"",componentName:$e.meta.name,hasEnvironmentsStep:!1}:ue?ne={...ne,pathPrefix:ue.mountPoint||"",componentName:ue.meta.name,hasEnvironmentsStep:!1}:ne={...ne,pathPrefix:nt?`/${je(Me)||je(We)}`.toLowerCase():"/",componentName:"",hasEnvironmentsStep:((Wn=(Gn=F.current.meta)==null?void 0:Gn.environments)==null?void 0:Wn.length)>0};const Ie=wi(F.current.meta),It=Ti(F.current.meta),Ut=qt(U);G({bundleDid:ye,componentDid:et,...ne,hasRequiredEnvironments:Ei(F.current.meta),requirePurchase:Ie,didSpaceIsRequiredSetup:It,didSpaceEndpoint:Ut,isUpload:q}),M&&Ie&&qo()};d.useEffect(()=>{if(!c&&!(y!=null&&y.meta)||K!==0||!U)return;const{meta:P,inputUrl:I="",inStore:M=!0,registryUrl:q="",isUpload:te=!1}=y||{};kt({chooseParams:{blocklets:[c||P],meta:c||P,registryUrl:q||u||c.homepage,inStore:M,inputUrl:I},isInit:!0,isUpload:te}),G({showFromUrlDialog:!1}),xe()},[c,K,U,y]),de.push({key:"selectComponent",name:g("blocklet.component.selectComponent"),body:t.jsxs(Ue,{sx:{width:400,display:"flex",flexDirection:"column"},component:"div",children:[h&&_.showFromUrlDialog&&t.jsx(Po,{mode:"component",onCancel:()=>{G({showFromUrlDialog:!1})},onSuccess:({meta:P,inputUrl:I,inStore:M,registryUrl:q})=>{kt({chooseParams:{meta:P,inputUrl:I,inStore:M,registryUrl:q},isInit:!0}),G({showFromUrlDialog:!1}),xe()},handleText:{title:g("blocklet.component.addComponentTip.fromUrl"),confirm:g("blocklet.component.choose")}}),t.jsx(mn,{stores:n,extra:wo.isInServerlessMode(Y)?null:h?t.jsxs(pe,{variant:"text",color:"primary","data-cy":"add-component-from-url",onClick:()=>{G({showFromUrlDialog:!0})},style:{padding:"0 2px"},children:[t.jsx(Ht,{style:{fontSize:20,marginRight:4}}),g("blocklet.component.addComponentTip.fromUrl")]}):null,loading:w,onChange:()=>{W({}),F.current={}},storageKey:i,children:({currentRegistry:P})=>t.jsx(hn,{showResourcesSwitch:x,showCategory:S,serverVersion:Y==null?void 0:Y.version,compact:!0,style:{flex:1,overflow:"hidden",height:"100%"},storeUrl:P.url,resourceType:a,resourceDid:r,handleButtonClick:I=>{kt({chooseParams:{...I,inStore:!0},isInit:!0})},handleBlockletRender:({blocklet:I,defaultRender:M})=>{const q=(_==null?void 0:_.bundleDid)&&(_==null?void 0:_.bundleDid)===(I==null?void 0:I.did);return t.jsxs(_i,{children:[t.jsx(C,{className:q?"choose-blocklet":"",sx:{"& > div":{position:"relative","&:before, &:after":{content:'""',position:"absolute",width:"0",height:"0",opacity:0,transition:"width 0.3s, height 0.3s, opacity 0.3s",borderRadius:"8px",pointerEvents:"none",...q?{width:"100%",height:"100%",opacity:1}:{}},"&:before":{top:0,left:0,borderTop:"1px solid",borderLeft:"1px solid",borderColor:"primary.main"},"&:after":{bottom:0,right:0,borderBottom:"1px solid",borderRight:"1px solid",borderColor:"primary.main"},"&:hover":{"&:before, &:after":{width:"100%",height:"100%",opacity:1}}}},style:{marginLeft:16},children:M}),q&&t.jsx(C,{className:"check-container",children:t.jsx(jr,{className:"check-icon"})})]})}})})]}),cancel:o==="embed"?void 0:g("common.cancel"),confirm:Pi({params:_,blocklet:U,t:g}),onCancel:Be,onConfirm:()=>{xe()}}),de.push({key:"agreement",name:g("launchBlocklet.introduction"),body:t.jsxs(Ue,{component:"div",className:"agreement-wrapper",children:[t.jsx(Eo,{title:g("launchBlocklet.introduction"),subTitle:g("blocklet.component.addComponentTip.introduction")}),A?t.jsx(vs,{meta:A,onClickNext:xe,installRelated:re,onChangeInstallRelated:Ee,handleDescEle:t.jsx("p",{children:g("blocklet.component.addComponentTip.belowInformation")})}):null]}),cancel:c?void 0:g("common.pre"),disabled:!Le,confirm:g(Le?"launchBlocklet.next":"launchBlocklet.canNotInstall"),onCancel:c?Be:Ge,onConfirm:()=>{ge(!1),xe()}}),A&&_.requirePurchase&&de.push({key:"purchase",name:t.jsxs(t.Fragment,{children:[g("common.verifyNFT"),t.jsx(dt,{})]}),body:t.jsxs(Ue,{component:"div",className:"flex-align-center",style:{flexDirection:"column"},children:[!(((Mn=(Qe=le.current)==null?void 0:Qe.getCurrentStep)==null?void 0:Mn.call(Qe))===2||Ne)&&t.jsx(ct,{title:g("common.verifyNFT"),subTitle:g("blocklet.component.addComponentTip.verifyNFT")}),at(_.purchaseResultProps)?Q&&t.jsx(ci,{ref:le,meta:Q.meta,mode:_.componentDid?"verify":"both",onCancel:Fo,installOpts:Q.installOpts,handlePaySuccess:zo}):t.jsx("div",{className:"flex-align-center flex-justify-center",children:t.jsx(to,{..._.purchaseResultProps})})]}),disabled:(($n=(Je=le.current)==null?void 0:Je.getCurrentStep)==null?void 0:$n.call(Je))===2||Ne,cancel:g("common.pre"),confirm:g("common.next"),onConfirm:()=>{typeof le.current.onNext=="function"&&(le.current.onNext(),ge(!0))},onCancel:()=>{Ge()}}),B.hasStartEngine(A)&&jo.hasMountPoint(A)?de.push({key:"config",name:g("common.config"),error:p,body:t.jsxs(Ue,{component:"div",children:[t.jsx(ct,{title:g("common.config"),subTitle:g("blocklet.component.addComponentTip.config")}),t.jsx(Z,{label:g("blocklet.component.mountPoint"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"mount-point-input"},fullWidth:!0,helperText:R||g("blocklet.component.mountPointTip"),style:{marginBottom:32},margin:"normal",value:_.pathPrefix,onChange:P=>{const I=P.target.value;G({pathPrefix:I}),j(g("common.slugifyHint",{value:Vt(I)}))}}),!!p&&t.jsx(Ft,{severity:"error",style:{width:"100%",marginTop:8},children:p})]}),cancel:g("common.pre"),confirm:g("common.next"),onCancel:Ge,onConfirm:()=>{xe()}}):A&&(_.pathPrefix=((qn=(An=A.interfaces)==null?void 0:An[0])==null?void 0:qn.path)||`/${A.did}`),A&&(_!=null&&_.hasEnvironmentsStep)&&de.push({key:"environment",name:t.jsxs(t.Fragment,{children:[g("common.environment")," ",_.hasRequiredEnvironments&&t.jsx(dt,{})]}),disabled:!!b||(_==null?void 0:_.hasMissRequiredConfigs),body:()=>t.jsxs(Ue,{component:"div",style:{overflowY:"auto"},children:[t.jsx(ct,{title:g("common.environment"),subTitle:g("blocklet.component.addComponentTip.environment")}),t.jsx(ln,{style:{marginTop:-12,width:"100%"},schema:_.configsList,defaultValue:_.configsValue,onChange:(P,{action:I,currentItem:M,allValues:q})=>{I==="confirm"&&G({hasMissRequiredConfigs:po(_.configsList,q),configsValue:q}),I==="edit"?m(M):["cancel","confirm"].includes(I)&&m(null)}})]}),cancel:g("common.pre"),confirm:g("common.next"),onCancel:Ge,onConfirm:xe}),A&&(_!=null&&_.didSpaceIsRequiredSetup)&&de.push({key:"didSpace",name:t.jsxs(t.Fragment,{children:[g("blocklet.component.didSpaceConfig")," ",_.didSpaceIsRequiredSetup==="required"&&t.jsx(dt,{})]}),disabled:(_==null?void 0:_.didSpaceIsRequiredSetup)&&!_.didSpaceEndpoint,body:()=>t.jsx(ys,{children:t.jsxs(Ue,{component:"div",children:[t.jsx(ct,{title:g("blocklet.component.didSpaceConfig"),subTitle:g("blocklet.component.didSpaceConfigTip")}),t.jsx(C,{sx:{mt:"36px","& > div":{maxWidth:"unset !important","& .MuiAutocomplete-root":{maxWidth:"unset !important"}}},children:t.jsx(pn,{blockletMeta:F.current.meta,onNext:()=>{xe()},onEndpointUpdate:ke})})]})}),cancel:g("common.pre"),confirm:g("common.next"),onCancel:Ge,onConfirm:xe}),de.push({key:"install",name:In(A==null?void 0:A.did)?g("common.upgrade"):g("common.install"),disabled:l?!1:at(_.installResultProps),loading:l?!1:at(_.installResultProps),body:t.jsx(Ue,{component:"div",className:"flex-justify-center flex-align-center",style:{flexDirection:"column"},children:at(_.installResultProps)?t.jsx(ps,{message:t.jsx(Ii,{children:g(l?"blocklet.component.installingCanCloseWindowTip":"blocklet.component.installingTip")}),increaseSpeed:.3,messageLoop:!1}):t.jsx("div",{style:{marginTop:120},children:t.jsx(to,{..._.installResultProps})})}),confirm:g("common.complete"),onConfirm:Ao});const se=de[K]||{},Go=()=>w||se.error||!_.bundleDid?!0:K>1?!_.pathPrefix:!1;return U?t.jsxs(ki,{sx:f?{height:{xs:"calc(100vh - 72px - 32px)",md:"72vh"},"&& .ll-header":{p:3},"&& .MuiDialogContent-root":{p:0},"&& .layout-content":{p:0,pl:{xs:0,md:2},pb:0,"& .filter-bar":{pt:0,pl:2}}}:{width:"100%",height:"100vh"},children:[t.jsx(ms,{steps:de,mode:"memory",children:t.jsx(Si,{ref:be,meta:A,isMobile:E,onStepChange:P=>{Te(P)}})}),t.jsxs(C,{className:"action-bar",children:[se.cancel&&t.jsx(pe,{onClick:P=>{P.stopPropagation(),se.onCancel()},disabled:K===de.length-2&&w,color:"inherit",children:se.cancel||g("common.cancel")}),se.confirm&&t.jsx(pe,{onClick:P=>{P.stopPropagation(),se.onConfirm()},color:"primary","data-cy":"submit-confirm-next",disabled:w||(typeof se.disabled=="boolean"?se.disabled:Go()),variant:"contained",autoFocus:!0,title:se.confirm,style:{marginLeft:8,overflow:"hidden",minWidth:"140px",maxWidth:"280px",textAlign:"center"},children:t.jsxs(C,{display:"flex",alignItems:"center",overflow:"hidden",children:[(typeof se.loading=="boolean"?se.loading:w)&&t.jsx(me,{style:{marginRight:8},size:16}),t.jsx(C,{component:"span",flex:1,sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:se.confirm})]})})]})]}):null}xn.propTypes={onClose:s.func,mode:s.oneOf(["normal","embed"]),inDialog:s.bool,stores:s.arrayOf(s.string),storeUrl:s.string,resourceType:s.string,resourceDid:s.string,storageKey:s.string,selectedMeta:s.object,showResourcesSwitch:s.bool,showFromUrl:s.bool,enableRunBackground:s.bool,showCategory:s.bool,installFromUrlParams:s.object};xn.defaultProps={onClose:()=>{},mode:"normal",stores:[],storeUrl:"",resourceType:"",resourceDid:"",storageKey:"",inDialog:!0,selectedMeta:null,showResourcesSwitch:!0,showFromUrl:!0,enableRunBackground:!0,showCategory:!0,installFromUrlParams:null};const ki=$(C)`
|
|
314
|
+
.action-bar {
|
|
315
|
+
display: flex;
|
|
316
|
+
justify-content: flex-end;
|
|
317
|
+
position: sticky;
|
|
318
|
+
bottom: 0;
|
|
319
|
+
padding-top: 16px;
|
|
320
|
+
z-index: 100;
|
|
321
|
+
width: 100%;
|
|
322
|
+
background: ${({theme:e})=>e.palette.background.paper};
|
|
323
|
+
border-top: '1px solid';
|
|
324
|
+
border-color: ${({theme:e})=>e.palette.divider};
|
|
325
|
+
}
|
|
326
|
+
`,Ue=$(oe)`
|
|
327
|
+
width: 100%;
|
|
328
|
+
height: 100%;
|
|
329
|
+
`,ct=$(Eo)`
|
|
330
|
+
margin-bottom: 24px;
|
|
331
|
+
`,_i=$.div`
|
|
332
|
+
position: relative;
|
|
333
|
+
|
|
334
|
+
.choose-blocklet {
|
|
335
|
+
background-color: rgb(236, 251, 253);
|
|
336
|
+
border-color: rgb(236, 251, 253);
|
|
337
|
+
border-radius: 8px;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.check-container {
|
|
341
|
+
position: absolute;
|
|
342
|
+
right: 0;
|
|
343
|
+
bottom: 0;
|
|
344
|
+
display: flex;
|
|
345
|
+
justify-content: flex-end;
|
|
346
|
+
align-items: flex-end;
|
|
347
|
+
width: 30px;
|
|
348
|
+
height: 30px;
|
|
349
|
+
border-radius: 0 0 8px 0;
|
|
350
|
+
color: ${e=>e.theme.palette.common.white};
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
transition: all ease 0.3s;
|
|
353
|
+
&:after {
|
|
354
|
+
position: absolute;
|
|
355
|
+
z-index: 0;
|
|
356
|
+
display: block;
|
|
357
|
+
width: 0;
|
|
358
|
+
height: 0;
|
|
359
|
+
border-top: transparent solid 15px;
|
|
360
|
+
border-left: transparent solid 15px;
|
|
361
|
+
border-bottom: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
362
|
+
border-right: ${e=>e.theme.palette.primary.main} solid 15px;
|
|
363
|
+
transition: all ease 0.1s;
|
|
364
|
+
content: '';
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.check-icon {
|
|
368
|
+
position: relative;
|
|
369
|
+
z-index: 2;
|
|
370
|
+
margin: 0 1px 1px 0;
|
|
371
|
+
font-size: 16px;
|
|
372
|
+
transition: all ease 0.2s;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
`,Ii=$.div`
|
|
376
|
+
color: ${e=>e.theme.palette.primary.main};
|
|
377
|
+
.msg-before {
|
|
378
|
+
display: inline-block;
|
|
379
|
+
color: #aaa;
|
|
380
|
+
font-size: 14px;
|
|
381
|
+
margin-right: 6px;
|
|
382
|
+
}
|
|
383
|
+
`;function St({blocklet:e,showDialog:o,setShowDialog:n,selectedMeta:a,showFromUrl:r,installFromUrlParams:i}){const{t:f}=z(),c=Co(h=>h.breakpoints.down("md")),{inService:u}=X(),x=()=>{n(!1)};return o?t.jsx(Ui,{title:f("blocklet.component.addWithName",{name:B.getDisplayName(e)}),maxWidth:!1,fullWidth:!1,PaperProps:{style:c?{width:"100%",height:window.innerHeight}:{maxWidth:1350,minWidth:930,width:"80%"}},onClose:(h,l)=>{l!=="backdropClick"&&x()},showCloseButton:!0,disableEscapeKeyDown:!0,open:!0,children:t.jsx(xn,{selectedMeta:a,onClose:x,storageKey:u?ls:cs,showFromUrl:r,installFromUrlParams:i})}):null}St.propTypes={selectedMeta:s.object,showDialog:s.bool.isRequired,setShowDialog:s.func.isRequired,blocklet:s.object.isRequired,showFromUrl:s.bool,installFromUrlParams:s.object};St.defaultProps={selectedMeta:null,showFromUrl:!0,installFromUrlParams:null};const Ui=$(xt)`
|
|
384
|
+
.ux-dialog_header {
|
|
385
|
+
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
386
|
+
}
|
|
387
|
+
.MuiDialogContent-root {
|
|
388
|
+
background-color: ${({theme:e})=>e.palette.background.paper};
|
|
389
|
+
}
|
|
390
|
+
`;function yn({blocklet:e,children:o,disabled:n}){var p,v;const{t:a}=z(),[r,i]=d.useState(!1),[f,c]=d.useState({show:!1,params:null}),[u,x]=d.useState({show:!1,params:null}),{getSessionInHeader:h,prefix:l}=X(),S=R=>{R.stopPropagation(),i(!0)},y=d.useCallback(()=>{c(R=>({...R,show:!0}))},[]),g=d.useCallback((R=!1)=>{c(R?{params:null,show:!1}:j=>({...j,show:!1}))},[]),T=d.useCallback(()=>{x({params:null,show:!0})},[]),w=d.useCallback(R=>{x({params:{...R,inStore:!1,isUpload:!0},show:!1}),R.meta&&i(!0)},[]),k=d.useCallback((R=!1)=>{x(R?{params:null,show:!1}:j=>({...j,show:!1}))},[]),b=d.useCallback(R=>{i(R),R||(g(!0),k(!0))},[g,k]),m=d.useMemo(()=>[t.jsxs(Ot.Item,{"data-cy":"add-component-from-url",onClick:y,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Ht,{style:{fontSize:16,marginRight:4}}),a("blocklet.component.addComponentTip.fromUrl")]},"add-component-from-url"),t.jsxs(Ot.Item,{"data-cy":"add-component-from-upload",onClick:T,style:{fontSize:14,color:"primary.main"},children:[t.jsx(Lo,{style:{fontSize:16,marginRight:4}}),a("blocklet.component.addComponentTip.fromUpload")]},"add-component-from-upload")],[T,y,a]);return t.jsxs(t.Fragment,{children:[typeof o=="function"?o({open:S}):t.jsxs(Ot,{onClick:S,disabled:n,size:"small",menuButtonProps:{"data-cy":"add-component-more"},menu:m,children:[t.jsx(Jr,{style:{fontSize:"1.3em",marginRight:4}}),a("blocklet.component.add")]}),t.jsx(St,{showDialog:r,setShowDialog:b,blocklet:e,selectedMeta:((p=f.params)==null?void 0:p.meta)||((v=u.params)==null?void 0:v.meta)||null,installFromUrlParams:f.params||u.params,showFromUrl:!1}),f.show?t.jsx(Po,{mode:"component",onCancel:g,onSuccess:({meta:R,inputUrl:j,inStore:N,registryUrl:O})=>{c({show:!1,params:{meta:R,inputUrl:j,inStore:N,registryUrl:O}}),i(!0)},handleText:{title:a("blocklet.component.addComponentTip.fromUrl"),confirm:a("blocklet.component.choose")}}):null,t.jsx(nn,{open:u.show,did:e.meta.did,prefix:l,headers:h,onUploaded:w,onClose:k})]})}yn.propTypes={children:s.any,blocklet:s.object.isRequired,disabled:s.bool};yn.defaultProps={children:null,disabled:!1};const Di=e=>e.children.filter(o=>o.meta.interfaces.find(n=>n.type===H.BLOCKLET_INTERFACE_TYPE_WEB));function Rt({params:e,setParams:o,setError:n,serviceTypes:a}){const{t:r}=z(),{blocklet:i}=fe(),f=i.meta.did,c=Di(i),[u,x]=d.useState([]),h={301:r("common.redirectPermanently"),302:r("common.redirectTemporary"),307:r("common.redirectTemporary"),308:r("common.redirectPermanently")};return d.useEffect(()=>{if(e.type===D.ROUTING_RULE_TYPES.COMPONENT&&e.componentId){const l=c.find(g=>g.meta.did===e.componentId),S=B.findWebInterface(l.meta),y=(Array.isArray(S==null?void 0:S.pageGroups)?S.pageGroups:[]).map(g=>({value:g,label:`${g} pages`}));y.length&&y.unshift({value:"",label:"All pages"}),x(y),e.pageGroup&&y.find(g=>g.value===e.pageGroup)===!1&&o({...e,pageGroups:""})}},[e.componentId,e.type]),t.jsxs(t.Fragment,{children:[t.jsx(Z,{select:!0,label:r("router.domain.add.type"),autoComplete:"off",variant:"outlined",name:"type","data-cy":"domain-add-type",fullWidth:!0,value:e.type,onChange:l=>{n(""),o({...e,type:l.target.value,did:l.target.value===D.ROUTING_RULE_TYPES.BLOCKLET?f:"",__disableConfirm:!1})},style:{marginBottom:32},SelectProps:{},children:a.map(({name:l,value:S})=>t.jsx(Se,{value:S,children:l},S))}),e.type===D.ROUTING_RULE_TYPES.REDIRECT&&[t.jsx(Z,{select:!0,label:r("router.domain.add.redirect"),autoComplete:"off",variant:"outlined",name:"type",fullWidth:!0,value:e.redirectCode,onChange:l=>o({...e,redirectCode:l.target.value}),style:{marginBottom:32},SelectProps:{},children:Object.keys(h).map(l=>t.jsx(Se,{value:l,children:`${h[l]} - ${l}`},l))},"redirectCode"),t.jsx(Z,{label:r("common.redirectUrl"),autoComplete:"off",variant:"outlined",name:"url",inputProps:{"data-cy":"redirect-url-input"},fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{o({...e,url:l.target.value,__disableConfirm:!l.target.value.trim()}),l.target.value.trim()?n(""):n(r("router.validation.redirectUrlRequired"))}},"redirectUrl")],e.type===D.ROUTING_RULE_TYPES.COMPONENT&&[t.jsx(Z,{select:!0,label:r("router.domain.add.component"),autoComplete:"off",variant:"outlined","data-cy":"select-component-input",name:"componentId",fullWidth:!0,value:e.componentId,onChange:l=>{o({...e,componentId:l.target.value})},style:{marginBottom:32},SelectProps:{},children:c.map(l=>t.jsx(Se,{value:l.meta.did,selected:l.meta.did===e.componentId,children:B.getDisplayName(l,!0)},l.meta.did))},"componentId"),u.length?t.jsx(Z,{select:!0,label:r("router.domain.add.pageGroup"),autoComplete:"off",variant:"outlined",name:"pageGroup","data-cy":"route-group-input",fullWidth:!0,value:e.pageGroup,helperText:r("router.domain.add.pageGroupTip"),style:{marginBottom:32},onChange:l=>{o({...e,pageGroup:l.target.value})},SelectProps:{},children:u.map(l=>t.jsx(Se,{value:l.value,selected:l.value===e.pageGroup,children:l.label},l.label))},"pageGroup"):null].filter(Boolean),e.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(Z,{label:r("common.rewriteUrl"),autoComplete:"off",variant:"outlined",name:"url","data-cy":"rewrite-url-input",fullWidth:!0,value:e.url,helperText:r("router.urlHelperText"),style:{marginBottom:32},onChange:l=>{const S=l.target.value.trim();o({...e,url:l.target.value,__disableConfirm:!S}),n(S?"":r("router.validation.rewriteUrlRequired"))}},"url"),e.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&[t.jsx(Z,{select:!0,label:r("router.rule.add.responseType"),autoComplete:"off",variant:"outlined",name:"responseType",fullWidth:!0,value:e.responseType,onChange:l=>o({...e,responseType:l.target.value}),style:{marginBottom:32},SelectProps:{},children:D.ROUTING_RESPONSE_TYPES.map(l=>t.jsx(Se,{value:l.value,children:l.text},l.value))},"responseType"),t.jsx(Z,{label:r("router.rule.add.responseBody"),autoComplete:"off",variant:"outlined",name:"responseBody","data-cy":"response-body-input",fullWidth:!0,multiline:!0,minRows:3,value:e.responseBody,helperText:r("router.rule.add.responseBodyTip"),style:{marginBottom:32},onChange:l=>{const S=l.target.value.trim();o({...e,responseBody:l.target.value,__disableConfirm:!S}),n(S?"":r("router.rule.add.responseBodyRequired"))}},"response-body")]]})}Rt.propTypes={params:s.object,serviceTypes:s.array,setParams:s.func,setError:s.func};Rt.defaultProps={params:{},serviceTypes:[{name:"Redirect",value:D.ROUTING_RULE_TYPES.REDIRECT},{name:"Default - User will see the 404 page",value:D.ROUTING_RULE_TYPES.NONE},{name:"Rewrite - Route traffic without redirect",value:D.ROUTING_RULE_TYPES.GENERAL_REWRITE},{name:"Response - Response with provided content",value:D.ROUTING_RULE_TYPES.DIRECT_RESPONSE},{name:"Component - Pass traffic to blocklet component",value:D.ROUTING_RULE_TYPES.COMPONENT}],setParams:()=>{},setError:()=>{}};function Cn({children:e,hiddenChildren:o,open:n,onClose:a}){const{t:r}=z(),{api:i}=X(),{blocklet:f}=fe(),[c,u]=d.useState(!1),[x,h]=d.useState(!1),l=f.meta.did,S=f.site.id,y=()=>{a==null||a(),u(!1),h(!1)},g=async b=>{try{const m=await ut(b,r);if(m)throw m;u(!0);const p={from:{pathPrefix:je(b.pathPrefix)},to:{type:b.type}};b.type===D.ROUTING_RULE_TYPES.REDIRECT&&(p.to.url=b.url.trim(),p.to.redirectCode=b.redirectCode),b.type===D.ROUTING_RULE_TYPES.COMPONENT&&(p.to.did=l,p.to.componentId=b.componentId,p.to.pageGroup=b.pageGroup),b.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(p.to.url=je(b.url)),b.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(p.to.response={status:200,contentType:b.responseType,body:b.responseBody}),await i.addRoutingRule({input:{id:S,rule:p,teamDid:l}}),a==null||a()}catch(m){L.error(m.message)}finally{u(!1),h(!1)}},T={title:r("router.rule.add.title"),description:(b,m,p)=>{const v=R=>{if(p(null),ut(R,r)){m({...R,__disableConfirm:!0});return}m({...R})};return t.jsxs(oe,{component:"div",children:[t.jsx(Z,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:b.pathPrefixHint||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:b.pathPrefix,onChange:R=>{let j=!1;const N=ko({params:{...b,pathPrefix:R.target.value},blocklets:[f]});p(N),b.type===D.ROUTING_RULE_TYPES.BLOCKLET&&N&&(j=!0),b.type===D.ROUTING_RULE_TYPES.REDIRECT&&!b.url&&(j=!0),b.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!b.url&&(j=!0),b.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!b.responseType||!b.responseBody)&&(j=!0),R.target.value.trim()||(j=!0,p(r("router.validation.pathPrefixRequired"))),j||p("");const O=r("common.slugifyHint",{value:Vt(R.target.value)});m({...b,pathPrefix:R.target.value,pathPrefixHint:O,__disableConfirm:j})}}),t.jsx(Rt,{params:b,setParams:v,setError:p})]})},confirm:r("router.rule.add.confirm"),cancel:r("common.cancel"),params:{did:"",pathPrefix:"",type:D.ROUTING_RULE_TYPES.REDIRECT,componentId:"",pageGroup:"",redirectCode:302,responseType:"text/plain",responseBody:"",__disableConfirm:!0},onConfirm:g,onCancel:y},w=b=>{b.stopPropagation(),h(!0)};let k=null;return o||(k=typeof e=="function"?e({open:w}):t.jsxs(Se,{onClick:w,className:"rule-action","data-cy":"action-add-rule",children:[c?t.jsx(me,{size:16}):t.jsx(Ht,{style:{fontSize:18,marginRight:5}}),r("router.rule.add.title")]})),t.jsxs(t.Fragment,{children:[k,(n||x)&&t.jsx(Fe,{title:T.title,description:T.description,confirm:T.confirm,cancel:T.cancel,params:T.params,onConfirm:T.onConfirm,onCancel:T.onCancel,color:"primary"})]})}Cn.propTypes={children:s.any,onClose:s.func,hiddenChildren:s.bool,open:s.bool};Cn.defaultProps={children:null,open:!1,onClose:null,hiddenChildren:!1};function Xe({depth:e,className:o}){return t.jsx(C,{ml:Math.max((e-1)*2,0),className:o,sx:{borderBottom:1,borderColor:"rgba(0,0,0,0.12)"}},"group-collapse-box")}Xe.propTypes={depth:s.number,className:s.string};Xe.defaultProps={depth:1,className:""};function jn({id:e,from:o,children:n}){const{t:a}=z(),{api:r}=X(),{blocklet:i}=fe(),[f,c]=d.useState(!1),[u,x]=d.useState(null),h=i.meta.did,l=i.site.id,S=o.pathPrefix,y=()=>{c(!1),x(null)},g=async()=>{c(!0);try{await r.deleteRoutingRule({input:{id:l,ruleId:e,teamDid:h}})}catch(k){L.error(k.message)}finally{x(null),c(!1)}},T={keyName:S,title:a("router.rule.delete.title"),description:a("router.rule.delete.description",{name:`<b>${S}</b>`}),confirmPlaceholder:a("router.rule.delete.confirm_desc",{name:S}),confirm:a("common.delConfirm"),cancel:a("router.rule.delete.cancel"),onConfirm:g,onCancel:y},w=k=>{k.stopPropagation(),x(T)};return t.jsxs(t.Fragment,{children:[typeof n=="function"?n({loading:f,open:w}):t.jsxs(Se,{onClick:w,className:"rule-action","data-cy":"action-delete-rule",children:[f?t.jsx(me,{size:16}):t.jsx(jt,{style:{fontSize:18,marginRight:5}}),a("router.rule.delete.title")]}),u&&t.jsx(Ls,{keyName:u.keyName,title:u.title,description:u.description,confirmPlaceholder:u.confirmPlaceholder,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel})]})}jn.propTypes={id:s.string.isRequired,from:s.object.isRequired,children:s.any};jn.defaultProps={children:null};function vn({id:e,from:o,to:n,children:a}){var b,m;const{t:r}=z(),{api:i}=X(),{blocklet:f}=fe(),[c,u]=d.useState(!1),[x,h]=d.useState(null),l=f.meta.did,S=f.site.id,y=o.pathPrefix,g=()=>{u(!1),h(null)},T=async p=>{try{const v=await ut(p,r);if(v)throw v;u(!0);const R={id:e,from:{pathPrefix:je(p.pathPrefix)},to:{type:p.type}};p.type===D.ROUTING_RULE_TYPES.REDIRECT&&(R.to.url=p.url,R.to.redirectCode=p.redirectCode),p.type===D.ROUTING_RULE_TYPES.COMPONENT&&(R.to.did=l,R.to.componentId=p.componentId,R.to.pageGroup=p.pageGroup),p.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&(R.to.url=je(p.url)),p.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(R.to.response={status:200,contentType:p.responseType,body:p.responseBody}),await i.updateRoutingRule({input:{id:S,rule:R,teamDid:l}})}catch(v){L.error(v.message)}finally{u(!1),h(null)}},w={title:r("router.rule.update.title"),description:(p,v,R)=>{const j=N=>{if(ut(N,r)){v({...N,__disableConfirm:!0});return}v({...N})};return t.jsxs(oe,{component:"div",children:[t.jsx(Z,{label:r("router.rule.add.pathPrefix"),autoComplete:"off",variant:"outlined",name:"pathPrefix",inputProps:{"data-cy":"path-prefix-input"},fullWidth:!0,autoFocus:!0,helperText:p.helperText||r("router.rule.add.pathPrefixTip"),style:{marginBottom:32},margin:"dense",value:p.pathPrefix,onChange:N=>{let O=!1;p.type===D.ROUTING_RULE_TYPES.REDIRECT&&!p.url&&(O=!0),p.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&!p.url&&(O=!0),p.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&(!p.responseType||!p.responseBody)&&(O=!0),N.target.value.trim()||(O=!0,R(r("router.validation.pathPrefixRequired"))),O||R("");const he=r("common.slugifyHint",{value:Vt(N.target.value)});v({...p,pathPrefix:N.target.value,helperText:he,__disableConfirm:O})}}),t.jsx(Rt,{params:p,setParams:j,setError:R})]})},confirm:r("router.rule.update.confirm"),cancel:r("router.rule.update.cancel"),color:"primary",params:{did:n.did||"",pathPrefix:y==="/"?y:y.replace(/^\/+/,"").replace(/\/+$/,""),type:n.type||D.ROUTING_RULE_TYPES.BLOCKLET,redirectCode:n.redirectCode||302,componentId:n.componentId||"",pageGroup:n.pageGroup||"",url:n.url||"",responseType:((b=n.response)==null?void 0:b.contentType)||"",responseBody:(((m=n.response)==null?void 0:m.body)||"").replace(/\\"/g,'"'),__disableConfirm:!1},onConfirm:T,onCancel:g},k=p=>{p.stopPropagation(),h(w)};return t.jsxs(t.Fragment,{children:[typeof a=="function"?a({loading:c,open:k}):t.jsxs(Se,{onClick:k,className:"rule-action","data-cy":"action-update-rule",children:[c?t.jsx(me,{size:16}):t.jsx(Ro,{style:{fontSize:18,marginRight:5}}),r("router.rule.update.title")]}),x&&t.jsx(Fe,{title:x.title,description:x.description,confirm:x.confirm,color:x.color,cancel:x.cancel,params:x.params,onConfirm:x.onConfirm,onCancel:x.onCancel})]})}vn.propTypes={id:s.string.isRequired,from:s.object.isRequired,to:s.object.isRequired,children:s.any};vn.defaultProps={children:null};function bn(e){const{locale:o}=z(),{blocklet:n,recommendedDomain:a}=fe(),r=vo(a,e.from.pathPrefix,Yt(n,o));return t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(C,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:r,rel:"noopener noreferrer",title:r,children:t.jsx(ee,{size:"small",children:t.jsx(Io,{})})}),t.jsx(vn,{...e,children:({open:i})=>t.jsx(ee,{size:"small",onClick:i,disabled:e.isProtected,"data-cy":"action-update-rule",children:t.jsx(Zr,{})})}),t.jsx(jn,{...e,children:({open:i})=>t.jsx(ee,{size:"small",onClick:i,disabled:e.isProtected,"data-cy":"action-delete-rule",children:t.jsx(jt,{})})})]})}bn.propTypes={isProtected:s.bool};bn.defaultProps={isProtected:!1};function Bo({group:e,...o}){return e?t.jsx(Ke,{type:"reverse",...o,children:e}):null}Bo.propTypes={group:s.string.isRequired};function pt({domain:e,isHttps:o,toUrl:n}){const a=o?"https":"http";let r=n;return Tr(r)||(r=`${a}://${e}${n}`),t.jsx(yt,{href:r,target:"_blank",style:{fontSize:14},underline:"hover",children:n},r)}pt.propTypes={domain:s.string.isRequired,toUrl:s.string.isRequired,isHttps:s.bool};pt.defaultProps={isHttps:!1};function wt({hasPermission:e}){const{t:o,locale:n}=z(),a=gt(),{blocklet:r,recommendedDomain:i}=fe();return r.site.rules.filter(c=>c.to.type!==D.ROUTING_RULE_TYPES.BLOCKLET).map(c=>{var l;let u=null,x=null;c.to.type===D.ROUTING_RULE_TYPES.NONE?u="404":c.to.type===D.ROUTING_RULE_TYPES.REDIRECT?u=c.to.redirectCode:c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE?u="R":c.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE?u=t.jsx(As,{sx:{color:"text.secondary",fontSize:"45px"}}):c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&(x=r.children.find(S=>S.meta.did===c.to.componentId),u="C");const h=c.isProtected?t.jsx(Ce,{title:o("blocklet.router.urlLockTooltip"),placement:"top",children:t.jsx("span",{children:t.jsx(ee,{disabled:!0,size:"small",style:{pointerEvents:"auto",paddingTop:0,paddingBottom:0,margin:"12px 0"},children:t.jsx(Ps,{style:{fill:a.palette.text.disabled}})})})}):t.jsx(bn,{...c});return[t.jsxs(C,{display:"flex",py:2,className:"component-item",justifyContent:"space-between",alignItems:"center",children:[t.jsxs(C,{width:{xs:300,md:400},display:"flex",alignItems:"center",children:[t.jsx(C,{className:"component-item__indent",width:28}),typeof u=="object"?u:t.jsx(Rr,{children:u}),t.jsxs(C,{sx:{ml:2,flex:1,wordBreak:"break-word"},children:[t.jsxs(C,{style:{color:"text.primary",fontSize:16},children:[c.to.type===D.ROUTING_RULE_TYPES.NONE&&o("common.page404"),c.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&o("common.redirect"),c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&o("common.rewrite"),c.to.type===D.ROUTING_RULE_TYPES.DIRECT_RESPONSE&&((l=D.ROUTING_RESPONSE_TYPES.find(S=>S.value===c.to.response.contentType))==null?void 0:l.text),c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&B.getDisplayName(x,!0)]}),t.jsxs(C,{display:"flex",alignItems:"center",children:[c.to.type===D.ROUTING_RULE_TYPES.REDIRECT&&t.jsx(pt,{domain:i,toUrl:c.to.url}),c.to.type===D.ROUTING_RULE_TYPES.GENERAL_REWRITE&&t.jsx(pt,{domain:i,toUrl:c.to.url}),c.to.type===D.ROUTING_RULE_TYPES.COMPONENT&&t.jsx(Bo,{group:c.to.pageGroup})]})]})]}),t.jsx(C,{px:2,sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:t.jsx(yt,{href:vo(i,c.from.pathPrefix,Yt(r,n)),target:"_blank",style:{fontSize:16,color:"inherit"},underline:"hover",children:wr(c.from.pathPrefix,"/")||"/"})},c.from.pathPrefix),t.jsx(C,{children:e&&t.jsx("div",{style:{textAlign:"right"},children:h})},"actions")]},"rule"),t.jsx(Xe,{},"divider")]})}wt.propTypes={hasPermission:s.bool};wt.defaultProps={hasPermission:!1};const Ni=Ct(wt,"mutate_blocklets"),Li=Ct(wt,"",Ye);function Bi(e){const{inService:o}=X();return o?t.jsx(Li,{...e}):t.jsx(Ni,{...e})}function Oi(e,o){const n=d.useRef(o);d.useEffect(()=>{const a=r=>n.current(r.detail);return window.addEventListener(e,a),()=>window.removeEventListener(e,a)},[e])}function Mi(e){const o=bo(),{t:n}=z(),a=()=>{const r=new URLSearchParams(window.location.search);r.get("checkUpdate")&&(r.delete("checkUpdate"),o(r.toString()),e(),L.success(n("notification.checkingForUpdates")))};d.useEffect(a,[]),Oi("checkUpdate",a)}function $i({blocklet:e,scrollToComponent:o}={blocklet:null,scrollToComponent:!1}){const n=bo(),{t:a}=z(),r=d.useRef(null),i=d.useMemo(()=>{if(!e||!e.optionalComponents)return null;const f=new URLSearchParams(window.location.search),c=f.get("install-component");if(c){r.current=c,f.delete("install-component"),n(f.toString());const u=e.optionalComponents.find(h=>h.meta.did===c);if(!u)return L.success(a("notification.installComponentError",{did:c})),null;const{meta:x}=u;if(o){const h=document.getElementById(`optional-component-${c}`),l=document.querySelector(".dashboard-main");if(h){const S=h.getBoundingClientRect(),y=l.getBoundingClientRect();l.scrollTo({top:S.top-y.top+l.scrollTop,behavior:"smooth"})}}return x}return null},[e,n,a,o]);return d.useEffect(()=>{var f;r.current&&window.opener&&window.opener.postMessage({blocklet:e,kind:"component-installer"},(f=window.blocklet)==null?void 0:f.appUrl)},[e]),i}function Tt({open:e,onClose:o,blocklet:n,ancestors:a}){var x;const{t:r}=z(),i=[...(a||[]).map(h=>{var l;return((l=h==null?void 0:h.meta)==null?void 0:l.did)||""}),((x=n==null?void 0:n.meta)==null?void 0:x.did)||""].filter(Boolean).join("/"),f=r("preferencesFor",{name:B.getDisplayName(n,!0)}),c=d.useMemo(()=>({position:"relative",minHeight:"50vh",height:"100%",overflow:"hidden",border:0}),[]);if(qe(n.status)||n.status==="unknown"&&qe(n.status))return null;const u=()=>{o==null||o()};return t.jsx(Ai,{open:e,fullWidth:!0,maxWidth:"md",title:f,onClose:u,PaperProps:{style:{minHeight:"500px"}},children:t.jsxs(go,{gap:1,children:[t.jsx(oe,{sx:{fontSize:12,color:"text.secondary",mb:.5},children:r("description.preferences",{name:B.getDisplayName(n,!0)})}),t.jsx(Qr,{id:i,styles:c})]})})}Tt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,open:s.bool,onClose:s.func};Tt.defaultProps={ancestors:[],open:!1,onClose:null};const Ai=$(xt)`
|
|
391
|
+
.MuiDialogContent-root {
|
|
392
|
+
padding-top: 0;
|
|
393
|
+
padding-bottom: 24px;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
.MuiToolbar-root {
|
|
397
|
+
padding-right: 0;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.ux-dialog_closeButton {
|
|
401
|
+
margin: 0;
|
|
402
|
+
}
|
|
403
|
+
`;function Sn({component:e,remove:o,disabled:n,tip:a,showConfirm:r,hideBtn:i,onCancel:f}){const{t:c}=d.useContext(ve),[u,x]=d.useState(!1),[h,l]=d.useState(null),S=async k=>{x(!0),await o(k.component,k.removeType),x(!1),l(null)},y=n||u,g=()=>{l({title:`${c("common.delete")} ${e.meta.title||e.meta.name}`,description:(k,b)=>t.jsxs(oe,{component:"div",children:[t.jsx(oe,{gutterBottom:!0,children:c("blocklet.action.removeComponentDescription")}),t.jsxs(Bs,{name:"removeType",value:k.removeType,onChange:m=>b({...k,removeType:m.target.value}),children:[t.jsx(zt,{value:"keepData",control:t.jsx(oo,{}),label:c("blocklet.action.removeComponentKeepData")}),t.jsx(zt,{value:"complete",control:t.jsx(oo,{}),label:c("blocklet.action.removeComponentComplete")})]})]}),confirm:c("common.confirm"),cancel:c("common.cancel"),params:{component:e,removeType:"keepData"},onConfirm:S,onCancel:()=>{l(null),f()}})};d.useEffect(()=>{r?g():(x(!1),l(null))},[r]);const T=t.jsx(qi,{size:"small",disabled:y,onClick:()=>g,"data-cy":"delete-component-btn",children:t.jsx(jt,{disabled:y})}),w=t.jsx(Ce,{title:a||c("common.delete"),children:t.jsx("span",{children:T})});return t.jsxs(t.Fragment,{children:[!i&&w,h&&t.jsx(Fe,{title:h.title,description:h.description,confirm:h.confirm,cancel:h.cancel,params:h.params,onConfirm:h.onConfirm,onCancel:h.onCancel})]})}Sn.propTypes={component:s.object.isRequired,remove:s.func,onCancel:s.func,disabled:s.bool,showConfirm:s.bool,hideBtn:s.bool,tip:s.string};Sn.defaultProps={remove:async()=>{},disabled:!1,showConfirm:!1,hideBtn:!1,onCancel:()=>{},tip:""};const qi=$(ee)`
|
|
404
|
+
&.Mui-disabled {
|
|
405
|
+
opacity: 0.5;
|
|
406
|
+
}
|
|
407
|
+
`;function Rn({component:e,onStart:o,onStop:n,disabled:a,tip:r}){const{t:i}=d.useContext(ve),[f,c]=d.useState(!1),[u,x]=d.useState(),h=async()=>{c(!0);try{await o(e)}catch(w){L.error(w.message)}c(!1)},l=async()=>{c(!0);try{await n(e)}catch(w){L.error(w.message)}c(!1)},S=a||f,y=["starting","running","stopping"].includes(e.status),g=y?qr:Fr,T=t.jsx(Fi,{disabled:S,onClick:()=>{var w;y?x({title:`${i("common.stop")} ${(w=e==null?void 0:e.meta)==null?void 0:w.title}`,description:i("blocklet.action.stopComponentDescription"),confirm:i("blocklet.action.confirmStop"),cancel:i("common.cancel"),onConfirm:()=>(x(null),l()),onCancel:()=>x(null)}):h()},"data-cy":`${y?"stop":"start"}-component-btn`,children:t.jsx(g,{disabled:S,fontSize:"small"})});return[t.jsx(Ce,{title:r||i(`common.${y?"stop":"start"}`),children:t.jsx("span",{children:T})},"btn"),u&&t.jsx(Fe,{title:u.title,description:u.description,confirm:u.confirm,cancel:u.cancel,params:u.params,onConfirm:u.onConfirm,onCancel:u.onCancel},"connect")]}Rn.propTypes={component:s.object.isRequired,onStart:s.func,onStop:s.func,disabled:s.bool,tip:s.string};Rn.defaultProps={onStart:async()=>{},onStop:async()=>{},disabled:!1,tip:""};const Fi=$(ee)`
|
|
408
|
+
&.Mui-disabled {
|
|
409
|
+
opacity: 0.5;
|
|
410
|
+
}
|
|
411
|
+
`;function wn({sourceInfo:e,blocklet:o}){var r;const{t:n}=d.useContext(ve);let{source:a}=e;return a==="registry"&&(a="Blocklet Store"),t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(Er,{type:"success",children:Os(a)},"source"),e.source==="registry"&&t.jsx(yt,{href:He(e.deployedFrom,"blocklets",((r=o==null?void 0:o.meta)==null?void 0:r.bundleDid)||""),target:"_blank",className:"page-link",underline:"hover",style:{display:"flex",alignItems:"center",marginLeft:8},children:n("blocklet.overview.viewInStore")})]})}wn.propTypes={sourceInfo:s.shape({source:s.string,deployedFrom:s.string}),blocklet:s.object};wn.defaultProps={sourceInfo:{},blocklet:{}};var Tn={},zi=ht;Object.defineProperty(Tn,"__esModule",{value:!0});var Oo=Tn.default=void 0,Gi=zi(ft()),Wi=t;Oo=Tn.default=(0,Gi.default)((0,Wi.jsx)("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward");function Et({blocklet:e,checkUpgrade:o,hasPermission:n,...a}){const{api:r}=X(),{t:i}=d.useContext(ve),[f,c]=d.useState(!1),[u,x]=d.useState(""),[h,l]=d.useState(null),[S,y]=d.useState(null);d.useEffect(()=>{l(null),o&&(e.mode,H.BLOCKLET_MODES.DEVELOPMENT)},[e,o]);const g=()=>{c(!1),y(null)},T=async()=>{c(!0);try{const k={did:e.meta.did,version:h.version,storeUrl:h.registryUrl||""};await Ve(2e3),await r.upgradeBlocklet({input:k})}catch(k){L.error(`Blocklet upgrade failed: ${ae(k)}`)}finally{c(!1),y(null)}},w={title:`${i("common.upgrade")} ${i("common.blocklet")} ${B.getDisplayName(e)}`,description:i("blocklet.action.upgradeDescription"),confirm:i("blocklet.action.confirmUpgrade"),cancel:i("common.cancel"),onConfirm:T,onCancel:g};return n&&h&&!B.isInProgress(e.status)?t.jsxs(t.Fragment,{children:[t.jsx(Ke,{...a,children:e.meta.version}),t.jsx(Ce,{title:i("common.updateAvailable",{version:h.version}),children:t.jsx(ee,{size:"small",style:{marginLeft:8},disabled:f,onClick:()=>y(w),children:f?t.jsx(me,{size:16}):t.jsx(Oo,{style:{fontSize:16,color:"red"}})})}),!!u&&t.jsx(L,{variant:"error",message:u,onClose:()=>x("")}),S&&t.jsx(Fe,{title:S.title,description:S.description,confirm:S.confirm,cancel:S.cancel,params:S.params,onConfirm:S.onConfirm,onCancel:S.onCancel})]}):t.jsx(Ke,{...a,children:e.meta.version})}Et.propTypes={blocklet:s.object.isRequired,checkUpgrade:s.bool,hasPermission:s.bool};Et.defaultProps={checkUpgrade:!1,hasPermission:!1};const Vi=Ct(Et,"mutate_blocklets"),Yi=Ct(Et,"",Ye);function Ki(e){const{inService:o}=X();return o?t.jsx(Yi,{...e}):t.jsx(Vi,{...e})}const Hi=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},Xi=(e,o)=>e?[{name:o("common.name"),value:e.displayName},{name:o("common.description"),value:e.description},{name:o("common.version"),value:t.jsx(Ke,{children:e.version})}]:[],Zi=e=>{const{source:o,deployedFrom:n,bundleSource:a}=e;if(o)return{source:o,deployedFrom:n};if(!a)return{source:"upload",deployedFrom:n};if(a.url){const r=n||Array.isArray(a.url)?a.url[0]:a.url;return{source:"url",deployedFrom:r,link:r}}if(a.store){const r=n||Array.isArray(a.store)?a.store[0]:a.store;return{source:"registry",deployedFrom:r,link:r}}return{}},Qi=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const i=[];for(;a&&r<n.length;){const f=a.children.find(c=>c.meta.did===n[r]);a=f,r++,f&&i.push(f.meta.title)}return i.join(" / ")};function En({blocklet:e,depth:o,componentInfo:n,app:a,onClose:r}){var y,g;const{t:i,locale:f}=d.useContext(ve),{deletingBlocklets:c}=Kt();let{status:u}=e;o===1&&c.includes(e.meta.did)&&(u="deleting");const x=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),h=T=>T.map(w=>w.name===i("common.did")||w.name===i("blocklet.appId")?t.jsx(Mt,{valueComponent:"div",nameWidth:120,name:w.name,nameFormatter:()=>w.name,children:w.value},w.name):t.jsx(Mt,{valueComponent:"div",nameWidth:120,name:w.name,children:w.link?t.jsx(yt,{href:w.link,target:"_blank",className:"page-link",underline:"hover",children:w.value}):w.value},w.name)),l=n?Zi(n):{},S=n?[{name:i("common.name"),value:B.getDisplayName(n,!0)},{name:i("common.version"),value:t.jsx(Ki,{blocklet:n,checkUpgrade:!1})},{name:i("common.status"),value:t.jsx(Uo,{isResource:Hi(e),status:u,source:n.source,progress:e.progress})},e.status==="running"?{name:i("blocklet.startedAt"),value:e.startedAt?t.jsx(Bt,{value:e.startedAt,type:"all",locale:f}):"-"}:null,e.status!=="running"?{name:i("blocklet.stoppedAt"),value:e.stoppedAt?t.jsx(Bt,{value:e.stoppedAt,type:"all",locale:f}):"-"}:null,e.installedAt?{name:i("blocklet.installedAt"),value:e.installedAt?t.jsx(Bt,{value:e.installedAt,type:"all",locale:f}):"-"}:null,B.hasStartEngine(e.meta)?{name:i("common.mountPoint"),value:x}:null,n.meta.group?{name:i("common.group"),value:t.jsx(Ke,{type:"success",children:n.meta.group})}:null,{name:i("blocklet.overview.source"),value:t.jsx(wn,{sourceInfo:l,blocklet:e})},{name:i("blocklet.overview.deployedFrom"),value:l.deployedFrom||"-",link:l.link??""},{name:i("common.did"),value:t.jsx(Pr,{did:n.meta.did,showQrcode:!0})},{name:i("common.author"),value:n.meta.owner?t.jsx(ks,{owner:n.meta.owner,locale:f}):_s.formatPerson(n.meta.author)},{name:i("common.engine"),value:Xi(n.engine,i).map(({name:T,value:w})=>t.jsx(Mt,{style:{marginBottom:4},nameWidth:120,name:T,children:w},T))},(y=e.dependents)!=null&&y.length?{name:i("common.dependents"),value:t.jsx(C,{children:e.dependents.map(T=>t.jsx(C,{children:`${Qi(T.id,a)} ${T.required?`(${i("common.required")})`:""}`},T.id))})}:null,(g=e.meta.resources)!=null&&g.length?{name:i("common.resource"),value:e.meta.resources.join(", ")}:null].filter(Boolean):[];return n?t.jsx(xt,{open:!0,title:i("common.componentBasicInfo"),showCloseButton:!0,fullWidth:!0,maxWidth:"md",onClose:()=>{r(null)},children:t.jsx(C,{paddingBottom:1.5,children:h(S)},"dialog-wrapper")},"base-info-dialog"):null}En.propTypes={blocklet:s.object.isRequired,depth:s.number,app:s.object,componentInfo:s.object,onClose:s.func.isRequired};En.defaultProps={depth:0,app:null,componentInfo:null};$(So)`
|
|
412
|
+
.BaseBadge-badge {
|
|
413
|
+
top: ${e=>e.top*8||6}px;
|
|
414
|
+
right: ${e=>e.right*8||6}px;
|
|
415
|
+
}
|
|
416
|
+
`;$(C)`
|
|
417
|
+
.component-header {
|
|
418
|
+
display: flex;
|
|
419
|
+
align-items: center;
|
|
420
|
+
align-items: flex-end;
|
|
421
|
+
cursor: pointer;
|
|
422
|
+
}
|
|
423
|
+
.component-name {
|
|
424
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
425
|
+
font-size: 16px;
|
|
426
|
+
}
|
|
427
|
+
.component-version {
|
|
428
|
+
color: ${({theme:e})=>e.palette.grey[400]};
|
|
429
|
+
font-size: 12px;
|
|
430
|
+
margin-left: 4px;
|
|
431
|
+
transform: translateY(-1px);
|
|
432
|
+
}
|
|
433
|
+
`;function Mo({blocklet:e,ancestors:o,mountPoint:n,href:a}){const[r,i]=d.useState(!1),[f,c]=d.useState(!1),[u,x]=d.useState(!1),[h,l]=d.useState(n),{api:S}=X(),y=!o.length,g=y?e.meta.did:o.map(j=>j.meta.did)[0],{t:T}=z(),{confirmApi:w,confirmHolder:k}=kr();d.useEffect(()=>{c(!1),i(!1),x(!1)},[n]);const b=()=>{i(!1),c(!1),l(n)},m=async()=>{x(!0),i(!1);try{const j={rootDid:g,mountPoint:je(h)};y||(j.did=e.meta.did),await S.updateComponentMountPoint({input:j})}catch(j){throw j.message=ae(j),L.error(j.message),j}finally{b()}},p=_r(()=>{w.open({title:T("common.noticeTitle"),content:t.jsxs(C,{sx:{color:"#9397A1","& > li":{listStyle:"disc",ml:1.5}},children:[t.jsx(oe,{sx:{mb:1.5},children:T("blocklet.mountPoint.description1")}),t.jsx(oe,{component:"li",children:T("blocklet.mountPoint.case1")}),t.jsx(oe,{component:"li",children:T("blocklet.mountPoint.case2")}),t.jsx(oe,{sx:{mt:1.5},children:T("blocklet.mountPoint.description2")})]}),confirmButtonText:T("common.confirm"),cancelButtonText:T("common.cancel"),async onConfirm(j){await m(),j()},confirmButtonProps:{"data-cy":"edit-mount-point-confirm"}})}),v=j=>{j==null||j.preventDefault(),je(h)!==n?p():c(!1)},R=f?t.jsxs(C,{sx:{ml:1},children:[t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),"data-cy":"edit-mount-point-submit",onClick:v,children:t.jsx(C,{component:J,icon:"material-symbols:done",sx:{color:"primary.main",transition:"0.3s opacity"}})}),t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:b,children:t.jsx(C,{component:J,icon:"iconoir:cancel",sx:{color:"primary.main",transition:"0.3s opacity"}})})]}):t.jsx(ee,{size:"medium",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>c(!0),children:t.jsx(C,{component:J,"data-cy":"edit-mount-point",icon:"lets-icons:edit-light",sx:{opacity:r?1:0,color:"primary.main",transition:"0.3s opacity"}})});return t.jsxs(C,{sx:{display:{xs:"none",md:"flex"}},alignItems:"center",flexGrow:"1",children:[k,f?t.jsx("form",{onSubmit:v,children:t.jsx(Z,{style:{flex:1},fullWidth:!0,"data-cy":"edit-mount-point-input",value:h,onChange:j=>l(j.target.value),autoFocus:!0,size:"small",variant:"outlined",placeholder:n})}):t.jsx(C,{component:"a",target:"_blank",href:a,rel:"noopener noreferrer",title:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:t.jsx(C,{maxWidth:400,sx:{color:"primary.main",fontSize:16,px:2},overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",children:Ir(n)})}),u?t.jsx(me,{size:20,sx:{ml:1}}):R]},n)}Mo.propTypes={mountPoint:s.string.isRequired,href:s.string.isRequired,blocklet:s.object.isRequired,ancestors:s.array.isRequired};const Ji=e=>{var o;return!((o=e==null?void 0:e.meta)!=null&&o.group)},fo=(e,o)=>{const n=e.split("/").slice(1);let a=o,r=0;const i=[];for(;a&&r<n.length;){const f=a.children.find(c=>c.meta.did===n[r]);a=f,r++,f&&i.push(f.meta.title)}return i.join(" / ")};function mt({blocklet:e,ancestors:o,depth:n,onRemove:a,onStart:r,onStop:i,onRestart:f,getComponentUrl:c,app:u}){var ge,we,_;const{t:x}=d.useContext(ve),[h,l]=d.useState(),[S,y]=d.useState(!1),[g,T]=d.useState(!1),[w,k]=d.useState(null),{info:b}=X(),[m,p]=d.useState(!1),[v,R]=d.useState(!1),{deletingBlocklets:j}=Kt();let{status:N}=e;n===1&&j.includes(e.meta.did)&&(N="deleting");const O=`/${e.mountPoint||"/"}`.replace(/\/+/g,"/"),he=c(O),Y=B.isInProgress(u.status),U=B.isInProgress(e.status);let Re="";if(Y||U||n===1&&j.includes(e.meta.did))Re=x("blocklet.component.tip.stopBlocklet");else if((ge=e.dependents)!=null&&ge.length){const W=e.dependents.filter(K=>K.required);if(W.length){const K=W.map(Te=>fo(Te.id,u));Re=x("blocklet.component.tip.requiredBy",{name:K.join(", ")})}}const Q=async(...W)=>{T(!0);try{await a(...W)}catch{}T(!1),y(!1)},{usingDocker:De,usingIsolation:Ne}=d.useMemo(()=>{var be,le;if(!e.meta.group||e.meta.group==="static")return{usingDocker:!1,usingIsolation:!1};const W=!!(b!=null&&b.enableDocker)||((be=window.blocklet)==null?void 0:be.enableDocker),K=[...u.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER"&&E.value),Te=[...u.configs,...e.configs].find(E=>E.key==="USE_DOCKER"&&E.value),F=[...u.configs,...e.configs].find(E=>E.key==="SKIP_DOCKER_NETWORK"&&E.value);return{usingDocker:W?!K:!!Te,usingIsolation:W&&!F&&((b==null?void 0:b.enableDockerNetwork)||((le=window.blocklet)==null?void 0:le.enableDockerNetwork))}},[e.configs,b==null?void 0:b.enableDocker,b==null?void 0:b.enableDockerNetwork,u.configs,e.meta.group]);return t.jsxs(t.Fragment,{children:[t.jsxs(Pn,{display:"flex",py:2,className:"component-item",justifyContent:"flex-start",alignItems:"center",children:[t.jsxs(C,{pl:2,width:{xs:250,sm:400},display:"flex",alignItems:"center",children:[t.jsx(Ur,{blocklet:e,ancestors:o}),t.jsxs(C,{ml:"16px",sx:{minWidth:0},children:[t.jsxs(C,{className:"component-header",onClick:()=>l(e),children:[t.jsx(C,{className:"component-name",children:B.getDisplayName(e,!0)}),t.jsx(C,{className:"component-version",children:(we=e==null?void 0:e.meta)==null?void 0:we.version})]}),t.jsxs(C,{display:"flex",alignItems:"center",sx:{mt:"2px",ml:-.5},children:[N!=="unknown"&&t.jsx(Uo,{style:{marginLeft:4},status:N,source:e.source,progress:e.progress}),t.jsx(Is,{style:{marginLeft:4},mode:e.mode||""}),e.mode!=="development"&&De&&t.jsx(Ce,{title:x("blocklet.usingDocker"),children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:To})})}),e.mode!=="development"&&Ne&&t.jsx(Ce,{title:x("blocklet.usingIsolation"),children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"streamline:network"})})}),!!((_=e.dependents)!=null&&_.length)&&t.jsx(Ce,{title:[`${x("common.dependents")}: `,e.dependents.map(W=>t.jsx(C,{pl:1,children:`${fo(W.id,u)} ${W.required?`(${x("common.required")})`:""}`},W.id))],children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"octicon:package-dependents-16"})})})]})]})]},e),jo.hasMountPoint(e.meta)&&t.jsx(Mo,{blocklet:e,ancestors:o,mountPoint:O,href:he},O),t.jsx("div",{style:{flex:1}}),t.jsxs(C,{display:"flex",alignItems:"center",children:[B.hasStartEngine(e.meta)&&t.jsx(Ce,{title:x("common.visit"),children:t.jsx(C,{component:"a",sx:{display:{xs:"flex",md:"none"}},target:"_blank",href:he,rel:"noopener noreferrer",children:t.jsx(ee,{size:"small",children:t.jsx(Io,{})})})}),t.jsx(Rn,{blocklet:u,component:e,onStart:r,onStop:i,disabled:!["starting","stopping"].includes(u.status)&&B.isInProgress(u.status)}),t.jsx(ee,{onClick:()=>R(!0),disabled:Y||U,children:t.jsx(Qt,{fontSize:"small"})}),t.jsx(Wt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(Do,{"data-cy":"component-actions",actions:[B.hasStartEngine(e.meta)||Ji(e)?{icon:t.jsx(Dr,{}),text:x("common.detail"),onClick:()=>{l(e)}}:null,{icon:t.jsx(zr,{}),text:x("common.restart"),onClick:()=>{k({title:`${x("common.restart")} ${e.meta.title}`,description:x("blocklet.action.restartDescription"),confirm:x("blocklet.action.confirmRestart"),cancel:x("common.cancel"),onConfirm:async()=>{T(!0),await f(e),T(!1),k(null)},onCancel:()=>k(null)})},disabled:g||Y||U||e.status!=="running"},{icon:t.jsx(jt,{}),text:x("common.delete"),onClick:()=>{y(!0)},disabled:Y||U||!!Re,tip:Re},{separator:!0},{icon:t.jsx(J,{icon:"mdi:variable"}),onClick:()=>{p(!0)},text:t.jsx(Wt,{color:"error",badgeContent:"",variant:"dot",invisible:!B.getComponentMissingConfigs(e,o[0]).length,children:t.jsx(C,{sx:{width:"100%"},children:x("common.environments")})}),disabled:Y||U}].filter(Boolean)})})]},"actions")]},"group-not-gateway-box"),t.jsx(Xe,{},"line"),t.jsx(En,{componentInfo:h,onClose:l,blocklet:e,app:u,depth:n}),t.jsx(Sn,{blocklet:u,component:e,remove:Q,onCancel:()=>y(!1),hideBtn:!0,showConfirm:S},"delete-component"),w&&t.jsx(Fe,{title:w.title,description:w.description,confirm:w.confirm,cancel:w.cancel,params:w.params,onConfirm:w.onConfirm,onCancel:w.onCancel},"confirm-setting"),m&&t.jsx(vt,{open:!0,hiddenChildren:!0,onClose:()=>p(!1),blocklet:e,ancestors:o}),v&&t.jsx(Tt,{open:!0,onClose:()=>R(!1),blocklet:e,ancestors:o})]})}mt.propTypes={blocklet:s.object.isRequired,ancestors:s.array,depth:s.number,onRemove:s.func,onStart:s.func,onStop:s.func,onRestart:s.func,getComponentUrl:s.func,app:s.object};mt.defaultProps={ancestors:[],depth:0,onRemove:()=>{},onStart:()=>{},onStop:()=>{},onRestart:()=>{},getComponentUrl:()=>window.location.origin,app:null};const Wt=$(So)`
|
|
434
|
+
.BaseBadge-badge {
|
|
435
|
+
top: ${e=>e.top*8||6}px;
|
|
436
|
+
right: ${e=>e.right*8||6}px;
|
|
437
|
+
}
|
|
438
|
+
`,Pn=$(C)`
|
|
439
|
+
&:hover {
|
|
440
|
+
background-color: rgba(0, 0, 0, 0.05);
|
|
441
|
+
}
|
|
442
|
+
.component-header {
|
|
443
|
+
display: flex;
|
|
444
|
+
align-items: center;
|
|
445
|
+
align-items: flex-end;
|
|
446
|
+
cursor: pointer;
|
|
447
|
+
}
|
|
448
|
+
.component-name {
|
|
449
|
+
min-width: 0;
|
|
450
|
+
overflow: hidden;
|
|
451
|
+
text-overflow: ellipsis;
|
|
452
|
+
white-space: nowrap;
|
|
453
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
454
|
+
font-size: 16px;
|
|
455
|
+
}
|
|
456
|
+
.component-version {
|
|
457
|
+
color: ${({theme:e})=>e.palette.text.secondary};
|
|
458
|
+
font-size: 12px;
|
|
459
|
+
margin-left: 4px;
|
|
460
|
+
transform: translateY(-1px);
|
|
461
|
+
}
|
|
462
|
+
`;function kn({meta:e,dependencies:o,logoUrl:n,setInstallComponentMeta:a}){const r=X(),{t:i}=z(),f=()=>{a(e)},c=40;return t.jsxs(ea,{id:`optional-component-${e.did}`,children:[t.jsxs("div",{className:"cell",children:[t.jsxs("div",{className:"component-left",children:[t.jsx("img",{className:"component-logo",src:n,onError:()=>`${r.imgPrefix}/blocklet.png`,alt:e.title,style:{width:c,height:c}}),t.jsxs("div",{className:"component-header",children:[t.jsx("div",{className:"component-name",children:e.title}),t.jsx("div",{className:"component-version",children:e.version})]}),t.jsx(Ce,{title:[`${i("common.dependents")}: `,o.map(u=>t.jsx(C,{pl:1,children:`${u.parentTitle} ${u.required?`(${i("common.required")})`:""}`},u.parentName+u.mount_point))],children:t.jsx(C,{display:"flex",color:"primary.main",ml:1,children:t.jsx(J,{icon:"octicon:package-dependents-16"})})})]}),t.jsx("div",{style:{flex:1}}),t.jsx(C,{sx:{minWidth:100,display:"flex",justifyContent:"flex-end"},children:t.jsx(Nr,{onClick:f,startIcon:t.jsx(J,{icon:"ph:download-simple-bold"}),children:i("common.install")})})]}),t.jsx(Xe,{class:"line"},"line")]})}kn.propTypes={meta:s.object.isRequired,logoUrl:s.string,setInstallComponentMeta:s.func.isRequired,dependencies:s.arrayOf(s.shape({parentDid:s.string,parentName:s.string,parentPoint:s.string,required:s.bool}))};kn.defaultProps={logoUrl:"",dependencies:[]};const ea=$(Pn)`
|
|
463
|
+
.line {
|
|
464
|
+
opacity: 0.5;
|
|
465
|
+
}
|
|
466
|
+
.cell {
|
|
467
|
+
display: flex;
|
|
468
|
+
width: 100%;
|
|
469
|
+
flex-direction: row;
|
|
470
|
+
align-items: center;
|
|
471
|
+
justify-content: flex-start;
|
|
472
|
+
padding-top: 16px;
|
|
473
|
+
padding-bottom: 16px;
|
|
474
|
+
}
|
|
475
|
+
.component-left {
|
|
476
|
+
display: flex;
|
|
477
|
+
flex-direction: row;
|
|
478
|
+
justify-content: flex-start;
|
|
479
|
+
align-items: center;
|
|
480
|
+
min-width: 0;
|
|
481
|
+
}
|
|
482
|
+
.component-logo {
|
|
483
|
+
width: 40px;
|
|
484
|
+
margin-left: 16px;
|
|
485
|
+
opacity: 0.5;
|
|
486
|
+
border-radius: 10px;
|
|
487
|
+
overflow: hidden;
|
|
488
|
+
}
|
|
489
|
+
.component-header {
|
|
490
|
+
flex: 1;
|
|
491
|
+
min-width: 0;
|
|
492
|
+
opacity: 0.5;
|
|
493
|
+
margin-left: 12px;
|
|
494
|
+
display: flex;
|
|
495
|
+
align-items: center;
|
|
496
|
+
align-items: flex-end;
|
|
497
|
+
cursor: pointer;
|
|
498
|
+
}
|
|
499
|
+
.component-name {
|
|
500
|
+
flex: 1;
|
|
501
|
+
opacity: 0.5;
|
|
502
|
+
color: ${({theme:e})=>e.palette.text.primary};
|
|
503
|
+
font-size: 16px;
|
|
504
|
+
}
|
|
505
|
+
.component-version {
|
|
506
|
+
opacity: 0.8;
|
|
507
|
+
color: ${({theme:e})=>e.palette.grey[400]};
|
|
508
|
+
font-size: 12px;
|
|
509
|
+
margin-left: 4px;
|
|
510
|
+
transform: translateY(-1px);
|
|
511
|
+
}
|
|
512
|
+
`;function _n({blocklet:e,onUpdate:o,getComponentUrl:n,...a}){var le;const{t:r}=d.useContext(ve),{api:i,inService:f,info:c}=X(),{addDeletingDid:u,removeDeletingDid:x,matchDeletingDid:h}=Kt(),[l,S]=d.useState(!1),[y,g]=d.useState(null),[T,w]=d.useState(null),[k,b]=d.useState(!1),[m,p]=d.useState(!1),[v,R]=d.useState(!1),[j,N]=d.useState(!1),[O,he]=d.useState(null),Y=e&&e.structVersion!==D.APP_STRUCT_VERSION,[U,Re]=d.useState(!1),Q=[...e.children];e.meta.group!=="gateway"&&Q.unshift(e),h(Q.map(E=>E.meta.did));const De=async()=>{if(!l){S(!0);try{const{updateId:E,updateList:V}=(await i.checkComponentsForUpdates({input:{did:e.meta.did}})).preUpdateInfo||{};if(S(!1),!E){L.info(r("blocklet.component.noUpdate"));return}const re=[];B.forEachChildSync(e,(A,{id:Le,ancestors:ce})=>{const G=V.find(ke=>ke.id===Le);if(G){const ke=ce.slice(1).concat(A).map(Be=>Be.meta.title||Be.meta.name).join(" / "),ze=(ce[1]||A).meta.did;re.push({groupId:ze,name:ke,version:A.meta.version,newVersion:G.meta.version})}});const Ee={};re.forEach(A=>{Ee[A.groupId]?A.disabled=!0:Ee[A.groupId]=!0}),g({params:{updateId:E},list:re,checks:Ee,hasChecks:!0})}catch(E){S(!1),L.error(ae(E))}}},Ne=async()=>{if(!l)try{S(!0);const E=Object.keys(y.checks).filter(re=>y.checks[re]),V={updateId:y.params.updateId,rootDid:e.meta.did,selectedComponents:E};await i.upgradeComponents({input:V}),S(!1),g(null),Re(null)}catch(E){S(!1),L.error(ae(E))}},ge=async(E,V)=>{u(E.meta.did);try{await i.deleteComponent({input:{did:E.meta.did,keepData:V==="keepData",rootDid:e.meta.did}}),await Ve(800)}catch(re){L.error(ae(re)),x(E.meta.did)}},we=async E=>{try{await i.startBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ve(800)}catch(V){L.error(ae(V))}},_=async E=>{try{await i.stopBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ve(800)}catch(V){L.error(ae(V))}},W=async E=>{try{await i.restartBlocklet({input:{did:e.meta.did,componentDids:[E.meta.did]}}),await Ve(800)}catch(V){L.error(ae(V))}},K=(E,V)=>{const{checked:re}=E.target;g(Ee=>{const A=Object.entries(Ee.checks).reduce((ce,[G,ke])=>(ce[G]=V===G||V==="all"?re:ke,ce),{}),Le=Object.values(A).includes(!0);return{...Ee,checks:A,hasChecks:Le}})},Te=d.useMemo(()=>y==null?void 0:y.list.filter(E=>!E.disabled).every(E=>y.checks[E.groupId]),[y]);Mi(De);const F=$i({blocklet:e,scrollToComponent:!0}),be=O||F;return t.jsxs(ta,{component:"div",...a,children:[t.jsxs(na,{display:"flex",children:[t.jsxs(oa,{flexDirection:"row",className:"title",display:"flex",alignItems:"center",children:[Q!=null&&Q.length?`${r("common.components")} (${Q.length})`:`${r("common.components")}`,!Y&&t.jsx(Gt,{permission:f?"":"mutate_blocklets",role:f?Ye:[],children:t.jsx(Jt,{children:t.jsx(Wt,{top:1.2,right:.4,color:"error",badgeContent:"",variant:"dot",invisible:!U,children:t.jsxs(pe,{disabled:l||B.isInProgress(e.status),onClick:()=>{De()},"data-cy":"check-for-updates",children:[t.jsx(C,{ml:.5,mr:.5,display:"flex",children:l?t.jsx(me,{size:16}):t.jsx(No,{style:{fontSize:"1em"}})}),r("blocklet.component.checkUpdateTitle")]})})})})]}),t.jsx(Gt,{permission:f?"":"mutate_blocklets",role:f?Ye:[],children:t.jsxs(C,{display:"flex",alignItems:"center",gap:.5,children:[!Y&&t.jsx(yn,{blocklet:e,serverVersion:c.version,disabled:l||B.isInProgress(e.status)}),t.jsx(Do,{"data-cy":"component-actions",actions:[{icon:t.jsx(J,{icon:"fluent:link-20-filled"}),onClick:()=>p(!0),text:r("router.rule.add.title"),disabled:l||B.isInProgress(e.status)},...Y?[]:[{icon:t.jsx(J,{icon:"mdi:variable"}),onClick:()=>{R(!0)},text:r("common.environments")},{icon:t.jsx(Qt,{}),onClick:()=>{N(!0)},text:r("common.preferences")}]].filter(Boolean)})]})})]}),Q!=null&&Q.length?t.jsxs(t.Fragment,{children:[t.jsxs(C,{mt:2,children:[e.meta.group!=="gateway"&&t.jsx(mt,{blocklet:e,app:e,onRemove:ge,onStart:we,onStop:_,onRestart:W,getComponentUrl:n},`0-${e.meta.did}`),e.children.map(E=>t.jsx(mt,{depth:1,blocklet:E,ancestors:[e],app:e,onRemove:ge,onStart:we,onStop:_,onRestart:W,getComponentUrl:n},`1-${E.meta.did}`))]},`top-blocklet-${e.meta.did}`),(le=e.optionalComponents)==null?void 0:le.map(E=>t.jsx(Pn,{children:t.jsx(kn,{setInstallComponentMeta:he,...E})},E.meta.did))]}):t.jsx(C,{mt:8,children:t.jsx($r,{children:r("blocklet.component.noComponent")})}),!!e.site.rules.length&&t.jsx(C,{sx:{mt:0,".component-item__indent":{pl:2,width:0}},children:t.jsx(Bi,{})}),!!y&&t.jsx(Xn,{open:!0,fullWidth:!0,children:t.jsxs(C,{paddingY:1.5,children:[t.jsx(Zn,{children:r("blocklet.component.updateTitle")}),t.jsxs(C,{component:Qn,py:4,children:[y.list.filter(E=>!E.disabled).length>1&&t.jsxs(C,{display:"flex",alignItems:"center",children:[t.jsx(Jn,{checked:Te,onChange:E=>K(E,"all")}),t.jsx(C,{children:r(Te?"common.unselectAll":"common.selectAll")})]}),y.list.map(E=>t.jsxs(C,{display:"flex",alignItems:"center",mb:1,children:[t.jsx(Jn,{checked:y.checks[E.groupId],onChange:V=>K(V,E.groupId),style:{marginLeft:E.disabled?16:0,alignSelf:"flex-start"},defaultChecked:!0,disabled:E.disabled}),t.jsxs(C,{flexGrow:1,children:[t.jsx(C,{pt:1,xs:8,children:E.name}),E.version&&t.jsxs(lt,{fontSize:"h6.fontSize",container:!0,spacing:2,alignItems:"center",children:[t.jsx(lt,{item:!0,xs:3,children:E.version}),t.jsx(lt,{item:!0,xs:1,children:t.jsx(Lr,{style:{fontSize:"0.9em"}})}),t.jsx(lt,{item:!0,xs:3,children:t.jsx(C,{color:"secondary.main",children:E.newVersion})})]})]},`${E.name}-${E.newVersion}`)]},E.name))]}),t.jsxs(Br,{style:{padding:"8px 24px 24px"},children:[t.jsx(pe,{onClick:()=>{g(null)},children:r("common.cancel")}),t.jsxs(pe,{onClick:E=>{E.stopPropagation(),Ne()},color:"primary",disabled:l||!y.hasChecks,variant:"contained",autoFocus:!0,children:[l&&t.jsx(me,{size:16}),r("common.update")]})]})]})}),!!T&&t.jsx(Xn,{open:!0,fullWidth:!0,onClose:()=>w(!1),children:t.jsxs(C,{paddingY:1.5,children:[t.jsx(Zn,{children:r("common.configuration")}),t.jsx(Qn,{children:t.jsx(C,{py:2,children:t.jsx(zt,{control:t.jsx(Ms,{checked:k,onChange:E=>b(!!E.target.checked)}),label:r("blocklet.component.showContainer")})})})]})}),t.jsx(St,{selectedMeta:be,blocklet:e,showDialog:!!be,setShowDialog:()=>he(null)}),m&&t.jsx(Cn,{hiddenChildren:!0,open:!0,onClose:()=>p(!1)}),v&&t.jsx(vt,{open:!0,onClose:()=>R(!1),hiddenChildren:!0,blocklet:e,ancestors:[]}),j&&t.jsx(Tt,{open:!0,onClose:()=>N(!1),blocklet:e,ancestors:[]})]})}_n.propTypes={blocklet:s.object.isRequired,onUpdate:s.func,getComponentUrl:s.func};_n.defaultProps={onUpdate:()=>{},getComponentUrl:()=>window.location.origin};const ta=$.div`
|
|
513
|
+
.title {
|
|
514
|
+
font-size: 1.2rem;
|
|
515
|
+
font-weight: bold;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
@keyframes showDelay {
|
|
519
|
+
0% {
|
|
520
|
+
opacity: 0;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
100% {
|
|
524
|
+
opacity: 1;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
.component-item {
|
|
529
|
+
animation: showDelay 0.75s ease 1;
|
|
530
|
+
}
|
|
531
|
+
`,na=$(C)`
|
|
532
|
+
${e=>e.theme.breakpoints.up("sm")} {
|
|
533
|
+
flex-direction: row;
|
|
534
|
+
justify-content: space-between;
|
|
535
|
+
align-items: center;
|
|
536
|
+
}
|
|
537
|
+
${e=>e.theme.breakpoints.down("sm")} {
|
|
538
|
+
flex-direction: column;
|
|
539
|
+
justify-content: flex-end;
|
|
540
|
+
align-items: flex-end;
|
|
541
|
+
.sm-hide-icon > svg {
|
|
542
|
+
display: none;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
`,oa=$(C)`
|
|
546
|
+
${e=>e.theme.breakpoints.down("sm")} {
|
|
547
|
+
width: 100%;
|
|
548
|
+
justify-content: space-between;
|
|
549
|
+
}
|
|
550
|
+
`;function $o(e){const{locale:o}=d.useContext(ve),{blocklet:n,recommendedDomain:a}=$s(),r=i=>Or({blocklet:n,domain:{value:a||`${Mr.encode(n.appPid)}.${D.DEFAULT_DID_DOMAIN}`},mountPoint:i,params:Yt(n,o)});return t.jsx(_n,{blocklet:n,getComponentUrl:r,...e})}$o.propTypes={};$o.defaultProps={};export{$o as default};
|