slack-blocks-to-jsx 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +71 -40
- package/dist/index.d.ts +71 -40
- package/dist/index.js +756 -211
- package/dist/index.mjs +758 -213
- package/dist/style.css +2 -0
- package/package.json +8 -4
- package/readme.md +12 -1
- package/dist/global.css +0 -2
- package/dist/index.css +0 -13
- package/tailwind.config.js +0 -48
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -45,7 +45,7 @@ type CheckboxesElement = {
|
|
|
45
45
|
/**
|
|
46
46
|
* An array of {@link https://api.slack.com/reference/block-kit/composition-objects#option option objects}. A maximum of 10 options are allowed.
|
|
47
47
|
*/
|
|
48
|
-
options:
|
|
48
|
+
options: OptionObjectWithoutUrl[];
|
|
49
49
|
/**
|
|
50
50
|
* An array of {@link https://api.slack.com/reference/block-kit/composition-objects#option option objects} that exactly matches one or more of the options within options. These options will be selected when the checkbox group initially loads.
|
|
51
51
|
*/
|
|
@@ -498,10 +498,10 @@ type ConversationsSelectElement = {
|
|
|
498
498
|
*/
|
|
499
499
|
confirm?: ConfirmDialogObject;
|
|
500
500
|
/**
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
* This field only works with menus in {@link https://api.slack.com/reference/block-kit/blocks#input input blocks} in {@link https://api.slack.com/surfaces/modals modals}.
|
|
502
|
+
|
|
503
|
+
* When set to ***true***, the {@link https://api.slack.com/reference/interaction-payloads/views#view_submission view_submission payload} from the menu's parent view will contain a ***response_url***. This ***response_url*** can be used for {@link https://api.slack.com/interactivity/handling#message_responses message responses}. The target conversation for the message will be determined by the value of this select menu.
|
|
504
|
+
*/
|
|
505
505
|
response_url_enabled?: boolean;
|
|
506
506
|
/**
|
|
507
507
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#filter_conversations filter object} that reduces the list of available conversations using the specified criteria.
|
|
@@ -531,10 +531,10 @@ type ChannelsSelectElement = {
|
|
|
531
531
|
*/
|
|
532
532
|
confirm?: ConfirmDialogObject;
|
|
533
533
|
/**
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
534
|
+
* This field only works with menus in {@link https://api.slack.com/reference/block-kit/blocks#input input blocks} in {@link https://api.slack.com/surfaces/modals modals}.
|
|
535
|
+
|
|
536
|
+
* When set to ***true***, the {@link https://api.slack.com/reference/interaction-payloads/views#view_submission view_submission payload} from the menu's parent view will contain a ***response_url***. This ***response_url*** can be used for {@link https://api.slack.com/interactivity/handling#message_responses message responses}. The target conversation for the message will be determined by the value of this select menu.
|
|
537
|
+
*/
|
|
538
538
|
response_url_enabled?: boolean;
|
|
539
539
|
/**
|
|
540
540
|
* Indicates whether the element will be set to auto focus within the {@link https://api.slack.com/reference/surfaces/views view object}. Only one element can be set to ***true***. Defaults to ***false***.
|
|
@@ -643,12 +643,13 @@ type OptionObject = {
|
|
|
643
643
|
/**
|
|
644
644
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#text ***plain_text***-only text object} that defines a line of descriptive text shown below the ***text*** field beside the radio button. Maximum length for the ***text*** object within this field is 75 characters.
|
|
645
645
|
*/
|
|
646
|
-
description?: TextObject
|
|
646
|
+
description?: TextObject;
|
|
647
647
|
/**
|
|
648
648
|
* A URL to load in the user's browser when the option is clicked. **The url attribute is only available in** {@link https://api.slack.com/reference/block-kit/block-elements#overflow overflow menus}. Maximum length for this field is 3000 characters. If you're using ***url***, you'll still receive an {@link https://api.slack.com/interactivity/handling#payloads interaction payload} and will need to {@link https://api.slack.com/interactivity/handling#acknowledgment_response send an acknowledgement response}.
|
|
649
649
|
*/
|
|
650
650
|
url?: string;
|
|
651
651
|
};
|
|
652
|
+
type OptionObjectWithoutUrl = Omit<OptionObject, "url">;
|
|
652
653
|
type OptionGroupObject = {
|
|
653
654
|
/**
|
|
654
655
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#text plain_text only text object} that defines the label shown above this group of options. Maximum length for the ***text*** in this field is 75 characters.
|
|
@@ -661,20 +662,20 @@ type OptionGroupObject = {
|
|
|
661
662
|
};
|
|
662
663
|
type DispatchActionConfigObject = {
|
|
663
664
|
/**
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
665
|
+
* An array of interaction types that you would like to receive a {@link https://api.slack.com/reference/interaction-payloads/block-actions block_actions payload} for. Should be one or both of:
|
|
666
|
+
|
|
667
|
+
* ***on_enter_pressed*** — payload is dispatched when user presses the enter key while the input is in focus. Hint text will appear underneath the input explaining to the user to press enter to submit.
|
|
668
|
+
|
|
669
|
+
* ***on_character_entered*** — payload is dispatched when a character is entered (or removed) in the input.
|
|
670
|
+
*/
|
|
670
671
|
trigger_actions_on?: string[];
|
|
671
672
|
};
|
|
672
673
|
type FilterObject = {
|
|
673
674
|
/**
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
675
|
+
* Indicates which type of conversations should be included in the list. When this field is provided, any conversations that do not match will be excluded
|
|
676
|
+
|
|
677
|
+
* You should provide an array of strings from the following options: ***im***, ***mpim***, ***private***, and ***public***. The array cannot be empty.
|
|
678
|
+
*/
|
|
678
679
|
include?: string[];
|
|
679
680
|
/**
|
|
680
681
|
* Indicates whether to exclude external {@link https://api.slack.com/enterprise/shared-channels shared channels} from conversation lists. Defaults to ***false***.
|
|
@@ -686,14 +687,15 @@ type FilterObject = {
|
|
|
686
687
|
exclude_bot_users?: boolean;
|
|
687
688
|
};
|
|
688
689
|
|
|
689
|
-
type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock;
|
|
690
|
+
type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock | RichTextBlock;
|
|
690
691
|
type ActionsBlock = {
|
|
691
692
|
/**
|
|
692
693
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
693
694
|
*
|
|
694
|
-
*
|
|
695
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q?cdn_fallback=1&force_cold_boot=1#%7B%22blocks%22:%5B%7B%22type%22:%22actions%22,%22block_id%22:%22actions1%22,%22elements%22:%5B%7B%22type%22:%22static_select%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Which%20witch%20is%20the%20witchiest%20witch?%22%7D,%22action_id%22:%22select_2%22,%22options%22:%5B%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Matilda%22%7D,%22value%22:%22matilda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Glinda%22%7D,%22value%22:%22glinda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Granny%20Weatherwax%22%7D,%22value%22:%22grannyWeatherwax%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Hermione%22%7D,%22value%22:%22hermione%22%7D%5D%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Cancel%22%7D,%22value%22:%22cancel%22,%22action_id%22:%22button_1%22%7D%5D%7D%5D%7D View here}
|
|
696
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#actions View here}
|
|
695
697
|
*
|
|
696
|
-
*
|
|
698
|
+
* A block that is used to hold multiple interactive {@link https://api.slack.com/reference/messaging/block-elements elements}.
|
|
697
699
|
*/
|
|
698
700
|
type: "actions";
|
|
699
701
|
/**
|
|
@@ -709,9 +711,10 @@ type ContextBlock = {
|
|
|
709
711
|
/**
|
|
710
712
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
711
713
|
*
|
|
712
|
-
*
|
|
714
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22image%22,%22image_url%22:%22https://image.freepik.com/free-photo/red-drawing-pin_1156-445.jpg%22,%22alt_text%22:%22images%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22Location:%20*Dogpatch*%22%7D%5D%7D%5D%7D View here}
|
|
715
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#context View here}
|
|
713
716
|
*
|
|
714
|
-
*
|
|
717
|
+
* Displays message context, which can include both images and text.
|
|
715
718
|
*/
|
|
716
719
|
type: "context";
|
|
717
720
|
/**
|
|
@@ -727,9 +730,10 @@ type DividerBlock = {
|
|
|
727
730
|
/**
|
|
728
731
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
729
732
|
*
|
|
730
|
-
*
|
|
733
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22divider%22,%22block_id%22:%22divider1%22%7D%5D%7D View here}
|
|
734
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#divider View here}
|
|
731
735
|
*
|
|
732
|
-
*
|
|
736
|
+
* A content divider, like an ***<hr>***, to split up different blocks inside of a message. The divider block is nice and neat, requiring only a ***type***.
|
|
733
737
|
*/
|
|
734
738
|
type: "divider";
|
|
735
739
|
/**
|
|
@@ -741,11 +745,12 @@ type FileBlock = {
|
|
|
741
745
|
/**
|
|
742
746
|
* Available in surfaces: **Messages**
|
|
743
747
|
*
|
|
748
|
+
* * Example: {@link https://api.slack.com/reference/block-kit/blocks#file_examples View here}
|
|
749
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#file View here}
|
|
750
|
+
*
|
|
744
751
|
* Displays a {@link https://api.slack.com/messaging/files/remote remote file}. You can't add this block to app surfaces directly, but it will show up when {@link https://api.slack.com/messaging/retrieving retrieving messages} that contain remote files.
|
|
745
752
|
*
|
|
746
753
|
* If you want to add remote files to messages, {@link https://api.slack.com/messaging/files/remote follow our guide}.
|
|
747
|
-
*
|
|
748
|
-
* Example: {@link https://api.slack.com/reference/block-kit/blocks#file_examples View here}
|
|
749
754
|
*/
|
|
750
755
|
type: "file";
|
|
751
756
|
/**
|
|
@@ -765,9 +770,10 @@ type HeaderBlock = {
|
|
|
765
770
|
/**
|
|
766
771
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
767
772
|
*
|
|
768
|
-
*
|
|
773
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22type%22:%22home%22,%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Budget%20Performance%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22fields%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Current%20Quarter*%5CnBudget:%20$18,000%20(ends%20in%2053%20days)%5CnSpend:%20$4,289.70%5CnRemain:%20$13,710.30%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Top%20Expense%20Categories*%5Cn:airplane:%20Flights%20%C2%B7%2030%25%5Cn:taxi:%20Taxi%20/%20Uber%20/%20Lyft%20%C2%B7%2024%25%20%5Cn:knife_fork_plate:%20Client%20lunch%20/%20meetings%20%C2%B7%2018%25%22%7D%5D%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/placeholder.png%22,%22alt_text%22:%22placeholder%22%7D%5D%7D,%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Expenses%20Awaiting%20Your%20Approval%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22Submitted%20by%22%7D,%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/profile_3.png%22,%22alt_text%22:%22Dwight%20Schrute%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Dwight%20Schrute*%22%7D%5D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Team%20Lunch%20(Internal)*%5CnCost:%20*$85.50USD*%5CnDate:%20*10/16/2019*%5CnService%20Provider:%20*Honest%20Sandwiches*%20%20%5CnExpense%20no.%20*%3Cfakelink.toUrl.com%7C#1797PD%3E*%22%7D,%22accessory%22:%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/creditcard.png%22,%22alt_text%22:%22credit%20card%22%7D%7D,%7B%22type%22:%22actions%22,%22elements%22:%5B%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%22,%22emoji%22:true%7D,%22style%22:%22primary%22,%22value%22:%22approve%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Decline%22,%22emoji%22:true%7D,%22style%22:%22danger%22,%22value%22:%22decline%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22View%20Details%22,%22emoji%22:true%7D,%22value%22:%22details%22%7D%5D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22Submitted%20by%22%7D,%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/profile_2.png%22,%22alt_text%22:%22Pam%20Beasely%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Pam%20Beasely*%22%7D%5D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Flights%20to%20New%20York*%5CnCost:%20*$520.78USD*%5CnDate:%20*10/18/2019*%5CnService%20Provider:%20*Delta%20Airways*%5CnExpense%20no.%20*%3Cfakelink.toUrl.com%7C#1803PD%3E*%22%7D,%22accessory%22:%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/plane.png%22,%22alt_text%22:%22plane%22%7D%7D,%7B%22type%22:%22actions%22,%22elements%22:%5B%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%22,%22emoji%22:true%7D,%22style%22:%22primary%22,%22value%22:%22approve%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Decline%22,%22emoji%22:true%7D,%22style%22:%22danger%22,%22value%22:%22decline%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22View%20Details%22,%22emoji%22:true%7D,%22value%22:%22details%22%7D%5D%7D%5D%7D View here}
|
|
774
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#header View here}
|
|
769
775
|
*
|
|
770
|
-
*
|
|
776
|
+
* A ***header*** is a plain-text block that displays in a larger, bold font. Use it to delineate between different groups of content in your app's surfaces.
|
|
771
777
|
*/
|
|
772
778
|
type: "header";
|
|
773
779
|
/**
|
|
@@ -783,9 +789,10 @@ type ImageBlock = {
|
|
|
783
789
|
/**
|
|
784
790
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
785
791
|
*
|
|
786
|
-
*
|
|
792
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22image%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Please%20enjoy%20this%20photo%20of%20a%20kitten%22%7D,%22block_id%22:%22image4%22,%22image_url%22:%22http://placekitten.com/500/500%22,%22alt_text%22:%22An%20incredibly%20cute%20kitten.%22%7D%5D%7D View here}
|
|
793
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#image View here}
|
|
787
794
|
*
|
|
788
|
-
*
|
|
795
|
+
* A simple image block, designed to make those cat photos really pop.
|
|
789
796
|
*/
|
|
790
797
|
type: "image";
|
|
791
798
|
/**
|
|
@@ -819,11 +826,12 @@ type InputBlock = {
|
|
|
819
826
|
/**
|
|
820
827
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
821
828
|
*
|
|
829
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Add%20info%20to%20feedback%22,%22emoji%22:true%7D,%22submit%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Save%22,%22emoji%22:true%7D,%22type%22:%22modal%22,%22blocks%22:%5B%7B%22type%22:%22input%22,%22element%22:%7B%22type%22:%22plain_text_input%22%7D,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Label%22,%22emoji%22:true%7D%7D%5D%7D View here}
|
|
830
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#input View here}
|
|
831
|
+
*
|
|
822
832
|
* A block that collects information from users - it can hold a {@link https://api.slack.com/reference/block-kit/block-elements#input plain-text input element}, a {@link https://api.slack.com/reference/block-kit/block-elements#checkboxes checkbox element}, a {@link radio button element}, a {@link https://api.slack.com/reference/block-kit/block-elements#select select menu element}, a {@link https://api.slack.com/reference/block-kit/block-elements#multi_select multi-select menu element}, or a {@link https://api.slack.com/reference/block-kit/block-elements#datepicker datepicker}.
|
|
823
833
|
*
|
|
824
834
|
* Read our guides to collecting input {@link https://api.slack.com/surfaces/modals#gathering_input in modals} or {@link https://api.slack.com/surfaces/tabs/using#gathering_input in Home tabs} to learn how input blocks pass information to your app.
|
|
825
|
-
*
|
|
826
|
-
* Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Add%20info%20to%20feedback%22,%22emoji%22:true%7D,%22submit%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Save%22,%22emoji%22:true%7D,%22type%22:%22modal%22,%22blocks%22:%5B%7B%22type%22:%22input%22,%22element%22:%7B%22type%22:%22plain_text_input%22%7D,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Label%22,%22emoji%22:true%7D%7D%5D%7D View here}
|
|
827
835
|
*/
|
|
828
836
|
type: "input";
|
|
829
837
|
/**
|
|
@@ -855,9 +863,10 @@ type SectionBlock = {
|
|
|
855
863
|
/**
|
|
856
864
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
857
865
|
*
|
|
858
|
-
*
|
|
866
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22text%22:%22*Sally*%20has%20requested%20you%20set%20the%20deadline%20for%20the%20Nano%20launch%20project%22,%22type%22:%22mrkdwn%22%7D,%22accessory%22:%7B%22type%22:%22datepicker%22%7D%7D%5D%7D View here}
|
|
867
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#section View here}
|
|
859
868
|
*
|
|
860
|
-
*
|
|
869
|
+
* A ***section*** is one of the most flexible blocks available - it can be used as a simple text block, in combination with text fields, or side-by-side with any of the available {@link https://api.slack.com/reference/messaging/block-elements block elements}.
|
|
861
870
|
*/
|
|
862
871
|
type: "section";
|
|
863
872
|
/**
|
|
@@ -881,6 +890,9 @@ type VideoBlock = {
|
|
|
881
890
|
/**
|
|
882
891
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
883
892
|
*
|
|
893
|
+
* * Example: {@link https://api.slack.com/reference/block-kit/blocks#video_examples View here}
|
|
894
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#video View here}
|
|
895
|
+
*
|
|
884
896
|
* A ***video*** block is designed to embed videos in all app surfaces (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks! To use the video block within your app, you must have the ***links.embed:write*** scope.
|
|
885
897
|
*
|
|
886
898
|
* Requirements
|
|
@@ -898,8 +910,6 @@ type VideoBlock = {
|
|
|
898
910
|
* - Interactivity (e.g. likes, comments, and reactions) are allowed within your player but shouldn't completely overlay or navigate away from the content being embedded. These interactions will be anonymous since no user data is transferred to the embedded view.
|
|
899
911
|
*
|
|
900
912
|
* The metadata received in the Block payload will be used to construct the description, provider, and title of the video in all clients. Developers have the flexibility to leave non-mandatory fields null and use other blocks to format this content.
|
|
901
|
-
*
|
|
902
|
-
* Example: {@link https://api.slack.com/reference/block-kit/blocks#video_examples View here}
|
|
903
913
|
*/
|
|
904
914
|
type: "video";
|
|
905
915
|
/**
|
|
@@ -943,14 +953,35 @@ type VideoBlock = {
|
|
|
943
953
|
*/
|
|
944
954
|
video_url: string;
|
|
945
955
|
};
|
|
956
|
+
type RichTextBlock = {
|
|
957
|
+
/**
|
|
958
|
+
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
959
|
+
*
|
|
960
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T01HP7H5HME#%7B%22blocks%22:%5B%7B%22type%22:%22rich_text%22,%22elements%22:%5B%7B%22type%22:%22rich_text_section%22,%22elements%22:%5B%7B%22type%22:%22text%22,%22text%22:%22Hello%20there,%20I%20am%20a%20basic%20rich%20text%20block!%22%7D%5D%7D%5D%7D%5D%7D View here}
|
|
961
|
+
*
|
|
962
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#rich_text View here}
|
|
963
|
+
*
|
|
964
|
+
* A ***rich_text*** block is a formatted, structured representation of text. It is the output of the Slack client's WYSIWYG composer, so all messages sent by end-users will have this format. You can use this block to create your own formatted text in Block Kit Builder or include user-defined formatted text in your Block Kit payload. You might encounter ***rich_text*** blocks in message payloads coming from our APIs, as a built-in type in the next-generation Slack platform, or as output of the ***rich_text_input*** block.
|
|
965
|
+
*/
|
|
966
|
+
type: "rich_text";
|
|
967
|
+
};
|
|
946
968
|
|
|
947
969
|
type Props = {
|
|
970
|
+
/**
|
|
971
|
+
* Not yet implemented.
|
|
972
|
+
*/
|
|
948
973
|
theme?: "light" | "dark";
|
|
974
|
+
/**
|
|
975
|
+
* Show a link to open the message in the Slack Block Kit Builder, for debugging purposes. Defaults to false.
|
|
976
|
+
*/
|
|
977
|
+
showBlockKitDebug?: boolean;
|
|
949
978
|
blocks: Block[];
|
|
950
979
|
logo: string;
|
|
951
980
|
name: string;
|
|
952
981
|
time?: Date;
|
|
982
|
+
className?: string;
|
|
983
|
+
style?: React.CSSProperties;
|
|
953
984
|
};
|
|
954
985
|
declare const Message: (props: Props) => JSX.Element;
|
|
955
986
|
|
|
956
|
-
export { Message };
|
|
987
|
+
export { ActionsBlock, Block, ButtonElement, ChannelsSelectElement, CheckboxesElement, ConfirmDialogObject, ContextBlock, ConversationsSelectElement, DatePickerElement, DateTimePickerElement, DispatchActionConfigObject, DividerBlock, Element, EmailInputElement, ExternalSelectElement, FileBlock, FilterObject, HeaderBlock, ImageBlock, ImageElement, InputBlock, Message, MultiChannelsSelectElement, MultiConversationsSelectElement, MultiExternalSelectElement, MultiStaticSelectElement, MultiUsersSelectElement, NumberInputElement, OptionGroupObject, OptionObject, OptionObjectWithoutUrl, OverflowMenuElement, PlainTextInputElement, RadioButtonsElement, RichTextBlock, SectionBlock, StaticSelectElement, Style, TextObject, TextObjectTextType, TimePickerElement, UrlTextInputElement, UsersSelectElement, VideoBlock };
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ type CheckboxesElement = {
|
|
|
45
45
|
/**
|
|
46
46
|
* An array of {@link https://api.slack.com/reference/block-kit/composition-objects#option option objects}. A maximum of 10 options are allowed.
|
|
47
47
|
*/
|
|
48
|
-
options:
|
|
48
|
+
options: OptionObjectWithoutUrl[];
|
|
49
49
|
/**
|
|
50
50
|
* An array of {@link https://api.slack.com/reference/block-kit/composition-objects#option option objects} that exactly matches one or more of the options within options. These options will be selected when the checkbox group initially loads.
|
|
51
51
|
*/
|
|
@@ -498,10 +498,10 @@ type ConversationsSelectElement = {
|
|
|
498
498
|
*/
|
|
499
499
|
confirm?: ConfirmDialogObject;
|
|
500
500
|
/**
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
501
|
+
* This field only works with menus in {@link https://api.slack.com/reference/block-kit/blocks#input input blocks} in {@link https://api.slack.com/surfaces/modals modals}.
|
|
502
|
+
|
|
503
|
+
* When set to ***true***, the {@link https://api.slack.com/reference/interaction-payloads/views#view_submission view_submission payload} from the menu's parent view will contain a ***response_url***. This ***response_url*** can be used for {@link https://api.slack.com/interactivity/handling#message_responses message responses}. The target conversation for the message will be determined by the value of this select menu.
|
|
504
|
+
*/
|
|
505
505
|
response_url_enabled?: boolean;
|
|
506
506
|
/**
|
|
507
507
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#filter_conversations filter object} that reduces the list of available conversations using the specified criteria.
|
|
@@ -531,10 +531,10 @@ type ChannelsSelectElement = {
|
|
|
531
531
|
*/
|
|
532
532
|
confirm?: ConfirmDialogObject;
|
|
533
533
|
/**
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
534
|
+
* This field only works with menus in {@link https://api.slack.com/reference/block-kit/blocks#input input blocks} in {@link https://api.slack.com/surfaces/modals modals}.
|
|
535
|
+
|
|
536
|
+
* When set to ***true***, the {@link https://api.slack.com/reference/interaction-payloads/views#view_submission view_submission payload} from the menu's parent view will contain a ***response_url***. This ***response_url*** can be used for {@link https://api.slack.com/interactivity/handling#message_responses message responses}. The target conversation for the message will be determined by the value of this select menu.
|
|
537
|
+
*/
|
|
538
538
|
response_url_enabled?: boolean;
|
|
539
539
|
/**
|
|
540
540
|
* Indicates whether the element will be set to auto focus within the {@link https://api.slack.com/reference/surfaces/views view object}. Only one element can be set to ***true***. Defaults to ***false***.
|
|
@@ -643,12 +643,13 @@ type OptionObject = {
|
|
|
643
643
|
/**
|
|
644
644
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#text ***plain_text***-only text object} that defines a line of descriptive text shown below the ***text*** field beside the radio button. Maximum length for the ***text*** object within this field is 75 characters.
|
|
645
645
|
*/
|
|
646
|
-
description?: TextObject
|
|
646
|
+
description?: TextObject;
|
|
647
647
|
/**
|
|
648
648
|
* A URL to load in the user's browser when the option is clicked. **The url attribute is only available in** {@link https://api.slack.com/reference/block-kit/block-elements#overflow overflow menus}. Maximum length for this field is 3000 characters. If you're using ***url***, you'll still receive an {@link https://api.slack.com/interactivity/handling#payloads interaction payload} and will need to {@link https://api.slack.com/interactivity/handling#acknowledgment_response send an acknowledgement response}.
|
|
649
649
|
*/
|
|
650
650
|
url?: string;
|
|
651
651
|
};
|
|
652
|
+
type OptionObjectWithoutUrl = Omit<OptionObject, "url">;
|
|
652
653
|
type OptionGroupObject = {
|
|
653
654
|
/**
|
|
654
655
|
* A {@link https://api.slack.com/reference/block-kit/composition-objects#text plain_text only text object} that defines the label shown above this group of options. Maximum length for the ***text*** in this field is 75 characters.
|
|
@@ -661,20 +662,20 @@ type OptionGroupObject = {
|
|
|
661
662
|
};
|
|
662
663
|
type DispatchActionConfigObject = {
|
|
663
664
|
/**
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
665
|
+
* An array of interaction types that you would like to receive a {@link https://api.slack.com/reference/interaction-payloads/block-actions block_actions payload} for. Should be one or both of:
|
|
666
|
+
|
|
667
|
+
* ***on_enter_pressed*** — payload is dispatched when user presses the enter key while the input is in focus. Hint text will appear underneath the input explaining to the user to press enter to submit.
|
|
668
|
+
|
|
669
|
+
* ***on_character_entered*** — payload is dispatched when a character is entered (or removed) in the input.
|
|
670
|
+
*/
|
|
670
671
|
trigger_actions_on?: string[];
|
|
671
672
|
};
|
|
672
673
|
type FilterObject = {
|
|
673
674
|
/**
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
675
|
+
* Indicates which type of conversations should be included in the list. When this field is provided, any conversations that do not match will be excluded
|
|
676
|
+
|
|
677
|
+
* You should provide an array of strings from the following options: ***im***, ***mpim***, ***private***, and ***public***. The array cannot be empty.
|
|
678
|
+
*/
|
|
678
679
|
include?: string[];
|
|
679
680
|
/**
|
|
680
681
|
* Indicates whether to exclude external {@link https://api.slack.com/enterprise/shared-channels shared channels} from conversation lists. Defaults to ***false***.
|
|
@@ -686,14 +687,15 @@ type FilterObject = {
|
|
|
686
687
|
exclude_bot_users?: boolean;
|
|
687
688
|
};
|
|
688
689
|
|
|
689
|
-
type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock;
|
|
690
|
+
type Block = ActionsBlock | ContextBlock | DividerBlock | FileBlock | HeaderBlock | ImageBlock | InputBlock | SectionBlock | VideoBlock | RichTextBlock;
|
|
690
691
|
type ActionsBlock = {
|
|
691
692
|
/**
|
|
692
693
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
693
694
|
*
|
|
694
|
-
*
|
|
695
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q?cdn_fallback=1&force_cold_boot=1#%7B%22blocks%22:%5B%7B%22type%22:%22actions%22,%22block_id%22:%22actions1%22,%22elements%22:%5B%7B%22type%22:%22static_select%22,%22placeholder%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Which%20witch%20is%20the%20witchiest%20witch?%22%7D,%22action_id%22:%22select_2%22,%22options%22:%5B%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Matilda%22%7D,%22value%22:%22matilda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Glinda%22%7D,%22value%22:%22glinda%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Granny%20Weatherwax%22%7D,%22value%22:%22grannyWeatherwax%22%7D,%7B%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Hermione%22%7D,%22value%22:%22hermione%22%7D%5D%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Cancel%22%7D,%22value%22:%22cancel%22,%22action_id%22:%22button_1%22%7D%5D%7D%5D%7D View here}
|
|
696
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#actions View here}
|
|
695
697
|
*
|
|
696
|
-
*
|
|
698
|
+
* A block that is used to hold multiple interactive {@link https://api.slack.com/reference/messaging/block-elements elements}.
|
|
697
699
|
*/
|
|
698
700
|
type: "actions";
|
|
699
701
|
/**
|
|
@@ -709,9 +711,10 @@ type ContextBlock = {
|
|
|
709
711
|
/**
|
|
710
712
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
711
713
|
*
|
|
712
|
-
*
|
|
714
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22image%22,%22image_url%22:%22https://image.freepik.com/free-photo/red-drawing-pin_1156-445.jpg%22,%22alt_text%22:%22images%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22Location:%20*Dogpatch*%22%7D%5D%7D%5D%7D View here}
|
|
715
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#context View here}
|
|
713
716
|
*
|
|
714
|
-
*
|
|
717
|
+
* Displays message context, which can include both images and text.
|
|
715
718
|
*/
|
|
716
719
|
type: "context";
|
|
717
720
|
/**
|
|
@@ -727,9 +730,10 @@ type DividerBlock = {
|
|
|
727
730
|
/**
|
|
728
731
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
729
732
|
*
|
|
730
|
-
*
|
|
733
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22divider%22,%22block_id%22:%22divider1%22%7D%5D%7D View here}
|
|
734
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#divider View here}
|
|
731
735
|
*
|
|
732
|
-
*
|
|
736
|
+
* A content divider, like an ***<hr>***, to split up different blocks inside of a message. The divider block is nice and neat, requiring only a ***type***.
|
|
733
737
|
*/
|
|
734
738
|
type: "divider";
|
|
735
739
|
/**
|
|
@@ -741,11 +745,12 @@ type FileBlock = {
|
|
|
741
745
|
/**
|
|
742
746
|
* Available in surfaces: **Messages**
|
|
743
747
|
*
|
|
748
|
+
* * Example: {@link https://api.slack.com/reference/block-kit/blocks#file_examples View here}
|
|
749
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#file View here}
|
|
750
|
+
*
|
|
744
751
|
* Displays a {@link https://api.slack.com/messaging/files/remote remote file}. You can't add this block to app surfaces directly, but it will show up when {@link https://api.slack.com/messaging/retrieving retrieving messages} that contain remote files.
|
|
745
752
|
*
|
|
746
753
|
* If you want to add remote files to messages, {@link https://api.slack.com/messaging/files/remote follow our guide}.
|
|
747
|
-
*
|
|
748
|
-
* Example: {@link https://api.slack.com/reference/block-kit/blocks#file_examples View here}
|
|
749
754
|
*/
|
|
750
755
|
type: "file";
|
|
751
756
|
/**
|
|
@@ -765,9 +770,10 @@ type HeaderBlock = {
|
|
|
765
770
|
/**
|
|
766
771
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
767
772
|
*
|
|
768
|
-
*
|
|
773
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22type%22:%22home%22,%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Budget%20Performance%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22section%22,%22fields%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Current%20Quarter*%5CnBudget:%20$18,000%20(ends%20in%2053%20days)%5CnSpend:%20$4,289.70%5CnRemain:%20$13,710.30%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Top%20Expense%20Categories*%5Cn:airplane:%20Flights%20%C2%B7%2030%25%5Cn:taxi:%20Taxi%20/%20Uber%20/%20Lyft%20%C2%B7%2024%25%20%5Cn:knife_fork_plate:%20Client%20lunch%20/%20meetings%20%C2%B7%2018%25%22%7D%5D%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/placeholder.png%22,%22alt_text%22:%22placeholder%22%7D%5D%7D,%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Expenses%20Awaiting%20Your%20Approval%22%7D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22Submitted%20by%22%7D,%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/profile_3.png%22,%22alt_text%22:%22Dwight%20Schrute%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Dwight%20Schrute*%22%7D%5D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Team%20Lunch%20(Internal)*%5CnCost:%20*$85.50USD*%5CnDate:%20*10/16/2019*%5CnService%20Provider:%20*Honest%20Sandwiches*%20%20%5CnExpense%20no.%20*%3Cfakelink.toUrl.com%7C#1797PD%3E*%22%7D,%22accessory%22:%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/creditcard.png%22,%22alt_text%22:%22credit%20card%22%7D%7D,%7B%22type%22:%22actions%22,%22elements%22:%5B%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%22,%22emoji%22:true%7D,%22style%22:%22primary%22,%22value%22:%22approve%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Decline%22,%22emoji%22:true%7D,%22style%22:%22danger%22,%22value%22:%22decline%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22View%20Details%22,%22emoji%22:true%7D,%22value%22:%22details%22%7D%5D%7D,%7B%22type%22:%22divider%22%7D,%7B%22type%22:%22context%22,%22elements%22:%5B%7B%22type%22:%22mrkdwn%22,%22text%22:%22Submitted%20by%22%7D,%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/profile_2.png%22,%22alt_text%22:%22Pam%20Beasely%22%7D,%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Pam%20Beasely*%22%7D%5D%7D,%7B%22type%22:%22section%22,%22text%22:%7B%22type%22:%22mrkdwn%22,%22text%22:%22*Flights%20to%20New%20York*%5CnCost:%20*$520.78USD*%5CnDate:%20*10/18/2019*%5CnService%20Provider:%20*Delta%20Airways*%5CnExpense%20no.%20*%3Cfakelink.toUrl.com%7C#1803PD%3E*%22%7D,%22accessory%22:%7B%22type%22:%22image%22,%22image_url%22:%22https://api.slack.com/img/blocks/bkb_template_images/plane.png%22,%22alt_text%22:%22plane%22%7D%7D,%7B%22type%22:%22actions%22,%22elements%22:%5B%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Approve%22,%22emoji%22:true%7D,%22style%22:%22primary%22,%22value%22:%22approve%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Decline%22,%22emoji%22:true%7D,%22style%22:%22danger%22,%22value%22:%22decline%22%7D,%7B%22type%22:%22button%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22View%20Details%22,%22emoji%22:true%7D,%22value%22:%22details%22%7D%5D%7D%5D%7D View here}
|
|
774
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#header View here}
|
|
769
775
|
*
|
|
770
|
-
*
|
|
776
|
+
* A ***header*** is a plain-text block that displays in a larger, bold font. Use it to delineate between different groups of content in your app's surfaces.
|
|
771
777
|
*/
|
|
772
778
|
type: "header";
|
|
773
779
|
/**
|
|
@@ -783,9 +789,10 @@ type ImageBlock = {
|
|
|
783
789
|
/**
|
|
784
790
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
785
791
|
*
|
|
786
|
-
*
|
|
792
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22image%22,%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Please%20enjoy%20this%20photo%20of%20a%20kitten%22%7D,%22block_id%22:%22image4%22,%22image_url%22:%22http://placekitten.com/500/500%22,%22alt_text%22:%22An%20incredibly%20cute%20kitten.%22%7D%5D%7D View here}
|
|
793
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#image View here}
|
|
787
794
|
*
|
|
788
|
-
*
|
|
795
|
+
* A simple image block, designed to make those cat photos really pop.
|
|
789
796
|
*/
|
|
790
797
|
type: "image";
|
|
791
798
|
/**
|
|
@@ -819,11 +826,12 @@ type InputBlock = {
|
|
|
819
826
|
/**
|
|
820
827
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
821
828
|
*
|
|
829
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Add%20info%20to%20feedback%22,%22emoji%22:true%7D,%22submit%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Save%22,%22emoji%22:true%7D,%22type%22:%22modal%22,%22blocks%22:%5B%7B%22type%22:%22input%22,%22element%22:%7B%22type%22:%22plain_text_input%22%7D,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Label%22,%22emoji%22:true%7D%7D%5D%7D View here}
|
|
830
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#input View here}
|
|
831
|
+
*
|
|
822
832
|
* A block that collects information from users - it can hold a {@link https://api.slack.com/reference/block-kit/block-elements#input plain-text input element}, a {@link https://api.slack.com/reference/block-kit/block-elements#checkboxes checkbox element}, a {@link radio button element}, a {@link https://api.slack.com/reference/block-kit/block-elements#select select menu element}, a {@link https://api.slack.com/reference/block-kit/block-elements#multi_select multi-select menu element}, or a {@link https://api.slack.com/reference/block-kit/block-elements#datepicker datepicker}.
|
|
823
833
|
*
|
|
824
834
|
* Read our guides to collecting input {@link https://api.slack.com/surfaces/modals#gathering_input in modals} or {@link https://api.slack.com/surfaces/tabs/using#gathering_input in Home tabs} to learn how input blocks pass information to your app.
|
|
825
|
-
*
|
|
826
|
-
* Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22title%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Add%20info%20to%20feedback%22,%22emoji%22:true%7D,%22submit%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Save%22,%22emoji%22:true%7D,%22type%22:%22modal%22,%22blocks%22:%5B%7B%22type%22:%22input%22,%22element%22:%7B%22type%22:%22plain_text_input%22%7D,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Label%22,%22emoji%22:true%7D%7D%5D%7D View here}
|
|
827
835
|
*/
|
|
828
836
|
type: "input";
|
|
829
837
|
/**
|
|
@@ -855,9 +863,10 @@ type SectionBlock = {
|
|
|
855
863
|
/**
|
|
856
864
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
857
865
|
*
|
|
858
|
-
*
|
|
866
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T0385D58J4Q#%7B%22blocks%22:%5B%7B%22type%22:%22section%22,%22text%22:%7B%22text%22:%22*Sally*%20has%20requested%20you%20set%20the%20deadline%20for%20the%20Nano%20launch%20project%22,%22type%22:%22mrkdwn%22%7D,%22accessory%22:%7B%22type%22:%22datepicker%22%7D%7D%5D%7D View here}
|
|
867
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#section View here}
|
|
859
868
|
*
|
|
860
|
-
*
|
|
869
|
+
* A ***section*** is one of the most flexible blocks available - it can be used as a simple text block, in combination with text fields, or side-by-side with any of the available {@link https://api.slack.com/reference/messaging/block-elements block elements}.
|
|
861
870
|
*/
|
|
862
871
|
type: "section";
|
|
863
872
|
/**
|
|
@@ -881,6 +890,9 @@ type VideoBlock = {
|
|
|
881
890
|
/**
|
|
882
891
|
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
883
892
|
*
|
|
893
|
+
* * Example: {@link https://api.slack.com/reference/block-kit/blocks#video_examples View here}
|
|
894
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#video View here}
|
|
895
|
+
*
|
|
884
896
|
* A ***video*** block is designed to embed videos in all app surfaces (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks! To use the video block within your app, you must have the ***links.embed:write*** scope.
|
|
885
897
|
*
|
|
886
898
|
* Requirements
|
|
@@ -898,8 +910,6 @@ type VideoBlock = {
|
|
|
898
910
|
* - Interactivity (e.g. likes, comments, and reactions) are allowed within your player but shouldn't completely overlay or navigate away from the content being embedded. These interactions will be anonymous since no user data is transferred to the embedded view.
|
|
899
911
|
*
|
|
900
912
|
* The metadata received in the Block payload will be used to construct the description, provider, and title of the video in all clients. Developers have the flexibility to leave non-mandatory fields null and use other blocks to format this content.
|
|
901
|
-
*
|
|
902
|
-
* Example: {@link https://api.slack.com/reference/block-kit/blocks#video_examples View here}
|
|
903
913
|
*/
|
|
904
914
|
type: "video";
|
|
905
915
|
/**
|
|
@@ -943,14 +953,35 @@ type VideoBlock = {
|
|
|
943
953
|
*/
|
|
944
954
|
video_url: string;
|
|
945
955
|
};
|
|
956
|
+
type RichTextBlock = {
|
|
957
|
+
/**
|
|
958
|
+
* Available in surfaces: **Modals**, **Messages**, **Home tabs**
|
|
959
|
+
*
|
|
960
|
+
* * Example: {@link https://app.slack.com/block-kit-builder/T01HP7H5HME#%7B%22blocks%22:%5B%7B%22type%22:%22rich_text%22,%22elements%22:%5B%7B%22type%22:%22rich_text_section%22,%22elements%22:%5B%7B%22type%22:%22text%22,%22text%22:%22Hello%20there,%20I%20am%20a%20basic%20rich%20text%20block!%22%7D%5D%7D%5D%7D%5D%7D View here}
|
|
961
|
+
*
|
|
962
|
+
* * Docs: {@link https://api.slack.com/reference/block-kit/blocks#rich_text View here}
|
|
963
|
+
*
|
|
964
|
+
* A ***rich_text*** block is a formatted, structured representation of text. It is the output of the Slack client's WYSIWYG composer, so all messages sent by end-users will have this format. You can use this block to create your own formatted text in Block Kit Builder or include user-defined formatted text in your Block Kit payload. You might encounter ***rich_text*** blocks in message payloads coming from our APIs, as a built-in type in the next-generation Slack platform, or as output of the ***rich_text_input*** block.
|
|
965
|
+
*/
|
|
966
|
+
type: "rich_text";
|
|
967
|
+
};
|
|
946
968
|
|
|
947
969
|
type Props = {
|
|
970
|
+
/**
|
|
971
|
+
* Not yet implemented.
|
|
972
|
+
*/
|
|
948
973
|
theme?: "light" | "dark";
|
|
974
|
+
/**
|
|
975
|
+
* Show a link to open the message in the Slack Block Kit Builder, for debugging purposes. Defaults to false.
|
|
976
|
+
*/
|
|
977
|
+
showBlockKitDebug?: boolean;
|
|
949
978
|
blocks: Block[];
|
|
950
979
|
logo: string;
|
|
951
980
|
name: string;
|
|
952
981
|
time?: Date;
|
|
982
|
+
className?: string;
|
|
983
|
+
style?: React.CSSProperties;
|
|
953
984
|
};
|
|
954
985
|
declare const Message: (props: Props) => JSX.Element;
|
|
955
986
|
|
|
956
|
-
export { Message };
|
|
987
|
+
export { ActionsBlock, Block, ButtonElement, ChannelsSelectElement, CheckboxesElement, ConfirmDialogObject, ContextBlock, ConversationsSelectElement, DatePickerElement, DateTimePickerElement, DispatchActionConfigObject, DividerBlock, Element, EmailInputElement, ExternalSelectElement, FileBlock, FilterObject, HeaderBlock, ImageBlock, ImageElement, InputBlock, Message, MultiChannelsSelectElement, MultiConversationsSelectElement, MultiExternalSelectElement, MultiStaticSelectElement, MultiUsersSelectElement, NumberInputElement, OptionGroupObject, OptionObject, OptionObjectWithoutUrl, OverflowMenuElement, PlainTextInputElement, RadioButtonsElement, RichTextBlock, SectionBlock, StaticSelectElement, Style, TextObject, TextObjectTextType, TimePickerElement, UrlTextInputElement, UsersSelectElement, VideoBlock };
|