A simple app with a few wysiwyg functionalities that lets users to write in a text editor, an attempt to mimic text editors.
There is a text input area where users can type their text. Initially it has empty content and has a default styling. When the user starts writing on it the app starts to save each input change on a local state and conditionally saves the input value.
-
Making a heading tag
Users can make a heading tag by typying
/1
at the beginning. Then a modal pops up to let the user pick options likeHeading 1
andExtended Heading 1
. The style will automatically change to predefinedheading1
style and the input area placholder readsHeading 1
. Then when the user starts wriiting the style is inHeading 1
. It is also possible to continue wriiting after the/1
tag which ignores the popup modal and changes the styling toHeading 1
. TheHeading 1
tag also has appropriatemarginBottom
value to give a sufficient space after aHeading
before a paragraph starts. -
When the user wants to end the current block just pressing
Enter
key will end the block and saves it to a local state. Each block is saved in a local array of block objects. -
The default text has a predefined
p
style which represents a noremal paragraph text style.
- Node.JS
- Next.JS
-
Clone the repository
git clone https://github.com/henatan99/helpjuice-wysiwyg-nextjs.git
-
cd to the project directory
cd helpjuice-wysiwyg
-
Install dependancies
npm install
oryarn
-
And follow the App Usage instructions in the next section
npm run dev
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
npm run test
Either run the app in local server after setting it up or just go to the live demo and give it a try.
๐ค Henok Mossissa
- GitHub: @henatan99
- Twitter: @henatan99
- LinkedIn: Henok Mossissa
Contributions, issues, and feature requests are welcome!
Give a โญ๏ธ if you like this project!
- HekpJuice for the intersting challenge and cool Figma design references
This project is MIT licensed.