@kungal/editor-nuxt
v0.38.2
Published
KunEditor Nuxt Layer — wraps @kungal/editor-vue and auto-imports <KunEditor> so an existing Nuxt app keeps its exact DX (no import needed).
Maintainers
Readme
@kungal/editor-nuxt
The Nuxt Layer for KunEditor. It wraps @kungal/editor-vue
and auto-imports <KunEditor>, so an existing Nuxt app uses the editor with no
import line — the same DX the forum has today with its in-repo Milkdown
component.
Usage
// nuxt.config.ts
export default defineNuxtConfig({
extends: ['@kungal/ui-nuxt', '@kungal/editor-nuxt']
})Then, anywhere in a template:
<KunEditor v-model="markdown" :adapters="adapters" />Requirements
- Extend
@kungal/ui-nuxttoo —<KunEditor>renders KunUI chrome (KunButton,KunIcon,KunPopover, …). - Install the Milkdown peers in the app (single ProseMirror instance):
@milkdown/kit @milkdown/prose @milkdown/vue. - Add
@kungal/editor-vue/style.cssto your app's stylesheet next to the@kungal/ui-tokens+@kungal/ui-vuesetup. This layer intentionally owns no Tailwind entry — the@sourcescan path is node_modules-layout-specific, so only the app can write it correctly. - Rendering the editor inside a
KunModal/KunDrawerneeds@kungal/ui-vue>= 2.26.0. The toolbar's link and sticker panels areKunPopovers, which teleport to<body>; before 2.26.0 an overlay's focus trap did not know about them and pulled focus straight back to the trigger, so those panels could not be typed into. 2.26.0 registers a popover with the overlay that opened it. Nothing to configure on the editor side.
Status
Scaffold — see ../../docs/architecture.md.
