@innoviatech/lexical-text-editor 2.0.2 โ 2.0.3
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 +237 -236
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AlignmentSelectionList.tsx +2 -2
- package/src/components/ColorPicker.tsx +1 -1
- package/src/components/ContentPreview.tsx +2 -1
- package/src/components/DropdownList.tsx +2 -2
- package/src/components/HeadingSelectionList.tsx +2 -2
- package/src/components/LinkModal.tsx +4 -4
- package/src/components/common/Dialog.tsx +1 -1
- package/src/nodes/ImageNode.tsx +0 -3
- package/src/plugins/ImagePlugin.tsx +4 -4
- package/src/plugins/ListPlugin.tsx +2 -2
- package/src/plugins/ToolbarPlugin.tsx +3 -3
- package/src/plugins/VideoPlugin.tsx +2 -3
- package/src/styles/lexical-editor.css +3 -3
package/README.md
CHANGED
|
@@ -1,236 +1,237 @@
|
|
|
1
|
-
# @innoviatech/lexical-text-editor v2.0
|
|
2
|
-
|
|
3
|
-
A powerful, customizable rich text editor component built with Lexical and React. Features a modern toolbar, image support, video embedding, and comprehensive text formatting options.
|
|
4
|
-
|
|
5
|
-

|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## What's New in v2.0
|
|
9
|
+
|
|
10
|
+
- **No Tailwind CSS Required** - Now uses raw CSS for styling
|
|
11
|
+
- **Reduced Dependencies** - Fewer peer dependencies to install
|
|
12
|
+
- **Simpler Setup** - Import CSS and start using immediately
|
|
13
|
+
- **Lightweight** - Smaller bundle size
|
|
14
|
+
- **Better Compatibility** - Works with any React project setup
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- ๐จ **Rich Text Editing** โ Bold, italic, underline, strikethrough, code blocks
|
|
22
|
+
- ๐ **Text Formatting** โ Headers, paragraphs, lists (bulleted & numbered), quotes
|
|
23
|
+
- ๐ **Link Support** โ Insert and edit hyperlinks
|
|
24
|
+
- ๐ผ๏ธ **Media Embedding** โ Images and YouTube videos with resizing
|
|
25
|
+
- ๐ฏ **Customizable Toolbar** โ Modern, intuitive interface
|
|
26
|
+
- ๐จ **Color Picker** โ Text and background color options
|
|
27
|
+
- ๐ฑ **Responsive Design** โ Works on desktop and mobile
|
|
28
|
+
- โก **TypeScript Support** โ Fully typed for better development experience
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Installation
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install @innoviatech/lexical-text-editor
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### No Peer Dependencies Required! ๐
|
|
39
|
+
|
|
40
|
+
Version 2.0 eliminates the need for Tailwind CSS and multiple UI libraries. Just install the package and start using it!
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```tsx
|
|
46
|
+
import React, { useState } from 'react';
|
|
47
|
+
import { LexicalTextEditor } from '@innoviatech/lexical-text-editor';
|
|
48
|
+
import '@innoviatech/lexical-text-editor/style.css';
|
|
49
|
+
|
|
50
|
+
function App() {
|
|
51
|
+
const [content, setContent] = useState('');
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<>
|
|
55
|
+
<LexicalTextEditor
|
|
56
|
+
name="my-editor"
|
|
57
|
+
value={content}
|
|
58
|
+
onChange={setContent}
|
|
59
|
+
placeholder="Start typing your content here..."
|
|
60
|
+
/>
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default App;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## Props
|
|
71
|
+
|
|
72
|
+
| Prop | Type | Required | Default | Description |
|
|
73
|
+
|-------------|-------------------------------------|----------|---------------|---------------------------------------------|
|
|
74
|
+
| `name` | `string` | Yes | โ | Unique identifier for the editor instance |
|
|
75
|
+
| `value` | `string` | Yes | โ | Current editor content (HTML string) |
|
|
76
|
+
| `onChange` | `(value: string) => void` | Yes | โ | Callback fired when content changes |
|
|
77
|
+
| `placeholder`| `string` | No | `"Some Text"` | Placeholder text when editor is empty |
|
|
78
|
+
| `maxWidth` | `string` | No | "1090px" | Adjust the maximum width accoding to the need ('80%' or '800px') |
|
|
79
|
+
| `height` | `string` | No | "500px" | Adjust the height accoding to the need ('50vh' or '500px') |
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## Advanced Usage
|
|
84
|
+
|
|
85
|
+
### With Initial Content
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import React, { useState } from 'react';
|
|
89
|
+
import { LexicalTextEditor } from '@innoviatech/lexical-text-editor';
|
|
90
|
+
import '@innoviatech/lexical-text-editor/style.css';
|
|
91
|
+
|
|
92
|
+
function App() {
|
|
93
|
+
const [content, setContent] = useState('<p>Welcome to the editor!</p><ul><li>Feature 1</li><li>Feature 2</li></ul>');
|
|
94
|
+
|
|
95
|
+
const handleSave = () => {
|
|
96
|
+
console.log('Current content:', content);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<form onSubmit={handleSave}>
|
|
101
|
+
<LexicalTextEditor
|
|
102
|
+
name="content-editor"
|
|
103
|
+
value={content}
|
|
104
|
+
onChange={setContent}
|
|
105
|
+
placeholder="Write your content..."
|
|
106
|
+
maxWidth="600px"
|
|
107
|
+
height="400px"
|
|
108
|
+
/>
|
|
109
|
+
<button type="submit">Save Content</button>
|
|
110
|
+
</form>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default App;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## Toolbar Features
|
|
119
|
+
|
|
120
|
+
- Text Formatting: Bold, Italic, Underline, Strikethrough
|
|
121
|
+
- Headings: H1โH6
|
|
122
|
+
- Lists: Bulleted and Numbered
|
|
123
|
+
- Alignment: Left, Center, Right, Justify
|
|
124
|
+
- Text Case: Uppercase, Lowercase, Capitalize
|
|
125
|
+
- Colors: Text & background color picker
|
|
126
|
+
- Media: Image upload, YouTube embedding, video node
|
|
127
|
+
- Links: Insert and edit hyperlinks
|
|
128
|
+
- Code: Inline code & code blocks
|
|
129
|
+
- Quotes: Blockquote formatting
|
|
130
|
+
- Undo/Redo, Clear formatting, Remove link
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
## Browser Support
|
|
134
|
+
|
|
135
|
+
- Chrome 90+
|
|
136
|
+
- Firefox 88+
|
|
137
|
+
- Safari 14+
|
|
138
|
+
- Edge 90+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
## Troubleshooting
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
- **CSS not loading:** `import '@innoviatech/lexical-text-editor/style.css'`
|
|
145
|
+
- **Editor not rendering:** Check that React 18+ or next.js 14+ is installed
|
|
146
|
+
- **TypeScript errors:** Update to TypeScript 5.0+
|
|
147
|
+
- **Missing styles:** Verify the CSS import path is correct
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
## Version Compatibility
|
|
152
|
+
|
|
153
|
+
- React 18+
|
|
154
|
+
- Next.js 14+
|
|
155
|
+
- Lexical 0.36.0+
|
|
156
|
+
- TypeScript 5.0+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## License
|
|
160
|
+
|
|
161
|
+
MIT ยฉ Innoviatech
|
|
162
|
+
|
|
163
|
+
## Support & Community
|
|
164
|
+
|
|
165
|
+
### Get Help
|
|
166
|
+
|
|
167
|
+
We're here to help you succeed with our editor! Here are the best ways to get support:
|
|
168
|
+
|
|
169
|
+
### Report an Issue
|
|
170
|
+
Found a bug or experiencing problems?
|
|
171
|
+
๐ [Open a GitHub Issue](https://github.com/technohaattech/Lexical-Text-Editor/issues)
|
|
172
|
+
|
|
173
|
+
**Please include:**
|
|
174
|
+
- ๐ฑ **Environment** (Browser, OS, React/Next.js version)
|
|
175
|
+
- ๐ **Steps to reproduce**
|
|
176
|
+
- ๐ฏ **Expected vs Actual behavior**
|
|
177
|
+
- ๐ **Relevant code snippets**
|
|
178
|
+
- ๐ผ๏ธ **Screenshots** (if applicable)
|
|
179
|
+
|
|
180
|
+
### Request a Feature
|
|
181
|
+
Have an idea to make the editor even better?
|
|
182
|
+
โจ [Submit a Feature Request](https://github.com/technohaattech/Lexical-Text-Editor/issues/new?template=feature_request.md)
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
### Documentation
|
|
187
|
+
[Getting Started Guide](https://github.com/technohaattech/Lexical-Text-Editor)
|
|
188
|
+
|
|
189
|
+
### Video Tutorials
|
|
190
|
+
- [Installation & Setup](https://youtube.com/playlist?list=...) *(Coming Soon!)*
|
|
191
|
+
- [Advanced Features](https://youtube.com/playlist?list=...) *(Coming Soon!)*
|
|
192
|
+
- [Integration Examples](https://youtube.com/playlist?list=...) *(Coming Soon!)*
|
|
193
|
+
|
|
194
|
+
### Community
|
|
195
|
+
Join our growing community of developers:
|
|
196
|
+
|
|
197
|
+
| Platform | Link | Best For |
|
|
198
|
+
|----------|------|----------|
|
|
199
|
+
| **GitHub Discussions** | [Join Discussion](https://github.com/technohaattech/Lexical-Text-Editor/discussions) | Questions & ideas |
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
### Contribute
|
|
203
|
+
|
|
204
|
+
Love our editor? Here's how you can contribute:
|
|
205
|
+
|
|
206
|
+
### Ways to Contribute
|
|
207
|
+
- ๐ **Improve Documentation** โ Help others learn
|
|
208
|
+
- ๐ง **Fix Bugs** โ Submit pull requests
|
|
209
|
+
- โจ **Add Features** โ Extend functionality
|
|
210
|
+
- ๐งช **Write Tests** โ Improve reliability
|
|
211
|
+
- ๐ **Translate** โ Help with localization
|
|
212
|
+
- ๐ฃ **Spread the Word** โ Star the repo, share with others
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
### About Innoviatech
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
**Our Mission**
|
|
219
|
+
|
|
220
|
+
At Innoviatech, we believe that creating great digital experiences should be accessible to every developer. We build tools that empower teams to focus on what matters most.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
**Built with Passion**
|
|
224
|
+
|
|
225
|
+
> "Great tools shouldn't get in the way of great ideas. That's why we build editors that feel like an extension of your creativity."
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
**Star Us on GitHub!**
|
|
230
|
+
|
|
231
|
+
If you find this project helpful, please consider giving it a star on GitHub. It helps us reach more developers like you!
|
|
232
|
+
|
|
233
|
+
[](https://github.com/technohaattech/Lexical-Text-Editor)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
*Made with โค๏ธ by the Innoviatech team*
|