@tightknitai/block-kitchen 0.10.19 → 0.10.20
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.
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/index.cjs +480 -150
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +481 -151
- package/dist/index.js.map +1 -1
- package/dist/{palette-DNUiqoQK.d.cts → palette-4BJw_nd7.d.cts} +54 -7
- package/dist/{palette-DNUiqoQK.d.ts → palette-4BJw_nd7.d.ts} +54 -7
- package/dist/palette.cjs +52 -0
- package/dist/palette.cjs.map +1 -1
- package/dist/palette.d.cts +1 -1
- package/dist/palette.d.ts +1 -1
- package/dist/palette.js +52 -0
- package/dist/palette.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
|
@@ -168,7 +168,7 @@ declare function buildVariantById(sections: readonly PaletteSection[]): Readonly
|
|
|
168
168
|
/**
|
|
169
169
|
* The Slack Block Kit block types supported by the builder in v1.
|
|
170
170
|
*/
|
|
171
|
-
type SupportedBlockType = 'section' | 'header' | 'divider' | 'context' | 'actions' | 'image' | 'markdown' | 'rich_text' | 'table' | 'alert' | 'card' | 'carousel' | 'context_actions' | 'input' | 'video' | 'plan' | 'task_card' | 'data_visualization' | 'container';
|
|
171
|
+
type SupportedBlockType = 'section' | 'header' | 'divider' | 'context' | 'actions' | 'image' | 'markdown' | 'rich_text' | 'table' | 'alert' | 'card' | 'carousel' | 'context_actions' | 'input' | 'video' | 'plan' | 'task_card' | 'data_visualization' | 'container' | 'data_table';
|
|
172
172
|
/**
|
|
173
173
|
* Slack `markdown` block payload. Renders standard markdown (GFM)
|
|
174
174
|
* via `slack-blocks-to-jsx`'s react-markdown integration.
|
|
@@ -180,15 +180,19 @@ interface MarkdownBlock {
|
|
|
180
180
|
text: string;
|
|
181
181
|
block_id?: string;
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* A plain-text cell in a {@link TableBlock} or {@link DataTableBlock} row.
|
|
185
|
+
*/
|
|
186
|
+
interface TableRawTextCell {
|
|
187
|
+
type: 'raw_text';
|
|
188
|
+
text: string;
|
|
189
|
+
}
|
|
183
190
|
/**
|
|
184
191
|
* One cell in a {@link TableBlock} row. Slack accepts either a raw text
|
|
185
192
|
* cell or a rich-text cell; the visual editor only emits raw text in v1
|
|
186
193
|
* but preserves rich-text cells on edit.
|
|
187
194
|
*/
|
|
188
|
-
type TableCell = {
|
|
189
|
-
type: 'raw_text';
|
|
190
|
-
text: string;
|
|
191
|
-
} | {
|
|
195
|
+
type TableCell = TableRawTextCell | {
|
|
192
196
|
type: 'rich_text';
|
|
193
197
|
elements: unknown[];
|
|
194
198
|
};
|
|
@@ -210,6 +214,49 @@ interface TableBlock {
|
|
|
210
214
|
column_settings?: TableColumnSetting[];
|
|
211
215
|
block_id?: string;
|
|
212
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* A numeric cell in a {@link DataTableBlock} row. A column whose cells are
|
|
219
|
+
* all `raw_number` sorts numerically. `text`, when set, is shown in place
|
|
220
|
+
* of `value` (e.g. `"$1.2M"`).
|
|
221
|
+
*/
|
|
222
|
+
interface DataTableRawNumberCell {
|
|
223
|
+
type: 'raw_number';
|
|
224
|
+
value: number;
|
|
225
|
+
text?: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A button cell in a {@link DataTableBlock} row. Clicking it sends a
|
|
229
|
+
* `block_actions` payload; set the button's `value` to tell rows apart.
|
|
230
|
+
* `fallback` shows instead on clients that don't support action cells.
|
|
231
|
+
*/
|
|
232
|
+
interface DataTableActionCell {
|
|
233
|
+
type: 'action_cell';
|
|
234
|
+
element: Button;
|
|
235
|
+
fallback?: TableRawTextCell | DataTableRawNumberCell;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* One cell in a {@link DataTableBlock} row. `rich_text` is not allowed in
|
|
239
|
+
* the header (first) row.
|
|
240
|
+
*/
|
|
241
|
+
type DataTableCell = TableCell | DataTableRawNumberCell | DataTableActionCell;
|
|
242
|
+
/**
|
|
243
|
+
* Slack `data_table` block payload. A paginated, sortable table: the first
|
|
244
|
+
* row is the header, followed by 1-200 data rows of 1-20 cells each, all
|
|
245
|
+
* the same length. Valid on message and App Home surfaces.
|
|
246
|
+
* `slack-web-api-client` doesn't ship this type yet, so we declare it.
|
|
247
|
+
* @see https://docs.slack.dev/reference/block-kit/blocks/data-table-block
|
|
248
|
+
*/
|
|
249
|
+
interface DataTableBlock {
|
|
250
|
+
type: 'data_table';
|
|
251
|
+
/** Required. Rendered as the table's HTML caption. */
|
|
252
|
+
caption: string;
|
|
253
|
+
rows: DataTableCell[][];
|
|
254
|
+
/** Rows per page, 1-100. Slack defaults to 5. */
|
|
255
|
+
page_size?: number;
|
|
256
|
+
/** 0-based index of the column that identifies each row. Slack defaults to 0. */
|
|
257
|
+
row_header_column_index?: number;
|
|
258
|
+
block_id?: string;
|
|
259
|
+
}
|
|
213
260
|
/**
|
|
214
261
|
* Severity level for an {@link AlertBlock}. Controls the icon and color
|
|
215
262
|
* accent rendered by Slack. Defaults to `default` when omitted.
|
|
@@ -557,7 +604,7 @@ type SupportedHeaderBlock = HeaderBlock & {
|
|
|
557
604
|
* Subset of {@link AnyMessageBlock} from `slack-web-api-client`,
|
|
558
605
|
* plus a header `level` extension.
|
|
559
606
|
*/
|
|
560
|
-
type SupportedBlock = SectionBlock | SupportedHeaderBlock | DividerBlock | ContextBlock | ActionsBlock | ImageBlock | MarkdownBlock | RichTextBlock | TableBlock | AlertBlock | CardBlock | CarouselBlock | ContextActionsBlock | InputBlock | VideoBlock | PlanBlock | TaskCardBlock | DataVisualizationBlock | ContainerBlock;
|
|
607
|
+
type SupportedBlock = SectionBlock | SupportedHeaderBlock | DividerBlock | ContextBlock | ActionsBlock | ImageBlock | MarkdownBlock | RichTextBlock | TableBlock | AlertBlock | CardBlock | CarouselBlock | ContextActionsBlock | InputBlock | VideoBlock | PlanBlock | TaskCardBlock | DataVisualizationBlock | ContainerBlock | DataTableBlock;
|
|
561
608
|
/**
|
|
562
609
|
* A block as represented inside the builder's working state.
|
|
563
610
|
* `id` is an ephemeral client-side identifier used by DnD and selection.
|
|
@@ -1360,4 +1407,4 @@ interface BlockKitchenComposeOnlyProps {
|
|
|
1360
1407
|
*/
|
|
1361
1408
|
type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
|
|
1362
1409
|
|
|
1363
|
-
export { type
|
|
1410
|
+
export { type PieChart as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionUser as W, type MentionsConfig as X, type PaletteMode as Y, type PaletteSection as Z, type PaletteVariant as _, type SendAsUserStatus as a, type PieChartSegment as a0, type PlanBlock as a1, type PreviewHooks as a2, type PrimaryActionConfig as a3, type PrimaryActionContext as a4, type RecentMessage as a5, type SendResult as a6, type SupportedBlockType as a7, type SupportedHeaderBlock as a8, type TableBlock as a9, type TableCell as aa, type TableColumnSetting as ab, type TableRawTextCell as ac, type TaskCardBlock as ad, type TaskCardStatus as ae, type UpdatePayload as af, type UpdateResult as ag, type UrlSourceElement as ah, type ValidationSummary as ai, type VideoBlock as aj, defaultPalette as ak, extraAlertVariant as al, legacyInputVariants as am, buildVariantById as an, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
|
|
@@ -168,7 +168,7 @@ declare function buildVariantById(sections: readonly PaletteSection[]): Readonly
|
|
|
168
168
|
/**
|
|
169
169
|
* The Slack Block Kit block types supported by the builder in v1.
|
|
170
170
|
*/
|
|
171
|
-
type SupportedBlockType = 'section' | 'header' | 'divider' | 'context' | 'actions' | 'image' | 'markdown' | 'rich_text' | 'table' | 'alert' | 'card' | 'carousel' | 'context_actions' | 'input' | 'video' | 'plan' | 'task_card' | 'data_visualization' | 'container';
|
|
171
|
+
type SupportedBlockType = 'section' | 'header' | 'divider' | 'context' | 'actions' | 'image' | 'markdown' | 'rich_text' | 'table' | 'alert' | 'card' | 'carousel' | 'context_actions' | 'input' | 'video' | 'plan' | 'task_card' | 'data_visualization' | 'container' | 'data_table';
|
|
172
172
|
/**
|
|
173
173
|
* Slack `markdown` block payload. Renders standard markdown (GFM)
|
|
174
174
|
* via `slack-blocks-to-jsx`'s react-markdown integration.
|
|
@@ -180,15 +180,19 @@ interface MarkdownBlock {
|
|
|
180
180
|
text: string;
|
|
181
181
|
block_id?: string;
|
|
182
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* A plain-text cell in a {@link TableBlock} or {@link DataTableBlock} row.
|
|
185
|
+
*/
|
|
186
|
+
interface TableRawTextCell {
|
|
187
|
+
type: 'raw_text';
|
|
188
|
+
text: string;
|
|
189
|
+
}
|
|
183
190
|
/**
|
|
184
191
|
* One cell in a {@link TableBlock} row. Slack accepts either a raw text
|
|
185
192
|
* cell or a rich-text cell; the visual editor only emits raw text in v1
|
|
186
193
|
* but preserves rich-text cells on edit.
|
|
187
194
|
*/
|
|
188
|
-
type TableCell = {
|
|
189
|
-
type: 'raw_text';
|
|
190
|
-
text: string;
|
|
191
|
-
} | {
|
|
195
|
+
type TableCell = TableRawTextCell | {
|
|
192
196
|
type: 'rich_text';
|
|
193
197
|
elements: unknown[];
|
|
194
198
|
};
|
|
@@ -210,6 +214,49 @@ interface TableBlock {
|
|
|
210
214
|
column_settings?: TableColumnSetting[];
|
|
211
215
|
block_id?: string;
|
|
212
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* A numeric cell in a {@link DataTableBlock} row. A column whose cells are
|
|
219
|
+
* all `raw_number` sorts numerically. `text`, when set, is shown in place
|
|
220
|
+
* of `value` (e.g. `"$1.2M"`).
|
|
221
|
+
*/
|
|
222
|
+
interface DataTableRawNumberCell {
|
|
223
|
+
type: 'raw_number';
|
|
224
|
+
value: number;
|
|
225
|
+
text?: string;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* A button cell in a {@link DataTableBlock} row. Clicking it sends a
|
|
229
|
+
* `block_actions` payload; set the button's `value` to tell rows apart.
|
|
230
|
+
* `fallback` shows instead on clients that don't support action cells.
|
|
231
|
+
*/
|
|
232
|
+
interface DataTableActionCell {
|
|
233
|
+
type: 'action_cell';
|
|
234
|
+
element: Button;
|
|
235
|
+
fallback?: TableRawTextCell | DataTableRawNumberCell;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* One cell in a {@link DataTableBlock} row. `rich_text` is not allowed in
|
|
239
|
+
* the header (first) row.
|
|
240
|
+
*/
|
|
241
|
+
type DataTableCell = TableCell | DataTableRawNumberCell | DataTableActionCell;
|
|
242
|
+
/**
|
|
243
|
+
* Slack `data_table` block payload. A paginated, sortable table: the first
|
|
244
|
+
* row is the header, followed by 1-200 data rows of 1-20 cells each, all
|
|
245
|
+
* the same length. Valid on message and App Home surfaces.
|
|
246
|
+
* `slack-web-api-client` doesn't ship this type yet, so we declare it.
|
|
247
|
+
* @see https://docs.slack.dev/reference/block-kit/blocks/data-table-block
|
|
248
|
+
*/
|
|
249
|
+
interface DataTableBlock {
|
|
250
|
+
type: 'data_table';
|
|
251
|
+
/** Required. Rendered as the table's HTML caption. */
|
|
252
|
+
caption: string;
|
|
253
|
+
rows: DataTableCell[][];
|
|
254
|
+
/** Rows per page, 1-100. Slack defaults to 5. */
|
|
255
|
+
page_size?: number;
|
|
256
|
+
/** 0-based index of the column that identifies each row. Slack defaults to 0. */
|
|
257
|
+
row_header_column_index?: number;
|
|
258
|
+
block_id?: string;
|
|
259
|
+
}
|
|
213
260
|
/**
|
|
214
261
|
* Severity level for an {@link AlertBlock}. Controls the icon and color
|
|
215
262
|
* accent rendered by Slack. Defaults to `default` when omitted.
|
|
@@ -557,7 +604,7 @@ type SupportedHeaderBlock = HeaderBlock & {
|
|
|
557
604
|
* Subset of {@link AnyMessageBlock} from `slack-web-api-client`,
|
|
558
605
|
* plus a header `level` extension.
|
|
559
606
|
*/
|
|
560
|
-
type SupportedBlock = SectionBlock | SupportedHeaderBlock | DividerBlock | ContextBlock | ActionsBlock | ImageBlock | MarkdownBlock | RichTextBlock | TableBlock | AlertBlock | CardBlock | CarouselBlock | ContextActionsBlock | InputBlock | VideoBlock | PlanBlock | TaskCardBlock | DataVisualizationBlock | ContainerBlock;
|
|
607
|
+
type SupportedBlock = SectionBlock | SupportedHeaderBlock | DividerBlock | ContextBlock | ActionsBlock | ImageBlock | MarkdownBlock | RichTextBlock | TableBlock | AlertBlock | CardBlock | CarouselBlock | ContextActionsBlock | InputBlock | VideoBlock | PlanBlock | TaskCardBlock | DataVisualizationBlock | ContainerBlock | DataTableBlock;
|
|
561
608
|
/**
|
|
562
609
|
* A block as represented inside the builder's working state.
|
|
563
610
|
* `id` is an ephemeral client-side identifier used by DnD and selection.
|
|
@@ -1360,4 +1407,4 @@ interface BlockKitchenComposeOnlyProps {
|
|
|
1360
1407
|
*/
|
|
1361
1408
|
type BlockKitchenProps = BlockKitchenBaseProps & (BlockKitchenSendProps | BlockKitchenComposeOnlyProps);
|
|
1362
1409
|
|
|
1363
|
-
export { type
|
|
1410
|
+
export { type PieChart as $, type AlertBlock as A, type BlockKitchenProps as B, type ChannelOption as C, type DataTableActionCell as D, type DataTableCell as E, type DataTableRawNumberCell as F, type DataVisualizationBlock as G, type EditableVia as H, type FeedbackButtonSubobject as I, type FeedbackButtonsElement as J, type HeaderLevel as K, type IconButtonElement as L, type IconButtonIcon as M, type InputBlock as N, type LoadMessageInput as O, type PreviewSurface as P, type LoadResult as Q, type LoadedMessage as R, type SupportedBlock as S, type Template as T, type LoadingConfig as U, type MarkdownBlock as V, type MentionUser as W, type MentionsConfig as X, type PaletteMode as Y, type PaletteSection as Z, type PaletteVariant as _, type SendAsUserStatus as a, type PieChartSegment as a0, type PlanBlock as a1, type PreviewHooks as a2, type PrimaryActionConfig as a3, type PrimaryActionContext as a4, type RecentMessage as a5, type SendResult as a6, type SupportedBlockType as a7, type SupportedHeaderBlock as a8, type TableBlock as a9, type TableCell as aa, type TableColumnSetting as ab, type TableRawTextCell as ac, type TaskCardBlock as ad, type TaskCardStatus as ae, type UpdatePayload as af, type UpdateResult as ag, type UrlSourceElement as ah, type ValidationSummary as ai, type VideoBlock as aj, defaultPalette as ak, extraAlertVariant as al, legacyInputVariants as am, buildVariantById as an, type SendPayload as b, type SendExtrasContext as c, type PreviewTheme as d, type AlertLevel as e, type BlockKitchenBaseProps as f, type BlockKitchenComposeOnlyProps as g, type BlockKitchenSendProps as h, type BrandPreset as i, type BrandTheme as j, type BrandTokens as k, type BuilderBlock as l, type CardBlock as m, type CarouselBlock as n, type CartesianChart as o, type Chart as p, type ChartAxisConfig as q, type ChartDataPoint as r, type ChartSeries as s, type ChartType as t, type ContainerBlock as u, type ContainerChildBlock as v, type ContextActionsBlock as w, type ContextActionsElement as x, type CustomEmoji as y, type DataTableBlock as z };
|
package/dist/palette.cjs
CHANGED
|
@@ -944,6 +944,58 @@ var defaultPalette = [
|
|
|
944
944
|
]
|
|
945
945
|
]
|
|
946
946
|
})
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
// Slack's documented example.
|
|
950
|
+
id: "data_table_basic",
|
|
951
|
+
label: "Data table",
|
|
952
|
+
factory: () => ({
|
|
953
|
+
type: "data_table",
|
|
954
|
+
caption: "A Fabulous Table",
|
|
955
|
+
rows: [
|
|
956
|
+
[
|
|
957
|
+
{ type: "raw_text", text: "Name" },
|
|
958
|
+
{ type: "raw_text", text: "Department" },
|
|
959
|
+
{ type: "raw_text", text: "Badge" }
|
|
960
|
+
],
|
|
961
|
+
[
|
|
962
|
+
{ type: "raw_text", text: "Data Refinement Department" },
|
|
963
|
+
{ type: "raw_text", text: "MDR" },
|
|
964
|
+
{
|
|
965
|
+
type: "rich_text",
|
|
966
|
+
elements: [
|
|
967
|
+
{ type: "rich_text_section", elements: [{ type: "text", text: "Blue", style: { bold: true } }] }
|
|
968
|
+
]
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
[
|
|
972
|
+
{ type: "raw_text", text: "Art Sourcing Department" },
|
|
973
|
+
{ type: "raw_text", text: "O&D" },
|
|
974
|
+
{
|
|
975
|
+
type: "rich_text",
|
|
976
|
+
elements: [
|
|
977
|
+
{
|
|
978
|
+
type: "rich_text_section",
|
|
979
|
+
elements: [
|
|
980
|
+
{ type: "text", text: "Green " },
|
|
981
|
+
{ type: "text", text: "review", style: { italic: true } }
|
|
982
|
+
]
|
|
983
|
+
}
|
|
984
|
+
]
|
|
985
|
+
}
|
|
986
|
+
],
|
|
987
|
+
[
|
|
988
|
+
{ type: "raw_text", text: "Wellness Department" },
|
|
989
|
+
{ type: "raw_text", text: "Wellness Center" },
|
|
990
|
+
{
|
|
991
|
+
type: "rich_text",
|
|
992
|
+
elements: [
|
|
993
|
+
{ type: "rich_text_section", elements: [{ type: "text", text: "Limited", style: { bold: true } }] }
|
|
994
|
+
]
|
|
995
|
+
}
|
|
996
|
+
]
|
|
997
|
+
]
|
|
998
|
+
})
|
|
947
999
|
}
|
|
948
1000
|
]
|
|
949
1001
|
},
|