Structured Block Kit fields: portable_text and block_list, plus Duplicate on plugin block cards #2673
simone-coelho
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Plugin blocks that carry rich text or nested content currently have no faithful Block Kit field for it. A rich-text value stored as Portable Text can only surface through a multiline
text_input, which shows an empty box over the stored array and replaces it with a plain string on save — silent data loss for any content imported or authored as Portable Text. Similarly, a block whose data contains an ordered list of other registered blocks (columns, composite sections) has no field kind the dialog can edit, and plugin block cards offer Edit/Delete but no Duplicate.Proposal (implementation ready, PR to follow):
portable_textelement — value is a Portable Text block array; the dialog mounts the existingPortableTextEditor, so structure (blocks, spans, marks, markDefs, keys) round-trips intact and is never stringified. RuntimerenderElementreturnsnulllikerepeater.block_listelement — an ordered list of registered plugin blocks ({ _type, _key, ...fields }items). Dialog UX: add from the registered catalog, edit via the chosen block's own Block Kit form, duplicate, delete, drag reorder, and "Move to…" a sibling list when a form holds several lists (including lists nested inrepeaterrows).allowed_types,min_items,max_itemsbound it.Both new elements are additive (new
Elementunion members + validation), are accepted asrepeatersub-fields, and change nothing for existing blocks. Motivation: CMS-native migration tooling needs imported rich text and nested layout content to stay fully editable in the stock admin editor without a private document format.All reactions