@daneshnaik/rich-text-editor 1.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/LICENSE +21 -0
- package/README.md +160 -0
- package/dist/rich-text-editor.js +1543 -0
- package/dist/rich-text-editor.umd.cjs +17 -0
- package/dist/style.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Danesh Naik
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Rich Text Editor for React
|
|
2
|
+
|
|
3
|
+
A powerful and feature-rich WYSIWYG rich text editor component for React applications with extensive formatting options, table editing, and image handling capabilities.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
✨ **Rich Text Formatting**
|
|
8
|
+
- Bold, Italic, Underline, Strikethrough
|
|
9
|
+
- Font family and size selection
|
|
10
|
+
- Text and background colors
|
|
11
|
+
- Headings (H1-H6), Paragraphs, Blockquotes
|
|
12
|
+
- Bullet and numbered lists
|
|
13
|
+
- Text alignment (left, center, right)
|
|
14
|
+
- Indent and outdent
|
|
15
|
+
|
|
16
|
+
📊 **Advanced Table Editing**
|
|
17
|
+
- Insert tables with custom dimensions
|
|
18
|
+
- Add/delete rows and columns
|
|
19
|
+
- Merge cells (horizontal and vertical)
|
|
20
|
+
- Cell selection and styling
|
|
21
|
+
- Header row support
|
|
22
|
+
- Drag-to-move tables
|
|
23
|
+
- Context menu for table operations
|
|
24
|
+
|
|
25
|
+
🖼️ **Image Handling**
|
|
26
|
+
- Insert images from URL or upload
|
|
27
|
+
- Drag-to-resize images
|
|
28
|
+
- Alignment controls (left, center, right)
|
|
29
|
+
- Size presets (50%, 75%, 100%)
|
|
30
|
+
- Delete images with controls
|
|
31
|
+
|
|
32
|
+
🔗 **Link Management**
|
|
33
|
+
- Insert and edit hyperlinks
|
|
34
|
+
- Link preview
|
|
35
|
+
- Recent links suggestion
|
|
36
|
+
- Remove links
|
|
37
|
+
|
|
38
|
+
🛠️ **Additional Features**
|
|
39
|
+
- Undo/redo functionality
|
|
40
|
+
- Find and replace
|
|
41
|
+
- Code block insertion
|
|
42
|
+
- Horizontal rules
|
|
43
|
+
- Clear formatting
|
|
44
|
+
- HTML source view
|
|
45
|
+
- Import/export HTML
|
|
46
|
+
- Fullscreen mode
|
|
47
|
+
- Print support
|
|
48
|
+
- Multiple page sizes (A4, Letter, Legal)
|
|
49
|
+
|
|
50
|
+
## Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install @daneshnaik/rich-text-editor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
or with yarn:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
yarn add @daneshnaik/rich-text-editor
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
or with pnpm:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm add @daneshnaik/rich-text-editor
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
```jsx
|
|
71
|
+
import React from 'react';
|
|
72
|
+
import { RichTextEditor } from '@daneshnaik/rich-text-editor';
|
|
73
|
+
import '@daneshnaik/rich-text-editor/dist/style.css';
|
|
74
|
+
|
|
75
|
+
function App() {
|
|
76
|
+
return (
|
|
77
|
+
<div className="App">
|
|
78
|
+
<h1>My Editor</h1>
|
|
79
|
+
<RichTextEditor />
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export default App;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Requirements
|
|
88
|
+
|
|
89
|
+
- React 18.0.0 or higher
|
|
90
|
+
- React DOM 18.0.0 or higher
|
|
91
|
+
|
|
92
|
+
## Browser Support
|
|
93
|
+
|
|
94
|
+
- Chrome (latest)
|
|
95
|
+
- Firefox (latest)
|
|
96
|
+
- Safari (latest)
|
|
97
|
+
- Edge (latest)
|
|
98
|
+
|
|
99
|
+
## Styling
|
|
100
|
+
|
|
101
|
+
The editor comes with built-in styles. Make sure to import the CSS file:
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
import '@daneshnaik/rich-text-editor/dist/style.css';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
You can customize the appearance by overriding the CSS classes in your own stylesheet.
|
|
108
|
+
|
|
109
|
+
## API
|
|
110
|
+
|
|
111
|
+
The `RichTextEditor` component is a controlled component that manages its own state internally.
|
|
112
|
+
|
|
113
|
+
### Props
|
|
114
|
+
|
|
115
|
+
Currently, the component doesn't accept any props and manages its state internally. Future versions may include:
|
|
116
|
+
- `initialContent`: Set initial HTML content
|
|
117
|
+
- `onChange`: Callback for content changes
|
|
118
|
+
- `readOnly`: Make the editor read-only
|
|
119
|
+
- `toolbar`: Customize toolbar buttons
|
|
120
|
+
|
|
121
|
+
## Development
|
|
122
|
+
|
|
123
|
+
### Building from source
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Clone the repository
|
|
127
|
+
git clone https://github.com/danu20002/extmaneditor.git
|
|
128
|
+
|
|
129
|
+
# Install dependencies
|
|
130
|
+
npm install
|
|
131
|
+
|
|
132
|
+
# Build the library
|
|
133
|
+
npm run build
|
|
134
|
+
|
|
135
|
+
# Run in development mode
|
|
136
|
+
npm run dev
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT © Danesh Naik
|
|
146
|
+
|
|
147
|
+
## Support
|
|
148
|
+
|
|
149
|
+
If you encounter any issues or have questions, please file an issue on the [GitHub repository](https://github.com/danu20002/extmaneditor/issues).
|
|
150
|
+
|
|
151
|
+
## Changelog
|
|
152
|
+
|
|
153
|
+
### 1.0.0 (2026-01-10)
|
|
154
|
+
- Initial release
|
|
155
|
+
- Rich text formatting
|
|
156
|
+
- Table editing
|
|
157
|
+
- Image handling
|
|
158
|
+
- Link management
|
|
159
|
+
- Find and replace
|
|
160
|
+
- Multiple page sizes
|