static / assets /AiFeatureBuilder-C6lUv4NI.js
admin08077's picture
Upload 131 files
777dff7 verified
import{r as a,j as e}from"./react-_fH1j4AW.js";import{g as N}from"./geminiService-7wPGMJPL.js";import{a as y,D as w}from"./index-Nqm_ElTk.js";import{T as v}from"./Terminal-BS7dp6j1.js";import"./@braintree-9Zuj5s7N.js";import"./@google-4tyssLU_.js";import"./react-dom-B47xkeQg.js";import"./scheduler-DYLXRpC5.js";import"./mermaid-CwNlsT42.js";import"./dayjs-LlU9W_sF.js";import"./d3-transition-593SbTzI.js";import"./d3-timer-DdKHrDhs.js";import"./d3-dispatch-kxCwF96_.js";import"./d3-interpolate-CfLzPKWk.js";import"./d3-color-amxIadob.js";import"./d3-selection-C52G7wmG.js";import"./d3-ease-DRPgKoYJ.js";import"./d3-zoom-Dc8HCWOS.js";import"./dompurify-J5RlrwSC.js";import"./dagre-d3-es-CXvdFQqV.js";import"./lodash-es-CKQobiyk.js";import"./d3-shape-C6amFesj.js";import"./d3-path-CimkQT29.js";import"./d3-fetch-BOsq7VnW.js";import"./khroma-DUX6PT6k.js";import"./uuid-DhYbOkY1.js";import"./d3-scale-BchcX-lF.js";import"./internmap-BkD7Hj8s.js";import"./d3-array-DGRYoJHh.js";import"./d3-format-CzD4bSOQ.js";import"./d3-time-format-CUNN4Ell.js";import"./d3-time-6cSPyVSY.js";import"./d3-axis-DSWTncID.js";import"./elkjs-BS_sNva5.js";import"./cytoscape-Copgxxlq.js";import"./cytoscape-cose-bilkent-DNVwk4oY.js";import"./cose-base-HlRMd3jM.js";import"./layout-base-BVPXtQQC.js";import"./d3-sankey-DgqkLiUE.js";import"./d3-scale-chromatic-B-NsZVaP.js";import"./ts-dedent-DrFu-skq.js";import"./stylis-D5iaQeiq.js";import"./mdast-util-from-markdown-CLAsVoWb.js";import"./micromark-CTBPIv-_.js";import"./micromark-util-combine-extensions-Bka6Sc1c.js";import"./micromark-util-chunked-DrRIdSP-.js";import"./micromark-factory-space-x2vfxbz5.js";import"./micromark-util-character-Bcm1tP9o.js";import"./micromark-core-commonmark-AH8VCgT7.js";import"./micromark-util-classify-character-Cq7Fg3xE.js";import"./micromark-util-resolve-all-PQCKh0dx.js";import"./decode-named-character-reference-C3-224fz.js";import"./micromark-util-subtokenize-QwsxNXk2.js";import"./micromark-factory-destination-CypD_wgM.js";import"./micromark-factory-label-CRHH4ZHP.js";import"./micromark-factory-title-B7kCBvC9.js";import"./micromark-factory-whitespace-B322EA6O.js";import"./micromark-util-normalize-identifier-C9ANKk3v.js";import"./micromark-util-html-tag-name-DbKNfynz.js";import"./micromark-util-decode-numeric-character-reference-DRnCnno4.js";import"./micromark-util-decode-string-DJl8Y_PO.js";import"./unist-util-stringify-position-Ch_qCilz.js";import"./mdast-util-to-string-C_aolqmU.js";import"./@xterm-i03dpVGE.js";const F=()=>e.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-400 animate-pulse",style:{animationDelay:"0s"}}),e.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-400 animate-pulse",style:{animationDelay:"0.2s"}}),e.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-400 animate-pulse",style:{animationDelay:"0.4s"}})]}),Be=()=>{const[i,g]=a.useState('A simple "Hello World" React component with a button that shows an alert.'),[c,p]=a.useState([]),[r,o]=a.useState(null),[n,d]=a.useState(!1),[S,m]=a.useState(""),l=a.useRef(null),j=a.useCallback(async()=>{var t,x,u,f,h;if(!i.trim()){m("Please enter a feature description.");return}d(!0),m(""),p([]),o(null),(t=l.current)==null||t.reset(),(x=l.current)==null||x.writeln("Sending request to Gemini...");try{const s=await N(i);p(s),(u=l.current)==null||u.writeln("✅ Feature generated successfully!"),(f=l.current)==null||f.writeln(` Created ${s.length} file(s). Select a file to view its content.`),s.length>0&&o(s[0])}catch(s){const b=s instanceof Error?s.message:"An unknown error occurred.";m(`Failed to generate feature: ${b}`),(h=l.current)==null||h.writeln(`❌ Error: ${b}`)}finally{d(!1)}},[i]);return e.jsxs("div",{className:"h-full flex flex-col text-slate-300",children:[e.jsxs("header",{className:"p-4 border-b border-slate-800 flex-shrink-0",children:[e.jsxs("h1",{className:"text-xl font-bold text-slate-100 flex items-center",children:[e.jsx(y,{}),e.jsx("span",{className:"ml-3",children:"AI Feature Builder"})]}),e.jsx("p",{className:"text-slate-400 mt-1 text-sm",children:"Describe a new feature, and watch Gemini build it for you."})]}),e.jsxs("div",{className:"flex-grow flex min-h-0",children:[e.jsxs("aside",{className:"w-64 bg-slate-900/70 border-r border-slate-800 p-4 flex flex-col space-y-2 overflow-y-auto",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-400 mb-2",children:"Generated Files"}),c.length>0?c.map(t=>e.jsxs("div",{onClick:()=>o(t),className:`flex items-center space-x-2 p-2 rounded-md cursor-pointer text-sm ${(r==null?void 0:r.filePath)===t.filePath?"bg-cyan-500/20 text-cyan-300":"hover:bg-slate-800"}`,children:[e.jsx(w,{}),e.jsx("span",{children:t.filePath.split("/").pop()})]},t.filePath)):e.jsx("div",{className:"text-center text-slate-500 text-sm mt-4",children:n?"Generating...":"No files generated yet."})]}),e.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[e.jsx("div",{className:"flex-grow flex flex-col bg-slate-900",children:r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-3 border-b border-slate-800 flex-shrink-0",children:[e.jsx("h3",{className:"font-mono text-sm text-slate-200",children:r.filePath}),e.jsx("p",{className:"text-xs text-slate-400",children:r.description})]}),e.jsx("textarea",{readOnly:!0,value:r.content,className:"w-full h-full p-4 bg-transparent resize-none font-mono text-sm text-cyan-300 focus:outline-none"})]}):e.jsx("div",{className:"flex items-center justify-center h-full text-slate-500",children:"Select a file to view its content."})}),e.jsxs("div",{className:"flex-shrink-0 h-64 border-t border-slate-800 flex",children:[e.jsxs("div",{className:"w-1/2 p-4 flex flex-col border-r border-slate-800",children:[e.jsx("label",{htmlFor:"prompt-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Feature Request"}),e.jsx("textarea",{id:"prompt-input",value:i,onChange:t=>g(t.target.value),placeholder:"e.g., A user profile card with an avatar, name, and bio.",className:"flex-grow p-2 bg-slate-800 border border-slate-700 rounded-md resize-none text-sm text-slate-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none"}),e.jsx("button",{onClick:j,disabled:n,className:"mt-2 w-full flex items-center justify-center gap-2 px-4 py-2 bg-cyan-500 text-slate-900 font-bold rounded-md hover:bg-cyan-400 transition-colors disabled:bg-slate-600 disabled:cursor-not-allowed",children:n?e.jsxs(e.Fragment,{children:[e.jsx(F,{})," Generating..."]}):"Generate Feature"})]}),e.jsxs("div",{className:"w-1/2 p-2 flex flex-col",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-1 px-2",children:"Terminal"}),e.jsx("div",{className:"flex-grow",children:e.jsx(v,{ref:l,initialMessage:"Welcome to the AI Feature Builder terminal.",isReadOnly:!0})})]})]})]})]})]})};export{Be as AiFeatureBuilder};
//# sourceMappingURL=AiFeatureBuilder-C6lUv4NI.js.map