slack-block-builder
Advanced tools
Comparing version 1.7.1 to 1.7.2
# Change Log | ||
## v1.7.2 – 2020-11-09 | ||
* Small code refactoring | ||
* Update TypeScript definitions | ||
## v1.7.1 – 2020-10-13 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "slack-block-builder", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"description": "Maintainable code for interactive Slack messages, modals and home tabs. A must-have for the Slack Block Kit framework.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -93,4 +93,6 @@ const { ConfirmableElement } = require('./base'); | ||
primary() { | ||
return this.set(enumValues.primary, props.style); | ||
primary(bool) { | ||
if (bool !== false) { | ||
return this.set(enumValues.primary, props.style); | ||
} | ||
} | ||
@@ -106,4 +108,6 @@ | ||
danger() { | ||
return this.set(enumValues.danger, props.style); | ||
danger(bool) { | ||
if (bool !== false) { | ||
return this.set(enumValues.danger, props.style); | ||
} | ||
} | ||
@@ -110,0 +114,0 @@ |
@@ -65,4 +65,15 @@ const { Builder } = require('../../utility/lib'); | ||
} | ||
/** | ||
* When called, builds the view and prints to the console the preview URL in | ||
* order to open and preview the view on the Slack Block Builder website | ||
*/ | ||
printPreviewUrl() { | ||
this.build(); | ||
console.log(encodeURI(`https://app.slack.com/block-kit-builder/#${JSON.stringify({ blocks: this.result.blocks, attachments: this.result.attachments })}`).replace(/[!'()*]/g, escape)); | ||
} | ||
} | ||
module.exports = Surface; |
@@ -194,13 +194,2 @@ const { Surface } = require('./base'); | ||
/** | ||
* When called, builds the view and prints to the console the preview URL in | ||
* order to open and preview the view on the Slack Block Builder website | ||
*/ | ||
printPreviewUrl() { | ||
this.build(); | ||
console.log(encodeURI(`https://app.slack.com/block-kit-builder/#${JSON.stringify({ blocks: this.result.blocks, attachments: this.result.attachments })}`).replace(/[!'()*]/g, escape)); | ||
} | ||
/** | ||
* @private | ||
@@ -207,0 +196,0 @@ */ |
@@ -389,2 +389,3 @@ declare module 'slack-block-builder' { | ||
getBlocks(): Block.Block[]; | ||
printPreviewUrl(): void; | ||
} | ||
@@ -396,3 +397,2 @@ | ||
externalId(externalId: string): this; | ||
printPreviewUrl(): void; | ||
} | ||
@@ -399,0 +399,0 @@ |
183567
4443