slack-ruby-block-kit 0.18.0 → 0.19.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +4 -3
- data/.gitignore +2 -1
- data/.rubocop.yml +4 -1
- data/CHANGELOG.md +13 -2
- data/Gemfile.lock +1 -1
- data/lib/slack/block_kit/blocks.rb +13 -0
- data/lib/slack/block_kit/layout/video.rb +51 -0
- data/lib/slack/block_kit/version.rb +1 -1
- data/lib/slack/surfaces/modal.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 122d7e0273762e60628682a4874b0c5c148312b3cc62e9659c0c42dff2f200d6
|
4
|
+
data.tar.gz: c5d1685745d2bf0bc12813e96ecd14c87a1a21fad9d81c27a29dac243891b1a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6e9df8d14a98baff1b3783c159527277d9e25d61f8fd68ff113d2449ad447611f80d1b023950733c1d159345d3359f6fe08c6bd70254b085ffbfa77613abd97b
|
7
|
+
data.tar.gz: 3cd7a5724578d354345bfbe11014c37f8ce4d2515c59bfe2cfdd139aaee4fa8bd71418811abe59500c0bac3950d14bf91891053c247144df0d76b9f70142f165
|
@@ -16,9 +16,10 @@ jobs:
|
|
16
16
|
- uses: ruby/setup-ruby@v1
|
17
17
|
with:
|
18
18
|
ruby-version: 2.7
|
19
|
-
-
|
20
|
-
|
21
|
-
|
19
|
+
- name: Mask OTP
|
20
|
+
run: |
|
21
|
+
OTP=$(jq -r '.inputs.otp' $GITHUB_EVENT_PATH)
|
22
|
+
echo "::add-mask::$OTP"
|
22
23
|
- run: gem update --system
|
23
24
|
- run: git config --global user.email github-action@users.noreply.github.com
|
24
25
|
- run: git config --global user.name GitHub Actions
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -25,6 +25,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
25
25
|
### Security
|
26
26
|
- N/A
|
27
27
|
|
28
|
+
## [0.19.0] - 2022-09-05
|
29
|
+
|
30
|
+
### Added
|
31
|
+
- Added `Slack::BlockKit::Layout::Video` (#152 by @jcat4)
|
32
|
+
|
33
|
+
This adds support for Slack's new Video Block.
|
34
|
+
|
35
|
+
See: https://api.slack.com/reference/block-kit/blocks#video
|
36
|
+
|
37
|
+
|
28
38
|
## [0.18.0] - 2022-08-26
|
29
39
|
|
30
40
|
### Added
|
@@ -125,8 +135,9 @@ This release contains a breaking change on the `Layout::Actions` interface.
|
|
125
135
|
- Fixed initial options in multi select blocks (#46 by @caalberts)
|
126
136
|
|
127
137
|
|
128
|
-
[Unreleased]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.
|
129
|
-
[0.
|
138
|
+
[Unreleased]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.19.0...HEAD
|
139
|
+
[0.19.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.18.0...v0.19.0
|
140
|
+
[0.18.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.17.0...v0.18.0
|
130
141
|
[0.17.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.16.0...v0.17.0
|
131
142
|
[0.16.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.15.0...v0.16.0
|
132
143
|
[0.15.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.14.1...v0.15.0
|
data/Gemfile.lock
CHANGED
@@ -55,6 +55,19 @@ module Slack
|
|
55
55
|
append(block)
|
56
56
|
end
|
57
57
|
|
58
|
+
def video(alt_text:, thumbnail_url:, video_url:, title:, description:, **optional_args)
|
59
|
+
block = Layout::Video.new(
|
60
|
+
alt_text: alt_text,
|
61
|
+
thumbnail_url: thumbnail_url,
|
62
|
+
video_url: video_url,
|
63
|
+
title: title,
|
64
|
+
description: description,
|
65
|
+
**optional_args
|
66
|
+
)
|
67
|
+
|
68
|
+
append(block)
|
69
|
+
end
|
70
|
+
|
58
71
|
def section(block_id: nil)
|
59
72
|
block = Layout::Section.new(block_id: block_id)
|
60
73
|
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Slack
|
4
|
+
module BlockKit
|
5
|
+
module Layout
|
6
|
+
# A video block is designed to embed videos in all app surfaces
|
7
|
+
# (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks!
|
8
|
+
# To use the video block within your app, you must have the links.embed:write scope.
|
9
|
+
#
|
10
|
+
# https://api.slack.com/reference/messaging/blocks#context
|
11
|
+
class Video
|
12
|
+
TYPE = 'video'
|
13
|
+
|
14
|
+
def initialize(alt_text:, thumbnail_url:, video_url:, title:, description:, **optional_args)
|
15
|
+
@alt_text = alt_text
|
16
|
+
@thumbnail_url = thumbnail_url
|
17
|
+
@video_url = video_url
|
18
|
+
@author_name = optional_args[:author_name]
|
19
|
+
@block_id = optional_args[:block_id]
|
20
|
+
@provider_icon_url = optional_args[:provider_icon_url]
|
21
|
+
@provider_name = optional_args[:provider_name]
|
22
|
+
@title_url = optional_args[:title_url]
|
23
|
+
@description = Composition::PlainText.new(
|
24
|
+
text: description,
|
25
|
+
emoji: optional_args[:emoji]
|
26
|
+
)
|
27
|
+
@title = Composition::PlainText.new(
|
28
|
+
text: title,
|
29
|
+
emoji: optional_args[:emoji]
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
def as_json(*)
|
34
|
+
{
|
35
|
+
type: TYPE,
|
36
|
+
alt_text: @alt_text,
|
37
|
+
thumbnail_url: @thumbnail_url,
|
38
|
+
video_url: @video_url,
|
39
|
+
author_name: @author_name,
|
40
|
+
block_id: @block_id,
|
41
|
+
provider_icon_url: @provider_icon_url,
|
42
|
+
provider_name: @provider_name,
|
43
|
+
title_url: @title_url,
|
44
|
+
description: @description.as_json,
|
45
|
+
title: @title.as_json
|
46
|
+
}.compact
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
data/lib/slack/surfaces/modal.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-ruby-block-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Gregg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zeitwerk
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/slack/block_kit/layout/input.rb
|
84
84
|
- lib/slack/block_kit/layout/section.rb
|
85
85
|
- lib/slack/block_kit/layout/section/multi_select_elements.rb
|
86
|
+
- lib/slack/block_kit/layout/video.rb
|
86
87
|
- lib/slack/block_kit/version.rb
|
87
88
|
- lib/slack/surfaces/home.rb
|
88
89
|
- lib/slack/surfaces/message.rb
|