@koishi-ce/plugin-config 1.1.5 → 1.1.6

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/dist/index.js CHANGED
@@ -2,4 +2,4 @@ import{Schema as e,ScopeStatus as t,Service as n,clone as r,extendLocales as i,i
2
2
  C312,10.8,322.7,0,336,0z M408,144c13.3,0,24,10.7,24,24s-10.7,24-24,24h-8v64c0,80.2-59.9,146.6-136,158.2V512h-48v-97.8
3
3
  c-77-11.6-136-78-136-158.2v-64h-8c-13.2,0-24-10.7-24-24s10.8-24,24-24H408z M240,368c61.9,0,112-50.1,112-112v-64H128v64
4
4
  C128,317.9,178.1,368,240,368z`},null,-1),b(`path`,{fill:`currentColor`,d:`M444,416h36c11,0,20,9,20,20s-9,20-20,20h-36v36c0,11-9,20-20,20c-11.9,0-20-9-20-20v-36h-36c-11.9,0-20-9-20-20
5
- s8.1-20,20-20h36v-36c0-11,8.1-20,20-20c11,0,20,9,20,20V416z`},null,-1)]])}var qe=$(We,[[`render`,Ke]]),Je={},Ye={class:`k-icon check`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function Xe(e,t){return A(),y(`svg`,Ye,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z`},null,-1)]])}var Ze=$(Je,[[`render`,Xe]]),Qe={},$e={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function et(e,t){return A(),y(`svg`,$e,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M64 464H288C296.8 464 304 456.8 304 448V384H352V448C352 483.3 323.3 512 288 512H64C28.65 512 0 483.3 0 448V224C0 188.7 28.65 160 64 160H128V208H64C55.16 208 48 215.2 48 224V448C48 456.8 55.16 464 64 464zM160 64C160 28.65 188.7 0 224 0H448C483.3 0 512 28.65 512 64V288C512 323.3 483.3 352 448 352H224C188.7 352 160 323.3 160 288V64zM224 304H448C456.8 304 464 296.8 464 288V64C464 55.16 456.8 48 448 48H224C215.2 48 208 55.16 208 64V288C208 296.8 215.2 304 224 304z`},null,-1)]])}var tt=$(Qe,[[`render`,et]]),nt={},rt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function it(e,t){return A(),y(`svg`,rt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M81.84 152.1C77.43 156.9 71.21 159.8 64.63 159.1C58.05 160.2 51.69 157.6 47.03 152.1L7.029 112.1C-2.343 103.6-2.343 88.4 7.029 79.03C16.4 69.66 31.6 69.66 40.97 79.03L63.08 101.1L118.2 39.94C127 30.09 142.2 29.29 152.1 38.16C161.9 47.03 162.7 62.2 153.8 72.06L81.84 152.1zM81.84 312.1C77.43 316.9 71.21 319.8 64.63 319.1C58.05 320.2 51.69 317.6 47.03 312.1L7.029 272.1C-2.343 263.6-2.343 248.4 7.029 239C16.4 229.7 31.6 229.7 40.97 239L63.08 261.1L118.2 199.9C127 190.1 142.2 189.3 152.1 198.2C161.9 207 162.7 222.2 153.8 232.1L81.84 312.1zM216 120C202.7 120 192 109.3 192 96C192 82.75 202.7 72 216 72H488C501.3 72 512 82.75 512 96C512 109.3 501.3 120 488 120H216zM192 256C192 242.7 202.7 232 216 232H488C501.3 232 512 242.7 512 256C512 269.3 501.3 280 488 280H216C202.7 280 192 269.3 192 256zM160 416C160 402.7 170.7 392 184 392H488C501.3 392 512 402.7 512 416C512 429.3 501.3 440 488 440H184C170.7 440 160 429.3 160 416zM64 448C46.33 448 32 433.7 32 416C32 398.3 46.33 384 64 384C81.67 384 96 398.3 96 416C96 433.7 81.67 448 64 448z`},null,-1)]])}var at=$(nt,[[`render`,it]]),ot={},st={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function ct(e,t){return A(),y(`svg`,st,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13V38.13zM48 432L336 256L48 80V432z`},null,-1)]])}var lt=$(ot,[[`render`,ct]]),ut={},dt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function ft(e,t){return A(),y(`svg`,dt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M168 255.1C168 207.4 207.4 167.1 256 167.1C304.6 167.1 344 207.4 344 255.1C344 304.6 304.6 344 256 344C207.4 344 168 304.6 168 255.1zM256 199.1C225.1 199.1 200 225.1 200 255.1C200 286.9 225.1 311.1 256 311.1C286.9 311.1 312 286.9 312 255.1C312 225.1 286.9 199.1 256 199.1zM65.67 230.6L25.34 193.8C14.22 183.7 11.66 167.2 19.18 154.2L49.42 101.8C56.94 88.78 72.51 82.75 86.84 87.32L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L194.5 25.16C197.7 10.47 210.7 0 225.8 0H286.2C301.3 0 314.3 10.47 317.5 25.16L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L425.2 87.32C439.5 82.75 455.1 88.78 462.6 101.8L492.8 154.2C500.3 167.2 497.8 183.7 486.7 193.8L446.3 230.6C447.4 238.9 448 247.4 448 255.1C448 264.6 447.4 273.1 446.3 281.4L486.7 318.2C497.8 328.3 500.3 344.8 492.8 357.8L462.6 410.2C455.1 423.2 439.5 429.2 425.2 424.7L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L317.5 486.8C314.3 501.5 301.3 512 286.2 512H225.8C210.7 512 197.7 501.5 194.5 486.8L182.8 433.6C167 427 152.2 418.4 138.8 408.1L86.84 424.7C72.51 429.2 56.94 423.2 49.42 410.2L19.18 357.8C11.66 344.8 14.22 328.3 25.34 318.2L65.67 281.4C64.57 273.1 64 264.6 64 255.1C64 247.4 64.57 238.9 65.67 230.6V230.6zM158.4 129.2L145.1 139.5L77.13 117.8L46.89 170.2L99.58 218.2L97.39 234.8C96.47 241.7 96 248.8 96 255.1C96 263.2 96.47 270.3 97.39 277.2L99.58 293.8L46.89 341.8L77.13 394.2L145.1 372.5L158.4 382.8C169.5 391.4 181.9 398.6 195 403.1L210.5 410.4L225.8 480H286.2L301.5 410.4L316.1 403.1C330.1 398.6 342.5 391.4 353.6 382.8L366.9 372.5L434.9 394.2L465.1 341.8L412.4 293.8L414.6 277.2C415.5 270.3 416 263.2 416 256C416 248.8 415.5 241.7 414.6 234.8L412.4 218.2L465.1 170.2L434.9 117.8L366.9 139.5L353.6 129.2C342.5 120.6 330.1 113.4 316.1 108L301.5 101.6L286.2 32H225.8L210.5 101.6L195 108C181.9 113.4 169.5 120.6 158.4 129.2H158.4z`},null,-1)]])}var pt=$(ut,[[`render`,ft]]),mt={},ht={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function gt(e,t){return A(),y(`svg`,ht,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z`},null,-1)]])}var _t=$(mt,[[`render`,gt]]),vt={},yt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function bt(e,t){return A(),y(`svg`,yt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M320 64H64c-35.35 0-64 28.65-64 64v255.1c0 35.35 28.65 64 64 64H320c35.35 0 64-28.65 64-64V128C384 92.65 355.3 64 320 64zM336 384c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16V128c0-8.822 7.178-16 16-16h256c8.822 0 16 7.178 16 16V384z`},null,-1)]])}var xt=$(vt,[[`render`,bt]]),St={},Ct={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function wt(e,t){return A(),y(`svg`,Ct,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M160 400C160 408.8 152.8 416 144 416C135.2 416 128 408.8 128 400V192C128 183.2 135.2 176 144 176C152.8 176 160 183.2 160 192V400zM240 400C240 408.8 232.8 416 224 416C215.2 416 208 408.8 208 400V192C208 183.2 215.2 176 224 176C232.8 176 240 183.2 240 192V400zM320 400C320 408.8 312.8 416 304 416C295.2 416 288 408.8 288 400V192C288 183.2 295.2 176 304 176C312.8 176 320 183.2 320 192V400zM317.5 24.94L354.2 80H424C437.3 80 448 90.75 448 104C448 117.3 437.3 128 424 128H416V432C416 476.2 380.2 512 336 512H112C67.82 512 32 476.2 32 432V128H24C10.75 128 0 117.3 0 104C0 90.75 10.75 80 24 80H93.82L130.5 24.94C140.9 9.357 158.4 0 177.1 0H270.9C289.6 0 307.1 9.358 317.5 24.94H317.5zM151.5 80H296.5L277.5 51.56C276 49.34 273.5 48 270.9 48H177.1C174.5 48 171.1 49.34 170.5 51.56L151.5 80zM80 432C80 449.7 94.33 464 112 464H336C353.7 464 368 449.7 368 432V128H80V432z`},null,-1)]])}var Tt=$(St,[[`render`,wt]]);a.register(`activity:plugin`,pt),a.register(`add-group`,Ue),a.register(`add-plugin`,qe),a.register(`trash-can`,Tt),a.register(`check`,Ze),a.register(`clone`,tt),a.register(`manage`,at),a.register(`play`,lt),a.register(`stop`,xt),a.register(`save`,_t);var Et=Object.assign({"./locales/de-DE.yml":U,"./locales/en-US.yml":ne,"./locales/fr-FR.yml":re,"./locales/ja-JP.yml":ie,"./locales/ru-RU.yml":ae,"./locales/zh-CN.yml":oe,"./locales/zh-TW.yml":se}),Dt=class extends n{constructor(e){super(e,`configWriter`,!0),i(e,Et),e.slot({type:`global`,component:C(()=>()=>w(F(`k-slot`),{name:`plugin-select`,single:!0}))}),e.slot({type:`plugin-select-base`,component:ze,order:-1e3}),e.slot({type:`plugin-select`,component:ze,order:-1e3}),e.slot({type:`global`,component:Ce}),e.page({id:`config`,path:`/plugins/:name*`,name:()=>e.$i18n.t(`config.title`),icon:`activity:plugin`,order:800,authority:4,fields:[`config`,`packages`,`services`],component:Fe}),e.menu(`config.tree`,[{id:`config.tree.toggle`,type:({config:e})=>e.tree?.disabled?``:ue.value??``,icon:({config:e})=>e.tree?.disabled?`play`:`stop`,label:({config:t})=>e.$i18n.t(t.tree?.disabled?t.tree?.name===`group`?`config.menu.enableGroup`:`config.menu.enablePlugin`:t.tree?.name===`group`?`config.menu.disableGroup`:`config.menu.disablePlugin`)},{id:`.save`,icon:({config:e})=>e.tree?.disabled?`save`:`check`,label:({config:t})=>e.$i18n.t(t.tree?.disabled?`config.menu.saveConfig`:`config.menu.reloadConfig`)},{id:`@separator`},{id:`.rename`,icon:`edit`,label:()=>e.$i18n.t(`config.menu.rename`)},{id:`.remove`,type:`danger`,icon:`delete`,label:({config:t})=>e.$i18n.t(t.tree?.children?`config.menu.removeGroup`:`config.menu.removePlugin`)},{id:`@separator`},{id:`.clone`,icon:`clone`,label:()=>e.$i18n.t(`config.menu.clone`)},{id:`.manage`,icon:`manage`,label:()=>e.$i18n.t(`config.menu.manage`)},{id:`.add-plugin`,icon:`add-plugin`,label:()=>e.$i18n.t(`config.menu.addPlugin`)},{id:`.add-group`,icon:`add-group`,label:()=>e.$i18n.t(`config.menu.addGroup`)}])}ensure(e,t){let n=e.replace(/(koishi-|^@koishijs\/)plugin-/,``),r=Q.value.forks[n];if(r?.length)r.length===1?t||c.push(`/plugins/${r[0]}`):t||(K.value=e);else{let e=Math.random().toString(36).slice(2,8);l(`manager/unload`,``,`${n}:${e}`,{}),t||c.push(`/plugins/${e}`)}}remove(e){let t=e.replace(/(koishi-|^@koishijs\/)plugin-/,``),n=Q.value.forks[t];for(let e of n??[]){let t=Q.value.paths[e];t&&l(`manager/remove`,t.parent?.path??``,t.id)}}get(e){let t=e.replace(/(koishi-|^@koishijs\/)plugin-/,``);return Q.value.forks[t]?.map(e=>Q.value.paths[e])}};export{W as coreDeps,J as current,Dt as default,K as dialogFork,q as dialogSelect,G as envMap,X as getFullName,fe as getStatus,Y as hasCoreDeps,Z as name,Q as plugins,pe as removeItem,ue as type};
5
+ s8.1-20,20-20h36v-36c0-11,8.1-20,20-20c11,0,20,9,20,20V416z`},null,-1)]])}var qe=$(We,[[`render`,Ke]]),Je={},Ye={class:`k-icon check`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function Xe(e,t){return A(),y(`svg`,Ye,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M438.6 105.4C451.1 117.9 451.1 138.1 438.6 150.6L182.6 406.6C170.1 419.1 149.9 419.1 137.4 406.6L9.372 278.6C-3.124 266.1-3.124 245.9 9.372 233.4C21.87 220.9 42.13 220.9 54.63 233.4L159.1 338.7L393.4 105.4C405.9 92.88 426.1 92.88 438.6 105.4H438.6z`},null,-1)]])}var Ze=$(Je,[[`render`,Xe]]),Qe={},$e={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function et(e,t){return A(),y(`svg`,$e,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M64 464H288C296.8 464 304 456.8 304 448V384H352V448C352 483.3 323.3 512 288 512H64C28.65 512 0 483.3 0 448V224C0 188.7 28.65 160 64 160H128V208H64C55.16 208 48 215.2 48 224V448C48 456.8 55.16 464 64 464zM160 64C160 28.65 188.7 0 224 0H448C483.3 0 512 28.65 512 64V288C512 323.3 483.3 352 448 352H224C188.7 352 160 323.3 160 288V64zM224 304H448C456.8 304 464 296.8 464 288V64C464 55.16 456.8 48 448 48H224C215.2 48 208 55.16 208 64V288C208 296.8 215.2 304 224 304z`},null,-1)]])}var tt=$(Qe,[[`render`,et]]),nt={},rt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function it(e,t){return A(),y(`svg`,rt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M81.84 152.1C77.43 156.9 71.21 159.8 64.63 159.1C58.05 160.2 51.69 157.6 47.03 152.1L7.029 112.1C-2.343 103.6-2.343 88.4 7.029 79.03C16.4 69.66 31.6 69.66 40.97 79.03L63.08 101.1L118.2 39.94C127 30.09 142.2 29.29 152.1 38.16C161.9 47.03 162.7 62.2 153.8 72.06L81.84 152.1zM81.84 312.1C77.43 316.9 71.21 319.8 64.63 319.1C58.05 320.2 51.69 317.6 47.03 312.1L7.029 272.1C-2.343 263.6-2.343 248.4 7.029 239C16.4 229.7 31.6 229.7 40.97 239L63.08 261.1L118.2 199.9C127 190.1 142.2 189.3 152.1 198.2C161.9 207 162.7 222.2 153.8 232.1L81.84 312.1zM216 120C202.7 120 192 109.3 192 96C192 82.75 202.7 72 216 72H488C501.3 72 512 82.75 512 96C512 109.3 501.3 120 488 120H216zM192 256C192 242.7 202.7 232 216 232H488C501.3 232 512 242.7 512 256C512 269.3 501.3 280 488 280H216C202.7 280 192 269.3 192 256zM160 416C160 402.7 170.7 392 184 392H488C501.3 392 512 402.7 512 416C512 429.3 501.3 440 488 440H184C170.7 440 160 429.3 160 416zM64 448C46.33 448 32 433.7 32 416C32 398.3 46.33 384 64 384C81.67 384 96 398.3 96 416C96 433.7 81.67 448 64 448z`},null,-1)]])}var at=$(nt,[[`render`,it]]),ot={},st={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function ct(e,t){return A(),y(`svg`,st,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M24.52 38.13C39.66 29.64 58.21 29.99 73.03 39.04L361 215C375.3 223.8 384 239.3 384 256C384 272.7 375.3 288.2 361 296.1L73.03 472.1C58.21 482 39.66 482.4 24.52 473.9C9.377 465.4 0 449.4 0 432V80C0 62.64 9.377 46.63 24.52 38.13V38.13zM48 432L336 256L48 80V432z`},null,-1)]])}var lt=$(ot,[[`render`,ct]]),ut={},dt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`};function ft(e,t){return A(),y(`svg`,dt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M168 255.1C168 207.4 207.4 167.1 256 167.1C304.6 167.1 344 207.4 344 255.1C344 304.6 304.6 344 256 344C207.4 344 168 304.6 168 255.1zM256 199.1C225.1 199.1 200 225.1 200 255.1C200 286.9 225.1 311.1 256 311.1C286.9 311.1 312 286.9 312 255.1C312 225.1 286.9 199.1 256 199.1zM65.67 230.6L25.34 193.8C14.22 183.7 11.66 167.2 19.18 154.2L49.42 101.8C56.94 88.78 72.51 82.75 86.84 87.32L138.8 103.9C152.2 93.56 167 84.96 182.8 78.43L194.5 25.16C197.7 10.47 210.7 0 225.8 0H286.2C301.3 0 314.3 10.47 317.5 25.16L329.2 78.43C344.1 84.96 359.8 93.56 373.2 103.9L425.2 87.32C439.5 82.75 455.1 88.78 462.6 101.8L492.8 154.2C500.3 167.2 497.8 183.7 486.7 193.8L446.3 230.6C447.4 238.9 448 247.4 448 255.1C448 264.6 447.4 273.1 446.3 281.4L486.7 318.2C497.8 328.3 500.3 344.8 492.8 357.8L462.6 410.2C455.1 423.2 439.5 429.2 425.2 424.7L373.2 408.1C359.8 418.4 344.1 427 329.2 433.6L317.5 486.8C314.3 501.5 301.3 512 286.2 512H225.8C210.7 512 197.7 501.5 194.5 486.8L182.8 433.6C167 427 152.2 418.4 138.8 408.1L86.84 424.7C72.51 429.2 56.94 423.2 49.42 410.2L19.18 357.8C11.66 344.8 14.22 328.3 25.34 318.2L65.67 281.4C64.57 273.1 64 264.6 64 255.1C64 247.4 64.57 238.9 65.67 230.6V230.6zM158.4 129.2L145.1 139.5L77.13 117.8L46.89 170.2L99.58 218.2L97.39 234.8C96.47 241.7 96 248.8 96 255.1C96 263.2 96.47 270.3 97.39 277.2L99.58 293.8L46.89 341.8L77.13 394.2L145.1 372.5L158.4 382.8C169.5 391.4 181.9 398.6 195 403.1L210.5 410.4L225.8 480H286.2L301.5 410.4L316.1 403.1C330.1 398.6 342.5 391.4 353.6 382.8L366.9 372.5L434.9 394.2L465.1 341.8L412.4 293.8L414.6 277.2C415.5 270.3 416 263.2 416 256C416 248.8 415.5 241.7 414.6 234.8L412.4 218.2L465.1 170.2L434.9 117.8L366.9 139.5L353.6 129.2C342.5 120.6 330.1 113.4 316.1 108L301.5 101.6L286.2 32H225.8L210.5 101.6L195 108C181.9 113.4 169.5 120.6 158.4 129.2H158.4z`},null,-1)]])}var pt=$(ut,[[`render`,ft]]),mt={},ht={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function gt(e,t){return A(),y(`svg`,ht,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M224 256c-35.2 0-64 28.8-64 64c0 35.2 28.8 64 64 64c35.2 0 64-28.8 64-64C288 284.8 259.2 256 224 256zM433.1 129.1l-83.9-83.9C341.1 37.06 328.8 32 316.1 32H64C28.65 32 0 60.65 0 96v320c0 35.35 28.65 64 64 64h320c35.35 0 64-28.65 64-64V163.9C448 151.2 442.9 138.9 433.1 129.1zM128 80h144V160H128V80zM400 416c0 8.836-7.164 16-16 16H64c-8.836 0-16-7.164-16-16V96c0-8.838 7.164-16 16-16h16v104c0 13.25 10.75 24 24 24h192C309.3 208 320 197.3 320 184V83.88l78.25 78.25C399.4 163.2 400 164.8 400 166.3V416z`},null,-1)]])}var _t=$(mt,[[`render`,gt]]),vt={},yt={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 384 512`};function bt(e,t){return A(),y(`svg`,yt,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M320 64H64c-35.35 0-64 28.65-64 64v255.1c0 35.35 28.65 64 64 64H320c35.35 0 64-28.65 64-64V128C384 92.65 355.3 64 320 64zM336 384c0 8.822-7.178 16-16 16H64c-8.822 0-16-7.178-16-16V128c0-8.822 7.178-16 16-16h256c8.822 0 16 7.178 16 16V384z`},null,-1)]])}var xt=$(vt,[[`render`,bt]]),St={},Ct={class:`k-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 448 512`};function wt(e,t){return A(),y(`svg`,Ct,[...t[0]||=[b(`path`,{fill:`currentColor`,d:`M160 400C160 408.8 152.8 416 144 416C135.2 416 128 408.8 128 400V192C128 183.2 135.2 176 144 176C152.8 176 160 183.2 160 192V400zM240 400C240 408.8 232.8 416 224 416C215.2 416 208 408.8 208 400V192C208 183.2 215.2 176 224 176C232.8 176 240 183.2 240 192V400zM320 400C320 408.8 312.8 416 304 416C295.2 416 288 408.8 288 400V192C288 183.2 295.2 176 304 176C312.8 176 320 183.2 320 192V400zM317.5 24.94L354.2 80H424C437.3 80 448 90.75 448 104C448 117.3 437.3 128 424 128H416V432C416 476.2 380.2 512 336 512H112C67.82 512 32 476.2 32 432V128H24C10.75 128 0 117.3 0 104C0 90.75 10.75 80 24 80H93.82L130.5 24.94C140.9 9.357 158.4 0 177.1 0H270.9C289.6 0 307.1 9.358 317.5 24.94H317.5zM151.5 80H296.5L277.5 51.56C276 49.34 273.5 48 270.9 48H177.1C174.5 48 171.1 49.34 170.5 51.56L151.5 80zM80 432C80 449.7 94.33 464 112 464H336C353.7 464 368 449.7 368 432V128H80V432z`},null,-1)]])}var Tt=$(St,[[`render`,wt]]);a.register(`activity:plugin`,pt),a.register(`add-group`,Ue),a.register(`add-plugin`,qe),a.register(`trash-can`,Tt),a.register(`check`,Ze),a.register(`clone`,tt),a.register(`manage`,at),a.register(`play`,lt),a.register(`stop`,xt),a.register(`save`,_t);var Et=Object.assign({"./locales/de-DE.yml":U,"./locales/en-US.yml":ne,"./locales/fr-FR.yml":re,"./locales/ja-JP.yml":ie,"./locales/ru-RU.yml":ae,"./locales/zh-CN.yml":oe,"./locales/zh-TW.yml":se});function Dt(e){return e.replace(/(koishi-|^@(?:koishijs|koishi-ce)\/)plugin-/,``)}function Ot(e){let t=Q.value.forks;return t[Dt(e)]??t[e]}var kt=class extends n{constructor(e){super(e,`configWriter`,!0),i(e,Et),e.slot({type:`global`,component:C(()=>()=>w(F(`k-slot`),{name:`plugin-select`,single:!0}))}),e.slot({type:`plugin-select-base`,component:ze,order:-1e3}),e.slot({type:`plugin-select`,component:ze,order:-1e3}),e.slot({type:`global`,component:Ce}),e.page({id:`config`,path:`/plugins/:name*`,name:()=>e.$i18n.t(`config.title`),icon:`activity:plugin`,order:800,authority:4,fields:[`config`,`packages`,`services`],component:Fe}),e.menu(`config.tree`,[{id:`config.tree.toggle`,type:({config:e})=>e.tree?.disabled?``:ue.value??``,icon:({config:e})=>e.tree?.disabled?`play`:`stop`,label:({config:t})=>e.$i18n.t(t.tree?.disabled?t.tree?.name===`group`?`config.menu.enableGroup`:`config.menu.enablePlugin`:t.tree?.name===`group`?`config.menu.disableGroup`:`config.menu.disablePlugin`)},{id:`.save`,icon:({config:e})=>e.tree?.disabled?`save`:`check`,label:({config:t})=>e.$i18n.t(t.tree?.disabled?`config.menu.saveConfig`:`config.menu.reloadConfig`)},{id:`@separator`},{id:`.rename`,icon:`edit`,label:()=>e.$i18n.t(`config.menu.rename`)},{id:`.remove`,type:`danger`,icon:`delete`,label:({config:t})=>e.$i18n.t(t.tree?.children?`config.menu.removeGroup`:`config.menu.removePlugin`)},{id:`@separator`},{id:`.clone`,icon:`clone`,label:()=>e.$i18n.t(`config.menu.clone`)},{id:`.manage`,icon:`manage`,label:()=>e.$i18n.t(`config.menu.manage`)},{id:`.add-plugin`,icon:`add-plugin`,label:()=>e.$i18n.t(`config.menu.addPlugin`)},{id:`.add-group`,icon:`add-group`,label:()=>e.$i18n.t(`config.menu.addGroup`)}])}ensure(e,t){let n=Ot(e);if(n?.length)n.length===1?t||c.push(`/plugins/${n[0]}`):t||(K.value=e);else{let n=Math.random().toString(36).slice(2,8);l(`manager/unload`,``,`${Dt(e)}:${n}`,{}),t||c.push(`/plugins/${n}`)}}remove(e){let t=Ot(e);for(let e of t??[]){let t=Q.value.paths[e];t&&l(`manager/remove`,t.parent?.path??``,t.id)}}get(e){return Ot(e)?.map(e=>Q.value.paths[e])}};export{W as coreDeps,J as current,kt as default,K as dialogFork,q as dialogSelect,G as envMap,X as getFullName,fe as getStatus,Y as hasCoreDeps,Z as name,Q as plugins,pe as removeItem,ue as type};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@koishi-ce/plugin-config",
3
3
  "description": "Manage your bots and plugins with console",
4
- "version": "1.1.5",
4
+ "version": "1.1.6",
5
5
  "type": "module",
6
6
  "main": "lib/index.mjs",
7
7
  "types": "lib/index.d.ts",
@@ -67,7 +67,7 @@
67
67
  "@koishi-ce/koishi": "^1.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@koishi-ce/client": "^1.3.0",
70
+ "@koishi-ce/client": "^1.3.2",
71
71
  "@koishi-ce/plugin-hmr": "^1.1.2",
72
72
  "element-plus": "^2.14.5",
73
73
  "vue": "^3.5.12",
@@ -37,7 +37,7 @@ describe("@koishi-ce/plugin-config", () => {
37
37
  it("收集本机包与 workspace 源码包并附全局设置条目", async () => {
38
38
  const provider = app.get(
39
39
  "console.services.packages",
40
- ) as unknown as {
40
+ ) as {
41
41
  get(): Promise<Dict<Record<string, unknown>>>;
42
42
  };
43
43
  const data = await provider.get();
@@ -58,7 +58,7 @@ describe("@koishi-ce/plugin-config", () => {
58
58
  it("扫描 external/ 约定目录收录未启用的 workspace 插件", async () => {
59
59
  const provider = app.get(
60
60
  "console.services.packages",
61
- ) as unknown as {
61
+ ) as {
62
62
  get(): Promise<Dict<Record<string, unknown>>>;
63
63
  pathKeys: Dict<string>;
64
64
  cache: Dict<Record<string, unknown>>;
@@ -87,7 +87,7 @@ describe("@koishi-ce/plugin-config", () => {
87
87
  it("workspaces 声明驱动收录嵌套 monorepo 子包与 plugins/ 未启用包", async () => {
88
88
  const provider = app.get(
89
89
  "console.services.packages",
90
- ) as unknown as {
90
+ ) as {
91
91
  get(): Promise<Dict<Record<string, unknown>>>;
92
92
  };
93
93
  const data = await provider.get();
@@ -170,7 +170,7 @@ describe("@koishi-ce/plugin-config", () => {
170
170
  expect(listener).toBeTruthy();
171
171
  const provider = app.get(
172
172
  "console.services.packages",
173
- ) as unknown as {
173
+ ) as {
174
174
  cache: Dict<{ failed?: boolean }>;
175
175
  pathKeys: Dict<string>;
176
176
  };
@@ -67,7 +67,7 @@ describe("@koishi-ce/plugin-config", () => {
67
67
  it("上报各服务的提供者上下文并在服务变动时刷新", async () => {
68
68
  const provider = app.get(
69
69
  "console.services.services",
70
- ) as unknown as {
70
+ ) as {
71
71
  get(): Promise<Dict<number>>;
72
72
  };
73
73
  const data = await provider.get();
@@ -90,7 +90,7 @@ describe("@koishi-ce/plugin-config", () => {
90
90
  it("provide() 注册的服务同样上报(loader / watcher 形态)", async () => {
91
91
  const provider = app.get(
92
92
  "console.services.services",
93
- ) as unknown as {
93
+ ) as {
94
94
  get(): Promise<Dict<number>>;
95
95
  };
96
96
  // cordis 3.18 的 ctx.provide() 不给值定义自有 "ctx" 属性