UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.93 kB
import{i as o}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{s as d}from"./index-BsqYBobW.js";const{generalSettingsSchema:h}=await o("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:f,useProjectDefinition:j,useResettableForm:u}=await o("@baseplate-dev/project-builder-lib/web"),{FormActionBar:g,InputFieldController:s,SectionList:x,SectionListSection:b,SectionListSectionContent:S,SectionListSectionHeader:v,SectionListSectionTitle:w}=await o("@baseplate-dev/ui-components"),L=function(){const{definition:n,saveDefinitionWithFeedback:r}=j(),i=u({resolver:d(h),defaultValues:n.settings.general}),{handleSubmit:l,control:t,reset:c}=i,a=l(p=>r(m=>{m.settings.general=p}));return f({control:t,reset:c,onSubmit:a}),e.jsxs("form",{className:"relative h-full max-h-full pb-(--action-bar-height)",onSubmit:a,children:[e.jsxs("div",{className:"flex h-full max-h-full flex-1 flex-col overflow-y-auto px-6",children:[e.jsx("div",{className:"sticky top-0 border-b bg-background py-6",children:e.jsx("h1",{children:"Project settings"})}),e.jsx(x,{children:e.jsxs(b,{children:[e.jsx(v,{children:e.jsx(w,{children:"Settings"})}),e.jsxs(S,{className:"flex max-w-80 flex-col gap-4",children:[e.jsx(s,{name:"name",label:"Project Name",description:"Lowercase letters and dashes, e.g. my-project",control:t,placeholder:"e.g. my-project"}),e.jsx(s,{name:"portOffset",label:"Port Offset",description:"Multiple of 1000, e.g. 4000. This will offset the ports used by the project, e.g. API at 4001, database at 4432, to avoid conflicts with other projects.",control:t,registerOptions:{valueAsNumber:!0}}),e.jsx(s,{label:"Package Scope",name:"packageScope",description:"The scope for packages in this project, e.g. my-project will result in @my-project/app-name",control:t})]})]})})]}),e.jsx(g,{form:i})]})};export{L as component}; //# sourceMappingURL=index-CXOM53v8.js.map