@abtnode/blocklet-services 1.16.34-beta-20241127-121930-0923dfae → 1.16.34-beta-20241129-100152-679bd732
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/routes/blocklet.js +32 -0
- package/dist/assets/{Add-B6Ua6q-Z.js → Add-mXZrOf1h.js} +1 -1
- package/dist/assets/{Alert-CWJPPP63.js → Alert-DaafqUlw.js} +1 -1
- package/dist/assets/ArrowBackIos-BubgDQVS.js +1 -0
- package/dist/assets/{ArrowDropDown-BgPwecc9.js → ArrowDropDown-BtoPSHd8.js} +1 -1
- package/dist/assets/{Autocomplete-D3KoPHQM.js → Autocomplete-Bi_-KQfy.js} +1 -1
- package/dist/assets/{Avatar-D2r2PRgc.js → Avatar-Adx9Z0tZ.js} +1 -1
- package/dist/assets/{ButtonGroup-DUcvj0JP.js → ButtonGroup-BWb37jJW.js} +1 -1
- package/dist/assets/{CSSTransition-RPNtr5GO.js → CSSTransition-Dh8w9n01.js} +1 -1
- package/dist/assets/{CheckCircle-sPepMcgF.js → CheckCircle-CgD3tBC-.js} +1 -1
- package/dist/assets/{ChevronLeft-CnA-vGpD.js → ChevronLeft-CYIWlSCI.js} +1 -1
- package/dist/assets/{ChevronRight-BDSOab3L.js → ChevronRight-CwMDvr2n.js} +1 -1
- package/dist/assets/{Close-Bwwj0idf.js → Close-FBVHjH44.js} +1 -1
- package/dist/assets/Delete-CjUdkXlU.js +1 -0
- package/dist/assets/{DeleteOutline-CIxtpsDT.js → DeleteOutline-CzTPA4kL.js} +1 -1
- package/dist/assets/DialogContentText-Dydxe3m7.js +1 -0
- package/dist/assets/{Done-D9WIbYXR.js → Done-PbP-u2lH.js} +1 -1
- package/dist/assets/{Download-CqE0jRjy.js → Download-pBnEdFOD.js} +1 -1
- package/dist/assets/{EditIcon-BZlum5dn.js → EditIcon-D6m2tQ3O.js} +1 -1
- package/dist/assets/{Error-DtG_nJnF.js → Error-HNpddmqm.js} +1 -1
- package/dist/assets/{ExpandMore-5W_549ow.js → ExpandMore-B8oaKzsK.js} +1 -1
- package/dist/assets/FormControl-DD67kWGJ.js +1 -0
- package/dist/assets/{FormControlLabel-BxRswD5v.js → FormControlLabel-BaYmyBlu.js} +1 -1
- package/dist/assets/FormGroup-th0rZzfK.js +1 -0
- package/dist/assets/{Google-qI8npLuN.js → Google-BteNIqNP.js} +1 -1
- package/dist/assets/{Grid-BA09q8_6.js → Grid-DxM3VqDH.js} +1 -1
- package/dist/assets/{HelpOutline-D7SWssuj.js → HelpOutline-DYeyCE3o.js} +1 -1
- package/dist/assets/{Hidden-CxNxqyOD.js → Hidden-CXUMFZRF.js} +1 -1
- package/dist/assets/{InfoOutlined-BFgnejR3.js → InfoOutlined-BJbU1dHl.js} +1 -1
- package/dist/assets/{InputAdornment-DswAHyKT.js → InputAdornment-BjTDlo1K.js} +1 -1
- package/dist/assets/{LastPage-tIk3DwvT.js → LastPage-DnljsHk-.js} +1 -1
- package/dist/assets/{Launch-BBO9P6pW.js → Launch-BeWg-XKa.js} +1 -1
- package/dist/assets/{LaunchOutlined-CHU3XSU7.js → LaunchOutlined-DtUGH3OW.js} +1 -1
- package/dist/assets/Link-BEFhKJq0.js +1 -0
- package/dist/assets/{ListItemButton-CvN22ZX5.js → ListItemButton-G-aWGmX0.js} +1 -1
- package/dist/assets/{ListSubheader-BjVS24fA.js → ListSubheader-CJ8rPs4Q.js} +1 -1
- package/dist/assets/{LoadingButton-BS19Y6Tw.js → LoadingButton-C-EDtX6C.js} +1 -1
- package/dist/assets/{LockIcon-BSrbW2OE.js → LockIcon-CYLVEooE.js} +1 -1
- package/dist/assets/{Loop-CXmGQ_OC.js → Loop-CIgMv9HE.js} +1 -1
- package/dist/assets/{MarkEmailRead-BT2Vq33O.js → MarkEmailRead-BNiANVq1.js} +1 -1
- package/dist/assets/{Menu-DDbT3zvj.js → Menu-BW47wukv.js} +1 -1
- package/dist/assets/{MoreHoriz-DPe0cN5I.js → MoreHoriz-CJmEH65j.js} +1 -1
- package/dist/assets/{MoreVert-C7wRaOtv.js → MoreVert-DLwvbbqd.js} +1 -1
- package/dist/assets/{OpenInNew-CXwMNDRH.js → OpenInNew-K-C4gsO1.js} +1 -1
- package/dist/assets/{Pagination-BAVQqann.js → Pagination-Dq4SzKhv.js} +1 -1
- package/dist/assets/{PlayArrow-cvQuZ8GO.js → PlayArrow-n1twcRud.js} +1 -1
- package/dist/assets/{QuestionMarkCircle-MfFIsz6w.js → QuestionMarkCircle-tCeIxlN3.js} +1 -1
- package/dist/assets/{RadioGroup-Bg1SV6KY.js → RadioGroup-DIin5rK_.js} +1 -1
- package/dist/assets/{Search-BqBCe5ki.js → Search-BMru4B7h.js} +1 -1
- package/dist/assets/{Select-YmfypP2F.js → Select-CDj8XFCr.js} +2 -2
- package/dist/assets/{ServerLogo-BxkjdQYl.js → ServerLogo-DT7vgAES.js} +1 -1
- package/dist/assets/{Skeleton-CACxc5Uz.js → Skeleton-Dq3yy5K4.js} +5 -5
- package/dist/assets/{Slider-CzpmIBcy.js → Slider-BBUwYcyt.js} +1 -1
- package/dist/assets/Stack-ID2bvJFU.js +1 -0
- package/dist/assets/{Stepper-BXsAA8yH.js → Stepper-oTT6WH0K.js} +1 -1
- package/dist/assets/{TextField-BUFHAnNK.js → TextField-GO8E4D8x.js} +1 -1
- package/dist/assets/{Toolbar-JUHTVGzV.js → Toolbar-Kng3WhVc.js} +1 -1
- package/dist/assets/{ViewColumn-jrdyac4S.js → ViewColumn-gNP4x-sg.js} +1 -1
- package/dist/assets/{ViewList-B3smRpWd.js → ViewList-DpyY5ugC.js} +1 -1
- package/dist/assets/{_createAggregator-DYS_Ds6-.js → _createAggregator-Bj6ourdE.js} +1 -1
- package/dist/assets/access-control-BG4EF_hx.js +13 -0
- package/dist/assets/{actions-Dibi1EdH.js → actions-egBtnEJO.js} +1 -1
- package/dist/assets/{add-component-core-DP59PpwH.js → add-component-core-BZjSv5V7.js} +597 -24
- package/dist/assets/add-resource-B4KK4ENF.js +1 -0
- package/dist/assets/{addon-C-v40wwX.js → addon-ChxdyV8s.js} +1 -1
- package/dist/assets/{analytics-CHoNglPk.js → analytics-BNddEk9_.js} +8 -8
- package/dist/assets/api-X6cMA7j1.js +1 -0
- package/dist/assets/ar-BVsNK7VV.js +1 -0
- package/dist/assets/{audit-logs-DtIh4hiz.js → audit-logs-C5ukCiti.js} +1 -1
- package/dist/assets/{base32-DCObnDPa.js → base32-DiHjpMk3.js} +1 -1
- package/dist/assets/{branding-ZQ4CmDsH.js → branding-CNPED9Yg.js} +2 -2
- package/dist/assets/bundle-avatar-BMYoF8YT.js +1 -0
- package/dist/assets/{button-NZaA5M6t.js → button-BUxzyD8I.js} +1 -1
- package/dist/assets/{click-to-copy-2G3TnzwZ.js → click-to-copy-Chph5bbk.js} +1 -1
- package/dist/assets/{complete-CziCaD75.js → complete-BqNLnMea.js} +4 -4
- package/dist/assets/{component-wQAbt5Q3.js → component-CHtRRUTN.js} +1 -1
- package/dist/assets/{config-BcpIe2R7.js → config-5Lv3Gr6U.js} +1 -1
- package/dist/assets/{config-D5SS71IZ.js → config-D1inqCBz.js} +2 -2
- package/dist/assets/{config-navigation-CCtGjPQJ.js → config-navigation-BVn4O5g1.js} +5 -5
- package/dist/assets/{config-space-CXlvk2nD.js → config-space-Bwfds2x7.js} +1 -1
- package/dist/assets/{confirm-CRz8exrR.js → confirm-DF9JbbCJ.js} +2 -2
- package/dist/assets/{connect-DXdc9kWf.js → connect-BFfXSmaa.js} +1 -1
- package/dist/assets/{connect-CNahQIe6.js → connect-BbTj5LFE.js} +1 -1
- package/dist/assets/{connect-to-C0srwZbp.js → connect-to-v0E4vbkK.js} +1 -1
- package/dist/assets/{content-layout-DCC3N0Ow.js → content-layout-BoriYFvl.js} +1 -1
- package/dist/assets/dashboard-vLl8x6aG.js +165 -0
- package/dist/assets/de-jtbglBCV.js +1 -0
- package/dist/assets/{deprecate-FglFs_bk.js → deprecate-DCu9jut5.js} +1 -1
- package/dist/assets/{did-address-BkdwWWEb.js → did-address-DOCLeksL.js} +1 -1
- package/dist/assets/domain-DRA23X8T.js +9 -0
- package/dist/assets/{domain-list-DgXgEmUx.js → domain-list-aULRrT5X.js} +2 -2
- package/dist/assets/{email-C6LgzIfO.js → email-fEPnd-HL.js} +3 -3
- package/dist/assets/emotion-cache.browser.esm-BwirBJuO.js +1 -0
- package/dist/assets/es-DXzTkv77.js +1 -0
- package/dist/assets/{exchange-passport-B-EhCwOs.js → exchange-passport-CGMrX_va.js} +1 -1
- package/dist/assets/{fallback-C6VgQPYP.js → fallback-DHTsTOsA.js} +1 -1
- package/dist/assets/{form-text-input-DZNGnBl-.js → form-text-input-DAeQJFrx.js} +2 -2
- package/dist/assets/{format-error-CsY5MTO-.js → format-error-DsLT-I_t.js} +1 -1
- package/dist/assets/fr-DB4Moo35.js +1 -0
- package/dist/assets/fuel-CiyBCkPM.js +32 -0
- package/dist/assets/{fullpage-D7RBGcpO.js → fullpage-CTN6Odrg.js} +1 -1
- package/dist/assets/hi-BZ8MRRQ-.js +1 -0
- package/dist/assets/{home-BDB4_nh_.js → home-Bd2Tx88Q.js} +1 -1
- package/dist/assets/id-D0Dktlf7.js +1 -0
- package/dist/assets/{iframe-CdHTiw1F.js → iframe-DJ2x9efl.js} +1 -1
- package/dist/assets/index-A6rXBmgc.js +102 -0
- package/dist/assets/{index-Dob_tNHw.js → index-B5-lwWQw.js} +1 -1
- package/dist/assets/{index-Dt7ERxZ3.js → index-BFcr9JDQ.js} +12 -12
- package/dist/assets/{index-D0t4oon5.js → index-BN0lgmDH.js} +1 -1
- package/dist/assets/{index-B9ApMsSr.js → index-BT7-315i.js} +1 -1
- package/dist/assets/{index-BAMc05XV.js → index-Be6nHNV0.js} +1 -1
- package/dist/assets/{index-Dl244yi8.js → index-BeFN5xGu.js} +4 -4
- package/dist/assets/{index-C-5E9QTe.js → index-BedxN_P9.js} +1 -1
- package/dist/assets/{index-B5XDziuX.js → index-BtSt5FGJ.js} +1 -1
- package/dist/assets/{index-C0UyxGZY.js → index-ByEY1S1p.js} +1 -1
- package/dist/assets/index-C6BTUKQj.js +316 -0
- package/dist/assets/{index-C5-NGiut.js → index-C8Cmkjd6.js} +1 -1
- package/dist/assets/{index-B3M4QG77.js → index-C9IrBso_.js} +1 -1
- package/dist/assets/{index-CBRA0x7Q.js → index-C9XX9FI-.js} +1 -1
- package/dist/assets/{index-wl3skyrX.js → index-CAz4oQnr.js} +1 -1
- package/dist/assets/{index-BbNdCg0Y.js → index-CDzU6wY1.js} +2 -2
- package/dist/assets/index-CE5DZOEQ.js +1 -0
- package/dist/assets/{index-x8tkXY5V.js → index-CPibawHo.js} +1 -1
- package/dist/assets/{index-DzNuKWIR.js → index-C_rc1Lwt.js} +1 -1
- package/dist/assets/{index-D_HGuArr.js → index-CdNrrBZk.js} +1 -1
- package/dist/assets/{index-fvB3wuMp.js → index-CqjSnEu1.js} +2 -2
- package/dist/assets/{index-B9T9perk.js → index-D9Cgh-AY.js} +9 -9
- package/dist/assets/{index-64M3FvoQ.js → index-DTzuTDWf.js} +5 -5
- package/dist/assets/{index-knWkj8AE.js → index-DXZuEbMH.js} +1 -1
- package/dist/assets/{index-3zMmyPq0.js → index-DXpM5evR.js} +4 -4
- package/dist/assets/index-Dazz_Sar.js +4 -0
- package/dist/assets/{index-8Uzxcrqs.js → index-DbN4h3gH.js} +1 -1
- package/dist/assets/{index-CcastwQZ.js → index-NlzmSJHU.js} +2 -2
- package/dist/assets/{index-M6u08XZP.js → index-OU0ZpNT_.js} +1 -1
- package/dist/assets/{index-QfRVoAyB.js → index-U-Ouf6WM.js} +1 -1
- package/dist/assets/{index-BQKTX3TH.js → index-XYcwhl4a.js} +8 -8
- package/dist/assets/{index-CYEg2-8x.js → index-bNbDSQ4T.js} +1 -1
- package/dist/assets/{index-CdgjvQxC.js → index-jHlcxkEo.js} +8 -8
- package/dist/assets/{index-Cv7pzw89.js → index-wBcLyYqT.js} +26 -26
- package/dist/assets/{invitation-B-19u0zg.js → invitation-JKzrZ57O.js} +5 -5
- package/dist/assets/invite-BFrJHYMn.js +5 -0
- package/dist/assets/{isEmail-LKjM3fdO.js → isEmail-BEisyjCN.js} +1 -1
- package/dist/assets/issue-passport-BAtnRtOM.js +1 -0
- package/dist/assets/{item-BY7CX9DM.js → item-CwYliHGb.js} +1 -1
- package/dist/assets/ja-DI5zkdyH.js +1 -0
- package/dist/assets/{jss-plugin-props-sort.esm-DZ0QxdlL.js → jss-plugin-props-sort.esm-l47fXiIJ.js} +3 -3
- package/dist/assets/ko-C6JgKTYW.js +1 -0
- package/dist/assets/{launch-result-message-CAyNosT8.js → launch-result-message-Bl-IHSrE.js} +1 -1
- package/dist/assets/{layout-Cc6IR4Xp.js → layout-luBpKsnB.js} +1 -1
- package/dist/assets/{list-header-CTKuPXBC.js → list-header-D0D_tjRh.js} +1 -1
- package/dist/assets/localization-C1hNyLvD.js +1 -0
- package/dist/assets/{log-DkVkil0j.js → log-Df2I_fqe.js} +1 -1
- package/dist/assets/{login-B9mkuN1r.js → login-DyZA9iO2.js} +1 -1
- package/dist/assets/{login-oauth-callback-B8IM5sRf.js → login-oauth-callback-C9pBHvVm.js} +1 -1
- package/dist/assets/logo-uploader-BoJpubye.js +133 -0
- package/dist/assets/{lost-passport-okkyxvyK.js → lost-passport-UDuDlY7N.js} +4 -4
- package/dist/assets/{lottie-react.esm-amlTBYrq.js → lottie-react.esm-BcAg_zzZ.js} +1 -1
- package/dist/assets/{notifications-x-_0y6ay.js → notifications-Dwy1x_4b.js} +2 -2
- package/dist/assets/{open-window-Dsehi6Pa.js → open-window-T5jgTpk6.js} +1 -1
- package/dist/assets/overview-DxoUd1AE.js +12 -0
- package/dist/assets/{permission-Bw97vdZf.js → permission-B0L9pgvB.js} +1 -1
- package/dist/assets/{preferences-BQUunT_2.js → preferences-BMHmIBuj.js} +1 -1
- package/dist/assets/pt-F1XUE4F0.js +1 -0
- package/dist/assets/publish-resource-BcJxqHgb.js +1 -0
- package/dist/assets/purify.es-CCJo14B2.js +2 -0
- package/dist/assets/{raf-schd.esm-CR0Pt1CF.js → raf-schd.esm-DbYZ8cuK.js} +1 -1
- package/dist/assets/{react-beautiful-dnd.esm-Cp27_Z2H.js → react-beautiful-dnd.esm-B8s8Je1D.js} +1 -1
- package/dist/assets/refType-CwbBamWm.js +1 -0
- package/dist/assets/{resource-dialog-CQ8ePIzz.js → resource-dialog-CQSjUEGn.js} +1 -1
- package/dist/assets/ru-DMrR-cU9.js +1 -0
- package/dist/assets/sdk-Lodb3mfy.js +1 -0
- package/dist/assets/selector-BB2fFIXP.js +48 -0
- package/dist/assets/session-D3zyh62B.js +1 -0
- package/dist/assets/setup-B6L46KHj.js +562 -0
- package/dist/assets/{shorten-label-BYD4zgYF.js → shorten-label-ZyDji4qi.js} +1 -1
- package/dist/assets/{simple-select-BSiU44cf.js → simple-select-DKsN30ub.js} +1 -1
- package/dist/assets/{slicedToArray-B3EJlOBV.js → slicedToArray-Drxe8-64.js} +2 -2
- package/dist/assets/{start-B6pKpEk6.js → start-DxaM-09J.js} +1 -1
- package/dist/assets/step-actions-DQ0D400i.js +61 -0
- package/dist/assets/{studio-RgHJ4uhM.js → studio-THNjOZL1.js} +1 -1
- package/dist/assets/{switch-control-OVb1BwTo.js → switch-control-DkucmIR-.js} +1 -1
- package/dist/assets/th-CJB7WnNL.js +1 -0
- package/dist/assets/{toUpper-DZIzLyKU.js → toUpper-BHGjhPud.js} +1 -1
- package/dist/assets/{transfer-D-jivKPt.js → transfer-DaOZAizQ.js} +1 -1
- package/dist/assets/{trim-BV_NDhVJ.js → trim-CaA4via3.js} +1 -1
- package/dist/assets/{uniqBy-BnPjLUjC.js → uniqBy-CH7S750Q.js} +1 -1
- package/dist/assets/unsubscribe-DtBxc6TZ.js +1 -0
- package/dist/assets/{url-join-DEFKjkns.js → url-join-sg6DH6qt.js} +1 -1
- package/dist/assets/use-mobile-CM0Yohdc.js +1 -0
- package/dist/assets/use-mobile-Cz-VrkwE.js +1 -0
- package/dist/assets/{useAsync-uZ9Wuln3.js → useAsync-NthGdZ_B.js} +1 -1
- package/dist/assets/{useFormControl-CKpzs7q1.js → useFormControl-CS6vjtl0.js} +1 -1
- package/dist/assets/{useLocalStorage-BhUUdeSi.js → useLocalStorage-Kt0ynk4Q.js} +1 -1
- package/dist/assets/{useSetState-GTMZIRrt.js → useSetState-DUhj3dVg.js} +1 -1
- package/dist/assets/useSlot-D-6cy3hj.js +1 -0
- package/dist/assets/{useSlotProps-CHK9ut6X.js → useSlotProps-CEuB5YLI.js} +1 -1
- package/dist/assets/{useThemeProps-D3g52yHb.js → useThemeProps-CmIdHfIC.js} +1 -1
- package/dist/assets/user-center-BO_McZ0Z.js +1 -0
- package/dist/assets/{user-sessions-B7LrJMkc.js → user-sessions-BXhrzhKK.js} +1 -1
- package/dist/assets/{util-Bami76iP.js → util-CRg7-9Pj.js} +1 -1
- package/dist/assets/vi-U1GPEq8E.js +1 -0
- package/dist/assets/wrap-locale-Dj-ckYCY.js +1 -0
- package/dist/assets/{zh-B7Ba_Kee.js → zh-B1PHGWyj.js} +1 -1
- package/dist/assets/zh-tw-B9CGi8IO.js +1 -0
- package/dist/index.html +1 -1
- package/dist/service-worker.js +1 -1
- package/package.json +25 -25
- package/dist/assets/Delete-s2NC3KEw.js +0 -1
- package/dist/assets/DialogContentText-C-7SR9C-.js +0 -1
- package/dist/assets/FormControl-D38v2z67.js +0 -1
- package/dist/assets/FormGroup-Dtv1bjEg.js +0 -1
- package/dist/assets/Link-BdhOk-uG.js +0 -1
- package/dist/assets/Stack-D1S3xkvy.js +0 -1
- package/dist/assets/access-control-f0MW9Zgj.js +0 -13
- package/dist/assets/add-resource-BGwTxNy-.js +0 -1
- package/dist/assets/api-BGevyJlL.js +0 -1
- package/dist/assets/ar-IGiynOFu.js +0 -1
- package/dist/assets/bundle-avatar-meR-iuh8.js +0 -1
- package/dist/assets/dashboard-wctDSPQY.js +0 -165
- package/dist/assets/de-C5dj0Xqf.js +0 -1
- package/dist/assets/domain-CHeNVNMy.js +0 -9
- package/dist/assets/emotion-cache.browser.esm-C8uPGoLI.js +0 -1
- package/dist/assets/es-CtZrebqK.js +0 -1
- package/dist/assets/fr-AxDVLuWz.js +0 -1
- package/dist/assets/fuel-BE4OI5l7.js +0 -32
- package/dist/assets/hi-RUZ0vBCk.js +0 -1
- package/dist/assets/id-DsdmMEGZ.js +0 -1
- package/dist/assets/index-BWSzmUO8.js +0 -102
- package/dist/assets/index-CdP156si.js +0 -544
- package/dist/assets/index-DeKdvlFq.js +0 -4
- package/dist/assets/index-deUlJetP.js +0 -316
- package/dist/assets/invite-DPOy64nF.js +0 -5
- package/dist/assets/issue-passport-QnXwWENR.js +0 -1
- package/dist/assets/ja-DTDtkp5G.js +0 -1
- package/dist/assets/ko-DgLbeBNo.js +0 -1
- package/dist/assets/localization-D7g53qeR.js +0 -1
- package/dist/assets/logo-uploader-B7IPezmK.js +0 -133
- package/dist/assets/overview-pKFxQLkN.js +0 -12
- package/dist/assets/page-header-CYu3_H82.js +0 -31
- package/dist/assets/pt-CZCvruh-.js +0 -1
- package/dist/assets/publish-resource-kR9OHRdE.js +0 -1
- package/dist/assets/purify.es-Bq0E5Q3l.js +0 -2
- package/dist/assets/refType-BCOesXZo.js +0 -1
- package/dist/assets/ru-D_KkTcPZ.js +0 -1
- package/dist/assets/sdk-Dtv_Cfx3.js +0 -1
- package/dist/assets/selector-BR2XoI6A.js +0 -48
- package/dist/assets/session-BhpnDl9E.js +0 -1
- package/dist/assets/setup-BntqqJam.js +0 -19
- package/dist/assets/step-actions-BGpXjOsH.js +0 -31
- package/dist/assets/th-2G8RPPGN.js +0 -1
- package/dist/assets/unsubscribe--o-tBu4k.js +0 -1
- package/dist/assets/use-mobile-iElkM1XK.js +0 -1
- package/dist/assets/use-mobile-ys1gCl_z.js +0 -1
- package/dist/assets/useSlot-h7rz3Ehc.js +0 -1
- package/dist/assets/user-center-COK230kp.js +0 -1
- package/dist/assets/vi-Bj0Zh1pF.js +0 -1
- package/dist/assets/wrap-locale-sAzfVK-h.js +0 -1
- package/dist/assets/zh-tw-ChudOecJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aN as Re,aM as Ae,aO as Ee,ak as He,aP as D,aS as F,r as p,aQ as Ve,aR as De,j as t,aU as _,aV as We,X as Te,db as Oe,dc as Se,_ as Ue,cc as qe,aB as Q,Z as ie,$ as le,bA as f,ae as Ge,ar as X,aJ as Y,L as W,T as P,b as Qe,aK as de,B as w,bC as Xe,I as E,dd as ce,H as ue,de as pe,a1 as Ye,Q as he,k as q,df as Je,l as H,dg as Ke,dh as Ze}from"./index-jHlcxkEo.js";import{d as xe}from"./Menu-BW47wukv.js";import{T as et}from"./Toolbar-Kng3WhVc.js";import{H as me}from"./Hidden-CXUMFZRF.js";const G={50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5"};function tt(e){return Re("MuiAppBar",e)}Ae("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const nt=["className","color","enableColorOnDark","position"],at=e=>{const{color:n,position:a,classes:r}=e,i={root:["root",`color${D(n)}`,`position${D(a)}`]};return We(i,tt,r)},V=(e,n)=>e?`${e==null?void 0:e.replace(")","")}, ${n})`:n,ot=Ee(He,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:a}=e;return[n.root,n[`position${D(a.position)}`],n[`color${D(a.color)}`]]}})(({theme:e,ownerState:n})=>{const a=e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[900];return F({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0},n.position==="fixed"&&{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}},n.position==="absolute"&&{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},n.position==="sticky"&&{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0},n.position==="static"&&{position:"static"},n.position==="relative"&&{position:"relative"},!e.vars&&F({},n.color==="default"&&{backgroundColor:a,color:e.palette.getContrastText(a)},n.color&&n.color!=="default"&&n.color!=="inherit"&&n.color!=="transparent"&&{backgroundColor:e.palette[n.color].main,color:e.palette[n.color].contrastText},n.color==="inherit"&&{color:"inherit"},e.palette.mode==="dark"&&!n.enableColorOnDark&&{backgroundColor:null,color:null},n.color==="transparent"&&F({backgroundColor:"transparent",color:"inherit"},e.palette.mode==="dark"&&{backgroundImage:"none"})),e.vars&&F({},n.color==="default"&&{"--AppBar-background":n.enableColorOnDark?e.vars.palette.AppBar.defaultBg:V(e.vars.palette.AppBar.darkBg,e.vars.palette.AppBar.defaultBg),"--AppBar-color":n.enableColorOnDark?e.vars.palette.text.primary:V(e.vars.palette.AppBar.darkColor,e.vars.palette.text.primary)},n.color&&!n.color.match(/^(default|inherit|transparent)$/)&&{"--AppBar-background":n.enableColorOnDark?e.vars.palette[n.color].main:V(e.vars.palette.AppBar.darkBg,e.vars.palette[n.color].main),"--AppBar-color":n.enableColorOnDark?e.vars.palette[n.color].contrastText:V(e.vars.palette.AppBar.darkColor,e.vars.palette[n.color].contrastText)},!["inherit","transparent"].includes(n.color)&&{backgroundColor:"var(--AppBar-background)"},{color:n.color==="inherit"?"inherit":"var(--AppBar-color)"},n.color==="transparent"&&{backgroundImage:"none",backgroundColor:"transparent",color:"inherit"}))}),rt=p.forwardRef(function(n,a){const r=Ve({props:n,name:"MuiAppBar"}),{className:i,color:d="primary",enableColorOnDark:c=!1,position:s="fixed"}=r,u=De(r,nt),o=F({},r,{color:d,position:s,enableColorOnDark:c}),l=at(o);return t.jsx(ot,F({square:!0,component:"header",ownerState:o,elevation:4,className:_(l.root,i,s==="fixed"&&"mui-fixed"),ref:a},u))});function st(e,n){var a,r=Te(e),i=(a=n==null?void 0:n.wait)!==null&&a!==void 0?a:1e3,d=p.useMemo(function(){return Oe(function(){for(var c=[],s=0;s<arguments.length;s++)c[s]=arguments[s];return r.current.apply(r,Se([],Ue(c),!1))},i,n)},[]);return qe(function(){d.cancel()}),{run:d,cancel:d.cancel,flush:d.flush}}const it=Q(t.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),lt=Q(t.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu"),dt=Q(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreHoriz"),fe=p.createContext(null),ct=e=>{const n=p.useContext(fe);return p.useLayoutEffect(()=>{},[]),n};function ut({children:e,...n}){const[a,r]=p.useState({inFullPage:!1,showToggleButton:!1,headerVisibleInFullPage:!0,footerVisibleInFullPage:!1,sidebarVisibleInFullPage:!1}),i=()=>{r(c=>({...c,inFullPage:!c.inFullPage}))},d=p.useMemo(()=>({...a,headerVisible:!a.inFullPage||a.headerVisibleInFullPage,footerVisible:!a.inFullPage||a.footerVisibleInFullPage,sidebarVisible:!a.inFullPage||a.sidebarVisibleInFullPage,toggleFullPage:i,configure:c=>r(s=>({...s,...c}))}),[a]);return t.jsx(fe.Provider,{value:d,...n,children:e})}var J={},pt=le;Object.defineProperty(J,"__esModule",{value:!0});var ge=J.default=void 0,ht=pt(ie()),xt=t;ge=J.default=(0,ht.default)((0,xt.jsx)("path",{d:"M21 11V3h-8l3.29 3.29-10 10L3 13v8h8l-3.29-3.29 10-10z"}),"OpenInFull");var K={},mt=le;Object.defineProperty(K,"__esModule",{value:!0});var be=K.default=void 0,ft=mt(ie()),gt=t;be=K.default=(0,ft.default)((0,gt.jsx)("path",{d:"M22 3.41 16.71 8.7 20 12h-8V4l3.29 3.29L20.59 2zM3.41 22l5.29-5.29L12 20v-8H4l3.29 3.29L2 20.59z"}),"CloseFullscreen");function bt({name:e,size:n=36,alt:a="",color:r="#000000",prefix:i="/images",showBadge:d=!1,style:c={},...s}){const u=`${i}/${e}-${r.replace(/^#/,"")}.png`;return t.jsxs(vt,{style:{width:n,height:n},children:[t.jsx(Ge,{width:n,height:n,alt:a||e,src:u,style:Object.assign({width:n},c),...s}),d&&t.jsx("i",{className:"badge-point"})]})}const vt=f("div")`
|
|
2
2
|
position: relative;
|
|
3
3
|
.badge-point {
|
|
4
4
|
position: absolute;
|
|
@@ -22,7 +22,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
22
22
|
${e=>e.layout==="vertical"?"margin-top: 8px;":""}
|
|
23
23
|
${e=>e.layout==="vertical"?"":"margin-left: 8px;"};
|
|
24
24
|
}
|
|
25
|
-
`;function jt({images:e,links:n,prefix:a="/images",addons:r,logo:i,...d}){const c=
|
|
25
|
+
`;function jt({images:e,links:n,prefix:a="/images",addons:r,logo:i,...d}){const c=X(),s=Y(),u=(o,l)=>new RegExp(`/${l}`).test(s.pathname);return t.jsxs(wt,{...d,children:[t.jsx(W,{to:"/",className:"sidebar-logo",children:i||t.jsx(Z,{showText:!1,size:20})}),n.map(({url:o,name:l,title:x,showBadge:b})=>{const j=u(o,l);return t.jsxs(kt,{component:W,selected:j,to:o,children:[t.jsx(bt,{name:e[l],size:36,color:j?"#00c2c4":c.typography.color.main,prefix:a,showBadge:b}),t.jsx(P,{component:"span",className:"menu-title",children:x})]},o)}),t.jsx("div",{style:{flex:1}}),r]})}const wt=p.memo(f("div")`
|
|
26
26
|
flex: 1;
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
@@ -43,7 +43,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
43
43
|
display: block;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
`),re="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",kt=f(
|
|
46
|
+
`),re="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",kt=f(Qe)`
|
|
47
47
|
&& {
|
|
48
48
|
display: flex;
|
|
49
49
|
flex-direction: column;
|
|
@@ -142,7 +142,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
142
142
|
display: block;
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
`;function zt({onToggleMenu:e,brand:n,description:a,addons:r,brandAddon:i,homeUrl:d="/",logo:c,children:s,...u}){return t.jsx($t,{position:"sticky",className:"header",...u,children:t.jsxs(et,{disableGutters:!1,className:"header-toolbar",children:[t.jsx(de,{color:"inherit","aria-label":"open drawer",edge:"start",className:"header-menu","aira-label":"header menu button",onClick:e,children:t.jsx(xe,{})}),t.jsxs(W,{to:d,className:"header-link",children:[t.jsx(me,{mdDown:!0,children:t.jsx("div",{className:"header-logo",children:c||t.jsx(Z,{showText:!1})})}),t.jsxs("div",{className:"header-title",children:[t.jsxs(P,{component:"h2",noWrap:!0,className:"header-title__primary",children:[n,i]}),t.jsx(P,{component:"p",noWrap:!0,className:"header-title__secondary",children:a})]})]}),t.jsx(w,{flexGrow:1}),!!s&&t.jsx("div",{className:"header-children",children:s}),t.jsx("div",{className:"header-addons",children:r})]})})}function O(e){var x;const n=
|
|
145
|
+
`;function zt({onToggleMenu:e,brand:n,description:a,addons:r,brandAddon:i,homeUrl:d="/",logo:c,children:s,...u}){return t.jsx($t,{position:"sticky",className:"header",...u,children:t.jsxs(et,{disableGutters:!1,className:"header-toolbar",children:[t.jsx(de,{color:"inherit","aria-label":"open drawer",edge:"start",className:"header-menu","aira-label":"header menu button",onClick:e,children:t.jsx(xe,{})}),t.jsxs(W,{to:d,className:"header-link",children:[t.jsx(me,{mdDown:!0,children:t.jsx("div",{className:"header-logo",children:c||t.jsx(Z,{showText:!1})})}),t.jsxs("div",{className:"header-title",children:[t.jsxs(P,{component:"h2",noWrap:!0,className:"header-title__primary",children:[n,i]}),t.jsx(P,{component:"p",noWrap:!0,className:"header-title__secondary",children:a})]})]}),t.jsx(w,{flexGrow:1}),!!s&&t.jsx("div",{className:"header-children",children:s}),t.jsx("div",{className:"header-addons",children:r})]})})}function O(e){var x;const n=Xe(e,O,["dark","style"]),{className:a,copyStart:r,style:i,brand:d,dark:c,addon:s}=n,u=`${new Date().getFullYear()}`,o=`${r}`,l=u===o?u:`${o}-${u}`;return t.jsxs(Nt,{className:a,style:i,dark:c,children:[t.jsx(E,{maxWidth:!1,children:t.jsxs(P,{component:"div",className:"footer",children:[t.jsxs(P,{component:"p",className:"footer-item",children:[t.jsxs("span",{className:"footer-copy",children:["Copyright © ",l," "]}),t.jsx("span",{className:"footer-brand",children:d})]}),s&&t.jsx(P,{component:"div",className:"footer-item",sx:{order:{xs:"-1",md:"initial"},ml:{xs:0,md:"auto"},width:{xs:"100%",md:"auto"}},children:s}),t.jsxs(P,{component:"p",className:"footer-item",style:{justifyContent:"flex-end",flexShrink:0},children:["Powered by",t.jsx(Z,{mode:c?"light":"dark",layout:"horizontal",className:"logo-container"})]})]})}),t.jsx(w,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:(x=window==null?void 0:window.blocklet)==null?void 0:x.version})]})}O.defaultProps={dark:!1,className:"",copyStart:"2017",brand:"ArcBlock",style:{},addon:null};const Nt=f("div",{shouldForwardProp:e=>e!=="dark"})`
|
|
146
146
|
position: relative;
|
|
147
147
|
margin-top: 64px;
|
|
148
148
|
padding: 24px 0 32px;
|
|
@@ -339,7 +339,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
`;function _t({menu:e,prepend:n,children:a,...r}){const i=
|
|
342
|
+
`;function _t({menu:e,prepend:n,children:a,...r}){const i=X(),d=Ye(i.breakpoints.down("md")),[c,s]=p.useState(!1),u=typeof a=="function"?a({isMobile:d,closeMenu:()=>s(!1)}):a,o=he({changed:!1,value:"",priority:""});return q(()=>{var l;if((l=document.documentElement)!=null&&l.style){const x=()=>{o.changed&&(o.value?document.documentElement.style.setProperty("overflow",o.value,o.priority):document.documentElement.style.removeProperty("overflow"),o.value="",o.priority="",o.changed=!1)};return c?(o.changed=!0,o.value=document.documentElement.style.getPropertyValue("overflow"),o.priority=document.documentElement.style.getPropertyPriority("overflow"),document.documentElement.style.setProperty("overflow","revert","important")):x(),x}return()=>{}},[c]),a?t.jsxs(Bt,{prepend:n||t.jsx(de,{sx:{color:i.palette.grey[500]},edge:"start",className:"header-menu","aria-label":"header menu button",onClick:()=>s(!c),children:c?t.jsx(Je,{}):t.jsx(xe,{})}),...r,children:[!d&&u,d&&t.jsx(pe,{open:c,onClose:()=>s(!1),ModalProps:{disablePortal:!1,keepMounted:!0,BackdropComponent:void 0},anchor:"top",sx:{top:64,zIndex:i.zIndex.appBar-1},PaperProps:{style:{top:64,bottom:0,boxShadow:"none"}},children:t.jsx(Ft,{children:u})})]}):t.jsx(ke,{prepend:n,...r})}const Bt=f(ke)`
|
|
343
343
|
.header-menu {
|
|
344
344
|
display: none;
|
|
345
345
|
}
|
|
@@ -536,7 +536,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
536
536
|
.navmenu-sub--opened > .navmenu-sub-container {
|
|
537
537
|
display: block;
|
|
538
538
|
}
|
|
539
|
-
`,ee=p.createContext(null);function ze(e){return e?p.Children.toArray(e).filter(n=>p.isValidElement(n)?n.type===ne||n.type===T:!1):null}function Ne(e){return p.useRef(e||`navmenu-item-id-${Math.random().toString(36).slice(2)}`).current}function te({items:e=[],mode:n="horizontal",children:a=null,activeId:r=null,textColor:i="#9397a1",activeTextColor:d="#25292f",bgColor:c="#fff",onSelected:s,...u}){var ae;const o=ze(a);if(!(e!=null&&e.length)&&!(o!=null&&o.length))throw new Error("One of 'items' or 'children' is required by NavMenu component.");const l=he({activeId:r,openedIds:[],hiddenItemCount:0}),x=H(h=>{l.activeId=h,s==null||s(h)}),b=H(h=>{l.openedIds.push(h)}),j=H(h=>{l.openedIds=l.openedIds.filter(y=>y!==h)}),z=q(()=>({...l,mode:n,activate:x,open:b,close:j}),[l.activeId,l.hiddenItemCount,l.openedIds,n,x,b,j]),N=p.useRef(null),m=p.useRef([]),v=p.useRef(null),M=l.hiddenItemCount===((ae=m.current)==null?void 0:ae.length),I=M?{marginLeft:"0px"}:void 0,B=q(()=>M?t.jsx(lt,{}):t.jsx(dt,{}),[M]),R=h=>p.Children.map(h,(y,L)=>p.cloneElement(y,{ref:C=>{m.current[L]=C}})),$=ce(N.current),{run:g}=st(H(()=>{let h=0,y=0,L=!1;const C=($==null?void 0:$.width)||0,U=v.current?v.current.offsetWidth+parseFloat(window.getComputedStyle(v.current).marginLeft):0;m.current.forEach((A,Be)=>{if(A){A.style.display="flex";const Fe=Be>0?parseFloat(window.getComputedStyle(A).marginLeft):0,oe=A.offsetWidth+Fe;C-U>=h+oe&&!L?h+=oe:(A.style.display="none",L=!0,y++)}}),y!==l.hiddenItemCount&&(l.hiddenItemCount=y)}),{wait:100});p.useLayoutEffect(()=>{n==="horizontal"&&g()},[$==null?void 0:$.width,n]),p.useEffect(()=>{if(n==="horizontal")return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[n,e]),p.useEffect(()=>{r!=null&&(l.activeId=r)},[r]);const k=_("navmenu",`navmenu--${n}`,u.className),S=(h,y,L=!1)=>h!=null&&h.children?t.jsx(T,{id:h.id,icon:h.icon,label:h.label,ref:L?C=>{m.current[y]=C}:void 0,children:h.children.map((C,U)=>S(C,U,!1))},h.id):t.jsx(ne,{id:h.id,icon:h.icon,label:h.label,active:h.active,ref:L?C=>{m.current[y]=C}:void 0},h.id),Le=e?e==null?void 0:e.slice(-l.hiddenItemCount).map((h,y)=>S(h,y)):o==null?void 0:o.slice(-l.hiddenItemCount),_e=n==="inline"?At:Rt;return t.jsx(ee.Provider,{value:z,children:t.jsx(_e,{...u,className:k,$textColor:i,$activeTextColor:d,$bgColor:c,children:t.jsxs("ul",{className:"navmenu-root",ref:N,children:[e?e.map((h,y)=>S(h,y,!0)):R(o||[]),l.hiddenItemCount>0&&t.jsx(T,{expandIcon:!1,icon:B,label:"",ref:v,style:I,children:Le})]})})})}const ne=p.forwardRef(({id:e="",icon:n=null,label:a="",active:r=!1,onClick:i=null,...d},c)=>{const s=Ne(e),{activeId:u,activate:o}=p.useContext(ee)||{},l=_("navmenu-item",{"navmenu-item--active":u===s},d.className);p.useEffect(()=>{r&&(o==null||o(s))},[r]);const x=()=>{i==null||i(),o==null||o(s)};return t.jsxs("li",{...d,className:l,onClick:x,ref:c,children:[n&&t.jsx("span",{className:"navmenu-item-icon",children:n}),t.jsx("span",{className:"navmenu-item-label",children:a})]})}),T=p.forwardRef(({id:e="",icon:n=null,label:a=null,children:r,expandIcon:i=({isOpen:s})=>t.jsx(it,{style:{transform:`rotate(${s?180:0}deg)`}}),...d},c)=>{const s=Ne(e),{openedIds:u,open:o,close:l,mode:x}=p.useContext(ee)||{},b=(u==null?void 0:u.includes(s))??!1,j=_("navmenu-sub",{"navmenu-sub--opened":b},d.className),z=x==="inline",N=z?{onClick:()=>{u!=null&&u.includes(s)?l==null||l(s):o==null||o(s)}}:{onMouseEnter:()=>o==null?void 0:o(s),onMouseLeave:()=>l==null?void 0:l(s)},m=z?{onClick:v=>v.stopPropagation()}:{};return t.jsxs("li",{...d,className:j,...N,ref:c,children:[n&&t.jsx("span",{className:"navmenu-sub-icon",children:n}),t.jsx("span",{className:"navmenu-sub-label",children:a}),i&&t.jsx("span",{className:"navmenu-sub-expand-icon",children:typeof i=="function"?i({isOpen:b}):i}),t.jsx("div",{className:"navmenu-sub-container",...m,children:t.jsx("ul",{className:"navmenu-sub-list",children:ze(r)})})]})});te.Item=ne;te.Sub=T;function Ce({routerLinkComponent:e,to:n,external:a=!1,children:r,...i}){return a?t.jsx("a",{href:n,...i,children:r}):t.jsx(e,{to:n,...i,children:r})}function Me(e){return t.jsx(Ce,{routerLinkComponent:W,...e})}function Et({className:e="",...n}){const a=typeof e=="function"?e():e;return t.jsx(Ce,{routerLinkComponent:Ke,className:a,...n})}function Ie(e,n){var u;if((u=e.children)!=null&&u.length)return Ht(e,n);const{url:a,icon:r,title:i,showBadge:d,external:c,active:s}=e;return t.jsx("li",{className:"layout-sidebar-item",children:t.jsxs(Et,{external:c,to:a,className:()=>_("layout-sidebar-link",{"layout-sidebar-link--active":c?s:!1}),children:[r&&t.jsx("span",{className:`layout-sidebar-icon ${d?"layout-sidebar-badge":""}`,children:r}),t.jsx(P,{component:"span",className:"layout-sidebar-link-text",children:i})]})},`${a}-${n}`)}function Ht(e,n){return t.jsxs("li",{className:"layout-sidebar-group",children:[t.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),t.jsx("ul",{children:e.children.map(Ie)})]},`group-${e.title}-${n}`)}function se({links:e,addons:n,dense:a=!1,...r}){return t.jsxs(
|
|
539
|
+
`,ee=p.createContext(null);function ze(e){return e?p.Children.toArray(e).filter(n=>p.isValidElement(n)?n.type===ne||n.type===T:!1):null}function Ne(e){return p.useRef(e||`navmenu-item-id-${Math.random().toString(36).slice(2)}`).current}function te({items:e=[],mode:n="horizontal",children:a=null,activeId:r=null,textColor:i="#9397a1",activeTextColor:d="#25292f",bgColor:c="#fff",onSelected:s,...u}){var ae;const o=ze(a);if(!(e!=null&&e.length)&&!(o!=null&&o.length))throw new Error("One of 'items' or 'children' is required by NavMenu component.");const l=he({activeId:r,openedIds:[],hiddenItemCount:0}),x=H(h=>{l.activeId=h,s==null||s(h)}),b=H(h=>{l.openedIds.push(h)}),j=H(h=>{l.openedIds=l.openedIds.filter(y=>y!==h)}),z=q(()=>({...l,mode:n,activate:x,open:b,close:j}),[l.activeId,l.hiddenItemCount,l.openedIds,n,x,b,j]),N=p.useRef(null),m=p.useRef([]),v=p.useRef(null),M=l.hiddenItemCount===((ae=m.current)==null?void 0:ae.length),I=M?{marginLeft:"0px"}:void 0,B=q(()=>M?t.jsx(lt,{}):t.jsx(dt,{}),[M]),R=h=>p.Children.map(h,(y,L)=>p.cloneElement(y,{ref:C=>{m.current[L]=C}})),$=ce(N.current),{run:g}=st(H(()=>{let h=0,y=0,L=!1;const C=($==null?void 0:$.width)||0,U=v.current?v.current.offsetWidth+parseFloat(window.getComputedStyle(v.current).marginLeft):0;m.current.forEach((A,Be)=>{if(A){A.style.display="flex";const Fe=Be>0?parseFloat(window.getComputedStyle(A).marginLeft):0,oe=A.offsetWidth+Fe;C-U>=h+oe&&!L?h+=oe:(A.style.display="none",L=!0,y++)}}),y!==l.hiddenItemCount&&(l.hiddenItemCount=y)}),{wait:100});p.useLayoutEffect(()=>{n==="horizontal"&&g()},[$==null?void 0:$.width,n]),p.useEffect(()=>{if(n==="horizontal")return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[n,e]),p.useEffect(()=>{r!=null&&(l.activeId=r)},[r]);const k=_("navmenu",`navmenu--${n}`,u.className),S=(h,y,L=!1)=>h!=null&&h.children?t.jsx(T,{id:h.id,icon:h.icon,label:h.label,ref:L?C=>{m.current[y]=C}:void 0,children:h.children.map((C,U)=>S(C,U,!1))},h.id):t.jsx(ne,{id:h.id,icon:h.icon,label:h.label,active:h.active,ref:L?C=>{m.current[y]=C}:void 0},h.id),Le=e?e==null?void 0:e.slice(-l.hiddenItemCount).map((h,y)=>S(h,y)):o==null?void 0:o.slice(-l.hiddenItemCount),_e=n==="inline"?At:Rt;return t.jsx(ee.Provider,{value:z,children:t.jsx(_e,{...u,className:k,$textColor:i,$activeTextColor:d,$bgColor:c,children:t.jsxs("ul",{className:"navmenu-root",ref:N,children:[e?e.map((h,y)=>S(h,y,!0)):R(o||[]),l.hiddenItemCount>0&&t.jsx(T,{expandIcon:!1,icon:B,label:"",ref:v,style:I,children:Le})]})})})}const ne=p.forwardRef(({id:e="",icon:n=null,label:a="",active:r=!1,onClick:i=null,...d},c)=>{const s=Ne(e),{activeId:u,activate:o}=p.useContext(ee)||{},l=_("navmenu-item",{"navmenu-item--active":u===s},d.className);p.useEffect(()=>{r&&(o==null||o(s))},[r]);const x=()=>{i==null||i(),o==null||o(s)};return t.jsxs("li",{...d,className:l,onClick:x,ref:c,children:[n&&t.jsx("span",{className:"navmenu-item-icon",children:n}),t.jsx("span",{className:"navmenu-item-label",children:a})]})}),T=p.forwardRef(({id:e="",icon:n=null,label:a=null,children:r,expandIcon:i=({isOpen:s})=>t.jsx(it,{style:{transform:`rotate(${s?180:0}deg)`}}),...d},c)=>{const s=Ne(e),{openedIds:u,open:o,close:l,mode:x}=p.useContext(ee)||{},b=(u==null?void 0:u.includes(s))??!1,j=_("navmenu-sub",{"navmenu-sub--opened":b},d.className),z=x==="inline",N=z?{onClick:()=>{u!=null&&u.includes(s)?l==null||l(s):o==null||o(s)}}:{onMouseEnter:()=>o==null?void 0:o(s),onMouseLeave:()=>l==null?void 0:l(s)},m=z?{onClick:v=>v.stopPropagation()}:{};return t.jsxs("li",{...d,className:j,...N,ref:c,children:[n&&t.jsx("span",{className:"navmenu-sub-icon",children:n}),t.jsx("span",{className:"navmenu-sub-label",children:a}),i&&t.jsx("span",{className:"navmenu-sub-expand-icon",children:typeof i=="function"?i({isOpen:b}):i}),t.jsx("div",{className:"navmenu-sub-container",...m,children:t.jsx("ul",{className:"navmenu-sub-list",children:ze(r)})})]})});te.Item=ne;te.Sub=T;function Ce({routerLinkComponent:e,to:n,external:a=!1,children:r,...i}){return a?t.jsx("a",{href:n,...i,children:r}):t.jsx(e,{to:n,...i,children:r})}function Me(e){return t.jsx(Ce,{routerLinkComponent:W,...e})}function Et({className:e="",...n}){const a=typeof e=="function"?e():e;return t.jsx(Ce,{routerLinkComponent:Ke,className:a,...n})}function Ie(e,n){var u;if((u=e.children)!=null&&u.length)return Ht(e,n);const{url:a,icon:r,title:i,showBadge:d,external:c,active:s}=e;return t.jsx("li",{className:"layout-sidebar-item",children:t.jsxs(Et,{external:c,to:a,className:()=>_("layout-sidebar-link",{"layout-sidebar-link--active":c?s:!1}),children:[r&&t.jsx("span",{className:`layout-sidebar-icon ${d?"layout-sidebar-badge":""}`,children:r}),t.jsx(P,{component:"span",className:"layout-sidebar-link-text",children:i})]})},`${a}-${n}`)}function Ht(e,n){return t.jsxs("li",{className:"layout-sidebar-group",children:[t.jsx("span",{className:"layout-sidebar-group-title",children:e.title}),t.jsx("ul",{children:e.children.map(Ie)})]},`group-${e.title}-${n}`)}function se({links:e,addons:n,dense:a=!1,...r}){return t.jsxs(Dt,{...r,className:_({"layout-sidebar-dense":a}),children:[t.jsx("ul",{children:e.map(Ie)}),t.jsx("div",{style:{flex:1}}),n]})}const Vt="linear-gradient(32deg, rgba(144, 255, 230, 0.1), rgba(144, 255, 230, 0))",Dt=f("div")`
|
|
540
540
|
display: flex;
|
|
541
541
|
flex-direction: column;
|
|
542
542
|
ul {
|
|
@@ -555,7 +555,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
555
555
|
&:hover,
|
|
556
556
|
&.layout-sidebar-link--active {
|
|
557
557
|
color: ${e=>e.theme.palette.primary.main};
|
|
558
|
-
background: ${
|
|
558
|
+
background: ${Vt};
|
|
559
559
|
border-left-color: ${G.A700};
|
|
560
560
|
}
|
|
561
561
|
}
|
|
@@ -661,7 +661,7 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
661
661
|
margin-top: 16px;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
`;function Wt({closeMenu:e,...n}){const a=
|
|
664
|
+
`;function Wt({closeMenu:e,...n}){const a=Y();return p.useEffect(()=>{e()},[a]),t.jsx(te,{...n})}function Pe(e,n){return e.map(a=>{var r;return(r=a.children)!=null&&r.length?{...a,label:a.title,children:Pe(a.children,n)}:{...a,label:t.jsx(Me,{to:a.url,external:a.external,children:a.title}),active:a.external?a.active:!!Ze({path:a.url,end:!1},n.pathname)}})}function Tt({title:e="Home",headerProps:n={},links:a=[],sidebarWidth:r=120,fullWidth:i=!1,dense:d="auto",footerProps:c={},children:s,...u}){const o=X(),{inFullPage:l,showToggleButton:x,headerVisible:b,footerVisible:j,sidebarVisible:z,toggleFullPage:N}=ct(),m=Y(),v=p.useMemo(()=>Pe(a,m),[m,a]),M=v.some(g=>{var k;return!!((k=g.children)!=null&&k.length)}),I=d==="auto"?v.length>=8||M:d,B=_("dashboard",{"dashboard-dense":I},u.className),$={homeLink:g=>{var k;return t.jsx(Me,{to:((k=window.blocklet)==null?void 0:k.prefix)||"/",children:g})},...n};return p.useEffect(()=>{const{searchParams:g}=new URL(window.location.href);g.get("inviter")&&window.localStorage.setItem("inviter",g.get("inviter"))},[]),t.jsxs(Ot,{...u,className:B,sidebarWidth:r,children:[t.jsx(ue,{title:e},e),b&&t.jsx(St,{...$,className:"dashboard-header",children:a!=null&&a.length?({isMobile:g,closeMenu:k})=>g?t.jsx(Wt,{mode:"inline",items:v,closeMenu:k,bgColor:"transparent",activeTextColor:o.palette.primary.main}):null:null}),t.jsxs(w,{display:"flex",className:"dashboard-body",children:[t.jsx(me,{mdDown:!0,children:!!(a!=null&&a.length)&&z&&t.jsx(w,{className:"dashboard-sidebar",children:I?t.jsx(se,{links:a,dense:I}):t.jsx(w,{className:"dashboard-sidebar-container",children:t.jsx(se,{links:a,dense:I})})})}),t.jsxs(w,{className:"dashboard-main",children:[x&&t.jsx(w,{sx:{position:"absolute",top:4,right:4,display:"flex",justifyContent:"center",alignItems:"center",width:24,height:24,color:"#fff",bgcolor:"rgba(158,158,158, 0.6);",borderRadius:1,cursor:"pointer"},onClick:N,children:l?t.jsx(be,{style:{fontSize:18}}):t.jsx(ge,{style:{fontSize:18}})}),t.jsx(E,{className:"dashboard-content",...i&&{maxWidth:!1},children:s}),j&&t.jsx(O,{...c})]})]})]})}const Ot=f("div",{shouldForwardProp:e=>e!=="sidebarWidth"})`
|
|
665
665
|
&.dashboard {
|
|
666
666
|
display: flex;
|
|
667
667
|
flex-direction: column;
|
|
@@ -718,4 +718,4 @@ import{aH as Re,aG as Ae,aI as Ee,ak as He,aJ as V,aM as F,r as p,aK as De,aL as
|
|
|
718
718
|
.header-container {
|
|
719
719
|
max-width: 100%;
|
|
720
720
|
}
|
|
721
|
-
`;function
|
|
721
|
+
`;function Xt({legacy:e=!0,...n}){return e?t.jsx(Mt,{...n}):t.jsx(ut,{children:t.jsx(Tt,{...n})})}export{Xt as D,te as N,_t as R,ct as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as $,
|
|
1
|
+
import{r as $,c2 as X,dz as Z,j as o,bL as O,dA as z,P as n,dB as ee,dC as U,bA as b,bK as B,u as _,dD as q,B as y,aU as C,ar as oe,I as D}from"./index-jHlcxkEo.js";import{E as W}from"./fallback-DHTsTOsA.js";import{R as ne,N as te}from"./index-D9Cgh-AY.js";import{i as re,u as ie,f as K,g as I,p as ae,m as G,a as se,b as le,H as ce,B as de}from"./index-BedxN_P9.js";import{d as pe}from"./ExpandMore-B8oaKzsK.js";import{A as S}from"./Avatar-Adx9Z0tZ.js";function T({icon:e,size:t,sx:r,...a}){const i=[...Array.isArray(r)?r:[r]];t&&i.push({width:t,height:t});const[u,s]=$.useState(!1),[c,l]=$.useState(!0);if(X(async()=>{l(!0);try{await Z(e),s(!0)}catch{s(!1)}l(!1)},[e]),a.variant||i.push({"&.MuiAvatar-root":{color:"inherit",fontWeight:"bold",backgroundColor:"transparent",borderRadius:0},"&.MuiAvatar-root svg":{width:"100%",height:"100%"}}),re(e))return o.jsx(S,{component:"span",...a,src:e,sx:i});const d=t?.6*t+4:0;return c?o.jsx(O,{icon:"codicon:blank",height:d||void 0}):u?o.jsx(S,{component:"span",...a,sx:i,children:o.jsx(O,{icon:e,height:d||void 0})}):e&&typeof e=="string"?(i.push({"&.MuiAvatar-root":{display:"inline-flex",...t&&{fontSize:t-2}}}),o.jsx(S,{component:"span",...a,sx:i,children:Array.from(e)[0]})):null}const ue=z();function R({theme:e,children:t}){const r=e?z(e):ue;return o.jsx(ee,{theme:r,children:t})}R.propTypes={children:n.any.isRequired,theme:n.object};R.defaultProps={theme:null};const fe=e=>{if(!(e!=null&&e.length))return{navItems:[],activeId:null};let t=1;const a=G(e,s=>{var d,p;const c=s.icon?o.jsx(T,{icon:s.icon}):null;if(s.items)return{id:`${t++}`,label:s.title,icon:c,children:s.items};let l={};return((d=s.link)!=null&&d.startsWith("http://")||(p=s.link)!=null&&p.startsWith("https://"))&&(l={target:"_blank",rel:"noreferrer"}),{id:`${t++}`,label:o.jsx("a",{href:s.link,...l,children:s.title}),icon:c,link:s.link}},"items"),i=se(a),u=le(i.map(s=>s.link));return{navItems:a,activeId:u>=0?i[u].id:null}};function he({meta:e={},addons:t,sessionManagerProps:r={showRole:!0},homeLink:a=ae,theme:i,hideNavMenu:u=!1,...s}){var h,N;ie();const{locale:c}=_()||{},l=$.useMemo(()=>{const w=Object.assign({},window.blocklet,e);try{return K(w)}catch(Q){return console.error("Failed to format blocklet info",Q,w),w}},[e]);if(!l.appName)return null;const{appLogo:d,appLogoRect:p,theme:m}=l,f=I((h=l==null?void 0:l.navigation)==null?void 0:h.header,c),k=fe(f),{navItems:g,activeId:v}=k,j=typeof t=="function"?w=>t(w,{navigation:k}):t,x=o.jsx(ce,{formattedBlocklet:l,addons:j,sessionManagerProps:r});return o.jsx(R,{theme:i,children:o.jsx(me,{homeLink:a,logo:o.jsx("img",{src:p||d,alt:"logo"}),addons:x,...q(s,["bordered"]),$bordered:s==null?void 0:s.bordered,$bgcolor:(N=m==null?void 0:m.background)==null?void 0:N.header,children:u||!(g!=null&&g.length)?null:({isMobile:w})=>o.jsx(te,{mode:w?"inline":"horizontal",activeId:v,items:g,className:"header-nav",bgColor:"transparent",textColor:"#777"})})})}const me=b(ne)`
|
|
2
2
|
${({$bgcolor:e})=>`background-color: ${e||"#fff"};`}
|
|
3
3
|
font-family: Inter, Avenir, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
|
|
4
4
|
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -76,7 +76,7 @@ import{r as $,bY as X,dz as Z,j as o,bF as O,dA as z,P as n,dB as ee,dC as U,bu
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
`;function
|
|
79
|
+
`;function A({links:e,flowLayout:t,...r}){const[a,i]=$.useState(-1);if(!(e!=null&&e.length))return null;const u=e.some(c=>{var l;return(l=c.items)==null?void 0:l.length}),s=({label:c,link:l,icon:d,render:p,props:m})=>{let f=c;return p?f=p({label:c,link:l,props:m}):l&&(f=o.jsx("a",{href:l,"aria-label":`Footer link for ${c}`,...m,children:c})),o.jsxs(o.Fragment,{children:[d&&o.jsx(T,{icon:d,size:20,sx:{mr:.5}}),f]})};return o.jsx(xe,{...r,className:C(r.className,{"footer-links--grouped":u,"footer-links--flow":t}),children:o.jsxs("div",{className:"footer-links-inner",children:[t&&e.map((c,l)=>o.jsx("span",{className:"footer-links-item",children:s(c)},l)),!t&&e.map((c,l)=>{const{items:d}=c,p=l===a;return o.jsxs("div",{className:C("footer-links-group",{"footer-links-group--active":p}),onClick:()=>i(a===l?-1:l),children:[o.jsxs("span",{className:"footer-links-item",children:[s(c),!!(d!=null&&d.length)&&o.jsx("span",{className:"footer-links-group-expand-icon",children:o.jsx(pe,{style:{transform:`rotate(${p?180:0}deg)`}})})]}),!!(d!=null&&d.length)&&o.jsx("div",{className:"footer-links-sub",children:d.map((m,f)=>o.jsx("span",{className:"footer-links-item",children:s(m)},f))})]},l)})]})})}A.propTypes={links:n.arrayOf(n.shape({label:n.string,link:n.string,render:n.func,props:n.object})),flowLayout:n.bool};A.defaultProps={links:[],flowLayout:!1};const xe=b("div")`
|
|
80
80
|
overflow: hidden;
|
|
81
81
|
color: ${e=>e.theme.palette.grey[600]};
|
|
82
82
|
.footer-links-inner {
|
|
@@ -241,7 +241,7 @@ import{r as $,bY as X,dz as Z,j as o,bF as O,dA as z,P as n,dB as ee,dC as U,bu
|
|
|
241
241
|
margin: 0 auto;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
`;function
|
|
244
|
+
`;function V({elements:e,data:t,...r}){var a;return o.jsx(ve,{...r,children:o.jsxs(D,{children:[o.jsxs(y,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},justifyContent:"space-between",alignItems:{xs:"center",md:"space-between"},gap:2,pb:3},children:[o.jsx(y,{children:e.brand}),o.jsx(y,{lineHeight:1,children:e.socialMedia})]}),!!((a=t.navigation)!=null&&a.length)&&o.jsx(y,{sx:{mb:6,pt:3,borderTop:1,borderColor:"grey.200"},children:e.navigation}),o.jsxs(M,{sx:{pt:3,borderTop:1,borderColor:"grey.200"},autoCenter:!0,children:[e.copyright,e.links]})]})})}V.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired};const ve=b("div")`
|
|
245
245
|
padding: 32px 0 24px 0;
|
|
246
246
|
.footer-brand-name,
|
|
247
247
|
.footer-brand-desc {
|
|
@@ -250,7 +250,7 @@ import{r as $,bY as X,dz as Z,j as o,bF as O,dA as z,P as n,dB as ee,dC as U,bu
|
|
|
250
250
|
&& .footer-brand-logo {
|
|
251
251
|
margin-right: 0;
|
|
252
252
|
}
|
|
253
|
-
`;function
|
|
253
|
+
`;function Y({elements:e,data:t,...r}){return o.jsx(je,{...r,children:o.jsxs(D,{className:"plain-layout-container",children:[!!t.links&&o.jsxs(M,{sx:{width:1},autoCenter:!0,children:[e.copyright,e.links]}),!t.links&&o.jsxs(o.Fragment,{children:[$.cloneElement(e.brand,{name:null,description:null}),e.copyright]})]})})}Y.propTypes={elements:n.shape({brand:n.element,navigation:n.element,socialMedia:n.element,copyright:n.element,links:n.element}).isRequired,data:n.object.isRequired};const je=b("div")`
|
|
254
254
|
padding: 24px 0;
|
|
255
255
|
.plain-layout-container {
|
|
256
256
|
display: flex;
|
|
@@ -259,7 +259,7 @@ import{r as $,bY as X,dz as Z,j as o,bF as O,dA as z,P as n,dB as ee,dC as U,bu
|
|
|
259
259
|
flex-wrap: wrap;
|
|
260
260
|
gap: 8px;
|
|
261
261
|
}
|
|
262
|
-
`,J=[{name:"plain",support:(e,t)=>{var r,a;return!((r=t.navigation)!=null&&r.length)&&!((a=t.socialMedia)!=null&&a.length)},component:
|
|
262
|
+
`,J=[{name:"plain",support:(e,t)=>{var r,a;return!((r=t.navigation)!=null&&r.length)&&!((a=t.socialMedia)!=null&&a.length)},component:Y},{name:"standard",support:()=>!0,component:V}],we=J.reduce((e,t)=>({...e,[t.name]:t}),{});function L(e){var v,j;const{brand:t,navigation:r,socialMedia:a,copyright:i,links:u,layout:s,...c}=e,l=()=>t?o.jsx(F,{...t}):null,d=()=>r!=null&&r.length?o.jsx(A,{links:r}):null,p=()=>a!=null&&a.length?o.jsx(P,{items:a}):null,m=()=>{const x=(i==null?void 0:i.owner)||(t==null?void 0:t.name);return x?o.jsx(E,{owner:x,year:(i==null?void 0:i.year)||void 0}):null},f=()=>u!=null&&u.length?o.jsx(A,{flowLayout:!0,links:u}):null,k={brand:l(),navigation:d(),socialMedia:p(),copyright:m(),links:f()};let g=null;if(s==="auto"?g=J.find(x=>x.support(k,e)).component:g=(v=we[s])==null?void 0:v.component,!g)throw new Error(`layout ${s} is not supported.`);return o.jsxs(y,{position:"relative",...c,children:[o.jsx(g,{elements:k,data:e}),o.jsx(y,{position:"absolute",right:16,bottom:0,fontSize:12,sx:{color:"transparent","::selection":{background:"#000",color:"#fff"}},children:(j=window==null?void 0:window.blocklet)==null?void 0:j.version})]})}L.propTypes={brand:n.shape({name:n.node,description:n.string,logo:n.node}),navigation:n.arrayOf(n.shape({label:n.node,link:n.string})),socialMedia:n.arrayOf(n.shape({icon:n.node,link:n.string})),copyright:n.shape({owner:n.string,year:n.oneOfType([n.string,n.number])}),links:n.arrayOf(n.shape({label:n.node,link:n.string})),layout:n.oneOf(["auto","standard","plain"])};L.defaultProps={brand:null,navigation:null,copyright:null,socialMedia:null,links:null,layout:"auto"};function H({meta:e,theme:t,...r}){var g,v,j,x;const{locale:a}=_()||{},i=$.useMemo(()=>{const h=Object.assign({},window.blocklet,e);try{return K(h)}catch(N){return console.error("Failed to format blocklet info",N,h),h}},[e]);if(!i.appName)return null;const{appLogo:u,appLogoRect:s,appName:c,appDescription:l,description:d,theme:p,copyright:m}=i,f={footerNav:I((g=i==null?void 0:i.navigation)==null?void 0:g.footer,a)||[],socialMedia:I((v=i==null?void 0:i.navigation)==null?void 0:v.social,a)||[],links:I((j=i==null?void 0:i.navigation)==null?void 0:j.bottom,a)||[]},k={brand:{name:c,description:l||d,logo:s||u},navigation:G(f.footerNav,h=>({...h,label:h.title,link:h.link}),"items"),copyright:m,socialMedia:f.socialMedia,links:f.links.map(h=>({...h,label:h.title}))};return o.jsx(R,{theme:t,children:o.jsx($e,{...k,...q(r,["bordered"]),$bordered:r==null?void 0:r.bordered,$bgcolor:(x=p==null?void 0:p.background)==null?void 0:x.footer})})}H.propTypes={meta:de,theme:n.object};H.defaultProps={meta:{},theme:null};const $e=b(L)`
|
|
263
263
|
${({$bordered:e})=>`border-top: 1px solid ${e?B.strokeSep:"#eee"};`}
|
|
264
264
|
color: ${e=>e.theme.palette.grey[600]};
|
|
265
265
|
${({$bgcolor:e})=>e&&`background-color: ${e};`}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f0 as b}from"./index-
|
|
1
|
+
import{f0 as b}from"./index-jHlcxkEo.js";function c(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}function A(o,e){for(var r="",i=0,l=-1,t=0,n,f=0;f<=o.length;++f){if(f<o.length)n=o.charCodeAt(f);else{if(n===47)break;n=47}if(n===47){if(!(l===f-1||t===1))if(l!==f-1&&t===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var s=r.lastIndexOf("/");if(s!==r.length-1){s===-1?(r="",i=0):(r=r.slice(0,s),i=r.length-1-r.lastIndexOf("/")),l=f,t=0;continue}}else if(r.length===2||r.length===1){r="",i=0,l=f,t=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+o.slice(l+1,f):r=o.slice(l+1,f),i=f-l-1;l=f,t=0}else n===46&&t!==-1?++t:t=-1}return r}function h(o,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+o+i:i}var g={resolve:function(){for(var e="",r=!1,i,l=arguments.length-1;l>=-1&&!r;l--){var t;l>=0?t=arguments[l]:(i===void 0&&(i=b.cwd()),t=i),c(t),t.length!==0&&(e=t+"/"+e,r=t.charCodeAt(0)===47)}return e=A(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(e){if(c(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=A(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return c(e),e.length>0&&e.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];c(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":g.normalize(e)},relative:function(e,r){if(c(e),c(r),e===r||(e=g.resolve(e),r=g.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,t=l-i,n=1;n<r.length&&r.charCodeAt(n)===47;++n);for(var f=r.length,s=f-n,v=t<s?t:s,u=-1,a=0;a<=v;++a){if(a===v){if(s>v){if(r.charCodeAt(n+a)===47)return r.slice(n+a+1);if(a===0)return r.slice(n+a)}else t>v&&(e.charCodeAt(i+a)===47?u=a:a===0&&(u=0));break}var m=e.charCodeAt(i+a),C=r.charCodeAt(n+a);if(m!==C)break;m===47&&(u=a)}var d="";for(a=i+u+1;a<=l;++a)(a===l||e.charCodeAt(a)===47)&&(d.length===0?d+="..":d+="/..");return d.length>0?d+r.slice(n+u):(n+=u,r.charCodeAt(n)===47&&++n,r.slice(n))},_makeLong:function(e){return e},dirname:function(e){if(c(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,l=-1,t=!0,n=e.length-1;n>=1;--n)if(r=e.charCodeAt(n),r===47){if(!t){l=n;break}}else t=!1;return l===-1?i?"/":".":i&&l===1?"//":e.slice(0,l)},basename:function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');c(e);var i=0,l=-1,t=!0,n;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var f=r.length-1,s=-1;for(n=e.length-1;n>=0;--n){var v=e.charCodeAt(n);if(v===47){if(!t){i=n+1;break}}else s===-1&&(t=!1,s=n+1),f>=0&&(v===r.charCodeAt(f)?--f===-1&&(l=n):(f=-1,l=s))}return i===l?l=s:l===-1&&(l=e.length),e.slice(i,l)}else{for(n=e.length-1;n>=0;--n)if(e.charCodeAt(n)===47){if(!t){i=n+1;break}}else l===-1&&(t=!1,l=n+1);return l===-1?"":e.slice(i,l)}},extname:function(e){c(e);for(var r=-1,i=0,l=-1,t=!0,n=0,f=e.length-1;f>=0;--f){var s=e.charCodeAt(f);if(s===47){if(!t){i=f+1;break}continue}l===-1&&(t=!1,l=f+1),s===46?r===-1?r=f:n!==1&&(n=1):r!==-1&&(n=-1)}return r===-1||l===-1||n===0||n===1&&r===l-1&&r===i+1?"":e.slice(r,l)},format:function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return h("/",e)},parse:function(e){c(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),l=i===47,t;l?(r.root="/",t=1):t=0;for(var n=-1,f=0,s=-1,v=!0,u=e.length-1,a=0;u>=t;--u){if(i=e.charCodeAt(u),i===47){if(!v){f=u+1;break}continue}s===-1&&(v=!1,s=u+1),i===46?n===-1?n=u:a!==1&&(a=1):n!==-1&&(a=-1)}return n===-1||s===-1||a===0||a===1&&n===s-1&&n===f+1?s!==-1&&(f===0&&l?r.base=r.name=e.slice(1,s):r.base=r.name=e.slice(f,s)):(f===0&&l?(r.name=e.slice(1,n),r.base=e.slice(1,s)):(r.name=e.slice(f,n),r.base=e.slice(f,s)),r.ext=e.slice(n,s)),f>0?r.dir=e.slice(0,f-1):l&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};g.posix=g;var y=g;export{y as p};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{av as d4,j as o,aI as n1,cR as m3,aM as $,fH as J2,aL as b1,aG as F1,aH as A1,T as G,r as j,aK as m2,aN as C4,aO as U1,aP as q1,cY as u4,fI as s2,Z as R1,$ as y1,a1 as z1,B as L,P as p,G as X,e as L2,u as t1,aR as j1,a_ as P1,bz as i2,a3 as o2,L as C1,bL as L3,a as g1,aE as m1,N as p4,t as U,a0 as a1,bM as f4,ac as w1,c as u1,I as h4,bX as b2,cj as b3,cM as x4,cV as $1,cW as j3,al as g4,da as m4,cQ as J1,bF as i1,c5 as Q1,fu as L4,aa as Q2,fJ as b4,b as r1,n as l2,bo as v3,ej as V3,ak as j2,bp as w3,cA as H3,aV as O1,aU as j4,a5 as R3,fK as Y2,fh as k1,bm as v4,aw as y3,c4 as V4,l as w4,aD as H4,as as R4,at as d2}from"./index-CdgjvQxC.js";import{d as v2}from"./Add-B6Ua6q-Z.js";import{d as M3,a as y4}from"./Delete-s2NC3KEw.js";import{d as M4}from"./Error-DtG_nJnF.js";import{D as V2}from"./index-B9ApMsSr.js";import{T as S3,b as S4}from"./index-fvB3wuMp.js";import{C as w2}from"./confirm-CRz8exrR.js";import{u as c2}from"./session-BhpnDl9E.js";import{W as e3}from"./did-address-BkdwWWEb.js";import{E as W1,D as k4,C as Z4,P as I4}from"./react-beautiful-dnd.esm-Cp27_Z2H.js";import{B as H2}from"./bundle-avatar-meR-iuh8.js";import{S as L1}from"./shorten-label-BYD4zgYF.js";import{A as k3}from"./Avatar-D2r2PRgc.js";import{d as P4}from"./Download-CqE0jRjy.js";import{d as T4}from"./QuestionMarkCircle-MfFIsz6w.js";import{b as D4,c as t3,T as N4}from"./index-CBRA0x7Q.js";import{_ as S1}from"./useSetState-GTMZIRrt.js";import{c as R2}from"./index-DzNuKWIR.js";import{C as Y1,L as _4}from"./MoreVert-C7wRaOtv.js";import{A as Z3}from"./Alert-CWJPPP63.js";import{p as r2}from"./index-x8tkXY5V.js";import"./api-BGevyJlL.js";import{i as B4}from"./index-QfRVoAyB.js";import{d as E4}from"./ExpandMore-5W_549ow.js";import{d as O4}from"./ChevronRight-BDSOab3L.js";import{d as $4}from"./OpenInNew-CXwMNDRH.js";import{u as I3}from"./useThemeProps-D3g52yHb.js";import{F as f2}from"./FormControlLabel-BxRswD5v.js";import{u as F4}from"./useSlotProps-CHK9ut6X.js";import{d as A4}from"./DeleteOutline-CIxtpsDT.js";import{c as U4,A as P3,u as q4,S as z4,U as W4}from"./item-BY7CX9DM.js";import{d as G4}from"./ArrowDropDown-BgPwecc9.js";import{f as I1}from"./format-error-CsY5MTO-.js";import{B as h2}from"./ButtonGroup-DUcvj0JP.js";import{T as Z1}from"./TextField-BUFHAnNK.js";import{I as y2}from"./InputAdornment-DswAHyKT.js";import{S as B1}from"./Stack-D1S3xkvy.js";import{C as K4}from"./click-to-copy-2G3TnzwZ.js";import{d as X4}from"./Launch-BBO9P6pW.js";import{S as o3}from"./index-CYEg2-8x.js";import{M as J4}from"./index-Dob_tNHw.js";import{p as Q4}from"./purify.es-Bq0E5Q3l.js";import{r as Y4}from"./index-8Uzxcrqs.js";import{d as e5}from"./Done-D9WIbYXR.js";import{c as T3,d as D3,b as t5,S as o5,a as l5}from"./Stepper-BXsAA8yH.js";import{R as r5,a as l3}from"./RadioGroup-Bg1SV6KY.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-C8uPGoLI.js";import"./index-B5XDziuX.js";import"./redux-CluOqhW1.js";import"./ViewColumn-jrdyac4S.js";import"./FormControl-D38v2z67.js";import"./useFormControl-CKpzs7q1.js";import"./FormGroup-Dtv1bjEg.js";import"./Grid-BA09q8_6.js";import"./Select-YmfypP2F.js";import"./LastPage-tIk3DwvT.js";import"./Toolbar-JUHTVGzV.js";import"./Search-BqBCe5ki.js";import"./index-D0t4oon5.js";import"./DialogContentText-C-7SR9C-.js";import"./Link-BdhOk-uG.js";import"./raf-schd.esm-CR0Pt1CF.js";import"./useSlot-h7rz3Ehc.js";import"./jss-plugin-props-sort.esm-DZ0QxdlL.js";const n5=d4(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"),s5=["slots","slotProps"],i5=n1(m3)(({theme:e})=>$({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":$({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":$({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:J2(e.palette.grey[200],.12)}:{backgroundColor:J2(e.palette.grey[600],.12)})})),c5=n1(n5)({width:24,height:16});function a5(e){const{slots:t={},slotProps:r={}}=e,n=b1(e,s5),s=e;return o.jsx("li",{children:o.jsx(i5,$({focusRipple:!0},n,{ownerState:s,children:o.jsx(c5,$({as:t.CollapsedIcon,ownerState:s},r.collapsedIcon))}))})}function d5(e){return A1("MuiBreadcrumbs",e)}const C5=F1("MuiBreadcrumbs",["root","ol","li","separator"]),u5=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],p5=e=>{const{classes:t}=e;return q1({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},d5,t)},f5=n1(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${C5.li}`]:t.li},t.root]})({}),h5=n1("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),x5=n1("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function g5(e,t,r,n){return e.reduce((s,c,i)=>(i<e.length-1?s=s.concat(c,o.jsx(x5,{"aria-hidden":!0,className:t,ownerState:n,children:r},`separator-${i}`)):s.push(c),s),[])}const N3=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiBreadcrumbs"}),{children:s,className:c,component:i="nav",slots:C={},slotProps:a={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:V=8,separator:u="/"}=n,d=b1(n,u5),[h,v]=j.useState(!1),w=$({},n,{component:i,expanded:h,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:V,separator:u}),H=p5(w),R=C4({elementType:C.CollapsedIcon,externalSlotProps:a.collapsedIcon,ownerState:w}),S=j.useRef(null),y=M=>{const F=()=>{v(!0);const D=S.current.querySelector("a[href],button,[tabindex]");D&&D.focus()};return g+x>=M.length?M:[...M.slice(0,g),o.jsx(a5,{"aria-label":f,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:F},"ellipsis"),...M.slice(M.length-x,M.length)]},k=j.Children.toArray(s).filter(M=>j.isValidElement(M)).map((M,F)=>o.jsx("li",{className:H.li,children:M},`child-${F}`));return o.jsx(f5,$({ref:r,component:i,color:"text.secondary",className:U1(H.root,c),ownerState:w},d,{children:o.jsx(h5,{className:H.ol,ref:S,ownerState:w,children:g5(h||V&&k.length<=V?k:y(k),H.separator,u,w)})}))});function m5(e){return A1("MuiStepButton",e)}const r3=F1("MuiStepButton",["root","horizontal","vertical","touchRipple"]),L5=["children","className","icon","optional"],b5=e=>{const{classes:t,orientation:r}=e;return q1({root:["root",r],touchRipple:["touchRipple"]},m5,t)},j5=n1(m3,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${r3.touchRipple}`]:t.touchRipple},t.root,t[r.orientation]]}})(({ownerState:e})=>$({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${r3.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),v5=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiStepButton"}),{children:s,className:c,icon:i,optional:C}=n,a=b1(n,L5),{disabled:f,active:x}=j.useContext(T3),{orientation:g}=j.useContext(D3),V=$({},n,{orientation:g}),u=b5(V),d={icon:i,optional:C},h=u4(s,["StepLabel"])?j.cloneElement(s,d):o.jsx(t5,$({},d,{children:s}));return o.jsx(j5,$({focusRipple:!0,disabled:f,TouchRippleProps:{className:u.touchRipple},className:U1(u.root,c),ref:r,ownerState:V,"aria-current":x?"step":void 0},a,{children:h}))});function V5(e){return A1("MuiStepContent",e)}F1("MuiStepContent",["root","last","transition"]);const w5=["children","className","TransitionComponent","transitionDuration","TransitionProps"],H5=e=>{const{classes:t,last:r}=e;return q1({root:["root",r&&"last"],transition:["transition"]},V5,t)},R5=n1("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.last&&t.last]}})(({ownerState:e,theme:t})=>$({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"})),y5=n1(s2,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),M5=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiStepContent"}),{children:s,className:c,TransitionComponent:i=s2,transitionDuration:C="auto",TransitionProps:a}=n,f=b1(n,w5);j.useContext(D3);const{active:x,last:g,expanded:V}=j.useContext(T3),u=$({},n,{last:g}),d=H5(u);let h=C;return C==="auto"&&!i.muiSupportAuto&&(h=void 0),o.jsx(R5,$({className:U1(d.root,c),ref:r,ownerState:u},f,{children:o.jsx(y5,$({as:i,in:x||V,className:d.transition,ownerState:u,timeout:h,unmountOnExit:!0},a,{children:s}))}))});var M2={},S5=y1;Object.defineProperty(M2,"__esModule",{value:!0});var _3=M2.default=void 0,k5=S5(R1()),Z5=o;_3=M2.default=(0,k5.default)((0,Z5.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 S2={},I5=y1;Object.defineProperty(S2,"__esModule",{value:!0});var B3=S2.default=void 0,P5=I5(R1()),T5=o;B3=S2.default=(0,P5.default)((0,T5.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 k2={},D5=y1;Object.defineProperty(k2,"__esModule",{value:!0});var E3=k2.default=void 0,N5=D5(R1()),_5=o;E3=k2.default=(0,N5.default)((0,_5.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 Z2({did:e,projectId:t,title:r,logo:n,describe:s}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${n}`,[C,a]=j.useState(!1),f=z1(x=>x.breakpoints.down("md"));return o.jsxs(L,{sx:{display:"flex",flexDirection:"row",color:C?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[o.jsx(k3,{sx:{borderRadius:1},src:i}),o.jsxs(L,{children:[o.jsx(L1,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:r||"/"}),o.jsx(L1,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||C?"primary.main":"grey.700"},children:s||"/"})]})]})}Z2.propTypes={projectId:p.string.isRequired,did:p.string.isRequired,title:p.string.isRequired,logo:p.string.isRequired,describe:p.string.isRequired};function I2({initUrl:e}){const t=L2(),r=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:n,locale:s}=t1(),{api:c}=j1(),{api:i}=c2(),[C,a]=j.useState(!0),{blocklet:f}=P1(),[x,g]=j.useState(null),[V,u]=j.useState(!1),d=z1(Z=>Z.breakpoints.down("xl")),{componentDid:h=""}=i2(),[v,w]=j.useState(null),H=()=>{c.getProjects({input:{did:f.meta.did,componentDid:h,tenantScope:r}}).then(Z=>{const T=(Z==null?void 0:Z.projects)||[];a(!1),w(T)}).catch(Z=>{a(!1),U.error(Z.message)})},R=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},S=Z=>{g(Z)},y=()=>{a(!1),u(!0)},k=()=>{u(!1),g(null)},M=Z=>{U.error(Z.message),u(!1),g(null)},F=Z=>{if(!(Z!=null&&Z.deleted)){U.error("Delete project failed");return}H(),u(!1),g(null)};if(j.useEffect(()=>{H()},[]),!v&&C)return o.jsx(L,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(W1,{})});if(!v)return null;if(!v.length)return o.jsxs(L,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(L,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),o.jsx(L,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),o.jsx(o2,{onClick:R,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const D=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:Z=>{const T=v[Z];return o.jsx(C1,{to:`${T.id}`,children:o.jsx(Z2,{did:f.meta.did,projectId:T.id,logo:T.blockletLogo,title:T.blockletTitle,describe:T.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:Z=>Z?o.jsx(S3,{type:"success",children:Z}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:Z=>Z?o.jsx(e3,{size:14,compact:!0,responsive:!1,did:Z}):null}},d||h?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:Z=>Z?o.jsx(e3,{onClick:()=>{t(`/.well-known/service/admin/members?did=${Z}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:Z}):null}},d||h?null:{label:n("common.scope"),name:"componentDid",options:{customBodyRender:Z=>{const T=(f.children||[]).find(P=>P.meta.did===Z);return T?o.jsxs(L,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(H2,{size:14,blocklet:T,ancestors:[f]}),o.jsx(L,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:T.meta.title})]},Z):""}}},d||r?null:{label:n("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:Z=>o.jsx(L,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(L1,{children:Z})})}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:Z=>o.jsx(L3,{value:Number(Z),locale:s})}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:Z=>{const T=v[Z];return o.jsxs(L,{display:"flex",children:[o.jsx(C1,{to:`${T.id}/new-release/${T.lastReleaseId}`,children:o.jsx(g1,{title:n("blocklet.publish.createRelease"),placement:"top",children:o.jsx(m1,{color:"primary","aria-label":"create",children:o.jsx(_3,{style:{fontSize:18}})})})}),!!T.lastReleaseId&&o.jsx(g1,{title:n("blocklet.publish.viewLastRelease",{name:T.blockletTitle}),placement:"top",children:o.jsx(m1,{color:"secondary","aria-label":"create",children:o.jsx(C1,{style:{display:"flex"},to:`${T.id}/view/${T.lastReleaseId}`,children:o.jsx(B3,{sx:{fontSize:18}})})})}),o.jsx(g1,{title:n("blocklet.publish.delete",{name:T.blockletTitle}),placement:"top",children:o.jsx(m1,{color:"primary","aria-label":"delete",onClick:()=>S(T),children:o.jsx(M3,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=V?o.jsx(p4,{open:!0,popup:!0,onClose:k,action:"check-has-project-id",locale:s,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:F,onError:M,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(B5,{children:[o.jsxs(L,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(L,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(L,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),o.jsx(g1,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(E3,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(o2,{onClick:R,variant:"contained",children:[o.jsx(v2,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.publish.createBlocklet")]})]}),o.jsx(L,{mt:3}),o.jsx(V2,{className:"main-table",locale:s,data:v,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(w2,{title:`${n("common.delete")} ${x.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:y,onCancel:()=>g(null),children:o.jsx(L,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(Z=>o.jsxs(L,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(M4,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:Z})]}))})}),I]})}I2.propTypes={initUrl:p.object};I2.defaultProps={initUrl:null};const B5=a1(L)`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BFcr9JDQ.js","assets/index-jHlcxkEo.js","assets/index-B4oT57Ax.css","assets/url-join-sg6DH6qt.js","assets/index-DXZuEbMH.js","assets/_createAggregator-Bj6ourdE.js","assets/index-C8Cmkjd6.js","assets/index-C_rc1Lwt.js","assets/index-DTzuTDWf.js","assets/fallback-DHTsTOsA.js","assets/index-D9Cgh-AY.js","assets/Menu-BW47wukv.js","assets/Toolbar-Kng3WhVc.js","assets/Hidden-CXUMFZRF.js","assets/index-BedxN_P9.js","assets/MoreVert-DLwvbbqd.js","assets/FormControlLabel-BaYmyBlu.js","assets/useFormControl-CS6vjtl0.js","assets/Stack-ID2bvJFU.js","assets/ListItemButton-G-aWGmX0.js","assets/selector-BB2fFIXP.js","assets/ExpandMore-B8oaKzsK.js","assets/Avatar-Adx9Z0tZ.js","assets/useSlot-D-6cy3hj.js","assets/resource-dialog-CQSjUEGn.js","assets/index-OU0ZpNT_.js","assets/OpenInNew-K-C4gsO1.js","assets/index-U-Ouf6WM.js","assets/Link-BEFhKJq0.js","assets/Skeleton-Dq3yy5K4.js","assets/HelpOutline-DYeyCE3o.js","assets/index-CDzU6wY1.js","assets/ButtonGroup-BWb37jJW.js","assets/DialogContentText-Dydxe3m7.js","assets/TextField-GO8E4D8x.js","assets/FormControl-DD67kWGJ.js","assets/Select-CDj8XFCr.js","assets/use-mobile-CM0Yohdc.js","assets/index-C9XX9FI-.js","assets/index-BN0lgmDH.js","assets/index-A6rXBmgc.js","assets/emotion-cache.browser.esm-BwirBJuO.js","assets/purify.es-CCJo14B2.js","assets/index-bNbDSQ4T.js","assets/index-BT7-315i.js","assets/useThemeProps-CmIdHfIC.js","assets/toPropertyKey-PLuKRk1e.js","assets/index-BtSt5FGJ.js","assets/redux-CluOqhW1.js","assets/ViewColumn-gNP4x-sg.js","assets/FormGroup-th0rZzfK.js","assets/Grid-DxM3VqDH.js","assets/Delete-CjUdkXlU.js","assets/LastPage-DnljsHk-.js","assets/Search-BMru4B7h.js","assets/deprecate-DCu9jut5.js","assets/uniqBy-CH7S750Q.js","assets/toUpper-BHGjhPud.js","assets/index-AgKpYdvC.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{aB as d4,j as o,aO as n1,cR as m3,aS as $,fH as J2,aR as b1,aM as F1,aN as A1,T as G,r as j,aQ as m2,aT as C4,aU as U1,aV as q1,cY as u4,fI as s2,Z as R1,$ as y1,a1 as z1,B as L,P as p,G as X,e as L2,u as t1,aX as j1,b4 as P1,bF as i2,a3 as o2,L as C1,bR as L3,a as g1,aK as m1,N as p4,t as U,a0 as a1,bS as f4,ac as w1,c as u1,I as h4,c1 as b2,cp as b3,cM as x4,cV as $1,cW as j3,ar as g4,da as m4,cQ as J1,bL as i1,cb as Q1,fu as L4,aa as Q2,fJ as b4,b as r1,n as l2,bu as v3,ej as V3,ak as j2,bv as w3,cG as H3,a$ as O1,a_ as j4,a5 as R3,fK as Y2,fh as k1,bs as v4,aC as y3,ca as V4,l as w4,aJ as H4,ay as R4,az as d2}from"./index-jHlcxkEo.js";import{d as v2}from"./Add-mXZrOf1h.js";import{d as M3,a as y4}from"./Delete-CjUdkXlU.js";import{d as M4}from"./Error-HNpddmqm.js";import{D as V2}from"./index-BT7-315i.js";import{T as S3,b as S4}from"./index-CqjSnEu1.js";import{C as w2}from"./confirm-DF9JbbCJ.js";import{u as c2}from"./session-D3zyh62B.js";import{W as e3}from"./did-address-DOCLeksL.js";import{E as W1,D as k4,C as Z4,P as I4}from"./react-beautiful-dnd.esm-B8s8Je1D.js";import{B as H2}from"./bundle-avatar-BMYoF8YT.js";import{S as L1}from"./shorten-label-ZyDji4qi.js";import{A as k3}from"./Avatar-Adx9Z0tZ.js";import{d as P4}from"./Download-pBnEdFOD.js";import{d as T4}from"./QuestionMarkCircle-tCeIxlN3.js";import{b as D4,c as t3,T as N4}from"./index-C9XX9FI-.js";import{_ as S1}from"./useSetState-DUhj3dVg.js";import{c as R2}from"./index-C_rc1Lwt.js";import{C as Y1,L as _4}from"./MoreVert-DLwvbbqd.js";import{A as Z3}from"./Alert-DaafqUlw.js";import{p as r2}from"./index-CPibawHo.js";import"./api-X6cMA7j1.js";import{i as B4}from"./index-U-Ouf6WM.js";import{d as E4}from"./ExpandMore-B8oaKzsK.js";import{d as O4}from"./ChevronRight-CwMDvr2n.js";import{d as $4}from"./OpenInNew-K-C4gsO1.js";import{u as I3}from"./useThemeProps-CmIdHfIC.js";import{F as f2}from"./FormControlLabel-BaYmyBlu.js";import{u as F4}from"./useSlotProps-CEuB5YLI.js";import{d as A4}from"./DeleteOutline-CzTPA4kL.js";import{c as U4,A as P3,u as q4,S as z4,U as W4}from"./item-CwYliHGb.js";import{d as G4}from"./ArrowDropDown-BtoPSHd8.js";import{f as I1}from"./format-error-DsLT-I_t.js";import{B as h2}from"./ButtonGroup-BWb37jJW.js";import{T as Z1}from"./TextField-GO8E4D8x.js";import{I as y2}from"./InputAdornment-BjTDlo1K.js";import{S as B1}from"./Stack-ID2bvJFU.js";import{C as K4}from"./click-to-copy-Chph5bbk.js";import{d as X4}from"./Launch-BeWg-XKa.js";import{S as o3}from"./index-bNbDSQ4T.js";import{M as J4}from"./index-B5-lwWQw.js";import{p as Q4}from"./purify.es-CCJo14B2.js";import{r as Y4}from"./index-DbN4h3gH.js";import{d as e5}from"./Done-PbP-u2lH.js";import{c as T3,d as D3,b as t5,S as o5,a as l5}from"./Stepper-oTT6WH0K.js";import{R as r5,a as l3}from"./RadioGroup-DIin5rK_.js";import"./toPropertyKey-PLuKRk1e.js";import"./emotion-cache.browser.esm-BwirBJuO.js";import"./index-BtSt5FGJ.js";import"./redux-CluOqhW1.js";import"./ViewColumn-gNP4x-sg.js";import"./FormControl-DD67kWGJ.js";import"./useFormControl-CS6vjtl0.js";import"./FormGroup-th0rZzfK.js";import"./Grid-DxM3VqDH.js";import"./Select-CDj8XFCr.js";import"./LastPage-DnljsHk-.js";import"./Toolbar-Kng3WhVc.js";import"./Search-BMru4B7h.js";import"./index-BN0lgmDH.js";import"./DialogContentText-Dydxe3m7.js";import"./Link-BEFhKJq0.js";import"./raf-schd.esm-DbYZ8cuK.js";import"./useSlot-D-6cy3hj.js";import"./jss-plugin-props-sort.esm-l47fXiIJ.js";const n5=d4(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"),s5=["slots","slotProps"],i5=n1(m3)(({theme:e})=>$({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":$({},e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}),"&:active":$({boxShadow:e.shadows[0]},e.palette.mode==="light"?{backgroundColor:J2(e.palette.grey[200],.12)}:{backgroundColor:J2(e.palette.grey[600],.12)})})),c5=n1(n5)({width:24,height:16});function a5(e){const{slots:t={},slotProps:r={}}=e,n=b1(e,s5),s=e;return o.jsx("li",{children:o.jsx(i5,$({focusRipple:!0},n,{ownerState:s,children:o.jsx(c5,$({as:t.CollapsedIcon,ownerState:s},r.collapsedIcon))}))})}function d5(e){return A1("MuiBreadcrumbs",e)}const C5=F1("MuiBreadcrumbs",["root","ol","li","separator"]),u5=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],p5=e=>{const{classes:t}=e;return q1({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},d5,t)},f5=n1(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,t)=>[{[`& .${C5.li}`]:t.li},t.root]})({}),h5=n1("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(e,t)=>t.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),x5=n1("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(e,t)=>t.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function g5(e,t,r,n){return e.reduce((s,c,i)=>(i<e.length-1?s=s.concat(c,o.jsx(x5,{"aria-hidden":!0,className:t,ownerState:n,children:r},`separator-${i}`)):s.push(c),s),[])}const N3=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiBreadcrumbs"}),{children:s,className:c,component:i="nav",slots:C={},slotProps:a={},expandText:f="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:g=1,maxItems:V=8,separator:u="/"}=n,d=b1(n,u5),[h,v]=j.useState(!1),w=$({},n,{component:i,expanded:h,expandText:f,itemsAfterCollapse:x,itemsBeforeCollapse:g,maxItems:V,separator:u}),H=p5(w),R=C4({elementType:C.CollapsedIcon,externalSlotProps:a.collapsedIcon,ownerState:w}),S=j.useRef(null),y=M=>{const F=()=>{v(!0);const D=S.current.querySelector("a[href],button,[tabindex]");D&&D.focus()};return g+x>=M.length?M:[...M.slice(0,g),o.jsx(a5,{"aria-label":f,slots:{CollapsedIcon:C.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:F},"ellipsis"),...M.slice(M.length-x,M.length)]},k=j.Children.toArray(s).filter(M=>j.isValidElement(M)).map((M,F)=>o.jsx("li",{className:H.li,children:M},`child-${F}`));return o.jsx(f5,$({ref:r,component:i,color:"text.secondary",className:U1(H.root,c),ownerState:w},d,{children:o.jsx(h5,{className:H.ol,ref:S,ownerState:w,children:g5(h||V&&k.length<=V?k:y(k),H.separator,u,w)})}))});function m5(e){return A1("MuiStepButton",e)}const r3=F1("MuiStepButton",["root","horizontal","vertical","touchRipple"]),L5=["children","className","icon","optional"],b5=e=>{const{classes:t,orientation:r}=e;return q1({root:["root",r],touchRipple:["touchRipple"]},m5,t)},j5=n1(m3,{name:"MuiStepButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${r3.touchRipple}`]:t.touchRipple},t.root,t[r.orientation]]}})(({ownerState:e})=>$({width:"100%",padding:"24px 16px",margin:"-24px -16px",boxSizing:"content-box"},e.orientation==="vertical"&&{justifyContent:"flex-start",padding:"8px",margin:"-8px"},{[`& .${r3.touchRipple}`]:{color:"rgba(0, 0, 0, 0.3)"}})),v5=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiStepButton"}),{children:s,className:c,icon:i,optional:C}=n,a=b1(n,L5),{disabled:f,active:x}=j.useContext(T3),{orientation:g}=j.useContext(D3),V=$({},n,{orientation:g}),u=b5(V),d={icon:i,optional:C},h=u4(s,["StepLabel"])?j.cloneElement(s,d):o.jsx(t5,$({},d,{children:s}));return o.jsx(j5,$({focusRipple:!0,disabled:f,TouchRippleProps:{className:u.touchRipple},className:U1(u.root,c),ref:r,ownerState:V,"aria-current":x?"step":void 0},a,{children:h}))});function V5(e){return A1("MuiStepContent",e)}F1("MuiStepContent",["root","last","transition"]);const w5=["children","className","TransitionComponent","transitionDuration","TransitionProps"],H5=e=>{const{classes:t,last:r}=e;return q1({root:["root",r&&"last"],transition:["transition"]},V5,t)},R5=n1("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.last&&t.last]}})(({ownerState:e,theme:t})=>$({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"})),y5=n1(s2,{name:"MuiStepContent",slot:"Transition",overridesResolver:(e,t)=>t.transition})({}),M5=j.forwardRef(function(t,r){const n=m2({props:t,name:"MuiStepContent"}),{children:s,className:c,TransitionComponent:i=s2,transitionDuration:C="auto",TransitionProps:a}=n,f=b1(n,w5);j.useContext(D3);const{active:x,last:g,expanded:V}=j.useContext(T3),u=$({},n,{last:g}),d=H5(u);let h=C;return C==="auto"&&!i.muiSupportAuto&&(h=void 0),o.jsx(R5,$({className:U1(d.root,c),ref:r,ownerState:u},f,{children:o.jsx(y5,$({as:i,in:x||V,className:d.transition,ownerState:u,timeout:h,unmountOnExit:!0},a,{children:s}))}))});var M2={},S5=y1;Object.defineProperty(M2,"__esModule",{value:!0});var _3=M2.default=void 0,k5=S5(R1()),Z5=o;_3=M2.default=(0,k5.default)((0,Z5.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 S2={},I5=y1;Object.defineProperty(S2,"__esModule",{value:!0});var B3=S2.default=void 0,P5=I5(R1()),T5=o;B3=S2.default=(0,P5.default)((0,T5.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 k2={},D5=y1;Object.defineProperty(k2,"__esModule",{value:!0});var E3=k2.default=void 0,N5=D5(R1()),_5=o;E3=k2.default=(0,N5.default)((0,_5.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 Z2({did:e,projectId:t,title:r,logo:n,describe:s}){const i=`${`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e}/${t}/logo/upload`}/${n}`,[C,a]=j.useState(!1),f=z1(x=>x.breakpoints.down("md"));return o.jsxs(L,{sx:{display:"flex",flexDirection:"row",color:C?"primary.main":"grey.900",gap:1},onPointerEnter:()=>a(!0),onPointerLeave:()=>a(!1),children:[o.jsx(k3,{sx:{borderRadius:1},src:i}),o.jsxs(L,{children:[o.jsx(L1,{hiddenTip:!0,maxLength:"24",sx:{fontSize:"14px",fontWeight:"500",color:f?"primary.main":""},children:r||"/"}),o.jsx(L1,{hiddenTip:!0,maxLength:"58",sx:{fontSize:"12px",color:f||C?"primary.main":"grey.700"},children:s||"/"})]})]})}Z2.propTypes={projectId:p.string.isRequired,did:p.string.isRequired,title:p.string.isRequired,logo:p.string.isRequired,describe:p.string.isRequired};function I2({initUrl:e}){const t=L2(),r=(e==null?void 0:e.searchParams.get("tenantScope"))||"",{t:n,locale:s}=t1(),{api:c}=j1(),{api:i}=c2(),[C,a]=j.useState(!0),{blocklet:f}=P1(),[x,g]=j.useState(null),[V,u]=j.useState(!1),d=z1(Z=>Z.breakpoints.down("xl")),{componentDid:h=""}=i2(),[v,w]=j.useState(null),H=()=>{c.getProjects({input:{did:f.meta.did,componentDid:h,tenantScope:r}}).then(Z=>{const T=(Z==null?void 0:Z.projects)||[];a(!1),w(T)}).catch(Z=>{a(!1),U.error(Z.message)})},R=()=>{t(`${X.UNOWNED_DID}/create/none`,{replace:!0})},S=Z=>{g(Z)},y=()=>{a(!1),u(!0)},k=()=>{u(!1),g(null)},M=Z=>{U.error(Z.message),u(!1),g(null)},F=Z=>{if(!(Z!=null&&Z.deleted)){U.error("Delete project failed");return}H(),u(!1),g(null)};if(j.useEffect(()=>{H()},[]),!v&&C)return o.jsx(L,{sx:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"40px"},children:o.jsx(W1,{})});if(!v)return null;if(!v.length)return o.jsxs(L,{display:"flex",flexDirection:"column",alignItems:"center",pt:10,children:[o.jsx(L,{sx:{fontSize:20,fontWeight:"bold",mb:3},children:n("blocklet.publish.blockletEmptyTip")}),o.jsx(L,{sx:{fontSize:14,color:"text.secondary",mb:3},children:n("blocklet.publish.createBlockletTip")}),o.jsx(o2,{onClick:R,variant:"contained",children:n("blocklet.publish.createBlocklet")})]});const D=[{label:"Blocklet",name:"blockletTitle",minWidth:160,options:{customBodyRenderLite:Z=>{const T=v[Z];return o.jsx(C1,{to:`${T.id}`,children:o.jsx(Z2,{did:f.meta.did,projectId:T.id,logo:T.blockletLogo,title:T.blockletTitle,describe:T.blockletDescription})})}}},{label:"Version",name:"blockletVersion",options:{customBodyRender:Z=>Z?o.jsx(S3,{type:"success",children:Z}):""}},{label:"DID",name:"blockletDid",options:{customBodyRender:Z=>Z?o.jsx(e3,{size:14,compact:!0,responsive:!1,did:Z}):null}},d||h?null:{label:n("common.createdBy"),name:"createdBy",options:{customBodyRender:Z=>Z?o.jsx(e3,{onClick:()=>{t(`/.well-known/service/admin/members?did=${Z}`)},style:{cursor:"pointer"},size:14,compact:!0,copyable:!1,showQrcode:!1,responsive:!1,did:Z}):null}},d||h?null:{label:n("common.scope"),name:"componentDid",options:{customBodyRender:Z=>{const T=(f.children||[]).find(P=>P.meta.did===Z);return T?o.jsxs(L,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(H2,{size:14,blocklet:T,ancestors:[f]}),o.jsx(L,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:T.meta.title})]},Z):""}}},d||r?null:{label:n("blocklet.publish.tenantScope"),name:"tenantScope",options:{customBodyRender:Z=>o.jsx(L,{ml:.5,sx:{ml:.5,color:"text.primary",fontSize:14},children:o.jsx(L1,{children:Z})})}},{label:n("common.updatedAt"),name:"updatedAt",options:{customBodyRender:Z=>o.jsx(L3,{value:Number(Z),locale:s})}},{label:n("common.actions"),name:"actions",options:{customBodyRenderLite:Z=>{const T=v[Z];return o.jsxs(L,{display:"flex",children:[o.jsx(C1,{to:`${T.id}/new-release/${T.lastReleaseId}`,children:o.jsx(g1,{title:n("blocklet.publish.createRelease"),placement:"top",children:o.jsx(m1,{color:"primary","aria-label":"create",children:o.jsx(_3,{style:{fontSize:18}})})})}),!!T.lastReleaseId&&o.jsx(g1,{title:n("blocklet.publish.viewLastRelease",{name:T.blockletTitle}),placement:"top",children:o.jsx(m1,{color:"secondary","aria-label":"create",children:o.jsx(C1,{style:{display:"flex"},to:`${T.id}/view/${T.lastReleaseId}`,children:o.jsx(B3,{sx:{fontSize:18}})})})}),o.jsx(g1,{title:n("blocklet.publish.delete",{name:T.blockletTitle}),placement:"top",children:o.jsx(m1,{color:"primary","aria-label":"delete",onClick:()=>S(T),children:o.jsx(M3,{sx:{fontSize:18}})})})]})}}}].filter(Boolean),I=V?o.jsx(p4,{open:!0,popup:!0,onClose:k,action:"check-has-project-id",locale:s,checkFn:i.get,saveConnect:!1,forceConnected:!1,checkTimeout:5*60*1e3,onSuccess:F,onError:M,extraParams:{projectId:x.id,did:f.meta.did,name:x.blockletTitle},messages:{title:n("blocklet.publish.deleteProject.title",{name:x.blockletTitle}),scan:n("blocklet.publish.deleteProject.scan",{name:x.blockletTitle}),confirm:n("blocklet.publish.deleteProject.confirm"),success:n("blocklet.publish.deleteProject.success")}}):null;return o.jsxs(B5,{children:[o.jsxs(L,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[o.jsxs(L,{display:"flex",flexDirection:"row",alignItems:"center",children:[o.jsx(L,{sx:{fontSize:"1.2rem",fontWeight:"bold"},children:n("common.blockletStudio")}),o.jsx(g1,{title:n("blocklet.publish.createBlockletTip"),arrow:!0,placement:"right",children:o.jsx(E3,{sx:{opacity:.6,fontSize:"1.1em",ml:1}})})]}),o.jsxs(o2,{onClick:R,variant:"contained",children:[o.jsx(v2,{style:{fontSize:"1.3em",marginRight:4}}),n("blocklet.publish.createBlocklet")]})]}),o.jsx(L,{mt:3}),o.jsx(V2,{className:"main-table",locale:s,data:v,columns:D,options:{sort:!1,download:!1,filter:!1,print:!1,search:!1}}),x&&o.jsx(w2,{title:`${n("common.delete")} ${x.blockletTitle}`,description:n("blocklet.publish.deleteProject.description"),confirm:n("common.confirm"),onConfirm:y,onCancel:()=>g(null),children:o.jsx(L,{sx:{marginTop:2},children:[n("blocklet.publish.deleteProject.tip1"),n("blocklet.publish.deleteProject.tip2"),n("blocklet.publish.deleteProject.tip3")].map(Z=>o.jsxs(L,{sx:{display:"flex",marginTop:1,flexDirection:"row",alignItems:"flex-start"},children:[o.jsx(M4,{color:"warning",sx:{marginRight:1,fontSize:20,marginTop:"2px"}}),o.jsx(G,{component:"span",variant:"inherit",color:"text.secondary",children:Z})]}))})}),I]})}I2.propTypes={initUrl:p.object};I2.defaultProps={initUrl:null};const B5=a1(L)`
|
|
3
3
|
.main-table > div:first-child {
|
|
4
4
|
display: none;
|
|
5
5
|
}
|
|
@@ -133,7 +133,7 @@ import{av as d4,j as o,aI as n1,cR as m3,aM as $,fH as J2,aL as b1,aG as F1,aH a
|
|
|
133
133
|
background: #fff;
|
|
134
134
|
z-index: 10;
|
|
135
135
|
}
|
|
136
|
-
`,C3="lastWantToConnectStoreId";function X8(e){var C,a;const[t,r]=j.useState(null),{session:n}=c2(),s=j.useCallback(f=>{r(f),localStorage.setItem(C3,f==null?void 0:f.id)},[r]),c=j.useMemo(()=>{var V,u,d,h;const f=localStorage.getItem(C3),x=f?(((V=e==null?void 0:e.settings)==null?void 0:V.storeList)||[]).find(v=>v.id===f):null;if(x)return x;let g=(((u=e==null?void 0:e.settings)==null?void 0:u.storeList)||[]).find(v=>{var w;return!(v.id!==X.BLOCKLET_STORE.id||v.scope&&v.scope!=="studio"&&v.scope!==((w=n==null?void 0:n.user)==null?void 0:w.did))});return g||(g=(h=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:h[0]),g},[(C=e==null?void 0:e.settings)==null?void 0:C.storeList,(a=n==null?void 0:n.user)==null?void 0:a.did]);return[t||c||{},s]}const p2={};async function G3(e,{interval:t=1e3,maxDuration:r=120*1e3,intervalFirst:n=4e3,timerKey:s=""}){p2[s]&&clearTimeout(p2[s]),await new Promise(C=>setTimeout(C,n));const c=Date.now(),i=async(C,a)=>{try{const f=await e();C(f)}catch(f){Date.now()-c>r?a(f):s?p2[s]=setTimeout(()=>i(C,a),t):setTimeout(()=>i(C,a),t)}};return new Promise(i)}function J8(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Q8(e,{did:t,projectId:r,messageId:n}){return G3(async()=>{var c;const s=await e.getProject({input:{did:t,projectId:r,messageId:n}});if(!((c=s==null?void 0:s.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function Y8(e,{did:t,projectId:r,storeId:n}){return G3(async()=>{var i,C;const s=await e.getProject({input:{did:t,projectId:r,messageId:""}});if(!((C=(i=s==null?void 0:s.project)==null?void 0:i.connectedStores)!=null&&C.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(a=>a.storeId===n))throw new Error("Connected store not found")},{timerKey:`connect-store-${n}`})}const K3=({fromBlocklet:e,nodeInfo:t,blocklet:r,userDid:n})=>{var i,C;const s=e?(i=r==null?void 0:r.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((C=r==null?void 0:r.settings)==null?void 0:C.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===n),{teamDid:s,storeList:c}};function A2({blocklet:e,store:t={},onChangeStore:r,onClick:n,disabled:s,loading:c,componentDid:i}){var T,P,_;const{t:C}=t1(),{session:a}=c2(),{api:f,info:x,inService:g}=j1(),V=P1(),[u,d]=j.useState(!1),h=j.useRef(null),[v,w]=j.useState(!1),[H,R]=j.useState(null),S=E=>{r(E),d(!1)},y=()=>{d(!u)},k=E=>{h.current&&h.current.contains(E.target)||d(!1)},M=()=>{w(!0)},F=()=>{w(!1)},D=async()=>{var E;if(H)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:H.url,projectId:"",scope:H.scope||"studio"}}),await((E=V==null?void 0:V.actions)==null?void 0:E.refreshBlocklet())}catch(O){U.error(`Remove Blocklet Store Error: ${I1(O)}`)}finally{R(null)}},{storeList:I}=K3({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(T=a==null?void 0:a.user)==null?void 0:T.did}),Z=(P=e==null?void 0:e.meta)==null?void 0:P.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h2,{disabled:s,ref:h,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(r1,{onClick:n,children:[c&&o.jsx(l2,{size:14,sx:{mr:.5}}),`${C("common.connect")} ${t.name||""}`]}),o.jsx(r1,{size:"small","aria-controls":u?"split-button-menu":void 0,"aria-expanded":u?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:o.jsx(G4,{})})]}),o.jsx(v3,{sx:{zIndex:10},open:u,anchorEl:h.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:E})=>o.jsx(V3,{...E,style:{transformOrigin:"center top"},children:o.jsx(j2,{children:o.jsx(w3,{onClickAway:k,children:o.jsxs(H3,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(O=>{var z;return o.jsxs(O1,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>S(O),children:[o.jsxs(L,{children:[o.jsx(L1,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(L1,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U4({store:O,userDid:(z=a==null?void 0:a.user)==null?void 0:z.did})&&o.jsx(m1,{sx:{ml:1},onClick:K=>{K.preventDefault(),K.stopPropagation(),R(O)},children:o.jsx(i1,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(j4,{}),o.jsxs(O1,{onClick:M,children:[o.jsx(v2,{font:!0}),o.jsx(G,{variant:"inherit",children:C("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&o.jsx(P3,{hiddenChildren:!0,open:!0,onClose:F,teamDid:Z,storeList:I,scope:"studio",onAdd:(_=V==null?void 0:V.actions)==null?void 0:_.refreshBlocklet}),H&&o.jsx(w2,{displayError:!0,title:`${C("common.delete")} ${H.name}`,description:C("blocklet.publish.deleteStoreTip",{name:H.name}),confirm:C("common.confirm"),onConfirm:D,onCancel:()=>R(null)})]})}A2.propTypes={store:p.object,blocklet:p.object,onChangeStore:p.func.isRequired,onClick:p.func.isRequired,loading:p.bool.isRequired,disabled:p.bool.isRequired,componentDid:p.string.isRequired,projectType:p.string.isRequired,getData:p.func.isRequired};A2.defaultProps={store:null,blocklet:null};const u3=j.lazy(()=>R3(()=>import("./index-Dt7ERxZ3.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,58])).then(e=>({default:e.Uploader})));function X3({projectId:e,readOnly:t,loading:r,blocklet:n,params:s,setParams:c,paramsErrTip:i,setParamsErrTip:C,setLoading:a,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:V}){const{t:u}=t1(),{api:d}=j1(),h=L2(),v=j.useRef(null),w=j.useRef(null),[H,R]=X8(n),S=q4({messageType:"connect-store-message",onOpen:()=>a(!0),onClose:()=>a(!1)}),y=async P=>{const _=setTimeout(()=>{a(!1)},2e4),E=await Q8(d,P);a(!1),clearTimeout(_),window.parent.postMessage({event:"studioDialog.connected",componentDid:V},"*"),h(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${E}/create`),{replace:!0})},k=()=>{if(!s.blockletTitle){U.error(u("blocklet.publish.errorTip.noTitle"));return}if(!(H!=null&&H.url)){U.error(u("blocklet.publish.noStoreSelected"));return}const P=J8();S(async(_,E)=>{var O,z,K;try{const J=await d.connectByStudio({input:{did:(O=n==null?void 0:n.meta)==null?void 0:O.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:H.url,storeId:H.id,storeName:H.name,type:((z=s==null?void 0:s.blockletComponents)==null?void 0:z.length)>0?"pack":"resource",componentDid:V,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(J!=null&&J.url)){U.error("failed to connect to store");return}E(J.url),y({did:(K=n==null?void 0:n.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(J){const s1=I1(J);U.error(s1),a(!1)}})},M=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/logo/upload`,F=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/screenshot/upload`,D=s!=null&&s.blockletLogo?`${M}/${s.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(P=>`${F}/${P}`),Z=()=>t?!1:!e||e===X.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,T=P=>{if(!P.destination)return;const _=Array.from(s.blockletScreenshots),[E]=_.splice(P.source.index,1);_.splice(P.destination.index,0,E),c(O=>({...O,blockletScreenshots:_}))};return o.jsxs(e9,{children:[o.jsx(L,{display:"flex",className:"section",children:o.jsxs(L,{sx:{flex:1},children:[o.jsx(Z1,{disabled:r||t,label:`Blocklet ${u("common.title")}`,placeholder:`Blocklet ${u("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:P=>{C({blockletTitle:""}),c({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Z1,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(y2,{position:"end",children:o.jsx(A2,{blocklet:n,store:H,componentDid:V,onChangeStore:R,disabled:!s.blockletTitle||t||r,loading:r,onClick:k})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Z1,{disabled:r||t,label:`Blocklet ${u("common.description")}`,placeholder:`Blocklet ${u("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:P=>{C({blockletDescription:""}),c({blockletDescription:P.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(L,{sx:{flex:1},children:[o.jsxs(L,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(B1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.logo")}),o.jsxs(B1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),o.jsx(L,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(k3,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||D,onClick:()=>{var P;Z()&&((P=v.current)==null||P.open())}})})]}),o.jsxs(L,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(B1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.screenshot")}),o.jsxs(B1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(L,{sx:{border:"none"},variant:"outlined",size:"small",children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),o.jsx(k4,{onDragEnd:t?void 0:T,children:o.jsx(Z4,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(P,_)=>o.jsxs(L,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:_.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:_.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[I.map((E,O)=>o.jsx(I4,{draggableId:E,index:O,isDragDisabled:t,children:(z,K)=>o.jsxs(L,{ref:z.innerRef,...z.draggableProps,...z.dragHandleProps,className:"screenshot",sx:{transform:K.isDragging?"scale(1.05)":"none",boxShadow:K.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:E}),!t&&o.jsx(m1,{className:"action",onClick:()=>{c(J=>{const s1=[...J.blockletScreenshots];return s1.splice(O,1),{...J,blockletScreenshots:s1}})},children:o.jsx(A4,{})})]})},E)),P.placeholder,I.length<5&&o.jsx(L,{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 E;Z()&&((E=w.current)==null||E.open())},children:"+"})]})})})]})]})}),o.jsxs(j.Suspense,{fallback:o.jsx(W1,{}),children:[o.jsx(u3,{ref:v,popup:!0,onUploadFinish:P=>{var _;c({blockletLogo:P.data.filename}),g(""),(_=v.current)==null||_.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:M,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(u3,{ref:w,popup:!0,onUploadFinish:P=>{var _;c(E=>{var z;const O=E.blockletScreenshots||[];return O.push((z=P.data)==null?void 0:z.filename),{...E,blockletScreenshots:O}}),(_=w.current)==null||_.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:F,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-I.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")]})]})}X3.propTypes={projectId:p.string.isRequired,readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,loading:p.bool.isRequired,blocklet:p.object.isRequired,setLoading:p.func.isRequired,initUrl:p.object.isRequired,componentDid:p.isRequired,initLogoUrl:p.string.isRequired,setInitLogoUrl:p.func.isRequired};const e9=a1.div`
|
|
136
|
+
`,C3="lastWantToConnectStoreId";function X8(e){var C,a;const[t,r]=j.useState(null),{session:n}=c2(),s=j.useCallback(f=>{r(f),localStorage.setItem(C3,f==null?void 0:f.id)},[r]),c=j.useMemo(()=>{var V,u,d,h;const f=localStorage.getItem(C3),x=f?(((V=e==null?void 0:e.settings)==null?void 0:V.storeList)||[]).find(v=>v.id===f):null;if(x)return x;let g=(((u=e==null?void 0:e.settings)==null?void 0:u.storeList)||[]).find(v=>{var w;return!(v.id!==X.BLOCKLET_STORE.id||v.scope&&v.scope!=="studio"&&v.scope!==((w=n==null?void 0:n.user)==null?void 0:w.did))});return g||(g=(h=(d=e==null?void 0:e.settings)==null?void 0:d.storeList)==null?void 0:h[0]),g},[(C=e==null?void 0:e.settings)==null?void 0:C.storeList,(a=n==null?void 0:n.user)==null?void 0:a.did]);return[t||c||{},s]}const p2={};async function G3(e,{interval:t=1e3,maxDuration:r=120*1e3,intervalFirst:n=4e3,timerKey:s=""}){p2[s]&&clearTimeout(p2[s]),await new Promise(C=>setTimeout(C,n));const c=Date.now(),i=async(C,a)=>{try{const f=await e();C(f)}catch(f){Date.now()-c>r?a(f):s?p2[s]=setTimeout(()=>i(C,a),t):setTimeout(()=>i(C,a),t)}};return new Promise(i)}function J8(){return Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)+`${Date.now()}`.slice(-6)}function Q8(e,{did:t,projectId:r,messageId:n}){return G3(async()=>{var c;const s=await e.getProject({input:{did:t,projectId:r,messageId:n}});if(!((c=s==null?void 0:s.project)!=null&&c.blockletDid))throw new Error("Connected store not found");return s.project.blockletDid},{timerKey:"connect-studio"})}function Y8(e,{did:t,projectId:r,storeId:n}){return G3(async()=>{var i,C;const s=await e.getProject({input:{did:t,projectId:r,messageId:""}});if(!((C=(i=s==null?void 0:s.project)==null?void 0:i.connectedStores)!=null&&C.length))throw new Error("Connected store not found");if(!s.project.connectedStores.find(a=>a.storeId===n))throw new Error("Connected store not found")},{timerKey:`connect-store-${n}`})}const K3=({fromBlocklet:e,nodeInfo:t,blocklet:r,userDid:n})=>{var i,C;const s=e?(i=r==null?void 0:r.meta)==null?void 0:i.did:t==null?void 0:t.did;let c=e?((C=r==null?void 0:r.settings)==null?void 0:C.storeList)||[]:(t==null?void 0:t.blockletRegistryList)||[];return Array.isArray(c)||(c=[]),c=c.filter(a=>a.protected||!a.scope||a.scope==="studio"||a.scope===n),{teamDid:s,storeList:c}};function A2({blocklet:e,store:t={},onChangeStore:r,onClick:n,disabled:s,loading:c,componentDid:i}){var T,P,_;const{t:C}=t1(),{session:a}=c2(),{api:f,info:x,inService:g}=j1(),V=P1(),[u,d]=j.useState(!1),h=j.useRef(null),[v,w]=j.useState(!1),[H,R]=j.useState(null),S=E=>{r(E),d(!1)},y=()=>{d(!u)},k=E=>{h.current&&h.current.contains(E.target)||d(!1)},M=()=>{w(!0)},F=()=>{w(!1)},D=async()=>{var E;if(H)try{await f.deleteBlockletStore({input:{teamDid:e.meta.did,url:H.url,projectId:"",scope:H.scope||"studio"}}),await((E=V==null?void 0:V.actions)==null?void 0:E.refreshBlocklet())}catch(O){U.error(`Remove Blocklet Store Error: ${I1(O)}`)}finally{R(null)}},{storeList:I}=K3({fromBlocklet:g,blocklet:e,nodeInfo:x,componentDid:i,userDid:(T=a==null?void 0:a.user)==null?void 0:T.did}),Z=(P=e==null?void 0:e.meta)==null?void 0:P.did;return o.jsxs(o.Fragment,{children:[o.jsxs(h2,{disabled:s,ref:h,variant:"contained",color:"primary","aria-label":"Button group with connect store",children:[o.jsxs(r1,{onClick:n,children:[c&&o.jsx(l2,{size:14,sx:{mr:.5}}),`${C("common.connect")} ${t.name||""}`]}),o.jsx(r1,{size:"small","aria-controls":u?"split-button-menu":void 0,"aria-expanded":u?"true":void 0,"aria-label":"select merge strategy","aria-haspopup":"menu",onClick:y,children:o.jsx(G4,{})})]}),o.jsx(v3,{sx:{zIndex:10},open:u,anchorEl:h.current,placement:"bottom-end",role:void 0,transition:!0,disablePortal:!0,children:({TransitionProps:E})=>o.jsx(V3,{...E,style:{transformOrigin:"center top"},children:o.jsx(j2,{children:o.jsx(w3,{onClickAway:k,children:o.jsxs(H3,{id:"split-button-menu",autoFocusItem:!0,sx:{maxHeight:300,overflowY:"auto",zIndex:10},children:[I==null?void 0:I.map(O=>{var z;return o.jsxs(O1,{selected:O.id===(t==null?void 0:t.id),sx:{height:56},onClick:()=>S(O),children:[o.jsxs(L,{children:[o.jsx(L1,{sx:{fontSize:"16px"},maxLength:24,children:O.name}),o.jsx(L1,{sx:{fontSize:"13px",opacity:.6},maxLength:30,children:O.url})]}),U4({store:O,userDid:(z=a==null?void 0:a.user)==null?void 0:z.did})&&o.jsx(m1,{sx:{ml:1},onClick:K=>{K.preventDefault(),K.stopPropagation(),R(O)},children:o.jsx(i1,{icon:"ic:outline-delete"})})]},O.url)}),o.jsx(j4,{}),o.jsxs(O1,{onClick:M,children:[o.jsx(v2,{font:!0}),o.jsx(G,{variant:"inherit",children:C("store.blockletRegistry.addRegistry")})]})]})})})})}),v&&o.jsx(P3,{hiddenChildren:!0,open:!0,onClose:F,teamDid:Z,storeList:I,scope:"studio",onAdd:(_=V==null?void 0:V.actions)==null?void 0:_.refreshBlocklet}),H&&o.jsx(w2,{displayError:!0,title:`${C("common.delete")} ${H.name}`,description:C("blocklet.publish.deleteStoreTip",{name:H.name}),confirm:C("common.confirm"),onConfirm:D,onCancel:()=>R(null)})]})}A2.propTypes={store:p.object,blocklet:p.object,onChangeStore:p.func.isRequired,onClick:p.func.isRequired,loading:p.bool.isRequired,disabled:p.bool.isRequired,componentDid:p.string.isRequired,projectType:p.string.isRequired,getData:p.func.isRequired};A2.defaultProps={store:null,blocklet:null};const u3=j.lazy(()=>R3(()=>import("./index-BFcr9JDQ.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,58])).then(e=>({default:e.Uploader})));function X3({projectId:e,readOnly:t,loading:r,blocklet:n,params:s,setParams:c,paramsErrTip:i,setParamsErrTip:C,setLoading:a,initUrl:f,initLogoUrl:x,setInitLogoUrl:g,componentDid:V}){const{t:u}=t1(),{api:d}=j1(),h=L2(),v=j.useRef(null),w=j.useRef(null),[H,R]=X8(n),S=q4({messageType:"connect-store-message",onOpen:()=>a(!0),onClose:()=>a(!1)}),y=async P=>{const _=setTimeout(()=>{a(!1)},2e4),E=await Q8(d,P);a(!1),clearTimeout(_),window.parent.postMessage({event:"studioDialog.connected",componentDid:V},"*"),h(window.location.pathname.replace(`${X.UNOWNED_DID}/create`,`${E}/create`),{replace:!0})},k=()=>{if(!s.blockletTitle){U.error(u("blocklet.publish.errorTip.noTitle"));return}if(!(H!=null&&H.url)){U.error(u("blocklet.publish.noStoreSelected"));return}const P=J8();S(async(_,E)=>{var O,z,K;try{const J=await d.connectByStudio({input:{did:(O=n==null?void 0:n.meta)==null?void 0:O.did,blockletTitle:s==null?void 0:s.blockletTitle,storeUrl:H.url,storeId:H.id,storeName:H.name,type:((z=s==null?void 0:s.blockletComponents)==null?void 0:z.length)>0?"pack":"resource",componentDid:V,messageId:P,tenantScope:(f==null?void 0:f.searchParams.get("tenantScope"))||""}});if(!(J!=null&&J.url)){U.error("failed to connect to store");return}E(J.url),y({did:(K=n==null?void 0:n.meta)==null?void 0:K.did,projectId:"",messageId:P})}catch(J){const s1=I1(J);U.error(s1),a(!1)}})},M=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/logo/upload`,F=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${n.meta.did}/${e}/screenshot/upload`,D=s!=null&&s.blockletLogo?`${M}/${s.blockletLogo}`:`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`,I=((s==null?void 0:s.blockletScreenshots)||[]).filter(Boolean).map(P=>`${F}/${P}`),Z=()=>t?!1:!e||e===X.UNOWNED_DID?(U.error(u("blocklet.publish.errorTip.noFirstDid")),!1):!0,T=P=>{if(!P.destination)return;const _=Array.from(s.blockletScreenshots),[E]=_.splice(P.source.index,1);_.splice(P.destination.index,0,E),c(O=>({...O,blockletScreenshots:_}))};return o.jsxs(e9,{children:[o.jsx(L,{display:"flex",className:"section",children:o.jsxs(L,{sx:{flex:1},children:[o.jsx(Z1,{disabled:r||t,label:`Blocklet ${u("common.title")}`,placeholder:`Blocklet ${u("common.title")}`,InputProps:{"data-cy":"blocklet-title",readOnly:t},autoComplete:"off",variant:"outlined",fullWidth:!0,required:!0,value:s.blockletTitle||"",onChange:P=>{C({blockletTitle:""}),c({blockletTitle:P.target.value})},error:!!i.blockletTitle,helperText:i.blockletTitle||""}),o.jsx(Z1,{required:!0,label:"Blocklet DID",fullWidth:!0,readonly:!0,disabled:!0,autoComplete:"off",variant:"outlined",InputProps:{"data-cy":"export-blocklet-did",endAdornment:e===X.UNOWNED_DID&&o.jsx(y2,{position:"end",children:o.jsx(A2,{blocklet:n,store:H,componentDid:V,onChangeStore:R,disabled:!s.blockletTitle||t||r,loading:r,onClick:k})})},error:!!i.projectId,helperText:i.projectId||"",value:e===X.UNOWNED_DID?"":`did:abt:${e}`,sx:{mt:3}}),o.jsx(Z1,{disabled:r||t,label:`Blocklet ${u("common.description")}`,placeholder:`Blocklet ${u("common.description")}`,InputProps:{"data-cy":"blocklet-description",readOnly:t},required:!0,autoComplete:"off",variant:"outlined",fullWidth:!0,value:s.blockletDescription||"",onChange:P=>{C({blockletDescription:""}),c({blockletDescription:P.target.value})},error:!!i.blockletDescription,helperText:i.blockletDescription||"",sx:{mt:3}})]})}),o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(L,{sx:{flex:1},children:[o.jsxs(L,{display:"flex",flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(B1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.logo")}),o.jsxs(B1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"256x256"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"<500Kb"})]})})]})]}),o.jsx(L,{sx:{flex:1,cursor:t?"default":"pointer"},children:o.jsx(k3,{variant:"square",sx:{width:80,height:80},alt:"Blocklet Logo",src:x||D,onClick:()=>{var P;Z()&&((P=v.current)==null||P.open())}})})]}),o.jsxs(L,{display:"flex",mt:3,flexDirection:"row",flexWrap:"wrap",children:[o.jsxs(B1,{direction:"column",spacing:1,sx:{mr:2,width:"160px"},children:[o.jsx(G,{variant:"subtitle1",sx:{fontWeight:"bold"},children:u("common.screenshot")}),o.jsxs(B1,{direction:"column",alignItems:"flex-start",spacing:1,sx:{opacity:.8,fontSize:"12px"},children:[o.jsx(L,{sx:{border:"none"},variant:"outlined",size:"small",children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.ratio"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"16 / 9"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.count"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"1~5"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.size"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:"<5MB"})]})}),o.jsx(L,{children:o.jsxs(L,{component:"span",children:[o.jsxs(L,{component:"span",sx:{color:"#555"},children:[u("studio.order"),":"," "]}),o.jsx(L,{component:"span",sx:{color:"#007ec6"},children:u("studio.orderTip")})]})})]})]}),o.jsx(k4,{onDragEnd:t?void 0:T,children:o.jsx(Z4,{droppableId:"screenshots",direction:"horizontal",isDropDisabled:t,children:(P,_)=>o.jsxs(L,{display:"flex",alignItems:"center",sx:{flex:1,flexWrap:"wrap",minHeight:160,background:_.isDraggingOver?"#f5f5f5":"transparent",transition:"background-color 0.2s ease",border:_.isDraggingOver?"2px dashed #999":"none",borderRadius:"4px"},ref:P.innerRef,...P.droppableProps,children:[I.map((E,O)=>o.jsx(I4,{draggableId:E,index:O,isDragDisabled:t,children:(z,K)=>o.jsxs(L,{ref:z.innerRef,...z.draggableProps,...z.dragHandleProps,className:"screenshot",sx:{transform:K.isDragging?"scale(1.05)":"none",boxShadow:K.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:E}),!t&&o.jsx(m1,{className:"action",onClick:()=>{c(J=>{const s1=[...J.blockletScreenshots];return s1.splice(O,1),{...J,blockletScreenshots:s1}})},children:o.jsx(A4,{})})]})},E)),P.placeholder,I.length<5&&o.jsx(L,{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 E;Z()&&((E=w.current)==null||E.open())},children:"+"})]})})})]})]})}),o.jsxs(j.Suspense,{fallback:o.jsx(W1,{}),children:[o.jsx(u3,{ref:v,popup:!0,onUploadFinish:P=>{var _;c({blockletLogo:P.data.filename}),g(""),(_=v.current)==null||_.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:M,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(u3,{ref:w,popup:!0,onUploadFinish:P=>{var _;c(E=>{var z;const O=E.blockletScreenshots||[];return O.push((z=P.data)==null?void 0:z.filename),{...E,blockletScreenshots:O}}),(_=w.current)==null||_.close()},installerProps:{disabled:!0},plugins:["ImageEditor"],apiPathProps:{uploader:F,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileTypes:["image/*","application/svg+xml"],maxFileSize:1024*1024*5,maxNumberOfFiles:5-I.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")]})]})}X3.propTypes={projectId:p.string.isRequired,readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,loading:p.bool.isRequired,blocklet:p.object.isRequired,setLoading:p.func.isRequired,initUrl:p.object.isRequired,componentDid:p.isRequired,initLogoUrl:p.string.isRequired,setInitLogoUrl:p.func.isRequired};const e9=a1.div`
|
|
137
137
|
margin-top: 24px;
|
|
138
138
|
.screenshot {
|
|
139
139
|
margin-bottom: 16px;
|
|
@@ -178,7 +178,7 @@ import{av as d4,j as o,aI as n1,cR as m3,aM as $,fH as J2,aL as b1,aG as F1,aH a
|
|
|
178
178
|
padding-bottom: 12px;
|
|
179
179
|
border-bottom: ${({theme:e})=>`1px solid ${e.palette.divider}`};
|
|
180
180
|
}
|
|
181
|
-
`;function o4({text:e}){return e?o.jsx(J4,{wrapperElement:{"data-color-mode":"light"},source:Q4.sanitize(e),rehypePlugins:[[Y4,{target:"_blank"}]]}):o.jsx(H1,{Icon:G1})}o4.propTypes={text:p.string.isRequired};function l4({params:e,setParams:t,paramsErrTip:r,loading:n,setParamsErrTip:s,readOnly:c}){var x;const{t:i}=t1(),[C,a]=j.useState(c?"preview":"write"),f=(g,V)=>{a(V)};return o.jsxs(L,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(L,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(D4,{value:C,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t3,{value:"write",label:"Write"}),o.jsx(t3,{value:"preview",label:"Preview"})]})]}),o.jsx(L,{display:C==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Z1,{disabled:n||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(y2,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",w1.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{s({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,w1.PROJECT.MAX_INTRO_LENGTH)})},error:!!r.blockletIntroduction,helperText:r.blockletIntroduction||""})}),o.jsx(L,{display:C==="preview"?"block":"none",mt:3,children:o.jsx(o4,{text:e.blockletIntroduction||""})})]})}l4.propTypes={params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,readOnly:p.bool.isRequired,loading:p.bool.isRequired};var z2={},d9=y1;Object.defineProperty(z2,"__esModule",{value:!0});var r4=z2.default=void 0,C9=d9(R1()),f3=o;r4=z2.default=(0,C9.default)([(0,f3.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f3.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function W2({step:e,ok:t,active:r,error:n}){let s="grey.500",c=e+1;return t&&(c=o.jsx(e5,{sx:{fontSize:18,margin:0},color:"white"})),n||!t&&r>e?(s="error.main",c=o.jsx(r4,{sx:{fontSize:18,margin:0},color:"white"})):r>=e&&(s="primary.main"),o.jsx(L,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}W2.propTypes={step:p.number,ok:p.bool,active:p.number,error:p.string};W2.defaultProps={step:0,ok:!1,active:0,error:""};function n4({steps:e,activeStep:t,setActiveStep:r,hasSelectedResources:n,params:s,loading:c,paramsErrTip:i,viewMode:C,projectId:a}){const{t:f}=t1(),x=()=>{r(d=>d+1)},g=()=>{r(d=>d-1)},V=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):"",u=C||Q3({hasSelectedResources:n,params:s,projectId:a,t:f})===null;return o.jsxs(L,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(o5,{activeStep:t,orientation:"vertical",children:e.map((d,h)=>{const v={},w=c||!c9({hasSelectedResources:n,params:s,projectId:a,step:h,t:f}),H=c?"":V(h);return H&&(v.optional=o.jsx(G,{variant:"caption",color:"error",children:H}),v.error=!0),o.jsxs(l5,{children:[o.jsx(v5,{icon:o.jsx(W2,{error:H,active:u?99:t,step:h,ok:w}),sx:{cursor:"pointer",color:H?"error.main":"inherit"},disabled:!1,onClick:()=>r(h),...v,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:H||!w&&t>h?"error.main":"inherit",children:d.label})}),o.jsxs(M5,{children:[o.jsx(G,{fontSize:12,children:d.description}),!u&&o.jsx(L,{sx:{mb:2},children:o.jsxs("div",{children:[h<e.length-1&&o.jsx(r1,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:H||!w,children:f("common.continue")}),h>0&&o.jsx(r1,{disabled:h===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(j2,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}n4.propTypes={steps:p.array.isRequired,activeStep:p.number.isRequired,setActiveStep:p.func.isRequired,params:p.object.isRequired,viewMode:p.string.isRequired,loading:p.bool.isRequired,projectId:p.string.isRequired,hasSelectedResources:p.bool.isRequired,paramsErrTip:p.shape({projectId:p.string,blockletVersion:p.string,blockletTitle:p.string,blockletDescription:p.string,note:p.string,blockletResource:p.string}).isRequired};const u9=[".zip",".gz"],p9=1024*1024*100,f9=j.lazy(()=>R3(()=>import("./index-Dt7ERxZ3.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,58])).then(e=>({default:e.Uploader})));function G2({app:e,projectId:t,readOnly:r,params:n,setParams:s,setParamsErrTip:c,error:i}){const{t:C}=t1(),a=j.useRef(null),f=()=>r?!1:!t||t===X.UNOWNED_DID?(U.error(C("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(L,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:C("blocklet.publish.resourceUpload")}),o.jsxs(B1,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:r?"default":"pointer"},children:[!!n.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:n.uploadedResource}),!r&&o.jsx(r1,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=a.current)==null||g.open())},children:n.uploadedResource?C("common.change"):C("common.upload")})]}),o.jsx(j.Suspense,{fallback:o.jsx(W1,{}),children:o.jsx(f9,{ref:a,popup:!0,onUploadFinish:g=>{var V;s({uploadedResource:g.data.filename}),c({blockletResource:""}),(V=a.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:u9,maxFileSize:p9,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(L,{color:"error.main",mt:1,fontSize:14,children:i})]})}G2.propTypes={app:p.object.isRequired,projectId:p.string.isRequired,readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,error:p.string.isRequired,setParamsErrTip:p.func.isRequired};G2.defaultProps={};function n2({readOnly:e,params:t,setParams:r,paramsErrTip:n,setParamsErrTip:s,loading:c}){var C;const{t:i}=t1();return o.jsx(L,{display:"flex",mt:3,className:"section",children:o.jsxs(L,{sx:{flex:1},children:[o.jsx(Z1,{required:!0,disabled:c||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:a=>{s({blockletVersion:""}),r({blockletVersion:a.target.value})},error:!!n.blockletVersion,helperText:n.blockletVersion||""}),o.jsx(Z1,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(y2,{position:"end",children:[((C=t==null?void 0:t.note)==null?void 0:C.length)||0," / ",w1.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:a=>{s({note:""}),r({note:a.target.value.slice(0,w1.PROJECT.MAX_NOTE_LENGTH)})},error:!!n.note,helperText:n.note||"",sx:{mt:3}})]})})}n2.propTypes={readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,loading:p.bool.isRequired};n2.defaultProps={};function s4(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&s4(e[t]);return e}const h9=({tabs:e,blocklet:t,ancestors:r=[]})=>{const n=t.meta.did;e.push({label:o.jsxs(L,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(H2,{size:24,blocklet:t,ancestors:r}),o.jsx(L,{ml:"4px",className:"text",children:o.jsx(L,{children:t.meta.title})})]},n),value:n})},h3=(e,t)=>{const r=b2(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletResourceType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return r.blockletComponents?r.blockletComponents=r.blockletComponents.map(n=>({...n,included:!0})):r.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!1,required:!1})),r.resourceFromSelect=!r.uploadedResource,r},x9={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},x3={branding:0,introduction:1,resources:2,blocklets:3,version:4};function K2({initUrl:e,...t}){var X2;const{projectId:r,mode:n,releaseId:s,componentDid:c=""}=i2(),{t:i}=t1(),{blocklet:C}=P1(),[a,f]=S1({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",resourceFromSelect:!0}),[x,g]=S1({}),[V,u]=j.useState(!1),[d,h]=S1(null),{api:v}=j1(),w=z1(N=>N.breakpoints.down("md")),[H,R]=j.useState({}),[S,y]=j.useState(!1),k=j.useRef({}),[M,F]=S1({}),[D,I]=j.useState(""),[Z,T]=S1({}),P=e==null?void 0:e.searchParams.get("dependentComponentsMode"),_=P==="readonly",E=j.useMemo(()=>{const N={};return Object.keys(Z).forEach(B=>{const V1=Z[B];V1&&V1.forEach(a4=>{N[a4]=!0})}),N},[Z]),O=j.useCallback(N=>{_&&f({blockletComponents:[]}),T(N)},[_,T,f]),z=j.useCallback((...N)=>{F(...N),g({blockletResource:""})},[]),K=s==="none"?(a==null?void 0:a.lastReleaseId)||"":s,[J,s1]=j.useState(n==="new-release"?4:0);j.useEffect(()=>{r&&g({projectId:""})},[r,g]);const p1=j.useMemo(()=>{var N;return(a==null?void 0:a.blockletResourceType)==="resource"?"resource":(N=a==null?void 0:a.blockletComponents)!=null&&N.some(B=>B.included)||Object.keys(E).length||a!=null&&a.uploadedResource?"pack":"resource"},[a==null?void 0:a.blockletComponents,a==null?void 0:a.uploadedResource,E,a==null?void 0:a.blockletResourceType]),d1=[],o1=((C==null?void 0:C.children)||[]).filter(N=>{var B;return(B=N.meta.resource)==null?void 0:B.exportApi}).filter(N=>!c||N.meta.did===c);o1.forEach(N=>{h9({tabs:d1,blocklet:N,t:i,ancestors:[C]})});const[e1,c1]=j.useState((X2=d1[0])==null?void 0:X2.value),f1=!S&&(d==null?void 0:d.status)==="published",Q=f1,h1=w4(()=>{if(!e)return;I(e.searchParams.get("logo")),f(B=>{var V1;return{...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(V1=B==null?void 0:B.blockletComponents)!=null&&V1.length?B==null?void 0:B.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}});const N=e.searchParams.get("resources");try{const B=JSON.parse(N);R(B)}catch{}}),W=async()=>{if(K)try{const N=await v.getRelease({input:{did:C.meta.did,projectId:r,releaseId:K}});if(u(!1),!N.release){U.error("Release not found");return}N.release=s4(N.release),n!=="view"&&(N.release.note=""),f(B=>h3({...B,...N.release,blockletVersion:n==="create"||n==="new-release"?k1.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},C)),h(N.release)}catch(N){u(!1),U.error(I1(N))}},l1=async()=>{if(r===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!r){U.error(i("blocklet.publish.errorTip.noDid"));return}try{const B=(await v.getProject({input:{did:C.meta.did,projectId:r}})).project||{};B.blockletVersion?(n==="create"||n==="new-release")&&k1.valid(B.blockletVersion)&&(B.blockletVersion=k1.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const V1=h3(B,C);f(V1),B.lastReleaseId||h1()}catch(N){U.error(I1(N))}},A=j.useCallback(async()=>{u(!0);try{if(n==="view"){if(!K){U.error("Empty release id");return}await l1(),await W();return}await l1(),K&&(y(!0),await W())}finally{u(!1)}},[n,K]),K1=N=>{f({blockletComponents:N})},X1=N=>{f({blockletResourceType:N})};j.useEffect(()=>{A()},[A]),j.useEffect(()=>{r===X.UNOWNED_DID&&(n==="create"||n==="new-release")&&e&&h1()},[r,e,n,h1]);const D1=j.useMemo(()=>!!Object.keys(M).find(N=>!!M[N].length),[M]);if(!a&&V)return o.jsx(W1,{});if(!a)return null;const N1=o1.find(N=>N.meta.did===e1);if(o1.every(N=>N.status!=="running")&&(o1!=null&&o1.length))return o.jsx(H1,{children:i("blocklet.publish.allComponentsNotRunning")});const q=N=>{c1(N)},Y=e==null?void 0:e.searchParams.get("resourcesTitle"),_1=e==null?void 0:e.searchParams.get("componentsTitle"),M1=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Y||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:_1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],c4=M1[J]||M1[M1.length-1],v1=x9[J];return o.jsxs(g9,{...t,children:[o.jsx(t4,{blocklet:C,release:d,getData:A,getRelease:W,mode:n,params:a,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:f1,loading:V,setLoading:u,initLogoUrl:D,releaseId:K,projectId:r,projectType:p1,resourceComponents:o1,resourceComponentsMap:Z,resourceRelateComponents:E,resourceItem:N1,saveSelectedEventsRef:k,hasSelectedResources:D1,releaseUsedLast:S,setReleaseUsedLast:y,setRelease:h}),o.jsxs(L,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(L,{pt:3}),o.jsxs(L,{sx:{gap:3},display:"flex",flexDirection:w?"column":"row",children:[!w&&o.jsx(n4,{steps:M1,loading:V,viewMode:n==="view",params:a,hasSelectedResources:D1||a.uploadedResource,paramsErrTip:x,activeStep:J,setActiveStep:s1,projectId:r,resourcesUrlTitle:Y,componentsUrlTitle:_1}),o.jsxs(L,{flex:"1",maxWidth:"720px",children:[!w&&v1!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[c4.label,v1==="branding"&&o.jsx(g1,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(L,{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(T4,{})})})]}),(w||v1==="branding")&&o.jsx(L,{flexDirection:"column",children:o.jsx(X3,{projectId:r,setParams:f,setParamsErrTip:g,params:a,componentDid:c,blocklet:C,initUrl:e,loading:V,setLoading:u,paramsErrTip:x,readOnly:Q,initLogoUrl:D,setInitLogoUrl:I})}),w&&o.jsx(L,{flexDirection:"column",children:o.jsx(n2,{loading:V,params:a,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(w||v1==="introduction")&&o.jsx(L,{display:"flex",flexDirection:"column",sx:{mt:w?5:0,width:"100%"},children:o.jsx(l4,{loading:V,readOnly:Q,params:a,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),w&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:M1[x3.resources].label}),o.jsx(L,{display:w||v1==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(L,{sx:{flex:1},children:[o.jsxs(r5,{onChange:()=>f({resourceFromSelect:!a.resourceFromSelect}),children:[o.jsx(f2,{value:"select",disabled:Q,control:o.jsx(l3,{size:"small",checked:a.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f2,{value:"select",disabled:Q,control:o.jsx(l3,{size:"small",checked:!a.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),a.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(N4,{tabs:d1,current:e1,onChange:q,sx:{ml:-2,mt:2,maxWidth:w?window.innerWidth-24:"100%"}}),o.jsx(F2,{loading:V,initialResources:H,saveSelectedEventsRef:k,selectedResourceIds:M,setSelectedResourceIds:z,setResourceComponentsMap:O,error:x.blockletResource,app:C,readOnly:Q,component:N1,componentDid:c,initUrl:e,params:a,setParams:f,projectId:r===X.UNOWNED_DID?"":r,releaseUsedLast:S,release:{...d,id:K}})]}),!a.resourceFromSelect&&o.jsx(G2,{app:C,readOnly:Q,projectId:r===X.UNOWNED_DID?"":r,params:a,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),w&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:M1[x3.blocklets].label}),(w||v1==="blocklets")&&o.jsx(L,{flexDirection:"column",children:o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsx(L,{sx:{flex:1},children:o.jsx(D2,{projectType:p1,disabled:V||Q,app:C,value:(a==null?void 0:a.blockletComponents)||[],blockletResourceType:(a==null?void 0:a.blockletResourceType)||"",onChange:K1,onChangeBlockletResourceType:X1,resourceRelateComponents:E,dependentComponentsMode:P})})})}),!w&&v1==="version"&&o.jsx(L,{flexDirection:"column",children:o.jsx(n2,{loading:V,params:a,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}K2.propTypes={initUrl:p.object};K2.defaultProps={initUrl:null};const g9=a1.div`
|
|
181
|
+
`;function o4({text:e}){return e?o.jsx(J4,{wrapperElement:{"data-color-mode":"light"},source:Q4.sanitize(e),rehypePlugins:[[Y4,{target:"_blank"}]]}):o.jsx(H1,{Icon:G1})}o4.propTypes={text:p.string.isRequired};function l4({params:e,setParams:t,paramsErrTip:r,loading:n,setParamsErrTip:s,readOnly:c}){var x;const{t:i}=t1(),[C,a]=j.useState(c?"preview":"write"),f=(g,V)=>{a(V)};return o.jsxs(L,{sx:{border:"1px solid #fff",width:"100%",borderRadius:2},children:[o.jsxs(L,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[o.jsx(G,{variant:"h6",fontWeight:"bold",sx:{},children:i("common.introduction")}),o.jsxs(D4,{value:C,onChange:f,"aria-label":"wrapped label tabs example",children:[o.jsx(t3,{value:"write",label:"Write"}),o.jsx(t3,{value:"preview",label:"Preview"})]})]}),o.jsx(L,{display:C==="write"?"block":"none",sx:{width:"100%",marginTop:3},children:o.jsx(Z1,{disabled:n||c,sx:{border:"none"},placeholder:`Blocklet ${i("common.introduction")}`,InputProps:{"data-cy":"export-blocklet-introduction",readOnly:c,endAdornment:o.jsxs(y2,{position:"end",children:[((x=e==null?void 0:e.blockletIntroduction)==null?void 0:x.length)||0," / ",w1.PROJECT.MAX_INTRO_LENGTH]})},autoComplete:"off",variant:"outlined",fullWidth:!0,multiline:!0,minRows:4,value:e.blockletIntroduction||"",onChange:g=>{s({blockletIntroduction:""}),t({blockletIntroduction:g.target.value.slice(0,w1.PROJECT.MAX_INTRO_LENGTH)})},error:!!r.blockletIntroduction,helperText:r.blockletIntroduction||""})}),o.jsx(L,{display:C==="preview"?"block":"none",mt:3,children:o.jsx(o4,{text:e.blockletIntroduction||""})})]})}l4.propTypes={params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,readOnly:p.bool.isRequired,loading:p.bool.isRequired};var z2={},d9=y1;Object.defineProperty(z2,"__esModule",{value:!0});var r4=z2.default=void 0,C9=d9(R1()),f3=o;r4=z2.default=(0,C9.default)([(0,f3.jsx)("circle",{cx:"12",cy:"19",r:"2"},"0"),(0,f3.jsx)("path",{d:"M10 3h4v12h-4z"},"1")],"PriorityHigh");function W2({step:e,ok:t,active:r,error:n}){let s="grey.500",c=e+1;return t&&(c=o.jsx(e5,{sx:{fontSize:18,margin:0},color:"white"})),n||!t&&r>e?(s="error.main",c=o.jsx(r4,{sx:{fontSize:18,margin:0},color:"white"})):r>=e&&(s="primary.main"),o.jsx(L,{width:24,height:24,bgcolor:s,borderRadius:"100%",color:"white",display:"flex",justifyContent:"center",fontWeight:"bold",fontSize:14,alignItems:"center",children:c})}W2.propTypes={step:p.number,ok:p.bool,active:p.number,error:p.string};W2.defaultProps={step:0,ok:!1,active:0,error:""};function n4({steps:e,activeStep:t,setActiveStep:r,hasSelectedResources:n,params:s,loading:c,paramsErrTip:i,viewMode:C,projectId:a}){const{t:f}=t1(),x=()=>{r(d=>d+1)},g=()=>{r(d=>d-1)},V=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):"",u=C||Q3({hasSelectedResources:n,params:s,projectId:a,t:f})===null;return o.jsxs(L,{sx:{width:300,maxWidth:300,minWidth:300,padding:2,border:"1px solid #ccc",borderRadius:2},children:[o.jsx(o5,{activeStep:t,orientation:"vertical",children:e.map((d,h)=>{const v={},w=c||!c9({hasSelectedResources:n,params:s,projectId:a,step:h,t:f}),H=c?"":V(h);return H&&(v.optional=o.jsx(G,{variant:"caption",color:"error",children:H}),v.error=!0),o.jsxs(l5,{children:[o.jsx(v5,{icon:o.jsx(W2,{error:H,active:u?99:t,step:h,ok:w}),sx:{cursor:"pointer",color:H?"error.main":"inherit"},disabled:!1,onClick:()=>r(h),...v,children:o.jsx(G,{fontSize:"14px",fontWeight:"500",color:H||!w&&t>h?"error.main":"inherit",children:d.label})}),o.jsxs(M5,{children:[o.jsx(G,{fontSize:12,children:d.description}),!u&&o.jsx(L,{sx:{mb:2},children:o.jsxs("div",{children:[h<e.length-1&&o.jsx(r1,{variant:"contained",onClick:x,sx:{mt:1,mr:1},disabled:H||!w,children:f("common.continue")}),h>0&&o.jsx(r1,{disabled:h===0,onClick:g,sx:{mt:1,mr:1},children:f("common.back")})]})})]})]},d.label)})}),t>=e.length-1&&o.jsx(j2,{square:!0,elevation:0,sx:{p:3},children:o.jsx(G,{fontSize:12,sx:{opacity:.5},children:"Click right top button to release"})})]})}n4.propTypes={steps:p.array.isRequired,activeStep:p.number.isRequired,setActiveStep:p.func.isRequired,params:p.object.isRequired,viewMode:p.string.isRequired,loading:p.bool.isRequired,projectId:p.string.isRequired,hasSelectedResources:p.bool.isRequired,paramsErrTip:p.shape({projectId:p.string,blockletVersion:p.string,blockletTitle:p.string,blockletDescription:p.string,note:p.string,blockletResource:p.string}).isRequired};const u9=[".zip",".gz"],p9=1024*1024*100,f9=j.lazy(()=>R3(()=>import("./index-BFcr9JDQ.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,58])).then(e=>({default:e.Uploader})));function G2({app:e,projectId:t,readOnly:r,params:n,setParams:s,setParamsErrTip:c,error:i}){const{t:C}=t1(),a=j.useRef(null),f=()=>r?!1:!t||t===X.UNOWNED_DID?(U.error(C("blocklet.publish.errorTip.noFirstDid")),!1):!0,x=`${X.WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${e.meta.did}/${t}/resource/upload`;return o.jsxs(L,{sx:{mt:3},children:[o.jsx(G,{gutterBottom:!0,children:C("blocklet.publish.resourceUpload")}),o.jsxs(B1,{direction:"row",alignItems:"center",spacing:1,sx:{flex:1,cursor:r?"default":"pointer"},children:[!!n.uploadedResource&&o.jsx(G,{component:"a",href:`${x}/params.uploadedResource`,children:n.uploadedResource}),!r&&o.jsx(r1,{variant:"outlined",size:"small",onClick:()=>{var g;f()&&((g=a.current)==null||g.open())},children:n.uploadedResource?C("common.change"):C("common.upload")})]}),o.jsx(j.Suspense,{fallback:o.jsx(W1,{}),children:o.jsx(f9,{ref:a,popup:!0,onUploadFinish:g=>{var V;s({uploadedResource:g.data.filename}),c({blockletResource:""}),(V=a.current)==null||V.close()},plugins:["ImageEditor"],installerProps:{disabled:!0},apiPathProps:{uploader:x,disableMediaKitPrefix:!0},coreProps:{restrictions:{allowedFileExts:u9,maxFileSize:p9,maxNumberOfFiles:1}}},"uploader-resource")}),!!i&&o.jsx(L,{color:"error.main",mt:1,fontSize:14,children:i})]})}G2.propTypes={app:p.object.isRequired,projectId:p.string.isRequired,readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,error:p.string.isRequired,setParamsErrTip:p.func.isRequired};G2.defaultProps={};function n2({readOnly:e,params:t,setParams:r,paramsErrTip:n,setParamsErrTip:s,loading:c}){var C;const{t:i}=t1();return o.jsx(L,{display:"flex",mt:3,className:"section",children:o.jsxs(L,{sx:{flex:1},children:[o.jsx(Z1,{required:!0,disabled:c||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:a=>{s({blockletVersion:""}),r({blockletVersion:a.target.value})},error:!!n.blockletVersion,helperText:n.blockletVersion||""}),o.jsx(Z1,{label:i("blocklet.publish.releaseNote"),autoComplete:"off",disabled:c||e,variant:"outlined",InputProps:{"data-cy":"release-note",readOnly:e,endAdornment:o.jsxs(y2,{position:"end",children:[((C=t==null?void 0:t.note)==null?void 0:C.length)||0," / ",w1.PROJECT.MAX_NOTE_LENGTH]})},fullWidth:!0,multiline:!0,minRows:4,required:!0,value:t.note||"",onChange:a=>{s({note:""}),r({note:a.target.value.slice(0,w1.PROJECT.MAX_NOTE_LENGTH)})},error:!!n.note,helperText:n.note||"",sx:{mt:3}})]})})}n2.propTypes={readOnly:p.bool.isRequired,params:p.object.isRequired,setParams:p.func.isRequired,paramsErrTip:p.object.isRequired,setParamsErrTip:p.func.isRequired,loading:p.bool.isRequired};n2.defaultProps={};function s4(e){for(const t in e)typeof e[t]=="string"?e[t]=e[t].replace(/\\\\/g,"\\"):typeof e[t]=="object"&&e[t]!==null&&s4(e[t]);return e}const h9=({tabs:e,blocklet:t,ancestors:r=[]})=>{const n=t.meta.did;e.push({label:o.jsxs(L,{display:"flex",alignItems:"center",justifyContent:"flex-start",children:[o.jsx(H2,{size:24,blocklet:t,ancestors:r}),o.jsx(L,{ml:"4px",className:"text",children:o.jsx(L,{children:t.meta.title})})]},n),value:n})},h3=(e,t)=>{const r=b2(e,["blockletVersion","blockletTitle","blockletDescription","blockletLogo","blockletIntroduction","blockletScreenshots","blockletResourceType","connectedStores","blockletComponents","lastReleaseId","uploadedResource","autoUpload","possibleSameStore","note"]);return r.blockletComponents?r.blockletComponents=r.blockletComponents.map(n=>({...n,included:!0})):r.blockletComponents=(t.children||[]).map(n=>({did:n.meta.did,included:!1,required:!1})),r.resourceFromSelect=!r.uploadedResource,r},x9={0:"branding",1:"introduction",2:"resources",3:"blocklets",4:"version"},x3={branding:0,introduction:1,resources:2,blocklets:3,version:4};function K2({initUrl:e,...t}){var X2;const{projectId:r,mode:n,releaseId:s,componentDid:c=""}=i2(),{t:i}=t1(),{blocklet:C}=P1(),[a,f]=S1({blockletScreenshots:[],publishedStoreIds:[],connectedStores:[],uploadedResource:"",blockletResourceType:"",resourceFromSelect:!0}),[x,g]=S1({}),[V,u]=j.useState(!1),[d,h]=S1(null),{api:v}=j1(),w=z1(N=>N.breakpoints.down("md")),[H,R]=j.useState({}),[S,y]=j.useState(!1),k=j.useRef({}),[M,F]=S1({}),[D,I]=j.useState(""),[Z,T]=S1({}),P=e==null?void 0:e.searchParams.get("dependentComponentsMode"),_=P==="readonly",E=j.useMemo(()=>{const N={};return Object.keys(Z).forEach(B=>{const V1=Z[B];V1&&V1.forEach(a4=>{N[a4]=!0})}),N},[Z]),O=j.useCallback(N=>{_&&f({blockletComponents:[]}),T(N)},[_,T,f]),z=j.useCallback((...N)=>{F(...N),g({blockletResource:""})},[]),K=s==="none"?(a==null?void 0:a.lastReleaseId)||"":s,[J,s1]=j.useState(n==="new-release"?4:0);j.useEffect(()=>{r&&g({projectId:""})},[r,g]);const p1=j.useMemo(()=>{var N;return(a==null?void 0:a.blockletResourceType)==="resource"?"resource":(N=a==null?void 0:a.blockletComponents)!=null&&N.some(B=>B.included)||Object.keys(E).length||a!=null&&a.uploadedResource?"pack":"resource"},[a==null?void 0:a.blockletComponents,a==null?void 0:a.uploadedResource,E,a==null?void 0:a.blockletResourceType]),d1=[],o1=((C==null?void 0:C.children)||[]).filter(N=>{var B;return(B=N.meta.resource)==null?void 0:B.exportApi}).filter(N=>!c||N.meta.did===c);o1.forEach(N=>{h9({tabs:d1,blocklet:N,t:i,ancestors:[C]})});const[e1,c1]=j.useState((X2=d1[0])==null?void 0:X2.value),f1=!S&&(d==null?void 0:d.status)==="published",Q=f1,h1=w4(()=>{if(!e)return;I(e.searchParams.get("logo")),f(B=>{var V1;return{...B,blockletTitle:(B==null?void 0:B.blockletTitle)||e.searchParams.get("title"),blockletDescription:(B==null?void 0:B.blockletDescription)||e.searchParams.get("description"),blockletIntroduction:(B==null?void 0:B.blockletIntroduction)||e.searchParams.get("introduction")||e.searchParams.get("description"),blockletComponents:(V1=B==null?void 0:B.blockletComponents)!=null&&V1.length?B==null?void 0:B.blockletComponents:JSON.parse(e.searchParams.get("components")||"[]"),note:(B==null?void 0:B.note)||e.searchParams.get("note")||"No note"}});const N=e.searchParams.get("resources");try{const B=JSON.parse(N);R(B)}catch{}}),W=async()=>{if(K)try{const N=await v.getRelease({input:{did:C.meta.did,projectId:r,releaseId:K}});if(u(!1),!N.release){U.error("Release not found");return}N.release=s4(N.release),n!=="view"&&(N.release.note=""),f(B=>h3({...B,...N.release,blockletVersion:n==="create"||n==="new-release"?k1.inc(N.release.blockletVersion,"patch"):N.release.blockletVersion},C)),h(N.release)}catch(N){u(!1),U.error(I1(N))}},l1=async()=>{if(r===X.UNOWNED_DID){f({blockletVersion:"1.0.0",blockletTitle:""});return}if(!r){U.error(i("blocklet.publish.errorTip.noDid"));return}try{const B=(await v.getProject({input:{did:C.meta.did,projectId:r}})).project||{};B.blockletVersion?(n==="create"||n==="new-release")&&k1.valid(B.blockletVersion)&&(B.blockletVersion=k1.inc(B.blockletVersion,"patch")):B.blockletVersion="1.0.0";const V1=h3(B,C);f(V1),B.lastReleaseId||h1()}catch(N){U.error(I1(N))}},A=j.useCallback(async()=>{u(!0);try{if(n==="view"){if(!K){U.error("Empty release id");return}await l1(),await W();return}await l1(),K&&(y(!0),await W())}finally{u(!1)}},[n,K]),K1=N=>{f({blockletComponents:N})},X1=N=>{f({blockletResourceType:N})};j.useEffect(()=>{A()},[A]),j.useEffect(()=>{r===X.UNOWNED_DID&&(n==="create"||n==="new-release")&&e&&h1()},[r,e,n,h1]);const D1=j.useMemo(()=>!!Object.keys(M).find(N=>!!M[N].length),[M]);if(!a&&V)return o.jsx(W1,{});if(!a)return null;const N1=o1.find(N=>N.meta.did===e1);if(o1.every(N=>N.status!=="running")&&(o1!=null&&o1.length))return o.jsx(H1,{children:i("blocklet.publish.allComponentsNotRunning")});const q=N=>{c1(N)},Y=e==null?void 0:e.searchParams.get("resourcesTitle"),_1=e==null?void 0:e.searchParams.get("componentsTitle"),M1=[{label:i("blocklet.publish.branding"),description:i("blocklet.publish.steps.branding")},{label:i("common.introduction"),description:i("blocklet.publish.steps.introduction")},{label:Y||i("blocklet.publish.resourceTitle"),description:i("blocklet.publish.steps.resources")},{label:_1||i("common.components"),description:i("blocklet.publish.steps.blocklets")},{label:i("blocklet.publish.versionTitle"),description:i("blocklet.publish.steps.version")}],c4=M1[J]||M1[M1.length-1],v1=x9[J];return o.jsxs(g9,{...t,children:[o.jsx(t4,{blocklet:C,release:d,getData:A,getRelease:W,mode:n,params:a,setParams:f,setParamsErrTip:g,readOnly:Q,isPublished:f1,loading:V,setLoading:u,initLogoUrl:D,releaseId:K,projectId:r,projectType:p1,resourceComponents:o1,resourceComponentsMap:Z,resourceRelateComponents:E,resourceItem:N1,saveSelectedEventsRef:k,hasSelectedResources:D1,releaseUsedLast:S,setReleaseUsedLast:y,setRelease:h}),o.jsxs(L,{display:"flex",flexDirection:"column",sx:{width:"100%"},children:[o.jsx(L,{pt:3}),o.jsxs(L,{sx:{gap:3},display:"flex",flexDirection:w?"column":"row",children:[!w&&o.jsx(n4,{steps:M1,loading:V,viewMode:n==="view",params:a,hasSelectedResources:D1||a.uploadedResource,paramsErrTip:x,activeStep:J,setActiveStep:s1,projectId:r,resourcesUrlTitle:Y,componentsUrlTitle:_1}),o.jsxs(L,{flex:"1",maxWidth:"720px",children:[!w&&v1!=="introduction"&&o.jsxs(G,{variant:"h6",fontWeight:"bold",display:"flex",flexDirection:"row",alignItems:"center",children:[c4.label,v1==="branding"&&o.jsx(g1,{title:i("blocklet.publish.brandingHelp"),placement:"right",children:o.jsx(L,{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(T4,{})})})]}),(w||v1==="branding")&&o.jsx(L,{flexDirection:"column",children:o.jsx(X3,{projectId:r,setParams:f,setParamsErrTip:g,params:a,componentDid:c,blocklet:C,initUrl:e,loading:V,setLoading:u,paramsErrTip:x,readOnly:Q,initLogoUrl:D,setInitLogoUrl:I})}),w&&o.jsx(L,{flexDirection:"column",children:o.jsx(n2,{loading:V,params:a,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})}),(w||v1==="introduction")&&o.jsx(L,{display:"flex",flexDirection:"column",sx:{mt:w?5:0,width:"100%"},children:o.jsx(l4,{loading:V,readOnly:Q,params:a,setParams:f,paramsErrTip:x,setParamsErrTip:g})}),w&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:M1[x3.resources].label}),o.jsx(L,{display:w||v1==="resources"?"flex":"none",sx:{maxWidth:720},flexDirection:"column",children:o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsxs(L,{sx:{flex:1},children:[o.jsxs(r5,{onChange:()=>f({resourceFromSelect:!a.resourceFromSelect}),children:[o.jsx(f2,{value:"select",disabled:Q,control:o.jsx(l3,{size:"small",checked:a.resourceFromSelect}),label:i("blocklet.publish.resourceSelect")}),o.jsx(f2,{value:"select",disabled:Q,control:o.jsx(l3,{size:"small",checked:!a.resourceFromSelect}),label:i("blocklet.publish.resourceUpload")})]}),a.resourceFromSelect&&o.jsxs(o.Fragment,{children:[!c&&o.jsx(N4,{tabs:d1,current:e1,onChange:q,sx:{ml:-2,mt:2,maxWidth:w?window.innerWidth-24:"100%"}}),o.jsx(F2,{loading:V,initialResources:H,saveSelectedEventsRef:k,selectedResourceIds:M,setSelectedResourceIds:z,setResourceComponentsMap:O,error:x.blockletResource,app:C,readOnly:Q,component:N1,componentDid:c,initUrl:e,params:a,setParams:f,projectId:r===X.UNOWNED_DID?"":r,releaseUsedLast:S,release:{...d,id:K}})]}),!a.resourceFromSelect&&o.jsx(G2,{app:C,readOnly:Q,projectId:r===X.UNOWNED_DID?"":r,params:a,error:x.blockletResource,setParams:f,setParamsErrTip:g})]})})}),w&&o.jsx(G,{variant:"h6",fontWeight:"bold",mt:5,children:M1[x3.blocklets].label}),(w||v1==="blocklets")&&o.jsx(L,{flexDirection:"column",children:o.jsx(L,{display:"flex",mt:3,className:"section full-width",children:o.jsx(L,{sx:{flex:1},children:o.jsx(D2,{projectType:p1,disabled:V||Q,app:C,value:(a==null?void 0:a.blockletComponents)||[],blockletResourceType:(a==null?void 0:a.blockletResourceType)||"",onChange:K1,onChangeBlockletResourceType:X1,resourceRelateComponents:E,dependentComponentsMode:P})})})}),!w&&v1==="version"&&o.jsx(L,{flexDirection:"column",children:o.jsx(n2,{loading:V,params:a,paramsErrTip:x,setParams:f,setParamsErrTip:g,readOnly:Q})})]})]})]})]})}K2.propTypes={initUrl:p.object};K2.defaultProps={initUrl:null};const g9=a1.div`
|
|
182
182
|
.section {
|
|
183
183
|
&.full-width {
|
|
184
184
|
max-width: 100%;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as h,a2 as g,b4 as y,j as t,C as P,n as v,B as c,a3 as d,P as m,a0 as w}from"./index-jHlcxkEo.js";import{P as T,S as u}from"./step-actions-DQ0D400i.js";import{u as B}from"./config-space-Bwfds2x7.js";import{C as E,D as b,a as D}from"./connect-to-v0E4vbkK.js";import{S as N}from"./layout-luBpKsnB.js";import"./ArrowBackIos-BubgDQVS.js";import"./index-U-Ouf6WM.js";import"./api-X6cMA7j1.js";import"./index-OU0ZpNT_.js";import"./OpenInNew-K-C4gsO1.js";import"./Stack-ID2bvJFU.js";import"./Link-BEFhKJq0.js";import"./Skeleton-Dq3yy5K4.js";import"./HelpOutline-DYeyCE3o.js";import"./index-CDzU6wY1.js";import"./ExpandMore-B8oaKzsK.js";import"./ButtonGroup-BWb37jJW.js";import"./DialogContentText-Dydxe3m7.js";import"./TextField-GO8E4D8x.js";import"./FormControl-DD67kWGJ.js";import"./useFormControl-CS6vjtl0.js";import"./Select-CDj8XFCr.js";import"./DeleteOutline-CzTPA4kL.js";import"./format-error-DsLT-I_t.js";import"./content-layout-BoriYFvl.js";function l({onNext:a,onPrevious:x}){var n,r,p;const{t:i}=h.useContext(g),{blocklet:e}=y(),{spaceGateway:C,settingStorageEndpoint:j,updateSpaceGateway:S,hasStorageEndpoint:f,loading:o,storageEndpoint:s}=B();return o?t.jsx(P,{relative:"parent",children:t.jsx(v,{})}):t.jsxs(G,{children:[t.jsx("div",{className:"header",children:t.jsx(T,{title:i("setup.didSpace.title"),subTitle:i("setup.didSpace.subTitle"),onClickBack:x})}),t.jsx(c,{sx:{width:"100%",maxWidth:"720px"},children:f?t.jsx(E,{spaceGateway:C,settingStorageEndpoint:j}):t.jsx(b,{})}),((n=e==null?void 0:e.capabilities)==null?void 0:n.didSpace)&&t.jsx(c,{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"24px",children:t.jsx(D,{onConnect:S,storageEndpoint:s})}),((r=e==null?void 0:e.capabilities)==null?void 0:r.didSpace)==="required"&&t.jsx(u,{mt:8,children:t.jsx(d,{loading:o,variant:"contained",disabled:o||!s,onClick:()=>a(),children:i("setup.continue")})}),((p=e==null?void 0:e.capabilities)==null?void 0:p.didSpace)==="optional"&&t.jsx(u,{blocklet:e,onStartNow:()=>a("complete"),children:t.jsx(d,{className:"start-now",loading:o,variant:"contained",disabled:o,onClick:()=>a(),children:i(s?"setup.continue":"setup.skip")})})]})}l.propTypes={onNext:m.func,onPrevious:m.func};l.defaultProps={onNext:()=>{},onPrevious:()=>{}};const G=w(N)`
|
|
2
|
+
height: 100%;
|
|
3
|
+
overflow-y: auto;
|
|
4
|
+
`;export{l as default};
|
|
@@ -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-B5-lwWQw.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};
|