CoolFace
Apppublic

admin08077/Githubgemini

sourceHugging Faceotherupdated 10mo agoView on Hugging Face
0likes
CodeSpellChecker-B0VPiJ9S.js7 linesDownload Raw Back to assets
1import{r as m,j as t,R as p}from"./react-CIdJ77ke.js";import{B as s}from"./index-CX7Qxd1D.js";import"./@braintree-DzxiOROe.js";import"./react-dom-R9L8nDNe.js";import"./scheduler-CoSDG3-6.js";import"./@google-CcUHq7Ay.js";import"./idb-Dob3nYDb.js";import"./marked-BrGMJkBT.js";import"./mermaid-KwKZWwy0.js";import"./dayjs-CeEF-NGT.js";import"./d3-transition-CiCB8KJE.js";import"./d3-timer-DdKHrDhs.js";import"./d3-dispatch-kxCwF96_.js";import"./d3-interpolate-CtIaNujU.js";import"./d3-color-amxIadob.js";import"./d3-selection-C52G7wmG.js";import"./d3-ease-DRPgKoYJ.js";import"./d3-zoom-BYoC3mS3.js";import"./dompurify-J5RlrwSC.js";import"./dagre-d3-es-CTpFWynZ.js";import"./lodash-es-Dt6r0yiR.js";import"./d3-shape-CX8xTzfR.js";import"./d3-path-CimkQT29.js";import"./d3-fetch-BOsq7VnW.js";import"./khroma-DUX6PT6k.js";import"./uuid-DhYbOkY1.js";import"./d3-scale-DRZz3QW5.js";import"./internmap-BkD7Hj8s.js";import"./d3-array-DGRYoJHh.js";import"./d3-format-CzD4bSOQ.js";import"./d3-time-format-CUNN4Ell.js";import"./d3-time-6cSPyVSY.js";import"./d3-axis-DSWTncID.js";import"./elkjs-oKFFZvz7.js";import"./cytoscape-DtBltrT8.js";import"./cytoscape-cose-bilkent-Cgr1thlj.js";import"./cose-base-CwCxnKwh.js";import"./layout-base-CMXQqlmj.js";import"./d3-sankey-DgqkLiUE.js";import"./d3-scale-chromatic-B-NsZVaP.js";import"./ts-dedent-DrFu-skq.js";import"./stylis-D5iaQeiq.js";import"./mdast-util-from-markdown-CLAsVoWb.js";import"./micromark-CTBPIv-_.js";import"./micromark-util-combine-extensions-Bka6Sc1c.js";import"./micromark-util-chunked-DrRIdSP-.js";import"./micromark-factory-space-x2vfxbz5.js";import"./micromark-util-character-Bcm1tP9o.js";import"./micromark-core-commonmark-AH8VCgT7.js";import"./micromark-util-classify-character-Cq7Fg3xE.js";import"./micromark-util-resolve-all-PQCKh0dx.js";import"./decode-named-character-reference-C3-224fz.js";import"./micromark-util-subtokenize-QwsxNXk2.js";import"./micromark-factory-destination-CypD_wgM.js";import"./micromark-factory-label-CRHH4ZHP.js";import"./micromark-factory-title-B7kCBvC9.js";import"./micromark-factory-whitespace-B322EA6O.js";import"./micromark-util-normalize-identifier-C9ANKk3v.js";import"./micromark-util-html-tag-name-DbKNfynz.js";import"./micromark-util-decode-numeric-character-reference-DRnCnno4.js";import"./micromark-util-decode-string-DJl8Y_PO.js";import"./unist-util-stringify-position-Ch_qCilz.js";import"./mdast-util-to-string-C_aolqmU.js";import"./jszip-CFFhfFtd.js";import"./octokit-B6bKu3NB.js";import"./@octokit-MBEWYTsi.js";import"./bottleneck-D_vuF9V7.js";import"./universal-user-agent-CLgqIJsR.js";import"./before-after-hook-y8XtM9xW.js";import"./fast-content-type-parse-3SwieiST.js";const a=["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"],i=new RegExp(`\\b(${a.join("|")})\\b`,"gi"),c=p.memo(({text:e})=>{const o=m.useMemo(()=>e.split(i).map((r,n)=>i.test(r)?t.jsx("span",{className:"underline decoration-red-500 decoration-wavy",title:"Possible typo",children:r},n):r),[e]);return t.jsx(t.Fragment,{children:o})}),Et=()=>{const[e,o]=m.useState(`funtion myFunction() {2  consle.log("Hello World");3  const myVarable = docment.getElementById("root");4  // This is a React componnet5}`);return t.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[t.jsxs("header",{className:"mb-6",children:[t.jsxs("h1",{className:"text-3xl flex items-center",children:[t.jsx(s,{}),t.jsx("span",{className:"ml-3",children:"Code Spell Checker"})]}),t.jsx("p",{className:"text-text-secondary mt-1",children:"A simple tool that finds and highlights common typos in code."})]}),t.jsxs("div",{className:"relative flex-grow font-mono text-sm bg-surface border border-border rounded-lg p-4 overflow-auto",children:[t.jsx("textarea",{value:e,onChange:r=>o(r.target.value),className:"absolute inset-0 w-full h-full p-4 bg-transparent text-transparent caret-primary resize-none z-10",spellCheck:"false"}),t.jsx("pre",{className:"absolute inset-0 w-full h-full p-4 pointer-events-none whitespace-pre-wrap","aria-hidden":"true",children:t.jsx(c,{text:e})})]}),t.jsx("p",{className:"text-xs text-text-secondary mt-2 text-center",children:"This checker uses a predefined list of common typos and does not use AI."})]})};export{Et as CodeSpellChecker};6//# sourceMappingURL=CodeSpellChecker-B0VPiJ9S.js.map7