feat: Implement a rich text editor using Lexical
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 14s
All checks were successful
CI - Build and Push / Build and Push Docker Image (push) Successful in 14s
- Added RichTextEditor component with basic formatting features. - Integrated toolbar with undo/redo, text formatting, and color pickers. - Created EditorTheme for styling the editor components. - Added styles for editor and toolbar. - Introduced DropdownColorPicker for color selection. - Updated package.json to include Lexical dependencies. - Created EditorDemo page to showcase the rich text editor. - Added README documentation for the editor's features and usage.
This commit is contained in:
33
src/editor/themes/EditorTheme.ts
Normal file
33
src/editor/themes/EditorTheme.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type { EditorThemeClasses } from 'lexical';
|
||||
|
||||
const theme: EditorThemeClasses = {
|
||||
paragraph: 'editor-paragraph',
|
||||
quote: 'editor-quote',
|
||||
heading: {
|
||||
h1: 'editor-heading-h1',
|
||||
h2: 'editor-heading-h2',
|
||||
h3: 'editor-heading-h3',
|
||||
h4: 'editor-heading-h4',
|
||||
h5: 'editor-heading-h5',
|
||||
h6: 'editor-heading-h6',
|
||||
},
|
||||
list: {
|
||||
nested: {
|
||||
listitem: 'editor-nested-listitem',
|
||||
},
|
||||
ol: 'editor-list-ol',
|
||||
ul: 'editor-list-ul',
|
||||
listitem: 'editor-listitem',
|
||||
},
|
||||
text: {
|
||||
bold: 'editor-text-bold',
|
||||
italic: 'editor-text-italic',
|
||||
underline: 'editor-text-underline',
|
||||
strikethrough: 'editor-text-strikethrough',
|
||||
code: 'editor-text-code',
|
||||
},
|
||||
code: 'editor-code',
|
||||
codeHighlight: {},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
Reference in New Issue
Block a user