I would like to build a WYSIWYG for things like an email, where the user can drag in a component and then configure it, but I am not totally sure where to start.
I'm not sure if there's a misunderstanding between the question and all responses? I think what he seeks is (2)
You don't because the concept itself is flawed -- since starting out with what it looks like instead of what things ARE pisses on the entire reason HTML even exists, concepts like semantics and separation of presentation from content, resulting in websites that are nothing more than a giant middle finger to users.
That's why not one single WYSIWYG in the history of web development has created a website that was worth a flying ****! They are the pinnacle of developer ignorance and incompetence, and at BEST are little more than nube predating scam-bait!
You take content of value or a reasonable facsimile of future content, mark it up SEMANTICALLY (a sick euphemism for "use HTML correctly") with ZERO concern for what it looks like, then bend that markup to your will with CSS using semantically neutral containers like DIV and SPAN where and only as needed.
THAT is design. Dicking around with what it looks like from the start is called graphic arts.
Marco Alka
Software Engineer, Technical Consultant & Mentor
While I agree wholeheartedly with Jason, the point of this question is to enable you to create such an application. I do not know why you would do something like that, and I don't think it's the point, so I will try to give you the hints you need.
Well. While I didn't include any technical stuff, I really think that such a thing is not necessary here. You will find so many problems along the way, that whatever I wrote here would never help you get to the goal. It is important that you learn how to do it yourself. Well, you could say, instead of giving you instructions, I give you Google ("give a man a fish..." - you know what I mean).
One last thing: In order to improve and get things done, it is important to stay motivated. In order to stay motivated, have fun. If what you do is no fun, change something so that you have fun!