{"_id":"@amio/md-editor","name":"@amio/md-editor","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@amio/md-editor","version":"0.1.0","description":"A minimal Markdown editor web component with syntax highlighting.","repository":{"type":"git","url":"git+https://github.com/amio/eloc.git#main"},"main":"dist/index.js","module":"dist/index.js","license":"MIT","scripts":{"build":"esbuild src/index.ts --bundle --minify --format=esm --outfile=dist/index.js","prepack":"npm run build"},"devDependencies":{"esbuild":"^0.27.3","typescript":"^5.1.6"},"dependencies":{"marked":"^17.0.3"},"gitHead":"b212af8661cef743c9a0fe4a9bde331427c84bd6","_id":"@amio/md-editor@0.1.0","bugs":{"url":"https://github.com/amio/eloc/issues"},"homepage":"https://github.com/amio/eloc/tree/main#readme","_nodeVersion":"24.13.0","_npmVersion":"11.10.0","dist":{"integrity":"sha512-69cmQjkGpKpn67WR8DkhGBclnVcJKWRhhe4s9h/9ULLtEJ4dadxBUd4+RcWR2KwXehLZ0QkbhEUtZT/Pn4UwCQ==","shasum":"b884c5b8b6140b5cbf78c200701c9783f82e5702","tarball":"https://registry.npmjs.org/@amio/md-editor/-/md-editor-0.1.0.tgz","fileCount":4,"unpackedSize":51713,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDrOkyVC7l3OqzvCVF5f+ZLAtbv/+ZZ+xmZi1IA71YlywIhAJ2S7gkS124Wb5M0qaOtNrnXEAVpDW859n4Tn/7Uw3SP"}]},"_npmUser":{"name":"amio","email":"amio.cn@gmail.com"},"directories":{},"maintainers":[{"name":"amio","email":"amio.cn@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/md-editor_0.1.0_1771914830147_0.9348251629812887"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-24T06:33:50.014Z","0.1.0":"2026-02-24T06:33:50.277Z","modified":"2026-02-24T06:33:50.514Z"},"maintainers":[{"name":"amio","email":"amio.cn@gmail.com"}],"description":"A minimal Markdown editor web component with syntax highlighting.","homepage":"https://github.com/amio/eloc/tree/main#readme","repository":{"type":"git","url":"git+https://github.com/amio/eloc.git#main"},"bugs":{"url":"https://github.com/amio/eloc/issues"},"license":"MIT","readme":"# @amio/md-editor\n\nA minimal Markdown editor web component with syntax highlighting.\n\nImplemented using `contenteditable=\"plaintext-only\"` and the **CSS Custom Highlight API**.\n\n## Features\n\n- **Native Speed**: Zero DOM manipulation for rendering. Styling is handled by the browser's Highlight API.\n- **Plaintext Input**: Uses `contenteditable=\"plaintext-only\"` to ensure consistent behavior across browsers and prevent HTML injection.\n- **Theming**: Supports automatic (system-based) and manual light/dark themes.\n\n## Usage\n\n### 1. Installation\n\n```bash\nnpm install @amio/md-editor\n```\n\n### 2. Basic Example\n\nInclude the script and use the `<md-editor>` tag:\n\n```html\n<script type=\"module\" src=\"node_modules/@amio/md-editor/dist/index.js\"></script>\n\n<md-editor theme=\"auto\"># Hello Markdown</md-editor>\n```\n\n## API\n\n### Attributes\n\n| Attribute | Description | Values | Default |\n| :--- | :--- | :--- | :--- |\n| `theme` | Sets the visual theme of the editor. | `auto`, `light`, `dark` | `auto` |\n| `value` | Sets the initial Markdown content. | String | `\"\"` |\n\n> **Note**: Initial content can also be provided as child text nodes of the `<md-editor>` element.\n\n### CSS Custom Properties\n\nCustomize the editor's appearance using css:\n\n```stylesheet\nmd-editor.my-theme {\n  --md-header-color: red;\n  --md-list-color: blue;\n}\n```\n\nAvailable CSS variables:\n\n| Variable | Description |\n| :--- | :--- |\n| `--md-editor-bg` | Editor background color |\n| `--md-editor-fg` | Text color |\n| `--md-border-color` | Border color |\n| `--md-header-color` | Heading text color |\n| `--md-list-color` | List item marker/text color |\n| `--md-code-color` | Inline code text color |\n| `--md-code-bg` | Inline code background color |\n| `--md-code-block-color` | Fenced code block text color |\n| `--md-code-block-bg` | Fenced code block background color |\n| `--md-link-color` | Link text color |\n\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-8ff41f4f1c4fb4bfcd4c7e302937e109"}