UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.9 kB
import{i as o}from"./_virtual___federation_fn_import-o6aKHb82.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{w,s as g}from"./index-D_oO4W9-.js";const{createWebAppSchema:v}=await o("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:C,useDefinitionSchema:L,useProjectDefinition:F,useResettableForm:A}=await o("@baseplate-dev/project-builder-lib/web"),{FormActionBar:D,InputFieldController:n,SectionList:k,SectionListSection:r,SectionListSectionContent:p,SectionListSectionDescription:m,SectionListSectionHeader:d,SectionListSectionTitle:u,SwitchFieldController:b}=await o("@baseplate-dev/ui-components"),B=function(){const{saveDefinitionWithFeedback:x}=F(),{webDefinition:i}=w.useRouteContext(),j=L(v),s=A({resolver:g(j),values:i}),{control:t,handleSubmit:h,reset:S}=s,a=h(f=>x(c=>{c.apps=c.apps.map(l=>l.id===i.id?f:l)}));return C({control:t,reset:S,onSubmit:a}),e.jsxs("form",{onSubmit:a,className:"w-full max-w-7xl space-y-4 p-4",children:[e.jsxs(k,{children:[e.jsxs(r,{children:[e.jsxs(d,{children:[e.jsx(u,{children:"General"}),e.jsx(m,{children:"Basic configuration for your web application."})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsx(n,{label:"Name",control:t,name:"name"}),e.jsx(n,{label:"Package Location (optional)",placeholder:"e.g. packages/web",control:t,name:"packageLocation"}),e.jsx(n,{label:"Page Title",control:t,name:"title"}),e.jsx(n,{label:"Description Meta Tag",control:t,name:"description"})]})]}),e.jsxs(r,{children:[e.jsxs(d,{children:[e.jsx(u,{children:"Features"}),e.jsx(m,{children:"Configure optional features for your web application."})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsx(b,{label:"Include Auth?",control:t,name:"includeAuth"}),e.jsx(b,{label:"Include Upload Components?",control:t,name:"includeUploadComponents"})]})]})]}),e.jsx(D,{form:s})]})};export{B as component}; //# sourceMappingURL=index-DGB_wag0.js.map