Repository navigation
refactor: rename the header blocks to banner - #1516
Merged
Merged
Conversation
makhnatkin
marked this pull request as ready for review
November 21, 2026 20:59
Rename packages/plugin-header to packages/plugin-banner and packages/editor-header-extension to packages/editor-banner-extension, together with their exports, the :::banner markup, CSS classes, i18n keyset, demo stories and visual tests. Typography (header-N, subheader-*) and YfmTable header names stay as they are. The settings panel visual test now waits for the markup preview before the width list screenshot, so the snapshot no longer catches the stale height value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
force-pushed
the
refactor/rename-header-to-banner
branch
from
November 21, 2026 21:14
9212aaa to
faa6747
Compare
makhnatkin
added a commit
that referenced
this pull request
Nov 21, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_layout.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 21, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_layout.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
makhnatkin
added a commit
that referenced
this pull request
Nov 22, 2026
Blocks: - @gravity-ui/markdown-plugin-banner: markdown-it plugins for the banner, banner-title, banner-content, banner-image and button blocks, bannerPreset, per-block styles, narrow layout, fills, background images, print styles - editor WYSIWYG keeps every block attribute across mode switches - files galleries skip the banner blocks (data-files-gallery-exclude) - both banner packages are private: they are not added to release-please or the publish workflow yet Banner: - Settings: the Title, Description, Button 1-3 and Image switches insert and remove the blocks (every copy of a doubled title or description; a block removed with a switch comes back with its text and settings when the switch is turned on again, until the page reloads), the alignment controls write `align` and `vertical`; the Background window opens with the focus on its active tab - Toolbar inserts a banner with a title, a description and one button in both modes - The Copy button of the banner toolbar is the UIKit `ClipboardButton`: it writes the Markdown of the banner to the clipboard and leaves the document unchanged; like the code block copy button it keeps the focus and shows that the text is copied - The settings panel opens to the right of the banner (inside the viewport when there is no room); the panel, the Background popup, the image popup and the button tooltip are drawn in one layer above the other popups; the labels of the settings rows are aligned to the top of their rows - Node view skips DOM updates when only the content changes, and the toolbar is not rendered again while text is typed in the banner; a background change that replaces the image (fill, Reset, link, removal), Cancel, Escape or hiding the background or image popup discards a running upload, while the text color or the blur keeps it; a failed upload returns the focus to the upload button; a single-pass reader of raw directive attributes - Block toolbars appear once the editor has the focus, and a selection that leaves the banner hides them; like the other windows of the editor, the settings panel, the Background popup and the image popup do not pass the undo and redo keys to the editor - Pasting text copied across the title and the description gives plain paragraphs (no second title or description, no description outside a banner); the banner is an isolating block: Backspace and Delete at its outer or inner edge never move a block in or out of it; Enter in an empty last paragraph of the banner (Enter twice after the last button row) continues below the banner; only text pastes that contain a title or a description are parsed twice - The title and the description have the editor's `complex: 'leaf'` role, so Quote in the title quotes the whole banner and Cut is not offered there; the title never turns into another block: list, heading and code block shortcuts do nothing there, and `# ` or a triple backtick typed into it stay text - `BannerSpecs` registers the banner with its title, description and image, so a specs-only host round-trips every block - A banner at the end of a quote, note, cut or list item (or at the start of a quote) keeps the neighbor paragraph on Backspace and Delete like a top-level banner; in a banner inside a list item or a table cell, Tab and Shift+Tab belong to the banner toolbars and never indent or lift the item or move to another cell; Shift+Tab from the first button of a block toolbar and Tab from its last one return the focus to the editor; a block toolbar hidden by a click outside it stays hidden while the focus is outside the editor (such as in the settings panel) Banner title: - Edited in place as plain text with a placeholder, Enter moves to the description and never splits the title; Backspace and Delete at its edges never join a neighbor block (a button row is kept); pasted buttons give their labels and images nothing; a toolbar with the size (Heading 1-6) and the text color menus; no selection toolbar over the title; undo and redo restore an edit of a range that starts in the title; a pasted text keeps the spaces at its edges as one space Banner description: - Rich text edited in place with a placeholder, no size attribute; an isolated block that Enter, Backspace, Delete and select-all never break or leave; Backspace or Delete over all of its text keeps a rule, an image or another non-text block outside the selection - On medium and heavy fills and on images, the title and description placeholders use the complementary text color Banner image: - Shown like the preview; an empty address is a gray placeholder with an icon, named "Add image" for screen readers, whose colors follow the page theme only: a click anywhere on it shows the image popup under it, also before the editor has the focus; Backspace and Delete next to the image select it instead of deleting a neighbor; the first click into an unfocused editor selects the image; a selected image has only the selection ring of the editor - No toolbar: a selected image shows its popup under it right away, like the button tooltip, without taking the focus (upload through the file upload handler or a link with the address check of the background); Escape, a click outside and a focus move to the page hide it, Enter and Tab move the focus into it, Tab out of it returns to the editor; with an address the popup has the "Reset" button of the Background popup, which brings the placeholder back in one undo step, and the corner radius and paddings of the button tooltip; while the image is selected the banner toolbar stays centered under the banner - The alternative text and the title are not edited in the editor: `alt` and `title` written in Markdown are kept; the image is removed with Backspace, Delete or the Image switch - The background popup and the image popup share the upload and link form, which shows only the source (the title, alternative text and size fields of the editor's image form are hidden); the size limit is shown in B, KB or MB - An image without alternative text is named "Image" with `role="img"` in the editor only Button: - An indivisible inline node (atom) with the label, link, style and target as attributes; it looks like the preview in a text, in a row and in a banner - A click, or Enter on a selected button, opens the "Button settings" dialog under it with the focus in the label field (label, style list with a preview, link, "Open in a new tab"); Tab after the last control or Shift+Tab before the first one, Escape and a click outside save the fields, close it and return to the editor; keys that reach the editor while it is open do nothing; in a banner the banner toolbar is hidden meanwhile; each change is one undo step - Backspace and Delete next to a button select it first, and the next press removes it; the selected button is outlined - An empty label is allowed: the button shows the dimmed placeholder "Button" and the Markdown gets it as the label; `[`, `]`, `\` and `|` in a label are escaped; an address that the Markdown parser drops (`normalizeButtonHref`) is refused with an error in the field - Text marks apply to the whole button; a link, inline code, a subscript and a superscript never do: they apply to the text on each side and skip the button - A paragraph of buttons with no other marks is a row (a bold or italic button or a linked space makes it a paragraph of text, as in the preview); buttons of a banner are one row shown like the preview, each written as its own paragraph; in the editor a row is a line of text with the same button boxes as the preview (inline buttons, the gaps as the width of the spaces between them, the narrow column as full-width buttons), the arrow keys leave it as they leave a paragraph, and adjacent buttons of a row stay separate buttons - The toolbar item inserts an empty button and opens its settings, or turns the selected text into the label - `:button` with no `[` right after it stays plain text, so a link around it (`[Press the :button now](/help)`) still parses - A link around a button is split at the button by the markdown-it plugin, so the preview and the editor keep the link on the text on both sides and never nest a link in a link Plugin: - One enum picker and shared data-attribute helpers for the blocks; the description has no size attribute; `bannerModel`, `bannerModelValues` and `bannerModelFromAttrs` are the banner API (`bannerModelFromAttrs` is the one reader of the banner attributes) - `safeLinkUrl` for button addresses that do not come from Markdown, button color modifiers generated from one color-to-token map - The banner and image addresses are also checked with `md.validateLink` of the parser; size and text tokens of every block have fallback values, so the blocks keep their size and type without the Gravity UI theme; `--g-md-banner-plugin-image-width` is at most `50%`, so the image never covers the text - The narrow-layout width is one shared partial (`build/styles/_variables.scss`) used by the editor button-row rule; size modifiers generated from height and width maps (same values) - README: browser support, a Sanitizer section with the attributes an allow-list sanitizer must keep, the banner width in content-sized parents, a note on link plugins Editor and viewer: - `ImageForm`, `ImageFormProps` and `ImageFormSubmitParams` are exported from the editor root entry; the background and image popups of the banner reuse the editor's image form - `useFilesGallery` (`/view`) skips images and links inside `[data-files-gallery-exclude]` and does not prevent clicks on them, and exports `FilesGalleryAttrs`; the banner and the banner image set the attribute, so banner images and buttons never open the gallery - `FilesGallery` and `collect-gallery` of the viewer skip the same attribute; `FILES_GALLERY_EXCLUDE_ATTRIBUTE` is exported from `extensions` - `ToolbarListButton` no longer marks enabled menu items as dialog triggers through the disabled-hint popover Package and demo: - Based on the rename of the header blocks to banner in `main` (#1516); the new blocks follow it: `::banner-image`, `::banner-title[…]`, `:::banner-content` - Packages: `@gravity-ui/markdown-plugin-banner` and `@gravity-ui/markdown-editor-banner-extension` stay private (not released yet) - `Banner` and `Button` import only the stylesheets of the blocks they render, so a Button-only or Banner-only host does not ship the other blocks' styles - Peers: `@gravity-ui/uikit` `^7.39.0` (the version the package is built and tested with); the README says both packages are not published yet and are used from this repository as workspace packages, lists `@gravity-ui/markdown-plugin-banner` next to the extension, and its Preview snippet imports `MarkdownIt` - The Playground uses the `Banner` extension and its toolbar item, so a banner shown in its preview survives the switch to WYSIWYG - Demo: the stories `Extensions / Landing / Banner` and `Extensions / Landing / Button` are one Playground canvas each, with every variant under its own heading; the per-block stories and the syntax gallery story are removed Tests: - Only the tests that exist in `main` stay, adapted; the tests this change added are removed for now - The Button visual test, its fixture and its screenshots are the ones from `main`; only the button link moves from `(url)` to `href` - The Banner visual test and its block class are the ones from `main`; they differ only where the component does: the toolbar needs the cursor in the block, the settings open beside the block, and the settings are real, so the test of the demonstration settings is removed - The plugin-banner unit tests are the Banner and Button ones from `main`; the button address moves from `(url)` to `href`, the banner HTML carries `data-files-gallery-exclude`, and the cases of the removed button title, the empty button link and HTML entities in the address are removed - The editor-banner-extension unit tests are the Banner and Button ones from `main`; dimensions are set with `setBannerAttrs`, node attributes are the full banner model, an inserted banner carries its preview content, the button link moves from `(url)` to `href`, and the cases of the removed banner copy command and button title are removed - The demo page-constructor test preloads the constructor once with a longer timeout fix(toolbars): run enabled list menu items from the keyboard feat(forms): export ImageForm feat(view): skip elements with data-files-gallery-exclude in the files gallery feat(viewer): skip elements with data-files-gallery-exclude in FilesGallery and export FILES_GALLERY_EXCLUDE_ATTRIBUTE fix(Button): keep the label color under project link styles docs: agent rules for the banner packages (packages/plugin-banner/AGENTS.md, packages/editor-banner-extension/AGENTS.md) and the root linter warning rule Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Renames the header blocks to banner, split out of #1451 so that PR keeps only the new blocks.
packages/plugin-header→packages/plugin-banner(@gravity-ui/markdown-plugin-banner)packages/editor-header-extension→packages/editor-banner-extension(@gravity-ui/markdown-editor-banner-extension)Markup
:::header→:::banner; exports, CSS classes and custom properties (g-md-banner-*), i18n keyset, actions (insertBanner)Demo stories
stories/header→stories/banner, visual tests and their snapshots renamed to match the new test namesThe settings panel visual test now waits for the markup preview before the width list screenshot; the old snapshot had caught the stale
height="s", so the test was flakyNo behavior changes. Typography (
header-N,subheader-*) and YfmTable header names are not touched. Both packages are still private.🤖 Generated with Claude Code