@bootstrap-wc/plugin-summernote
v2.0.0
Published
Summernote (BS5 build) WYSIWYG wrapper.
Downloads
444
Maintainers
Readme
@bootstrap-wc/plugin-summernote
Summernote (BS5 build) WYSIWYG wrapper.
<bs-rich-text> is a Lit-based web-component wrapper for [summernote].
Why a wrapper?
The upstream library was written before web components and assumes CSS rules in the host document can target its generated markup. This wrapper renders in light DOM (no shadow root) so its stylesheet selectors continue to apply.
Install
npm install @bootstrap-wc/plugin-summernote summernoteUsage
<script type="module" src="https://cdn.jsdelivr.net/npm/@bootstrap-wc/plugin-summernote/dist/define.js"></script>
<bs-rich-text options='{"key": "value"}'>
<!-- slotted markup the plugin operates on -->
</bs-rich-text>Or in JS:
import '@bootstrap-wc/plugin-summernote/define';
const el = document.querySelector('bs-rich-text');
el.addEventListener('bs:ready', (e) => console.log('plugin ready', e.detail));Compatibility caveats
- Lives in light DOM so plugin CSS reaches the children.
- If you place
<bs-rich-text>inside another wc component (e.g.<bs-modal>), the plugin still operates only on the slotted light-DOM children — that works fine for wc components that use named slots. - Do not combine with
document-wide jQuery selectors that assume the plugin DOM is at the page root.
See /packages/PLUGINS.md for the full plugin compatibility matrix.
Status
Preview (0.1.0). Subclass-overridable lifecycle; per-plugin specialisation typically needs ~30 lines of code. Contributions welcome.
