https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
a

Adam Brown

07/02/2022, 9:13 PM
If anyone has been looking for a Rich Text editor composable, I ported a Jetpack compose library someone made to multiplatform compose (w_ith the original authors blessing_) https://github.com/Wavesonics/richtext-compose-multiplatform it's still pretty early, but I'm continuing to work on it.
👏 2
❤️ 4
K 5
👏🏻 1
🎉 8
👏🏾 1
j

james

07/04/2022, 1:13 AM
nice work! you might also be interested in this, which I have not personally used, but I believe a lot of the code in this library was written by at least two Google employees currently working on Compose.. so there may be some good knowledge to be gained here: https://github.com/halilozercan/compose-richtext
n

Norbi

07/05/2022, 7:48 AM
I ported a Jetpack compose library someone made to multiplatform compose
Nice, thanks 🙂 One question: the original library's authors are not interested in multiplatform?
c

Casey Brooks

07/05/2022, 3:59 PM
I’ve been looking for something like this, great job! Definitely early, but a very promising start. Are there plans to support saving/loading text, such as to/from HTML strings? And having a built-in toolbar with keyboard shortcuts would just be 🤌
a

Adam Brown

07/05/2022, 6:55 PM
Yup, I opened an issue on his repo and was told he was done working on it but I was welcome to fork it
👍🏻 1
That's all pretty possible, I'm not sure if it should be included in this library? But maybe. In the project I'm using this library in I have it exporting to mark down already.
c

Casey Brooks

07/05/2022, 7:50 PM
Maybe it could have several Gradle modules with some of these extra features, so that the core artifact doesn’t get too bloated? I would suggest keeping the core data classes and the
RichTextField
in a core artifact, and moving the
RichTextEditor
into a separate one with an additional
RichTextToolbar
component. And then more artifacts for exporting to HTML, Markdown, etc. would also be very valuable. I would love to collaborate on some of this. I’ve been able to throw together a basic toolbar POC that I’d happily contribute and help maintain
a

Adam Brown

07/05/2022, 7:54 PM
ya that'd work pretty well, currently the desktop & android demos have a toolbar that covers a lot of this functionality. Would love to collaborate too, this is really at a POC state at the moment, there's a lot of work to be done in the future to make it more production ready.
The main issue at the moment is that
BasicTextField
which this uses under the hood, is not setup to deal with rich text as it get's changes. So
RichTextEditor
does a lot of book keeping and full data copies in order to maintain the state around the rich text spans. It's really inefficient and will certainly become a problem with large amounts of text.
929 Views