erikgeiser / promptkit

Go prompt library
MIT License
249 stars 21 forks source link

Integrate with bubbletea #3

Closed jon4hz closed 3 years ago

jon4hz commented 3 years ago

Hello there

This library is listed as additional bubble here. This makes me wonder, is it possible to integrate promptkit in a bubbletea based application?

erikgeiser commented 3 years ago

I personally don't use promptkit that way currently but I wrote it in a way that should make it possible. To integrate it into bubbletea, use confirmation.NewModel(confirmation.New(...)). However, currently the models themselves do not display anything after the input is submitted, but I plan to change that over the next few days such that the bubbletea model behaves identical to the standalone prompt. I'm leaving the issue open until then.

erikgeiser commented 3 years ago

I pushed some changes that make it easier to use the prompt models as bubbletea widgets. Also check out the new example.

jon4hz commented 3 years ago

Amazing, thanks a lot!

erikgeiser commented 3 years ago

You're welcome. Keep in mind when upgrading that the library API currently changes significantly between versions. It will be stable from 1.0.0 onward.

jon4hz commented 3 years ago

Thanks for the hint. I'm currently working on a beta version for an application which uses bubbletea. I'm planing to integrate promptkit in a future release, after most of the bugs from the beta are eliminated. Eventually version 1.0.0 will be out by then, haha