-
-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an inline/minimal input mode to Bard #6973
Conversation
|
I think the tests should be fine, looks like Windows has just fallen over. |
Ah yeah that's a github workflow thing we fixed in 3.3 but hasn't been merged into master. I'll sort that out. |
I've updated the master branch if you wouldn't mind merging it back in here and testing it out again. |
Yep all good now. |
LOVE THIS, will officially negate all sorts of stupid hacks I do to circumvent fat fields; my favourite being using square brackets with {{ hero_heading | regex_replace="\[|<span class='text-rose-550'>" | regex_replace="\]|</span>" }} Thanks @jacksleight 🔥 |
Closes statamic/ideas#893. Targets the master branch as this requires Tiptap 2.
This PR adds an inline/minimal input mode to Bard. This allows you to create single line Text-like fields but with formatting and links:
CleanShot.2022-10-28.at.10.07.36.mp4
When augmented only inline HTML is output:
Notes
Tiptap 2 can support root text nodes, however a temporary paragraph is used as a wrapper during editing because the CP CSS and some extensions (eg. placeholder) expect/target paragraphs.
You can switch between inline and block modes seamlessly. Going from block to inline will only retain the first node’s content.
There are a bunch of features (sets, lists, images etc) that don’t make sense in this mode and won’t work. The fieldtype could switch them off, but to keep things simple I’ve left it to the user to configure the field appropriately. If they are enabled the buttons just do nothing.