# @tanbo/tbus

> A rich text editor

Latest version **0.0.2-beta.85** (published 2020-08-03) · GPL license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @tanbo/tbus
pnpm add @tanbo/tbus
yarn add @tanbo/tbus
bun add @tanbo/tbus
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.2-beta.85 |
| Published | 2020-08-03 |
| First published | 2019-12-19 |
| Weekly downloads | 0 |
| License | GPL |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1385 |
| Author | Tan Bo |
| Maintainers | tanbo |
| Keywords | editor, text, rich, component editor, web editor, office, word, excel, note |

## Links

- npm: https://www.npmjs.com/package/@tanbo/tbus
- Repository: https://github.com/tbhuabi/editor
- Homepage: https://github.com/tbhuabi/editor#readme
- Issues: https://github.com/tbhuabi/editor.git/issues
- npm.io page: https://npm.io/package/@tanbo/tbus

## Dependencies (9)

- [rxjs](https://npm.io/package/rxjs.md) ^6.0.0
- [pretty](https://npm.io/package/pretty.md) ^2.0.0
- [@tanbo/color](https://npm.io/package/@tanbo/color.md) ^0.0.3
- [highlight.js](https://npm.io/package/highlight.js.md) ^9.17.1
- [@tanbo/bezier](https://npm.io/package/@tanbo/bezier.md) 0.0.1
- [@types/pretty](https://npm.io/package/@types/pretty.md) ^2.0.0
- [@tanbo/css-themes](https://npm.io/package/@tanbo/css-themes.md) ^0.0.1
- [@tanbo/color-picker](https://npm.io/package/@tanbo/color-picker.md) ^0.0.15
- [@types/highlight.js](https://npm.io/package/@types/highlight.js.md) ^9.12.3

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 0.0.2-beta.85 (latest) — 2020-08-03
- 0.0.2-beta.84 — 2020-08-03
- 0.0.2-beta.83 — 2020-08-03
- 0.0.2-beta.82 — 2020-08-03
- 0.0.2-beta.81 — 2020-08-02
- 0.0.2-beta.80 — 2020-08-02
- 0.0.2-beta.79 — 2020-08-01
- 0.0.2-beta.78 — 2020-08-01
- 0.0.2-beta.77 — 2020-08-01
- 0.0.2-beta.76 — 2020-07-31
- 0.0.2-beta.75 — 2020-07-31
- 0.0.2-beta.74 — 2020-07-31
- 0.0.2-beta.73 — 2020-07-31
- 0.0.2-beta.72 — 2020-07-30
- 0.0.2-beta.71 — 2020-07-30
- … 171 more at https://npm.io/package/@tanbo/tbus/versions

## README

## 安装

通过 npm 安装 TBus：
```bash
npm install @tanbo/tbus
```

在 html 中准备一个空的元素
```html
<body>
  <div id="editor"></div>
</body>

```

通过 css 选择器，或直接传入一个 DOM 元素初始化 TBus。
```typescript
import { createEditor } from '@tanbo/tbus';
import { Observable } from 'rxjs';

const editor = createEditor('#editor', {
  uploader(type: string): string | Promise<string> | Observable<string> {
    // switch (type) {
    //   case 'video':
    //     console.log('上传视频');
    //     break;
    //   case 'image':
    //     console.log('上传视频');
    //     break;
    //   case 'audio':
    //     console.log('上传音频');
    //     break;
    // }
    return Promise.resolve().then(() => {
      return '/test'
    })
  },
  content: `<p>欢迎你使用&nbsp;<strong>TBus</strong> 富文本编辑器...<br></p>`
});

editor.onChange.subscribe(() => {
  console.log(editor.getContents());
});
```
## 官网地址
[TBus 官网](https://www.tanboui.com/tbus/home)

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