Skip to content

Commit

Permalink
✨ Release v2.8.0
Browse files Browse the repository at this point in the history
✨ Release v2.8.0
  • Loading branch information
raycharius authored Dec 22, 2023
2 parents 6dff295 + f614faa commit fac1baf
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ Below is a list of supported objects and how to access them in **Block Builder**
| Date Picker | Element | :white_check_mark: | `Elements.DatePicker()`
| Date Time Picker | Element | :white_check_mark: | `Elements.DateTimePicker()`
| Email Input | Element | :white_check_mark: | `Elements.EmailInput()`
| File Input | Element | :white_check_mark: | `Elements.FileInput()`
| Time Picker | Element | :white_check_mark: | `Elements.TimePicker()`
| Image | Element | :white_check_mark: | `Elements.Img()`
| Number Input | Element | :white_check_mark: | `Elements.NumberInput()`
Expand Down
4 changes: 4 additions & 0 deletions docs-generator/mappers/map-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ export default (type: string, capitalize = false): string => {
return 'Date';
}

if (type === 'string[]') {
return 'String[]';
}

if (type === 'boolean') {
return 'boolean';
}
Expand Down
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* [Email Input](elements/email-input.md "Block Builder – Email Input – Maintainable JavaScript Code for Slack Block Kit")
* [External Multi-Select](elements/external-multi-select.md "Block Builder – External Multi-Select – Maintainable JavaScript Code for Slack Block Kit")
* [External Select](elements/external-select.md "Block Builder – External Select – Maintainable JavaScript Code for Slack Block Kit")
* [File Input](elements/file-input.md "Block Builder – File Input – Maintainable JavaScript Code for Slack Block Kit")
* [Image](elements/img.md "Block Builder – Image – Maintainable JavaScript Code for Slack Block Kit")
* [Number Input](elements/number-input.md "Block Builder – Number Input – Maintainable JavaScript Code for Slack Block Kit")
* [Overflow Menu](elements/overflow-menu.md "Block Builder – Overflow Menu – Maintainable JavaScript Code for Slack Block Kit")
Expand Down
2 changes: 2 additions & 0 deletions docs/blocks/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const myObj = Blocks.Video(params?);
Each instance of the `VideoBuilder` object has chainable setter methods for the object's properties. However, properties with primitive values can optionally be passed to the instantiating function, should you prefer:
`altText` – *String*
`blockId` – *String*
`description` – *String*
Expand Down
63 changes: 63 additions & 0 deletions docs/elements/file-input.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# File Input Builder

?> **Note:** This document is a reference to the `FileInputBuilder` object in **Block Builder**. For more information on how this carries over to the Slack API, view the [the File Input Builder docs](https://api.slack.com/reference/block-kit/block-elements#file_input) on Slack's doc site.

### Creating an Instance

The function that creates a new instance of `FileInputBuilder` is available as both a top-level import and as a member of its 'category', `Elements`:

```javascript
import { FileInput } from 'slack-block-builder';

const myObj = FileInput(params?);

```
```javascript
import { Elements } from 'slack-block-builder';

const myObj = Elements.FileInput(params?);
```
### Params
Each instance of the `FileInputBuilder` object has chainable setter methods for the object's properties. However, properties with primitive values can optionally be passed to the instantiating function, should you prefer:
`actionId` – *String*
`filetypes` – *String[]*
`maxFiles` – *Int*
?> **Note:** For an explanation of any one of the parameters, see its corresponding setter method below.
### Setter Methods
All setter methods return `this`, the instance of `FileInputBuilder` on which it is called.
```javascript
FileInputBuilder.actionId(string);
```
Sets a string to be an identifier for the action taken by the user. It is sent back to your app in the interaction payload when the element is interacted or when the view is submitted.
```javascript
FileInputBuilder.maxFiles(int?);
```
Maximum number of files that can be uploaded for this file_input element. Minimum of 1, maximum of 10. Defaults to 10 if not specified. Defaults to `10`.
```javascript
FileInputBuilder.filetypes(String[]?);
```
An array of valid file extensions that will be accepted for this element. All file extensions will be accepted if filetypes is not specified. Defaults to `[]`.
### Other Methods
The `FileInputBuilder` object also has other methods available:
```javascript
FileInputBuilder.end();
```
Performs no alterations to the object on which it is called. It is meant to simulate a closing HTML tag for those who prefer to have an explicit end declared for an object.
2 changes: 2 additions & 0 deletions docs/elements/text-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Each instance of the `TextInputBuilder` object has chainable setter methods for
`initialValue` – *String*
`multiline` – *boolean*
`maxLength` – *Int*
`minLength` – *Int*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "slack-block-builder",
"version": "2.7.2",
"version": "2.8.0",
"description": "Maintainable code for interactive Slack messages, modals, home tabs, and workflow steps. A must-have for the Slack Block Kit framework.",
"author": {
"name": "Ray East",
Expand Down
2 changes: 1 addition & 1 deletion src/components/accordion-ui-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export interface AccordionActionIdParams {
export type AccordionActionIdFn = StringReturnableFn<AccordionActionIdParams>;
export type AccordionTitleTextFn<T> = StringReturnableFn<{ item: T }>;
export type AccordionBuilderFn<T> = BlockBuilderReturnableFn<{ item: T }>;

export type AccordionIsExpandableFn<T> = (item: T) => boolean;

export interface AccordionUIComponentParams<T> {
items: T[];
paginator: AccordionStateManager;
Expand Down
2 changes: 1 addition & 1 deletion src/elements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export function StaticSelect(params?: StaticSelectParams): StaticSelectBuilder {
* @param {string} [params.actionId] Sets a string to be an identifier for the source of an action in interaction payloads.
* @param {string} [params.placeholder] Adds the text in place of the input before selected or interacted with.
* @param {string} [params.initialValue] Sets the default text entered into the text input at modal render.
* @param {boolean} [params.multiline] Sets wether the input will be a single line or a larger text area.
* @param {boolean} [params.multiline] Sets whether the input will be a single line or a larger text area.
* @param {int} [params.minLength] Sets a minimum character count in order for the user to submit the form.
* @param {int} [params.maxLength] Sets a maximum character count allowed to send the form.
*
Expand Down
1 change: 1 addition & 0 deletions src/internal/dto/slack-dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export enum Param {
maxValue = 'max_value',
maxFiles = 'max_files',
filetypes = 'filetypes',
source = 'source',
}

export class SlackDto implements ObjectLiteral {
Expand Down

0 comments on commit fac1baf

Please sign in to comment.