@lexion-rte/astro
v0.1.4
Published
Astro client-mount adapter for the Lexion editor.
Maintainers
Readme

This package is part of the Lexion framework-agnostic rich text editor.
Lexion is a framework-agnostic, headless rich text editor platform built on ProseMirror, designed to provide a shared core, reusable extensions, and framework-specific adapters.
@lexion-rte/astro
Astro client-side mounting adapter for Lexion.
Overview
@lexion-rte/astro provides:
LexionAstroAdapterclassmountLexionAstroEditor({ element, ...options })helper
Use it in client scripts where DOM APIs are available.
Install
pnpm add @lexion-rte/astro astroQuick Usage
---
const editorId = "lexion-editor";
---
<div id={editorId}></div>
<script>
import { mountLexionAstroEditor } from "@lexion-rte/astro";
const element = document.getElementById("lexion-editor");
if (element) {
const adapter = mountLexionAstroEditor({ element });
window.addEventListener("beforeunload", () => adapter.destroy(), { once: true });
}
</script>Adapter Methods
mount(element)update({ value?, readOnly?, onChange? })execute(command, ...args)destroy()editorgetter
Notes
- Mount only on the client.
- Re-mounting recreates the underlying web editor instance.
