Build your own Notion-like WYSIWYG Editor in React

  Рет қаралды 8,722

Colby Fayock

Colby Fayock

4 ай бұрын

Learn how to add a WYSIWYG editor with AI commands in React using Novel.
We'll walk through setting up React in an Astro app, installing and adding the Novel editor, and setting up and configuring an AI chat completion endpoint using the OpenAI API and Vercel's AI SDK.
🧰 Resources
Tutorial: spacejelly.dev/posts/how-to-a...
Code: github.com/colbyfayock/my-ast...
Demo: my-astro-ai-editor.vercel.app...
📺 KZfaq: kzfaq.info?sub_c...
🐦 Twitter: / colbyfayock
📹 Twitch: / colbyfayock
✉️ Newsletter: www.colbyfayock.com/newsletter/
🎥 What I Use: www.colbyfayock.com/uses
#colbyfayock #aieditor #reactjs #astrojs #wysiwyg #webdevelopment

Пікірлер: 30
@colbyfayock
@colbyfayock 4 ай бұрын
Get fresh tutorials and other free content straight to your inbox! colbyfayock.com/news
@harshrakholiya_
@harshrakholiya_ 3 ай бұрын
hay! i have my own project and in backend it takes string so im wondaring will this output string or any thing else
@colbyfayock
@colbyfayock 3 ай бұрын
yup so in this video i show grabbing it as HTML via getHTML and do exactly that, store it inside of a database. which i prefer. you can also grab it as a JSON format. i prefer the HTML as it feels like its more transportable to any other platform/framework instead of having to maintain code to parse the JSON or use the TipTap tools to do so
@adamboucek7437
@adamboucek7437 3 ай бұрын
@@colbyfayock Hey! but then you display it as raw data? I don't know astro but how would you do it in react? Thanks!
@colbyfayock
@colbyfayock 3 ай бұрын
@@adamboucek7437 in React you would render it using dangerouslySetInnerHTML={{ __html: content }} though keep in mind as it notes, its "dangerously" setting it as if you don't know the source of the HTML, someone could exploit that as a security issue, but in the context of bringing in content from a CMS that you own that's usually okay you also have the opportunity to use something like Rehype if you'd like to transform that HTML, such as turning particular elements into React components kzfaq.info/get/bejne/gqx-gNZpzqvLiIE.html
@FzsHotDogInDonut
@FzsHotDogInDonut 4 ай бұрын
I got it working with remix js. But never got that ui. Or blocks to drag and drop.
@colbyfayock
@colbyfayock 4 ай бұрын
can you elaborate on the working but not the UI? which part is working as i'd assume the UI is part of it? do you see any console errors?
@FzsHotDogInDonut
@FzsHotDogInDonut 4 ай бұрын
@@colbyfayock I got it working I am using remix js. They no longer export as a single component. Their doc is only for next js. And uses shadcn/ui and tailwind(I use them, too so no problem there). But it takes so much more effort than this. Tippy.js gives warning continuously . And Image can not be resized after that saved status changes. It gives warning like "image edit is only available in html mode". No idea how to get it. I couldn't save the image in local dir[/public/img]. But after some tweak got it to based64. then got the json to db. But couldn't generate html from that. No video preview or facebook or twitter embed. A lot less setup than plate js though. But plate js got a lot of options.
@colbyfayock
@colbyfayock 4 ай бұрын
@@FzsHotDogInDonut bummer sorry to hear that. im confused though, i was able to see that they recently merged in their headless components work which i assume is ultimately a good thing, but it looks like the basic example stil lworks according to the homepage: novel.sh/ - do you mean for more advanced use cases I guess? still, i wouldn't expect the setup to be much different between Next.js, Remix, or any other React-based framework. sounds like maybe it may make sense to consider TipTap directly? would take more work to get it to the point you need, especially visually, but may give you more flexibility: github.com/ueberdosis/tiptap havent heard of platejs, looks nice too
@henrikharju4561
@henrikharju4561 3 ай бұрын
Feels like somethings missing.. Trying to add into fresh astro project. 'Editor' cannot be used as a JSX component. Its type 'typeof Editor' is not a valid JSX element type. Types of construct signatures are incompatible. Type 'new (options?: Partial) => Editor' is not assignable to type 'new (props: any, deprecatedLegacyContext?: any) => Component'. Type 'Editor' is missing the following properties from type 'Component': context, setState, forceUpdate, render, and 2 more.ts(2786) (alias) class Editor import Editor
@colbyfayock
@colbyfayock 3 ай бұрын
hey did you install React? here's my code: github.com/colbyfayock/my-astro-ai-editor
@anhkhoavu6693
@anhkhoavu6693 3 ай бұрын
I also got this error. I installed the latest novel version and got the same problem. When you restore to the older version, the problem will no longer occur
@colbyfayock
@colbyfayock 3 ай бұрын
@@anhkhoavu6693 found this issue: github.com/steven-tey/novel/issues/296 - it looks like there have been some breaking changes from the new maintainer that haven't been properly documented / sorted out with updated instructions - there are links to examples in there, hope that helps
@amin_baccari
@amin_baccari 4 ай бұрын
Is Novel and its AI components free to use tho ?
@colbyfayock
@colbyfayock 4 ай бұрын
novel is free - the AI aspect depends on what you use. my example here is openai which has a cost. if you run your own AI service then it would be whatver the cost is of that infrastructure, which would likely be cheaper than openai
@CanRau
@CanRau 4 ай бұрын
I’d say I’ve got to consider TipTap’s pricing as well
@colbyfayock
@colbyfayock 4 ай бұрын
@@CanRau i think that's only if you use more advanced features that are opt-in, unless im mistaken. i believe the tool as shown has no price tag associated with it (aside from the AI endpoint), but again i may be missing something?
@sebasfernandez1600
@sebasfernandez1600 Ай бұрын
Do I need to pay TipTap for using Novel?
@colbyfayock
@colbyfayock Ай бұрын
not that im aware of, i didnt touch TipTap directly through this. i believe paying TipTap is for further TipTap features
@MemeJargoo
@MemeJargoo 2 ай бұрын
This doesn't seem to work on for me
@colbyfayock
@colbyfayock 2 ай бұрын
People are having issues with their recent updates that broke backwards compatibility. I'm working to create a PR to show the updated code when I have time
@dirtybeans69
@dirtybeans69 2 ай бұрын
@@colbyfayock Could really use an update video. My final project relies on this 😭
@colbyfayock
@colbyfayock 2 ай бұрын
@@dirtybeans69 you could install this version for now if you want to work based off of this video, but of course wouldnt be able to get the latest updates to the library www.npmjs.com/package/novel/v/0.1.22
@chadjones4255
@chadjones4255 2 ай бұрын
This really got my hopes up but unfortunately, it no longer works.
@codinglyio
@codinglyio 3 ай бұрын
Honestly, the Novel docs are some of the worst I've seen. No idea how they made it to 10k stars. Your tutorial video is great anyway. Too bad it's outdated and the Novel team kept their docs as vague as it could possibly be.
@colbyfayock
@colbyfayock 3 ай бұрын
yeah that parts a bit challenging right now unfortunately. is the video unusable with the recent updates? i plan to create a PR into my code demo to show the updated code, but i have to imagine most of the same concepts still apply
@codinglyio
@codinglyio 3 ай бұрын
@@colbyfayock Unfortunately I could not get it to work with your video. And I'd consider myself decently technical and familiar with React etc.
@vampirekabir
@vampirekabir 2 ай бұрын
since u are a prominent youtube teacher, pls make a tutorial on Novel along with storing them on database and cloud(aws s3, mongoose) will be a great great great help for everyone.
@vampirekabir
@vampirekabir 2 ай бұрын
@@codinglyio since u are a prominent youtube teacher, pls make a tutorial on Novel along with storing them on database and cloud(aws s3, mongoose) will be a great great great help for everyone
@dirtybeans69
@dirtybeans69 2 ай бұрын
@@colbyfayock Yes the video is unuseable with the recent updates
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 397 М.
Detect Clicks Anywhere on a Page in React
12:10
Colby Fayock
Рет қаралды 2,3 М.
ИРИНА КАЙРАТОВНА - АЙДАХАР (БЕКА) [MV]
02:51
ГОСТ ENTERTAINMENT
Рет қаралды 1,4 МЛН
2000000❤️⚽️#shorts #thankyou
00:20
あしざるFC
Рет қаралды 15 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 39 МЛН
Climbing to 18M Subscribers 🎉
00:32
Matt Larose
Рет қаралды 24 МЛН
A WYSIWYG editor with AI powered autocomplete! | Novel.sh
21:20
LiveCode247
Рет қаралды 7 М.
Speech Recognition & Voice Synthesis in React (Web Speech API)
31:00
Helix Text Editor: A Review
13:42
Diego Sandoval
Рет қаралды 22 М.
This UI component library is mind-blowing
8:23
Beyond Fireship
Рет қаралды 588 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 558 М.
You Don't Need a CMS - Use This Instead
28:55
Colby Fayock
Рет қаралды 14 М.
This VS Code AI Coding Assistant Is A Game Changer!
14:27
codeSTACKr
Рет қаралды 139 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 182 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 23 МЛН
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 18 МЛН
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,6 МЛН
Купил этот ваш VR.
37:21
Ремонтяш
Рет қаралды 231 М.
DC Fast 🏃‍♂️ Mobile 📱 Charger
0:42
Tech Official
Рет қаралды 482 М.