UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.85 kB
import{i as s}from"./_virtual___federation_fn_import-DOo8C-zl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{s as w,b as v,k as y}from"./index-DiAhmW9l.js";const{createWebAppSchema:C}=await s("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:F,useDefinitionSchema:A,useProjectDefinition:D,useResettableForm:L}=await s("@baseplate-dev/project-builder-lib/web"),{FormActionBar:g,InputFieldController:i,SectionList:N,SectionListSection:r,SectionListSectionContent:p,SectionListSectionDescription:m,SectionListSectionHeader:d,SectionListSectionTitle:u,SwitchFieldController:x}=await s("@baseplate-dev/ui-components");function T(){const{saveDefinitionWithFeedback:b}=D(),{webDefinition:n}=w.useRouteContext(),j=A(C),o=L({resolver:v(j),values:n}),{control:t,handleSubmit:h,reset:S}=o,a=h(f=>b(c=>{c.apps=c.apps.map(l=>l.id===n.id?f:l)}));return F({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(N,{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(i,{label:"Name",control:t,name:"name"}),e.jsx(i,{label:"Page Title",control:t,name:"title"}),e.jsx(i,{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(x,{label:"Include Auth?",control:t,name:"includeAuth"}),e.jsx(x,{label:"Include Upload Components?",control:t,name:"includeUploadComponents"})]})]}),e.jsx(y,{entityType:"app",entityId:n.id,name:n.name})]}),e.jsx(g,{form:o})]})}export{T as component}; //# sourceMappingURL=index-De6W7yxU.js.map