{"_id":"@altagen/velt-core","_rev":"5-57bc17031b3e1dabb8c1fa448434aeab","name":"@altagen/velt-core","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@altagen/velt-core","version":"0.1.0","keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"author":{"name":"Altagen"},"license":"MIT","_id":"@altagen/velt-core@0.1.0","maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"homepage":"https://github.com/Altagen/Velt-Core#readme","bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"dist":{"shasum":"622c3ff801855a8dfbc110d8433f841ee69f3b82","tarball":"https://registry.npmjs.org/@altagen/velt-core/-/velt-core-0.1.0.tgz","fileCount":27,"integrity":"sha512-AEz32cIELLdU4faCHf+6CdlYyPnW1hZBTyUzi/de2AMy3+fRpwyg0ed277MkCayUvxtCodXGKuNZL11T6zdj2w==","signatures":[{"sig":"MEYCIQDVRia+gPtbm+OyVk7QlZyU3YL4ZNGk0eleDnEX9V2+KAIhANdkQwmN7bWhP85yk4mu1UBooiDozvzL4tYZ9IJWSqaU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@altagen%2fvelt-core@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":151009},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2cff82261bf1fb38fa46b9177546f0ff81f8e342","scripts":{"build":"tsc","prepare":"husky || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"altagen","email":"ange.cesari@proton.me"},"repository":{"url":"git+https://github.com/Altagen/Velt-Core.git","type":"git"},"_npmVersion":"10.8.2","description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","directories":{},"_nodeVersion":"20.20.0","dependencies":{"codemirror":"^6.0.1","@codemirror/view":"^6.35.3","@codemirror/state":"^6.4.1","@codemirror/search":"^6.5.8","@codemirror/commands":"^6.7.1","@codemirror/lang-cpp":"^6.0.3","@codemirror/lang-css":"^6.3.1","@codemirror/lang-php":"^6.0.2","@codemirror/lang-sql":"^6.10.0","@codemirror/lang-xml":"^6.1.0","@codemirror/lang-html":"^6.4.9","@codemirror/lang-java":"^6.0.2","@codemirror/lang-json":"^6.0.1","@codemirror/lang-rust":"^6.0.2","@codemirror/lang-python":"^6.1.6","@codemirror/lang-markdown":"^6.3.1","@codemirror/lang-javascript":"^6.2.2"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.9.3","@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1"},"peerDependencies":{"@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0"},"peerDependenciesMeta":{"@codemirror/view":{"optional":false},"@codemirror/state":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/velt-core_0.1.0_1770320437263_0.4830820900134192","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@altagen/velt-core","version":"0.1.1","keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"author":{"name":"Altagen"},"license":"MIT","_id":"@altagen/velt-core@0.1.1","maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"homepage":"https://github.com/Altagen/Velt-Core#readme","bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"dist":{"shasum":"f102a9e5348c67588ed43c7c41bcdc302f9b30a4","tarball":"https://registry.npmjs.org/@altagen/velt-core/-/velt-core-0.1.1.tgz","fileCount":27,"integrity":"sha512-yxZCoHte4pSI17N4yVytagrs2wiYv2A4kUOXPnw9PMfRXoF+TcZoM8ZXdJVaLMEtfC6urLd/IyKwF2R0/t4ulg==","signatures":[{"sig":"MEQCIFHgvRgXa20NVVLzUcaue9iWURSPDO9PnQUAKuuI9KneAiBJMXaSlm70QHiZU9AR1TiOS3K8Pow+j+olQRRe2DoPvA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@altagen%2fvelt-core@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":145780},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ee4c952f7fcfddf2c74b9d785f9cc56a9a8d0ead","scripts":{"build":"tsc","prepare":"husky || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"altagen","email":"ange.cesari@proton.me"},"repository":{"url":"git+https://github.com/Altagen/Velt-Core.git","type":"git"},"_npmVersion":"10.8.2","description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","directories":{},"_nodeVersion":"20.20.0","dependencies":{"codemirror":"^6.0.1","@codemirror/view":"^6.35.3","@codemirror/state":"^6.4.1","@codemirror/search":"^6.5.8","@codemirror/commands":"^6.7.1","@codemirror/language":"^6.10.8","@codemirror/language-data":"^6.5.2"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.9.3","@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1"},"peerDependencies":{"@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0"},"peerDependenciesMeta":{"@codemirror/view":{"optional":false},"@codemirror/state":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/velt-core_0.1.1_1771035627312_0.7759091726891325","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@altagen/velt-core","version":"0.1.2","keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"author":{"name":"Altagen"},"license":"MIT","_id":"@altagen/velt-core@0.1.2","maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"homepage":"https://github.com/Altagen/Velt-Core#readme","bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"dist":{"shasum":"adda66492338fe04ed4148ff99a8472739c43296","tarball":"https://registry.npmjs.org/@altagen/velt-core/-/velt-core-0.1.2.tgz","fileCount":27,"integrity":"sha512-gria6G3JVNYc6Ew+v02vW2VLDErBOeHwHK0xuEN4XC8evzR7960ASr/UNgem4bsOrkB7w8SrrHrR3LzOtpKajg==","signatures":[{"sig":"MEYCIQCYX4UmkFYqOUvhgMR+Ty+3ZyTPtQxCGfKklQfRLid+AgIhAOFyjR7SQ15Q5P7uDU/CyML8nosk/ZNCctcT8D1gQTUj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@altagen%2fvelt-core@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":145908},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"0fc591c8c94d764d3b0a4cddd9e94806e1de3113","scripts":{"build":"tsc","prepare":"husky || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"altagen","email":"ange.cesari@proton.me"},"repository":{"url":"git+https://github.com/Altagen/Velt-Core.git","type":"git"},"_npmVersion":"10.8.2","description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","directories":{},"_nodeVersion":"20.20.0","dependencies":{"codemirror":"^6.0.1","@codemirror/view":"^6.35.3","@codemirror/state":"^6.4.1","@codemirror/search":"^6.5.8","@codemirror/commands":"^6.7.1","@codemirror/language":"^6.10.8","@codemirror/language-data":"^6.5.2"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.9.3","@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1"},"peerDependencies":{"@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0"},"peerDependenciesMeta":{"@codemirror/view":{"optional":false},"@codemirror/state":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/velt-core_0.1.2_1771037476532_0.5715414726720975","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@altagen/velt-core","version":"0.1.3","keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"author":{"name":"Altagen"},"license":"MIT","_id":"@altagen/velt-core@0.1.3","maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"homepage":"https://github.com/Altagen/Velt-Core#readme","bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"dist":{"shasum":"9f447f9d3d2b20307214703169e8654583a6452a","tarball":"https://registry.npmjs.org/@altagen/velt-core/-/velt-core-0.1.3.tgz","fileCount":27,"integrity":"sha512-5QoWADqVlEdeOUGMijAvEN0Ao/MrqkEWWlqYf5cdQBRZn0YOxA3LDhKZcnidpLEZw3HwdcLglcxyzfaecKl/5w==","signatures":[{"sig":"MEQCIFIon6ihgUM4Rb0tEtlnKpZUK6yA64kaijzUqPrTJ9PeAiBzIj4+i0k78qqv+6ETHPNHHcjSQIh8NlCrqaxZNNA/FQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@altagen%2fvelt-core@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":153543},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5eb2071ceef2852c1e4366b9a96dd14331575c2c","scripts":{"build":"tsc","prepare":"husky || true","prepublishOnly":"npm run build"},"_npmUser":{"name":"altagen","email":"ange.cesari@proton.me"},"repository":{"url":"git+https://github.com/Altagen/Velt-Core.git","type":"git"},"_npmVersion":"10.8.2","description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","directories":{},"_nodeVersion":"20.20.0","dependencies":{"codemirror":"^6.0.1","@codemirror/view":"^6.35.3","@codemirror/state":"^6.4.1","@codemirror/search":"^6.5.8","@codemirror/commands":"^6.7.1","@codemirror/language":"^6.10.8","@codemirror/language-data":"^6.5.2"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","typescript":"^5.9.3","@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1"},"peerDependencies":{"@codemirror/view":"^6.0.0","@codemirror/state":"^6.0.0"},"peerDependenciesMeta":{"@codemirror/view":{"optional":false},"@codemirror/state":{"optional":false}},"_npmOperationalInternal":{"tmp":"tmp/velt-core_0.1.3_1771117426192_0.36036183797914","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@altagen/velt-core","version":"0.1.4","description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsc","prepare":"husky || true","prepublishOnly":"npm run build"},"keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"author":{"name":"Altagen"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Altagen/Velt-Core.git"},"bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"homepage":"https://github.com/Altagen/Velt-Core#readme","dependencies":{"@codemirror/commands":"^6.7.1","@codemirror/language":"^6.10.8","@codemirror/language-data":"^6.5.2","@codemirror/search":"^6.5.8","@codemirror/state":"^6.4.1","@codemirror/view":"^6.35.3","codemirror":"^6.0.1"},"devDependencies":{"@commitlint/cli":"^20.4.1","@commitlint/config-conventional":"^20.4.1","husky":"^9.1.7","typescript":"^5.9.3"},"peerDependencies":{"@codemirror/state":"^6.0.0","@codemirror/view":"^6.0.0"},"peerDependenciesMeta":{"@codemirror/state":{"optional":false},"@codemirror/view":{"optional":false}},"engines":{"node":">=18.0.0"},"_id":"@altagen/velt-core@0.1.4","gitHead":"5902edacbb74b16ca92af384775159127f189c70","_nodeVersion":"20.20.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-JDO1un4RNRwMM3MCqiobvA2ImVReITVOI0P4lZWIfCsn1FWwDWQsAhUJJomzE4078amg6yqxXCZnQWt3t1nQ8Q==","shasum":"6dd9aeeeebb67b0ce16238eed7d48fde1f4f79c3","tarball":"https://registry.npmjs.org/@altagen/velt-core/-/velt-core-0.1.4.tgz","fileCount":27,"unpackedSize":166171,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@altagen%2fvelt-core@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDVzXVXTZdAlrpnGjKlVrdsP5WYMaEvcfUIm0H/x9mJ6AIgM55rDudmGZvGGv8qZdiT8G0jdUHjjf5PVl9srqiRw+I="}]},"_npmUser":{"name":"altagen","email":"ange.cesari@proton.me"},"directories":{},"maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/velt-core_0.1.4_1771666901172_0.9316572665077907"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-05T19:40:37.166Z","modified":"2026-02-21T09:41:41.660Z","0.1.0":"2026-02-05T19:40:37.400Z","0.1.1":"2026-02-14T02:20:27.460Z","0.1.2":"2026-02-14T02:51:16.688Z","0.1.3":"2026-02-15T01:03:46.348Z","0.1.4":"2026-02-21T09:41:41.344Z"},"bugs":{"url":"https://github.com/Altagen/Velt-Core/issues"},"author":{"name":"Altagen"},"license":"MIT","homepage":"https://github.com/Altagen/Velt-Core#readme","keywords":["editor","code-editor","codemirror","codemirror6","text-editor","syntax-highlighting","typescript","react","svelte","vue"],"repository":{"type":"git","url":"git+https://github.com/Altagen/Velt-Core.git"},"description":"Core editor components for Velt - A modern, minimal code editor built on CodeMirror 6","maintainers":[{"name":"altagen","email":"ange.cesari@proton.me"}],"readme":"# Velt Core\n\nCore editor components for building modern code editors. Built on [CodeMirror 6](https://codemirror.net/), Velt Core provides a high-level API for creating feature-rich text editors.\n\n## Features\n\n- **VeltEditor** - A fully-featured code editor with syntax highlighting, search/replace, bookmarks, and more\n- **TabManager** - Tab management system for multi-file editing\n- **Theme Support** - Customizable themes with editor, gutter, UI, and icon color configuration\n- **Language Support** - Built-in syntax highlighting for JavaScript, TypeScript, Python, Rust, HTML, CSS, JSON, and more\n- **Framework Agnostic** - Works with React, Svelte, Vue, or vanilla JavaScript\n\n## Installation\n\n```bash\nnpm install @altagen/velt-core\n```\n\n## Quick Start\n\n```typescript\nimport { VeltEditor } from '@altagen/velt-core';\n\nconst editor = new VeltEditor({\n  container: document.getElementById('editor'),\n  content: 'console.log(\"Hello, World!\");',\n  language: 'javascript',\n  onChange: (content) => {\n    console.log('Content changed:', content);\n  }\n});\n```\n\n## API Reference\n\n### VeltEditor\n\nThe main editor class.\n\n```typescript\ninterface VeltEditorOptions {\n  container: HTMLElement;     // DOM element to mount the editor\n  content?: string;           // Initial content\n  language?: string;          // Language for syntax highlighting\n  onChange?: (content: string) => void;\n  readOnly?: boolean;\n  theme?: Theme;\n  fontSize?: number;\n  fontFamily?: string;\n  tabSize?: number;\n  wordWrap?: boolean;\n  showInvisibles?: boolean;\n}\n```\n\n#### Methods\n\n| Method | Description |\n|--------|-------------|\n| `getContent()` | Get current editor content |\n| `setContent(content)` | Set editor content |\n| `setLanguage(language)` | Change syntax highlighting language |\n| `applyTheme(theme)` | Apply a theme |\n| `focus()` | Focus the editor |\n| `destroy()` | Destroy the editor instance |\n| `find(text, options)` | Search for text |\n| `findNext()` | Find next occurrence |\n| `findPrevious()` | Find previous occurrence |\n| `replace(text)` | Replace current match |\n| `replaceAll(text)` | Replace all matches |\n| `goToLine(line)` | Jump to a specific line |\n| `toggleBookmark()` | Toggle bookmark on current line |\n| `nextBookmark()` | Jump to next bookmark |\n| `previousBookmark()` | Jump to previous bookmark |\n\n### TabManager\n\nManages multiple editor tabs.\n\n```typescript\nimport { TabManager } from '@altagen/velt-core';\n\nconst tabManager = new TabManager();\n\n// Add a new tab\nconst tabId = tabManager.addTab({\n  filePath: '/path/to/file.ts',\n  content: 'const x = 1;',\n  originalContent: 'const x = 1;',\n  isDirty: false,\n  encoding: 'utf-8',\n  language: 'typescript'\n});\n\n// Subscribe to changes\ntabManager.subscribe((tabs, activeId) => {\n  console.log('Tabs updated:', tabs);\n});\n```\n\n### Theme Interface\n\n```typescript\ninterface Theme {\n  name: string;\n  editor: {\n    background: string;\n    foreground: string;\n    lineHighlight: string;\n    selection: string;\n    cursor: string;\n    searchMatch?: string;\n    searchMatchSelected?: string;\n  };\n  gutter: {\n    background: string;\n    foreground: string;\n    border: string;\n  };\n  ui: {\n    menuBar: string;\n    tabBar: string;\n    tabActive: string;\n    tabInactive: string;\n    // ... more UI colors\n  };\n  icons?: {\n    file?: string;\n    folder?: string;\n    save?: string;\n    // ... more icon colors\n  };\n}\n```\n\n### Language Detection\n\n```typescript\nimport { detectLanguageFromPath, getSupportedLanguages } from '@altagen/velt-core';\n\nconst language = detectLanguageFromPath('/path/to/file.tsx');\n// Returns: 'typescript'\n\nconst languages = getSupportedLanguages();\n// Returns: ['javascript', 'typescript', 'html', 'css', 'json', ...]\n```\n\n### Utilities\n\n```typescript\nimport { debounce, throttle, generateId, formatFileSize, getFileName } from '@altagen/velt-core';\n\n// Debounce function calls\nconst debouncedSave = debounce(save, 300);\n\n// Generate unique IDs\nconst id = generateId();\n\n// Format file sizes\nformatFileSize(1024); // \"1 KB\"\n\n// Get filename from path\ngetFileName('/path/to/file.txt'); // \"file.txt\"\n```\n\n## Supported Languages\n\n- JavaScript / TypeScript (JSX/TSX)\n- HTML\n- CSS / SCSS / SASS / LESS\n- JSON\n- Markdown\n- Python\n- Rust\n- C / C++\n- Java\n- PHP\n- XML / SVG\n- SQL\n\n## Framework Examples\n\n### React\n\n```tsx\nimport { useEffect, useRef } from 'react';\nimport { VeltEditor, type Theme } from '@altagen/velt-core';\n\nfunction Editor({ content, onChange, theme }: Props) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const editorRef = useRef<VeltEditor | null>(null);\n\n  useEffect(() => {\n    if (containerRef.current && !editorRef.current) {\n      editorRef.current = new VeltEditor({\n        container: containerRef.current,\n        content,\n        onChange,\n        theme\n      });\n    }\n\n    return () => {\n      editorRef.current?.destroy();\n    };\n  }, []);\n\n  return <div ref={containerRef} style={{ height: '100%' }} />;\n}\n```\n\n### Svelte\n\n```svelte\n<script lang=\"ts\">\n  import { onMount, onDestroy } from 'svelte';\n  import { VeltEditor, type Theme } from '@altagen/velt-core';\n\n  export let content: string;\n  export let onChange: (content: string) => void;\n  export let theme: Theme;\n\n  let container: HTMLDivElement;\n  let editor: VeltEditor;\n\n  onMount(() => {\n    editor = new VeltEditor({\n      container,\n      content,\n      onChange,\n      theme\n    });\n  });\n\n  onDestroy(() => {\n    editor?.destroy();\n  });\n</script>\n\n<div bind:this={container} style=\"height: 100%;\"></div>\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) for details.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/Altagen/Velt-Core).\n","readmeFilename":"README.md"}