@scoped-elements/codemirror
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@scoped-elements/codemirror

This is a wrapper of codemirror packaged using the scoped custom elements registries pattern using @open-wc/scoped-elements.

Installation

npm i @scoped-elements/codemirror

Usage

As an sub element in your own custom element

import { CodemirrorMarkdown } from '@scoped-elements/codemirror';
import { ScopedElementsMixin } from '@open-wc/scoped-elements';

export class CustomElement extends ScopedElementsMixin(LitElement) {
  static get scopedElements() {
    return {
      'codemirror-markdown': CodemirrorMarkdown,
    };
  }

  render() {
    return html`
      <codemirror-markdown
        text="example text"
        @text-inserted=${e => {
          console.log(e);
        }}
      ></codemirror-markdown>
    `;
  }
}

As a globally defined custom element

import { CodemirrorMarkdown } from '@scoped-elements/codemirror';

customElements.define('codemirror-markdown', CodemirrorMarkdown);

Documentation for the elements

As this package is just a re-export, you can find the documentation for codemirror here.

Appreciation

This library is just a re-export, all the credit goes to codemirror and its authors. Thanks!

Readme

Keywords

none

Package Sidebar

Install

npm i @scoped-elements/codemirror

Weekly Downloads

2

Version

0.1.1

License

MIT

Unpacked Size

42.5 kB

Total Files

19

Last publish

Collaborators

  • guillem.cordoba