Skip to content

Introduce Rich Text, Markdown, and Table Blocks & new Elements#140

Open
udivankin wants to merge 5 commits intoraycharius:mainfrom
udivankin:main
Open

Introduce Rich Text, Markdown, and Table Blocks & new Elements#140
udivankin wants to merge 5 commits intoraycharius:mainfrom
udivankin:main

Conversation

@udivankin
Copy link
Copy Markdown

Introduce Rich Text, Markdown, Table, and New Elements Support

Description of Changes

This pull request significantly updates the library by integrating comprehensive support for modern Slack Block Kit features, including Rich Text, a dedicated Markdown block, the new Table block, and several new interactive elements.


New Block Kit Components

Blocks Introduced

The following top-level block components are now supported:

  • RichText (Blocks.RichText()): Used to display formatted, structured text, typically the output of Slack's WYSIWYG message composer.
  • Markdown (Blocks.Markdown()): A dedicated block type for rendering Slack-flavored Markdown text.
  • Table (Blocks.Table()): Allows for the display of grid data, using Rich Text sections for cell content.
    • Constraint: Table cells strictly support RichTextSection elements only.
  • ContextActions (Blocks.ContextActions()): A block designed to hold related interactive elements, specifically FeedbackButtons or IconButton.

Rich Text Composition Objects (Bits)

A full suite of composition objects for building Rich Text content is now available via the Bits namespace:

Composition Object Builder/Accessor Description
Rich Text Section Bits.RichTextSection() A container for inline rich text elements.
Rich Text List Bits.RichTextList() Supports bulleted (bullet) or ordered (ordered) lists.
Rich Text Quote Bits.RichTextQuote() For displaying quoted text.
Rich Text Preformatted Bits.RichTextPreformatted() For multi-line code blocks.
Rich Text Text Bits.RichTextText() Plain text content within a rich text container.
Rich Text Emoji Bits.RichTextEmoji() Inserts emoji using a name (e.g., 'wave') or Unicode value.
Rich Text Link Bits.RichTextLink() Inserts a hyperlink.
Rich Text User Bits.RichTextUser() Creates a user mention (e.g., @user).
Rich Text Channel Bits.RichTextChannel() Creates a channel mention (e.g., #channel).
Rich Text Usergroup Bits.RichTextUsergroup() Creates a usergroup mention (e.g., @usergroup).
Rich Text Broadcast Bits.RichTextBroadcast() Creates mentions like @here, @channel, or @everyone.
Rich Text Date Bits.RichTextDate() For creating formatted date/time elements.
Rich Text Color Bits.RichTextColor() For applying a hex color value to text.
Rich Text Team Bits.RichTextTeam() For mentioning a team/workspace.

New Interactive Elements

The following interactive and contextual elements are introduced:

  • RichTextInput (Elements.RichTextInput()): A dedicated input element for capturing rich, formatted text, supporting initial values and dispatch configuration.
  • WorkflowButton (Elements.WorkflowButton()): A button that triggers a Slack Workflow when clicked.
  • IconButton (Elements.IconButton()): A compact, icon-only button, often used in conjunction with ContextActions.
  • FeedbackButtons (Elements.FeedbackButtons()): A specialized element offering positive/negative feedback buttons (e.g., "Thumbs Up"/"Thumbs Down") for the AI assistants.

Technical Updates

  • Dependency Updates: All existing internal and external references to Slack API documentation links (https://api.slack.com/) have been updated to the current standard format (https://docs.slack.dev/).
  • New Constants: New enums for RichTextElementType and updated BlockType and ElementType constants were introduced to manage the new components.

Introduces support for Slack's rich text blocks and elements, including new Bits (RichTextSection, RichTextList, RichTextQuote, RichTextPreformatted, RichTextText, RichTextEmoji, RichTextLink, RichTextUser, RichTextChannel, RichTextUsergroup, RichTextBroadcast, RichTextDate, RichTextColor, RichTextTeam), Blocks (RichText, Markdown, Table, ContextActions), and Elements (WorkflowButton, IconButton, FeedbackButtons, RichTextInput). Updates documentation, constants, and tests to cover all new features and objects.
Replaces all references to api.slack.com in documentation and source code with docs.slack.dev, ensuring all links point to the new Slack API documentation domain.
Replaces outdated Slack Block Kit documentation URLs with current, more specific links throughout bits, blocks, and elements modules.
…text element properties, and add related validations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant