UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.62 kB
import{i as a}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{A as c}from"./index--XHV4ygU.js";import{a as u}from"./index-BsqYBobW.js";const{getPluginMetadataByKeyOrThrow:p,pluginEntityType:s}=await a("@baseplate-dev/project-builder-lib"),{useProjectDefinition:m}=await a("@baseplate-dev/project-builder-lib/web"),{Button:h,NavigationMenu:x,NavigationMenuItem:g,NavigationMenuLink:y,NavigationMenuList:j,SidebarLayout:b,SidebarLayoutContent:f,SidebarLayoutSidebar:v}=await a("@baseplate-dev/ui-components"),{notEmpty:w}=await a("@baseplate-dev/utils"),{Link:o,Outlet:N}=await a("@tanstack/react-router"),C=function(){const{definition:r,schemaParserContext:i}=m(),{availablePlugins:l}=i.pluginStore,n=(r.plugins??[]).filter(t=>!p(i.pluginStore,s.keyFromId(t.id)).managedBy).map(t=>l.find(d=>d.metadata.key===s.keyFromId(t.id))?.metadata).filter(w);return e.jsxs(b,{className:"flex-1",children:[e.jsxs(v,{className:"flex flex-col gap-4",width:"sm",children:[e.jsx(o,{to:"/plugins",children:e.jsxs(h,{variant:"secondary",className:"w-full",size:"sm",children:[e.jsx(c,{}),"Add new plugin"]})}),e.jsx(x,{orientation:"vertical",children:e.jsxs(j,{children:[n.map(t=>e.jsx(y,{asChild:!0,children:e.jsx(o,{to:"/plugins/edit/$key",params:{key:t.key},children:t.displayName})},t.key)),n.length===0&&e.jsx(g,{className:"mt-4 w-full text-center opacity-80",children:"No plugins enabled"})]})})]}),e.jsx(f,{className:"h-[calc(100vh-var(--topbar-height)-1px)]",children:e.jsx(u,{children:e.jsx(N,{})})})]})};export{C as component}; //# sourceMappingURL=route-DWK86rwG.js.map