UNPKG

@jjdenhertog/ai-driven-development

Version:

AI-driven development workflow with learning capabilities for Claude

1 lines 7.72 kB
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2092],{1359:e=>{e.exports={editor:"ConceptSection_editor__b_CF1",fileList:"ConceptSection_fileList__OZaE3",header:"ConceptSection_header__bjLlH",fileInfo:"ConceptSection_fileInfo__UMO1a",headerActions:"ConceptSection_headerActions__wG6eF",unsaved:"ConceptSection_unsaved__WttKS",placeholder:"ConceptSection_placeholder__pXN1M"}},2001:(e,a,t)=>{"use strict";t.d(a,{M:()=>r});var s=t(5155),n=t(2115),i=t(3330),l=t(8101),c=t.n(l);let r=e=>{let{message:a,onClose:t,duration:l=5e3}=e;return(0,n.useEffect)(()=>{let e=setTimeout(t,l);return()=>clearTimeout(e)},[l,t]),(0,s.jsxs)("div",{className:c().notification,children:[(0,s.jsx)("p",{className:c().message,children:a}),(0,s.jsx)(i.$,{type:"button",variant:"ghost",size:"small",className:c().closeButton,onClick:t,"aria-label":"Close notification",children:"\xd7"})]})}},6933:(e,a,t)=>{"use strict";t.d(a,{a:()=>r});var s=t(5155),n=t(2115),i=t(7489),l=t(3578),c=t(3330);let r=e=>{let{isOpen:a,onClose:t,title:r,children:o,footer:d,width:h="600px"}=e,u=n.useCallback(e=>{e.stopPropagation()},[]);return a?(0,s.jsx)("div",{className:"modal-overlay",onClick:t,children:(0,s.jsxs)("div",{className:"modal-container",style:{maxWidth:h},onClick:u,children:[(0,s.jsxs)("div",{className:"modal-header",children:[(0,s.jsx)("h2",{children:r}),(0,s.jsx)(c.$,{variant:"ghost",size:"small",onClick:t,"aria-label":"Close",children:(0,s.jsx)(i.g,{icon:l.GRI})})]}),(0,s.jsx)("div",{className:"modal-content",children:o}),!!d&&(0,s.jsx)("div",{className:"modal-footer",children:d})]})}):null}},8101:e=>{e.exports={notification:"ErrorNotification_notification__PIYEQ",slideIn:"ErrorNotification_slideIn__jwlJu",message:"ErrorNotification_message__IvsVI",closeButton:"ErrorNotification_closeButton__nbrYx"}},9027:(e,a,t)=>{Promise.resolve().then(t.bind(t,9135))},9135:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>y});var s=t(5155),n=t(2115),i=t(5695),l=t(838),c=t(7489),r=t(7883),o=t(3578),d=t(1241),h=t(64),u=t(4653),m=t(3330),p=t(7565),x=t(8720),C=t(1359),v=t.n(C),j=t(5729),f=t(2001),_=t(6933),g=t(9995),N=t.n(g);let b=e=>{let{onClose:a,onCreate:t}=e,[i,l]=(0,n.useState)(""),[c,r]=(0,n.useState)(""),[o,d]=(0,n.useState)(!1),[u,p]=(0,n.useState)(""),x=(0,n.useCallback)(async e=>{if(e.preventDefault(),!i.trim())return void p("Please provide a filename");if(!c.trim())return void p("Please provide content for the concept");let a=i.trim().endsWith(".md")?i.trim():"".concat(i.trim(),".md");d(!0);try{await t(a,c.trim())}catch(e){p("Failed to create concept")}finally{d(!1)}},[i,c,t]),C=(0,n.useCallback)(e=>{x(e)},[x]),v=(0,n.useCallback)(e=>{l(e.target.value)},[]),j=(0,n.useCallback)(e=>{r(e||"")},[]),g=(0,n.useCallback)(()=>{p("")},[]),b=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.$,{type:"button",onClick:a,variant:"ghost",children:"Cancel"}),(0,s.jsx)(m.$,{type:"submit",form:"new-concept-form",disabled:o||!i.trim()||!c.trim(),children:o?"Creating...":"Create Concept"})]});return(0,s.jsxs)(_.a,{isOpen:!0,onClose:a,title:"New Concept",footer:b,children:[(0,s.jsx)("form",{id:"new-concept-form",onSubmit:C,className:N().form,children:(0,s.jsxs)("div",{className:"form-group",children:[(0,s.jsxs)("div",{className:N().field,children:[(0,s.jsx)("label",{htmlFor:"name",children:"Filename"}),(0,s.jsx)("input",{id:"name",type:"text",value:i,onChange:v,placeholder:"e.g., user-authentication or project-overview",className:N().input,autoFocus:!0}),(0,s.jsx)("p",{className:N().hint,children:".md extension will be added automatically if not provided"})]}),(0,s.jsxs)("div",{className:N().field,children:[(0,s.jsx)("label",{htmlFor:"content",children:"Content"}),(0,s.jsx)("div",{className:N().editorWrapper,children:(0,s.jsx)(h.B,{value:c,onChange:j,language:"markdown",height:"auto",minHeight:400,maxHeight:1e3})})]})]})}),!!u&&(0,s.jsx)(f.M,{message:u,onClose:g})]})};function k(){let e=(0,i.useRouter)();(0,i.usePathname)();let a=(0,i.useSearchParams)().get("file"),{enqueueSnackbar:t}=(0,j.dh)(),{data:C,error:f,mutate:_}=(0,l.Ay)("concepts",d.FH.getConcepts),[g,N]=(0,n.useState)(""),[k,y]=(0,n.useState)(!1),[w,S]=(0,n.useState)(!1),[F,E]=(0,n.useState)(!1);(0,n.useEffect)(()=>{a&&d.FH.getConcept(a).then(e=>{let{content:a}=e;N(a),S(!1)})},[a]);let H=(0,n.useCallback)(a=>{e.push("/plan/concepts?file=".concat(encodeURIComponent(a)))},[e]),I=(0,n.useCallback)(e=>{N(e),S(!0)},[]),L=(0,n.useCallback)(async()=>{if(a){y(!0);try{await d.FH.updateConcept(a,g),_(),S(!1),t("Concept saved successfully",{variant:"success"})}catch(e){t("Failed to save concept",{variant:"error"})}finally{y(!1)}}},[a,g,_,t]),M=(0,n.useCallback)(e=>()=>H(e),[H]),z=(0,n.useCallback)(()=>{L()},[L]),$=(0,n.useCallback)(()=>{E(!0)},[]),P=(0,n.useCallback)(()=>{E(!1)},[]),W=(0,n.useCallback)(async(e,a)=>{try{await d.FH.createConcept(e,a),_(),E(!1),t("Concept created successfully",{variant:"success"}),H(e)}catch(e){t("Failed to create concept",{variant:"error"})}},[_,t,H]),A=(0,n.useCallback)(async()=>{if(a&&window.confirm('Are you sure you want to delete "'.concat(a,'"?')))try{await d.FH.deleteConcept(a),_(),e.push("/plan/concepts"),t("Concept deleted successfully",{variant:"success"})}catch(e){t("Failed to delete concept",{variant:"error"})}},[a,_,e,t]);if(f)return(0,s.jsx)("div",{className:"error-state",children:"Failed to load concepts"});if(!C)return(0,s.jsx)("div",{className:"loading-state",children:"Loading concepts..."});let B=(0,s.jsxs)(p.a,{children:[(0,s.jsx)(p.o,{href:"/plan/concepts",active:!0,children:"Concepts"}),(0,s.jsx)(p.o,{href:"/plan/features",active:!1,children:"Features"})]}),R=(0,s.jsx)("div",{className:v().fileList,children:0===C.length?(0,s.jsxs)("div",{className:"empty-state",children:[(0,s.jsx)("p",{children:"No concepts yet"}),(0,s.jsxs)(m.$,{onClick:$,variant:"primary",size:"small",children:[(0,s.jsx)(c.g,{icon:o.QLR}),"Create new"]})]}):(0,s.jsxs)(s.Fragment,{children:[C.map(e=>(0,s.jsx)(x.H,{icon:r.h8M,title:e.name,description:e.size?"".concat((e.size/1024).toFixed(1),"KB"):void 0,selected:a===e.name,onClick:M(e.name)},e.name)),(0,s.jsxs)(m.$,{onClick:$,variant:"secondary",size:"small",style:{width:"100%"},children:[(0,s.jsx)(c.g,{icon:o.QLR}),"Create new file"]})]})});return(0,s.jsxs)(u.M,{title:"Plan",subtitle:"Here comes a description",variant:"sidebar",sidebarHeader:B,sidebarContent:R,children:[a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:v().header,children:[(0,s.jsxs)("div",{className:v().fileInfo,children:[(0,s.jsx)("h2",{children:a}),w?(0,s.jsx)("span",{className:v().unsaved,children:"• Unsaved changes"}):null]}),(0,s.jsxs)("div",{className:v().headerActions,children:[(0,s.jsx)(m.$,{onClick:A,variant:"danger",size:"small",title:"Delete concept",children:(0,s.jsx)(c.g,{icon:o.yLS})}),(0,s.jsx)(m.$,{onClick:z,disabled:k||!w,variant:"primary",size:"medium",children:k?"Saving..":"Save"})]})]}),(0,s.jsx)("div",{className:v().editor,children:(0,s.jsx)(h.B,{value:g,onChange:I,language:"markdown",height:"100%"})})]}):(0,s.jsxs)("div",{className:v().placeholder,children:[(0,s.jsx)("p",{children:"Select a concept to view details"}),0===C.length&&(0,s.jsxs)(m.$,{onClick:$,variant:"primary",size:"large",children:[(0,s.jsx)(c.g,{icon:o.QLR}),"Create your first concept"]})]}),!!F&&(0,s.jsx)(b,{onClose:P,onCreate:W})]})}function y(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"loading-state",children:"Loading..."}),children:(0,s.jsx)(k,{})})}},9995:e=>{e.exports={form:"NewConceptModal_form__QNCej",input:"NewConceptModal_input__q3AwT",hint:"NewConceptModal_hint__UUKy2",editorWrapper:"NewConceptModal_editorWrapper__9_mhW"}}},e=>{e.O(0,[2403,6750,2266,1919,838,5729,6874,3044,2112,8441,5964,7358],()=>e(e.s=9027)),_N_E=e.O()}]);