Spaces:
Running
Running
Delete assets
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- assets/@google-4tyssLU_.js +0 -0
- assets/@google-4tyssLU_.js.map +0 -0
- assets/AiCodeExplainer-CxCBh5Ix.js +0 -11
- assets/AiCodeExplainer-CxCBh5Ix.js.map +0 -1
- assets/AiCodeMigrator-DbV4mPbO.js +0 -8
- assets/AiCodeMigrator-DbV4mPbO.js.map +0 -1
- assets/AiCodingChallenge-Dh6tvY6F.js +0 -2
- assets/AiCodingChallenge-Dh6tvY6F.js.map +0 -1
- assets/AiCommandCenter-CVnQ0f79.js +0 -3
- assets/AiCommandCenter-CVnQ0f79.js.map +0 -1
- assets/AiCommitGenerator-BL1O9TtY.js +0 -14
- assets/AiCommitGenerator-BL1O9TtY.js.map +0 -1
- assets/AiFeatureBuilder-Di-hwVvK.js +0 -8
- assets/AiFeatureBuilder-Di-hwVvK.js.map +0 -1
- assets/AiImageGenerator-Dy58AZjY.js +0 -2
- assets/AiImageGenerator-Dy58AZjY.js.map +0 -1
- assets/AiStyleTransfer-CNrZDb1L.js +0 -4
- assets/AiStyleTransfer-CNrZDb1L.js.map +0 -1
- assets/AiUnitTestGenerator-CfYJVzr-.js +0 -9
- assets/AiUnitTestGenerator-CfYJVzr-.js.map +0 -1
- assets/AsyncCallTreeViewer-Dmje5dK2.js +0 -23
- assets/AsyncCallTreeViewer-Dmje5dK2.js.map +0 -1
- assets/AudioToCode-B0PlwkeG.js +0 -2
- assets/AudioToCode-B0PlwkeG.js.map +0 -1
- assets/ChangelogGenerator-CwVf8_gS.js +0 -13
- assets/ChangelogGenerator-CwVf8_gS.js.map +0 -1
- assets/CodeDiffGhost-BO5D2V6-.js +0 -18
- assets/CodeDiffGhost-BO5D2V6-.js.map +0 -1
- assets/CodeFormatter-BOOFBlt1.js +0 -8
- assets/CodeFormatter-BOOFBlt1.js.map +0 -1
- assets/CodeReviewBot-DZnlxz1p.js +0 -12
- assets/CodeReviewBot-DZnlxz1p.js.map +0 -1
- assets/CodeSpellChecker-C5gwLsi0.js +0 -6
- assets/CodeSpellChecker-C5gwLsi0.js.map +0 -1
- assets/ColorPaletteGenerator-BG5TiXtv.js +0 -2
- assets/ColorPaletteGenerator-BG5TiXtv.js.map +0 -1
- assets/CronJobBuilder-j1M2S9Ja.js +0 -2
- assets/CronJobBuilder-j1M2S9Ja.js.map +0 -1
- assets/CssGridEditor-BIgc_aXP.js +0 -7
- assets/CssGridEditor-BIgc_aXP.js.map +0 -1
- assets/DevNotesStickyPanel-CLNoK4mX.js +0 -3
- assets/DevNotesStickyPanel-CLNoK4mX.js.map +0 -1
- assets/FontPairingTool-BiWUGH0d.js +0 -2
- assets/FontPairingTool-BiWUGH0d.js.map +0 -1
- assets/FontPreviewPicker-BY0e7Rn9.js +0 -2
- assets/FontPreviewPicker-BY0e7Rn9.js.map +0 -1
- assets/JsonTreeNavigator-DDac-dKC.js +0 -13
- assets/JsonTreeNavigator-DDac-dKC.js.map +0 -1
- assets/LogicFlowBuilder-C0g3EKR6.js +0 -2
- assets/LogicFlowBuilder-C0g3EKR6.js.map +0 -1
assets/@google-4tyssLU_.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/@google-4tyssLU_.js.map
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
assets/AiCodeExplainer-CxCBh5Ix.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
import{r,j as e}from"./react-D_B_5QVd.js";import{e as g,a as b,M as N}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const f=({text:l="AI is analyzing..."})=>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"}}),e.jsx("span",{className:"text-slate-400 ml-2",children:l})]}),v=`const bubbleSort = (arr) => {
|
| 2 |
-
for (let i = 0; i < arr.length; i++) {
|
| 3 |
-
for (let j = 0; j < arr.length - i - 1; j++) {
|
| 4 |
-
if (arr[j] > arr[j + 1]) {
|
| 5 |
-
[arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
|
| 6 |
-
}
|
| 7 |
-
}
|
| 8 |
-
}
|
| 9 |
-
return arr;
|
| 10 |
-
};`,I=({initialCode:l})=>{const[d,m]=r.useState(l||v),[a,x]=r.useState(null),[n,u]=r.useState(!1),[i,c]=r.useState(""),[p,h]=r.useState("summary"),o=r.useCallback(async s=>{if(!s.trim()){c("Please enter some code to explain.");return}u(!0),c(""),x(null),h("summary");try{const t=await g(s);x(t)}catch(t){const y=t instanceof Error?t.message:"An unknown error occurred.";c(`Failed to get explanation: ${y}`)}finally{u(!1)}},[]);r.useEffect(()=>{l&&(m(l),o(l))},[l,o]);const j=()=>{if(!a)return null;switch(p){case"summary":return e.jsx(N,{content:a.summary});case"lineByLine":return e.jsx("div",{className:"space-y-3",children:a.lineByLine.map((s,t)=>e.jsxs("div",{className:"p-3 bg-slate-900/50 rounded-md",children:[e.jsxs("p",{className:"font-mono text-xs text-cyan-400 mb-1",children:["Lines: ",s.lines]}),e.jsx("p",{className:"text-sm",children:s.explanation})]},t))});case"complexity":return e.jsxs("div",{children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Time Complexity:"})," ",e.jsx("span",{className:"font-mono text-amber-400",children:a.complexity.time})]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Space Complexity:"})," ",e.jsx("span",{className:"font-mono text-amber-400",children:a.complexity.space})]})]});case"suggestions":return e.jsx("ul",{className:"list-disc list-inside space-y-2",children:a.suggestions.map((s,t)=>e.jsx("li",{children:s},t))})}};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-slate-300",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(b,{}),e.jsx("span",{className:"ml-3",children:"AI Code Explainer"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Get a detailed, structured analysis of any code snippet."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0",children:[e.jsxs("div",{className:"flex flex-col min-h-0",children:[e.jsx("label",{htmlFor:"code-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Your Code"}),e.jsx("textarea",{id:"code-input",value:d,onChange:s=>m(s.target.value),placeholder:"Paste your code here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none"}),e.jsx("div",{className:"mt-4",children:e.jsx("button",{onClick:()=>o(d),disabled:n,className:"w-full flex items-center justify-center px-6 py-3 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.jsx(f,{text:"Analyzing..."}):"Analyze Code"})})]}),e.jsxs("div",{className:"flex flex-col min-h-0",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"AI Analysis"}),e.jsxs("div",{className:"relative flex-grow flex flex-col bg-slate-800/50 border border-slate-700/50 rounded-md overflow-hidden",children:[e.jsx("div",{className:"flex-shrink-0 flex border-b border-slate-700",children:["summary","lineByLine","complexity","suggestions"].map(s=>e.jsx("button",{onClick:()=>h(s),disabled:!a,className:`px-4 py-2 text-sm font-medium capitalize transition-colors ${p===s?"bg-slate-700/50 text-cyan-300":"text-slate-400 hover:bg-slate-700/30 disabled:text-slate-600"}`,children:s.replace(/([A-Z])/g," $1")},s))}),e.jsxs("div",{className:"p-4 flex-grow overflow-y-auto",children:[n&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(f,{})}),i&&e.jsx("p",{className:"text-red-400",children:i}),a&&!n&&j(),!n&&!a&&!i&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"The analysis will appear here."})]})]})]})]})]})};export{I as AiCodeExplainer};
|
| 11 |
-
//# sourceMappingURL=AiCodeExplainer-CxCBh5Ix.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiCodeExplainer-CxCBh5Ix.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiCodeExplainer-CxCBh5Ix.js","sources":["../../components/AiCodeExplainer.tsx"],"sourcesContent":["\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { explainCodeStructured, StructuredExplanation } from '../services/geminiService.ts';\nimport { CpuChipIcon } from './icons/InterfaceIcons.tsx';\nimport { MarkdownRenderer } from './shared/MarkdownRenderer.tsx';\n\nconst LoadingSpinner: React.FC<{text?: string}> = ({ text = 'AI is analyzing...'}) => (\n <div className=\"flex items-center justify-center space-x-2\">\n <div className=\"w-2 h-2 rounded-full bg-cyan-400 animate-pulse\" style={{ animationDelay: '0s' }}></div>\n <div className=\"w-2 h-2 rounded-full bg-cyan-400 animate-pulse\" style={{ animationDelay: '0.2s' }}></div>\n <div className=\"w-2 h-2 rounded-full bg-cyan-400 animate-pulse\" style={{ animationDelay: '0.4s' }}></div>\n <span className=\"text-slate-400 ml-2\">{text}</span>\n </div>\n);\n\nconst exampleCode = `const bubbleSort = (arr) => {\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length - i - 1; j++) {\n if (arr[j] > arr[j + 1]) {\n [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];\n }\n }\n }\n return arr;\n};`;\n\ntype ExplanationTab = 'summary' | 'lineByLine' | 'complexity' | 'suggestions';\n\nexport const AiCodeExplainer: React.FC<{ initialCode?: string }> = ({ initialCode }) => {\n const [code, setCode] = useState<string>(initialCode || exampleCode);\n const [explanation, setExplanation] = useState<StructuredExplanation | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n const [activeTab, setActiveTab] = useState<ExplanationTab>('summary');\n\n const handleExplain = useCallback(async (codeToExplain: string) => {\n if (!codeToExplain.trim()) {\n setError('Please enter some code to explain.');\n return;\n }\n setIsLoading(true);\n setError('');\n setExplanation(null);\n setActiveTab('summary');\n try {\n const result = await explainCodeStructured(codeToExplain);\n setExplanation(result);\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to get explanation: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, []);\n \n useEffect(() => {\n if (initialCode) {\n setCode(initialCode);\n handleExplain(initialCode);\n }\n }, [initialCode, handleExplain]);\n\n const renderTabContent = () => {\n if (!explanation) return null;\n switch(activeTab) {\n case 'summary':\n return <MarkdownRenderer content={explanation.summary} />;\n case 'lineByLine':\n return (\n <div className=\"space-y-3\">\n {explanation.lineByLine.map((item, index) => (\n <div key={index} className=\"p-3 bg-slate-900/50 rounded-md\">\n <p className=\"font-mono text-xs text-cyan-400 mb-1\">Lines: {item.lines}</p>\n <p className=\"text-sm\">{item.explanation}</p>\n </div>\n ))}\n </div>\n );\n case 'complexity':\n return (\n <div>\n <p><strong>Time Complexity:</strong> <span className=\"font-mono text-amber-400\">{explanation.complexity.time}</span></p>\n <p><strong>Space Complexity:</strong> <span className=\"font-mono text-amber-400\">{explanation.complexity.space}</span></p>\n </div>\n );\n case 'suggestions':\n return (\n <ul className=\"list-disc list-inside space-y-2\">\n {explanation.suggestions.map((item, index) => <li key={index}>{item}</li>)}\n </ul>\n );\n }\n }\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-slate-300\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <CpuChipIcon />\n <span className=\"ml-3\">AI Code Explainer</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Get a detailed, structured analysis of any code snippet.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0\">\n <div className=\"flex flex-col min-h-0\">\n <label htmlFor=\"code-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Your Code</label>\n <textarea\n id=\"code-input\"\n value={code}\n onChange={(e) => setCode(e.target.value)}\n placeholder=\"Paste your code here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none\"\n />\n <div className=\"mt-4\">\n <button\n onClick={() => handleExplain(code)}\n disabled={isLoading}\n className=\"w-full flex items-center justify-center px-6 py-3 bg-cyan-500 text-slate-900 font-bold rounded-md hover:bg-cyan-400 transition-colors disabled:bg-slate-600 disabled:cursor-not-allowed\"\n >\n {isLoading ? <LoadingSpinner text=\"Analyzing...\"/> : 'Analyze Code'}\n </button>\n </div>\n </div>\n <div className=\"flex flex-col min-h-0\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">AI Analysis</label>\n <div className=\"relative flex-grow flex flex-col bg-slate-800/50 border border-slate-700/50 rounded-md overflow-hidden\">\n <div className=\"flex-shrink-0 flex border-b border-slate-700\">\n {(['summary', 'lineByLine', 'complexity', 'suggestions'] as ExplanationTab[]).map(tab => (\n <button key={tab} onClick={() => setActiveTab(tab)} disabled={!explanation}\n className={`px-4 py-2 text-sm font-medium capitalize transition-colors ${activeTab === tab ? 'bg-slate-700/50 text-cyan-300' : 'text-slate-400 hover:bg-slate-700/30 disabled:text-slate-600'}`}>\n {tab.replace(/([A-Z])/g, ' $1')}\n </button>\n ))}\n </div>\n <div className=\"p-4 flex-grow overflow-y-auto\">\n {isLoading && <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>}\n {error && <p className=\"text-red-400\">{error}</p>}\n {explanation && !isLoading && renderTabContent()}\n {!isLoading && !explanation && !error && <div className=\"text-slate-500 h-full flex items-center justify-center\">The analysis will appear here.</div>}\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n};"],"names":["LoadingSpinner","text","jsxs","jsx","exampleCode","AiCodeExplainer","initialCode","code","setCode","useState","explanation","setExplanation","isLoading","setIsLoading","error","setError","activeTab","setActiveTab","handleExplain","useCallback","codeToExplain","result","explainCodeStructured","err","errorMessage","useEffect","renderTabContent","MarkdownRenderer","item","index","CpuChipIcon","e","tab"],"mappings":"iRAOA,MAAMA,EAA4C,CAAC,CAAE,KAAAC,EAAO,wBACxDC,OAAC,MAAA,CAAI,UAAU,6CACX,SAAA,CAAAC,MAAC,OAAI,UAAU,iDAAiD,MAAO,CAAE,eAAgB,MAAQ,EACjGA,MAAC,OAAI,UAAU,iDAAiD,MAAO,CAAE,eAAgB,QAAU,EACnGA,MAAC,OAAI,UAAU,iDAAiD,MAAO,CAAE,eAAgB,QAAU,EACnGA,EAAAA,IAAC,OAAA,CAAK,UAAU,sBAAuB,SAAAF,CAAA,CAAK,CAAA,EAChD,EAGEG,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAaPC,EAAsD,CAAC,CAAE,YAAAC,KAAkB,CACpF,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAiBH,GAAeF,CAAW,EAC7D,CAACM,EAAaC,CAAc,EAAIF,EAAAA,SAAuC,IAAI,EAC3E,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAkB,EAAK,EACnD,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAiB,EAAE,EACvC,CAACO,EAAWC,CAAY,EAAIR,EAAAA,SAAyB,SAAS,EAE9DS,EAAgBC,cAAY,MAAOC,GAA0B,CAC/D,GAAI,CAACA,EAAc,OAAQ,CACvBL,EAAS,oCAAoC,EAC7C,MACJ,CACAF,EAAa,EAAI,EACjBE,EAAS,EAAE,EACXJ,EAAe,IAAI,EACnBM,EAAa,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SAAA,CAAC,UAAW,aAAc,aAAc,aAAa,EAAuB,IAAI6B,GAC9E7B,EAAAA,IAAC,SAAA,CAAiB,QAAS,IAAMc,EAAae,CAAG,EAAG,SAAU,CAACtB,EAC9D,UAAW,8DAA8DM,IAAcgB,EAAM,gCAAkC,8DAA8D,GACzL,SAAAA,EAAI,QAAQ,WAAY,KAAK,CAAA,EAFrBA,CAAA,CAIhB,EACJ,EACA9B,EAAAA,KAAC,MAAA,CAAI,UAAU,gCACV,SAAA,CAAAU,SAAc,MAAA,CAAI,UAAU,0CAA0C,SAAAT,MAACH,IAAe,EAAE,EACxFc,GAASX,EAAAA,IAAC,IAAA,CAAE,UAAU,eAAgB,SAAAW,EAAM,EAC5CJ,GAAe,CAACE,GAAac,EAAA,EAC7B,CAACd,GAAa,CAACF,GAAe,CAACI,GAASX,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,gCAAA,CAA8B,CAAA,CAAA,CACnJ,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiCodeMigrator-DbV4mPbO.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./react-D_B_5QVd.js";import{I as L,J as A,L as w,M}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const k=["SASS","CSS","JavaScript","TypeScript","Python","Go","React","Vue","Angular","Tailwind CSS"],E=`// SASS
|
| 2 |
-
$primary-color: #333;
|
| 3 |
-
|
| 4 |
-
body {
|
| 5 |
-
color: $primary-color;
|
| 6 |
-
font-family: sans-serif;
|
| 7 |
-
}`,T=({inputCode:a,fromLang:l,toLang:o})=>{const[p,g]=s.useState(a||E),[m,h]=s.useState(""),[j,S]=s.useState(l||"SASS"),[b,N]=s.useState(o||"CSS"),[n,y]=s.useState(!1),[x,i]=s.useState(""),u=s.useCallback(async(r,f,t)=>{if(!r.trim()){i("Please enter some code to migrate.");return}y(!0),i(""),h("");try{const c=L(r,f,t);let d="";for await(const C of c)d+=C,h(d)}catch(c){const d=c instanceof Error?c.message:"An unknown error occurred.";i(`Failed to migrate code: ${d}`)}finally{y(!1)}},[]);s.useEffect(()=>{a&&l&&o&&(g(a),S(l),N(o),u(a,l,o))},[a,l,o,u]);const v=({value:r,onChange:f})=>e.jsx("select",{value:r,onChange:t=>f(t.target.value),className:"w-full px-3 py-2 rounded-md bg-slate-800 border border-slate-700",children:k.map(t=>e.jsx("option",{value:t,children:t},t))});return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(A,{}),e.jsx("span",{className:"ml-3",children:"AI Code Migrator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Translate code between languages, frameworks, and syntax styles."})]}),e.jsxs("div",{className:"flex-grow flex flex-col min-h-0",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 flex-grow min-h-0",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400",children:"From:"}),e.jsx(v,{value:j,onChange:S})]}),e.jsx("textarea",{value:p,onChange:r=>g(r.target.value),placeholder:"Paste your source code here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400",children:"To:"}),e.jsx(v,{value:b,onChange:N})]}),e.jsxs("div",{className:"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[n&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(w,{})}),x&&e.jsx("p",{className:"p-4 text-red-400",children:x}),m&&!n&&e.jsx(M,{content:m}),!n&&!m&&!x&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"Migrated code will appear here."})]})]})]}),e.jsx("button",{onClick:()=>u(p,j,b),disabled:n,className:"btn-primary mt-4 w-full max-w-sm mx-auto flex items-center justify-center px-6 py-3",children:n?e.jsx(w,{}):"Migrate Code"})]})]})};export{T as AiCodeMigrator};
|
| 8 |
-
//# sourceMappingURL=AiCodeMigrator-DbV4mPbO.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiCodeMigrator-DbV4mPbO.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiCodeMigrator-DbV4mPbO.js","sources":["../../components/features/AiCodeMigrator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { migrateCodeStream } from '../../services/geminiService.ts';\nimport { ArrowPathIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst languages = ['SASS', 'CSS', 'JavaScript', 'TypeScript', 'Python', 'Go', 'React', 'Vue', 'Angular', 'Tailwind CSS'];\n\nconst exampleCode = `// SASS\n$primary-color: #333;\n\nbody {\n color: $primary-color;\n font-family: sans-serif;\n}`;\n\nexport const AiCodeMigrator: React.FC<{ inputCode?: string, fromLang?: string, toLang?: string }> = ({ inputCode: initialCode, fromLang: initialFrom, toLang: initialTo }) => {\n const [inputCode, setInputCode] = useState<string>(initialCode || exampleCode);\n const [outputCode, setOutputCode] = useState<string>('');\n const [fromLang, setFromLang] = useState(initialFrom || 'SASS');\n const [toLang, setToLang] = useState(initialTo || 'CSS');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleMigrate = useCallback(async (code: string, from: string, to: string) => {\n if (!code.trim()) {\n setError('Please enter some code to migrate.');\n return;\n }\n setIsLoading(true);\n setError('');\n setOutputCode('');\n try {\n const stream = migrateCodeStream(code, from, to);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setOutputCode(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to migrate code: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n useEffect(() => {\n if (initialCode && initialFrom && initialTo) {\n setInputCode(initialCode);\n setFromLang(initialFrom);\n setToLang(initialTo);\n handleMigrate(initialCode, initialFrom, initialTo);\n }\n }, [initialCode, initialFrom, initialTo, handleMigrate]);\n\n const LanguageSelector: React.FC<{ value: string, onChange: (val: string) => void }> = ({ value, onChange }) => (\n <select value={value} onChange={e => onChange(e.target.value)} className=\"w-full px-3 py-2 rounded-md bg-slate-800 border border-slate-700\">\n {languages.map(lang => <option key={lang} value={lang}>{lang}</option>)}\n </select>\n );\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\"><ArrowPathIcon /><span className=\"ml-3\">AI Code Migrator</span></h1>\n <p className=\"text-slate-400 mt-1\">Translate code between languages, frameworks, and syntax styles.</p>\n </header>\n <div className=\"flex-grow flex flex-col min-h-0\">\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 flex-grow min-h-0\">\n <div className=\"flex flex-col h-full\">\n <div className=\"mb-2\">\n <label className=\"text-sm font-medium text-slate-400\">From:</label>\n <LanguageSelector value={fromLang} onChange={setFromLang} />\n </div>\n <textarea\n value={inputCode}\n onChange={(e) => setInputCode(e.target.value)}\n placeholder=\"Paste your source code here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n </div>\n <div className=\"flex flex-col h-full\">\n <div className=\"mb-2\">\n <label className=\"text-sm font-medium text-slate-400\">To:</label>\n <LanguageSelector value={toLang} onChange={setToLang} />\n </div>\n <div className=\"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>}\n {error && <p className=\"p-4 text-red-400\">{error}</p>}\n {outputCode && !isLoading && <MarkdownRenderer content={outputCode} />}\n {!isLoading && !outputCode && !error && <div className=\"text-slate-500 h-full flex items-center justify-center\">Migrated code will appear here.</div>}\n </div>\n </div>\n </div>\n <button\n onClick={() => handleMigrate(inputCode, fromLang, toLang)}\n disabled={isLoading}\n className=\"btn-primary mt-4 w-full max-w-sm mx-auto flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Migrate Code'}\n </button>\n </div>\n </div>\n );\n};\n"],"names":["languages","exampleCode","AiCodeMigrator","initialCode","initialFrom","initialTo","inputCode","setInputCode","useState","outputCode","setOutputCode","fromLang","setFromLang","toLang","setToLang","isLoading","setIsLoading","error","setError","handleMigrate","useCallback","code","from","to","stream","migrateCodeStream","fullResponse","chunk","err","errorMessage","useEffect","LanguageSelector","value","onChange","jsx","e","lang","jsxs","ArrowPathIcon","LoadingSpinner","MarkdownRenderer"],"mappings":"wRAOA,MAAMA,EAAY,CAAC,OAAQ,MAAO,aAAc,aAAc,SAAU,KAAM,QAAS,MAAO,UAAW,cAAc,EAEjHC,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAQPC,EAAuF,CAAC,CAAE,UAAWC,EAAa,SAAUC,EAAa,OAAQC,KAAgB,CAC1K,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAiBL,GAAeF,CAAW,EACvE,CAACQ,EAAYC,CAAa,EAAIF,EAAAA,SAAiB,EAAE,EACjD,CAACG,EAAUC,CAAW,EAAIJ,EAAAA,SAASJ,GAAe,MAAM,EACxD,CAACS,EAAQC,CAAS,EAAIN,EAAAA,SA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AI,UAAU,yDAAyD,SAAA,iCAAA,CAA+B,CAAA,CAAA,CACnJ,CAAA,CAAA,CACJ,CAAA,EACJ,EACCA,EAAAA,IAAC,SAAA,CACE,QAAS,IAAMf,EAAcb,EAAWK,EAAUE,CAAM,EACxD,SAAUE,EACV,UAAU,sFAET,SAAAA,EAAYmB,EAAAA,IAACK,EAAA,CAAA,CAAe,EAAK,cAAA,CAAA,CACtC,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiCodingChallenge-Dh6tvY6F.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as t,j as e}from"./react-D_B_5QVd.js";import{x as f,B as h,L as m,M as u}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const w=()=>{const[a,c]=t.useState(""),[s,i]=t.useState(!1),[n,d]=t.useState(""),o=t.useCallback(async()=>{i(!0),d(""),c("");try{const r=f(null);let l="";for await(const x of r)l+=x,c(l)}catch(r){const l=r instanceof Error?r.message:"An unknown error occurred.";d(`Failed to generate challenge: ${l}`)}finally{i(!1)}},[]);return t.useEffect(()=>{o()},[o]),e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6 flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"AI Coding Challenge Generator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Generate a unique coding problem to test your skills."})]}),e.jsx("button",{onClick:o,disabled:s,className:"btn-primary flex items-center justify-center px-6 py-3",children:s?e.jsx(m,{}):"Generate New Challenge"})]}),e.jsxs("div",{className:"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[s&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(m,{})}),n&&e.jsx("p",{className:"text-red-400",children:n}),a&&!s&&e.jsx(u,{content:a}),!s&&!a&&!n&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:'Click "Generate New Challenge" to start.'})]})]})};export{w as AiCodingChallenge};
|
| 2 |
-
//# sourceMappingURL=AiCodingChallenge-Dh6tvY6F.js.map
|
|
|
|
|
|
|
|
|
assets/AiCodingChallenge-Dh6tvY6F.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiCodingChallenge-Dh6tvY6F.js","sources":["../../components/features/AiCodingChallenge.tsx"],"sourcesContent":["\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { generateCodingChallengeStream } from '../../services/geminiService.ts';\nimport { BeakerIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nexport const AiCodingChallenge: React.FC = () => {\n const [challenge, setChallenge] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n setIsLoading(true);\n setError('');\n setChallenge('');\n try {\n const stream = generateCodingChallengeStream(null);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setChallenge(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate challenge: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n useEffect(() => {\n // Generate a challenge on initial load for a better user experience\n handleGenerate();\n }, [handleGenerate]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6 flex justify-between items-center\">\n <div>\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <BeakerIcon />\n <span className=\"ml-3\">AI Coding Challenge Generator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Generate a unique coding problem to test your skills.</p>\n </div>\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Generate New Challenge'}\n </button>\n </header>\n <div className=\"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && (\n <div className=\"flex items-center justify-center h-full\">\n <LoadingSpinner />\n </div>\n )}\n {error && <p className=\"text-red-400\">{error}</p>}\n {challenge && !isLoading && (\n <MarkdownRenderer content={challenge} />\n )}\n {!isLoading && !challenge && !error && (\n <div className=\"text-slate-500 h-full flex items-center justify-center\">\n Click \"Generate New Challenge\" to start.\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["AiCodingChallenge","challenge","setChallenge","useState","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","stream","generateCodingChallengeStream","fullResponse","chunk","err","errorMessage","useEffect","jsxs","jsx","BeakerIcon","LoadingSpinner","MarkdownRenderer"],"mappings":"6RAOO,MAAMA,EAA8B,IAAM,CAC7C,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAiB,EAAE,EAC/C,CAACC,EAAWC,CAAY,EAAIF,EAAAA,SAAkB,EAAK,EACnD,CAACG,EAAOC,CAAQ,EAAIJ,EAAAA,SAAiB,EAAE,EAEvCK,EAAiBC,EAAAA,YAAY,SAAY,CAC3CJ,EAAa,EAAI,EACjBE,EAAS,EAAE,EACXL,EAAa,EAAE,EACf,GAAI,CACA,MAAMQ,EAASC,EAA8B,IAAI,EACjD,IAAIC,EAAe,GACnB,gBAAiBC,KAASH,EACtBE,GAAgBC,EAChBX,EAAaU,CAAY,CAEjC,OAASE,EAAK,CACV,MAAMC,EAAeD,aAAe,MAAQA,EAAI,QAAU,6BAC1DP,EAAS,iCAAiCQ,CAAY,EAAE,CAC5D,QAAA,CACIV,EAAa,EAAK,CACtB,CACJ,EAAG,CAAA,CAAE,EAELW,OAAAA,EAAAA,UAAU,IAAM,CAEZR,EAAA,CACJ,EAAG,CAACA,CAAc,CAAC,EAGfS,EAAAA,KAAC,MAAA,CAAI,UAAU,yCACX,SAAA,CAAAA,EAAAA,KAAC,SAAA,CAAO,UAAU,yCACd,SAAA,CAAAA,OAAC,MAAA,CACG,SAAA,CAAAA,EAAAA,KAAC,KAAA,CAAG,UAAU,sDACV,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAW,EACZD,EAAAA,IAAC,OAAA,CAAK,UAAU,OAAO,SAAA,+BAAA,CAA6B,CAAA,EACxD,EACAA,EAAAA,IAAC,IAAA,CAAE,UAAU,sBAAsB,SAAA,uDAAA,CAAqD,CAAA,EAC5F,EACAA,EAAAA,IAAC,SAAA,CACG,QAASV,EACT,SAAUJ,EACV,UAAU,yDAET,SAAAA,EAAYc,EAAAA,IAACE,EAAA,CAAA,CAAe,EAAK,wBAAA,CAAA,CACtC,EACJ,EACAH,EAAAA,KAAC,MAAA,CAAI,UAAU,sFACV,SAAA,CAAAb,SACK,MAAA,CAAI,UAAU,0CACZ,SAAAc,MAACE,IAAe,EACnB,EAEJd,GAASY,EAAAA,IAAC,IAAA,CAAE,UAAU,eAAgB,SAAAZ,EAAM,EAC5CL,GAAa,CAACG,GACXc,EAAAA,IAACG,EAAA,CAAiB,QAASpB,EAAW,EAExC,CAACG,GAAa,CAACH,GAAa,CAACK,GAC3BY,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,0CAAA,CAExE,CAAA,CAAA,CAER,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiCommandCenter-CVnQ0f79.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
import{r as o,j as e}from"./react-D_B_5QVd.js";import{T as r}from"./@google-4tyssLU_.js";import{u as h,g as y,l as b,C as I,L as k}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const l=[{id:"ai-command-center",name:"AI Command Center",description:"The main entry point. Use natural language to navigate and control the entire toolkit. Can call other tools.",category:"Core",inputs:"A natural language prompt describing what the user wants to do. Examples: 'explain this code: ...', 'design a theme with space vibes'."},{id:"ai-code-explainer",name:"AI Code Explainer",description:"Accepts a code snippet and provides a detailed, structured analysis including summary, line-by-line breakdown, time/space complexity, and suggestions for improvement.",category:"AI Tools",inputs:"A string containing a code snippet."},{id:"theme-designer",name:"AI Theme Designer",description:"Generates a complete UI color theme (primary, background, text colors) from a simple text description.",category:"AI Tools",inputs:"A string describing the desired aesthetic. Example: 'a calm, minimalist theme for a blog'."},{id:"regex-sandbox",name:"RegEx Sandbox",description:"Generates a regular expression from a natural language description. Also allows testing expressions against a string.",category:"Testing",inputs:"A string describing the pattern to match. Example: 'find all email addresses'."},{id:"pr-summary-generator",name:"AI PR Summary Generator",description:"Takes 'before' and 'after' code snippets, calculates the diff, and generates a structured pull request summary including a title, a prose description, and a bulleted list of changes.",category:"AI Tools",inputs:"Two strings: 'beforeCode' and 'afterCode'."},{id:"visual-git-tree",name:"AI Git Log Analyzer",description:"Intelligently parses a raw 'git log' output to create a categorized and well-formatted changelog, separating new features from bug fixes.",category:"Git",inputs:"A string containing the raw output of a 'git log' command."},{id:"cron-job-builder",name:"AI Cron Job Builder",description:"Generates a valid cron expression from a natural language description of a schedule.",category:"Deployment",inputs:"A string describing a schedule. Example: 'every weekday at 5pm'."},{id:"ai-code-migrator",name:"AI Code Migrator",description:"Translate code between languages & frameworks.",category:"AI Tools",inputs:"A string of code to convert, a string for the source language, and a string for the target language. e.g. 'migrate this SASS to CSS: ...'"},{id:"ai-commit-generator",name:"AI Commit Message Generator",description:"Generates a conventional commit message from a git diff.",category:"AI Tools",inputs:"A string containing a git diff."},{id:"worker-thread-debugger",name:"AI Concurrency Analyzer",description:"Analyzes JavaScript code for potential Web Worker concurrency issues like race conditions.",category:"Testing",inputs:"A string of JavaScript code to analyze for concurrency issues."}],A=[{name:"navigateTo",description:"Navigates to a specific feature page.",parameters:{type:r.OBJECT,properties:{featureId:{type:r.STRING,description:"The ID of the feature to navigate to.",enum:l.map(a=>a.id)}},required:["featureId"]}},{name:"runFeatureWithInput",description:"Navigates to a feature and passes initial data to it.",parameters:{type:r.OBJECT,properties:{featureId:{type:r.STRING,description:"The ID of the feature to run.",enum:l.map(a=>a.id)},props:{type:r.OBJECT,description:"An object containing the initial properties for the feature, based on its required inputs.",properties:{initialCode:{type:r.STRING},initialPrompt:{type:r.STRING},beforeCode:{type:r.STRING},afterCode:{type:r.STRING},logInput:{type:r.STRING},diff:{type:r.STRING},codeInput:{type:r.STRING}}}},required:["featureId","props"]}}],T=l.map(a=>`- ${a.name} (${a.id}): ${a.description} Inputs: ${a.inputs}`).join(`
|
| 2 |
-
`),R=()=>{const{dispatch:a}=h(),[n,p]=o.useState(""),[s,g]=o.useState(!1),[m,i]=o.useState(""),u=o.useCallback(async()=>{if(n.trim()){g(!0),i("");try{const t=await y(n,A,T);if(t.functionCalls&&t.functionCalls.length>0){const x=t.functionCalls[0],{name:d,args:c}=x;switch(i(`Understood! Executing command: ${d}`),d){case"navigateTo":a({type:"SET_VIEW",payload:{view:c.featureId}});break;case"runFeatureWithInput":a({type:"SET_VIEW",payload:{view:c.featureId,props:c.props}});break;default:i(`Unknown command: ${d}`)}p("")}else i(t.text)}catch(t){b(t,{prompt:n}),i(t instanceof Error?t.message:"An unknown error occurred.")}finally{g(!1)}}},[n,a]),f=t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),u())};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6 text-center",children:[e.jsxs("h1",{className:"text-4xl font-extrabold text-text-primary-light dark:text-text-primary-dark tracking-tight flex items-center justify-center",children:[e.jsx(I,{}),e.jsx("span",{className:"ml-3",children:"AI Command Center"})]}),e.jsx("p",{className:"mt-2 text-lg text-text-secondary-light dark:text-text-secondary-dark",children:"What would you like to do?"})]}),e.jsxs("div",{className:"flex-grow flex flex-col justify-end max-w-3xl w-full mx-auto",children:[m&&e.jsx("div",{className:"mb-4 p-4 bg-surface-light dark:bg-surface-dark rounded-lg text-text-primary-light dark:text-text-primary-dark border border-border-light dark:border-border-dark",children:e.jsxs("p",{children:[e.jsx("strong",{children:"AI:"})," ",m]})}),e.jsxs("div",{className:"relative",children:[e.jsx("textarea",{value:n,onChange:t=>p(t.target.value),onKeyDown:f,disabled:s,placeholder:'Try "explain this code: const a = 1;" or "open the theme designer"',className:"w-full p-4 pr-28 rounded-lg bg-background-light dark:bg-surface-dark border border-border-light dark:border-border-dark focus:ring-2 focus:ring-primary dark:focus:ring-primary-dark focus:outline-none resize-none shadow-sm",rows:2}),e.jsx("button",{onClick:u,disabled:s,className:"btn-primary absolute right-3 top-1/2 -translate-y-1/2 px-4 py-2",children:s?e.jsx(k,{}):"Send"})]}),e.jsx("p",{className:"text-xs text-text-secondary-light dark:text-text-secondary-dark text-center mt-2",children:"Press Enter to send, Shift+Enter for new line."})]})]})};export{R as AiCommandCenter};
|
| 3 |
-
//# sourceMappingURL=AiCommandCenter-CVnQ0f79.js.map
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiCommandCenter-CVnQ0f79.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiCommandCenter-CVnQ0f79.js","sources":["../../services/taxonomyService.ts","../../components/features/AiCommandCenter.tsx"],"sourcesContent":["export interface FeatureTaxonomy {\n id: string;\n name: string;\n description: string;\n category: string;\n inputs: string;\n}\n\nexport const FEATURE_TAXONOMY: FeatureTaxonomy[] = [\n {\n id: \"ai-command-center\",\n name: \"AI Command Center\",\n description: \"The main entry point. Use natural language to navigate and control the entire toolkit. Can call other tools.\",\n category: \"Core\",\n inputs: \"A natural language prompt describing what the user wants to do. Examples: 'explain this code: ...', 'design a theme with space vibes'.\"\n },\n {\n id: \"ai-code-explainer\",\n name: \"AI Code Explainer\",\n description: \"Accepts a code snippet and provides a detailed, structured analysis including summary, line-by-line breakdown, time/space complexity, and suggestions for improvement.\",\n category: \"AI Tools\",\n inputs: \"A string containing a code snippet.\"\n },\n {\n id: \"theme-designer\",\n name: \"AI Theme Designer\",\n description: \"Generates a complete UI color theme (primary, background, text colors) from a simple text description.\",\n category: \"AI Tools\",\n inputs: \"A string describing the desired aesthetic. Example: 'a calm, minimalist theme for a blog'.\"\n },\n {\n id: \"regex-sandbox\",\n name: \"RegEx Sandbox\",\n description: \"Generates a regular expression from a natural language description. Also allows testing expressions against a string.\",\n category: \"Testing\",\n inputs: \"A string describing the pattern to match. Example: 'find all email addresses'.\"\n },\n {\n id: \"pr-summary-generator\",\n name: \"AI PR Summary Generator\",\n description: \"Takes 'before' and 'after' code snippets, calculates the diff, and generates a structured pull request summary including a title, a prose description, and a bulleted list of changes.\",\n category: \"AI Tools\",\n inputs: \"Two strings: 'beforeCode' and 'afterCode'.\"\n },\n {\n id: \"visual-git-tree\",\n name: \"AI Git Log Analyzer\",\n description: \"Intelligently parses a raw 'git log' output to create a categorized and well-formatted changelog, separating new features from bug fixes.\",\n category: \"Git\",\n inputs: \"A string containing the raw output of a 'git log' command.\"\n },\n {\n id: \"cron-job-builder\",\n name: \"AI Cron Job Builder\",\n description: \"Generates a valid cron expression from a natural language description of a schedule.\",\n category: \"Deployment\",\n inputs: \"A string describing a schedule. Example: 'every weekday at 5pm'.\"\n },\n {\n id: \"ai-code-migrator\",\n name: \"AI Code Migrator\",\n description: \"Translate code between languages & frameworks.\",\n category: \"AI Tools\",\n inputs: \"A string of code to convert, a string for the source language, and a string for the target language. e.g. 'migrate this SASS to CSS: ...'\"\n },\n {\n id: \"ai-commit-generator\",\n name: \"AI Commit Message Generator\",\n description: \"Generates a conventional commit message from a git diff.\",\n category: \"AI Tools\",\n inputs: \"A string containing a git diff.\"\n },\n {\n id: \"worker-thread-debugger\",\n name: \"AI Concurrency Analyzer\",\n description: \"Analyzes JavaScript code for potential Web Worker concurrency issues like race conditions.\",\n category: \"Testing\",\n inputs: \"A string of JavaScript code to analyze for concurrency issues.\"\n }\n];","\nimport React, { useState, useCallback } from 'react';\nimport { Type, FunctionDeclaration } from \"@google/genai\";\nimport { getInferenceFunction, CommandResponse } from '../../services/geminiService.ts';\nimport { FEATURE_TAXONOMY } from '../../services/taxonomyService.ts';\nimport { useGlobalState } from '../../contexts/GlobalStateContext.tsx';\nimport { CommandLineIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { logError } from '../../services/telemetryService.ts';\n\nconst functionDeclarations: FunctionDeclaration[] = [\n {\n name: 'navigateTo',\n description: 'Navigates to a specific feature page.',\n parameters: {\n type: Type.OBJECT,\n properties: {\n featureId: { \n type: Type.STRING, \n description: 'The ID of the feature to navigate to.',\n enum: FEATURE_TAXONOMY.map(f => f.id)\n },\n },\n required: ['featureId'],\n },\n },\n {\n name: 'runFeatureWithInput',\n description: 'Navigates to a feature and passes initial data to it.',\n parameters: {\n type: Type.OBJECT,\n properties: {\n featureId: { \n type: Type.STRING, \n description: 'The ID of the feature to run.',\n enum: FEATURE_TAXONOMY.map(f => f.id)\n },\n props: {\n type: Type.OBJECT,\n description: 'An object containing the initial properties for the feature, based on its required inputs.',\n properties: {\n initialCode: { type: Type.STRING },\n initialPrompt: { type: Type.STRING },\n beforeCode: { type: Type.STRING },\n afterCode: { type: Type.STRING },\n logInput: { type: Type.STRING },\n diff: { type: Type.STRING },\n codeInput: { type: Type.STRING }\n }\n }\n },\n required: ['featureId', 'props']\n }\n }\n];\n\nconst knowledgeBase = FEATURE_TAXONOMY.map(f => `- ${f.name} (${f.id}): ${f.description} Inputs: ${f.inputs}`).join('\\n');\n\nexport const AiCommandCenter: React.FC = () => {\n const { dispatch } = useGlobalState();\n const [prompt, setPrompt] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [lastResponse, setLastResponse] = useState('');\n\n const handleCommand = useCallback(async () => {\n if (!prompt.trim()) return;\n\n setIsLoading(true);\n setLastResponse('');\n\n try {\n const response: CommandResponse = await getInferenceFunction(prompt, functionDeclarations, knowledgeBase);\n \n if (response.functionCalls && response.functionCalls.length > 0) {\n const call = response.functionCalls[0];\n const { name, args } = call;\n\n setLastResponse(`Understood! Executing command: ${name}`);\n\n switch (name) {\n case 'navigateTo':\n dispatch({ type: 'SET_VIEW', payload: { view: args.featureId }});\n break;\n case 'runFeatureWithInput':\n dispatch({ type: 'SET_VIEW', payload: { view: args.featureId, props: args.props } });\n break;\n default:\n setLastResponse(`Unknown command: ${name}`);\n }\n setPrompt(''); // Clear prompt on successful command\n } else {\n setLastResponse(response.text);\n }\n\n } catch (err) {\n logError(err as Error, { prompt });\n setLastResponse(err instanceof Error ? err.message : 'An unknown error occurred.');\n } finally {\n setIsLoading(false);\n }\n }, [prompt, dispatch]);\n\n const handleKeyDown = (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n handleCommand();\n }\n };\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6 text-center\">\n <h1 className=\"text-4xl font-extrabold text-text-primary-light dark:text-text-primary-dark tracking-tight flex items-center justify-center\">\n <CommandLineIcon />\n <span className=\"ml-3\">AI Command Center</span>\n </h1>\n <p className=\"mt-2 text-lg text-text-secondary-light dark:text-text-secondary-dark\">What would you like to do?</p>\n </header>\n \n <div className=\"flex-grow flex flex-col justify-end max-w-3xl w-full mx-auto\">\n {lastResponse && (\n <div className=\"mb-4 p-4 bg-surface-light dark:bg-surface-dark rounded-lg text-text-primary-light dark:text-text-primary-dark border border-border-light dark:border-border-dark\">\n <p><strong>AI:</strong> {lastResponse}</p>\n </div>\n )}\n <div className=\"relative\">\n <textarea\n value={prompt}\n onChange={e => setPrompt(e.target.value)}\n onKeyDown={handleKeyDown}\n disabled={isLoading}\n placeholder='Try \"explain this code: const a = 1;\" or \"open the theme designer\"'\n className=\"w-full p-4 pr-28 rounded-lg bg-background-light dark:bg-surface-dark border border-border-light dark:border-border-dark focus:ring-2 focus:ring-primary dark:focus:ring-primary-dark focus:outline-none resize-none shadow-sm\"\n rows={2}\n />\n <button\n onClick={handleCommand}\n disabled={isLoading}\n className=\"btn-primary absolute right-3 top-1/2 -translate-y-1/2 px-4 py-2\"\n >\n {isLoading ? <LoadingSpinner/> : 'Send'}\n </button>\n </div>\n <p className=\"text-xs text-text-secondary-light dark:text-text-secondary-dark text-center mt-2\">Press Enter to send, Shift+Enter for new line.</p>\n </div>\n </div>\n );\n};\n"],"names":["FEATURE_TAXONOMY","functionDeclarations","Type","f","knowledgeBase","AiCommandCenter","dispatch","useGlobalState","prompt","setPrompt","useState","isLoading","setIsLoading","lastResponse","setLastResponse","handleCommand","useCallback","response","getInferenceFunction","call","name","args","err","logError","handleKeyDown","e","jsxs","jsx","CommandLineIcon","LoadingSpinner"],"mappings":"gTAQO,MAAMA,EAAsC,CAC/C,CACI,GAAI,oBACJ,KAAM,oBACN,YAAa,+GACb,SAAU,OACV,OAAQ,wIAAA,EAEZ,CACI,GAAI,oBACJ,KAAM,oBACN,YAAa,yKACb,SAAU,WACV,OAAQ,qCAAA,EAEZ,CACI,GAAI,iBACJ,KAAM,oBACN,YAAa,yGACb,SAAU,WACV,OAAQ,4FAAA,EAEZ,CACI,GAAI,gBACJ,KAAM,gBACN,YAAa,wHACb,SAAU,UACV,OAAQ,gFAAA,EAEZ,CACI,GAAI,uBACJ,KAAM,0BACN,YAAa,yLACb,SAAU,WACV,OAAQ,4CAAA,EAEX,CACG,GAAI,kBACJ,KAAM,sBACN,YAAa,4IACb,SAAU,MACV,OAAQ,4DAAA,EAEZ,CACI,GAAI,mBACJ,KAAM,sBACN,YAAa,uFACb,SAAU,aACV,OAAQ,kEAAA,EAEZ,CACI,GAAI,mBACJ,KAAM,mBACN,YAAa,iDACb,SAAU,WACV,OAAQ,2IAAA,EAEZ,CACI,GAAI,sBACJ,KAAM,8BACN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ACAA,EAAAA,IAAC,IAAA,CAAE,UAAU,uEAAuE,SAAA,4BAAA,CAA0B,CAAA,EAClH,EAEAD,EAAAA,KAAC,MAAA,CAAI,UAAU,+DACV,SAAA,CAAAb,GACGc,EAAAA,IAAC,MAAA,CAAI,UAAU,mKACX,gBAAC,IAAA,CAAE,SAAA,CAAAA,EAAAA,IAAC,UAAO,SAAA,KAAA,CAAG,EAAS,IAAEd,CAAA,CAAA,CAAa,CAAA,CAC1C,EAEHa,EAAAA,KAAC,MAAA,CAAI,UAAU,WACZ,SAAA,CAAAC,EAAAA,IAAC,WAAA,CACG,MAAOnB,EACP,SAAUiB,GAAKhB,EAAUgB,EAAE,OAAO,KAAK,EACvC,UAAWD,EACX,SAAUb,EACV,YAAY,qEACZ,UAAU,gOACV,KAAM,CAAA,CAAA,EAEVgB,EAAAA,IAAC,SAAA,CACG,QAASZ,EACT,SAAUJ,EACV,UAAU,kEAEV,SAAAA,EAAYgB,EAAAA,IAACE,EAAA,CAAA,CAAc,EAAK,MAAA,CAAA,CACpC,EACJ,EACCF,EAAAA,IAAC,IAAA,CAAE,UAAU,mFAAmF,SAAA,gDAAA,CAA8C,CAAA,CAAA,CACnJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiCommitGenerator-BL1O9TtY.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./react-D_B_5QVd.js";import{f as j,G as b,L as u}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const N=`diff --git a/src/components/Button.tsx b/src/components/Button.tsx
|
| 2 |
-
index 1b2c3d4..5e6f7g8 100644
|
| 3 |
-
--- a/src/components/Button.tsx
|
| 4 |
-
+++ b/src/components/Button.tsx
|
| 5 |
-
@@ -1,7 +1,7 @@
|
| 6 |
-
import React from 'react';
|
| 7 |
-
|
| 8 |
-
interface ButtonProps {
|
| 9 |
-
- text: string;
|
| 10 |
-
+ label: string;
|
| 11 |
-
onClick: () => void;
|
| 12 |
-
}
|
| 13 |
-
`,S=({diff:t})=>{const[d,x]=s.useState(t||N),[a,f]=s.useState(""),[r,p]=s.useState(!1),[c,i]=s.useState(""),m=s.useCallback(async l=>{if(!l.trim()){i("Please paste a diff to generate a message.");return}p(!0),i(""),f("");try{const o=j(l);let n="";for await(const h of o)n+=h,f(n)}catch(o){const n=o instanceof Error?o.message:"An unknown error occurred.";i(`Failed to generate message: ${n}`)}finally{p(!1)}},[]);s.useEffect(()=>{t&&(x(t),m(t))},[t,m]);const g=()=>{navigator.clipboard.writeText(a)};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(b,{}),e.jsx("span",{className:"ml-3",children:"AI Commit Message Generator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Paste your diff and let Gemini craft the perfect commit message."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"diff-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Git Diff"}),e.jsx("textarea",{id:"diff-input",value:d,onChange:l=>x(l.target.value),placeholder:"Paste your git diff here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-slate-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none"}),e.jsx("button",{onClick:()=>m(d),disabled:r,className:"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3",children:r?e.jsx(u,{}):"Generate Commit Message"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Generated Message"}),e.jsxs("div",{className:"relative flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[r&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(u,{})}),c&&e.jsx("p",{className:"text-red-400",children:c}),a&&!r&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:g,className:"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"}),e.jsx("pre",{className:"whitespace-pre-wrap font-sans text-slate-200",children:a})]}),!r&&!a&&!c&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"The commit message will appear here."})]})]})]})]})};export{S as AiCommitGenerator};
|
| 14 |
-
//# sourceMappingURL=AiCommitGenerator-BL1O9TtY.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiCommitGenerator-BL1O9TtY.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiCommitGenerator-BL1O9TtY.js","sources":["../../components/features/AiCommitGenerator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback, useEffect } from 'react';\nimport { generateCommitMessageStream } from '../../services/geminiService.ts';\nimport { GitBranchIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\n\nconst exampleDiff = `diff --git a/src/components/Button.tsx b/src/components/Button.tsx\nindex 1b2c3d4..5e6f7g8 100644\n--- a/src/components/Button.tsx\n+++ b/src/components/Button.tsx\n@@ -1,7 +1,7 @@\n import React from 'react';\n\n interface ButtonProps {\n- text: string;\n+ label: string;\n onClick: () => void;\n }\n`;\n\nexport const AiCommitGenerator: React.FC<{ diff?: string }> = ({ diff: initialDiff }) => {\n const [diff, setDiff] = useState<string>(initialDiff || exampleDiff);\n const [message, setMessage] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async (diffToAnalyze: string) => {\n if (!diffToAnalyze.trim()) {\n setError('Please paste a diff to generate a message.');\n return;\n }\n setIsLoading(true);\n setError('');\n setMessage('');\n try {\n const stream = generateCommitMessageStream(diffToAnalyze);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setMessage(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate message: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n useEffect(() => {\n if (initialDiff) {\n setDiff(initialDiff);\n handleGenerate(initialDiff);\n }\n }, [initialDiff, handleGenerate]);\n \n const handleCopy = () => {\n navigator.clipboard.writeText(message);\n };\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <GitBranchIcon />\n <span className=\"ml-3\">AI Commit Message Generator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Paste your diff and let Gemini craft the perfect commit message.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"diff-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Git Diff</label>\n <textarea\n id=\"diff-input\"\n value={diff}\n onChange={(e) => setDiff(e.target.value)}\n placeholder=\"Paste your git diff here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-slate-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none\"\n />\n <button\n onClick={() => handleGenerate(diff)}\n disabled={isLoading}\n className=\"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Generate Commit Message'}\n </button>\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Generated Message</label>\n <div className=\"relative flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && (\n <div className=\"flex items-center justify-center h-full\">\n <LoadingSpinner />\n </div>\n )}\n {error && <p className=\"text-red-400\">{error}</p>}\n {message && !isLoading && (\n <>\n <button onClick={handleCopy} className=\"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button>\n <pre className=\"whitespace-pre-wrap font-sans text-slate-200\">{message}</pre>\n </>\n )}\n {!isLoading && !message && !error && (\n <div className=\"text-slate-500 h-full flex items-center justify-center\">\n The commit message will appear here.\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleDiff","AiCommitGenerator","initialDiff","diff","setDiff","useState","message","setMessage","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","diffToAnalyze","stream","generateCommitMessageStream","fullResponse","chunk","err","errorMessage","useEffect","handleCopy","jsxs","jsx","GitBranchIcon","e","LoadingSpinner","Fragment"],"mappings":"sRAMA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcPC,EAAiD,CAAC,CAAE,KAAMC,KAAkB,CACrF,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAiBH,GAAeF,CAAW,EAC7D,CAACM,EAASC,CAAU,EAAIF,EAAAA,SAAiB,EAAE,EAC3C,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAkB,EAAK,EACnD,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAiB,EAAE,EAEvCO,EAAiBC,cAAY,MAAOC,GAA0B,CAChE,GAAI,CAACA,EAAc,OAAQ,CACvBH,EAAS,4CAA4C,EACrD,MACJ,CACAF,EAAa,EAAI,EACjBE,EAAS,EAAE,EACXJ,EAAW,EAAE,EACb,GAAI,CACA,MAAMQ,EAASC,EAA4BF,CAAa,EACxD,IAAIG,EAAe,GACnB,gBAAiBC,KAASH,E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AA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,oBAAiB,EAC5ED,EAAAA,KAAC,MAAA,CAAI,UAAU,+FACV,SAAA,CAAAf,SACK,MAAA,CAAI,UAAU,0CACZ,SAAAgB,MAACG,IAAe,EACnB,EAEJjB,GAASc,EAAAA,IAAC,IAAA,CAAE,UAAU,eAAgB,SAAAd,EAAM,EAC5CJ,GAAW,CAACE,GACTe,EAAAA,KAAAK,EAAAA,SAAA,CACG,SAAA,CAAAJ,MAAC,SAAA,CAAO,QAASF,EAAY,UAAU,sFAAsF,SAAA,OAAI,EACjIE,EAAAA,IAAC,MAAA,CAAI,UAAU,+CAAgD,SAAAlB,CAAA,CAAQ,CAAA,EAC1E,EAEF,CAACE,GAAa,CAACF,GAAW,CAACI,GACzBc,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,sCAAA,CAExE,CAAA,CAAA,CAER,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiFeatureBuilder-Di-hwVvK.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./react-D_B_5QVd.js";import{c as O,b as D,s as I,d as P,f as A,h as $,D as N,B as G,G as B,L as S,i as L,M as v}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const Q=()=>{const[c,F]=a.useState('A simple "Hello World" React component with a button that shows an alert.'),[f,x]=a.useState([]),[h,u]=a.useState(""),[p,j]=a.useState(""),[r,o]=a.useState(null),[m,g]=a.useState(!1),[b,d]=a.useState(""),[n,i]=a.useState("CODE");a.useEffect(()=>{(async()=>{const s=await L();x(s),s.length>0&&o(s[0])})()},[]);const y=a.useCallback(async()=>{if(!c.trim()){d("Please enter a feature description.");return}g(!0),d(""),await O(),x([]),u(""),j(""),o(null),i("CODE");try{const t=await D(c);for(const s of t)await I(s);if(x(t),t.length>0){const s=t.find(l=>l.filePath.endsWith(".tsx")||l.filePath.endsWith(".jsx"));if(o(s||t[0]),s){const l=P(s.content);let C="";for await(const M of l)C+=M,u(C)}const E=t.map(l=>`File: ${l.filePath}
|
| 2 |
-
|
| 3 |
-
${l.content}`).join(`
|
| 4 |
-
---
|
| 5 |
-
`),k=A(E);let w="";for await(const l of k)w+=l,j(w)}}catch(t){const s=t instanceof Error?t.message:"An unknown error occurred.";d(`Failed to generate feature: ${s}`)}finally{g(!1)}},[c]),T=()=>{switch(n){case"TESTS":return e.jsx(v,{content:h});case"COMMIT":return e.jsx("pre",{className:"w-full h-full p-4 whitespace-pre-wrap font-sans text-sm",children:p});case"CODE":default:return r?e.jsx(v,{content:`\`\`\`tsx
|
| 6 |
-
${r.content}
|
| 7 |
-
\`\`\``}):e.jsx("div",{className:"flex items-center justify-center h-full text-slate-500",children:"Select a file to view its content."})}};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("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($,{}),e.jsx("span",{className:"ml-3",children:"AI Feature Builder"})]})}),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",children:[e.jsx("h2",{className:"text-sm font-semibold text-slate-400 mb-2",children:"Generated Files"}),e.jsx("div",{className:"overflow-y-auto space-y-1",children:f.map(t=>e.jsxs("div",{onClick:()=>{o(t),i("CODE")},className:`flex items-center space-x-2 p-2 rounded-md cursor-pointer text-sm ${(r==null?void 0:r.filePath)===t.filePath&&n==="CODE"?"bg-cyan-500/20 text-cyan-300":"hover:bg-slate-800"}`,children:[e.jsx(N,{}),e.jsx("span",{children:t.filePath.split("/").pop()})]},t.filePath))})]}),e.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"flex-grow flex flex-col bg-slate-900",children:[e.jsxs("div",{className:"border-b border-slate-800 flex items-center",children:[e.jsxs("button",{onClick:()=>i("CODE"),className:`flex items-center gap-2 px-4 py-2 text-sm ${n==="CODE"?"bg-slate-800 text-slate-100":"text-slate-400"}`,children:[e.jsx(N,{})," Code"]}),h&&e.jsxs("button",{onClick:()=>i("TESTS"),className:`flex items-center gap-2 px-4 py-2 text-sm ${n==="TESTS"?"bg-slate-800 text-slate-100":"text-slate-400"}`,children:[e.jsx(G,{})," Tests"]}),p&&e.jsxs("button",{onClick:()=>i("COMMIT"),className:`flex items-center gap-2 px-4 py-2 text-sm ${n==="COMMIT"?"bg-slate-800 text-slate-100":"text-slate-400"}`,children:[e.jsx(B,{})," Commit"]})]}),e.jsx("div",{className:"flex-grow p-2 overflow-auto",children:m&&!f.length?e.jsx("div",{className:"flex justify-center items-center h-full",children:e.jsx(S,{})}):T()})]}),e.jsxs("div",{className:"flex-shrink-0 p-4 border-t border-slate-800 bg-slate-800/50",children:[e.jsx("textarea",{value:c,onChange:t=>F(t.target.value),placeholder:"e.g., A user profile card with an avatar, name, and bio.",className:"w-full p-2 bg-slate-800 border border-slate-700 rounded-md resize-none text-sm h-20"}),e.jsx("button",{onClick:y,disabled:m,className:"btn-primary mt-2 w-full flex items-center justify-center gap-2 px-4 py-2",children:m?e.jsxs(e.Fragment,{children:[e.jsx(S,{})," Generating..."]}):"Generate Feature"}),b&&e.jsx("p",{className:"text-red-400 text-xs mt-2 text-center",children:b})]})]})]})]})};export{Q as AiFeatureBuilder};
|
| 8 |
-
//# sourceMappingURL=AiFeatureBuilder-Di-hwVvK.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiFeatureBuilder-Di-hwVvK.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiFeatureBuilder-Di-hwVvK.js","sources":["../../components/features/AiFeatureBuilder.tsx"],"sourcesContent":["\n\nimport React, { useState, useCallback, useEffect } from 'react';\nimport type { GeneratedFile } from '../../types.ts';\nimport { generateFeature, generateUnitTestsStream, generateCommitMessageStream } from '../../services/geminiService.ts';\nimport { saveFile, getAllFiles, clearAllFiles } from '../../services/dbService.ts';\nimport { CpuChipIcon, DocumentTextIcon, BeakerIcon, GitBranchIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\ntype ActiveTab = 'CODE' | 'TESTS' | 'COMMIT';\n\nexport const AiFeatureBuilder: React.FC = () => {\n const [prompt, setPrompt] = useState<string>('A simple \"Hello World\" React component with a button that shows an alert.');\n const [generatedFiles, setGeneratedFiles] = useState<GeneratedFile[]>([]);\n const [unitTests, setUnitTests] = useState<string>('');\n const [commitMessage, setCommitMessage] = useState<string>('');\n const [selectedFile, setSelectedFile] = useState<GeneratedFile | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n const [activeTab, setActiveTab] = useState<ActiveTab>('CODE');\n \n useEffect(() => {\n const loadFiles = async () => {\n const files = await getAllFiles();\n setGeneratedFiles(files);\n if (files.length > 0) setSelectedFile(files[0]);\n };\n loadFiles();\n }, []);\n\n const handleGenerate = useCallback(async () => {\n if (!prompt.trim()) { setError('Please enter a feature description.'); return; }\n setIsLoading(true);\n setError('');\n await clearAllFiles(); // Start fresh for each generation\n setGeneratedFiles([]);\n setUnitTests('');\n setCommitMessage('');\n setSelectedFile(null);\n setActiveTab('CODE');\n\n try {\n const resultFiles = await generateFeature(prompt);\n for (const file of resultFiles) { await saveFile(file); }\n setGeneratedFiles(resultFiles);\n\n if (resultFiles.length > 0) {\n const componentFile = resultFiles.find(f => f.filePath.endsWith('.tsx') || f.filePath.endsWith('.jsx'));\n setSelectedFile(componentFile || resultFiles[0]);\n\n if (componentFile) {\n const testStream = generateUnitTestsStream(componentFile.content);\n let tests = '';\n for await (const chunk of testStream) { tests += chunk; setUnitTests(tests); }\n }\n\n const diffContext = resultFiles.map(f => `File: ${f.filePath}\\n\\n${f.content}`).join('\\n---\\n');\n const commitStream = generateCommitMessageStream(diffContext);\n let commit = '';\n for await (const chunk of commitStream) { commit += chunk; setCommitMessage(commit); }\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate feature: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [prompt]);\n \n const renderContent = () => {\n switch (activeTab) {\n case 'TESTS': return <MarkdownRenderer content={unitTests} />;\n case 'COMMIT': return <pre className=\"w-full h-full p-4 whitespace-pre-wrap font-sans text-sm\">{commitMessage}</pre>;\n case 'CODE':\n default:\n return selectedFile ? <MarkdownRenderer content={`\\`\\`\\`tsx\\n${selectedFile.content}\\n\\`\\`\\``} /> : <div className=\"flex items-center justify-center h-full text-slate-500\">Select a file to view its content.</div>;\n }\n }\n\n return (\n <div className=\"h-full flex flex-col\">\n <header className=\"p-4 border-b border-slate-800 flex-shrink-0\">\n <h1 className=\"text-xl font-bold text-slate-100 flex items-center\"><CpuChipIcon /><span className=\"ml-3\">AI Feature Builder</span></h1>\n </header>\n\n <div className=\"flex-grow flex min-h-0\">\n <aside className=\"w-64 bg-slate-900/70 border-r border-slate-800 p-4 flex flex-col\">\n <h2 className=\"text-sm font-semibold text-slate-400 mb-2\">Generated Files</h2>\n <div className=\"overflow-y-auto space-y-1\">\n {generatedFiles.map(file => (\n <div key={file.filePath} onClick={() => { setSelectedFile(file); setActiveTab('CODE'); }} className={`flex items-center space-x-2 p-2 rounded-md cursor-pointer text-sm ${selectedFile?.filePath === file.filePath && activeTab === 'CODE' ? 'bg-cyan-500/20 text-cyan-300' : 'hover:bg-slate-800'}`}>\n <DocumentTextIcon /><span>{file.filePath.split('/').pop()}</span>\n </div>\n ))}\n </div>\n </aside>\n\n <main className=\"flex-1 flex flex-col min-w-0\">\n <div className=\"flex-grow flex flex-col bg-slate-900\">\n <div className=\"border-b border-slate-800 flex items-center\">\n <button onClick={() => setActiveTab('CODE')} className={`flex items-center gap-2 px-4 py-2 text-sm ${activeTab === 'CODE' ? 'bg-slate-800 text-slate-100' : 'text-slate-400'}`}><DocumentTextIcon /> Code</button>\n {unitTests && <button onClick={() => setActiveTab('TESTS')} className={`flex items-center gap-2 px-4 py-2 text-sm ${activeTab === 'TESTS' ? 'bg-slate-800 text-slate-100' : 'text-slate-400'}`}><BeakerIcon /> Tests</button>}\n {commitMessage && <button onClick={() => setActiveTab('COMMIT')} className={`flex items-center gap-2 px-4 py-2 text-sm ${activeTab === 'COMMIT' ? 'bg-slate-800 text-slate-100' : 'text-slate-400'}`}><GitBranchIcon /> Commit</button>}\n </div>\n <div className=\"flex-grow p-2 overflow-auto\">\n {isLoading && !generatedFiles.length ? <div className=\"flex justify-center items-center h-full\"><LoadingSpinner/></div> : renderContent()}\n </div>\n </div>\n \n <div className=\"flex-shrink-0 p-4 border-t border-slate-800 bg-slate-800/50\">\n <textarea value={prompt} onChange={(e) => setPrompt(e.target.value)} placeholder=\"e.g., A user profile card with an avatar, name, and bio.\" className=\"w-full p-2 bg-slate-800 border border-slate-700 rounded-md resize-none text-sm h-20\"/>\n <button onClick={handleGenerate} disabled={isLoading} className=\"btn-primary mt-2 w-full flex items-center justify-center gap-2 px-4 py-2\">\n {isLoading ? <><LoadingSpinner /> Generating...</> : 'Generate Feature'}\n </button>\n {error && <p className=\"text-red-400 text-xs mt-2 text-center\">{error}</p>}\n </div>\n </main>\n </div>\n </div>\n );\n};"],"names":["AiFeatureBuilder","prompt","setPrompt","useState","generatedFiles","setGeneratedFiles","unitTests","setUnitTests","commitMessage","setCommitMessage","selectedFile","setSelectedFile","isLoading","setIsLoading","error","setError","activeTab","setActiveTab","useEffect","files","getAllFiles","handleGenerate","useCallback","clearAllFiles","resultFiles","generateFeature","file","saveFile","componentFile","f","testStream","generateUnitTestsStream","tests","chunk","diffContext","commitStream","generateCommitMessageStream","commit","err","errorMessage","renderContent","jsx","MarkdownRenderer","jsxs","CpuChipIcon","DocumentTextIcon","BeakerIcon","GitBranchIcon","LoadingSpinner","e","Fragment"],"mappings":"qVAYO,MAAMA,EAA6B,IAAM,CAC5C,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAiB,2EAA2E,EAClH,CAACC,EAAgBC,CAAiB,EAAIF,EAAAA,SAA0B,CAAA,CAAE,EAClE,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAiB,EAAE,EAC/C,CAACK,EAAeC,CAAgB,EAAIN,EAAAA,SAAiB,EAAE,EACvD,CAACO,EAAcC,CAAe,EAAIR,EAAAA,SAA+B,IAAI,EACrE,CAACS,EAAWC,CAAY,EAAIV,EAAAA,SAAkB,EAAK,EACnD,CAACW,EAAOC,CAAQ,EAAIZ,EAAAA,SAAiB,EAAE,EACvC,CAACa,EAAWC,CAAY,EAAId,EAAAA,SAAoB,MAAM,EAE5De,EAAAA,UAAU,IAAM,EACM,SAAY,CAC1B,MAAMC,EAAQ,MAAMC,EAAA,EACpBf,EAAkBc,CAAK,EACnBA,EAAM,OAAS,GAAGR,EAAgBQ,EAAM,CAAC,CAAC,CAClD,GACA,CACJ,EAAG,CAAA,CAAE,EAEL,MAAME,EAAiBC,EAAAA,YAAY,SAAY,CAC3C,GAAI,CAACrB,EAAO,OAAQ,CAAEc,EAAS,qCAAqC,EAAG,MAAQ,CAC/EF,EAAa,EAAI,EACjBE,EAAS,EAAE,EACX,MAAMQ,EAAA,EACNlB,EAAkB,CAAA,CAAE,EACpBE,EAAa,EAAE,EACfE,EAAiB,EAAE,EACnBE,EAAgB,IAAI,EACpBM,EAAa,MAAM,EAEnB,GAAI,CACA,MAAMO,EAAc,MAAMC,EAAgBxB,CAAM,EAChD,UAAWyB,KAAQF,EAAe,MAAMG,EAASD,CAAI,EAGrD,GAFArB,EAAkBmB,CAAW,EAEzBA,EAAY,OAAS,EAAG,CACxB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tC,GAAiBmC,EAAAA,KAAC,SAAA,CAAO,QAAS,IAAM1B,EAAa,QAAQ,EAAG,UAAW,6CAA6CD,IAAc,SAAW,8BAAgC,gBAAgB,GAAI,SAAA,CAAAyB,EAAAA,IAACM,EAAA,EAAc,EAAE,SAAA,CAAA,CAAO,CAAA,EAClO,QACC,MAAA,CAAI,UAAU,8BACV,SAAAnC,GAAa,CAACR,EAAe,OAASqC,EAAAA,IAAC,MAAA,CAAI,UAAU,0CAA0C,SAAAA,EAAAA,IAACO,IAAc,CAAA,CAAE,EAASR,GAAc,CAC5I,CAAA,EACJ,EAEAG,EAAAA,KAAC,MAAA,CAAI,UAAU,8DACX,SAAA,CAAAF,EAAAA,IAAC,WAAA,CAAS,MAAOxC,EAAQ,SAAWgD,GAAM/C,EAAU+C,EAAE,OAAO,KAAK,EAAG,YAAY,2DAA2D,UAAU,sFAAqF,EAC1OR,EAAAA,IAAC,UAAO,QAASpB,EAAgB,SAAUT,EAAW,UAAU,2EAC5D,SAAAA,EAAY+B,EAAAA,KAAAO,EAAAA,SAAA,CAAE,SAAA,CAAAT,EAAAA,IAACO,EAAA,EAAe,EAAE,gBAAA,CAAA,CAAc,EAAM,mBACzD,EACElC,GAAS2B,EAAAA,IAAC,IAAA,CAAE,UAAU,wCAAyC,SAAA3B,CAAA,CAAM,CAAA,CAAA,CAC3E,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiImageGenerator-Dy58AZjY.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as n,j as e}from"./react-D_B_5QVd.js";import{O as p,Q as h,L as c,R as b}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const A=()=>{const[t,m]=n.useState("A photorealistic image of a futuristic city at sunset, with flying cars."),[a,i]=n.useState(null),[s,d]=n.useState(!1),[o,l]=n.useState(""),g=n.useCallback(async()=>{if(!t.trim()){l("Please enter a prompt to generate an image.");return}d(!0),l(""),i(null);try{const r=await p(t);i(r)}catch(r){const u=r instanceof Error?r.message:"An unknown error occurred.";l(`Failed to generate image: ${u}`)}finally{d(!1)}},[t]),x=()=>{if(!a)return;const r=document.createElement("a");r.href=a,r.download=`${t.slice(0,30).replace(/\s/g,"_")}.png`,document.body.appendChild(r),r.click(),document.body.removeChild(r)};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-text-primary-light dark:text-text-primary-dark flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"AI Image Generator"})]}),e.jsx("p",{className:"text-text-secondary-light dark:text-text-secondary-dark mt-1",children:"Generate stunning, high-quality images from text prompts using Imagen 3."})]}),e.jsxs("div",{className:"flex flex-col gap-4 mb-4",children:[e.jsx("label",{htmlFor:"prompt-input",className:"text-sm font-medium text-text-secondary-light dark:text-text-secondary-dark",children:"Your Prompt"}),e.jsx("textarea",{id:"prompt-input",value:t,onChange:r=>m(r.target.value),placeholder:"e.g., A cute cat wearing a wizard hat",className:"w-full p-3 rounded-md bg-background-light dark:bg-surface-dark border border-border-light dark:border-border-dark focus:ring-2 focus:ring-primary focus:outline-none resize-y",rows:3}),e.jsx("button",{onClick:g,disabled:s,className:"btn-primary w-full flex items-center justify-center px-6 py-3",children:s?e.jsx(c,{}):"Generate Image"})]}),e.jsxs("div",{className:"flex-grow flex items-center justify-center bg-background-light dark:bg-background-dark border-2 border-dashed border-border-light dark:border-border-dark rounded-lg p-4 relative",children:[s&&e.jsx(c,{}),o&&e.jsx("p",{className:"text-red-500 text-center",children:o}),a&&!s&&e.jsxs(e.Fragment,{children:[e.jsx("img",{src:a,alt:"Generated by AI",className:"max-w-full max-h-full object-contain rounded-md shadow-lg"}),e.jsx("button",{onClick:x,className:"absolute top-4 right-4 p-2 bg-slate-800/50 text-white rounded-full hover:bg-slate-700/70 backdrop-blur-sm",title:"Download Image",children:e.jsx(b,{})})]}),!s&&!a&&!o&&e.jsx("div",{className:"text-center text-text-secondary-light dark:text-text-secondary-dark",children:e.jsx("p",{children:"Your generated image will appear here."})})]})]})};export{A as AiImageGenerator};
|
| 2 |
-
//# sourceMappingURL=AiImageGenerator-Dy58AZjY.js.map
|
|
|
|
|
|
|
|
|
assets/AiImageGenerator-Dy58AZjY.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiImageGenerator-Dy58AZjY.js","sources":["../../components/features/AiImageGenerator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { generateImage } from '../../services/geminiService.ts';\nimport { ImageGeneratorIcon } from '../icons/CustomFeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { ArrowDownTrayIcon } from '../icons/InterfaceIcons.tsx';\n\nexport const AiImageGenerator: React.FC = () => {\n const [prompt, setPrompt] = useState<string>('A photorealistic image of a futuristic city at sunset, with flying cars.');\n const [imageUrl, setImageUrl] = useState<string | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n if (!prompt.trim()) {\n setError('Please enter a prompt to generate an image.');\n return;\n }\n setIsLoading(true);\n setError('');\n setImageUrl(null);\n try {\n const resultUrl = await generateImage(prompt);\n setImageUrl(resultUrl);\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate image: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [prompt]);\n \n const handleDownload = () => {\n if (!imageUrl) return;\n const link = document.createElement('a');\n link.href = imageUrl;\n link.download = `${prompt.slice(0, 30).replace(/\\s/g, '_')}.png`;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-text-primary-light dark:text-text-primary-dark flex items-center\">\n <ImageGeneratorIcon />\n <span className=\"ml-3\">AI Image Generator</span>\n </h1>\n <p className=\"text-text-secondary-light dark:text-text-secondary-dark mt-1\">Generate stunning, high-quality images from text prompts using Imagen 3.</p>\n </header>\n \n <div className=\"flex flex-col gap-4 mb-4\">\n <label htmlFor=\"prompt-input\" className=\"text-sm font-medium text-text-secondary-light dark:text-text-secondary-dark\">Your Prompt</label>\n <textarea\n id=\"prompt-input\"\n value={prompt}\n onChange={(e) => setPrompt(e.target.value)}\n placeholder=\"e.g., A cute cat wearing a wizard hat\"\n className=\"w-full p-3 rounded-md bg-background-light dark:bg-surface-dark border border-border-light dark:border-border-dark focus:ring-2 focus:ring-primary focus:outline-none resize-y\"\n rows={3}\n />\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary w-full flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Generate Image'}\n </button>\n </div>\n\n <div className=\"flex-grow flex items-center justify-center bg-background-light dark:bg-background-dark border-2 border-dashed border-border-light dark:border-border-dark rounded-lg p-4 relative\">\n {isLoading && <LoadingSpinner />}\n {error && <p className=\"text-red-500 text-center\">{error}</p>}\n {imageUrl && !isLoading && (\n <>\n <img src={imageUrl} alt=\"Generated by AI\" className=\"max-w-full max-h-full object-contain rounded-md shadow-lg\" />\n <button \n onClick={handleDownload}\n className=\"absolute top-4 right-4 p-2 bg-slate-800/50 text-white rounded-full hover:bg-slate-700/70 backdrop-blur-sm\"\n title=\"Download Image\"\n >\n <ArrowDownTrayIcon />\n </button>\n </>\n )}\n {!isLoading && !imageUrl && !error && (\n <div className=\"text-center text-text-secondary-light dark:text-text-secondary-dark\">\n <p>Your generated image will appear here.</p>\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["AiImageGenerator","prompt","setPrompt","useState","imageUrl","setImageUrl","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","resultUrl","generateImage","err","errorMessage","handleDownload","link","jsxs","jsx","ImageGeneratorIcon","e","LoadingSpinner","Fragment","ArrowDownTrayIcon"],"mappings":"6RAOO,MAAMA,EAA6B,IAAM,CAC5C,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAiB,0EAA0E,EACjH,CAACC,EAAUC,CAAW,EAAIF,EAAAA,SAAwB,IAAI,EACtD,CAACG,EAAWC,CAAY,EAAIJ,EAAAA,SAAkB,EAAK,EACnD,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAiB,EAAE,EAEvCO,EAAiBC,EAAAA,YAAY,SAAY,CAC3C,GAAI,CAACV,EAAO,OAAQ,CAChBQ,EAAS,6CAA6C,EACtD,MACJ,CACAF,EAAa,EAAI,EACjBE,EAAS,EAAE,EACXJ,EAAY,IAAI,EAChB,GAAI,CACA,MAAMO,EAAY,MAAMC,EAAcZ,CAAM,EAC5CI,EAAYO,CAAS,CACzB,OAASE,EAAK,CACV,MAAMC,EAAeD,aAAe,MAAQA,EAAI,QAAU,6BAC1DL,EAAS,6BAA6BM,CAAY,EAAE,CACxD,QAAA,CACIR,EAAa,EAAK,CACtB,CACJ,EAAG,CAACN,CAAM,CAAC,EAELe,EAAiB,IAAM,CACzB,GAAI,CAACZ,EAAU,OACf,MAAMa,EAAO,SAAS,cAAc,GAAG,EACvCA,EAAK,KAAOb,EACZa,EAAK,SAAW,GAAGhB,EAAO,MAAM,EAAG,EAAE,EAAE,QAAQ,MAAO,GAAG,CAAC,OAC1D,SAAS,KAAK,YAAYgB,CAAI,EAC9BA,EAAK,MAAA,EACL,SAAS,KAAK,YAAYA,CAAI,CAClC,EAEA,OACIC,EAAAA,KAAC,MAAA,CAAI,UAAU,yCACX,SAAA,CAAAA,EAAAA,KAAC,SAAA,CAAO,UAAU,OACd,SAAA,CAAAA,EAAAA,KAAC,KAAA,CAAG,UAAU,2FACV,SAAA,CA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@@
|
|
| 1 |
-
import{r as t,j as e}from"./react-D_B_5QVd.js";import{w as j,S as g,L as x,M as y}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const b="function my_func(x,y){return x+y;}",N=`- Use camelCase for function names.
|
| 2 |
-
- Add a space after commas in argument lists.
|
| 3 |
-
- Use semicolons at the end of statements.`,I=()=>{const[l,f]=t.useState(b),[r,u]=t.useState(N),[a,c]=t.useState(""),[n,m]=t.useState(!1),[i,d]=t.useState(""),p=t.useCallback(async()=>{if(!l.trim()||!r.trim()){d("Please provide both code and a style guide.");return}m(!0),d(""),c("");try{const s=j({code:l,styleGuide:r});let o="";for await(const h of s)o+=h,c(o)}catch(s){const o=s instanceof Error?s.message:"An unknown error occurred.";d(`Failed to transfer style: ${o}`)}finally{m(!1)}},[l,r]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(g,{}),e.jsx("span",{className:"ml-3",children:"AI Code Style Transfer"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Rewrite code to match a specific style guide using AI."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full gap-4",children:[e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{htmlFor:"input-code",className:"text-sm font-medium text-slate-400 mb-2",children:"Original Code"}),e.jsx("textarea",{id:"input-code",value:l,onChange:s=>f(s.target.value),className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"})]}),e.jsxs("div",{className:"flex flex-col flex-1 min-h-0",children:[e.jsx("label",{htmlFor:"style-guide",className:"text-sm font-medium text-slate-400 mb-2",children:"Style Guide"}),e.jsx("textarea",{id:"style-guide",value:r,onChange:s=>u(s.target.value),className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"})]})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400",children:"Rewritten Code"}),e.jsx("button",{onClick:p,disabled:n,className:"btn-primary flex items-center justify-center px-4 py-1 text-sm",children:n?e.jsx(x,{}):"Rewrite Code"})]}),e.jsxs("div",{className:"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[n&&!a&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(x,{})}),i&&e.jsx("p",{className:"p-4 text-red-400",children:i}),a&&e.jsx(y,{content:a}),!n&&!a&&!i&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"Rewritten code will appear here."})]})]})]})]})};export{I as AiStyleTransfer};
|
| 4 |
-
//# sourceMappingURL=AiStyleTransfer-CNrZDb1L.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiStyleTransfer-CNrZDb1L.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiStyleTransfer-CNrZDb1L.js","sources":["../../components/features/AiStyleTransfer.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { transferCodeStyleStream } from '../../services/geminiService.ts';\nimport { SparklesIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst exampleCode = `function my_func(x,y){return x+y;}`;\nconst exampleStyleGuide = `- Use camelCase for function names.\n- Add a space after commas in argument lists.\n- Use semicolons at the end of statements.`;\n\nexport const AiStyleTransfer: React.FC = () => {\n const [inputCode, setInputCode] = useState<string>(exampleCode);\n const [styleGuide, setStyleGuide] = useState<string>(exampleStyleGuide);\n const [outputCode, setOutputCode] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n if (!inputCode.trim() || !styleGuide.trim()) {\n setError('Please provide both code and a style guide.');\n return;\n }\n setIsLoading(true);\n setError('');\n setOutputCode('');\n try {\n const stream = transferCodeStyleStream({ code: inputCode, styleGuide });\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setOutputCode(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to transfer style: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [inputCode, styleGuide]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <SparklesIcon />\n <span className=\"ml-3\">AI Code Style Transfer</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Rewrite code to match a specific style guide using AI.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full gap-4\">\n <div className=\"flex flex-col flex-1 min-h-0\">\n <label htmlFor=\"input-code\" className=\"text-sm font-medium text-slate-400 mb-2\">Original Code</label>\n <textarea\n id=\"input-code\"\n value={inputCode}\n onChange={(e) => setInputCode(e.target.value)}\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n </div>\n <div className=\"flex flex-col flex-1 min-h-0\">\n <label htmlFor=\"style-guide\" className=\"text-sm font-medium text-slate-400 mb-2\">Style Guide</label>\n <textarea\n id=\"style-guide\"\n value={styleGuide}\n onChange={(e) => setStyleGuide(e.target.value)}\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n </div>\n </div>\n <div className=\"flex flex-col h-full\">\n <div className=\"flex justify-between items-center mb-2\">\n <label className=\"text-sm font-medium text-slate-400\">Rewritten Code</label>\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary flex items-center justify-center px-4 py-1 text-sm\"\n >\n {isLoading ? <LoadingSpinner /> : 'Rewrite Code'}\n </button>\n </div>\n <div className=\"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && !outputCode && <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>}\n {error && <p className=\"p-4 text-red-400\">{error}</p>}\n {outputCode && <MarkdownRenderer content={outputCode} />}\n {!isLoading && !outputCode && !error && <div className=\"text-slate-500 h-full flex items-center justify-center\">Rewritten code will appear here.</div>}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleCode","exampleStyleGuide","AiStyleTransfer","inputCode","setInputCode","useState","styleGuide","setStyleGuide","outputCode","setOutputCode","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","stream","transferCodeStyleStream","fullResponse","chunk","err","errorMessage","jsxs","jsx","SparklesIcon","e","LoadingSpinner","MarkdownRenderer"],"mappings":"6RAOA,MAAMA,EAAc,qCACdC,EAAoB;AAAA;AAAA,4CAIbC,EAA4B,IAAM,CAC3C,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAiBL,CAAW,EACxD,CAACM,EAAYC,CAAa,EAAIF,EAAAA,SAAiBJ,CAAiB,EAChE,CAACO,EAAYC,CAAa,EAAIJ,EAAAA,SAAiB,EAAE,EACjD,CAACK,EAAWC,CAAY,EAAIN,EAAAA,SAAkB,EAAK,EACnD,CAACO,EAAOC,CAAQ,EAAIR,EAAAA,SAAiB,EAAE,EAEvCS,EAAiBC,EAAAA,YAAY,SAAY,CAC3C,GAAI,CAACZ,EAAU,KAAA,GAAU,CAACG,EAAW,OAAQ,CACzCO,EAAS,6CAA6C,EACtD,MACJ,CACAF,EAAa,EAAI,EACjBE,EAAS,EAA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AckB,EAAE,OAAO,KAAK,EAC7C,UAAU,6FAAA,CAAA,CACd,CAAA,CACJ,CAAA,EACJ,EACAH,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACV,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,yCACZ,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,qCAAqC,SAAA,iBAAc,EACpEA,EAAAA,IAAC,SAAA,CACG,QAAST,EACT,SAAUJ,EACV,UAAU,iEAET,SAAAA,EAAYa,EAAAA,IAACG,EAAA,CAAA,CAAe,EAAK,cAAA,CAAA,CACtC,EACJ,EACAJ,EAAAA,KAAC,MAAA,CAAI,UAAU,sFACV,SAAA,CAAAZ,GAAa,CAACF,GAAce,EAAAA,IAAC,MAAA,CAAI,UAAU,0CAA0C,SAAAA,EAAAA,IAACG,IAAe,CAAA,CAAE,EACvGd,GAASW,EAAAA,IAAC,IAAA,CAAE,UAAU,mBAAoB,SAAAX,EAAM,EAChDJ,GAAce,EAAAA,IAACI,EAAA,CAAiB,QAASnB,CAAA,CAAY,EACpD,CAACE,GAAa,CAACF,GAAc,CAACI,GAASW,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,kCAAA,CAAgC,CAAA,CAAA,CACrJ,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AiUnitTestGenerator-CfYJVzr-.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./react-D_B_5QVd.js";import{d as p,B as h,L as m,M as g}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const j=`import React from 'react';
|
| 2 |
-
|
| 3 |
-
export const Greeting = ({ name }) => {
|
| 4 |
-
if (!name) {
|
| 5 |
-
return <div>Hello, Guest!</div>;
|
| 6 |
-
}
|
| 7 |
-
return <div>Hello, {name}!</div>;
|
| 8 |
-
};`,k=()=>{const[r,x]=s.useState(j),[a,i]=s.useState(""),[l,d]=s.useState(!1),[o,c]=s.useState(""),f=s.useCallback(async()=>{if(!r.trim()){c("Please enter some code to generate tests for.");return}d(!0),c(""),i("");try{const t=p(r);let n="";for await(const u of t)n+=u,i(n)}catch(t){const n=t instanceof Error?t.message:"An unknown error occurred.";c(`Failed to generate tests: ${n}`)}finally{d(!1)}},[r]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"AI Unit Test Generator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Provide a function or component and let AI write the tests."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"code-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Source Code"}),e.jsx("textarea",{id:"code-input",value:r,onChange:t=>x(t.target.value),placeholder:"Paste your source code here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none"}),e.jsx("button",{onClick:f,disabled:l,className:"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3",children:l?e.jsx(m,{}):"Generate Unit Tests"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Generated Tests"}),e.jsxs("div",{className:"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[l&&!a&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(m,{})}),o&&e.jsx("p",{className:"p-4 text-red-400",children:o}),a&&e.jsx(g,{content:a}),!l&&!a&&!o&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"The generated tests will appear here."})]})]})]})]})};export{k as AiUnitTestGenerator};
|
| 9 |
-
//# sourceMappingURL=AiUnitTestGenerator-CfYJVzr-.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AiUnitTestGenerator-CfYJVzr-.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AiUnitTestGenerator-CfYJVzr-.js","sources":["../../components/features/AiUnitTestGenerator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { generateUnitTestsStream } from '../../services/geminiService.ts';\nimport { BeakerIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst exampleCode = `import React from 'react';\n\nexport const Greeting = ({ name }) => {\n if (!name) {\n return <div>Hello, Guest!</div>;\n }\n return <div>Hello, {name}!</div>;\n};`;\n\nexport const AiUnitTestGenerator: React.FC = () => {\n const [code, setCode] = useState<string>(exampleCode);\n const [tests, setTests] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n if (!code.trim()) {\n setError('Please enter some code to generate tests for.');\n return;\n }\n setIsLoading(true);\n setError('');\n setTests('');\n try {\n const stream = generateUnitTestsStream(code);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setTests(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate tests: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [code]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <BeakerIcon />\n <span className=\"ml-3\">AI Unit Test Generator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Provide a function or component and let AI write the tests.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"code-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Source Code</label>\n <textarea\n id=\"code-input\"\n value={code}\n onChange={(e) => setCode(e.target.value)}\n placeholder=\"Paste your source code here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none\"\n />\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Generate Unit Tests'}\n </button>\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Generated Tests</label>\n <div className=\"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && !tests && (\n <div className=\"flex items-center justify-center h-full\">\n <LoadingSpinner />\n </div>\n )}\n {error && <p className=\"p-4 text-red-400\">{error}</p>}\n {tests && <MarkdownRenderer content={tests} />}\n {!isLoading && !tests && !error && (\n <div className=\"text-slate-500 h-full flex items-center justify-center\">\n The generated tests will appear here.\n </div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleCode","AiUnitTestGenerator","code","setCode","useState","tests","setTests","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","stream","generateUnitTestsStream","fullResponse","chunk","err","errorMessage","jsxs","jsx","BeakerIcon","e","LoadingSpinner","MarkdownRenderer"],"mappings":"6RAOA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASPC,EAAgC,IAAM,CAC/C,KAAM,CAACC,EAA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EAAQmB,EAAE,OAAO,KAAK,EACvC,YAAY,iCACZ,UAAU,+JAAA,CAAA,EAEdF,EAAAA,IAAC,SAAA,CACG,QAAST,EACT,SAAUJ,EACV,UAAU,qEAET,SAAAA,EAAYa,EAAAA,IAACG,EAAA,CAAA,CAAe,EAAK,qBAAA,CAAA,CACtC,EACJ,EACAJ,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,kBAAe,EAC1ED,EAAAA,KAAC,MAAA,CAAI,UAAU,sFACV,SAAA,CAAAZ,GAAa,CAACF,GACXe,EAAAA,IAAC,MAAA,CAAI,UAAU,0CACX,SAAAA,EAAAA,IAACG,IAAe,CAAA,CACpB,EAEHd,GAASW,EAAAA,IAAC,IAAA,CAAE,UAAU,mBAAoB,SAAAX,EAAM,EAChDJ,GAASe,EAAAA,IAACI,EAAA,CAAiB,QAASnB,CAAA,CAAO,EAC3C,CAACE,GAAa,CAACF,GAAS,CAACI,GACtBW,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,uCAAA,CAExE,CAAA,CAAA,CAER,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AsyncCallTreeViewer-Dmje5dK2.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
| 1 |
-
import{r as d,j as e,R as h}from"./react-D_B_5QVd.js";import{T as u}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const p=`{
|
| 2 |
-
"name": "startApp",
|
| 3 |
-
"duration": 500,
|
| 4 |
-
"children": [
|
| 5 |
-
{
|
| 6 |
-
"name": "fetchUserData",
|
| 7 |
-
"duration": 300,
|
| 8 |
-
"children": [
|
| 9 |
-
{ "name": "authenticate", "duration": 100 },
|
| 10 |
-
{ "name": "fetchProfile", "duration": 150 }
|
| 11 |
-
]
|
| 12 |
-
},
|
| 13 |
-
{
|
| 14 |
-
"name": "loadInitialAssets",
|
| 15 |
-
"duration": 450,
|
| 16 |
-
"children": [
|
| 17 |
-
{ "name": "loadImage.png", "duration": 200 },
|
| 18 |
-
{ "name": "loadScript.js", "duration": 250 }
|
| 19 |
-
]
|
| 20 |
-
}
|
| 21 |
-
]
|
| 22 |
-
}`,x=({node:s,level:i,maxDuration:t})=>{const[r,c]=h.useState(!0),l=s.children&&s.children.length>0;return e.jsxs("div",{className:"my-1",children:[e.jsxs("div",{className:"flex items-center p-2 rounded-md hover:bg-slate-800/50",style:{paddingLeft:`${i*20+8}px`},children:[l&&e.jsx("button",{onClick:()=>c(!r),className:"mr-2 text-slate-500 w-4 h-4 flex-shrink-0 transform transition-transform ${isOpen ? 'rotate-90' : ''}",children:"▶"}),!l&&e.jsx("div",{className:"w-6 mr-2 flex-shrink-0"}),e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-4",children:[e.jsx("span",{className:"truncate",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("div",{className:"w-24 h-4 bg-slate-700/50 rounded-full overflow-hidden",children:e.jsx("div",{className:"h-4 bg-cyan-500",style:{width:`${s.duration/t*100}%`}})}),e.jsxs("span",{className:"text-cyan-400 w-16 text-right",children:[s.duration.toFixed(0),"ms"]})]})]})]}),r&&l&&e.jsx("div",{children:s.children.map((a,n)=>e.jsx(x,{node:a,level:i+1,maxDuration:t},n))})]})},S=()=>{const[s,i]=d.useState(p),[t,r]=d.useState(""),{treeData:c,maxDuration:l}=d.useMemo(()=>{try{const a=JSON.parse(s);let n=0;const m=o=>{o.duration>n&&(n=o.duration),o.children&&o.children.forEach(m)};return m(a),r(""),{treeData:a,maxDuration:n}}catch{return r("Invalid JSON format."),{treeData:null,maxDuration:0}}},[s]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl flex items-center",children:[e.jsx(u,{}),e.jsx("span",{className:"ml-3",children:"Async Call Tree Viewer"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Paste a JSON structure to visualize an asynchronous function call tree."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"json-input",className:"text-sm font-medium text-slate-400 mb-2",children:"JSON Input"}),e.jsx("textarea",{id:"json-input",value:s,onChange:a=>i(a.target.value),className:`flex-grow p-4 bg-slate-900 border ${t?"border-red-500":"border-slate-700"} rounded-md resize-none font-mono text-sm`,spellCheck:"false"}),t&&e.jsx("p",{className:"text-red-400 text-xs mt-1",children:t})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Visual Tree"}),e.jsx("div",{className:"flex-grow bg-slate-900/50 p-4 rounded-lg text-sm overflow-y-auto border border-slate-700",children:c?e.jsx(x,{node:c,level:0,maxDuration:l}):e.jsx("div",{className:"text-slate-500",children:t||"Enter valid JSON to see the tree."})})]})]})]})};export{S as AsyncCallTreeViewer};
|
| 23 |
-
//# sourceMappingURL=AsyncCallTreeViewer-Dmje5dK2.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/AsyncCallTreeViewer-Dmje5dK2.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AsyncCallTreeViewer-Dmje5dK2.js","sources":["../../components/features/AsyncCallTreeViewer.tsx"],"sourcesContent":["\nimport React, { useState, useMemo } from 'react';\nimport { ChartBarIcon } from '../icons/FeatureIcons.tsx';\n\ninterface CallNode {\n name: string;\n duration: number;\n children?: CallNode[];\n}\n\nconst exampleJson = `{\n \"name\": \"startApp\",\n \"duration\": 500,\n \"children\": [\n {\n \"name\": \"fetchUserData\",\n \"duration\": 300,\n \"children\": [\n { \"name\": \"authenticate\", \"duration\": 100 },\n { \"name\": \"fetchProfile\", \"duration\": 150 }\n ]\n },\n {\n \"name\": \"loadInitialAssets\",\n \"duration\": 450,\n \"children\": [\n { \"name\": \"loadImage.png\", \"duration\": 200 },\n { \"name\": \"loadScript.js\", \"duration\": 250 }\n ]\n }\n ]\n}`;\n\n\nconst TreeNode: React.FC<{ node: CallNode, level: number, maxDuration: number }> = ({ node, level, maxDuration }) => {\n const [isOpen, setIsOpen] = React.useState(true);\n const hasChildren = node.children && node.children.length > 0;\n\n return (\n <div className=\"my-1\">\n <div\n className=\"flex items-center p-2 rounded-md hover:bg-slate-800/50\"\n style={{ paddingLeft: `${level * 20 + 8}px` }}\n >\n {hasChildren && (\n <button onClick={() => setIsOpen(!isOpen)} className=\"mr-2 text-slate-500 w-4 h-4 flex-shrink-0 transform transition-transform ${isOpen ? 'rotate-90' : ''}\">\n ▶\n </button>\n )}\n {!hasChildren && <div className=\"w-6 mr-2 flex-shrink-0\" />}\n <div className=\"flex-grow flex items-center justify-between gap-4\">\n <span className=\"truncate\">{node.name}</span>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <div className=\"w-24 h-4 bg-slate-700/50 rounded-full overflow-hidden\">\n <div className=\"h-4 bg-cyan-500\" style={{ width: `${(node.duration / maxDuration) * 100}%` }}/>\n </div>\n <span className=\"text-cyan-400 w-16 text-right\">{node.duration.toFixed(0)}ms</span>\n </div>\n </div>\n </div>\n {isOpen && hasChildren && (\n <div>\n {node.children!.map((child, index) => (\n <TreeNode key={index} node={child} level={level + 1} maxDuration={maxDuration} />\n ))}\n </div>\n )}\n </div>\n );\n};\n\n\nexport const AsyncCallTreeViewer: React.FC = () => {\n const [jsonInput, setJsonInput] = useState(exampleJson);\n const [error, setError] = useState('');\n\n const { treeData, maxDuration } = useMemo(() => {\n try {\n const data: CallNode = JSON.parse(jsonInput);\n let max = 0;\n const findMax = (node: CallNode) => {\n if (node.duration > max) max = node.duration;\n if (node.children) node.children.forEach(findMax);\n };\n findMax(data);\n setError('');\n return { treeData: data, maxDuration: max };\n } catch (e) {\n setError('Invalid JSON format.');\n return { treeData: null, maxDuration: 0 };\n }\n }, [jsonInput]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl flex items-center\">\n <ChartBarIcon />\n <span className=\"ml-3\">Async Call Tree Viewer</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Paste a JSON structure to visualize an asynchronous function call tree.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"json-input\" className=\"text-sm font-medium text-slate-400 mb-2\">JSON Input</label>\n <textarea\n id=\"json-input\"\n value={jsonInput}\n onChange={e => setJsonInput(e.target.value)}\n className={`flex-grow p-4 bg-slate-900 border ${error ? 'border-red-500' : 'border-slate-700'} rounded-md resize-none font-mono text-sm`}\n spellCheck=\"false\"\n />\n {error && <p className=\"text-red-400 text-xs mt-1\">{error}</p>}\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Visual Tree</label>\n <div className=\"flex-grow bg-slate-900/50 p-4 rounded-lg text-sm overflow-y-auto border border-slate-700\">\n {treeData ? <TreeNode node={treeData} level={0} maxDuration={maxDuration} /> : <div className=\"text-slate-500\">{error || 'Enter valid JSON to see the tree.'}</div>}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleJson","TreeNode","node","level","maxDuration","isOpen","setIsOpen","React","hasChildren","jsxs","jsx","child","index","AsyncCallTreeViewer","jsonInput","setJsonInput","useState","error","setError","treeData","useMemo","data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,IAAC,WAAA,CACG,GAAG,aACH,MAAOI,EACP,SAAUW,GAAKV,EAAaU,EAAE,OAAO,KAAK,EAC1C,UAAW,qCAAqCR,EAAQ,iBAAmB,kBAAkB,4CAC7F,WAAW,OAAA,CAAA,EAEdA,GAASP,EAAAA,IAAC,IAAA,CAAE,UAAU,4BAA6B,SAAAO,CAAA,CAAM,CAAA,EAC9D,EACAR,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,cAAW,QACrE,MAAA,CAAI,UAAU,2FACV,SAAAS,EAAWT,MAACT,GAAS,KAAMkB,EAAU,MAAO,EAAG,YAAAf,CAAA,CAA0B,EAAKM,EAAAA,IAAC,MAAA,CAAI,UAAU,iBAAkB,SAAAO,GAAS,oCAAoC,CAAA,CACjK,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/AudioToCode-B0PlwkeG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./react-D_B_5QVd.js";import{U as y,V as v,L as h,M as N}from"./index-Dg9as_wf.js";import{a as R}from"./fileUtils-Cip6XKeN.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const B=()=>{const[o,f]=s.useState(!1),[n,d]=s.useState(!1),[i,x]=s.useState(""),[u,c]=s.useState(""),r=s.useRef(null),l=s.useRef([]),g=async()=>{if(c(""),x(""),!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){c("Audio recording is not supported by your browser.");return}try{const t=await navigator.mediaDevices.getUserMedia({audio:!0});r.current=new MediaRecorder(t),r.current.ondataavailable=a=>{l.current.push(a.data)},r.current.onstop=j,r.current.start(),f(!0)}catch{c("Microphone access was denied. Please enable it in your browser settings.")}},b=()=>{r.current&&o&&(r.current.stop(),r.current.stream.getTracks().forEach(t=>t.stop()),f(!1),d(!0))},j=s.useCallback(async()=>{if(l.current.length===0){d(!1);return}const t=new Blob(l.current,{type:"audio/webm"});l.current=[];try{const a=await R(t),m=y(a,"audio/webm");let p="";for await(const w of m)p+=w,x(p)}catch(a){const m=a instanceof Error?a.message:"An unknown error occurred.";c(`Failed to transcribe audio: ${m}`)}finally{d(!1)}},[]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(v,{}),e.jsx("span",{className:"ml-3",children:"AI Audio-to-Code"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Speak your programming ideas and watch them turn into code."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0",children:[e.jsxs("div",{className:"flex flex-col items-center justify-center bg-slate-800/50 p-6 rounded-lg",children:[e.jsx("button",{onClick:o?b:g,className:`w-32 h-32 rounded-full flex items-center justify-center text-white font-bold text-lg transition-all ${o?"bg-red-500 animate-pulse":"bg-cyan-500"}`,disabled:n,children:n?e.jsx(h,{}):o?"Stop":"Record"}),e.jsx("p",{className:"mt-4 text-slate-400",children:n?"Transcribing...":o?"Recording in progress...":"Click to start recording"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Generated Code"}),e.jsxs("div",{className:"flex-grow p-1 bg-slate-900 border border-slate-700 rounded-md overflow-y-auto",children:[n&&!i&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(h,{})}),u&&e.jsx("p",{className:"p-4 text-red-400",children:u}),i&&e.jsx(N,{content:i}),!n&&!i&&!u&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"Code will appear here."})]})]})]})]})};export{B as AudioToCode};
|
| 2 |
-
//# sourceMappingURL=AudioToCode-B0PlwkeG.js.map
|
|
|
|
|
|
|
|
|
assets/AudioToCode-B0PlwkeG.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"AudioToCode-B0PlwkeG.js","sources":["../../components/features/AudioToCode.tsx"],"sourcesContent":["\nimport React, { useState, useRef, useCallback } from 'react';\nimport { transcribeAudioToCodeStream } from '../../services/geminiService.ts';\nimport { MicrophoneIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\nimport { blobToBase64 } from '../../services/fileUtils.ts';\n\nexport const AudioToCode: React.FC = () => {\n const [isRecording, setIsRecording] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n const [code, setCode] = useState('');\n const [error, setError] = useState('');\n const mediaRecorderRef = useRef<MediaRecorder | null>(null);\n const audioChunksRef = useRef<Blob[]>([]);\n\n const handleStartRecording = async () => {\n setError('');\n setCode('');\n if (!navigator.mediaDevices || !navigator.mediaDevices.getUserMedia) {\n setError('Audio recording is not supported by your browser.');\n return;\n }\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ audio: true });\n mediaRecorderRef.current = new MediaRecorder(stream);\n mediaRecorderRef.current.ondataavailable = event => {\n audioChunksRef.current.push(event.data);\n };\n mediaRecorderRef.current.onstop = handleTranscribe;\n mediaRecorderRef.current.start();\n setIsRecording(true);\n } catch (err) {\n setError('Microphone access was denied. Please enable it in your browser settings.');\n }\n };\n\n const handleStopRecording = () => {\n if (mediaRecorderRef.current && isRecording) {\n mediaRecorderRef.current.stop();\n // Stop all media tracks to turn off the recording indicator\n mediaRecorderRef.current.stream.getTracks().forEach(track => track.stop());\n setIsRecording(false);\n setIsLoading(true);\n }\n };\n\n const handleTranscribe = useCallback(async () => {\n if (audioChunksRef.current.length === 0) {\n setIsLoading(false);\n return;\n }\n const audioBlob = new Blob(audioChunksRef.current, { type: 'audio/webm' });\n audioChunksRef.current = [];\n try {\n const base64Audio = await blobToBase64(audioBlob);\n const stream = transcribeAudioToCodeStream(base64Audio, 'audio/webm');\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setCode(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to transcribe audio: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <MicrophoneIcon />\n <span className=\"ml-3\">AI Audio-to-Code</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Speak your programming ideas and watch them turn into code.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 min-h-0\">\n <div className=\"flex flex-col items-center justify-center bg-slate-800/50 p-6 rounded-lg\">\n <button\n onClick={isRecording ? handleStopRecording : handleStartRecording}\n className={`w-32 h-32 rounded-full flex items-center justify-center text-white font-bold text-lg transition-all ${isRecording ? 'bg-red-500 animate-pulse' : 'bg-cyan-500'}`}\n disabled={isLoading}\n >\n {isLoading ? <LoadingSpinner/> : isRecording ? 'Stop' : 'Record'}\n </button>\n <p className=\"mt-4 text-slate-400\">\n {isLoading ? 'Transcribing...' : isRecording ? 'Recording in progress...' : 'Click to start recording'}\n </p>\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Generated Code</label>\n <div className=\"flex-grow p-1 bg-slate-900 border border-slate-700 rounded-md overflow-y-auto\">\n {isLoading && !code && (\n <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>\n )}\n {error && <p className=\"p-4 text-red-400\">{error}</p>}\n {code && <MarkdownRenderer content={code} />}\n {!isLoading && !code && !error && (\n <div className=\"text-slate-500 h-full flex items-center justify-center\">Code will appear here.</div>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["AudioToCode","isRecording","setIsRecording","useState","isLoading","setIsLoading","code","setCode","error","setError","mediaRecorderRef","useRef","audioChunksRef","handleStartRecording","stream","event","handleTranscribe","handleStopRecording","track","useCallback","audioBlob","base64Audio","blobToBase64","transcribeAudioToCodeStream","fullResponse","chunk","err","errorMessage","jsxs","jsx","MicrophoneIcon","LoadingSpinner","MarkdownRenderer"],"mappings":"yUAQO,MAAMA,EAAwB,IAAM,CACvC,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,EAAK,EAC9C,CAACC,EAAWC,CAAY,EAAIF,EAAAA,SAAS,EAAK,EAC1C,CAACG,EAAMC,CAAO,EAAIJ,EAAAA,SAAS,EAAE,EAC7B,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAS,EAAE,EAC/BO,EAAmBC,EAAAA,OAA6B,IAAI,EACpDC,EAAiBD,EAAAA,OAAe,EAAE,EAElCE,EAAuB,SAAY,CAGrC,GAFAJ,EAAS,EAAE,EACXF,EAAQ,EAAE,EACN,CAAC,UAAU,cAAgB,CAAC,UAAU,aAAa,aAAc,CACjEE,EAAS,mDAAmD,EAC5D,MACJ,CACA,GAAI,CACA,MAAMK,EAAS,MAAM,UAAU,aAAa,aAAa,CAAE,MAAO,GAAM,EACxEJ,EAAiB,QAAU,IAAI,cAAcI,CAAM,EACnDJ,EAAiB,QAAQ,gBAAkBK,GAAS,CAChDH,EAAe,QAAQ,KAAKG,EAAM,IAAI,CAC1C,EACAL,EAAiB,QAAQ,OAASM,EAClCN,EAAiB,QAAQ,MAAA,EACzBR,EAAe,EAAI,CACvB,MAAc,CACVO,EAAS,0EAA0E,CACvF,CACJ,EAEMQ,EAAsB,IAAM,CAC1BP,EAAiB,SAAWT,IAC5BS,EAAiB,QAAQ,KAAA,EAEzBA,EAAiB,QAAQ,OAAO,UAAA,EAAY,QAAQQ,GAASA,EAAM,MAAM,EACzEhB,EAAe,EAAK,EACpBG,EAAa,EAAI,EAEzB,EAEMW,EAAm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F,CAAA,EACJ,EACC2B,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACZ,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,iBAAc,EACzED,EAAAA,KAAC,MAAA,CAAI,UAAU,gFACV,SAAA,CAAAxB,GAAa,CAACE,GACXuB,EAAAA,IAAC,MAAA,CAAI,UAAU,0CAA0C,SAAAA,EAAAA,IAACE,IAAe,CAAA,CAAE,EAE9EvB,GAASqB,EAAAA,IAAC,IAAA,CAAE,UAAU,mBAAoB,SAAArB,EAAM,EAChDF,GAAQuB,EAAAA,IAACG,EAAA,CAAiB,QAAS1B,CAAA,CAAM,EACzC,CAACF,GAAa,CAACE,GAAQ,CAACE,GACrBqB,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,wBAAA,CAAsB,CAAA,CAAA,CAEtG,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/ChangelogGenerator-CwVf8_gS.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./react-D_B_5QVd.js";import{A as h,G as f,L as d,M as p}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const j=`commit 3a4b5c...
|
| 2 |
-
Author: Dev One <dev.one@example.com>
|
| 3 |
-
Date: Mon Jul 15 11:30:00 2024 -0400
|
| 4 |
-
|
| 5 |
-
feat: add user login page
|
| 6 |
-
|
| 7 |
-
commit 1a2b3c...
|
| 8 |
-
Author: Dev Two <dev.two@example.com>
|
| 9 |
-
Date: Mon Jul 15 10:00:00 2024 -0400
|
| 10 |
-
|
| 11 |
-
fix: correct typo in header
|
| 12 |
-
`,k=()=>{const[r,x]=a.useState(j),[s,n]=a.useState(""),[l,c]=a.useState(!1),[i,o]=a.useState(""),g=a.useCallback(async()=>{if(!r.trim()){o("Please paste your git log output.");return}c(!0),o(""),n("");try{const t=h(r);let m="";for await(const u of t)m+=u,n(m)}catch(t){o(t instanceof Error?t.message:"An unknown error occurred.")}finally{c(!1)}},[r]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(f,{}),e.jsx("span",{className:"ml-3",children:"AI Changelog Generator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Generate a markdown changelog from your raw git log."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"commit-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Raw Git Log"}),e.jsx("textarea",{id:"commit-input",value:r,onChange:t=>x(t.target.value),className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"}),e.jsx("button",{onClick:g,disabled:l,className:"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3",children:l?e.jsx(d,{}):"Generate Changelog"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Generated Changelog.md"}),e.jsxs("div",{className:"relative flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[l&&!s&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(d,{})}),i&&e.jsx("p",{className:"text-red-400",children:i}),s&&e.jsx(p,{content:s}),!l&&s&&e.jsx("button",{onClick:()=>navigator.clipboard.writeText(s),className:"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"})]})]})]})]})};export{k as ChangelogGenerator};
|
| 13 |
-
//# sourceMappingURL=ChangelogGenerator-CwVf8_gS.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/ChangelogGenerator-CwVf8_gS.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"ChangelogGenerator-CwVf8_gS.js","sources":["../../components/features/ChangelogGenerator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { generateChangelogFromLogStream } from '../../services/geminiService.ts';\nimport { GitBranchIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst exampleLog = `commit 3a4b5c...\nAuthor: Dev One <dev.one@example.com>\nDate: Mon Jul 15 11:30:00 2024 -0400\n\n feat: add user login page\n\ncommit 1a2b3c...\nAuthor: Dev Two <dev.two@example.com>\nDate: Mon Jul 15 10:00:00 2024 -0400\n\n fix: correct typo in header\n`;\n\nexport const ChangelogGenerator: React.FC = () => {\n const [log, setLog] = useState(exampleLog);\n const [changelog, setChangelog] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState('');\n\n const handleGenerate = useCallback(async () => {\n if (!log.trim()) {\n setError('Please paste your git log output.');\n return;\n }\n setIsLoading(true);\n setError('');\n setChangelog('');\n try {\n const stream = generateChangelogFromLogStream(log);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setChangelog(fullResponse);\n }\n } catch (err) {\n setError(err instanceof Error ? err.message : 'An unknown error occurred.');\n } finally {\n setIsLoading(false);\n }\n }, [log]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <GitBranchIcon />\n <span className=\"ml-3\">AI Changelog Generator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Generate a markdown changelog from your raw git log.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"commit-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Raw Git Log</label>\n <textarea\n id=\"commit-input\"\n value={log}\n onChange={(e) => setLog(e.target.value)}\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n <button onClick={handleGenerate} disabled={isLoading} className=\"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3\">\n {isLoading ? <LoadingSpinner /> : 'Generate Changelog'}\n </button>\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Generated Changelog.md</label>\n <div className=\"relative flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && !changelog && <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>}\n {error && <p className=\"text-red-400\">{error}</p>}\n {changelog && <MarkdownRenderer content={changelog} />}\n {!isLoading && changelog && <button onClick={() => navigator.clipboard.writeText(changelog)} className=\"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button>}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleLog","ChangelogGenerator","log","setLog","useState","changelog","setChangelog","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","stream","generateChangelogFromLogStream","fullResponse","chunk","err","jsxs","jsx","GitBranchIcon","e","LoadingSpinner","MarkdownRenderer"],"mappings":"6RAOA,MAAMA,EAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaNC,EAA+B,IAAM,CAC9C,KAAM,CAACC,EAAKC,CAAM,EAAIC,EAAAA,SAASJ,CAAU,EACnC,CAACK,EAAWC,CAAY,EAAIF,EAAAA,SAAS,EAAE,EACvC,CAACG,EAAWC,CAAY,EAAIJ,EAAA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Ae,EAAK,oBAAA,CACtC,CAAA,EACJ,EACAJ,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,yBAAsB,EACjFD,EAAAA,KAAC,MAAA,CAAI,UAAU,+FACV,SAAA,CAAAX,GAAa,CAACF,GAAac,EAAAA,IAAC,MAAA,CAAI,UAAU,0CAA0C,SAAAA,EAAAA,IAACG,IAAe,CAAA,CAAE,EACtGb,GAASU,EAAAA,IAAC,IAAA,CAAE,UAAU,eAAgB,SAAAV,EAAM,EAC5CJ,GAAac,EAAAA,IAACI,EAAA,CAAiB,QAASlB,CAAA,CAAW,EACnD,CAACE,GAAaF,GAAac,EAAAA,IAAC,UAAO,QAAS,IAAM,UAAU,UAAU,UAAUd,CAAS,EAAG,UAAU,sFAAsF,SAAA,MAAA,CAAI,CAAA,CAAA,CACrM,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CodeDiffGhost-BO5D2V6-.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
| 1 |
-
import{r as l,j as e}from"./react-D_B_5QVd.js";import{E as u}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const h=`function UserProfile({ user }) {
|
| 2 |
-
return (
|
| 3 |
-
<div className="profile">
|
| 4 |
-
<h1>{user.name}</h1>
|
| 5 |
-
<p>{user.email}</p>
|
| 6 |
-
</div>
|
| 7 |
-
);
|
| 8 |
-
}`,x=`function UserProfile({ user }) {
|
| 9 |
-
const { name, email, avatar } = user;
|
| 10 |
-
return (
|
| 11 |
-
<div className="profile-card">
|
| 12 |
-
<img src={avatar} alt={name} />
|
| 13 |
-
<h2>{name}</h2>
|
| 14 |
-
<a href={\`mailto:\${email}\`}>{email}</a>
|
| 15 |
-
</div>
|
| 16 |
-
);
|
| 17 |
-
}`,y=()=>{const[c,d]=l.useState(h),[r,m]=l.useState(x),[n,i]=l.useState(""),[a,o]=l.useState(!1),s=l.useRef(null),f=()=>{s.current&&clearInterval(s.current),o(!0),i(""),s.current=window.setInterval(()=>{i(t=>t.length<r.length?r.substring(0,t.length+1):(s.current&&clearInterval(s.current),o(!1),r))},15)};return l.useEffect(()=>()=>{s.current&&clearInterval(s.current)},[]),e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl flex items-center",children:[e.jsx(u,{}),e.jsx("span",{className:"ml-3",children:"Code Diff Ghost"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:'Visualize code changes with a "ghost typing" effect.'})]}),e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("button",{onClick:f,disabled:a,className:"btn-primary px-6 py-2",children:a?"Visualizing...":"Show Changes"})}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden font-mono text-sm",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"before-code",className:"text-sm font-medium text-slate-400 mb-2",children:"Before"}),e.jsx("textarea",{id:"before-code",value:c,onChange:t=>d(t.target.value),className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md text-red-300 whitespace-pre-wrap resize-none",spellCheck:"false"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"after-code",className:"text-sm font-medium text-slate-400 mb-2",children:"After"}),e.jsxs("div",{className:"relative flex-grow",children:[e.jsx("textarea",{id:"after-code",value:r,onChange:t=>m(t.target.value),className:"absolute inset-0 w-full h-full p-4 bg-slate-900 border border-slate-700 rounded-md text-green-300 whitespace-pre-wrap resize-none z-0",spellCheck:"false"}),(a||n)&&e.jsxs("pre",{className:"absolute inset-0 w-full h-full p-4 bg-slate-900 pointer-events-none text-green-300 whitespace-pre-wrap z-10",children:[n,a&&e.jsx("span",{className:"animate-pulse",children:"|"})]})]})]})]})]})};export{y as CodeDiffGhost};
|
| 18 |
-
//# sourceMappingURL=CodeDiffGhost-BO5D2V6-.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CodeDiffGhost-BO5D2V6-.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CodeDiffGhost-BO5D2V6-.js","sources":["../../components/features/CodeDiffGhost.tsx"],"sourcesContent":["\nimport React, { useState, useEffect, useRef } from 'react';\nimport { EyeIcon } from '../icons/FeatureIcons.tsx';\n\nconst initialOldCode = `function UserProfile({ user }) {\n return (\n <div className=\"profile\">\n <h1>{user.name}</h1>\n <p>{user.email}</p>\n </div>\n );\n}`;\n\nconst initialNewCode = `function UserProfile({ user }) {\n const { name, email, avatar } = user;\n return (\n <div className=\"profile-card\">\n <img src={avatar} alt={name} />\n <h2>{name}</h2>\n <a href={\\`mailto:\\${email}\\`}>{email}</a>\n </div>\n );\n}`;\n\nexport const CodeDiffGhost: React.FC = () => {\n const [oldCode, setOldCode] = useState(initialOldCode);\n const [newCode, setNewCode] = useState(initialNewCode);\n const [typedCode, setTypedCode] = useState('');\n const [isRunning, setIsRunning] = useState(false);\n const intervalRef = useRef<number | null>(null);\n\n const startAnimation = () => {\n if (intervalRef.current) clearInterval(intervalRef.current);\n setIsRunning(true);\n setTypedCode('');\n \n intervalRef.current = window.setInterval(() => {\n setTypedCode(prev => {\n if (prev.length < newCode.length) {\n return newCode.substring(0, prev.length + 1);\n }\n if (intervalRef.current) clearInterval(intervalRef.current);\n setIsRunning(false);\n return newCode;\n });\n }, 15);\n };\n\n useEffect(() => {\n return () => {\n if (intervalRef.current) clearInterval(intervalRef.current);\n };\n }, []);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl flex items-center\">\n <EyeIcon />\n <span className=\"ml-3\">Code Diff Ghost</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Visualize code changes with a \"ghost typing\" effect.</p>\n </header>\n <div className=\"flex justify-center mb-4\">\n <button\n onClick={startAnimation}\n disabled={isRunning}\n className=\"btn-primary px-6 py-2\"\n >\n {isRunning ? 'Visualizing...' : 'Show Changes'}\n </button>\n </div>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden font-mono text-sm\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"before-code\" className=\"text-sm font-medium text-slate-400 mb-2\">Before</label>\n <textarea\n id=\"before-code\"\n value={oldCode}\n onChange={e => setOldCode(e.target.value)}\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md text-red-300 whitespace-pre-wrap resize-none\"\n spellCheck=\"false\"\n />\n </div>\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"after-code\" className=\"text-sm font-medium text-slate-400 mb-2\">After</label>\n <div className=\"relative flex-grow\">\n <textarea\n id=\"after-code\"\n value={newCode}\n onChange={e => setNewCode(e.target.value)}\n className=\"absolute inset-0 w-full h-full p-4 bg-slate-900 border border-slate-700 rounded-md text-green-300 whitespace-pre-wrap resize-none z-0\"\n spellCheck=\"false\"\n />\n {(isRunning || typedCode) && (\n <pre className=\"absolute inset-0 w-full h-full p-4 bg-slate-900 pointer-events-none text-green-300 whitespace-pre-wrap z-10\">\n {typedCode}{isRunning && <span className=\"animate-pulse\">|</span>}\n </pre>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["initialOldCode","initialNewCode","CodeDiffGhost","oldCode","setOldCode","useState","newCode","setNewCode","typedCode","setTypedCode","isRunning","setIsRunning","intervalRef","useRef","startAnimation","prev","useEffect","jsxs","jsx","EyeIcon","e"],"mappings":"wQA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ASJ,EACT,SAAUJ,EACV,UAAU,wBAET,WAAY,iBAAmB,cAAA,CAAA,EAExC,EACAO,EAAAA,KAAC,MAAA,CAAI,UAAU,2FACX,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,MAAC,QAAA,CAAM,QAAQ,cAAc,UAAU,0CAA0C,SAAA,SAAM,EACvFA,EAAAA,IAAC,WAAA,CACG,GAAG,cACH,MAAOf,EACP,SAAUiB,GAAKhB,EAAWgB,EAAE,OAAO,KAAK,EACxC,UAAU,6GACV,WAAW,OAAA,CAAA,CACf,EACJ,EACCH,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACZ,SAAA,CAAAC,MAAC,QAAA,CAAM,QAAQ,aAAa,UAAU,0CAA0C,SAAA,QAAK,EACpFD,EAAAA,KAAC,MAAA,CAAI,UAAU,qBACZ,SAAA,CAAAC,EAAAA,IAAC,WAAA,CACG,GAAG,aACH,MAAOZ,EACP,SAAUc,GAAKb,EAAWa,EAAE,OAAO,KAAK,EACxC,UAAU,wIACV,WAAW,OAAA,CAAA,GAEbV,GAAaF,IACXS,EAAAA,KAAC,MAAA,CAAI,UAAU,8GACV,SAAA,CAAAT,EAAWE,GAAaQ,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAgB,SAAA,GAAA,CAAC,CAAA,CAAA,CAC9D,CAAA,CAAA,CAER,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CodeFormatter-BOOFBlt1.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 1 |
-
import{r as s,j as e}from"./react-D_B_5QVd.js";import{p,o as h,L as d,M as j}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const g=`const MyComponent = (props) => {
|
| 2 |
-
const {name, items}=props
|
| 3 |
-
if(!items || items.length === 0){
|
| 4 |
-
return <p>No items found for {name}</p>;
|
| 5 |
-
}
|
| 6 |
-
return <ul>{items.map(item=> <li key={item.id}>{item.name}</li>)}</ul>
|
| 7 |
-
}`,S=()=>{const[r,x]=s.useState(g),[o,i]=s.useState(""),[a,c]=s.useState(!1),[n,m]=s.useState(""),f=s.useCallback(async()=>{if(!r.trim()){m("Please enter some code to format.");return}c(!0),m(""),i("");try{const t=p(r);let l="";for await(const u of t)l+=u,i(l)}catch(t){const l=t instanceof Error?t.message:"An unknown error occurred.";m(`Failed to format code: ${l}`)}finally{c(!1)}},[r]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"AI Code Formatter"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Clean up your code with AI-powered formatting, like a smart Prettier."})]}),e.jsxs("div",{className:"flex-grow flex flex-col min-h-0",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 flex-grow min-h-0",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"code-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Input"}),e.jsx("textarea",{id:"code-input",value:r,onChange:t=>x(t.target.value),placeholder:"Paste your unformatted code here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Output"}),e.jsxs("div",{className:"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[a&&!o&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(d,{})}),n&&e.jsx("p",{className:"p-4 text-red-400",children:n}),o&&e.jsx(j,{content:o}),!a&&!o&&!n&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"Formatted code will appear here."})]})]})]}),e.jsx("button",{onClick:f,disabled:a,className:"btn-primary mt-4 w-full max-w-sm mx-auto flex items-center justify-center px-6 py-3",children:a?e.jsx(d,{}):"Format Code"})]})]})};export{S as CodeFormatter};
|
| 8 |
-
//# sourceMappingURL=CodeFormatter-BOOFBlt1.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CodeFormatter-BOOFBlt1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CodeFormatter-BOOFBlt1.js","sources":["../../components/features/CodeFormatter.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { formatCodeStream } from '../../services/geminiService.ts';\nimport { CodeBracketSquareIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst exampleCode = `const MyComponent = (props) => {\n const {name, items}=props\n if(!items || items.length === 0){\n return <p>No items found for {name}</p>;\n }\n return <ul>{items.map(item=> <li key={item.id}>{item.name}</li>)}</ul>\n}`;\n\nexport const CodeFormatter: React.FC = () => {\n const [inputCode, setInputCode] = useState<string>(exampleCode);\n const [formattedCode, setFormattedCode] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleFormat = useCallback(async () => {\n if (!inputCode.trim()) {\n setError('Please enter some code to format.');\n return;\n }\n setIsLoading(true);\n setError('');\n setFormattedCode('');\n try {\n const stream = formatCodeStream(inputCode);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setFormattedCode(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to format code: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [inputCode]);\n \n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <CodeBracketSquareIcon />\n <span className=\"ml-3\">AI Code Formatter</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Clean up your code with AI-powered formatting, like a smart Prettier.</p>\n </header>\n <div className=\"flex-grow flex flex-col min-h-0\">\n <div className=\"grid grid-cols-1 lg:grid-cols-2 gap-6 flex-grow min-h-0\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"code-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Input</label>\n <textarea\n id=\"code-input\"\n value={inputCode}\n onChange={(e) => setInputCode(e.target.value)}\n placeholder=\"Paste your unformatted code here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Output</label>\n <div className=\"flex-grow p-1 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && !formattedCode && (\n <div className=\"flex items-center justify-center h-full\">\n <LoadingSpinner />\n </div>\n )}\n {error && <p className=\"p-4 text-red-400\">{error}</p>}\n {formattedCode && <MarkdownRenderer content={formattedCode} />}\n {!isLoading && !formattedCode && !error && (\n <div className=\"text-slate-500 h-full flex items-center justify-center\">\n Formatted code will appear here.\n </div>\n )}\n </div>\n </div>\n </div>\n <button\n onClick={handleFormat}\n disabled={isLoading}\n className=\"btn-primary mt-4 w-full max-w-sm mx-auto flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Format Code'}\n </button>\n </div>\n </div>\n );\n};\n"],"names":["exampleCode","CodeFormatter","inputCode","setInputCode","useState","formattedCode","setFormattedCode","isLoading","setIsLoading","error","setError","handleFormat","useCallback","stream","formatCodeStream","fullResponse","chunk","err","errorMessage","jsxs","jsx","CodeBracketSquareIcon","e","LoadingSpin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AAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,MAAC,QAAA,CAAM,QAAQ,aAAa,UAAU,0CAA0C,SAAA,QAAK,EACrFA,EAAAA,IAAC,WAAA,CACG,GAAG,aACH,MAAOlB,EACP,SAAWoB,GAAMnB,EAAamB,EAAE,OAAO,KAAK,EAC5C,YAAY,sCACZ,UAAU,6FAAA,CAAA,CACd,EACJ,EACAH,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,SAAM,EACjED,EAAAA,KAAC,MAAA,CAAI,UAAU,sFACX,SAAA,CAAAZ,GAAa,CAACF,GACVe,EAAAA,IAAC,MAAA,CAAI,UAAU,0CACX,SAAAA,EAAAA,IAACG,IAAe,CAAA,CACpB,EAEHd,GAASW,EAAAA,IAAC,IAAA,CAAE,UAAU,mBAAoB,SAAAX,EAAM,EAChDJ,GAAiBe,EAAAA,IAACI,EAAA,CAAiB,QAASnB,CAAA,CAAe,EAC3D,CAACE,GAAa,CAACF,GAAiB,CAACI,GAC9BW,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,kCAAA,CAExE,CAAA,CAAA,CAER,CAAA,CAAA,CACJ,CAAA,EACJ,EACCA,EAAAA,IAAC,SAAA,CACE,QAAST,EACT,SAAUJ,EACV,UAAU,sFAET,SAAAA,EAAYa,EAAAA,IAACG,EAAA,CAAA,CAAe,EAAK,aAAA,CAAA,CACtC,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CodeReviewBot-DZnlxz1p.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
| 1 |
-
import{r as t,j as e}from"./react-D_B_5QVd.js";import{y as h,h as p,L as m,M as j}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const v=`function UserList(users) {
|
| 2 |
-
if (users.length = 0) {
|
| 3 |
-
return "no users";
|
| 4 |
-
} else {
|
| 5 |
-
return (
|
| 6 |
-
users.map(u => {
|
| 7 |
-
return <li>{u.name}</li>
|
| 8 |
-
})
|
| 9 |
-
)
|
| 10 |
-
}
|
| 11 |
-
}`,S=()=>{const[r,x]=t.useState(v),[l,c]=t.useState(""),[a,d]=t.useState(!1),[n,i]=t.useState(""),u=t.useCallback(async()=>{if(!r.trim()){i("Please enter some code to review.");return}d(!0),i(""),c("");try{const s=h(r);let o="";for await(const f of s)o+=f,c(o)}catch(s){const o=s instanceof Error?s.message:"An unknown error occurred.";i(`Failed to get review: ${o}`)}finally{d(!1)}},[r]);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(p,{}),e.jsx("span",{className:"ml-3",children:"AI Code Review Bot"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Get an automated code review from Gemini."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"code-input",className:"text-sm font-medium text-slate-400 mb-2",children:"Code to Review"}),e.jsx("textarea",{id:"code-input",value:r,onChange:s=>x(s.target.value),placeholder:"Paste your code here...",className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm"}),e.jsx("button",{onClick:u,disabled:a,className:"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3",children:a?e.jsx(m,{}):"Request Review"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"AI Feedback"}),e.jsxs("div",{className:"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[a&&!l&&e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx(m,{})}),n&&e.jsx("p",{className:"text-red-400",children:n}),l&&e.jsx(j,{content:l}),!a&&!l&&!n&&e.jsx("div",{className:"text-slate-500 h-full flex items-center justify-center",children:"Review will appear here."})]})]})]})]})};export{S as CodeReviewBot};
|
| 12 |
-
//# sourceMappingURL=CodeReviewBot-DZnlxz1p.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CodeReviewBot-DZnlxz1p.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CodeReviewBot-DZnlxz1p.js","sources":["../../components/features/CodeReviewBot.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { reviewCodeStream } from '../../services/geminiService.ts';\nimport { CpuChipIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\nconst exampleCode = `function UserList(users) {\n if (users.length = 0) {\n return \"no users\";\n } else {\n return (\n users.map(u => {\n return <li>{u.name}</li>\n })\n )\n }\n}`;\n\nexport const CodeReviewBot: React.FC = () => {\n const [code, setCode] = useState<string>(exampleCode);\n const [review, setReview] = useState<string>('');\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n if (!code.trim()) {\n setError('Please enter some code to review.');\n return;\n }\n setIsLoading(true);\n setError('');\n setReview('');\n try {\n const stream = reviewCodeStream(code);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setReview(fullResponse);\n }\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to get review: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [code]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <CpuChipIcon />\n <span className=\"ml-3\">AI Code Review Bot</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Get an automated code review from Gemini.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"code-input\" className=\"text-sm font-medium text-slate-400 mb-2\">Code to Review</label>\n <textarea\n id=\"code-input\"\n value={code}\n onChange={(e) => setCode(e.target.value)}\n placeholder=\"Paste your code here...\"\n className=\"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm\"\n />\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary mt-4 w-full flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Request Review'}\n </button>\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">AI Feedback</label>\n <div className=\"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto\">\n {isLoading && !review && <div className=\"flex items-center justify-center h-full\"><LoadingSpinner /></div>}\n {error && <p className=\"text-red-400\">{error}</p>}\n {review && <MarkdownRenderer content={review} />}\n {!isLoading && !review && !error && <div className=\"text-slate-500 h-full flex items-center justify-center\">Review will appear here.</div>}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["exampleCode","CodeReviewBot","code","setCode","useState","review","setReview","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","stream","reviewCodeStream","fullResponse","chunk","err","errorMessage","jsxs","jsx","CpuChipIcon","e","LoadingSpinner","MarkdownRenderer"],"mappings":"6RAOA,MAAMA,EAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAYPC,EAA0B,IAAM,CACzC,KAAM,CAACC,EAAMC,CAAO,EAAIC,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,OAAO,KAAK,EACvC,YAAY,0BACZ,UAAU,6FAAA,CAAA,EAEdF,EAAAA,IAAC,SAAA,CACG,QAAST,EACT,SAAUJ,EACV,UAAU,qEAET,SAAAA,EAAYa,EAAAA,IAACG,EAAA,CAAA,CAAe,EAAK,gBAAA,CAAA,CACtC,EACJ,EACAJ,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,cAAW,EACtED,EAAAA,KAAC,MAAA,CAAI,UAAU,sFACV,SAAA,CAAAZ,GAAa,CAACF,GAAUe,EAAAA,IAAC,MAAA,CAAI,UAAU,0CAA0C,SAAAA,EAAAA,IAACG,IAAe,CAAA,CAAE,EACnGd,GAASW,EAAAA,IAAC,IAAA,CAAE,UAAU,eAAgB,SAAAX,EAAM,EAC5CJ,GAAUe,EAAAA,IAACI,EAAA,CAAiB,QAASnB,CAAA,CAAQ,EAC5C,CAACE,GAAa,CAACF,GAAU,CAACI,GAASW,EAAAA,IAAC,MAAA,CAAI,UAAU,yDAAyD,SAAA,0BAAA,CAAwB,CAAA,CAAA,CACzI,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CodeSpellChecker-C5gwLsi0.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
| 1 |
-
import{r,j as e,R as l}from"./react-D_B_5QVd.js";import{B as c}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const i=["funtion","functoin","funciton","contructor","cosntructor","consle","conosle","cosnole","varable","varaible","vairable","docment","docuemnt","docmunet","componnet","componenet","compnent","retunr","retrun","asnyc","asycn","awai","awiat","promse","resolv","rejct","catach","thne","lenght","lengt","prperty","undefinded","nul","booleon","numbar","srtring","arrya","objcet","elemnt","attriubte","eveent","listner","handeler","clieck","submitt","resposne","requset","stauts","eror","sucess","implemnt","overide","extned","pbulic","prvate","procted","statci","abstact","interace","enmu","moduel","packge","importt","exprot","defualt","namspace","tyep","clsas","whiel","swich","cse","brek","contiune","thrwo","finnaly"],o=new RegExp(`\\b(${i.join("|")})\\b`,"gi"),m=l.memo(({text:t})=>{const s=r.useMemo(()=>t.split(o).map((n,a)=>o.test(n)?e.jsx("span",{className:"underline decoration-red-500 decoration-wavy",title:"Possible typo",children:n},a):n),[t]);return e.jsx(e.Fragment,{children:s})}),j=()=>{const[t,s]=r.useState(`funtion myFunction() {
|
| 2 |
-
consle.log("Hello World");
|
| 3 |
-
const myVarable = docment.getElementById("root");
|
| 4 |
-
// This is a React componnet
|
| 5 |
-
}`);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl flex items-center",children:[e.jsx(c,{}),e.jsx("span",{className:"ml-3",children:"Code Spell Checker"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"A simple tool that finds and highlights common typos in code."})]}),e.jsxs("div",{className:"relative flex-grow font-mono text-sm bg-slate-900 border border-slate-700 rounded-lg p-4 overflow-auto",children:[e.jsx("textarea",{value:t,onChange:n=>s(n.target.value),className:"absolute inset-0 w-full h-full p-4 bg-transparent text-transparent caret-cyan-400 resize-none z-10",spellCheck:"false"}),e.jsx("pre",{className:"absolute inset-0 w-full h-full p-4 pointer-events-none whitespace-pre-wrap","aria-hidden":"true",children:e.jsx(m,{text:t})})]}),e.jsx("p",{className:"text-xs text-slate-500 mt-2 text-center",children:"This checker uses a predefined list of common typos and does not use AI."})]})};export{j as CodeSpellChecker};
|
| 6 |
-
//# sourceMappingURL=CodeSpellChecker-C5gwLsi0.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CodeSpellChecker-C5gwLsi0.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CodeSpellChecker-C5gwLsi0.js","sources":["../../components/features/CodeSpellChecker.tsx"],"sourcesContent":["\nimport React, { useState, useMemo } from 'react';\nimport { BeakerIcon } from '../icons/FeatureIcons.tsx';\n\n// A more comprehensive list of common programming typos\nconst commonTypos = [\n 'funtion', 'functoin', 'funciton', 'contructor', 'cosntructor',\n 'consle', 'conosle', 'cosnole', 'varable', 'varaible', 'vairable',\n 'docment', 'docuemnt', 'docmunet', 'componnet', 'componenet', 'compnent',\n 'retunr', 'retrun', 'asnyc', 'asycn', 'awai', 'awiat', 'promse',\n 'resolv', 'rejct', 'catach', 'thne', 'lenght', 'lengt', 'prperty',\n 'undefinded', 'nul', 'booleon', 'numbar', 'srtring', 'arrya', 'objcet',\n 'elemnt', 'attriubte', 'eveent', 'listner', 'handeler', 'clieck',\n 'submitt', 'resposne', 'requset', 'stauts', 'eror', 'sucess',\n 'implemnt', 'overide', 'extned', 'pbulic', 'prvate', 'procted',\n 'statci', 'abstact', 'interace', 'enmu', 'moduel', 'packge',\n 'importt', 'exprot', 'defualt', 'namspace', 'tyep', 'clsas',\n 'whiel', 'swich', 'cse', 'brek', 'contiune', 'thrwo', 'finnaly'\n];\n\nconst typoRegex = new RegExp(`\\\\b(${commonTypos.join('|')})\\\\b`, 'gi');\n\nconst HighlightedText: React.FC<{ text: string }> = React.memo(({ text }) => {\n const parts = useMemo(() => {\n return text.split(typoRegex).map((part, i) => {\n if (typoRegex.test(part)) {\n return <span key={i} className=\"underline decoration-red-500 decoration-wavy\" title={`Possible typo`}>{part}</span>;\n }\n return part;\n });\n }, [text]);\n\n return <>{parts}</>;\n});\n\nexport const CodeSpellChecker: React.FC = () => {\n const [code, setCode] = useState('funtion myFunction() {\\n consle.log(\"Hello World\");\\n const myVarable = docment.getElementById(\"root\");\\n // This is a React componnet\\n}');\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl flex items-center\">\n <BeakerIcon />\n <span className=\"ml-3\">Code Spell Checker</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">A simple tool that finds and highlights common typos in code.</p>\n </header>\n <div className=\"relative flex-grow font-mono text-sm bg-slate-900 border border-slate-700 rounded-lg p-4 overflow-auto\">\n <textarea\n value={code}\n onChange={(e) => setCode(e.target.value)}\n className=\"absolute inset-0 w-full h-full p-4 bg-transparent text-transparent caret-cyan-400 resize-none z-10\"\n spellCheck=\"false\"\n />\n <pre className=\"absolute inset-0 w-full h-full p-4 pointer-events-none whitespace-pre-wrap\" aria-hidden=\"true\">\n <HighlightedText text={code} />\n </pre>\n </div>\n <p className=\"text-xs text-slate-500 mt-2 text-center\">This checker uses a predefined list of common typos and does not use AI.</p>\n </div>\n );\n};\n"],"names":["commonTypos","typoRegex","HighlightedText","React","text","parts","useMemo","part","i","CodeSpellChecker","code","setCode","useState","jsxs","jsx","BeakerIcon","e"],"mappings":"0QAKA,MAAMA,EAAc,CAChB,UAAW,WAAY,WAAY,aAAc,cACjD,SAAU,UAAW,UAAW,UAAW,WAAY,WACvD,UAAW,WAAY,WAAY,YAAa,aAAc,WAC9D,SAAU,SAAU,QAAS,QAAS,OAAQ,QAAS,SACvD,SAAU,QAAS,SAAU,OAAQ,SAAU,QAAS,UACxD,aAAc,MAAO,UAAW,SAAU,UAAW,QAAS,SAC9D,SAAU,YAAa,SAAU,UAAW,WAAY,SACxD,UAAW,WAAY,UAAW,SAAU,OAAQ,SACpD,WAAY,UAAW,SAAU,SAAU,SAAU,UACrD,SAAU,UAAW,WAAY,OAAQ,SAAU,SACnD,UAAW,SAAU,UAAW,WAAY,OAAQ,QACpD,QAAS,QAAS,MAAO,OAAQ,WAAY,QAAS,SAC1D,EAEMC,EAAY,IAAI,OAAO,OAAOD,EAAY,KAAK,GAAG,CAAC,OAAQ,IAAI,EAE/DE,EAA8CC,EAAM,KAAK,CAAC,CAAE,KAAAC,KAAW,CACzE,MAAMC,EAAQC,EAAAA,QAAQ,IACXF,EAAK,MAAMH,CAAS,EAAE,IAAI,CAACM,EAAMC,IAChCP,EAAU,KAAKM,CAAI,QACX,OAAA,CAAa,UAAU,+CAA+C,MAAO,gBAAkB,YAArFC,CAA0F,EAEzGD,CACV,EACF,CAACH,CAAI,CAAC,EAET,yBAAU,SAAAC,CAAA,CAAM,CACpB,CAAC,EAEYI,EAA6B,IAAM,CAC5C,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS;AAAA;AAAA;AAAA;AAAA,EAA8I,EAE/K,OACIC,EAAAA,KAAC,MAAA,CAAI,UAAU,yCACX,SAAA,CAAAA,EAAAA,KAAC,SAAA,CAAO,UAAU,OACd,SAAA,CAAAA,EAAAA,KAAC,KAAA,CAAG,UAAU,6BACV,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAW,EACZD,EAAAA,IAAC,OAAA,CAAK,UAAU,OAAO,SAAA,oBAAA,CAAkB,CAAA,EAC7C,EACAA,EAAAA,IAAC,IAAA,CAAE,UAAU,sBAAsB,SAAA,+DAAA,CAA6D,CAAA,EACpG,EACAD,EAAAA,KAAC,MAAA,CAAI,UAAU,yGACX,SAAA,CAAAC,EAAAA,IAAC,WAAA,CACG,MAAOJ,EACP,SAAWM,GAAML,EAAQK,EAAE,OAAO,KAAK,EACvC,UAAU,qGACV,WAAW,OAAA,CAAA,EAEfF,EAAAA,IAAC,MAAA,CAAI,UAAU,6EAA6E,cAAY,OACpG,SAAAA,EAAAA,IAACZ,EAAA,CAAgB,KAAMQ,CAAA,CAAM,CAAA,CACjC,CAAA,EACJ,EACCI,EAAAA,IAAC,IAAA,CAAE,UAAU,0CAA0C,SAAA,0EAAA,CAAwE,CAAA,EACpI,CAER"}
|
|
|
|
|
|
assets/ColorPaletteGenerator-BG5TiXtv.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./react-D_B_5QVd.js";import{Z as u}from"./react-colorful-yV61q6mf.js";import{W as h,S as b,L as c}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const S=()=>{const[s,i]=a.useState("#06b6d4"),[m,d]=a.useState(["#06b6d4","#0891b2","#0e7490","#155e75","#164e63","#083344"]),[l,r]=a.useState(!1),[o,n]=a.useState(""),x=a.useCallback(async()=>{r(!0),n("");try{const t=await h(s);d(t.colors)}catch(t){const f=t instanceof Error?t.message:"An unknown error occurred.";n(`Failed to generate palette: ${f}`)}finally{r(!1)}},[s]),p=t=>{navigator.clipboard.writeText(t)};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6 text-center",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center justify-center",children:[e.jsx(b,{}),e.jsx("span",{className:"ml-3",children:"AI Color Palette Generator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Pick a base color and let Gemini design a beautiful palette for you."})]}),e.jsxs("div",{className:"flex-grow flex flex-col md:flex-row items-center justify-center gap-8",children:[e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(u,{color:s,onChange:i,className:"!w-64 !h-64"}),e.jsx("div",{className:"p-2 bg-slate-800 rounded-md font-mono text-lg",style:{border:`1px solid ${s}`},children:s}),e.jsx("button",{onClick:x,disabled:l,className:"btn-primary w-full flex items-center justify-center px-6 py-3",children:l?e.jsx(c,{}):"Generate Palette"}),o&&e.jsx("p",{className:"text-red-400 text-sm mt-2",children:o})]}),e.jsxs("div",{className:"flex flex-col gap-2 w-full max-w-sm",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Generated Palette:"}),l?e.jsx("div",{className:"flex items-center justify-center h-48",children:e.jsx(c,{})}):m.map(t=>e.jsxs("div",{className:"group flex items-center justify-between p-4 rounded-md shadow-md",style:{backgroundColor:t},children:[e.jsx("span",{className:"font-mono font-bold text-black/70 mix-blend-overlay",children:t}),e.jsx("button",{onClick:()=>p(t),className:"opacity-0 group-hover:opacity-100 transition-opacity bg-white/30 hover:bg-white/50 px-3 py-1 rounded text-xs text-black font-semibold backdrop-blur-sm",children:"Copy"})]},t))]})]})]})};export{S as ColorPaletteGenerator};
|
| 2 |
-
//# sourceMappingURL=ColorPaletteGenerator-BG5TiXtv.js.map
|
|
|
|
|
|
|
|
|
assets/ColorPaletteGenerator-BG5TiXtv.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"ColorPaletteGenerator-BG5TiXtv.js","sources":["../../components/features/ColorPaletteGenerator.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { HexColorPicker } from 'react-colorful';\nimport { generateColorPalette } from '../../services/geminiService.ts';\nimport { SparklesIcon } from '../icons/FeatureIcons.tsx';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\n\nexport const ColorPaletteGenerator: React.FC = () => {\n const [baseColor, setBaseColor] = useState(\"#06b6d4\");\n const [palette, setPalette] = useState<string[]>(['#06b6d4', '#0891b2', '#0e7490', '#155e75', '#164e63', '#083344']);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<string>('');\n\n const handleGenerate = useCallback(async () => {\n setIsLoading(true);\n setError('');\n try {\n const result = await generateColorPalette(baseColor);\n setPalette(result.colors);\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : 'An unknown error occurred.';\n setError(`Failed to generate palette: ${errorMessage}`);\n } finally {\n setIsLoading(false);\n }\n }, [baseColor]);\n\n const handleCopy = (color: string) => {\n navigator.clipboard.writeText(color);\n };\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6 text-center\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center justify-center\">\n <SparklesIcon />\n <span className=\"ml-3\">AI Color Palette Generator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Pick a base color and let Gemini design a beautiful palette for you.</p>\n </header>\n <div className=\"flex-grow flex flex-col md:flex-row items-center justify-center gap-8\">\n <div className=\"flex flex-col items-center gap-4\">\n <HexColorPicker color={baseColor} onChange={setBaseColor} className=\"!w-64 !h-64\"/>\n <div className=\"p-2 bg-slate-800 rounded-md font-mono text-lg\" style={{border: `1px solid ${baseColor}`}}>{baseColor}</div>\n <button\n onClick={handleGenerate}\n disabled={isLoading}\n className=\"btn-primary w-full flex items-center justify-center px-6 py-3\"\n >\n {isLoading ? <LoadingSpinner /> : 'Generate Palette'}\n </button>\n {error && <p className=\"text-red-400 text-sm mt-2\">{error}</p>}\n </div>\n <div className=\"flex flex-col gap-2 w-full max-w-sm\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Generated Palette:</label>\n {isLoading ? (\n <div className=\"flex items-center justify-center h-48\"><LoadingSpinner /></div>\n ) : (\n palette.map((color) => (\n <div key={color} className=\"group flex items-center justify-between p-4 rounded-md shadow-md\" style={{ backgroundColor: color }}>\n <span className=\"font-mono font-bold text-black/70 mix-blend-overlay\">{color}</span>\n <button\n onClick={() => handleCopy(color)}\n className=\"opacity-0 group-hover:opacity-100 transition-opacity bg-white/30 hover:bg-white/50 px-3 py-1 rounded text-xs text-black font-semibold backdrop-blur-sm\">\n Copy\n </button>\n </div>\n ))\n )}\n </div>\n </div>\n </div>\n );\n};\n"],"names":["ColorPaletteGenerator","baseColor","setBaseColor","useState","palette","setPalette","isLoading","setIsLoading","error","setError","handleGenerate","useCallback","result","generateColorPalette","err","errorMessage","handleCopy","color","jsxs","jsx","SparklesIcon","HexColorPicker","LoadingSpinner"],"mappings":"uUAOO,MAAMA,EAAkC,IAAM,CACjD,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAAA,SAAS,SAAS,EAC9C,CAACC,EAASC,CAAU,EAAIF,EAAAA,SAAmB,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAAC,EAC7G,CAACG,EAAWC,C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AAAA,IAAC,IAAA,CAAE,UAAU,4BAA6B,SAAAX,CAAA,CAAM,CAAA,EAC9D,EACAU,EAAAA,KAAC,MAAA,CAAI,UAAU,sCACX,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,qBAAkB,EAC5Eb,QACK,MAAA,CAAI,UAAU,wCAAwC,SAAAa,MAACG,EAAA,CAAA,CAAe,EAAE,EAE1ElB,EAAQ,IAAKa,UACR,MAAA,CAAgB,UAAU,mEAAmE,MAAO,CAAE,gBAAiBA,CAAA,EACpH,SAAA,CAAAE,EAAAA,IAAC,OAAA,CAAK,UAAU,sDAAuD,SAAAF,EAAM,EAC7EE,EAAAA,IAAC,SAAA,CACG,QAAS,IAAMH,EAAWC,CAAK,EAC/B,UAAU,yJAAyJ,SAAA,MAAA,CAAA,CAEvK,CAAA,EANMA,CAOV,CACH,CAAA,CAAA,CAET,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CronJobBuilder-j1M2S9Ja.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as t,j as e}from"./react-D_B_5QVd.js";import{H as C,C as N,L as S,S as k}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const c=({label:r,value:o,onChange:i,options:l})=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-slate-400",children:r}),e.jsxs("select",{value:o,onChange:n=>i(n.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700",children:[e.jsx("option",{value:"*",children:"* (every)"}),l.map(n=>e.jsx("option",{value:n,children:n},n))]})]}),_=({initialPrompt:r})=>{const[o,i]=t.useState("0"),[l,n]=t.useState("17"),[d,p]=t.useState("*"),[m,h]=t.useState("*"),[x,g]=t.useState("1-5"),[f,b]=t.useState(r||"every weekday at 5pm"),[j,y]=t.useState(!1),v=t.useMemo(()=>`${o} ${l} ${d} ${m} ${x}`,[o,l,d,m,x]),u=t.useCallback(async a=>{if(a){y(!0);try{const s=await C(a);i(s.minute),n(s.hour),p(s.dayOfMonth),h(s.month),g(s.dayOfWeek)}catch(s){console.error(s)}finally{y(!1)}}},[]);return t.useEffect(()=>{r&&(b(r),u(r))},[r,u]),e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(N,{}),e.jsx("span",{className:"ml-3",children:"AI Cron Job Builder"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Visually construct a cron expression or describe it in plain English."})]}),e.jsxs("div",{className:"flex gap-2 mb-6",children:[e.jsx("input",{type:"text",value:f,onChange:a=>b(a.target.value),placeholder:"Describe a schedule...",className:"flex-grow px-3 py-1.5 rounded-md bg-slate-800 border border-slate-700 text-sm"}),e.jsxs("button",{onClick:()=>u(f),disabled:j,className:"btn-primary px-4 py-1.5 flex items-center gap-2",children:[j?e.jsx(S,{}):e.jsx(k,{})," AI Generate"]})]}),e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4 mb-6",children:[e.jsx(c,{label:"Minute",value:o,onChange:i,options:Array.from({length:60},(a,s)=>s)}),e.jsx(c,{label:"Hour",value:l,onChange:n,options:Array.from({length:24},(a,s)=>s)}),e.jsx(c,{label:"Day (Month)",value:d,onChange:p,options:Array.from({length:31},(a,s)=>s+1)}),e.jsx(c,{label:"Month",value:m,onChange:h,options:Array.from({length:12},(a,s)=>s+1)}),e.jsx(c,{label:"Day (Week)",value:x,onChange:g,options:Array.from({length:7},(a,s)=>s)})]}),e.jsxs("div",{className:"bg-slate-900 p-4 rounded-lg text-center",children:[e.jsx("p",{className:"text-slate-400 text-sm",children:"Generated Expression"}),e.jsx("p",{className:"font-mono text-cyan-400 text-2xl mt-1",children:v}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(v),className:"mt-4 px-3 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"})]})]})};export{_ as CronJobBuilder};
|
| 2 |
-
//# sourceMappingURL=CronJobBuilder-j1M2S9Ja.js.map
|
|
|
|
|
|
|
|
|
assets/CronJobBuilder-j1M2S9Ja.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CronJobBuilder-j1M2S9Ja.js","sources":["../../components/features/CronJobBuilder.tsx"],"sourcesContent":["\nimport React, { useState, useMemo, useCallback, useEffect } from 'react';\nimport { CommandLineIcon, SparklesIcon } from '../icons/FeatureIcons.tsx';\nimport { generateCronFromDescription, CronParts } from '../../services/geminiService.ts';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\n\nconst CronPartSelector: React.FC<{ label: string, value: string, onChange: (value: string) => void, options: (string|number)[] }> = ({ label, value, onChange, options }) => {\n return (\n <div>\n <label className=\"block text-sm font-medium text-slate-400\">{label}</label>\n <select value={value} onChange={e => onChange(e.target.value)} className=\"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700\">\n <option value=\"*\">* (every)</option>\n {options.map(o => <option key={o} value={o}>{o}</option>)}\n </select>\n </div>\n );\n};\n\nexport const CronJobBuilder: React.FC<{ initialPrompt?: string }> = ({ initialPrompt }) => {\n const [minute, setMinute] = useState('0');\n const [hour, setHour] = useState('17');\n const [dayOfMonth, setDayOfMonth] = useState('*');\n const [month, setMonth] = useState('*');\n const [dayOfWeek, setDayOfWeek] = useState('1-5');\n const [aiPrompt, setAiPrompt] = useState(initialPrompt || 'every weekday at 5pm');\n const [isLoading, setIsLoading] = useState(false);\n \n const cronExpression = useMemo(() => {\n return `${minute} ${hour} ${dayOfMonth} ${month} ${dayOfWeek}`;\n }, [minute, hour, dayOfMonth, month, dayOfWeek]);\n\n const handleAiGenerate = useCallback(async (p: string) => {\n if (!p) return;\n setIsLoading(true);\n try {\n const result: CronParts = await generateCronFromDescription(p);\n setMinute(result.minute);\n setHour(result.hour);\n setDayOfMonth(result.dayOfMonth);\n setMonth(result.month);\n setDayOfWeek(result.dayOfWeek);\n } catch (e) {\n console.error(e);\n } finally {\n setIsLoading(false);\n }\n }, []);\n\n useEffect(() => {\n if (initialPrompt) {\n setAiPrompt(initialPrompt);\n handleAiGenerate(initialPrompt);\n }\n }, [initialPrompt, handleAiGenerate]);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <CommandLineIcon />\n <span className=\"ml-3\">AI Cron Job Builder</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Visually construct a cron expression or describe it in plain English.</p>\n </header>\n <div className=\"flex gap-2 mb-6\">\n <input type=\"text\" value={aiPrompt} onChange={e => setAiPrompt(e.target.value)} placeholder=\"Describe a schedule...\" className=\"flex-grow px-3 py-1.5 rounded-md bg-slate-800 border border-slate-700 text-sm\"/>\n <button onClick={() => handleAiGenerate(aiPrompt)} disabled={isLoading} className=\"btn-primary px-4 py-1.5 flex items-center gap-2\">\n {isLoading ? <LoadingSpinner /> : <SparklesIcon />} AI Generate\n </button>\n </div>\n <div className=\"grid grid-cols-2 md:grid-cols-5 gap-4 mb-6\">\n <CronPartSelector label=\"Minute\" value={minute} onChange={setMinute} options={Array.from({length: 60}, (_, i) => i)} />\n <CronPartSelector label=\"Hour\" value={hour} onChange={setHour} options={Array.from({length: 24}, (_, i) => i)} />\n <CronPartSelector label=\"Day (Month)\" value={dayOfMonth} onChange={setDayOfMonth} options={Array.from({length: 31}, (_, i) => i + 1)} />\n <CronPartSelector label=\"Month\" value={month} onChange={setMonth} options={Array.from({length: 12}, (_, i) => i + 1)} />\n <CronPartSelector label=\"Day (Week)\" value={dayOfWeek} onChange={setDayOfWeek} options={Array.from({length: 7}, (_, i) => i)} />\n </div>\n <div className=\"bg-slate-900 p-4 rounded-lg text-center\">\n <p className=\"text-slate-400 text-sm\">Generated Expression</p>\n <p className=\"font-mono text-cyan-400 text-2xl mt-1\">{cronExpression}</p>\n <button onClick={() => navigator.clipboard.writeText(cronExpression)} className=\"mt-4 px-3 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button>\n </div>\n </div>\n );\n};\n"],"names":["CronPartSelector","label","value","onChange","options","jsx","jsxs","e","o","CronJobBuilder","initialPrompt","minute","setMinute","useState","hour","setHour","dayOfMonth","setDayOfMonth","month","setMonth","dayOfWeek","setDayOfWeek","aiPrompt","setAiPrompt","isLoading","setIsLoading","cronExpression","useMemo","handleAiGenerate","useCallback","p","result","generateCronFromDescription","useEffect","CommandLineIcon","LoadingSpinner","SparklesIcon","_","i"],"mappings":"6RAMA,MAAMA,EAA8H,CAAC,CAAE,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,QAAAC,YAEtJ,MAAA,CACG,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,2CAA4C,SAAAJ,EAAM,EACnEK,EAAAA,KAAC,SAAA,CAAO,MAAAJ,EAAc,SAAUK,GAAKJ,EAASI,EAAE,OAAO,KAAK,EAAG,UAAU,wEACrE,SAAA,CAAAF,EAAAA,IAAC,SAAA,CAAO,MAAM,IAAI,SAAA,YAAS,EAC1BD,EAAQ,IAAII,GAAKH,EAAAA,IAAC,UAAe,MAAOG,EAAI,SAAAA,CAAA,EAAdA,CAAgB,CAAS,CAAA,CAAA,CAC5D,CAAA,EACJ,EAIKC,EAAuD,CAAC,CAAE,cAAAC,KAAoB,CACvF,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,GAAG,EAClC,CAACC,EAAMC,CAAO,EAAIF,EAAAA,SAAS,IAAI,EAC/B,CAACG,EAAYC,CAAa,EAAIJ,EAAAA,SAAS,GAAG,EAC1C,CAACK,EAAOC,CAAQ,EAAIN,EAAAA,SAAS,GAAG,EAChC,CAACO,EAAW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A,CAAE,UAAU,wCAAyC,SAAAqB,EAAe,EACpErB,EAAAA,IAAC,SAAA,CAAO,QAAS,IAAM,UAAU,UAAU,UAAUqB,CAAc,EAAG,UAAU,oEAAoE,SAAA,MAAA,CAAI,CAAA,CAAA,CAC7J,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/CssGridEditor-BIgc_aXP.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
import{r as o,j as e}from"./react-D_B_5QVd.js";import{o as g}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const C=()=>{const[a,c]=o.useState(3),[l,i]=o.useState(4),[t,m]=o.useState(1),[r,p]=o.useState(1),x={display:"grid",gridTemplateColumns:`repeat(${l}, 1fr)`,gridTemplateRows:`repeat(${a}, 1fr)`,gap:`${t}rem ${r}rem`,height:"100%",width:"100%"},n=o.useMemo(()=>`.grid-container {
|
| 2 |
-
display: grid;
|
| 3 |
-
grid-template-columns: repeat(${l}, 1fr);
|
| 4 |
-
grid-template-rows: repeat(${a}, 1fr);
|
| 5 |
-
gap: ${t}rem ${r}rem;
|
| 6 |
-
}`,[a,l,t,r]),u=()=>{navigator.clipboard.writeText(n)};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(g,{}),e.jsx("span",{className:"ml-3",children:"CSS Grid Visual Editor"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Configure your grid layout and copy the generated CSS."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg",children:[e.jsx("h3",{className:"text-xl font-bold",children:"Controls"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"rows",className:"block text-sm font-medium text-slate-400",children:["Rows (",a,")"]}),e.jsx("input",{id:"rows",type:"range",min:"1",max:"12",value:a,onChange:s=>c(Number(s.target.value)),className:"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"cols",className:"block text-sm font-medium text-slate-400",children:["Columns (",l,")"]}),e.jsx("input",{id:"cols",type:"range",min:"1",max:"12",value:l,onChange:s=>i(Number(s.target.value)),className:"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"rowGap",className:"block text-sm font-medium text-slate-400",children:["Row Gap (",t,"rem)"]}),e.jsx("input",{id:"rowGap",type:"range",min:"0",max:"8",step:"0.25",value:t,onChange:s=>m(Number(s.target.value)),className:"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"colGap",className:"block text-sm font-medium text-slate-400",children:["Column Gap (",r,"rem)"]}),e.jsx("input",{id:"colGap",type:"range",min:"0",max:"8",step:"0.25",value:r,onChange:s=>p(Number(s.target.value)),className:"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer"})]})]}),e.jsxs("div",{className:"flex-grow mt-4",children:[e.jsx("label",{className:"block text-sm font-medium text-slate-400 mb-2",children:"Generated CSS"}),e.jsxs("div",{className:"relative h-full",children:[e.jsx("pre",{className:"bg-slate-900 p-4 rounded-md text-cyan-300 text-sm overflow-auto h-full",children:n}),e.jsx("button",{onClick:u,className:"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"})]})]})]}),e.jsx("div",{className:"lg:col-span-2 bg-slate-900/50 rounded-lg p-4 border-2 border-dashed border-slate-700",children:e.jsx("div",{style:x,children:Array.from({length:a*l}).map((s,d)=>e.jsx("div",{className:"bg-cyan-500/20 rounded-lg border-2 border-dashed border-cyan-400/50 flex items-center justify-center text-cyan-300",children:e.jsx("span",{className:"text-xs opacity-70",children:d+1})},d))})})]})]})};export{C as CssGridEditor};
|
| 7 |
-
//# sourceMappingURL=CssGridEditor-BIgc_aXP.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/CssGridEditor-BIgc_aXP.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"CssGridEditor-BIgc_aXP.js","sources":["../../components/features/CssGridEditor.tsx"],"sourcesContent":["\nimport React, { useState, useMemo } from 'react';\nimport { CodeBracketSquareIcon } from '../icons/FeatureIcons.tsx';\n\nexport const CssGridEditor: React.FC = () => {\n const [rows, setRows] = useState(3);\n const [cols, setCols] = useState(4);\n const [rowGap, setRowGap] = useState(1); // in rem\n const [colGap, setColGap] = useState(1); // in rem\n\n const gridStyle = {\n display: 'grid',\n gridTemplateColumns: `repeat(${cols}, 1fr)`,\n gridTemplateRows: `repeat(${rows}, 1fr)`,\n gap: `${rowGap}rem ${colGap}rem`,\n height: '100%',\n width: '100%'\n };\n\n const cssCode = useMemo(() => {\n return `.grid-container {\n display: grid;\n grid-template-columns: repeat(${cols}, 1fr);\n grid-template-rows: repeat(${rows}, 1fr);\n gap: ${rowGap}rem ${colGap}rem;\n}`;\n }, [rows, cols, rowGap, colGap]);\n \n const handleCopy = () => {\n navigator.clipboard.writeText(cssCode);\n };\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <CodeBracketSquareIcon />\n <span className=\"ml-3\">CSS Grid Visual Editor</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Configure your grid layout and copy the generated CSS.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0\">\n <div className=\"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg\">\n <h3 className=\"text-xl font-bold\">Controls</h3>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"rows\" className=\"block text-sm font-medium text-slate-400\">Rows ({rows})</label>\n <input id=\"rows\" type=\"range\" min=\"1\" max=\"12\" value={rows} onChange={e => setRows(Number(e.target.value))} className=\"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer\" />\n </div>\n <div>\n <label htmlFor=\"cols\" className=\"block text-sm font-medium text-slate-400\">Columns ({cols})</label>\n <input id=\"cols\" type=\"range\" min=\"1\" max=\"12\" value={cols} onChange={e => setCols(Number(e.target.value))} className=\"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer\" />\n </div>\n <div>\n <label htmlFor=\"rowGap\" className=\"block text-sm font-medium text-slate-400\">Row Gap ({rowGap}rem)</label>\n <input id=\"rowGap\" type=\"range\" min=\"0\" max=\"8\" step=\"0.25\" value={rowGap} onChange={e => setRowGap(Number(e.target.value))} className=\"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer\" />\n </div>\n <div>\n <label htmlFor=\"colGap\" className=\"block text-sm font-medium text-slate-400\">Column Gap ({colGap}rem)</label>\n <input id=\"colGap\" type=\"range\" min=\"0\" max=\"8\" step=\"0.25\" value={colGap} onChange={e => setColGap(Number(e.target.value))} className=\"w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer\" />\n </div>\n </div>\n <div className=\"flex-grow mt-4\">\n <label className=\"block text-sm font-medium text-slate-400 mb-2\">Generated CSS</label>\n <div className=\"relative h-full\">\n <pre className=\"bg-slate-900 p-4 rounded-md text-cyan-300 text-sm overflow-auto h-full\">{cssCode}</pre>\n <button onClick={handleCopy} className=\"absolute top-2 right-2 px-2 py-1 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button>\n </div>\n </div>\n </div>\n <div className=\"lg:col-span-2 bg-slate-900/50 rounded-lg p-4 border-2 border-dashed border-slate-700\">\n <div style={gridStyle}>\n {Array.from({ length: rows * cols }).map((_, i) => (\n <div key={i} className=\"bg-cyan-500/20 rounded-lg border-2 border-dashed border-cyan-400/50 flex items-center justify-center text-cyan-300\">\n <span className=\"text-xs opacity-70\">{i + 1}</span>\n </div>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["CssGridEditor","rows","setRows","useState","cols","setCols","rowGap","setRowGap","colGap","setColGap","gridStyle","cssCode","useMemo","handleCopy","jsxs","jsx","CodeBracketSquareIcon","e","_","i"],"mappings":"wQAIO,MAAMA,EAA0B,IAAM,CACzC,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,CAAC,EAC5B,CAACC,EAAMC,CAAO,EAAIF,EAAAA,SAAS,CAAC,EAC5B,CAACG,EAAQC,CAAS,EAAIJ,EAAAA,SAAS,CAAC,EAChC,CAACK,EAAQC,CAAS,EAAIN,EAAAA,SAAS,CAAC,EAEhCO,EAAY,CACd,QAAS,OACT,oBAAqB,UAAUN,CAAI,SACnC,iBAAkB,UAAUH,CAAI,SAChC,IAAK,GAAGK,CAAM,OAAOE,CAAM,MAC3B,OAAQ,OACR,MAAO,MAAA,EAGLG,EAAUC,EAAAA,QAAQ,IACb;AAAA;AAAA,kCAEmBR,CAAI;AAAA,+BACPH,CAAI;AAAA,SAC1BK,CAAM,OAAOE,CAAM;AAAA,GAErB,CAACP,EAAMG,EAAME,EAAQE,CAAM,CAAC,EAEzBK,EAAa,IAAM,CACrB,UAAU,UAAU,UAAUF,CAAO,CACzC,EAEA,OACIG,EAAAA,KAAC,MAAA,CAAI,UAAU,yCACX,SAAA,CAAAA,EAAAA,KAAC,SAAA,CAAO,UAAU,OACd,SAAA,CAAAA,EAAAA,KAAC,KAAA,CAAG,UAAU,sDACV,SAAA,CAAAC,EAAAA,IAACC,EAAA,EAAsB,EACvBD,EAAAA,IAAC,OAAA,CAAK,UAAU,OAAO,SAAA,wBAAA,CAAsB,CAAA,EACjD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A,CACE,SAAA,CAAAH,EAAAA,KAAC,QAAA,CAAM,QAAQ,SAAS,UAAU,2CAA2C,SAAA,CAAA,eAAaN,EAAO,MAAA,EAAI,EACrGO,EAAAA,IAAC,QAAA,CAAM,GAAG,SAAS,KAAK,QAAQ,IAAI,IAAI,IAAI,IAAI,KAAK,OAAO,MAAOP,EAAQ,SAAUS,GAAKR,EAAU,OAAOQ,EAAE,OAAO,KAAK,CAAC,EAAG,UAAU,mEAAA,CAAoE,CAAA,CAAA,CAC/M,CAAA,EACJ,EACCH,EAAAA,KAAC,MAAA,CAAI,UAAU,iBACZ,SAAA,CAAAC,EAAAA,IAAC,QAAA,CAAM,UAAU,gDAAgD,SAAA,gBAAa,EAC9ED,EAAAA,KAAC,MAAA,CAAI,UAAU,kBACX,SAAA,CAAAC,EAAAA,IAAC,MAAA,CAAI,UAAU,yEAA0E,SAAAJ,EAAQ,QAChG,SAAA,CAAO,QAASE,EAAY,UAAU,sFAAsF,SAAA,MAAA,CAAI,CAAA,CAAA,CACrI,CAAA,CAAA,CACJ,CAAA,EACJ,EACAE,MAAC,MAAA,CAAI,UAAU,uFACX,eAAC,MAAA,CAAI,MAAOL,EACP,SAAA,MAAM,KAAK,CAAE,OAAQT,EAAOG,CAAA,CAAM,EAAE,IAAI,CAACc,EAAGC,IACzCJ,EAAAA,IAAC,MAAA,CAAY,UAAU,qHACnB,SAAAA,EAAAA,IAAC,OAAA,CAAK,UAAU,qBAAsB,WAAI,CAAA,CAAE,CAAA,EADtCI,CAEV,CACH,EACL,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/DevNotesStickyPanel-CLNoK4mX.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
import{r as d,j as t}from"./react-D_B_5QVd.js";import{k as w,t as v,F as S,S as k,L as C,M as z}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const g=["bg-yellow-300 text-yellow-800","bg-green-300 text-green-800","bg-blue-300 text-blue-800","bg-pink-300 text-pink-800","bg-purple-300 text-purple-800"],L=()=>{const[r,n]=w("devcore_notes",[]),[l,u]=d.useState(null),[i,x]=d.useState(!1),[m,c]=d.useState(""),f=d.useCallback(async()=>{if(r.length!==0){x(!0),c("");try{const e=r.map(a=>`- ${a.text}`).join(`
|
| 2 |
-
`),s=v(e);let o="";for await(const a of s)o+=a,c(o)}catch(e){console.error(e),c("Sorry, an error occurred while summarizing.")}finally{x(!1)}}},[r]),h=()=>{const e={id:Date.now(),text:"New note...",x:50+r.length%10*20,y:50+r.length%10*20,color:g[r.length%g.length]};n([...r,e])},b=(e,s)=>{n(r.map(o=>o.id===e?{...o,text:s}:o))},N=(e,s)=>{s.stopPropagation(),n(r.filter(o=>o.id!==e))},j=(e,s)=>{if(e.target.tagName==="TEXTAREA"||e.target.tagName==="BUTTON")return;const a=e.currentTarget.getBoundingClientRect();u({id:s,offsetX:e.clientX-a.left,offsetY:e.clientY-a.top})},y=e=>{if(!l)return;const s=e.currentTarget.getBoundingClientRect();n(r.map(o=>o.id===l.id?{...o,x:e.clientX-l.offsetX-s.left,y:e.clientY-l.offsetY-s.top}:o))},p=()=>u(null);return t.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[t.jsxs("header",{className:"mb-6 flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[t.jsx(S,{}),t.jsx("span",{className:"ml-3",children:"Dev Notes Sticky Panel"})]}),t.jsx("p",{className:"text-slate-400 mt-1",children:"A place for your thoughts, todos, and random ideas."})]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsxs("button",{onClick:f,disabled:i||r.length===0,className:"btn-primary flex items-center gap-2 px-4 py-2",children:[t.jsx(k,{})," ",i?"Summarizing...":"AI Summarize"]}),t.jsx("button",{onClick:h,className:"btn-primary px-6 py-2",children:"Add Note"})]})]}),t.jsx("div",{className:"relative flex-grow bg-slate-900/50 border-2 border-dashed border-slate-700 rounded-lg overflow-hidden",onMouseMove:y,onMouseUp:p,onMouseLeave:p,children:r.map(e=>t.jsxs("div",{className:`group absolute w-48 h-48 p-2 flex flex-col shadow-lg cursor-grab active:cursor-grabbing rounded-md transition-transform duration-100 ${e.color}`,style:{top:e.y,left:e.x,transform:(l==null?void 0:l.id)===e.id?"scale(1.05) rotate(3deg)":"scale(1)"},onMouseDown:s=>j(s,e.id),children:[t.jsx("button",{onClick:s=>N(e.id,s),className:"absolute -top-2 -right-2 w-6 h-6 rounded-full bg-slate-700 text-white font-bold text-xs flex items-center justify-center opacity-0 group-hover:opacity-100 hover:bg-red-500 transition-all",children:"×"}),t.jsx("textarea",{value:e.text,onChange:s=>b(e.id,s.target.value),className:"w-full h-full bg-transparent resize-none focus:outline-none font-medium p-1 placeholder:text-inherit/50"})]},e.id))}),(i||m)&&t.jsx("div",{className:"fixed inset-0 bg-slate-900/80 backdrop-blur-sm z-50 flex items-center justify-center",onClick:()=>c(""),children:t.jsxs("div",{className:"w-full max-w-2xl bg-slate-800 border border-slate-700 rounded-lg shadow-2xl p-6",onClick:e=>e.stopPropagation(),children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:"AI Summary of Notes"}),i&&!m?t.jsx(C,{}):t.jsx(z,{content:m})]})})]})};export{L as DevNotesStickyPanel};
|
| 3 |
-
//# sourceMappingURL=DevNotesStickyPanel-CLNoK4mX.js.map
|
|
|
|
|
|
|
|
|
|
|
|
assets/DevNotesStickyPanel-CLNoK4mX.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"DevNotesStickyPanel-CLNoK4mX.js","sources":["../../components/features/DevNotesStickyPanel.tsx"],"sourcesContent":["\nimport React, { useState, useCallback } from 'react';\nimport { FileCodeIcon, SparklesIcon } from '../icons/FeatureIcons.tsx';\nimport { useLocalStorage } from '../../hooks/useLocalStorage.ts';\nimport { summarizeNotesStream } from '../../services/geminiService.ts';\nimport { LoadingSpinner } from '../shared/LoadingSpinner.tsx';\nimport { MarkdownRenderer } from '../shared/MarkdownRenderer.tsx';\n\ninterface Note {\n id: number;\n text: string;\n x: number;\n y: number;\n color: string;\n}\n\nconst colors = ['bg-yellow-300 text-yellow-800', 'bg-green-300 text-green-800', 'bg-blue-300 text-blue-800', 'bg-pink-300 text-pink-800', 'bg-purple-300 text-purple-800'];\n\nexport const DevNotesStickyPanel: React.FC = () => {\n const [notes, setNotes] = useLocalStorage<Note[]>('devcore_notes', []);\n const [dragging, setDragging] = useState<{ id: number; offsetX: number; offsetY: number } | null>(null);\n const [isSummarizing, setIsSummarizing] = useState(false);\n const [summary, setSummary] = useState('');\n\n const handleSummarize = useCallback(async () => {\n if (notes.length === 0) return;\n setIsSummarizing(true);\n setSummary('');\n try {\n const allNotesText = notes.map((n: Note) => `- ${n.text}`).join('\\n');\n const stream = summarizeNotesStream(allNotesText);\n let fullResponse = '';\n for await (const chunk of stream) {\n fullResponse += chunk;\n setSummary(fullResponse);\n }\n } catch (error) {\n console.error(error);\n setSummary('Sorry, an error occurred while summarizing.');\n } finally {\n setIsSummarizing(false);\n }\n }, [notes]);\n\n\n const addNote = () => {\n const newNote: Note = {\n id: Date.now(),\n text: 'New note...',\n x: 50 + (notes.length % 10) * 20,\n y: 50 + (notes.length % 10) * 20,\n color: colors[notes.length % colors.length],\n };\n setNotes([...notes, newNote]);\n };\n\n const updateText = (id: number, text: string) => {\n setNotes(notes.map((n: Note) => n.id === id ? { ...n, text } : n));\n };\n \n const deleteNote = (id: number, e: React.MouseEvent) => {\n e.stopPropagation();\n setNotes(notes.filter((n: Note) => n.id !== id));\n };\n\n const onMouseDown = (e: React.MouseEvent<HTMLDivElement>, id: number) => {\n if((e.target as HTMLElement).tagName === 'TEXTAREA' || (e.target as HTMLElement).tagName === 'BUTTON') return;\n const noteElement = e.currentTarget;\n const rect = noteElement.getBoundingClientRect();\n setDragging({ id, offsetX: e.clientX - rect.left, offsetY: e.clientY - rect.top });\n };\n\n const onMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {\n if (!dragging) return;\n const boardRect = e.currentTarget.getBoundingClientRect();\n setNotes(\n notes.map((n: Note) =>\n n.id === dragging.id\n ? { ...n, x: e.clientX - dragging.offsetX - boardRect.left, y: e.clientY - dragging.offsetY - boardRect.top }\n : n\n )\n );\n };\n\n const onMouseUp = () => setDragging(null);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6 flex justify-between items-center\">\n <div>\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\"><FileCodeIcon /><span className=\"ml-3\">Dev Notes Sticky Panel</span></h1>\n <p className=\"text-slate-400 mt-1\">A place for your thoughts, todos, and random ideas.</p>\n </div>\n <div className=\"flex gap-2\">\n <button onClick={handleSummarize} disabled={isSummarizing || notes.length === 0} className=\"btn-primary flex items-center gap-2 px-4 py-2\">\n <SparklesIcon/> {isSummarizing ? 'Summarizing...' : 'AI Summarize'}\n </button>\n <button onClick={addNote} className=\"btn-primary px-6 py-2\">Add Note</button>\n </div>\n </header>\n <div\n className=\"relative flex-grow bg-slate-900/50 border-2 border-dashed border-slate-700 rounded-lg overflow-hidden\"\n onMouseMove={onMouseMove}\n onMouseUp={onMouseUp}\n onMouseLeave={onMouseUp}\n >\n {notes.map((note: Note) => (\n <div\n key={note.id}\n className={`group absolute w-48 h-48 p-2 flex flex-col shadow-lg cursor-grab active:cursor-grabbing rounded-md transition-transform duration-100 ${note.color}`}\n style={{ top: note.y, left: note.x, transform: dragging?.id === note.id ? 'scale(1.05) rotate(3deg)' : 'scale(1)' }}\n onMouseDown={e => onMouseDown(e, note.id)}\n >\n <button onClick={(e) => deleteNote(note.id, e)} className=\"absolute -top-2 -right-2 w-6 h-6 rounded-full bg-slate-700 text-white font-bold text-xs flex items-center justify-center opacity-0 group-hover:opacity-100 hover:bg-red-500 transition-all\">×</button>\n <textarea\n value={note.text}\n onChange={(e) => updateText(note.id, e.target.value)}\n className=\"w-full h-full bg-transparent resize-none focus:outline-none font-medium p-1 placeholder:text-inherit/50\"\n />\n </div>\n ))}\n </div>\n {(isSummarizing || summary) && (\n <div className=\"fixed inset-0 bg-slate-900/80 backdrop-blur-sm z-50 flex items-center justify-center\" onClick={() => setSummary('')}>\n <div className=\"w-full max-w-2xl bg-slate-800 border border-slate-700 rounded-lg shadow-2xl p-6\" onClick={e => e.stopPropagation()}>\n <h2 className=\"text-xl font-bold mb-4\">AI Summary of Notes</h2>\n {isSummarizing && !summary ? <LoadingSpinner /> : <MarkdownRenderer content={summary} />}\n </div>\n </div>\n )}\n </div>\n );\n};\n"],"names":["colors","DevNotesStickyPanel","notes","setNotes","useLocalStorage","dragging","setDragging","useState","isSummarizing","setIsSummarizing","summary","setSummary","handleSummarize","useCallback","allNotesText","n","stream","summarizeNotesStream","fullResponse","chunk","error","addNote","newNote","updateText","id","text","deleteNote","e","onMouseDown","rect","onMouseMove","boardRect","onMouseUp","jsxs","jsx","FileCodeIcon","SparklesIcon","note","LoadingSpinner","MarkdownRenderer"],"mappings":"2SAgBA,MAAMA,EAAS,CAAC,gCAAiC,8BAA+B,4BAA6B,4BAA6B,+BAA+B,EAE5JC,EAAgC,IAAM,CAC/C,KAAM,CAACC,EAAOC,CAAQ,EAAIC,EAAwB,gBAAiB,CAAA,CAAE,EAC/D,CAACC,EAAUC,CAAW,EAAIC,EAAAA,SAAkE,IAAI,EAChG,CAACC,EAAeC,CAAgB,EAAIF,EAAAA,SAAS,EAAK,EAClD,CAACG,EAASC,CAAU,EAAIJ,EAAAA,SAAS,EAAE,EAEnCK,EAAkBC,EAAAA,YAAY,SAAY,CAC5C,GAAIX,EAAM,SAAW,EACrB,CAAAO,EAAiB,EAAI,EACrBE,EAAW,EAAE,EACb,GAAI,CACA,MAAMG,EAAeZ,EAAM,IAAKa,GAAY,KAAKA,EAAE,IA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AG,UAAU,6LAA6L,SAAA,GAAA,CAAO,EAC/PO,EAAAA,IAAC,WAAA,CACG,MAAOG,EAAK,KACZ,SAAWV,GAAMJ,EAAWc,EAAK,GAAIV,EAAE,OAAO,KAAK,EACnD,UAAU,yGAAA,CAAA,CACd,CAAA,EAVKU,EAAK,EAAA,CAYjB,CAAA,CAAA,GAEH7B,GAAiBE,IACdwB,EAAAA,IAAC,OAAI,UAAU,uFAAuF,QAAS,IAAMvB,EAAW,EAAE,EAC/H,SAAAsB,EAAAA,KAAC,OAAI,UAAU,kFAAkF,QAAS,GAAK,EAAE,kBAC7G,SAAA,CAAAC,EAAAA,IAAC,KAAA,CAAG,UAAU,yBAAyB,SAAA,sBAAmB,EACzD1B,GAAiB,CAACE,EAAUwB,EAAAA,IAACI,IAAe,EAAKJ,EAAAA,IAACK,EAAA,CAAiB,QAAS7B,CAAA,CAAS,CAAA,CAAA,CAC1F,CAAA,CACJ,CAAA,EAER,CAER"}
|
|
|
|
|
|
assets/FontPairingTool-BiWUGH0d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as i,j as e}from"./react-D_B_5QVd.js";import{E as m}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const p=["Roboto","Open Sans","Lato","Montserrat","Oswald","Source Sans Pro","Raleway","Poppins","Nunito","Merriweather","Playfair Display","Lora","Noto Sans","Ubuntu","PT Sans","Slabo 27px"],N=()=>{const[t,c]=i.useState("Oswald"),[l,d]=i.useState("Roboto");i.useEffect(()=>{const a=[t,l].filter(Boolean).join("|");if(a){const n="font-pairing-stylesheet";let s=document.getElementById(n);s||(s=document.createElement("link"),s.id=n,s.rel="stylesheet",document.head.appendChild(s)),s.href=`https://fonts.googleapis.com/css?family=${a.replace(/ /g,"+")}:400,700&display=swap`}},[t,l]);const r=({label:a,value:n,onChange:s})=>e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-slate-400",children:a}),e.jsx("select",{value:n,onChange:o=>s(o.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700",children:p.map(o=>e.jsx("option",{value:o,children:o},o))})]});return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(m,{}),e.jsx("span",{className:"ml-3",children:"Font Pairing Tool"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Preview Google Font combinations for your projects."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg",children:[e.jsx("h3",{className:"text-xl font-bold",children:"Controls"}),e.jsx(r,{label:"Heading Font",value:t,onChange:c}),e.jsx(r,{label:"Body Font",value:l,onChange:d})]}),e.jsxs("div",{className:"lg:col-span-2 bg-slate-900/50 border border-slate-700 rounded-lg p-8 overflow-y-auto",children:[e.jsx("h2",{className:"text-4xl font-bold mb-4",style:{fontFamily:`'${t}', sans-serif`},children:"The Quick Brown Fox Jumps Over the Lazy Dog"}),e.jsx("p",{className:"text-lg",style:{fontFamily:`'${l}', sans-serif`},children:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat."})]})]})]})};export{N as FontPairingTool};
|
| 2 |
-
//# sourceMappingURL=FontPairingTool-BiWUGH0d.js.map
|
|
|
|
|
|
|
|
|
assets/FontPairingTool-BiWUGH0d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"FontPairingTool-BiWUGH0d.js","sources":["../../components/features/FontPairingTool.tsx"],"sourcesContent":["\nimport React, { useState, useEffect } from 'react';\nimport { EyeIcon } from '../icons/FeatureIcons.tsx';\n\nconst popularFonts = [\n 'Roboto', 'Open Sans', 'Lato', 'Montserrat', 'Oswald', 'Source Sans Pro', 'Raleway', 'Poppins', 'Nunito', 'Merriweather',\n 'Playfair Display', 'Lora', 'Noto Sans', 'Ubuntu', 'PT Sans', 'Slabo 27px'\n];\n\nexport const FontPairingTool: React.FC = () => {\n const [headingFont, setHeadingFont] = useState('Oswald');\n const [bodyFont, setBodyFont] = useState('Roboto');\n\n useEffect(() => {\n const fontsToLoad = [headingFont, bodyFont].filter(Boolean).join('|');\n if (fontsToLoad) {\n const linkId = 'font-pairing-stylesheet';\n let link = document.getElementById(linkId) as HTMLLinkElement;\n if (!link) {\n link = document.createElement('link');\n link.id = linkId;\n link.rel = 'stylesheet';\n document.head.appendChild(link);\n }\n link.href = `https://fonts.googleapis.com/css?family=${fontsToLoad.replace(/ /g, '+')}:400,700&display=swap`;\n }\n }, [headingFont, bodyFont]);\n \n const FontSelector: React.FC<{ label: string, value: string, onChange: (font: string) => void }> = ({ label, value, onChange }) => (\n <div>\n <label className=\"block text-sm font-medium text-slate-400\">{label}</label>\n <select value={value} onChange={e => onChange(e.target.value)} className=\"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700\">\n {popularFonts.map(font => <option key={font} value={font}>{font}</option>)}\n </select>\n </div>\n );\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <EyeIcon />\n <span className=\"ml-3\">Font Pairing Tool</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Preview Google Font combinations for your projects.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0\">\n <div className=\"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg\">\n <h3 className=\"text-xl font-bold\">Controls</h3>\n <FontSelector label=\"Heading Font\" value={headingFont} onChange={setHeadingFont} />\n <FontSelector label=\"Body Font\" value={bodyFont} onChange={setBodyFont} />\n </div>\n <div className=\"lg:col-span-2 bg-slate-900/50 border border-slate-700 rounded-lg p-8 overflow-y-auto\">\n <h2 className=\"text-4xl font-bold mb-4\" style={{ fontFamily: `'${headingFont}', sans-serif` }}>\n The Quick Brown Fox Jumps Over the Lazy Dog\n </h2>\n <p className=\"text-lg\" style={{ fontFamily: `'${bodyFont}', sans-serif` }}>\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed non risus. Suspendisse lectus tortor, dignissim sit amet, adipiscing nec, ultricies sed, dolor. Cras elementum ultrices diam. Maecenas ligula massa, varius a, semper congue, euismod non, mi. Proin porttitor, orci nec nonummy molestie, enim est eleifend mi, non fermentum diam nisl sit amet erat.\n </p>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["popularFonts","FontPairingTool","headingFont","setHeadingFont","useState","bodyFont","setBodyFont","useEffect","fontsToLoad","linkId","link","FontSelector","label","value","onChange","jsx","e","font","jsxs","EyeIcon"],"mappings":"wQAIA,MAAMA,EAAe,CACjB,SAAU,YAAa,OAAQ,aAAc,SAAU,kBAAmB,UAAW,UAAW,SAAU,eAC1G,mBAAoB,OAAQ,YAAa,SAAU,UAAW,YAClE,EAEaC,EAA4B,IAAM,CAC3C,KAAM,CAACC,EAAaC,CAAc,EAAIC,EAAAA,SAAS,QAAQ,EACjD,CAACC,EAAUC,CAAW,EAAIF,EAAAA,SAAS,QAAQ,EAEjDG,EAAAA,UAAU,IAAM,CACZ,MAAMC,EAAc,CAACN,EAAaG,CAAQ,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACpE,GAAIG,EAAa,CACb,MAAMC,EAAS,0BACf,IAAIC,EAAO,SAAS,eAAeD,CAAM,EACpCC,IACDA,EAAO,SA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U,uFACX,SAAA,CAAAH,EAAAA,IAAC,KAAA,CAAG,UAAU,0BAA0B,MAAO,CAAE,WAAY,IAAIb,CAAW,eAAA,EAAmB,SAAA,6CAAA,CAE/F,EACAa,EAAAA,IAAC,IAAA,CAAE,UAAU,UAAU,MAAO,CAAE,WAAY,IAAIV,CAAQ,eAAA,EAAmB,SAAA,sWAAA,CAE3E,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/FontPreviewPicker-BY0e7Rn9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./react-D_B_5QVd.js";import{E as d}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const x=["Roboto","Open Sans","Lato","Montserrat","Oswald","Source Sans Pro","Raleway","Poppins","Nunito","Merriweather","Playfair Display","Lora","Noto Sans","Ubuntu","PT Sans","Slabo 27px"],j=()=>{const[s,n]=a.useState("Roboto"),[o,c]=a.useState("The quick brown fox jumps over the lazy dog.");a.useEffect(()=>{if(s){const t="font-preview-stylesheet";let l=document.getElementById(t);l||(l=document.createElement("link"),l.id=t,l.rel="stylesheet",document.head.appendChild(l)),l.href=`https://fonts.googleapis.com/css?family=${s.replace(/ /g,"+")}&display=swap`}},[s]);const r=`@import url('https://fonts.googleapis.com/css?family=${s.replace(/ /g,"+")}&display=swap');`,i=`font-family: '${s}', sans-serif;`;return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(d,{}),e.jsx("span",{className:"ml-3",children:"Font Preview & Picker"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Preview Google Fonts and get the CSS import rule."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0",children:[e.jsxs("div",{className:"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg",children:[e.jsx("h3",{className:"text-xl font-bold",children:"Controls"}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"font-select",className:"block text-sm font-medium text-slate-400",children:"Select Font"}),e.jsx("select",{id:"font-select",value:s,onChange:t=>n(t.target.value),className:"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700",children:x.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"preview-text",className:"block text-sm font-medium text-slate-400",children:"Preview Text"}),e.jsx("textarea",{id:"preview-text",value:o,onChange:t=>c(t.target.value),className:"w-full mt-1 p-2 rounded-md bg-slate-800 border border-slate-700 h-24 resize-none"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"block text-sm font-medium text-slate-400",children:"CSS Rules"}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-slate-900 p-2 rounded-md text-cyan-300 text-xs overflow-x-auto",children:r}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(r),className:"absolute top-1 right-1 px-2 py-0.5 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("pre",{className:"bg-slate-900 p-2 rounded-md text-cyan-300 text-xs overflow-x-auto",children:i}),e.jsx("button",{onClick:()=>navigator.clipboard.writeText(i),className:"absolute top-1 right-1 px-2 py-0.5 bg-slate-700 hover:bg-slate-600 rounded-md text-xs",children:"Copy"})]})]})]}),e.jsx("div",{className:"lg:col-span-2 bg-slate-900/50 border border-slate-700 rounded-lg p-8 flex items-center justify-center",children:e.jsx("p",{className:"text-4xl",style:{fontFamily:`'${s}', sans-serif`},children:o})})]})]})};export{j as FontPreviewPicker};
|
| 2 |
-
//# sourceMappingURL=FontPreviewPicker-BY0e7Rn9.js.map
|
|
|
|
|
|
|
|
|
assets/FontPreviewPicker-BY0e7Rn9.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"FontPreviewPicker-BY0e7Rn9.js","sources":["../../components/features/FontPreviewPicker.tsx"],"sourcesContent":["\nimport React, { useState, useEffect } from 'react';\nimport { EyeIcon } from '../icons/FeatureIcons.tsx';\n\nconst popularFonts = [\n 'Roboto', 'Open Sans', 'Lato', 'Montserrat', 'Oswald', 'Source Sans Pro', 'Raleway', 'Poppins', 'Nunito', 'Merriweather',\n 'Playfair Display', 'Lora', 'Noto Sans', 'Ubuntu', 'PT Sans', 'Slabo 27px'\n];\n\nexport const FontPreviewPicker: React.FC = () => {\n const [selectedFont, setSelectedFont] = useState('Roboto');\n const [previewText, setPreviewText] = useState('The quick brown fox jumps over the lazy dog.');\n\n useEffect(() => {\n if (selectedFont) {\n const linkId = 'font-preview-stylesheet';\n let link = document.getElementById(linkId) as HTMLLinkElement;\n if (!link) {\n link = document.createElement('link');\n link.id = linkId;\n link.rel = 'stylesheet';\n document.head.appendChild(link);\n }\n link.href = `https://fonts.googleapis.com/css?family=${selectedFont.replace(/ /g, '+')}&display=swap`;\n }\n }, [selectedFont]);\n \n const importRule = `@import url('https://fonts.googleapis.com/css?family=${selectedFont.replace(/ /g, '+')}&display=swap');`;\n const cssRule = `font-family: '${selectedFont}', sans-serif;`;\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <EyeIcon />\n <span className=\"ml-3\">Font Preview & Picker</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Preview Google Fonts and get the CSS import rule.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-3 gap-6 min-h-0\">\n <div className=\"lg:col-span-1 flex flex-col gap-4 bg-slate-800/50 p-6 rounded-lg\">\n <h3 className=\"text-xl font-bold\">Controls</h3>\n <div>\n <label htmlFor=\"font-select\" className=\"block text-sm font-medium text-slate-400\">Select Font</label>\n <select id=\"font-select\" value={selectedFont} onChange={e => setSelectedFont(e.target.value)} className=\"w-full mt-1 px-3 py-2 rounded-md bg-slate-800 border border-slate-700\">\n {popularFonts.map(font => <option key={font} value={font}>{font}</option>)}\n </select>\n </div>\n <div>\n <label htmlFor=\"preview-text\" className=\"block text-sm font-medium text-slate-400\">Preview Text</label>\n <textarea id=\"preview-text\" value={previewText} onChange={e => setPreviewText(e.target.value)} className=\"w-full mt-1 p-2 rounded-md bg-slate-800 border border-slate-700 h-24 resize-none\"></textarea>\n </div>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-slate-400\">CSS Rules</label>\n <div className=\"relative\"><pre className=\"bg-slate-900 p-2 rounded-md text-cyan-300 text-xs overflow-x-auto\">{importRule}</pre><button onClick={() => navigator.clipboard.writeText(importRule)} className=\"absolute top-1 right-1 px-2 py-0.5 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button></div>\n <div className=\"relative\"><pre className=\"bg-slate-900 p-2 rounded-md text-cyan-300 text-xs overflow-x-auto\">{cssRule}</pre><button onClick={() => navigator.clipboard.writeText(cssRule)} className=\"absolute top-1 right-1 px-2 py-0.5 bg-slate-700 hover:bg-slate-600 rounded-md text-xs\">Copy</button></div>\n </div>\n </div>\n <div className=\"lg:col-span-2 bg-slate-900/50 border border-slate-700 rounded-lg p-8 flex items-center justify-center\">\n <p className=\"text-4xl\" style={{ fontFamily: `'${selectedFont}', sans-serif` }}>\n {previewText}\n </p>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["popularFonts","FontPreviewPicker","selectedFont","setSelectedFont","useState","previewText","setPreviewText","useEffect","linkId","link","importRule","cssRule","jsxs","jsx","EyeIcon","e","font"],"mappings":"wQAIA,MAAMA,EAAe,CACjB,SAAU,YAAa,OAAQ,aAAc,SAAU,kBAAmB,UAAW,UAAW,SAAU,eAC1G,mBAAoB,OAAQ,YA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1 |
-
import{r as p,j as e}from"./react-D_B_5QVd.js";import{F as f}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const u=({data:s,nodeKey:o,isRoot:l=!1})=>{const[t,c]=p.useState(l),i=typeof s=="object"&&s!==null,n=()=>c(!t);if(!i)return e.jsxs("div",{className:"ml-4 pl-4 border-l border-slate-700",children:[e.jsxs("span",{className:"text-purple-400",children:[o,": "]}),e.jsx("span",{className:typeof s=="string"?"text-green-400":"text-orange-400",children:typeof s=="string"?`"${s}"`:String(s)})]});const d=Object.entries(s),a=Array.isArray(s)?"[]":"{}";return e.jsxs("div",{className:`ml-4 ${l?"":"pl-4 border-l border-slate-700"}`,children:[e.jsxs("button",{onClick:n,className:"flex items-center cursor-pointer hover:bg-slate-700/50 rounded px-1",children:[e.jsx("span",{className:`transform transition-transform ${t?"rotate-90":"rotate-0"}`,children:"▶"}),e.jsxs("span",{className:"ml-1 text-purple-400",children:[o,":"]}),e.jsx("span",{className:"ml-2 text-slate-500",children:a[0]}),!t&&e.jsxs("span",{className:"text-slate-500",children:["...",a[1]]})]}),t&&e.jsxs("div",{children:[d.map(([x,r])=>e.jsx(u,{nodeKey:x,data:r},x)),e.jsx("div",{className:"text-slate-500 ml-4",children:a[1]})]})]})},O=({initialData:s})=>{const o=`{
|
| 2 |
-
"id": "devcore-001",
|
| 3 |
-
"active": true,
|
| 4 |
-
"features": [
|
| 5 |
-
"ai-explainer",
|
| 6 |
-
"api-tester"
|
| 7 |
-
],
|
| 8 |
-
"config": {
|
| 9 |
-
"theme": "dark",
|
| 10 |
-
"version": 1
|
| 11 |
-
}
|
| 12 |
-
}`,[l,t]=p.useState(s?JSON.stringify(s,null,2):o),[c,i]=p.useState(()=>{try{return JSON.parse(l)}catch{return null}}),[n,d]=p.useState(""),a=r=>{try{const m=JSON.parse(r);i(m),d("")}catch(m){m instanceof Error&&d(m.message),i(null)}},x=r=>{t(r.target.value),a(r.target.value)};return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(f,{}),e.jsx("span",{className:"ml-3",children:"JSON Tree Navigator"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"Paste your JSON data to visualize it as a collapsible tree."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"json-input",className:"text-sm font-medium text-slate-400 mb-2",children:"JSON Input"}),e.jsx("textarea",{id:"json-input",value:l,onChange:x,className:`flex-grow p-4 bg-slate-900 border ${n?"border-red-500":"border-slate-700"} rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none`}),n&&e.jsx("p",{className:"text-red-400 text-xs mt-1",children:n})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Tree View"}),e.jsx("div",{className:"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto font-mono text-sm",children:c?e.jsx(u,{data:c,nodeKey:"root",isRoot:!0}):e.jsx("div",{className:"text-slate-500",children:"Enter valid JSON to view"})})]})]})]})};export{O as JsonTreeNavigator};
|
| 13 |
-
//# sourceMappingURL=JsonTreeNavigator-DDac-dKC.js.map
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/JsonTreeNavigator-DDac-dKC.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"JsonTreeNavigator-DDac-dKC.js","sources":["../../components/features/JsonTreeNavigator.tsx"],"sourcesContent":["\nimport React, { useState } from 'react';\nimport { FileCodeIcon } from '../icons/FeatureIcons.tsx';\n\ninterface JsonNodeProps {\n data: any;\n nodeKey: string;\n isRoot?: boolean;\n}\n\nconst JsonNode: React.FC<JsonNodeProps> = ({ data, nodeKey, isRoot = false }) => {\n const [isOpen, setIsOpen] = useState(isRoot);\n const isObject = typeof data === 'object' && data !== null;\n\n const toggleOpen = () => setIsOpen(!isOpen);\n\n if (!isObject) {\n return (\n <div className=\"ml-4 pl-4 border-l border-slate-700\">\n <span className=\"text-purple-400\">{nodeKey}: </span>\n <span className={typeof data === 'string' ? 'text-green-400' : 'text-orange-400'}>\n {typeof data === 'string' ? `\"${data}\"` : String(data)}\n </span>\n </div>\n );\n }\n\n const entries = Object.entries(data);\n const bracket = Array.isArray(data) ? '[]' : '{}';\n\n return (\n <div className={`ml-4 ${!isRoot ? 'pl-4 border-l border-slate-700' : ''}`}>\n <button onClick={toggleOpen} className=\"flex items-center cursor-pointer hover:bg-slate-700/50 rounded px-1\">\n <span className={`transform transition-transform ${isOpen ? 'rotate-90' : 'rotate-0'}`}>▶</span>\n <span className=\"ml-1 text-purple-400\">{nodeKey}:</span>\n <span className=\"ml-2 text-slate-500\">{bracket[0]}</span>\n {!isOpen && <span className=\"text-slate-500\">...{bracket[1]}</span>}\n </button>\n {isOpen && (\n <div>\n {entries.map(([key, value]) => (\n <JsonNode key={key} nodeKey={key} data={value} />\n ))}\n <div className=\"text-slate-500 ml-4\">{bracket[1]}</div>\n </div>\n )}\n </div>\n );\n};\n\nexport const JsonTreeNavigator: React.FC<{ initialData?: object }> = ({ initialData }) => {\n const defaultJson = '{\\n \"id\": \"devcore-001\",\\n \"active\": true,\\n \"features\": [\\n \"ai-explainer\",\\n \"api-tester\"\\n ],\\n \"config\": {\\n \"theme\": \"dark\",\\n \"version\": 1\\n }\\n}';\n const [jsonInput, setJsonInput] = useState(initialData ? JSON.stringify(initialData, null, 2) : defaultJson);\n const [parsedData, setParsedData] = useState<any>(() => {\n try {\n return JSON.parse(jsonInput);\n } catch {\n return null;\n }\n });\n const [error, setError] = useState('');\n\n const parseJson = (input: string) => {\n try {\n const parsed = JSON.parse(input);\n setParsedData(parsed);\n setError('');\n } catch (e) {\n if (e instanceof Error) setError(e.message);\n setParsedData(null);\n }\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setJsonInput(e.target.value);\n parseJson(e.target.value);\n }\n \n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl font-bold text-slate-100 flex items-center\">\n <FileCodeIcon />\n <span className=\"ml-3\">JSON Tree Navigator</span>\n </h1>\n <p className=\"text-slate-400 mt-1\">Paste your JSON data to visualize it as a collapsible tree.</p>\n </header>\n <div className=\"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden\">\n <div className=\"flex flex-col h-full\">\n <label htmlFor=\"json-input\" className=\"text-sm font-medium text-slate-400 mb-2\">JSON Input</label>\n <textarea\n id=\"json-input\"\n value={jsonInput}\n onChange={handleInputChange}\n className={`flex-grow p-4 bg-slate-900 border ${error ? 'border-red-500' : 'border-slate-700'} rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none`}\n />\n {error && <p className=\"text-red-400 text-xs mt-1\">{error}</p>}\n </div>\n <div className=\"flex flex-col h-full\">\n <label className=\"text-sm font-medium text-slate-400 mb-2\">Tree View</label>\n <div className=\"flex-grow p-4 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto font-mono text-sm\">\n {parsedData ? <JsonNode data={parsedData} nodeKey=\"root\" isRoot /> : <div className=\"text-slate-500\">Enter valid JSON to view</div>}\n </div>\n </div>\n </div>\n </div>\n );\n};\n"],"names":["JsonNode","data","nodeKey","isRoot","isOpen","setIsOpen","useState","isObject","toggleOpen","jsxs","entries","bracket","jsx","key","value","JsonTreeNavigator","initialData","defaultJson","jsonInput","setJsonInput","parsedData","setParsedData","error","setError","parseJson","input","parsed","e","handleInputChange","FileCodeIcon"],"mappings":"wQAUA,MAAMA,EAAoC,CAAC,CAAE,KAAAC,EAAM,QAAAC,EAAS,OAAAC,EAAS,MAAY,CAC7E,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAASH,CAAM,EACrCI,EAAW,OAAON,GAAS,UAAYA,IAAS,KAEhDO,EAAa,IAAMH,EAAU,CAACD,CAAM,EAE1C,GAAI,CAACG,EACD,OACIE,EAAAA,KAAC,MAAA,CAAI,UAAU,sCACX,SAAA,CAAAA,EAAAA,KAAC,OAAA,CAAK,UAAU,kBAAmB,SAAA,CAAAP,EAAQ,IAAA,EAAE,QAC5C,OAAA,CAAK,UAAW,OAAOD,GAAS,SAAW,iBAAmB,kBAC1D,SAAA,OAAOA,GAAS,SAAW,IAAIA,CAAI,IAAM,OAAOA,CAAI,CAAA,CACzD,CAAA,EACJ,EAIR,MAAMS,EAAU,OAAO,QAAQT,CAAI,EAC7BU,EAAU,MAAM,QAAQV,CAAI,EAAI,KAAO,KAE7C,OACIQ,OAAC,OAAI,UAAW,QAASN,EAA4C,GAAnC,gCAAqC,GACnE,SAAA,CAAAM,EAAAA,KAAC,SAAA,CAAO,QAASD,EAAY,UAAU,sEACnC,SAAA,CAAAI,EAAAA,IAAC,QAAK,UAAW,kCAAkCR,EAAS,YAAc,UAAU,GAAI,SAAA,GAAA,CAAC,EACzFK,EAAAA,KAAC,OAAA,CAAK,UAAU,uBAAwB,SAAA,CAAAP,EAAQ,GAAA,EAAC,QAChD,OAAA,CAAK,UAAU,sBAAuB,SAAAS,EAAQ,CAAC,EAAE,EACjD,CAACP,GAAUK,EAAAA,KAAC,OAAA,CAAK,UAAU,iBAAiB,SAAA,CAAA,MAAIE,EAAQ,CAAC,CAAA,CAAA,CAAE,CAAA,EAChE,EACCP,UACI,MAAA,CACI,SAAA,CAAAM,EAAQ,IAAI,CAAC,CAACG,EAAKC,CAAK,IACrBF,E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H,EAAAA,KAAC,MAAA,CAAI,UAAU,yEACX,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACX,SAAA,CAAAG,MAAC,QAAA,CAAM,QAAQ,aAAa,UAAU,0CAA0C,SAAA,aAAU,EAC1FA,EAAAA,IAAC,WAAA,CACG,GAAG,aACH,MAAOM,EACP,SAAUU,EACV,UAAW,qCAAqCN,EAAQ,iBAAmB,kBAAkB,6GAAA,CAAA,EAEhGA,GAASV,EAAAA,IAAC,IAAA,CAAE,UAAU,4BAA6B,SAAAU,CAAA,CAAM,CAAA,EAC9D,EACCb,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACZ,SAAA,CAAAG,EAAAA,IAAC,QAAA,CAAM,UAAU,0CAA0C,SAAA,YAAS,QACnE,MAAA,CAAI,UAAU,wGACV,SAAAQ,EAAaR,MAACZ,GAAS,KAAMoB,EAAY,QAAQ,OAAO,OAAM,GAAC,EAAKR,MAAC,OAAI,UAAU,iBAAiB,oCAAwB,CAAA,CACjI,CAAA,CAAA,CACJ,CAAA,CAAA,CACJ,CAAA,EACJ,CAER"}
|
|
|
|
|
|
assets/LogicFlowBuilder-C0g3EKR6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
import{r as a,j as e}from"./react-D_B_5QVd.js";import{q as p}from"./index-Dg9as_wf.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./marked-CesSW9Du.js";import"./idb-Dob3nYDb.js";const g={start:"border-green-500 bg-green-900/50",process:"border-cyan-500 bg-cyan-900/50",decision:"border-yellow-500 bg-yellow-900/50",end:"border-red-500 bg-red-900/50"},f=({node:r,onMouseDown:i})=>e.jsx("div",{className:`absolute p-4 rounded-lg shadow-lg text-sm cursor-grab active:cursor-grabbing border ${g[r.type]}`,style:{left:r.x,top:r.y,transform:"translate(-50%, -50%)"},onMouseDown:o=>i(o,r.id),children:r.title}),R=()=>{const[r,i]=a.useState([{id:1,title:"Start",type:"start",x:100,y:200},{id:2,title:"Process Data",type:"process",x:300,y:200}]),[o,c]=a.useState(null),n=a.useRef(null),m=(t,l)=>{const u=t.currentTarget.getBoundingClientRect();n.current.getBoundingClientRect(),c({id:l,offsetX:t.clientX-u.left,offsetY:t.clientY-u.top})},x=t=>{if(!o||!n.current)return;const l=n.current.getBoundingClientRect();i(r.map(s=>s.id===o.id?{...s,x:t.clientX-l.left-o.offsetX,y:t.clientY-l.top-o.offsetY}:s))},d=()=>c(null);return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl flex items-center",children:[e.jsx(p,{}),e.jsx("span",{className:"ml-3",children:"Logic Flow Builder"})]}),e.jsx("p",{className:"text-slate-400 mt-1",children:"A visual tool for building application logic flows."})]}),e.jsxs("div",{className:"flex-grow relative bg-slate-900/50 rounded-lg border-2 border-dashed border-slate-700 overflow-hidden",ref:n,onMouseMove:x,onMouseUp:d,onMouseLeave:d,children:[e.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",children:[r.slice(0,-1).map((t,l)=>{const s=r[l+1];return e.jsx("line",{x1:t.x,y1:t.y,x2:s.x,y2:s.y,stroke:"#475569",strokeWidth:"2",markerEnd:"url(#arrow)"},`${t.id}-${s.id}`)}),e.jsx("defs",{children:e.jsx("marker",{id:"arrow",viewBox:"0 0 10 10",refX:"5",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:e.jsx("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"#475569"})})})]}),r.map(t=>e.jsx(f,{node:t,onMouseDown:m},t.id))]})]})};export{R as LogicFlowBuilder};
|
| 2 |
-
//# sourceMappingURL=LogicFlowBuilder-C0g3EKR6.js.map
|
|
|
|
|
|
|
|
|
assets/LogicFlowBuilder-C0g3EKR6.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
{"version":3,"file":"LogicFlowBuilder-C0g3EKR6.js","sources":["../../components/features/LogicFlowBuilder.tsx"],"sourcesContent":["\nimport React, { useState, useRef } from 'react';\nimport { MapIcon } from '../icons/FeatureIcons.tsx';\n\ninterface Node {\n id: number;\n title: string;\n type: 'start' | 'process' | 'decision' | 'end';\n x: number;\n y: number;\n}\n\nconst nodeColors = {\n start: 'border-green-500 bg-green-900/50',\n process: 'border-cyan-500 bg-cyan-900/50',\n decision: 'border-yellow-500 bg-yellow-900/50',\n end: 'border-red-500 bg-red-900/50',\n};\n\nconst NodeComponent: React.FC<{ node: Node, onMouseDown: (e: React.MouseEvent, id: number) => void }> = ({ node, onMouseDown }) => (\n <div\n className={`absolute p-4 rounded-lg shadow-lg text-sm cursor-grab active:cursor-grabbing border ${nodeColors[node.type]}`}\n style={{ left: node.x, top: node.y, transform: 'translate(-50%, -50%)' }}\n onMouseDown={e => onMouseDown(e, node.id)}\n >\n {node.title}\n </div>\n);\n\nexport const LogicFlowBuilder: React.FC = () => {\n const [nodes, setNodes] = useState<Node[]>([\n { id: 1, title: 'Start', type: 'start', x: 100, y: 200 },\n { id: 2, title: 'Process Data', type: 'process', x: 300, y: 200 },\n ]);\n const [dragging, setDragging] = useState<{ id: number; offsetX: number; offsetY: number } | null>(null);\n const canvasRef = useRef<HTMLDivElement>(null);\n\n const onMouseDown = (e: React.MouseEvent, id: number) => {\n const nodeElement = e.currentTarget as HTMLElement;\n const rect = nodeElement.getBoundingClientRect();\n const canvasRect = canvasRef.current!.getBoundingClientRect();\n setDragging({ \n id, \n offsetX: e.clientX - rect.left, \n offsetY: e.clientY - rect.top \n });\n };\n\n const onMouseMove = (e: React.MouseEvent) => {\n if (!dragging || !canvasRef.current) return;\n const canvasRect = canvasRef.current.getBoundingClientRect();\n setNodes(nodes.map(n => n.id === dragging.id ? { \n ...n, \n x: e.clientX - canvasRect.left - dragging.offsetX,\n y: e.clientY - canvasRect.top - dragging.offsetY\n } : n));\n };\n\n const onMouseUp = () => setDragging(null);\n\n return (\n <div className=\"h-full flex flex-col p-4 sm:p-6 lg:p-8\">\n <header className=\"mb-6\">\n <h1 className=\"text-3xl flex items-center\"><MapIcon /><span className=\"ml-3\">Logic Flow Builder</span></h1>\n <p className=\"text-slate-400 mt-1\">A visual tool for building application logic flows.</p>\n </header>\n <div className=\"flex-grow relative bg-slate-900/50 rounded-lg border-2 border-dashed border-slate-700 overflow-hidden\" ref={canvasRef} onMouseMove={onMouseMove} onMouseUp={onMouseUp} onMouseLeave={onMouseUp}>\n <svg className=\"absolute inset-0 w-full h-full pointer-events-none\">\n {nodes.slice(0, -1).map((node, i) => {\n const nextNode = nodes[i+1];\n return <line key={`${node.id}-${nextNode.id}`} x1={node.x} y1={node.y} x2={nextNode.x} y2={nextNode.y} stroke=\"#475569\" strokeWidth=\"2\" markerEnd=\"url(#arrow)\" />;\n })}\n <defs>\n <marker id=\"arrow\" viewBox=\"0 0 10 10\" refX=\"5\" refY=\"5\" markerWidth=\"6\" markerHeight=\"6\" orient=\"auto-start-reverse\">\n <path d=\"M 0 0 L 10 5 L 0 10 z\" fill=\"#475569\" />\n </marker>\n </defs>\n </svg>\n {nodes.map(node => <NodeComponent key={node.id} node={node} onMouseDown={onMouseDown} />)}\n </div>\n </div>\n );\n};\n"],"names":["nodeColors","NodeComponent","node","onMouseDown","jsx","e","LogicFlowBuilder","nodes","setNodes","useState","dragging","setDragging","canvasRef","useRef","id","rect","onMouseMove","canvasRect","n","onMouseUp","jsxs","MapIcon","i","nextNode"],"mappings":"wQAYA,MAAMA,EAAa,CACf,MAAO,mCACP,QAAS,iCACT,SAAU,qCACV,IAAK,8BACT,EAEMC,EAAkG,CAAC,CAAE,KAAAC,EAAM,YAAAC,KAC7GC,EAAAA,IAAC,MAAA,CACG,UAAW,uFAAuFJ,EAAWE,EAAK,IAAI,CAAC,GACvH,MAAO,CAAE,KAAMA,EAAK,EAAG,IAAKA,EAAK,EAAG,UAAW,uBAAA,EAC/C,YAAaG,GAAKF,EAAYE,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