Releases: jeremeamia/slack-block-kit
Releases · jeremeamia/slack-block-kit
v0.16.0
v0.15.0
- Added
Message::fallbackText()for setting the legacy"text"property on a message.- This property is useful in Block Kit as a fallback when a message is displayed in a context where Block Kit is not (yet) supported.
- Added
Message::asPreviewableMessage()to convert an existingMessageobject to one compatible withKit::preview().
v0.14.0
- Added new
Formatterclass that provides several helper methods for Slack's mrkdwn features. - Added
Attachment::asMessage()to be able to quickly create a message wrapper for an attachment. - Added new
Configclass that provides a way to set the defaultverbatimandemojiarguments fortextelements. - Updated the
Kitfaçade to include the ability to access singleton instances ofFormatterandConfig. - Updated all
MrkdwnTextgenerating functions to to make the$verbatimargumentnullby default. - Updated all
textelements to defer theirverbatimandemojivalues (ifnull) to what is set in theKit'sConfig. - Updated
Kitto move Block Kit Builder preview functionality into a newPreviewerclass (still accessible viaKit::preview()).
Kit::config()->setDefaultVerbatimSetting(false);
$f = Kit::formatter();
$msg = Kit::newMessage()->text(<<<MRKDWN
{$f->escape('<&>')}
{$f->bold('hello')} world
{$f->italic('hello')} world
{$f->strike('hello')} world
{$f->code('hello')} world
{$f->blockQuote("this\nis\na\nblockquote")}
{$f->codeBlock("this\nis\na\ncode block")}
{$f->bulletedList(['this', 'is', 'a', 'bulleted list'])}
{$f->numberedList(['this', 'is', 'a', 'numbered list'])}
Today is {$f->date(time(), Formatter::DATE_LONG)}
Link: {$f->link('http://google.com', 'Google')}
MailTo: {$f->emailLink('jeremy@example.org', 'Email Jeremy')}
Join {$f->channel('general')}
Talk to {$f->user('jeremy.lindblom')}
Talk to {$f->userGroup('devs')}
Hey {$f->atHere()}
Hey {$f->atChannel()}
Hey {$f->atEveryone()}
MRKDWN);
$url = Kit::preview($msg);v0.13.1
- Added missing
fileblock element (needed for hydration). - Added missing shortcut
header()method for surfaces to add aheaderelement.
v0.13.0
- (BC) Raised minimum PHP version to PHP 7.3.
- (BC) Renamed
Slackclass toKit. - (BC) Removed the
Rendererinterface and allRenderersimplementations and factories.- You can use the new
Kit::preview()orElement::toJson(true)to replace theKitBuilderandJsonrenderers, respectively.
- You can use the new
- (Deprecated) Marked
MultiSelectMenu::setMaxSelectedItems()as deprecated in favor ofMultiSelectMenu::maxSelectedItems(). - ⭐ Added support for element/surface hydration from JSON data to object (e.g.,
Message::fromArray()). - Added
Element::fromJson()andElement::toJson()as convenience wrappers offromArray()andtoArray(). - Added support for the missing
headerblock element. - Added support for the
filterproperty of conversation select menus. - Added
Kit::preview()method to generate a link to the interactive Block Kit Builder containing the surface's content for preview. - Added
Type::mapType()method for looking up a type's class. - Added
MultiSelectMenu::maxSelectedItems()to match desired convention. - Added some additional setters on elements (e.g.,
addOptionGroup()) to assist with hydration implementation. - Fixed
PlainTextclass to only includeemojiproperty is explicitly set. - Fixed some return types, including in doc-blocks (e.g.,
@return self->@return static).
v0.12.0
- Added support for the
Attachmentsurface which can exist inside aMessage. - Added support for adding attachments to messages.
- Updated
KitRendererto use new the Block Kit Builder URL format. - Added a new, standalone
OptionListelement, which can be used as a response to ablock_suggestionrequest.
v0.11.0
- Added the
Element::tap()method, which allows for an improved fluent interface in some cases. You can pass a closure for modifying the element, but still return the original element.
v0.10.1
- Fixed
Message::$directivesproperty to have a default value of[].
v0.10.0
- Added support for the new
timepickerinput element. - Added support for the
workflow_stepsurface (a special case ofmodal). - Updated
Messageclass to:- Support additional directives like
replace_originalanddelete_original - Only include
response_typewhen explicitly configured.
- Support additional directives like
v0.9.0
HasOptionshas new ways to add options, including initial options. Also has validations for initial options.- New
OptionsConfigclass to help parameterizeHasOptionsbehavior. - Adds
setExtrato baseElementobject to allow for patching on new Slack features in a non-conflicting way prior to the library being updated. - Adds some missing/new fields to some menus.