# lexitor

> A rich text editor based on lexical playground

Latest version **0.1.2** (published 2024-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install lexitor
pnpm add lexitor
yarn add lexitor
bun add lexitor
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2024-04-08 |
| First published | 2024-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 31 |
| Unpacked size | 7 MB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | newproplus |

## Links

- npm: https://www.npmjs.com/package/lexitor
- Repository: https://github.com/lexitor/lexitor
- Issues: https://github.com/lexitor/lexitor/issues
- npm.io page: https://npm.io/package/lexitor

## Dependencies (31)

- [yjs](https://npm.io/package/yjs.md) >=13.5.42
- [sass](https://npm.io/package/sass.md) ^1.74.1
- [katex](https://npm.io/package/katex.md) ^0.15.2
- [react](https://npm.io/package/react.md) ^18.2.0
- [lexical](https://npm.io/package/lexical.md) 0.14.3
- [prettier](https://npm.io/package/prettier.md) ^3.2.5
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [y-websocket](https://npm.io/package/y-websocket.md) ^1.5.4
- [@lexical/yjs](https://npm.io/package/@lexical/yjs.md) 0.14.3
- [@lexical/code](https://npm.io/package/@lexical/code.md) 0.14.3
- [@lexical/file](https://npm.io/package/@lexical/file.md) 0.14.3
- [@lexical/link](https://npm.io/package/@lexical/link.md) 0.14.3
- [@lexical/list](https://npm.io/package/@lexical/list.md) 0.14.3
- [@lexical/mark](https://npm.io/package/@lexical/mark.md) 0.14.3
- [@lexical/text](https://npm.io/package/@lexical/text.md) 0.14.3
- [@lexical/react](https://npm.io/package/@lexical/react.md) 0.14.3
- [@lexical/table](https://npm.io/package/@lexical/table.md) 0.14.3
- [@lexical/utils](https://npm.io/package/@lexical/utils.md) 0.14.3
- [@lexical/dragon](https://npm.io/package/@lexical/dragon.md) ^0.14.3
- [@lexical/hashtag](https://npm.io/package/@lexical/hashtag.md) 0.14.3
- [@lexical/history](https://npm.io/package/@lexical/history.md) ^0.14.3
- [@lexical/headless](https://npm.io/package/@lexical/headless.md) ^0.14.3
- [@lexical/markdown](https://npm.io/package/@lexical/markdown.md) 0.14.3
- [@lexical/overflow](https://npm.io/package/@lexical/overflow.md) 0.14.3
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) 0.14.3
- [@lexical/rich-text](https://npm.io/package/@lexical/rich-text.md) 0.14.3
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) 0.14.3
- [@lexical/plain-text](https://npm.io/package/@lexical/plain-text.md) 0.14.3
- [react-error-boundary](https://npm.io/package/react-error-boundary.md) ^3.1.4
- [@excalidraw/excalidraw](https://npm.io/package/@excalidraw/excalidraw.md) ^0.17.0

## Recent versions

- 0.1.2 (latest) — 2024-04-08
- 0.1.1 — 2024-04-07
- 0.1.0 — 2024-04-07

## README

# Lexitor

A rich text editor based on [lexical playground](https://github.com/facebook/lexical/tree/main/packages/lexical-playground).

Lexical version: **v0.14.3**

## Using

### Import and DOM

```js
import { PlaygroundApp } from 'lexitor'
import 'lexitor/style.css'
```

```jsx
<PlaygroundApp />
```

### Medhod:

- onChange(content: string): A callback when content changes.
- setContentType(contentType: ContentType): Set the content type fo the editor, 'json' or 'markdown', defaults "json".
- setJson(content: string): Set a JSON data to editor, valid when ContentType equals "json".
- setMarkdown(content: string): Set a Markdown data to editor, valid when ContentType equals "markdown".

## Differents with lexical playground

### Moved

**Settings button** is displayed in toolbar. Merge **src/Settings.tsx** and **src/plugins/ActionsPlugin/index.tsx** to **src/plugins/ToolbarPlugin/Settings.tsx**.

### Commented out

- CommentPlugin, including **src/plugins/FloatingTextFormatToolbarPlugin/index.tsx** / **src/Editor.tsx**.
- DocsPlugin

### Styles

Keep all the content of **index.css**, add customed styles to **styles/**.

Add **dark mode** in **PlaygroundEditorThemeDark.scss**. Using `<html lang="en" class="dark">` to enable **dark mode**.

Using **.lexitor** and prefix **lexitor___** to limit style scope.

### Other:

Update **prettier**, using version 3.x.

Change `import katex from 'katex';` to `import * as katex from 'katex';`.

Commented out some images, shuch as "images/cat-typing.gif" / "images/landscape.jpg" / "images/yellow-flower.jpg"

Copy some files in "packages/shared/src/" of **lexical** to "src/shared/".

In **vite.config.ts**, using some new alias instead of  using **moduleResolution**.

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