tinode / tinode-js

Tinode javascript bindings
Apache License 2.0
52 stars 42 forks source link

Create a version of drafty independent from platform #44

Closed rxmoein closed 3 years ago

rxmoein commented 3 years ago

Is your feature request related to a problem? Please describe. Yes, currently it's highly dependent on host web objects.

Describe the solution you'd like Creating a core standard for formatting rich text content. Then provide a platform specific plugin to parse formatted data into native html element / rich text widget.

or-else commented 3 years ago

Drafty is exactly that: a platform-independent format, conceptually similar to markdown. It's currently implemented on three platforms: web (plain html + react), android, ios.

rxmoein commented 3 years ago

I mean making it a platform-independent package not in the tinode itself.

or-else commented 3 years ago

Drafty is written in such a way that it does depend on any other part of Tinode, it's pretty easy to split it into a separate project. My only concern would be to have too many features added to it. I want to keep it as simple and minimalistic as possible. Do you want to split it into a separate project?

rxmoein commented 3 years ago

I'm thinking about it as an independent rich-text format project. So the core code can be a package. It is responsible to convert content into serializable json and vice-versa. Now for each platform, we can have a plugin for it that generates the content based on that json for the target platform. For example, on the web, the destination will be HTML so it can be used easily. Or on flutter destination will be flutter widgets so it can be used as a container's child.

or-else commented 3 years ago

You are welcome to spin it off, just keep in mind that there is this: https://draftjs.org/