# d1edit

> Lightweight WYSIWYG editor

Latest version **1.2.17** (published 2020-01-30) · MIT license · 0 weekly downloads

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

## Install

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

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.17 |
| Published | 2020-01-30 |
| First published | 2018-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vadim Korolev |
| Maintainers | vadimkor |
| Keywords | textarea, editor, wysiwyg |

## Links

- npm: https://www.npmjs.com/package/d1edit
- Repository: https://github.com/vvvkor/d1edit
- Homepage: https://github.com/vvvkor/d1edit#readme
- Issues: https://github.com/vvvkor/d1edit/issues
- npm.io page: https://npm.io/package/d1edit

## Dependencies (1)

- [d1css](https://npm.io/package/d1css.md) ^1.2

## 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

- 1.2.17 (latest) — 2020-01-30
- 1.2.16 — 2019-11-12
- 1.2.15 — 2019-11-12
- 1.2.14 — 2019-09-26
- 1.2.12 — 2019-09-26
- 1.2.11 — 2019-09-25
- 1.2.10 — 2019-07-12
- 1.2.9 — 2019-05-31
- 1.2.8 — 2019-05-29
- 1.2.7 — 2019-05-27
- 1.2.6 — 2019-03-01
- 1.2.5 — 2019-02-11
- 1.2.4 — 2019-02-08
- 1.2.3 — 2018-12-25
- 1.2.2 — 2018-12-13
- … 1 more at https://npm.io/package/d1edit/versions

## README

# **DEPRECATED** - d1edit

This is no longer maintained.  
Please consider using [d1-web](https://github.com/vvvkor/d1-web) instead.

---

Add-on for [d1](https://github.com/vvvkor/d1).  
Lightweight WYSIWYG text editor.  
[Demo & docs](https://vvvkor.github.io/d1#edit)

## Install

```
npm install d1edit
```

## Usage

On page load call:
```
d1edit.init(options);
```

In your ``textarea`` markup:
* Add ``edit`` class to enable WYSIWYG editor.
* Add ``adjust`` class to automatically adjust textarea height to content.
* Add ``data-wys`` attribute to set initial editor mode. Set empty string as value for source code editing, any other value for WYSIWYG. If attribute is absent, initial mode is determined automatically (WYSIWYG if text contains HTML tags).
* Add ``data-tools`` attribute to customize WYSIWYG editor toolset.

## Example

```
<textarea class="edit" cols="50" rows="20">
  Write <b>formatted</b> text.
</textarea>
```

## Options

### qsAdjust

Query selector of textarea elements to auto-adjust height.  
Default: ``"textarea.adjust"``

### qsEdit

Query selector of textarea elements to enable WYSIWYG.  Default: ``"textarea.edit"``

### height

Default height of WYSIWYG editor in ``em``s.  
Default: ``50``

### tools

WYSIWYG editor toolset. 
Each character stands for tool:

* ``/`` - **toggle editing mode** (WYSIWYG/source)
* ``*`` - insert image
* ``@`` - insert link
* ``x`` - remove link
* ``b`` - bold
* ``i`` - italic
* ``_`` - remove format
* ``.`` - unordered list
* ``#`` - ordered list
* ``1`` - heading 1
* ``2`` - heading 2
* ``3`` - heading 3
* ``p`` - paragraph
* ``|`` - **toggle more tools**
* ``c`` - code
* ``,`` - abbreviation
* ``s`` - strike through
* ``^`` - subscript
* ``v`` - superscript
* ``d`` - div
* ``q`` - block quote
* ``f`` - preformatted
* ``~`` - horizontal ruler
* ``T`` - table
* ``(`` - justify left
* ``=`` - justify center
* ``)`` - justify right
* ``j`` - justify full
* ``+`` - increase indent
* ``-`` - decrease indent
 
Default: ``"/*@xbi_.#123p|c,s^vdqf~T(=)j+-"``

## Browser Support

* IE 10+
* Latest Stable: Chrome, Firefox, Opera, Safari

## License

[MIT](./LICENSE)

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