-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
250 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace SlackNet.Blocks | ||
{ | ||
public interface IActionElement | ||
{ | ||
string Type { get; } | ||
string ActionId { get; set; } | ||
} | ||
|
||
public abstract class ActionElement : BlockElement, IActionElement | ||
{ | ||
protected ActionElement(string type) : base(type) { } | ||
|
||
/// <summary> | ||
/// An identifier for this action. You can use this when you receive an interaction payload to identify the source of the action. | ||
/// Should be unique among all other <see cref="ActionId"/>s used elsewhere by your app. | ||
/// </summary> | ||
public string ActionId { get; set; } | ||
|
||
/// <summary> | ||
/// Defines an optional confirmation dialog that appears after the element is activated. | ||
/// </summary> | ||
public ConfirmationDialog Confirm { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
[SlackType("multi_channels_select")] | ||
public class ChannelMultiSelectAction | ||
{ | ||
public IList<string> SelectedChannels { get; set; } = new List<string>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
/// <summary> | ||
/// This multi-select menu will populate its options with a list of public channels visible to the current user in the active workspace. | ||
/// </summary> | ||
[SlackType("multi_channels_select")] | ||
public class ChannelMultiSelectMenu : SelectMenuBase | ||
{ | ||
public ChannelMultiSelectMenu() : base("multi_channels_select") { } | ||
|
||
/// <summary> | ||
/// A list of one or more IDs of any valid public channel to be pre-selected when the menu loads. | ||
/// </summary> | ||
public IList<string> InitialChannels { get; set; } = new List<string>(); | ||
|
||
/// <summary> | ||
/// Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. | ||
/// </summary> | ||
public int? MaxSelectedItems { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
[SlackType("multi_conversations_select")] | ||
public class ConversationMultiSelectAction | ||
{ | ||
public IList<string> SelectedConversations { get; set; } = new List<string>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
/// <summary> | ||
/// This multi-select menu will populate its options with a list of public and private channels, DMs, and MPIMs visible to the current user in the active workspace. | ||
/// </summary> | ||
[SlackType("multi_conversations_select")] | ||
public class ConversationMultiSelectMenu : SelectMenuBase | ||
{ | ||
public ConversationMultiSelectMenu() : base("multi_conversations_select") { } | ||
|
||
/// <summary> | ||
/// A list of one or more IDs of any valid conversations to be pre-selected when the menu loads. | ||
/// </summary> | ||
public IList<string> InitialConversations { get; set; } = new List<string>(); | ||
|
||
/// <summary> | ||
/// Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. | ||
/// </summary> | ||
public int? MaxSelectedItems { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
[SlackType("multi_external_select")] | ||
public class ExternalMultiSelectAction | ||
{ | ||
public IList<Option> SelectedOptions { get; set; } = new List<Option>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System.Collections.Generic; | ||
using SlackNet.Interaction; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
/// <summary> | ||
/// This menu will load its options from an external data source, allowing for a dynamic list of options. | ||
/// </summary> | ||
[SlackType("multi_external_select")] | ||
public class ExternalMultiSelectMenu : ExternalSelectMenuBase | ||
{ | ||
public ExternalMultiSelectMenu() : base("multi_external_select") { } | ||
|
||
/// <summary> | ||
/// A list of <see cref="Option"/>s that exactly match one or more of the options within the <see cref="BlockOptionsResponse.Options"/> | ||
/// or <see cref="BlockOptionsResponse.OptionGroups"/> loaded from the external data source. | ||
/// These options will be selected when the menu initially loads. | ||
/// </summary> | ||
public IList<Option> InitialOptions { get; set; } = new List<Option>(); | ||
|
||
/// <summary> | ||
/// Specifies the maximum number of items that can be selected in the menu. Minimum number is 1. | ||
/// </summary> | ||
public int? MaxSelectedItems { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace SlackNet.Blocks | ||
{ | ||
public abstract class ExternalSelectMenuBase : SelectMenuBase | ||
{ | ||
protected ExternalSelectMenuBase(string type) : base(type) { } | ||
|
||
/// <summary> | ||
/// When the typeahead field is used, a request will be sent on every character change. | ||
/// If you prefer fewer requests or more fully ideated queries, use this to tell Slack the fewest number of typed characters required before dispatch. | ||
/// </summary> | ||
public int? MinQueryLength { get; set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace SlackNet.Blocks | ||
{ | ||
public abstract class SelectMenuBase : ActionElement | ||
{ | ||
protected SelectMenuBase(string type) : base(type) { } | ||
|
||
/// <summary> | ||
/// A plain text object that defines the placeholder text shown on the menu. | ||
/// </summary> | ||
public PlainText Placeholder { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace SlackNet.Blocks | ||
{ | ||
[SlackType("multi_static_select")] | ||
public class StaticMultiSelectAction : BlockAction | ||
{ | ||
public IList<Option> SelectedOptions { get; set; } = new List<Option>(); | ||
} | ||
} |
Oops, something went wrong.