Skip to content

Releases: jeremeamia/slack-block-kit

v0.16.0

02 Mar 21:10
Compare
Choose a tag to compare
  • Updated HasOptions::options() and HasOptions::initialOptions() to support an indexed array.
    • Values are used for both the Options' text and value in this case.

v0.15.0

04 Feb 18:20
Compare
Choose a tag to compare
  • 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 existing Message object to one compatible with Kit::preview().

v0.14.0

05 Jan 18:24
9081400
Compare
Choose a tag to compare
  • Added new Formatter class 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 Config class that provides a way to set the default verbatim and emoji arguments for text elements.
  • Updated the Kit façade to include the ability to access singleton instances of Formatter and Config.
  • Updated all MrkdwnText generating functions to to make the $verbatim argument null by default.
  • Updated all text elements to defer their verbatim and emoji values (if null) to what is set in the Kit's Config.
  • Updated Kit to move Block Kit Builder preview functionality into a new Previewer class (still accessible via Kit::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

12 Dec 03:34
Compare
Choose a tag to compare
  • Added missing file block element (needed for hydration).
  • Added missing shortcut header() method for surfaces to add a header element.

v0.13.0

03 Dec 16:58
Compare
Choose a tag to compare
  • (BC) Raised minimum PHP version to PHP 7.3.
  • (BC) Renamed Slack class to Kit.
  • (BC) Removed the Renderer interface and all Renderers implementations and factories.
    • You can use the new Kit::preview() or Element::toJson(true) to replace the KitBuilder and Json renderers, respectively.
  • (Deprecated) Marked MultiSelectMenu::setMaxSelectedItems() as deprecated in favor of MultiSelectMenu::maxSelectedItems().
  • ⭐ Added support for element/surface hydration from JSON data to object (e.g., Message::fromArray()).
  • Added Element::fromJson() and Element::toJson() as convenience wrappers of fromArray() and toArray().
  • Added support for the missing header block element.
  • Added support for the filter property 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 PlainText class to only include emoji property is explicitly set.
  • Fixed some return types, including in doc-blocks (e.g., @return self -> @return static).

v0.12.0

23 Nov 04:17
3267a8b
Compare
Choose a tag to compare
  • Added support for the Attachment surface which can exist inside a Message.
  • Added support for adding attachments to messages.
  • Updated KitRenderer to use new the Block Kit Builder URL format.
  • Added a new, standalone OptionList element, which can be used as a response to a block_suggestion request.

v0.11.0

19 Nov 02:41
Compare
Choose a tag to compare
  • 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

19 Nov 00:50
Compare
Choose a tag to compare
  • Fixed Message::$directives property to have a default value of [].

v0.10.0

09 Nov 16:45
a52e8c1
Compare
Choose a tag to compare
  • Added support for the new timepicker input element.
  • Added support for the workflow_step surface (a special case of modal).
  • Updated Message class to:
    • Support additional directives like replace_original and delete_original
    • Only include response_type when explicitly configured.

v0.9.0

30 Sep 16:14
39b4898
Compare
Choose a tag to compare
v0.9.0 Pre-release
Pre-release
  • HasOptions has new ways to add options, including initial options. Also has validations for initial options.
  • New OptionsConfig class to help parameterize HasOptions behavior.
  • Adds setExtra to base Element object 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.