Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rich_text_input block payload support #1963

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@slack/logger": "^4.0.0",
"@slack/oauth": "^2.6.1",
"@slack/socket-mode": "^1.3.2",
"@slack/types": "^2.8.0",
"@slack/types": "^2.9.0",
"@slack/web-api": "^6.7.1",
"@types/express": "^4.16.1",
"@types/promise.allsettled": "^1.0.3",
Expand Down
14 changes: 11 additions & 3 deletions src/types/actions/block-action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PlainTextElement, Confirmation, Option } from '@slack/types';
import { PlainTextElement, Confirmation, Option, RichTextBlock } from '@slack/types';
import { StringIndexed } from '../helpers';
import { ViewOutput, ViewStateValue } from '../view';

Expand All @@ -24,7 +24,8 @@ export type BlockElementAction =
| TimepickerAction
| RadioButtonsAction
| CheckboxesAction
| PlainTextInputAction;
| PlainTextInputAction
| RichTextInputAction;

/**
* Any action from Slack's interactive elements
Expand Down Expand Up @@ -207,12 +208,19 @@ export interface CheckboxesAction extends BasicElementAction<'checkboxes'> {
}

/**
* An action from a plain_text_input element (must use dispatch_action: true)
* An action from a plain_text_input element (must use dispatch_action: true)
*/
export interface PlainTextInputAction extends BasicElementAction<'plain_text_input'> {
value: string;
}

/**
* An action from a rich_text_input element (must use dispatch_action: true)
*/
export interface RichTextInputAction extends BasicElementAction<'rich_text_input'> {
rich_text_value: RichTextBlock;
}

/**
* A Slack Block Kit element action wrapped in the standard metadata.
*
Expand Down
3 changes: 2 additions & 1 deletion src/types/view/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, KnownBlock, PlainTextElement, View } from '@slack/types';
import { Block, KnownBlock, PlainTextElement, RichTextBlock, View } from '@slack/types';
import { AckFn, RespondFn } from '../utilities';

/**
Expand Down Expand Up @@ -143,6 +143,7 @@ export interface ViewStateValue {
selected_channels?: string[];
selected_users?: string[];
selected_options?: ViewStateSelectedOption[];
rich_text_value?: RichTextBlock;
}

export interface ViewOutput {
Expand Down