# @binarycapsule/editor

> Prosemirror powered rich text editor.

Latest version **4.0.0** (published 2024-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @binarycapsule/editor
pnpm add @binarycapsule/editor
yarn add @binarycapsule/editor
bun add @binarycapsule/editor
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2024-02-02 |
| First published | 2019-09-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 12 |
| Unpacked size | 202.5 KB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Maintainers | jcmnunes |

## Links

- npm: https://www.npmjs.com/package/@binarycapsule/editor
- Repository: https://github.com/jcmnunes/editor
- Homepage: https://github.com/jcmnunes/editor#readme
- Issues: https://github.com/jcmnunes/editor/issues
- npm.io page: https://npm.io/package/@binarycapsule/editor

## Dependencies (12)

- [markdown-it](https://npm.io/package/markdown-it.md) ^12.3.2
- [prosemirror-view](https://npm.io/package/prosemirror-view.md) ^1.23.6
- [prosemirror-model](https://npm.io/package/prosemirror-model.md) ^1.16.1
- [prosemirror-state](https://npm.io/package/prosemirror-state.md) ^1.3.4
- [prosemirror-keymap](https://npm.io/package/prosemirror-keymap.md) ^1.1.5
- [prosemirror-history](https://npm.io/package/prosemirror-history.md) ^1.2.0
- [prosemirror-commands](https://npm.io/package/prosemirror-commands.md) ^1.2.1
- [prosemirror-markdown](https://npm.io/package/prosemirror-markdown.md) ^1.7.0
- [prosemirror-gapcursor](https://npm.io/package/prosemirror-gapcursor.md) ^1.2.1
- [prosemirror-dropcursor](https://npm.io/package/prosemirror-dropcursor.md) ^1.4.0
- [prosemirror-inputrules](https://npm.io/package/prosemirror-inputrules.md) ^1.1.3
- [prosemirror-schema-list](https://npm.io/package/prosemirror-schema-list.md) ^1.1.6

## Recent versions

- 4.0.0 (latest) — 2024-02-02
- 3.2.0 — 2024-02-02
- 3.0.4 — 2022-02-07
- 3.0.3 — 2022-02-06
- 3.0.2 — 2022-02-06
- 3.0.1 — 2022-02-05
- 3.0.0 — 2021-12-10
- 2.0.4 — 2021-02-21
- 2.0.3 — 2021-02-21
- 2.0.2 — 2021-02-21
- 2.0.1 — 2021-02-15
- 2.0.0 — 2021-02-14
- 1.1.3 — 2021-02-07
- 1.1.1 — 2019-10-27
- 1.1.0 — 2019-10-23
- … 4 more at https://npm.io/package/@binarycapsule/editor/versions

## README

<img src="https://raw.githubusercontent.com/jcmnunes/editor/master/public/logo512.png" alt="BC logo" width="100px" height="100px">

# BC Editor

### 🚨 **Breakable toy - Do not use in real projects** 🚨
**This library is a breakable toy. New versions will often contain breaking changes, even for non-major releases.**

---

BC Editor is a [Prosemirror](https://prosemirror.net/) based text editor with
markdown shortcuts and serialization. It is highly inspired by:

- [Rich Markdown Editor](https://github.com/outline/rich-markdown-editor) (the
  editor that powers [Outline](https://www.getoutline.com/))
- The editor inside the [Linear app](https://linear.app/)

Visit the demo at
[editor.binarycapsule.tech](https://editor.binarycapsule.tech).

## Getting started

The Editor is available as an npm package:

```bash
npm i @binarycapsule/editor
```

Peer dependencies:

```
npm i react react-dom @binarycapsule/ui-capsules
```

Note: this package is meant to be used inside a app already setup with the [ui-capsules](https://github.com/jcmnunes/ui-capsules) package.

## Usage

As a minimal implementation, pass a ref to the Editor. The editor's value can be
accessed through it:

```tsx
export const App = () => {
  const editorRef = React.useRef<EditorRef>(null);

  return (
    <div>
      <button
        onClick={() => {
          // Read the value from the ref
          console.log(editorRef.current?.value);
        }}
      >
        Save
      </button>

      <Editor ref={editorRef} />
    </div>
  );
};
```

## Licensing

Licensed under the [MIT License](./LICENSE).

---
_Source: https://npm.io/package/@binarycapsule/editor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
