nam-rich-text-editor 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/EditorCreator.d.ts +1 -0
- package/dist/ImageUtils.d.ts +2 -0
- package/dist/RichTextEditor.d.ts +8 -0
- package/dist/ToolbarCreator.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/rich-text-editor.es.js +2753 -0
- package/dist/rich-text-editor.umd.js +41 -0
- package/dist/toolbars/AlignButtons.d.ts +1 -0
- package/dist/toolbars/ColorPickers.d.ts +1 -0
- package/dist/toolbars/FontSelector.d.ts +1 -0
- package/dist/toolbars/FormatButtons.d.ts +1 -0
- package/dist/toolbars/FullscreenButton.d.ts +1 -0
- package/dist/toolbars/HeadingSelector.d.ts +1 -0
- package/dist/toolbars/ImageButton.d.ts +1 -0
- package/dist/toolbars/IndentButtons.d.ts +1 -0
- package/dist/toolbars/ListButtons.d.ts +1 -0
- package/dist/toolbars/SizeSelector.d.ts +1 -0
- package/dist/toolbars/UndoRedo.d.ts +1 -0
- package/dist/utils/SelectionUtils.d.ts +5 -0
- package/dist/vite.svg +1 -0
- package/package.json +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Rich Text Editor
|
|
2
|
+
|
|
3
|
+
A custom rich text editor similar to Word, built with JavaScript and TypeScript. The content is stored as HTML.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install rich-text-editor
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
import { RichTextEditor } from "rich-text-editor";
|
|
15
|
+
|
|
16
|
+
const editor = new RichTextEditor("editor-container");
|
|
17
|
+
|
|
18
|
+
// Get HTML content
|
|
19
|
+
const html = editor.getHTML();
|
|
20
|
+
|
|
21
|
+
// Set HTML content
|
|
22
|
+
editor.setHTML("<p>Hello <strong>world</strong>!</p>");
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Add a div with id 'editor-container' in your HTML:
|
|
26
|
+
|
|
27
|
+
```html
|
|
28
|
+
<div id="editor-container"></div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Features
|
|
32
|
+
|
|
33
|
+
- Bold, Italic, Underline formatting
|
|
34
|
+
- Bullet and numbered lists
|
|
35
|
+
- HTML content editing
|
|
36
|
+
|
|
37
|
+
## Development
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm run dev # Start development server
|
|
41
|
+
npm run build # Build for production
|
|
42
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createEditor(_onImageInsert: () => void, onImageToggle: (el: HTMLElement) => void): HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createToolbar(): HTMLElement;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RichTextEditor } from "./RichTextEditor";
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./style.css";
|