cms-admin: Add isTextBlockType option to createTipTapRichTextBlock - #6369
Draft
VPS-Andreas wants to merge 1 commit into
Draft
VPS-Andreas wants to merge 1 commit into
VPS-Andreas wants to merge 1 commit into
Conversation
The text block style dropdown was the only way to apply a style like a large "Display" heading variant, even for blocks where that style is really a distinct, editor-facing block type in its own right (some Draft.js RTEs had exactly this: a "display" block type sitting above "header-one", both rendering as <h1>). That produced two dropdowns where the legacy block had one, and left the style dropdown showing only "Default"/"Heading N" for every other heading level. A textBlockStyles entry with isTextBlockType: true now shows up as its own entry in the text block type dropdown instead, right above the plain heading level entry it shares a tag with. Picking that plain entry, or any other tag, always clears the style, so it can't linger as a stale value. Requires appliesTo to name exactly one tag, and that tag can't also carry a defaultTextBlockStyles entry, since the two would fight over what "no explicit style" means for it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The text block style dropdown was the only way to apply a style like a large "Display" heading variant, even for blocks where that style is really a distinct, editor-facing block type in its own right — some Draft.js RTEs had exactly this: a
displayblock type sitting aboveheader-one, both rendering as<h1>,displaya large hero-style variant. That produced two dropdowns where the legacy block had one, and left the style dropdown showing only "Default"/"Heading N" for every other heading level.A
textBlockStylesentry withisTextBlockType: truenow shows up as its own entry in the text block type dropdown instead, right above the plain heading level entry it shares a tag with. Picking that plain entry, or any other tag, always clears the style, so it can't linger as a stale value. RequiresappliesToto name exactly one tag, and that tag can't also carry adefaultTextBlockStylesentry, since the two would fight over what "no explicit style" means for it.Example
The type dropdown becomes Display, Heading 1, Heading 2, Heading 3, Heading 4, Heading 5 — matching the legacy single-dropdown block type select.
Stacking note
main— that PR needs to merge first. Once it does:git rebase --onto <new main tip> <old tiptap-default-text-block-style tip> tiptap-text-block-type-select-style(same dance already done twice this session for Support heading-only TipTap rich text blocks #6240→Add defaultTextBlockStyles option to createTipTapRichTextBlock #6366 and main→cms-admin: Fix invalid DOM nesting in textBlockStyles node views #6363/cms-admin: Don't insert a trailing paragraph after a heading #6364)mainin GitHub (or verify GitHub already auto-retargeted it after the base branch was deleted — still re-check the diff either way, since a squash-merge rewrites commit SHAs)tsc/eslint/the Storybook story after the rebaseTest plan
tscandeslintpass forcms-adminblocks/TipTapRichTextBlock→ "Is Text Block Type") verified interactively via Playwright — dropdown order (Display above Heading 1), no separate style dropdown, clearing on switch to the plain entry and to another tag: https://69df3371c46abe69b5199825-bqiylrjspn.chromatic.com/?path=/story/blocks-tiptaprichtextblock--is-text-block-type🤖 Generated with Claude Code