@abtnode/blocklet-services 1.16.33 → 1.16.34-beta-20241120-080738-bbbe036c
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/api/index.js +36 -26
- package/api/routes/blocklet.js +12 -6
- package/api/services/static.js +6 -0
- package/dist/assets/{Add-keKAhJf1.js → Add-X4z8DHkm.js} +1 -1
- package/dist/assets/{Alert-CvjoyYBC.js → Alert-SdIu9Hlz.js} +1 -1
- package/dist/assets/{ArrowDropDown-C0LbBLoq.js → ArrowDropDown-D_j-3Aek.js} +1 -1
- package/dist/assets/{Autocomplete-B2GoIEiU.js → Autocomplete-B0CdvXaN.js} +1 -1
- package/dist/assets/{Avatar-Dpx0qZux.js → Avatar-DdQeYraH.js} +1 -1
- package/dist/assets/{ButtonGroup-HFkgBADe.js → ButtonGroup-DwUDwu6o.js} +1 -1
- package/dist/assets/{CSSTransition-BCODA-ba.js → CSSTransition-bXUOWv9j.js} +1 -1
- package/dist/assets/{CheckCircle-dj8lmygB.js → CheckCircle-0O-lYcGp.js} +1 -1
- package/dist/assets/{ChevronLeft-DMcIWZxt.js → ChevronLeft-BAqoYyCf.js} +1 -1
- package/dist/assets/{ChevronRight-C5a3Tp9Z.js → ChevronRight-CqKzFBJG.js} +1 -1
- package/dist/assets/{Close-C1lblU7j.js → Close-DhyF9K4o.js} +1 -1
- package/dist/assets/{Delete-Bt8sEFHf.js → Delete-DsXQXt5C.js} +1 -1
- package/dist/assets/{DeleteOutline-CbAyWFU_.js → DeleteOutline-DU-DZ2Ol.js} +1 -1
- package/dist/assets/{DialogContentText-DCrSbjzq.js → DialogContentText-Bsce1Ptt.js} +1 -1
- package/dist/assets/{Done-DcSnacmc.js → Done-CEijBk0K.js} +1 -1
- package/dist/assets/{Download-DCo9Sut8.js → Download-KhEFO1tw.js} +1 -1
- package/dist/assets/{EditIcon-CCujR7ZO.js → EditIcon-66Fm0Qrw.js} +1 -1
- package/dist/assets/{Error-B1YMBQQI.js → Error-D9g7mp8J.js} +1 -1
- package/dist/assets/{ExpandMore-gjdCPrPn.js → ExpandMore-DsX-wPbd.js} +1 -1
- package/dist/assets/{FormControl-fwuAUJF7.js → FormControl-uyHqpehB.js} +1 -1
- package/dist/assets/{FormControlLabel-Dd50kGih.js → FormControlLabel-l14pLV4s.js} +1 -1
- package/dist/assets/{FormGroup-CQVrTSBu.js → FormGroup-D3XfyeLR.js} +1 -1
- package/dist/assets/{Google-tjgxWlOw.js → Google-ymTl1lSj.js} +1 -1
- package/dist/assets/{Grid-CdEXdmAj.js → Grid-Cozd141M.js} +1 -1
- package/dist/assets/{HelpOutline-BqeAr-nt.js → HelpOutline-C6jbNZqQ.js} +1 -1
- package/dist/assets/{Hidden-DzGAqhyo.js → Hidden-CPvi6LIk.js} +1 -1
- package/dist/assets/{InfoOutlined-bFgj9q23.js → InfoOutlined-9VuodX8w.js} +1 -1
- package/dist/assets/{InputAdornment-DLavXxQC.js → InputAdornment-D3mFMJR5.js} +1 -1
- package/dist/assets/{LastPage-BKsIncQL.js → LastPage-CDX1Zcgq.js} +1 -1
- package/dist/assets/{Launch-CxApRsQk.js → Launch-C-vq9aQf.js} +1 -1
- package/dist/assets/{LaunchOutlined-DfDSvTLO.js → LaunchOutlined-3OnisLst.js} +1 -1
- package/dist/assets/{Link-CwMoHxxH.js → Link-BBclrajR.js} +1 -1
- package/dist/assets/{ListItemButton-DVUJtRJm.js → ListItemButton-DxmUeeh5.js} +1 -1
- package/dist/assets/{ListSubheader-CFOk8Duw.js → ListSubheader-CmQXujp0.js} +1 -1
- package/dist/assets/{LoadingButton-CV6_YGxl.js → LoadingButton-XNe7vWUa.js} +1 -1
- package/dist/assets/{LockIcon-DuGlV5OX.js → LockIcon-mnkb3oX5.js} +1 -1
- package/dist/assets/{Loop-StSu2hQZ.js → Loop-DUXasQn9.js} +1 -1
- package/dist/assets/{MarkEmailRead-Dql1zMPh.js → MarkEmailRead-fYAbebKs.js} +1 -1
- package/dist/assets/{Menu-BO891UCo.js → Menu-B-903KAP.js} +1 -1
- package/dist/assets/{MoreHoriz-9r1HwwoN.js → MoreHoriz-CKBqccB-.js} +1 -1
- package/dist/assets/{MoreVert-DOniSEHD.js → MoreVert-D_0KIWFk.js} +1 -1
- package/dist/assets/{OpenInNew-BPyaFhom.js → OpenInNew-B33B2IQa.js} +1 -1
- package/dist/assets/{Pagination-BLtZNPA8.js → Pagination-BvVPAsto.js} +1 -1
- package/dist/assets/{PlayArrow-5GWIfGl4.js → PlayArrow-evoOMfsp.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-DKy3bE5m.js → QuestionMarkCircle-B4nA_yE6.js} +1 -1
- package/dist/assets/{RadioGroup-DORPFwcd.js → RadioGroup-dmNyerSz.js} +1 -1
- package/dist/assets/{Search-DX3AW4Ja.js → Search-XQNU_CT0.js} +1 -1
- package/dist/assets/{Select-CRV0iHHv.js → Select-B1-paS03.js} +1 -1
- package/dist/assets/{ServerLogo-Bf6UHHwQ.js → ServerLogo-Caf4HPFp.js} +1 -1
- package/dist/assets/{Skeleton-B0qtX8zT.js → Skeleton-BxBQ28EK.js} +1 -1
- package/dist/assets/{Slider-ICT3OK_s.js → Slider-Ddfmv_yI.js} +1 -1
- package/dist/assets/{Stack-D9gGxV3p.js → Stack-Cf8RLPm4.js} +1 -1
- package/dist/assets/{Stepper-DnzprAA5.js → Stepper-BMCZXJeS.js} +1 -1
- package/dist/assets/{TextField-CDyde-vy.js → TextField-nYO4mCN5.js} +1 -1
- package/dist/assets/{Toolbar-B1kAku_I.js → Toolbar-BRd5bS7b.js} +1 -1
- package/dist/assets/{ViewColumn-Cnif--3f.js → ViewColumn-83XwXiON.js} +1 -1
- package/dist/assets/{ViewList-BsA6104d.js → ViewList-CJ-RbwzW.js} +1 -1
- package/dist/assets/{_createAggregator-DrVSAj0q.js → _createAggregator-8eYFUECO.js} +1 -1
- package/dist/assets/{access-control-DLJpzKF0.js → access-control-CQUs5OWI.js} +1 -1
- package/dist/assets/{actions-aH21JHuE.js → actions-BM-xEZx2.js} +1 -1
- package/dist/assets/{add-component-core-CUJCSG5o.js → add-component-core-BMlbHeI0.js} +1 -1
- package/dist/assets/add-resource-DvFNfjB2.js +1 -0
- package/dist/assets/{addon-q69Gsvdx.js → addon-Bigmp9O7.js} +1 -1
- package/dist/assets/{analytics-PWeZC2nI.js → analytics-Bg67n4CY.js} +1 -1
- package/dist/assets/api-VcJV-X9V.js +1 -0
- package/dist/assets/{audit-logs-DDiQqcXp.js → audit-logs-CzGhOwwp.js} +1 -1
- package/dist/assets/{base32-C6zHYqZY.js → base32-DGUZQyiL.js} +1 -1
- package/dist/assets/{branding-UWNwsJgO.js → branding-8gA3ziq_.js} +2 -2
- package/dist/assets/{bundle-avatar-CAJ4ok0y.js → bundle-avatar-CG-YcfiD.js} +1 -1
- package/dist/assets/{button-B44tuPUX.js → button-SZ8X_p1g.js} +1 -1
- package/dist/assets/{click-to-copy-CO2NnWs4.js → click-to-copy-D-NrDLcT.js} +1 -1
- package/dist/assets/{complete-DDKp_U3c.js → complete-B4-BGkP7.js} +1 -1
- package/dist/assets/{component-D3p8A_S7.js → component-DBRvVUTw.js} +1 -1
- package/dist/assets/{config-fErcYSNl.js → config-CB3tMJeo.js} +1 -1
- package/dist/assets/{config-BaIaZlTt.js → config-COkhmeWZ.js} +1 -1
- package/dist/assets/{config-navigation-CA8IvSUF.js → config-navigation-CtSC9Cq8.js} +1 -1
- package/dist/assets/{config-space-BTpvPCf5.js → config-space-DQHQRL3E.js} +1 -1
- package/dist/assets/{confirm-Bc68-DFG.js → confirm-DlXzE3-N.js} +1 -1
- package/dist/assets/{connect-BuX8KN_Y.js → connect-D6bg9ePx.js} +1 -1
- package/dist/assets/{connect-B-gCtz6y.js → connect-DxhZ0Tvp.js} +1 -1
- package/dist/assets/{connect-to-CmPhkTnO.js → connect-to-B5jiLg6X.js} +1 -1
- package/dist/assets/{content-layout-DWrJ4SYf.js → content-layout-D3VC1ekw.js} +1 -1
- package/dist/assets/{dashboard-BJUhLtpP.js → dashboard-ZMG6gVdw.js} +3 -3
- package/dist/assets/{deprecate-CBfNeB3N.js → deprecate-BX2YtlbE.js} +1 -1
- package/dist/assets/{did-address-CeAEd9AA.js → did-address-C2pjT4Vo.js} +1 -1
- package/dist/assets/{domain-DAVxIeBd.js → domain-BqUMDT-1.js} +1 -1
- package/dist/assets/{domain-list-C9Q-rA9d.js → domain-list-BHqOp-Ih.js} +1 -1
- package/dist/assets/{email-DVrFLh0C.js → email-DKsPvpuS.js} +3 -3
- package/dist/assets/emotion-cache.browser.esm-MtkgfpRW.js +1 -0
- package/dist/assets/{exchange-passport-CymsSQq4.js → exchange-passport-CYNeQsny.js} +1 -1
- package/dist/assets/{fallback-HzSJFkgV.js → fallback-CSFjDMvp.js} +1 -1
- package/dist/assets/{form-text-input-DlUuPAGn.js → form-text-input-s8lVIw_B.js} +2 -2
- package/dist/assets/{format-error-DiR6lB9S.js → format-error-CDAFfj8A.js} +1 -1
- package/dist/assets/{fuel-00iTGFPb.js → fuel-D-f3orJl.js} +1 -1
- package/dist/assets/{fullpage-Tob3koDP.js → fullpage-CFqmJ0qL.js} +1 -1
- package/dist/assets/{home-C0YYsg_6.js → home-CLUN61Tw.js} +1 -1
- package/dist/assets/{iframe-ClBOPtPf.js → iframe-BAyMTu53.js} +1 -1
- package/dist/assets/{index-ak_q22RG.js → index-4NjjF0-i.js} +1 -1
- package/dist/assets/{index-Dvw2zQCR.js → index-5kreDgju.js} +1 -1
- package/dist/assets/{index-YTRzBzgM.js → index-7nX7dUfG.js} +1 -1
- package/dist/assets/{index-BBAn78dN.js → index-B0SXb9R9.js} +13 -13
- package/dist/assets/{index-ElzBhQUO.js → index-B18UT_6G.js} +1 -1
- package/dist/assets/{index-BVOdM4SV.js → index-B1mg4OYA.js} +1 -1
- package/dist/assets/{index-CgSUIlrZ.js → index-B20xJssN.js} +1 -1
- package/dist/assets/{index-BQQj2X3R.js → index-B2stpwyi.js} +1 -1
- package/dist/assets/{index-CCt0KYoE.js → index-B4lxRZaJ.js} +1 -1
- package/dist/assets/{index-CnIYMEiN.js → index-BMiSc2wz.js} +1 -1
- package/dist/assets/index-BqRmefsG.js +5 -0
- package/dist/assets/{index-BrPvHdaT.js → index-CDqA3u6q.js} +1 -1
- package/dist/assets/{index-2aUz-aBH.js → index-CSD_wMks.js} +1 -1
- package/dist/assets/{index-wdFo0Sfg.js → index-CSxTTw0q.js} +1 -1
- package/dist/assets/{index-gOnIj4Rb.js → index-Cq51W2RR.js} +1 -1
- package/dist/assets/{index-D9_f7f5B.js → index-CqTIWm-d.js} +1 -1
- package/dist/assets/{index-D9LIoB-S.js → index-Cs2E1YL_.js} +1 -1
- package/dist/assets/{index-DmehIOg4.js → index-CumCTaTW.js} +1 -1
- package/dist/assets/{index-DdQMqH36.js → index-Cx63crA-.js} +1 -1
- package/dist/assets/{index-BzUR-a4Z.js → index-D2SIiIQf.js} +1 -1
- package/dist/assets/{index-BF7ZXXC1.js → index-D5wEQrBd.js} +4 -4
- package/dist/assets/{index-DV2LNzli.js → index-D8QzYVOq.js} +1 -1
- package/dist/assets/{index-hSGAxOdh.js → index-DCT_TYwC.js} +1 -1
- package/dist/assets/{index-DsJOqL94.js → index-DEPDXC-J.js} +1 -1
- package/dist/assets/{index-DMQtTWea.js → index-DN-ud71W.js} +1 -1
- package/dist/assets/index-DTgMnz8b.js +23 -0
- package/dist/assets/{index-BdrLOxFM.js → index-DVPois7s.js} +1 -1
- package/dist/assets/{index-C0WGjtg-.js → index-DbV8Cm0j.js} +3 -3
- package/dist/assets/{index-CB8acmN6.js → index-Dk5x0Y-4.js} +1 -1
- package/dist/assets/{index-BLoPFMkc.js → index-DkMn9TUE.js} +1 -1
- package/dist/assets/{index-CtQQYMUx.js → index-DmnbXzbU.js} +1 -1
- package/dist/assets/{index-JB2oUFYn.js → index-Wcms7bcl.js} +1 -1
- package/dist/assets/{index-BSr00ZmK.js → index-v0JEVAIK.js} +1 -1
- package/dist/assets/{index-DFY8jb7D.js → index-w1h5fjUA.js} +3 -3
- package/dist/assets/{invitation-5s62ddPg.js → invitation-Yjy6HGG4.js} +1 -1
- package/dist/assets/{invite-3Iwg7r6_.js → invite-C0jfkMWg.js} +1 -1
- package/dist/assets/{isEmail-9Cd87-Jf.js → isEmail-DudZSfen.js} +1 -1
- package/dist/assets/{issue-passport-Bs_kcQrL.js → issue-passport-DudEqprT.js} +1 -1
- package/dist/assets/item-Qi3k0S3X.js +1 -0
- package/dist/assets/{jss-plugin-props-sort.esm-CAi1eATI.js → jss-plugin-props-sort.esm-eHjnd9Xc.js} +4 -4
- package/dist/assets/{launch-result-message-BKyjNhKo.js → launch-result-message-BjJsaytr.js} +1 -1
- package/dist/assets/{layout-D2dVjUzS.js → layout-UtcVR8BI.js} +1 -1
- package/dist/assets/{list-header-C4m5dLsI.js → list-header-NUhrDD1b.js} +1 -1
- package/dist/assets/localization-DfM99lg5.js +1 -0
- package/dist/assets/{log-C3JMMjMc.js → log-Bg2f-djb.js} +1 -1
- package/dist/assets/{login-Dvmflp_9.js → login-jZ_gbwxx.js} +1 -1
- package/dist/assets/{login-oauth-callback-CPc0zcES.js → login-oauth-callback-BsuD8dYE.js} +1 -1
- package/dist/assets/{logo-uploader-CBETevxN.js → logo-uploader-cazNDY0K.js} +3 -3
- package/dist/assets/{lost-passport-DU8KQjn-.js → lost-passport-DHMTqUy2.js} +3 -3
- package/dist/assets/{lottie-react.esm-1vAuyi_k.js → lottie-react.esm-BRmb5Q_x.js} +1 -1
- package/dist/assets/{notifications-BckZ6Zeg.js → notifications-BHOBSPJc.js} +1 -1
- package/dist/assets/{open-window-0wATMkvy.js → open-window-D8-74j_m.js} +1 -1
- package/dist/assets/{overview-Btrxfq66.js → overview-Dvi5x7VF.js} +1 -1
- package/dist/assets/{page-header-UrCX2Xf3.js → page-header-Cuk0VEwE.js} +1 -1
- package/dist/assets/{permission-HDkuilbX.js → permission-CMfgwGXI.js} +1 -1
- package/dist/assets/{preferences-BY6jsr72.js → preferences-CDXLVGEm.js} +1 -1
- package/dist/assets/publish-resource-BvIAjSul.js +1 -0
- package/dist/assets/{raf-schd.esm-B0fy_Dud.js → raf-schd.esm-CAcrK34B.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-qMe30Bxp.js → react-beautiful-dnd.esm-BKgqJ7JL.js} +1 -1
- package/dist/assets/refType-DiKtS-id.js +1 -0
- package/dist/assets/{resource-dialog-oqFn-KmA.js → resource-dialog-BVJhpy1Q.js} +1 -1
- package/dist/assets/sdk-D-9ToVwd.js +1 -0
- package/dist/assets/{selector-DwWXI-4m.js → selector-BpSDNqsZ.js} +1 -1
- package/dist/assets/session-F_I9Jrbv.js +1 -0
- package/dist/assets/setup-8nQMi_fq.js +19 -0
- package/dist/assets/{shorten-label-D-Kk5MqZ.js → shorten-label-WcbI2P0r.js} +1 -1
- package/dist/assets/{simple-select-r4Tnf5lE.js → simple-select-CCxWI6E-.js} +1 -1
- package/dist/assets/{slicedToArray-BO_HbV5G.js → slicedToArray-nT2OZGRu.js} +1 -1
- package/dist/assets/{start-B4VFPrrl.js → start-D7bgrQnF.js} +1 -1
- package/dist/assets/{step-actions-BRQxebyB.js → step-actions-DCffr4lG.js} +1 -1
- package/dist/assets/{studio-THlq023E.js → studio-rqa1WH-f.js} +1 -1
- package/dist/assets/{switch-control-8eQzUS4W.js → switch-control-y9A4IBOq.js} +1 -1
- package/dist/assets/{toUpper-DCrwupTk.js → toUpper-DXM7cuGF.js} +1 -1
- package/dist/assets/{transfer-6dDKzuz2.js → transfer-DEYUxRW5.js} +1 -1
- package/dist/assets/{trim-DYeSEo_Z.js → trim-CVcoUNy4.js} +1 -1
- package/dist/assets/{uniqBy-Vd8yZc0_.js → uniqBy-DuMgcCm2.js} +1 -1
- package/dist/assets/{unsubscribe-BWgJo6hj.js → unsubscribe-LWU1cavI.js} +1 -1
- package/dist/assets/{url-join-BOuybw6E.js → url-join-CL_JDvAa.js} +1 -1
- package/dist/assets/{use-mobile-n7zuWNST.js → use-mobile-CFQCpuvA.js} +1 -1
- package/dist/assets/{use-mobile-BS_bqT1b.js → use-mobile-ZzOK8QiS.js} +1 -1
- package/dist/assets/{useAsync-Bif71966.js → useAsync-gwjt9FVi.js} +1 -1
- package/dist/assets/{useFormControl-DqfIuuvt.js → useFormControl-DNefZzFa.js} +1 -1
- package/dist/assets/{useLocalStorage-DMU1hTLM.js → useLocalStorage-TwWpr1f9.js} +1 -1
- package/dist/assets/{useSetState-CN9u96ki.js → useSetState-BEl9w6Ey.js} +1 -1
- package/dist/assets/{useSlot-CHqta3Nf.js → useSlot-gmkdMHt7.js} +1 -1
- package/dist/assets/{useSlotProps-CCyJAuna.js → useSlotProps-Beat0gxH.js} +1 -1
- package/dist/assets/{useThemeProps-BA28YyAa.js → useThemeProps-D9xeggEi.js} +1 -1
- package/dist/assets/{user-center-BDSX7lWk.js → user-center-CYPTkfYq.js} +1 -1
- package/dist/assets/{user-sessions-B3_Z4sc5.js → user-sessions-CzYDLfF7.js} +1 -1
- package/dist/assets/{util-BDJl9b79.js → util-HMZRwDlC.js} +1 -1
- package/dist/assets/{wrap-locale-Cy5ov56q.js → wrap-locale-YCzz3OWo.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +19 -19
- package/dist/assets/add-resource-DK1zuka_.js +0 -1
- package/dist/assets/api-BDt5g5RU.js +0 -1
- package/dist/assets/emotion-cache.browser.esm-CdXTLibk.js +0 -1
- package/dist/assets/index-Bw7V6nBD.js +0 -6
- package/dist/assets/index-CElxuQNA.js +0 -23
- package/dist/assets/item-BoZPHIoN.js +0 -1
- package/dist/assets/localization-DDRUsd3P.js +0 -1
- package/dist/assets/publish-resource-HbUTGqHz.js +0 -1
- package/dist/assets/refType-hOh2vas7.js +0 -1
- package/dist/assets/sdk-DAD_xkYB.js +0 -1
- package/dist/assets/session-CASkyLZm.js +0 -1
- package/dist/assets/setup-BbMO8a0y.js +0 -19
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{P as l,r as c,j as n,B as h,bk as A,a2 as G,dF as H,fu as U,aa as Y,aE as L,n as J,de as Q,cN as Z,a0 as v}from"./index-
|
|
1
|
+
import{P as l,r as c,j as n,B as h,bk as A,a2 as G,dF as H,fu as U,aa as Y,aE as L,n as J,de as Q,cN as Z,a0 as v}from"./index-w1h5fjUA.js";import{d as ee}from"./Done-CEijBk0K.js";import{C as te}from"./Google-ymTl1lSj.js";import{T as ne}from"./TextField-nYO4mCN5.js";import{R as re,F as oe,L as se}from"./logo-uploader-cazNDY0K.js";const N={description:l.string,editing:l.bool,onChange:l.func,required:l.bool,value:l.any,componentProps:l.object,render:l.func,renderFormItem:l.func};function S({editing:o,value:r,onChange:a}){const[d,u]=c.useState(!1),m=c.useRef(),p=c.useRef(r);c.useEffect(()=>{let s=null;return o&&(s=setTimeout(()=>{u(!0)},50)),()=>{clearTimeout(s)}},[o]);const k=s=>{p.current=s,a(s)},b=()=>{u(!1),a(p.current)},I=n.jsx(h,{className:"form-item-input slot",px:1,children:n.jsxs(h,{display:"flex",alignItems:"center",children:[r,r!=="auto"&&n.jsx("div",{style:{marginLeft:4,backgroundColor:r,width:"1em",height:"1em",borderRadius:"0.2em"}})]})}),f=n.jsxs(h,{display:"flex",flexGrow:1,alignItems:"center",height:"40px",onKeyDown:b,children:[n.jsx(h,{display:"flex",alignItems:"center",onClick:()=>u(!0),children:n.jsx("div",{ref:m,style:{flexShrink:0,marginLeft:"8px",backgroundColor:r,width:"32px",height:"32px",boxSizing:"border-box",borderRadius:"8px",border:"1px solid #eee",cursor:r==="auto"?"default":"pointer"}})}),n.jsx(A,{open:d,anchorEl:m.current,onClose:()=>u(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},children:n.jsx(te,{color:r,onChange:s=>k(s.hex)})})]});return o?f:I}S.propTypes=N;function T({editing:o,description:r,value:a,onChange:d,componentProps:u,...m}){const{placeholder:p}=u,k=c.useRef(a),{t:b}=c.useContext(G),I=s=>{s.key==="Enter"&&d(k.current,"confirm")},f=s=>{k.current=s,d(s)};return o?n.jsx(ne,{style:{flex:1},fullWidth:!0,value:a,onChange:s=>{s.persist(),f(s.target.value)},autoFocus:!0,size:"small",variant:"outlined",placeholder:r||p,onKeyDown:I,...m}):n.jsx(h,{px:1,className:"form-item-input slot",children:a||n.jsx("span",{className:"placeholder",children:b("common.requiredInputPlaceholder",{name:r||p})})})}T.propTypes=N;T.defaultProps={componentProps:{}};function V({editing:o,value:r,onChange:a,componentProps:d,...u}){const{blocklet:m}=d,p=r==="auto"?H.getPassportColorFromDid(m.appDid):r;return n.jsxs(h,{display:"flex",alignItems:"center",children:[n.jsx("div",{style:{width:96,marginRight:12},dangerouslySetInnerHTML:{__html:U({title:"Owner",issuer:Y.getDisplayName(m),issuerDid:m.appDid,ownerName:"Your Name",ownerDid:m.appDid,preferredColor:r||"auto"})}}),n.jsx(S,{...u,editing:o,value:o?p:r,onChange:a,componentProps:d})]})}V.propTypes={...N,componentProps:l.shape({blocklet:l.object.isRequired}).isRequired};V.defaultProps={};const ie=Z`
|
|
2
2
|
0%, 100% {
|
|
3
3
|
transform: scale(1) translateX(0);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var dt=Object.defineProperty;var ht=(e,n,t)=>n in e?dt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var D=(e,n,t)=>ht(e,typeof n!="symbol"?n+"":n,t);import{P as f,r as j,Q as pt,l as gt,j as m,aE as mt,bF as be,bo as yt,bp as bt,dh as wt,ak as xt,bE as C,bm as It,B as St,di as vt,T as Tt,dj as Ct,dk as At,a3 as jt,dl as Pt,bC as Fe,u as ze,aF as kt,f as Lt,E as Mt}from"./index-
|
|
1
|
+
var dt=Object.defineProperty;var ht=(e,n,t)=>n in e?dt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var D=(e,n,t)=>ht(e,typeof n!="symbol"?n+"":n,t);import{P as f,r as j,Q as pt,l as gt,j as m,aE as mt,bF as be,bo as yt,bp as bt,dh as wt,ak as xt,bE as C,bm as It,B as St,di as vt,T as Tt,dj as Ct,dk as At,a3 as jt,dl as Pt,bC as Fe,u as ze,aF as kt,f as Lt,E as Mt}from"./index-w1h5fjUA.js";import{D as Et}from"./index-B1mg4OYA.js";import{L as Ot}from"./MoreVert-D_0KIWFk.js";import{L as Rt}from"./ListItemButton-DxmUeeh5.js";import{L as qt}from"./selector-BpSDNqsZ.js";/**
|
|
2
2
|
* (c) Iconify
|
|
3
3
|
*
|
|
4
4
|
* For the full copyright and license information, please view the license.txt
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as A,v as R,p as w,e as p}from"./index-
|
|
1
|
+
import{d as A,v as R,p as w,e as p}from"./index-CqTIWm-d.js";const O=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,x=/^[a-zA-Z]:\\/;function N(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return x.test(e)?!1:O.test(e)}const _=["http","https"],z=["nofollow"],L={};function T(e){const r=e||L,g=r.protocols||_,u=A(r.test);return function(h){R(h,"element",function(t,y,E){if(t.tagName==="a"&&typeof t.properties.href=="string"&&u(t,y,E)){const o=t.properties.href;if(N(o)?g.includes(o.slice(0,o.indexOf(":"))):o.startsWith("//")){const n=s(r.content,t),c=n&&!Array.isArray(n)?[n]:n,i=s(r.rel,t)||z,a=typeof i=="string"?w(i):i,f=s(r.target,t),l=s(r.properties,t);if(l&&Object.assign(t.properties,p(l)),a.length>0&&(t.properties.rel=[...a]),f&&(t.properties.target=f),c){const m=s(r.contentProperties,t)||{};t.children.push({type:"element",tagName:"span",properties:p(m),children:p(c)})}}}})}}function s(e,r){return typeof e=="function"?e(r):e}export{T as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b9 as y}from"./index-
|
|
1
|
+
import{b9 as y}from"./index-w1h5fjUA.js";var c={};function u(e,i){typeof i=="boolean"&&(i={forever:i}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=i||{},this._maxRetryTime=i&&i.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var T=u;u.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};u.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};u.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var i=new Date().getTime();if(e&&i-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};u.prototype.attempt=function(e,i){this._fn=e,i&&(i.timeout&&(this._operationTimeout=i.timeout),i.cb&&(this._operationTimeoutCb=i.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};u.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};u.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};u.prototype.start=u.prototype.try;u.prototype.errors=function(){return this._errors};u.prototype.attempts=function(){return this._attempts};u.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},i=null,t=0,r=0;r<this._errors.length;r++){var n=this._errors[r],o=n.message,a=(e[o]||0)+1;e[o]=a,a>=t&&(i=n,t=a)}return i};(function(e){var i=T;e.operation=function(t){var r=e.timeouts(t);return new i(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var n in t)r[n]=t[n];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],a=0;a<r.retries;a++)o.push(this.createTimeout(a,r));return t&&t.forever&&!o.length&&o.push(this.createTimeout(a,r)),o.sort(function(s,m){return s-m}),o},e.createTimeout=function(t,r){var n=r.randomize?Math.random()+1:1,o=Math.round(n*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));return o=Math.min(o,r.maxTimeout),o},e.wrap=function(t,r,n){if(r instanceof Array&&(n=r,r=null),!n){n=[];for(var o in t)typeof t[o]=="function"&&n.push(o)}for(var a=0;a<n.length;a++){var s=n[a],m=t[s];t[s]=(function(p){var f=e.operation(r),h=Array.prototype.slice.call(arguments,1),l=h.pop();h.push(function(_){f.retry(_)||(_&&(arguments[0]=f.mainError()),l.apply(this,arguments))}),f.attempt(function(){p.apply(t,h)})}).bind(t,m),t[s].options=r}}})(c);var v=c;const R=y(v);export{R as a,v as r};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as je,aG as $e,aH as Fe,T as K,r as w,aK as g1,aN as u2,aO as Ue,aP as qe,cY as p2,fK as r1,Z as Se,$ as ke,a1 as We,B as g,P as h,G as J,e as b1,u as te,aR as we,a_ as De,bz as i1,a3 as o1,L as ue,bL as b0,a as ve,aE as ge,N as h2,t as U,a0 as ce,dG as f2,ac as ye,c as pe,I as x2,bW as j1,cj as j0,cM as m2,cV as He,cW as w0,al as v2,da as g2,cQ as Qe,bF as ie,c4 as Ye,fw as b2,aa as Y1,fL as j2,b as ne,n as l1,bo as R0,el as C0,ak as w1,bp as y0,cA as z0,aV as Oe,aU as w2,a5 as S0,fM as Z1,fj as Pe,bm as R2,aw as k0,c3 as C2,l as y2,aD as z2,as as S2,at as d1}from"./index-DFY8jb7D.js";import{d as R1}from"./Add-keKAhJf1.js";import{d as I0,a as k2}from"./Delete-Bt8sEFHf.js";import{d as I2}from"./Error-B1YMBQQI.js";import{D as C1}from"./index-ak_q22RG.js";import{T as M0,b as M2}from"./index-BLoPFMkc.js";import{C as y1}from"./confirm-Bc68-DFG.js";import{u as a1}from"./session-CASkyLZm.js";import{W as e0}from"./did-address-CeAEd9AA.js";import{E as Ge,D as P2,C as L2,P as T2}from"./react-beautiful-dnd.esm-qMe30Bxp.js";import{B as z1}from"./bundle-avatar-CAJ4ok0y.js";import{S as be}from"./shorten-label-D-Kk5MqZ.js";import{A as P0}from"./Avatar-Dpx0qZux.js";import{d as D2}from"./Download-DCo9Sut8.js";import{d as N2}from"./QuestionMarkCircle-DKy3bE5m.js";import{b as V2,c as t0,T as _2}from"./index-DsJOqL94.js";import{_ as Me}from"./useSetState-CN9u96ki.js";import{c as S1}from"./index-BrPvHdaT.js";import{C as Ze,L as B2}from"./MoreVert-DOniSEHD.js";import{A as L0}from"./Alert-CvjoyYBC.js";import{p as n1}from"./index-2aUz-aBH.js";import"./api-BDt5g5RU.js";import{i as E2}from"./index-BSr00ZmK.js";import{d as A2}from"./ExpandMore-gjdCPrPn.js";import{d as O2}from"./ChevronRight-C5a3Tp9Z.js";import{d as H2}from"./OpenInNew-BPyaFhom.js";import{u as T0}from"./useThemeProps-BA28YyAa.js";import{F as f1}from"./FormControlLabel-Dd50kGih.js";import{u as $2}from"./useSlotProps-CCyJAuna.js";import{d as F2}from"./DeleteOutline-CbAyWFU_.js";import{c as U2,A as D0,u as q2,S as W2,U as G2}from"./item-BoZPHIoN.js";import{d as K2}from"./ArrowDropDown-C0LbBLoq.js";import{f as Te}from"./format-error-DiR6lB9S.js";import{B as x1}from"./ButtonGroup-HFkgBADe.js";import{T as Le}from"./TextField-CDyde-vy.js";import{I as k1}from"./InputAdornment-DLavXxQC.js";import{S as Ee}from"./Stack-D9gGxV3p.js";import{C as X2}from"./click-to-copy-CO2NnWs4.js";import{d as J2}from"./Launch-CxApRsQk.js";import{S as o0}from"./index-CCt0KYoE.js";import{M as Q2}from"./index-D9_f7f5B.js";import{p as Y2}from"./purify.es-Bq0E5Q3l.js";import{r as Z2}from"./index-DdQMqH36.js";import{d as et}from"./Done-DcSnacmc.js";import{c as N0,d as V0,b as tt,S as ot,a as lt}from"./Stepper-DnzprAA5.js";import{R as nt,a as l0}from"./RadioGroup-DORPFwcd.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-CdXTLibk.js";import"./index-BdrLOxFM.js";import"./redux-CluOqhW1.js";import"./ViewColumn-Cnif--3f.js";import"./FormControl-fwuAUJF7.js";import"./useFormControl-DqfIuuvt.js";import"./FormGroup-CQVrTSBu.js";import"./Grid-CdEXdmAj.js";import"./Select-CRV0iHHv.js";import"./LastPage-BKsIncQL.js";import"./Toolbar-B1kAku_I.js";import"./Search-DX3AW4Ja.js";import"./index-gOnIj4Rb.js";import"./DialogContentText-DCrSbjzq.js";import"./Link-CwMoHxxH.js";import"./raf-schd.esm-B0fy_Dud.js";import"./useSlot-CHqta3Nf.js";import"./jss-plugin-props-sort.esm-CAi1eATI.js";const st=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),rt=["slots","slotProps"],it=se(g0)(({theme:e})=>H({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":H({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":H({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:Q1(e.palette.grey[200],.12)}:{backgroundColor:Q1(e.palette.grey[600],.12)})})),at=se(st)({width:24,height:16});function ct(e){const{slots:t={},slotProps:l={}}=e,s=je(e,rt),r=e;return o.jsx("li",{children:o.jsx(it,H({focusRipple:!0},s,{ownerState:r,children:o.jsx(at,H({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function dt(e){return Fe("MuiBreadcrumbs",e)}const ut=$e("MuiBreadcrumbs",["root","ol","li","separator"]),pt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ht=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},dt,t)},ft=se(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ut.li}`]:t.li},t.root]})({}),xt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),mt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function vt(e,t,l,s){return e.reduce((r,a,i)=>(i<e.length-1?r=r.concat(a,o.jsx(mt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(a),r),[])}const _0=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:a,component:i="nav",slots:u={},slotProps:c={},expandText:f="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:v=1,maxItems:C=8,separator:p="/"}=s,d=je(s,pt),[x,R]=w.useState(!1),y=H({},s,{component:i,expanded:x,expandText:f,itemsAfterCollapse:m,itemsBeforeCollapse:v,maxItems:C,separator:p}),z=ht(y),S=u2({elementType:u.CollapsedIcon,externalSlotProps:c.collapsedIcon,ownerState:y}),M=w.useRef(null),k=I=>{const $=()=>{R(!0);const V=M.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return v+m>=I.length?I:[...I.slice(0,v),o.jsx(ct,{"aria-label":f,slots:{CollapsedIcon:u.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:$},"ellipsis"),...I.slice(I.length-m,I.length)]},P=w.Children.toArray(r).filter(I=>w.isValidElement(I)).map((I,$)=>o.jsx("li",{className:z.li,children:I},`child-${$}`));return o.jsx(ft,H({ref:l,component:i,color:"text.secondary",className:Ue(z.root,a),ownerState:y},d,{children:o.jsx(xt,{className:z.ol,ref:M,ownerState:y,children:vt(x||C&&P.length<=C?P:k(P),z.separator,p,y)})}))});function gt(e){return Fe("MuiStepButton",e)}const n0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),bt=["children","className","icon","optional"],jt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},gt,t)},wt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${n0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>H({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${n0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),Rt=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepButton"}),{children:r,className:a,icon:i,optional:u}=s,c=je(s,bt),{disabled:f,active:m}=w.useContext(N0),{orientation:v}=w.useContext(V0),C=H({},s,{orientation:v}),p=jt(C),d={icon:i,optional:u},x=p2(r,["StepLabel"])?w.cloneElement(r,d):o.jsx(tt,H({},d,{children:r}));return o.jsx(wt,H({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,a),ref:l,ownerState:C,"aria-current":m?"step":void 0},c,{children:x}))});function Ct(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const yt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],zt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},Ct,t)},St=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>H({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),kt=se(r1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),It=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepContent"}),{children:r,className:a,TransitionComponent:i=r1,transitionDuration:u="auto",TransitionProps:c}=s,f=je(s,yt);w.useContext(V0);const{active:m,last:v,expanded:C}=w.useContext(N0),p=H({},s,{last:v}),d=zt(p);let x=u;return u==="auto"&&!i.muiSupportAuto&&(x=void 0),o.jsx(St,H({className:Ue(d.root,a),ref:l,ownerState:p},f,{children:o.jsx(kt,H({as:i,in:m||C,className:d.transition,ownerState:p,timeout:x,unmountOnExit:!0},c,{children:r}))}))});var I1={},Mt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var B0=I1.default=void 0,Pt=Mt(Se()),Lt=o;B0=I1.default=(0,Pt.default)((0,Lt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var M1={},Tt=ke;Object.defineProperty(M1,"__esModule",{value:!0});var E0=M1.default=void 0,Dt=Tt(Se()),Nt=o;E0=M1.default=(0,Dt.default)((0,Nt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var P1={},Vt=ke;Object.defineProperty(P1,"__esModule",{value:!0});var A0=P1.default=void 0,_t=Vt(Se()),Bt=o;A0=P1.default=(0,_t.default)((0,Bt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function L1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[u,c]=w.useState(!1),f=We(m=>m.breakpoints.down("md"));return o.jsxs(g,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(g,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:r||"/"})]})]})}L1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function T1({initUrl:e}){const t=b1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:a}=we(),{api:i}=a1(),[u,c]=w.useState(!0),{blocklet:f}=De(),[m,v]=w.useState(null),[C,p]=w.useState(!1),d=We(L=>L.breakpoints.down("xl")),{componentDid:x=""}=i1(),[R,y]=w.useState(null),z=()=>{a.getProjects({input:{did:f.meta.did,componentDid:x,tenantScope:l}}).then(L=>{const N=(L==null?void 0:L.projects)||[];c(!1),y(N)}).catch(L=>{c(!1),U.error(L.message)})},S=()=>{t(`${J.UNOWNED_DID}/create/none`,{replace:!0})},M=L=>{v(L)},k=()=>{c(!1),p(!0)},P=()=>{p(!1),v(null)},I=L=>{U.error(L.message),p(!1),v(null)},$=L=>{if(!(L!=null&&L.deleted)){U.error("Delete project failed");return}z(),p(!1),v(null)};if(w.useEffect(()=>{z()},[]),!R&&u)return o.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ge,{})});if(!R)return null;if(!R.length)return o.jsxs(g,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(g,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(g,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(o1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:L=>{const N=R[L];return o.jsx(ue,{to:`${N.id}`,children:o.jsx(L1,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:L=>L?o.jsx(M0,{type:"success",children:L}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:L=>L?o.jsx(e0,{size:14,compact:!0,responsive:!1,did:L}):null}},d||x?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:L=>L?o.jsx(e0,{onClick:()=>{t(`/.well-known/service/admin/members?did=${L}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:L}):null}},d||x?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:L=>{const N=(f.children||[]).find(D=>D.meta.did===L);return N?o.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:14,blocklet:N,ancestors:[f]}),o.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},L):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:L=>o.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:L})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:L=>o.jsx(b0,{value:Number(L),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:L=>{const N=R[L];return o.jsxs(g,{display:"flex",children:[o.jsx(ue,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(B0,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:o.jsx(E0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>M(N),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),T=C?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:$,onError:I,extraParams:{projectId:m.id,did:f.meta.did,name:m.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:m.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:m.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Et,{children:[o.jsxs(g,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(g,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(g,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(o1,{onClick:S,variant:"contained",children:[o.jsx(R1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(g,{mt:3}),o.jsx(C1,{className:"main-table",locale:r,data:R,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),m&&o.jsx(y1,{title:`${s("common.delete")} ${m.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:k,onCancel:()=>v(null),children:o.jsx(g,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(L=>o.jsxs(g,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:L})]}))})}),T]})}T1.propTypes={initUrl:h.object};T1.defaultProps={initUrl:null};const Et=ce(g)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B0SXb9R9.js","assets/index-w1h5fjUA.js","assets/index-D8NuaJ66.css","assets/url-join-CL_JDvAa.js","assets/index-B2stpwyi.js","assets/_createAggregator-8eYFUECO.js","assets/index-D2SIiIQf.js","assets/index-CDqA3u6q.js","assets/index-BMiSc2wz.js","assets/fallback-CSFjDMvp.js","assets/index-B1mg4OYA.js","assets/Menu-B-903KAP.js","assets/Toolbar-BRd5bS7b.js","assets/Hidden-CPvi6LIk.js","assets/index-CumCTaTW.js","assets/MoreVert-D_0KIWFk.js","assets/FormControlLabel-l14pLV4s.js","assets/useFormControl-DNefZzFa.js","assets/Stack-Cf8RLPm4.js","assets/ListItemButton-DxmUeeh5.js","assets/selector-BpSDNqsZ.js","assets/ExpandMore-DsX-wPbd.js","assets/Avatar-DdQeYraH.js","assets/useSlot-gmkdMHt7.js","assets/resource-dialog-BVJhpy1Q.js","assets/index-D8QzYVOq.js","assets/emotion-cache.browser.esm-MtkgfpRW.js","assets/index-DTgMnz8b.js","assets/OpenInNew-B33B2IQa.js","assets/index-v0JEVAIK.js","assets/Link-BBclrajR.js","assets/Skeleton-BxBQ28EK.js","assets/HelpOutline-C6jbNZqQ.js","assets/index-DN-ud71W.js","assets/ButtonGroup-DwUDwu6o.js","assets/DialogContentText-Bsce1Ptt.js","assets/TextField-nYO4mCN5.js","assets/FormControl-uyHqpehB.js","assets/Select-B1-paS03.js","assets/index-DEPDXC-J.js","assets/index-Cq51W2RR.js","assets/index-B4lxRZaJ.js","assets/index-4NjjF0-i.js","assets/useThemeProps-D9xeggEi.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-DVPois7s.js","assets/redux-CluOqhW1.js","assets/ViewColumn-83XwXiON.js","assets/FormGroup-D3XfyeLR.js","assets/Grid-Cozd141M.js","assets/Delete-DsXQXt5C.js","assets/LastPage-CDX1Zcgq.js","assets/Search-XQNU_CT0.js","assets/deprecate-BX2YtlbE.js","assets/uniqBy-DuMgcCm2.js","assets/toUpper-DXM7cuGF.js","assets/purify.es-Bq0E5Q3l.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as je,aG as $e,aH as Fe,T as K,r as w,aK as g1,aN as u2,aO as Ue,aP as qe,cY as p2,fK as r1,Z as Se,$ as ke,a1 as We,B as g,P as h,G as J,e as b1,u as te,aR as we,a_ as De,bz as i1,a3 as o1,L as ue,bL as b0,a as ve,aE as ge,N as h2,t as U,a0 as ce,dG as f2,ac as ye,c as pe,I as x2,bW as j1,cj as j0,cM as m2,cV as He,cW as w0,al as v2,da as g2,cQ as Qe,bF as ie,c4 as Ye,fw as b2,aa as Y1,fL as j2,b as ne,n as l1,bo as R0,el as C0,ak as w1,bp as y0,cA as z0,aV as Oe,aU as w2,a5 as S0,fM as Z1,fj as Pe,bm as R2,aw as k0,c3 as C2,l as y2,aD as z2,as as S2,at as d1}from"./index-w1h5fjUA.js";import{d as R1}from"./Add-X4z8DHkm.js";import{d as I0,a as k2}from"./Delete-DsXQXt5C.js";import{d as I2}from"./Error-D9g7mp8J.js";import{D as C1}from"./index-4NjjF0-i.js";import{T as M0,b as M2}from"./index-DkMn9TUE.js";import{C as y1}from"./confirm-DlXzE3-N.js";import{u as a1}from"./session-F_I9Jrbv.js";import{W as e0}from"./did-address-C2pjT4Vo.js";import{E as Ge,D as P2,C as L2,P as T2}from"./react-beautiful-dnd.esm-BKgqJ7JL.js";import{B as z1}from"./bundle-avatar-CG-YcfiD.js";import{S as be}from"./shorten-label-WcbI2P0r.js";import{A as P0}from"./Avatar-DdQeYraH.js";import{d as D2}from"./Download-KhEFO1tw.js";import{d as N2}from"./QuestionMarkCircle-B4nA_yE6.js";import{b as V2,c as t0,T as _2}from"./index-DEPDXC-J.js";import{_ as Me}from"./useSetState-BEl9w6Ey.js";import{c as S1}from"./index-CDqA3u6q.js";import{C as Ze,L as B2}from"./MoreVert-D_0KIWFk.js";import{A as L0}from"./Alert-SdIu9Hlz.js";import{p as n1}from"./index-CSD_wMks.js";import"./api-VcJV-X9V.js";import{i as E2}from"./index-v0JEVAIK.js";import{d as A2}from"./ExpandMore-DsX-wPbd.js";import{d as O2}from"./ChevronRight-CqKzFBJG.js";import{d as H2}from"./OpenInNew-B33B2IQa.js";import{u as T0}from"./useThemeProps-D9xeggEi.js";import{F as f1}from"./FormControlLabel-l14pLV4s.js";import{u as $2}from"./useSlotProps-Beat0gxH.js";import{d as F2}from"./DeleteOutline-DU-DZ2Ol.js";import{c as U2,A as D0,u as q2,S as W2,U as G2}from"./item-Qi3k0S3X.js";import{d as K2}from"./ArrowDropDown-D_j-3Aek.js";import{f as Te}from"./format-error-CDAFfj8A.js";import{B as x1}from"./ButtonGroup-DwUDwu6o.js";import{T as Le}from"./TextField-nYO4mCN5.js";import{I as k1}from"./InputAdornment-D3mFMJR5.js";import{S as Ee}from"./Stack-Cf8RLPm4.js";import{C as X2}from"./click-to-copy-D-NrDLcT.js";import{d as J2}from"./Launch-C-vq9aQf.js";import{S as o0}from"./index-B4lxRZaJ.js";import{M as Q2}from"./index-CqTIWm-d.js";import{p as Y2}from"./purify.es-Bq0E5Q3l.js";import{r as Z2}from"./index-Cx63crA-.js";import{d as et}from"./Done-CEijBk0K.js";import{c as N0,d as V0,b as tt,S as ot,a as lt}from"./Stepper-BMCZXJeS.js";import{R as nt,a as l0}from"./RadioGroup-dmNyerSz.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-MtkgfpRW.js";import"./index-DVPois7s.js";import"./redux-CluOqhW1.js";import"./ViewColumn-83XwXiON.js";import"./FormControl-uyHqpehB.js";import"./useFormControl-DNefZzFa.js";import"./FormGroup-D3XfyeLR.js";import"./Grid-Cozd141M.js";import"./Select-B1-paS03.js";import"./LastPage-CDX1Zcgq.js";import"./Toolbar-BRd5bS7b.js";import"./Search-XQNU_CT0.js";import"./index-Cq51W2RR.js";import"./DialogContentText-Bsce1Ptt.js";import"./Link-BBclrajR.js";import"./raf-schd.esm-CAcrK34B.js";import"./useSlot-gmkdMHt7.js";import"./jss-plugin-props-sort.esm-eHjnd9Xc.js";const st=d2(o.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),rt=["slots","slotProps"],it=se(g0)(({theme:e})=>H({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`},e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":H({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":H({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:Q1(e.palette.grey[200],.12)}:{backgroundColor:Q1(e.palette.grey[600],.12)})})),at=se(st)({width:24,height:16});function ct(e){const{slots:t={},slotProps:l={}}=e,s=je(e,rt),r=e;return o.jsx("li",{children:o.jsx(it,H({focusRipple:!0},s,{ownerState:r,children:o.jsx(at,H({as:t.CollapsedIcon,ownerState:r},l.collapsedIcon))}))})}function dt(e){return Fe("MuiBreadcrumbs",e)}const ut=$e("MuiBreadcrumbs",["root","ol","li","separator"]),pt=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],ht=e=>{const{classes:t}=e;return qe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},dt,t)},ft=se(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${ut.li}`]:t.li},t.root]})({}),xt=se("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),mt=se("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function vt(e,t,l,s){return e.reduce((r,a,i)=>(i<e.length-1?r=r.concat(a,o.jsx(mt,{"aria-hidden":!0,className:t,ownerState:s,children:l},`separator-${i}`)):r.push(a),r),[])}const _0=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiBreadcrumbs"}),{children:r,className:a,component:i="nav",slots:u={},slotProps:c={},expandText:f="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:v=1,maxItems:C=8,separator:p="/"}=s,d=je(s,pt),[x,R]=w.useState(!1),y=H({},s,{component:i,expanded:x,expandText:f,itemsAfterCollapse:m,itemsBeforeCollapse:v,maxItems:C,separator:p}),z=ht(y),S=u2({elementType:u.CollapsedIcon,externalSlotProps:c.collapsedIcon,ownerState:y}),M=w.useRef(null),k=I=>{const $=()=>{R(!0);const V=M.current.querySelector("a[href],button,[tabindex]");V&&V.focus()};return v+m>=I.length?I:[...I.slice(0,v),o.jsx(ct,{"aria-label":f,slots:{CollapsedIcon:u.CollapsedIcon},slotProps:{collapsedIcon:S},onClick:$},"ellipsis"),...I.slice(I.length-m,I.length)]},P=w.Children.toArray(r).filter(I=>w.isValidElement(I)).map((I,$)=>o.jsx("li",{className:z.li,children:I},`child-${$}`));return o.jsx(ft,H({ref:l,component:i,color:"text.secondary",className:Ue(z.root,a),ownerState:y},d,{children:o.jsx(xt,{className:z.ol,ref:M,ownerState:y,children:vt(x||C&&P.length<=C?P:k(P),z.separator,p,y)})}))});function gt(e){return Fe("MuiStepButton",e)}const n0=$e("MuiStepButton",["root","horizontal","vertical","touchRipple"]),bt=["children","className","icon","optional"],jt=e=>{const{classes:t,orientation:l}=e;return qe({root:["root",l],touchRipple:["touchRipple"]},gt,t)},wt=se(g0,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[{[`& .${n0.touchRipple}`]:t.touchRipple},t.root,t[l.orientation]]}})(({ownerState:e})=>H({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${n0.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),Rt=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepButton"}),{children:r,className:a,icon:i,optional:u}=s,c=je(s,bt),{disabled:f,active:m}=w.useContext(N0),{orientation:v}=w.useContext(V0),C=H({},s,{orientation:v}),p=jt(C),d={icon:i,optional:u},x=p2(r,["StepLabel"])?w.cloneElement(r,d):o.jsx(tt,H({},d,{children:r}));return o.jsx(wt,H({focusRipple:!0,disabled:f,TouchRippleProps:{className:p.touchRipple},className:Ue(p.root,a),ref:l,ownerState:C,"aria-current":m?"step":void 0},c,{children:x}))});function Ct(e){return Fe("MuiStepContent",e)}$e("MuiStepContent",["root","last","transition"]);const yt=["children","className","TransitionComponent","transitionDuration","TransitionProps"],zt=e=>{const{classes:t,last:l}=e;return qe({root:["root",l&&"last"],transition:["transition"]},Ct,t)},St=se("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:l}=e;return[t.root,l.last&&t.last]}})(({ownerState:e,theme:t})=>H({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:t.vars?`1px solid ${t.vars.palette.StepContent.border}`:`1px solid ${t.palette.mode==="light"?t.palette.grey[400]:t.palette.grey[600]}`},e.last&&{borderLeft:"none"})),kt=se(r1,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),It=w.forwardRef(function(t,l){const s=g1({props:t,name:"MuiStepContent"}),{children:r,className:a,TransitionComponent:i=r1,transitionDuration:u="auto",TransitionProps:c}=s,f=je(s,yt);w.useContext(V0);const{active:m,last:v,expanded:C}=w.useContext(N0),p=H({},s,{last:v}),d=zt(p);let x=u;return u==="auto"&&!i.muiSupportAuto&&(x=void 0),o.jsx(St,H({className:Ue(d.root,a),ref:l,ownerState:p},f,{children:o.jsx(kt,H({as:i,in:m||C,className:d.transition,ownerState:p,timeout:x,unmountOnExit:!0},c,{children:r}))}))});var I1={},Mt=ke;Object.defineProperty(I1,"__esModule",{value:!0});var B0=I1.default=void 0,Pt=Mt(Se()),Lt=o;B0=I1.default=(0,Pt.default)((0,Lt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"}),"AddBox");var M1={},Tt=ke;Object.defineProperty(M1,"__esModule",{value:!0});var E0=M1.default=void 0,Dt=Tt(Se()),Nt=o;E0=M1.default=(0,Dt.default)((0,Nt.jsx)("path",{d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H15v-8h5V8zm-1 7V3.5L18.5 9zm4 12.66V16h5.66v2h-2.24l2.95 2.95-1.41 1.41L19 19.41v2.24h-2z"}),"FileOpen");var P1={},Vt=ke;Object.defineProperty(P1,"__esModule",{value:!0});var A0=P1.default=void 0,_t=Vt(Se()),Bt=o;A0=P1.default=(0,_t.default)((0,Bt.jsx)("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"}),"HelpOutlineOutlined");function L1({did:e,projectId:t,title:l,logo:s,describe:r}){const i=`${`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${s}`,[u,c]=w.useState(!1),f=We(m=>m.breakpoints.down("md"));return o.jsxs(g,{sx:{display:"flex",flexDirection:"row",color:u?"primary.main":"grey.900",gap:1},onPointerEnter:()=>c(!0),onPointerLeave:()=>c(!1),children:[o.jsx(P0,{sx:{borderRadius:1},src:i}),o.jsxs(g,{children:[o.jsx(be,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:l||"/"}),o.jsx(be,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||u?"primary.main":"grey.700"},children:r||"/"})]})]})}L1.propTypes={projectId:h.string.isRequired,did:h.string.isRequired,title:h.string.isRequired,logo:h.string.isRequired,describe:h.string.isRequired};function T1({initUrl:e}){const t=b1(),l=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:s,locale:r}=te(),{api:a}=we(),{api:i}=a1(),[u,c]=w.useState(!0),{blocklet:f}=De(),[m,v]=w.useState(null),[C,p]=w.useState(!1),d=We(L=>L.breakpoints.down("xl")),{componentDid:x=""}=i1(),[R,y]=w.useState(null),z=()=>{a.getProjects({input:{did:f.meta.did,componentDid:x,tenantScope:l}}).then(L=>{const N=(L==null?void 0:L.projects)||[];c(!1),y(N)}).catch(L=>{c(!1),U.error(L.message)})},S=()=>{t(`${J.UNOWNED_DID}/create/none`,{replace:!0})},M=L=>{v(L)},k=()=>{c(!1),p(!0)},P=()=>{p(!1),v(null)},I=L=>{U.error(L.message),p(!1),v(null)},$=L=>{if(!(L!=null&&L.deleted)){U.error("Delete project failed");return}z(),p(!1),v(null)};if(w.useEffect(()=>{z()},[]),!R&&u)return o.jsx(g,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(Ge,{})});if(!R)return null;if(!R.length)return o.jsxs(g,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(g,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:s("blocklet.publish.blockletEmptyTip")}),o.jsx(g,{sx:{fontSize:14,color:"text.secondary",mb:3},children:s("blocklet.publish.createBlockletTip")}),o.jsx(o1,{onClick:S,variant:"contained",children:s("blocklet.publish.createBlocklet")})]});const V=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:L=>{const N=R[L];return o.jsx(ue,{to:`${N.id}`,children:o.jsx(L1,{did:f.meta.did,projectId:N.id,logo:N.blockletLogo,title:N.blockletTitle,describe:N.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:L=>L?o.jsx(M0,{type:"success",children:L}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:L=>L?o.jsx(e0,{size:14,compact:!0,responsive:!1,did:L}):null}},d||x?null:{label:s("common.createdBy"),name:"createdBy",options:{customBodyRender:L=>L?o.jsx(e0,{onClick:()=>{t(`/.well-known/service/admin/members?did=${L}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:L}):null}},d||x?null:{label:s("common.scope"),name:"componentDid",options:{customBodyRender:L=>{const N=(f.children||[]).find(D=>D.meta.did===L);return N?o.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:14,blocklet:N,ancestors:[f]}),o.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:N.meta.title})]},L):""}}},d||l?null:{label:s("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:L=>o.jsx(g,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(be,{children:L})})}},{label:s("common.updatedAt"),name:"updatedAt",options:{customBodyRender:L=>o.jsx(b0,{value:Number(L),locale:r})}},{label:s("common.actions"),name:"actions",options:{customBodyRenderLite:L=>{const N=R[L];return o.jsxs(g,{display:"flex",children:[o.jsx(ue,{to:`${N.id}/new-release/${N.lastReleaseId}`,children:o.jsx(ve,{title:s("blocklet.publish.createRelease"),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"create",children:o.jsx(B0,{style:{fontSize:18}})})})}),!!N.lastReleaseId&&o.jsx(ve,{title:s("blocklet.publish.viewLastRelease",{name:N.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"secondary","aria-label":"create",children:o.jsx(ue,{style:{display:"flex"},to:`${N.id}/view/${N.lastReleaseId}`,children:o.jsx(E0,{sx:{fontSize:18}})})})}),o.jsx(ve,{title:s("blocklet.publish.delete",{name:N.blockletTitle}),placement:"top",children:o.jsx(ge,{color:"primary","aria-label":"delete",onClick:()=>M(N),children:o.jsx(I0,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),T=C?o.jsx(h2,{open:!0,popup:!0,onClose:P,action:"check-has-project-id",locale:r,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:$,onError:I,extraParams:{projectId:m.id,did:f.meta.did,name:m.blockletTitle},messages:{title:s("blocklet.publish.deleteProject.title",{name:m.blockletTitle}),scan:s("blocklet.publish.deleteProject.scan",{name:m.blockletTitle}),confirm:s("blocklet.publish.deleteProject.confirm"),success:s("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(Et,{children:[o.jsxs(g,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(g,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(g,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:s("common.blockletStudio")}),o.jsx(ve,{title:s("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(A0,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(o1,{onClick:S,variant:"contained",children:[o.jsx(R1,{style:{fontSize:"1.3em",marginRight:4}}),s("blocklet.publish.createBlocklet")]})]}),o.jsx(g,{mt:3}),o.jsx(C1,{className:"main-table",locale:r,data:R,columns:V,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),m&&o.jsx(y1,{title:`${s("common.delete")} ${m.blockletTitle}`,description:s("blocklet.publish.deleteProject.description"),confirm:s("common.confirm"),onConfirm:k,onCancel:()=>v(null),children:o.jsx(g,{sx:{marginTop:2},children:[s("blocklet.publish.deleteProject.tip1"),s("blocklet.publish.deleteProject.tip2"),s("blocklet.publish.deleteProject.tip3")].map(L=>o.jsxs(g,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(I2,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(K,{component:"span",variant:"inherit",color:"text.secondary",children:L})]}))})}),T]})}T1.propTypes={initUrl:h.object};T1.defaultProps={initUrl:null};const Et=ce(g)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as je,aG as $e,aH a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,u0="lastWantToConnectStoreId";function Jl(e){var u,c;const[t,l]=w.useState(null),{session:s}=a1(),r=w.useCallback(f=>{l(f),localStorage.setItem(u0,f==null?void 0:f.id)},[l]),a=w.useMemo(()=>{var C,p,d,x;const f=localStorage.getItem(u0),m=f?(((C=e==null?void 0:e.settings)==null?void 0:C.storeList)||[]).find(R=>R.id===f):null;if(m)return m;let v=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(R=>{var y;return!(R.id!==J.BLOCKLET_STORE.id||R.scope&&R.scope!=="studio"&&R.scope!==((y=s==null?void 0:s.user)==null?void 0:y.did))});return v||(v=(x=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:x[0]),v},[(u=e==null?void 0:e.settings)==null?void 0:u.storeList,(c=s==null?void 0:s.user)==null?void 0:c.did]);return[t||a||{},r]}const h1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){h1[r]&&clearTimeout(h1[r]),await new Promise(u=>setTimeout(u,s));const a=Date.now(),i=async(u,c)=>{try{const f=await e();u(f)}catch(f){Date.now()-a>l?c(f):r?h1[r]=setTimeout(()=>i(u,c),t):setTimeout(()=>i(u,c),t)}};return new Promise(i)}function Ql(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Yl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var a;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((a=r==null?void 0:r.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Zl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,u;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((u=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(c=>c.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,u;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let a=e?((u=l==null?void 0:l.settings)==null?void 0:u.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(c=>c.protected||!c.scope||c.scope==="studio"||c.scope===s),{teamDid:r,storeList:a}};function F1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:a,componentDid:i}){var N,D,B;const{t:u}=te(),{session:c}=a1(),{api:f,info:m,inService:v}=we(),C=De(),[p,d]=w.useState(!1),x=w.useRef(null),[R,y]=w.useState(!1),[z,S]=w.useState(null),M=A=>{l(A),d(!1)},k=()=>{d(!p)},P=A=>{x.current&&x.current.contains(A.target)||d(!1)},I=()=>{y(!0)},$=()=>{y(!1)},V=async()=>{var A;if(z)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:z.url,projectId:"",scope:z.scope||"studio"}}),await((A=C==null?void 0:C.actions)==null?void 0:A.refreshBlocklet())}catch(O){U.error(`Remove Blocklet Store Error: ${Te(O)}`)}finally{S(null)}},{storeList:T}=X0({fromBlocklet:v,blocklet:e,nodeInfo:m,componentDid:i,userDid:(N=c==null?void 0:c.user)==null?void 0:N.did}),L=(D=e==null?void 0:e.meta)==null?void 0:D.did;return o.jsxs(o.Fragment,{children:[o.jsxs(x1,{disabled:r,ref:x,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[a&&o.jsx(l1,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:k,children:o.jsx(K2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:x.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:A})=>o.jsx(C0,{...A,style:{transformOrigin:"center top"},children:o.jsx(w1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[T==null?void 0:T.map(O=>{var W;return o.jsxs(Oe,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>M(O),children:[o.jsxs(g,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U2({store:O,userDid:(W=c==null?void 0:c.user)==null?void 0:W.did})&&o.jsx(ge,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(O)},children:o.jsx(ie,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(w2,{}),o.jsxs(Oe,{onClick:I,children:[o.jsx(R1,{font:!0}),o.jsx(K,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),R&&o.jsx(D0,{hiddenChildren:!0,open:!0,onClose:$,teamDid:L,storeList:T,scope:"studio",onAdd:(B=C==null?void 0:C.actions)==null?void 0:B.refreshBlocklet}),z&&o.jsx(y1,{displayError:!0,title:`${u("common.delete")} ${z.name}`,description:u("blocklet.publish.deleteStoreTip",{name:z.name}),confirm:u("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}F1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};F1.defaultProps={store:null,blocklet:null};const p0=w.lazy(()=>S0(()=>import("./index-BBAn78dN.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,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:a,paramsErrTip:i,setParamsErrTip:u,setLoading:c,initUrl:f,initLogoUrl:m,setInitLogoUrl:v,componentDid:C}){const{t:p}=te(),{api:d}=we(),x=b1(),R=w.useRef(null),y=w.useRef(null),[z,S]=Jl(s),M=q2({messageType:"connect-store-message",onOpen:()=>c(!0),onClose:()=>c(!1)}),k=async D=>{const B=setTimeout(()=>{c(!1)},2e4),A=await Yl(d,D);c(!1),clearTimeout(B),window.parent.postMessage({event:"studioDialog.connected",componentDid:C},"*"),x(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){U.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(z!=null&&z.url)){U.error(p("blocklet.publish.noStoreSelected"));return}const D=Ql();M(async(B,A)=>{var O,W,X;try{const Q=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:z.url,storeId:z.id,storeName:z.name,type:((W=r==null?void 0:r.blockletComponents)==null?void 0:W.length)>0?"pack":"resource",componentDid:C,messageId:D,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(Q!=null&&Q.url)){U.error("failed to connect to store");return}A(Q.url),k({did:(X=s==null?void 0:s.meta)==null?void 0:X.did,projectId:"",messageId:D})}catch(Q){const re=Te(Q);U.error(re),c(!1)}})},I=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,$=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,T=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(D=>`${$}/${D}`),L=()=>t?!1:!e||e===J.UNOWNED_DID?(U.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,N=D=>{if(!D.destination)return;const B=Array.from(r.blockletScreenshots),[A]=B.splice(D.source.index,1);B.splice(D.destination.index,0,A),a(O=>({...O,blockletScreenshots:B}))};return o.jsxs(en,{children:[o.jsx(g,{display:"flex",className:"section",children:o.jsxs(g,{sx:{flex:1},children:[o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:D=>{u({blockletTitle:""}),a({blockletTitle:D.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&o.jsx(k1,{position:"end",children:o.jsx(F1,{blocklet:s,store:z,componentDid:C,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:D=>{u({blockletDescription:""}),a({blockletDescription:D.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(g,{sx:{flex:1},children:[o.jsxs(g,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(Ee,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),o.jsxs(Ee,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),o.jsx(g,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||V,onClick:()=>{var D;L()&&((D=R.current)==null||D.open())}})})]}),o.jsxs(g,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(Ee,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),o.jsxs(Ee,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(g,{sx:{border:"none"},variant:"outlined",size:"small",children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),o.jsx(P2,{onDragEnd:t?void 0:N,children:o.jsx(L2,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(D,B)=>o.jsxs(g,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:B.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:B.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:D.innerRef,...D.droppableProps,children:[T.map((A,O)=>o.jsx(T2,{draggableId:A,index:O,isDragDisabled:t,children:(W,X)=>o.jsxs(g,{ref:W.innerRef,...W.draggableProps,...W.dragHandleProps,className:"screenshot",sx:{transform:X.isDragging?"scale(1.05)":"none",boxShadow:X.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[o.jsx("img",{alt:"screenshot",src:A}),!t&&o.jsx(ge,{className:"action",onClick:()=>{a(Q=>{const re=[...Q.blockletScreenshots];return re.splice(O,1),{...Q,blockletScreenshots:re}})},children:o.jsx(F2,{})})]})},A)),D.placeholder,T.length<5&&o.jsx(g,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var A;L()&&((A=y.current)==null||A.open())},children:"+"})]})})})]})]})}),o.jsxs(w.Suspense,{fallback:o.jsx(Ge,{}),children:[o.jsx(p0,{ref:R,popup:!0,onUploadFinish:D=>{var B;a({blockletLogo:D.data.filename}),v(""),(B=R.current)==null||B.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),o.jsx(p0,{ref:y,popup:!0,onUploadFinish:D=>{var B;a(A=>{var W;const O=A.blockletScreenshots||[];return O.push((W=D.data)==null?void 0:W.filename),{...A,blockletScreenshots:O}}),(B=y.current)==null||B.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:$,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-T.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const en=ce.div`
|
|
136
|
+
`,u0="lastWantToConnectStoreId";function Jl(e){var u,c;const[t,l]=w.useState(null),{session:s}=a1(),r=w.useCallback(f=>{l(f),localStorage.setItem(u0,f==null?void 0:f.id)},[l]),a=w.useMemo(()=>{var C,p,d,x;const f=localStorage.getItem(u0),m=f?(((C=e==null?void 0:e.settings)==null?void 0:C.storeList)||[]).find(R=>R.id===f):null;if(m)return m;let v=(((p=e==null?void 0:e.settings)==null?void 0:p.storeList)||[]).find(R=>{var y;return!(R.id!==J.BLOCKLET_STORE.id||R.scope&&R.scope!=="studio"&&R.scope!==((y=s==null?void 0:s.user)==null?void 0:y.did))});return v||(v=(x=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:x[0]),v},[(u=e==null?void 0:e.settings)==null?void 0:u.storeList,(c=s==null?void 0:s.user)==null?void 0:c.did]);return[t||a||{},r]}const h1={};async function K0(e,{interval:t=1e3,maxDuration:l=120*1e3,intervalFirst:s=4e3,timerKey:r=""}){h1[r]&&clearTimeout(h1[r]),await new Promise(u=>setTimeout(u,s));const a=Date.now(),i=async(u,c)=>{try{const f=await e();u(f)}catch(f){Date.now()-a>l?c(f):r?h1[r]=setTimeout(()=>i(u,c),t):setTimeout(()=>i(u,c),t)}};return new Promise(i)}function Ql(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Yl(e,{did:t,projectId:l,messageId:s}){return K0(async()=>{var a;const r=await e.getProject({input:{did:t,projectId:l,messageId:s}});if(!((a=r==null?void 0:r.project)!=null&&a.blockletDid))throw new Error("Connected store not found");return r.project.blockletDid},{timerKey:"connect-studio"})}function Zl(e,{did:t,projectId:l,storeId:s}){return K0(async()=>{var i,u;const r=await e.getProject({input:{did:t,projectId:l,messageId:""}});if(!((u=(i=r==null?void 0:r.project)==null?void 0:i.connectedStores)!=null&&u.length))throw new Error("Connected store not found");if(!r.project.connectedStores.find(c=>c.storeId===s))throw new Error("Connected store not found")},{timerKey:`connect-store-${s}`})}const X0=({fromBlocklet:e,nodeInfo:t,blocklet:l,userDid:s})=>{var i,u;const r=e?(i=l==null?void 0:l.meta)==null?void 0:i.did:t==null?void 0:t.did;let a=e?((u=l==null?void 0:l.settings)==null?void 0:u.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(a)||(a=[]),a=a.filter(c=>c.protected||!c.scope||c.scope==="studio"||c.scope===s),{teamDid:r,storeList:a}};function F1({blocklet:e,store:t={},onChangeStore:l,onClick:s,disabled:r,loading:a,componentDid:i}){var N,D,B;const{t:u}=te(),{session:c}=a1(),{api:f,info:m,inService:v}=we(),C=De(),[p,d]=w.useState(!1),x=w.useRef(null),[R,y]=w.useState(!1),[z,S]=w.useState(null),M=A=>{l(A),d(!1)},k=()=>{d(!p)},P=A=>{x.current&&x.current.contains(A.target)||d(!1)},I=()=>{y(!0)},$=()=>{y(!1)},V=async()=>{var A;if(z)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:z.url,projectId:"",scope:z.scope||"studio"}}),await((A=C==null?void 0:C.actions)==null?void 0:A.refreshBlocklet())}catch(O){U.error(`Remove Blocklet Store Error: ${Te(O)}`)}finally{S(null)}},{storeList:T}=X0({fromBlocklet:v,blocklet:e,nodeInfo:m,componentDid:i,userDid:(N=c==null?void 0:c.user)==null?void 0:N.did}),L=(D=e==null?void 0:e.meta)==null?void 0:D.did;return o.jsxs(o.Fragment,{children:[o.jsxs(x1,{disabled:r,ref:x,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(ne,{onClick:s,children:[a&&o.jsx(l1,{size:14,sx:{mr:.5}}),`${u("common.connect")} ${t.name||""}`]}),o.jsx(ne,{size:"small","aria-controls":p?"split-button-menu":void 0,"aria-expanded":p?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:k,children:o.jsx(K2,{})})]}),o.jsx(R0,{sx:{zIndex:10},open:p,anchorEl:x.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:A})=>o.jsx(C0,{...A,style:{transformOrigin:"center top"},children:o.jsx(w1,{children:o.jsx(y0,{onClickAway:P,children:o.jsxs(z0,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[T==null?void 0:T.map(O=>{var W;return o.jsxs(Oe,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>M(O),children:[o.jsxs(g,{children:[o.jsx(be,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(be,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U2({store:O,userDid:(W=c==null?void 0:c.user)==null?void 0:W.did})&&o.jsx(ge,{sx:{ml:1},onClick:X=>{X.preventDefault(),X.stopPropagation(),S(O)},children:o.jsx(ie,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(w2,{}),o.jsxs(Oe,{onClick:I,children:[o.jsx(R1,{font:!0}),o.jsx(K,{variant:"inherit",children:u("store.blockletRegistry.addRegistry")})]})]})})})})}),R&&o.jsx(D0,{hiddenChildren:!0,open:!0,onClose:$,teamDid:L,storeList:T,scope:"studio",onAdd:(B=C==null?void 0:C.actions)==null?void 0:B.refreshBlocklet}),z&&o.jsx(y1,{displayError:!0,title:`${u("common.delete")} ${z.name}`,description:u("blocklet.publish.deleteStoreTip",{name:z.name}),confirm:u("common.confirm"),onConfirm:V,onCancel:()=>S(null)})]})}F1.propTypes={store:h.object,blocklet:h.object,onChangeStore:h.func.isRequired,onClick:h.func.isRequired,loading:h.bool.isRequired,disabled:h.bool.isRequired,componentDid:h.string.isRequired,projectType:h.string.isRequired,getData:h.func.isRequired};F1.defaultProps={store:null,blocklet:null};const p0=w.lazy(()=>S0(()=>import("./index-B0SXb9R9.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,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function J0({projectId:e,readOnly:t,loading:l,blocklet:s,params:r,setParams:a,paramsErrTip:i,setParamsErrTip:u,setLoading:c,initUrl:f,initLogoUrl:m,setInitLogoUrl:v,componentDid:C}){const{t:p}=te(),{api:d}=we(),x=b1(),R=w.useRef(null),y=w.useRef(null),[z,S]=Jl(s),M=q2({messageType:"connect-store-message",onOpen:()=>c(!0),onClose:()=>c(!1)}),k=async D=>{const B=setTimeout(()=>{c(!1)},2e4),A=await Yl(d,D);c(!1),clearTimeout(B),window.parent.postMessage({event:"studioDialog.connected",componentDid:C},"*"),x(window.location.pathname.replace(`${J.UNOWNED_DID}/create`,`${A}/create`),{replace:!0})},P=()=>{if(!r.blockletTitle){U.error(p("blocklet.publish.errorTip.noTitle"));return}if(!(z!=null&&z.url)){U.error(p("blocklet.publish.noStoreSelected"));return}const D=Ql();M(async(B,A)=>{var O,W,X;try{const Q=await d.connectByStudio({input:{did:(O=s==null?void 0:s.meta)==null?void 0:O.did,blockletTitle:r==null?void 0:r.blockletTitle,storeUrl:z.url,storeId:z.id,storeName:z.name,type:((W=r==null?void 0:r.blockletComponents)==null?void 0:W.length)>0?"pack":"resource",componentDid:C,messageId:D,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(Q!=null&&Q.url)){U.error("failed to connect to store");return}A(Q.url),k({did:(X=s==null?void 0:s.meta)==null?void 0:X.did,projectId:"",messageId:D})}catch(Q){const re=Te(Q);U.error(re),c(!1)}})},I=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/logo/upload`,$=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${s.meta.did}/${e}/screenshot/upload`,V=r!=null&&r.blockletLogo?`${I}/${r.blockletLogo}`:`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,T=((r==null?void 0:r.blockletScreenshots)||[]).filter(Boolean).map(D=>`${$}/${D}`),L=()=>t?!1:!e||e===J.UNOWNED_DID?(U.error(p("blocklet.publish.errorTip.noFirstDid")),!1):!0,N=D=>{if(!D.destination)return;const B=Array.from(r.blockletScreenshots),[A]=B.splice(D.source.index,1);B.splice(D.destination.index,0,A),a(O=>({...O,blockletScreenshots:B}))};return o.jsxs(en,{children:[o.jsx(g,{display:"flex",className:"section",children:o.jsxs(g,{sx:{flex:1},children:[o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.title")}`,placeholder:`Blocklet ${p("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:r.blockletTitle||"",onChange:D=>{u({blockletTitle:""}),a({blockletTitle:D.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Le,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===J.UNOWNED_DID&&o.jsx(k1,{position:"end",children:o.jsx(F1,{blocklet:s,store:z,componentDid:C,onChangeStore:S,disabled:!r.blockletTitle||t||l,loading:l,onClick:P})})},error:!!i.projectId,helperText:i.projectId||"",value:e===J.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Le,{disabled:l||t,label:`Blocklet ${p("common.description")}`,placeholder:`Blocklet ${p("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:r.blockletDescription||"",onChange:D=>{u({blockletDescription:""}),a({blockletDescription:D.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(g,{sx:{flex:1},children:[o.jsxs(g,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(Ee,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.logo")}),o.jsxs(Ee,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),o.jsx(g,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(P0,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:m||V,onClick:()=>{var D;L()&&((D=R.current)==null||D.open())}})})]}),o.jsxs(g,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(Ee,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(K,{variant:"subtitle1",sx:{fontWeight:"bold"},children:p("common.screenshot")}),o.jsxs(Ee,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(g,{sx:{border:"none"},variant:"outlined",size:"small",children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.ratio"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.count"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.size"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),o.jsx(g,{children:o.jsxs(g,{component:"span",children:[o.jsxs(g,{component:"span",sx:{color:"#555"},children:[p("studio.order"),":"," "]}),o.jsx(g,{component:"span",sx:{color:"#007ec6"},children:p("studio.orderTip")})]})})]})]}),o.jsx(P2,{onDragEnd:t?void 0:N,children:o.jsx(L2,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(D,B)=>o.jsxs(g,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:B.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:B.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:D.innerRef,...D.droppableProps,children:[T.map((A,O)=>o.jsx(T2,{draggableId:A,index:O,isDragDisabled:t,children:(W,X)=>o.jsxs(g,{ref:W.innerRef,...W.draggableProps,...W.dragHandleProps,className:"screenshot",sx:{transform:X.isDragging?"scale(1.05)":"none",boxShadow:X.isDragging?"0 5px 10px rgba(0,0,0,0.15)":"none",transition:"transform 0.2s ease, box-shadow 0.2s ease"},children:[o.jsx("img",{alt:"screenshot",src:A}),!t&&o.jsx(ge,{className:"action",onClick:()=>{a(Q=>{const re=[...Q.blockletScreenshots];return re.splice(O,1),{...Q,blockletScreenshots:re}})},children:o.jsx(F2,{})})]})},A)),D.placeholder,T.length<5&&o.jsx(g,{sx:{width:240,height:135,background:"#eee",cursor:t?"default":"pointer",color:"#999",mb:2},display:"flex",justifyContent:"center",alignItems:"center",fontSize:40,onClick:()=>{var A;L()&&((A=y.current)==null||A.open())},children:"+"})]})})})]})]})}),o.jsxs(w.Suspense,{fallback:o.jsx(Ge,{}),children:[o.jsx(p0,{ref:R,popup:!0,onUploadFinish:D=>{var B;a({blockletLogo:D.data.filename}),v(""),(B=R.current)==null||B.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:I,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*.5,maxNumberOfFiles:1}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,aspectRatio:1,initialAspectRatio:1,autoCropArea:1,croppedCanvasOptions:{minWidth:256,minHeight:256}}}},"uploader-logo"),o.jsx(p0,{ref:y,popup:!0,onUploadFinish:D=>{var B;a(A=>{var W;const O=A.blockletScreenshots||[];return O.push((W=D.data)==null?void 0:W.filename),{...A,blockletScreenshots:O}}),(B=y.current)==null||B.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:$,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-T.length}},dashboardProps:{autoOpen:"imageEditor"},imageEditorProps:{actions:{revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!1,cropWidescreen:!1,cropWidescreenVertical:!1},cropperOptions:{autoCrop:!0,autoCropArea:1,aspectRatio:16/9,initialAspectRatio:16/9,croppedCanvasOptions:{minWidth:1280,minHeight:720,maxWidth:1280*2,maxHeight:720*2}}}},"uploader-screenshot")]})]})}J0.propTypes={projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired,blocklet:h.object.isRequired,setLoading:h.func.isRequired,initUrl:h.object.isRequired,componentDid:h.isRequired,initLogoUrl:h.string.isRequired,setInitLogoUrl:h.func.isRequired};const en=ce.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{av as d2,j as o,aI as se,cR as g0,aM as H,fJ as Q1,aL as je,aG as $e,aH a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function o2({text:e}){return e?o.jsx(Q2,{wrapperElement:{"data-color-mode":"light"},source:Y2.sanitize(e),rehypePlugins:[[Z2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ke})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:a}){var m;const{t:i}=te(),[u,c]=w.useState(a?"preview":"write"),f=(v,C)=>{c(C)};return o.jsxs(g,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(g,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(V2,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t0,{value:"write",label:"Write"}),o.jsx(t0,{value:"preview",label:"Preview"})]})]}),o.jsx(g,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:s||a,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(k1,{position:"end",children:[((m=e==null?void 0:e.blockletIntroduction)==null?void 0:m.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:v=>{r({blockletIntroduction:""}),t({blockletIntroduction:v.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(g,{display:u==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var W1={},un=ke;Object.defineProperty(W1,"__esModule",{value:!0});var n2=W1.default=void 0,pn=un(Se()),f0=o;n2=W1.default=(0,pn.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function G1({step:e,ok:t,active:l,error:s}){let r="grey.500",a=e+1;return t&&(a=o.jsx(et,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",a=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(g,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}G1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};G1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:a,paramsErrTip:i,viewMode:u,projectId:c}){const{t:f}=te(),m=()=>{l(d=>d+1)},v=()=>{l(d=>d-1)},C=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=u||Y0({hasSelectedResources:s,params:r,projectId:c,t:f})===null;return o.jsxs(g,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(ot,{activeStep:t,orientation:"vertical",children:e.map((d,x)=>{const R={},y=a||!cn({hasSelectedResources:s,params:r,projectId:c,step:x,t:f}),z=a?"":C(x);return z&&(R.optional=o.jsx(K,{variant:"caption",color:"error",children:z}),R.error=!0),o.jsxs(lt,{children:[o.jsx(Rt,{icon:o.jsx(G1,{error:z,active:p?99:t,step:x,ok:y}),sx:{cursor:"pointer",color:z?"error.main":"inherit"},disabled:!1,onClick:()=>l(x),...R,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:z||!y&&t>x?"error.main":"inherit",children:d.label})}),o.jsxs(It,{children:[o.jsx(K,{fontSize:12,children:d.description}),!p&&o.jsx(g,{sx:{mb:2},children:o.jsxs("div",{children:[x<e.length-1&&o.jsx(ne,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:z||!y,children:f("common.continue")}),x>0&&o.jsx(ne,{disabled:x===0,onClick:v,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(w1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const hn=[".zip",".gz"],fn=1024*1024*100,xn=w.lazy(()=>S0(()=>import("./index-BBAn78dN.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,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function K1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:a,error:i}){const{t:u}=te(),c=w.useRef(null),f=()=>l?!1:!t||t===J.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(g,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),o.jsxs(Ee,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(K,{component:"a",href:`${m}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var v;f()&&((v=c.current)==null||v.open())},children:s.uploadedResource?u("common.change"):u("common.upload")})]}),o.jsx(w.Suspense,{fallback:o.jsx(Ge,{}),children:o.jsx(xn,{ref:c,popup:!0,onUploadFinish:v=>{var C;r({uploadedResource:v.data.filename}),a({blockletResource:""}),(C=c.current)==null||C.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:hn,maxFileSize:fn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(g,{color:"error.main",mt:1,fontSize:14,children:i})]})}K1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};K1.defaultProps={};function s1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:a}){var u;const{t:i}=te();return o.jsx(g,{display:"flex",mt:3,className:"section",children:o.jsxs(g,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:a||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:c=>{r({blockletVersion:""}),l({blockletVersion:c.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(k1,{position:"end",children:[((u=t==null?void 0:t.note)==null?void 0:u.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:c=>{r({note:""}),l({note:c.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}s1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};s1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const mn=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:24,blocklet:t,ancestors:l}),o.jsx(g,{ml:"4px",className:"text",children:o.jsx(g,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=j1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletResourceType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},vn={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function X1({initUrl:e,...t}){var J1;const{projectId:l,mode:s,releaseId:r,componentDid:a=""}=i1(),{t:i}=te(),{blocklet:u}=De(),[c,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",resourceFromSelect:!0}),[m,v]=Me({}),[C,p]=w.useState(!1),[d,x]=Me(null),{api:R}=we(),y=We(_=>_.breakpoints.down("md")),[z,S]=w.useState({}),[M,k]=w.useState(!1),P=w.useRef({}),[I,$]=Me({}),[V,T]=w.useState(""),[L,N]=Me({}),D=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=D==="readonly",A=w.useMemo(()=>{const _={};return Object.keys(L).forEach(E=>{const Ce=L[E];Ce&&Ce.forEach(c2=>{_[c2]=!0})}),_},[L]),O=w.useCallback(_=>{B&&f({blockletComponents:[]}),N(_)},[B,N,f]),W=w.useCallback((..._)=>{$(..._),v({blockletResource:""})},[]),X=r==="none"?(c==null?void 0:c.lastReleaseId)||"":r,[Q,re]=w.useState(s==="new-release"?4:0);w.useEffect(()=>{l&&v({projectId:""})},[l,v]);const he=w.useMemo(()=>{var _;return(c==null?void 0:c.blockletResourceType)==="resource"?"resource":(_=c==null?void 0:c.blockletComponents)!=null&&_.some(E=>E.included)||Object.keys(A).length||c!=null&&c.uploadedResource?"pack":"resource"},[c==null?void 0:c.blockletComponents,c==null?void 0:c.uploadedResource,A,c==null?void 0:c.blockletResourceType]),de=[],oe=((u==null?void 0:u.children)||[]).filter(_=>{var E;return(E=_.meta.resource)==null?void 0:E.exportApi}).filter(_=>!a||_.meta.did===a);oe.forEach(_=>{mn({tabs:de,blocklet:_,t:i,ancestors:[u]})});const[ee,ae]=w.useState((J1=de[0])==null?void 0:J1.value),fe=!M&&(d==null?void 0:d.status)==="published",Y=fe,xe=y2(()=>{if(!e)return;T(e.searchParams.get("logo")),f(E=>{var Ce;return{...E,blockletTitle:(E==null?void 0:E.blockletTitle)||e.searchParams.get("title"),blockletDescription:(E==null?void 0:E.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(E==null?void 0:E.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=E==null?void 0:E.blockletComponents)!=null&&Ce.length?E==null?void 0:E.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(E==null?void 0:E.note)||e.searchParams.get("note")||"No note"}});const _=e.searchParams.get("resources");try{const E=JSON.parse(_);S(E)}catch{}}),G=async()=>{if(X)try{const _=await R.getRelease({input:{did:u.meta.did,projectId:l,releaseId:X}});if(p(!1),!_.release){U.error("Release not found");return}_.release=r2(_.release),s!=="view"&&(_.release.note=""),f(E=>x0({...E,..._.release,blockletVersion:s==="create"||s==="new-release"?Pe.inc(_.release.blockletVersion,"patch"):_.release.blockletVersion},u)),x(_.release)}catch(_){p(!1),U.error(Te(_))}},le=async()=>{if(l===J.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){U.error(i("blocklet.publish.errorTip.noDid"));return}try{const E=(await R.getProject({input:{did:u.meta.did,projectId:l}})).project||{};E.blockletVersion?(s==="create"||s==="new-release")&&Pe.valid(E.blockletVersion)&&(E.blockletVersion=Pe.inc(E.blockletVersion,"patch")):E.blockletVersion="1.0.0";const Ce=x0(E,u);f(Ce),E.lastReleaseId||xe()}catch(_){U.error(Te(_))}},F=w.useCallback(async()=>{p(!0);try{if(s==="view"){if(!X){U.error("Empty release id");return}await le(),await G();return}await le(),X&&(k(!0),await G())}finally{p(!1)}},[s,X]),Xe=_=>{f({blockletComponents:_})},Je=_=>{f({blockletResourceType:_})};w.useEffect(()=>{F()},[F]),w.useEffect(()=>{l===J.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const Ve=w.useMemo(()=>!!Object.keys(I).find(_=>!!I[_].length),[I]);if(!c&&C)return o.jsx(Ge,{});if(!c)return null;const _e=oe.find(_=>_.meta.did===ee);if(oe.every(_=>_.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const q=_=>{ae(_)},Z=e==null?void 0:e.searchParams.get("resourcesTitle"),Be=e==null?void 0:e.searchParams.get("componentsTitle"),Ie=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Z||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Be||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=Ie[Q]||Ie[Ie.length-1],Re=vn[Q];return o.jsxs(gn,{...t,children:[o.jsx(t2,{blocklet:u,release:d,getData:F,getRelease:G,mode:s,params:c,setParams:f,setParamsErrTip:v,readOnly:Y,isPublished:fe,loading:C,setLoading:p,initLogoUrl:V,releaseId:X,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:L,resourceRelateComponents:A,resourceItem:_e,saveSelectedEventsRef:P,hasSelectedResources:Ve,releaseUsedLast:M,setReleaseUsedLast:k,setRelease:x}),o.jsxs(g,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(g,{pt:3}),o.jsxs(g,{sx:{gap:3},display:"flex",flexDirection:y?"column":"row",children:[!y&&o.jsx(s2,{steps:Ie,loading:C,viewMode:s==="view",params:c,hasSelectedResources:Ve||c.uploadedResource,paramsErrTip:m,activeStep:Q,setActiveStep:re,projectId:l,resourcesUrlTitle:Z,componentsUrlTitle:Be}),o.jsxs(g,{flex:"1",maxWidth:"720px",children:[!y&&Re!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(g,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(N2,{})})})]}),(y||Re==="branding")&&o.jsx(g,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:v,params:c,componentDid:a,blocklet:u,initUrl:e,loading:C,setLoading:p,paramsErrTip:m,readOnly:Y,initLogoUrl:V,setInitLogoUrl:T})}),y&&o.jsx(g,{flexDirection:"column",children:o.jsx(s1,{loading:C,params:c,paramsErrTip:m,setParams:f,setParamsErrTip:v,readOnly:Y})}),(y||Re==="introduction")&&o.jsx(g,{display:"flex",flexDirection:"column",sx:{mt:y?5:0,width:"100%"},children:o.jsx(l2,{loading:C,readOnly:Y,params:c,setParams:f,paramsErrTip:m,setParamsErrTip:v})}),y&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Ie[m0.resources].label}),o.jsx(g,{display:y||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(g,{sx:{flex:1},children:[o.jsxs(nt,{onChange:()=>f({resourceFromSelect:!c.resourceFromSelect}),children:[o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:c.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:!c.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),c.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(_2,{tabs:de,current:ee,onChange:q,sx:{ml:-2,mt:2,maxWidth:y?window.innerWidth-24:"100%"}}),o.jsx($1,{loading:C,initialResources:z,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:W,setResourceComponentsMap:O,error:m.blockletResource,app:u,readOnly:Y,component:_e,componentDid:a,initUrl:e,params:c,setParams:f,projectId:l===J.UNOWNED_DID?"":l,releaseUsedLast:M,release:{...d,id:X}})]}),!c.resourceFromSelect&&o.jsx(K1,{app:u,readOnly:Y,projectId:l===J.UNOWNED_DID?"":l,params:c,error:m.blockletResource,setParams:f,setParamsErrTip:v})]})})}),y&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Ie[m0.blocklets].label}),(y||Re==="blocklets")&&o.jsx(g,{flexDirection:"column",children:o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsx(g,{sx:{flex:1},children:o.jsx(V1,{projectType:he,disabled:C||Y,app:u,value:(c==null?void 0:c.blockletComponents)||[],blockletResourceType:(c==null?void 0:c.blockletResourceType)||"",onChange:Xe,onChangeBlockletResourceType:Je,resourceRelateComponents:A,dependentComponentsMode:D})})})}),!y&&Re==="version"&&o.jsx(g,{flexDirection:"column",children:o.jsx(s1,{loading:C,params:c,paramsErrTip:m,setParams:f,setParamsErrTip:v,readOnly:Y})})]})]})]})]})}X1.propTypes={initUrl:h.object};X1.defaultProps={initUrl:null};const gn=ce.div`
|
|
181
|
+
`;function o2({text:e}){return e?o.jsx(Q2,{wrapperElement:{"data-color-mode":"light"},source:Y2.sanitize(e),rehypePlugins:[[Z2,{target:"_blank"}]]}):o.jsx(ze,{Icon:Ke})}o2.propTypes={text:h.string.isRequired};function l2({params:e,setParams:t,paramsErrTip:l,loading:s,setParamsErrTip:r,readOnly:a}){var m;const{t:i}=te(),[u,c]=w.useState(a?"preview":"write"),f=(v,C)=>{c(C)};return o.jsxs(g,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(g,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(K,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(V2,{value:u,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t0,{value:"write",label:"Write"}),o.jsx(t0,{value:"preview",label:"Preview"})]})]}),o.jsx(g,{display:u==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Le,{disabled:s||a,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:a,endAdornment:o.jsxs(k1,{position:"end",children:[((m=e==null?void 0:e.blockletIntroduction)==null?void 0:m.length)||0," / ",ye.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:v=>{r({blockletIntroduction:""}),t({blockletIntroduction:v.target.value.slice(0,ye.PROJECT.MAX_INTRO_LENGTH)})},error:!!l.blockletIntroduction,helperText:l.blockletIntroduction||""})}),o.jsx(g,{display:u==="preview"?"block":"none",mt:3,children:o.jsx(o2,{text:e.blockletIntroduction||""})})]})}l2.propTypes={params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,readOnly:h.bool.isRequired,loading:h.bool.isRequired};var W1={},un=ke;Object.defineProperty(W1,"__esModule",{value:!0});var n2=W1.default=void 0,pn=un(Se()),f0=o;n2=W1.default=(0,pn.default)([(0,f0.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f0.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function G1({step:e,ok:t,active:l,error:s}){let r="grey.500",a=e+1;return t&&(a=o.jsx(et,{sx:{fontSize:18,margin:0},color:"white"})),s||!t&&l>e?(r="error.main",a=o.jsx(n2,{sx:{fontSize:18,margin:0},color:"white"})):l>=e&&(r="primary.main"),o.jsx(g,{width:24,height:24,bgcolor:r,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:a})}G1.propTypes={step:h.number,ok:h.bool,active:h.number,error:h.string};G1.defaultProps={step:0,ok:!1,active:0,error:""};function s2({steps:e,activeStep:t,setActiveStep:l,hasSelectedResources:s,params:r,loading:a,paramsErrTip:i,viewMode:u,projectId:c}){const{t:f}=te(),m=()=>{l(d=>d+1)},v=()=>{l(d=>d-1)},C=d=>d===0?(i==null?void 0:i.blockletTitle)||(i==null?void 0:i.projectId)||(i==null?void 0:i.blockletDescription):d===2?i==null?void 0:i.blockletResource:d>=4?(i==null?void 0:i.blockletVersion)||(i==null?void 0:i.note):"",p=u||Y0({hasSelectedResources:s,params:r,projectId:c,t:f})===null;return o.jsxs(g,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(ot,{activeStep:t,orientation:"vertical",children:e.map((d,x)=>{const R={},y=a||!cn({hasSelectedResources:s,params:r,projectId:c,step:x,t:f}),z=a?"":C(x);return z&&(R.optional=o.jsx(K,{variant:"caption",color:"error",children:z}),R.error=!0),o.jsxs(lt,{children:[o.jsx(Rt,{icon:o.jsx(G1,{error:z,active:p?99:t,step:x,ok:y}),sx:{cursor:"pointer",color:z?"error.main":"inherit"},disabled:!1,onClick:()=>l(x),...R,children:o.jsx(K,{fontSize:"14px",fontWeight:"500",color:z||!y&&t>x?"error.main":"inherit",children:d.label})}),o.jsxs(It,{children:[o.jsx(K,{fontSize:12,children:d.description}),!p&&o.jsx(g,{sx:{mb:2},children:o.jsxs("div",{children:[x<e.length-1&&o.jsx(ne,{variant:"contained",onClick:m,sx:{mt:1,mr:1},disabled:z||!y,children:f("common.continue")}),x>0&&o.jsx(ne,{disabled:x===0,onClick:v,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(w1,{square:!0,elevation:0,sx:{p:3},children:o.jsx(K,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}s2.propTypes={steps:h.array.isRequired,activeStep:h.number.isRequired,setActiveStep:h.func.isRequired,params:h.object.isRequired,viewMode:h.string.isRequired,loading:h.bool.isRequired,projectId:h.string.isRequired,hasSelectedResources:h.bool.isRequired,paramsErrTip:h.shape({projectId:h.string,blockletVersion:h.string,blockletTitle:h.string,blockletDescription:h.string,note:h.string,blockletResource:h.string}).isRequired};const hn=[".zip",".gz"],fn=1024*1024*100,xn=w.lazy(()=>S0(()=>import("./index-B0SXb9R9.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,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57])).then(e=>({default:e.Uploader})));function K1({app:e,projectId:t,readOnly:l,params:s,setParams:r,setParamsErrTip:a,error:i}){const{t:u}=te(),c=w.useRef(null),f=()=>l?!1:!t||t===J.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,m=`${J.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(g,{sx:{mt:3},children:[o.jsx(K,{gutterBottom:!0,children:u("blocklet.publish.resourceUpload")}),o.jsxs(Ee,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:l?"default":"pointer"},children:[!!s.uploadedResource&&o.jsx(K,{component:"a",href:`${m}/params.uploadedResource`,children:s.uploadedResource}),!l&&o.jsx(ne,{variant:"outlined",size:"small",onClick:()=>{var v;f()&&((v=c.current)==null||v.open())},children:s.uploadedResource?u("common.change"):u("common.upload")})]}),o.jsx(w.Suspense,{fallback:o.jsx(Ge,{}),children:o.jsx(xn,{ref:c,popup:!0,onUploadFinish:v=>{var C;r({uploadedResource:v.data.filename}),a({blockletResource:""}),(C=c.current)==null||C.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:m,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:hn,maxFileSize:fn,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(g,{color:"error.main",mt:1,fontSize:14,children:i})]})}K1.propTypes={app:h.object.isRequired,projectId:h.string.isRequired,readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,error:h.string.isRequired,setParamsErrTip:h.func.isRequired};K1.defaultProps={};function s1({readOnly:e,params:t,setParams:l,paramsErrTip:s,setParamsErrTip:r,loading:a}){var u;const{t:i}=te();return o.jsx(g,{display:"flex",mt:3,className:"section",children:o.jsxs(g,{sx:{flex:1},children:[o.jsx(Le,{required:!0,disabled:a||e,label:`Blocklet ${i("common.version")}`,placeholder:`Blocklet ${i("common.version")}`,InputProps:{"data-cy":"blocklet-version",readOnly:e},autoComplete:"off",variant:"outlined",fullWidth:!0,value:t.blockletVersion||"",onChange:c=>{r({blockletVersion:""}),l({blockletVersion:c.target.value})},error:!!s.blockletVersion,helperText:s.blockletVersion||""}),o.jsx(Le,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:a||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(k1,{position:"end",children:[((u=t==null?void 0:t.note)==null?void 0:u.length)||0," / ",ye.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:c=>{r({note:""}),l({note:c.target.value.slice(0,ye.PROJECT.MAX_NOTE_LENGTH)})},error:!!s.note,helperText:s.note||"",sx:{mt:3}})]})})}s1.propTypes={readOnly:h.bool.isRequired,params:h.object.isRequired,setParams:h.func.isRequired,paramsErrTip:h.object.isRequired,setParamsErrTip:h.func.isRequired,loading:h.bool.isRequired};s1.defaultProps={};function r2(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&r2(e[t]);return e}const mn=({tabs:e,blocklet:t,ancestors:l=[]})=>{const s=t.meta.did;e.push({label:o.jsxs(g,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(z1,{size:24,blocklet:t,ancestors:l}),o.jsx(g,{ml:"4px",className:"text",children:o.jsx(g,{children:t.meta.title})})]},s),value:s})},x0=(e,t)=>{const l=j1(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletResourceType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return l.blockletComponents?l.blockletComponents=l.blockletComponents.map(s=>({...s,included:!0})):l.blockletComponents=(t.children||[]).map(s=>({did:s.meta.did,included:!1,required:!1})),l.resourceFromSelect=!l.uploadedResource,l},vn={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},m0={branding:0,introduction:1,resources:2,blocklets:3,version:4};function X1({initUrl:e,...t}){var J1;const{projectId:l,mode:s,releaseId:r,componentDid:a=""}=i1(),{t:i}=te(),{blocklet:u}=De(),[c,f]=Me({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",resourceFromSelect:!0}),[m,v]=Me({}),[C,p]=w.useState(!1),[d,x]=Me(null),{api:R}=we(),y=We(_=>_.breakpoints.down("md")),[z,S]=w.useState({}),[M,k]=w.useState(!1),P=w.useRef({}),[I,$]=Me({}),[V,T]=w.useState(""),[L,N]=Me({}),D=e==null?void 0:e.searchParams.get("dependentComponentsMode"),B=D==="readonly",A=w.useMemo(()=>{const _={};return Object.keys(L).forEach(E=>{const Ce=L[E];Ce&&Ce.forEach(c2=>{_[c2]=!0})}),_},[L]),O=w.useCallback(_=>{B&&f({blockletComponents:[]}),N(_)},[B,N,f]),W=w.useCallback((..._)=>{$(..._),v({blockletResource:""})},[]),X=r==="none"?(c==null?void 0:c.lastReleaseId)||"":r,[Q,re]=w.useState(s==="new-release"?4:0);w.useEffect(()=>{l&&v({projectId:""})},[l,v]);const he=w.useMemo(()=>{var _;return(c==null?void 0:c.blockletResourceType)==="resource"?"resource":(_=c==null?void 0:c.blockletComponents)!=null&&_.some(E=>E.included)||Object.keys(A).length||c!=null&&c.uploadedResource?"pack":"resource"},[c==null?void 0:c.blockletComponents,c==null?void 0:c.uploadedResource,A,c==null?void 0:c.blockletResourceType]),de=[],oe=((u==null?void 0:u.children)||[]).filter(_=>{var E;return(E=_.meta.resource)==null?void 0:E.exportApi}).filter(_=>!a||_.meta.did===a);oe.forEach(_=>{mn({tabs:de,blocklet:_,t:i,ancestors:[u]})});const[ee,ae]=w.useState((J1=de[0])==null?void 0:J1.value),fe=!M&&(d==null?void 0:d.status)==="published",Y=fe,xe=y2(()=>{if(!e)return;T(e.searchParams.get("logo")),f(E=>{var Ce;return{...E,blockletTitle:(E==null?void 0:E.blockletTitle)||e.searchParams.get("title"),blockletDescription:(E==null?void 0:E.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(E==null?void 0:E.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(Ce=E==null?void 0:E.blockletComponents)!=null&&Ce.length?E==null?void 0:E.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(E==null?void 0:E.note)||e.searchParams.get("note")||"No note"}});const _=e.searchParams.get("resources");try{const E=JSON.parse(_);S(E)}catch{}}),G=async()=>{if(X)try{const _=await R.getRelease({input:{did:u.meta.did,projectId:l,releaseId:X}});if(p(!1),!_.release){U.error("Release not found");return}_.release=r2(_.release),s!=="view"&&(_.release.note=""),f(E=>x0({...E,..._.release,blockletVersion:s==="create"||s==="new-release"?Pe.inc(_.release.blockletVersion,"patch"):_.release.blockletVersion},u)),x(_.release)}catch(_){p(!1),U.error(Te(_))}},le=async()=>{if(l===J.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!l){U.error(i("blocklet.publish.errorTip.noDid"));return}try{const E=(await R.getProject({input:{did:u.meta.did,projectId:l}})).project||{};E.blockletVersion?(s==="create"||s==="new-release")&&Pe.valid(E.blockletVersion)&&(E.blockletVersion=Pe.inc(E.blockletVersion,"patch")):E.blockletVersion="1.0.0";const Ce=x0(E,u);f(Ce),E.lastReleaseId||xe()}catch(_){U.error(Te(_))}},F=w.useCallback(async()=>{p(!0);try{if(s==="view"){if(!X){U.error("Empty release id");return}await le(),await G();return}await le(),X&&(k(!0),await G())}finally{p(!1)}},[s,X]),Xe=_=>{f({blockletComponents:_})},Je=_=>{f({blockletResourceType:_})};w.useEffect(()=>{F()},[F]),w.useEffect(()=>{l===J.UNOWNED_DID&&(s==="create"||s==="new-release")&&e&&xe()},[l,e,s,xe]);const Ve=w.useMemo(()=>!!Object.keys(I).find(_=>!!I[_].length),[I]);if(!c&&C)return o.jsx(Ge,{});if(!c)return null;const _e=oe.find(_=>_.meta.did===ee);if(oe.every(_=>_.status!=="running")&&(oe!=null&&oe.length))return o.jsx(ze,{children:i("blocklet.publish.allComponentsNotRunning")});const q=_=>{ae(_)},Z=e==null?void 0:e.searchParams.get("resourcesTitle"),Be=e==null?void 0:e.searchParams.get("componentsTitle"),Ie=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Z||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:Be||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],a2=Ie[Q]||Ie[Ie.length-1],Re=vn[Q];return o.jsxs(gn,{...t,children:[o.jsx(t2,{blocklet:u,release:d,getData:F,getRelease:G,mode:s,params:c,setParams:f,setParamsErrTip:v,readOnly:Y,isPublished:fe,loading:C,setLoading:p,initLogoUrl:V,releaseId:X,projectId:l,projectType:he,resourceComponents:oe,resourceComponentsMap:L,resourceRelateComponents:A,resourceItem:_e,saveSelectedEventsRef:P,hasSelectedResources:Ve,releaseUsedLast:M,setReleaseUsedLast:k,setRelease:x}),o.jsxs(g,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(g,{pt:3}),o.jsxs(g,{sx:{gap:3},display:"flex",flexDirection:y?"column":"row",children:[!y&&o.jsx(s2,{steps:Ie,loading:C,viewMode:s==="view",params:c,hasSelectedResources:Ve||c.uploadedResource,paramsErrTip:m,activeStep:Q,setActiveStep:re,projectId:l,resourcesUrlTitle:Z,componentsUrlTitle:Be}),o.jsxs(g,{flex:"1",maxWidth:"720px",children:[!y&&Re!=="introduction"&&o.jsxs(K,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[a2.label,Re==="branding"&&o.jsx(ve,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(g,{component:"a",target:"_blank",href:"https://www.arcblock.io/docs/blocklet-store/en/blocklet-detail-page",sx:{paddingTop:1,marginLeft:1},style:{color:"gray"},children:o.jsx(N2,{})})})]}),(y||Re==="branding")&&o.jsx(g,{flexDirection:"column",children:o.jsx(J0,{projectId:l,setParams:f,setParamsErrTip:v,params:c,componentDid:a,blocklet:u,initUrl:e,loading:C,setLoading:p,paramsErrTip:m,readOnly:Y,initLogoUrl:V,setInitLogoUrl:T})}),y&&o.jsx(g,{flexDirection:"column",children:o.jsx(s1,{loading:C,params:c,paramsErrTip:m,setParams:f,setParamsErrTip:v,readOnly:Y})}),(y||Re==="introduction")&&o.jsx(g,{display:"flex",flexDirection:"column",sx:{mt:y?5:0,width:"100%"},children:o.jsx(l2,{loading:C,readOnly:Y,params:c,setParams:f,paramsErrTip:m,setParamsErrTip:v})}),y&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Ie[m0.resources].label}),o.jsx(g,{display:y||Re==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(g,{sx:{flex:1},children:[o.jsxs(nt,{onChange:()=>f({resourceFromSelect:!c.resourceFromSelect}),children:[o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:c.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f1,{value:"select",disabled:Y,control:o.jsx(l0,{size:"small",checked:!c.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),c.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!a&&o.jsx(_2,{tabs:de,current:ee,onChange:q,sx:{ml:-2,mt:2,maxWidth:y?window.innerWidth-24:"100%"}}),o.jsx($1,{loading:C,initialResources:z,saveSelectedEventsRef:P,selectedResourceIds:I,setSelectedResourceIds:W,setResourceComponentsMap:O,error:m.blockletResource,app:u,readOnly:Y,component:_e,componentDid:a,initUrl:e,params:c,setParams:f,projectId:l===J.UNOWNED_DID?"":l,releaseUsedLast:M,release:{...d,id:X}})]}),!c.resourceFromSelect&&o.jsx(K1,{app:u,readOnly:Y,projectId:l===J.UNOWNED_DID?"":l,params:c,error:m.blockletResource,setParams:f,setParamsErrTip:v})]})})}),y&&o.jsx(K,{variant:"h6",fontWeight:"bold",mt:5,children:Ie[m0.blocklets].label}),(y||Re==="blocklets")&&o.jsx(g,{flexDirection:"column",children:o.jsx(g,{display:"flex",mt:3,className:"section full-width",children:o.jsx(g,{sx:{flex:1},children:o.jsx(V1,{projectType:he,disabled:C||Y,app:u,value:(c==null?void 0:c.blockletComponents)||[],blockletResourceType:(c==null?void 0:c.blockletResourceType)||"",onChange:Xe,onChangeBlockletResourceType:Je,resourceRelateComponents:A,dependentComponentsMode:D})})})}),!y&&Re==="version"&&o.jsx(g,{flexDirection:"column",children:o.jsx(s1,{loading:C,params:c,paramsErrTip:m,setParams:f,setParamsErrTip:v,readOnly:Y})})]})]})]})]})}X1.propTypes={initUrl:h.object};X1.defaultProps={initUrl:null};const gn=ce.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|