@tightknitai/slack-block-kit-validator 0.1.15 → 0.1.17
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/check-surface-compatibility.d.ts.map +1 -1
- package/dist/helpers/check-surface-compatibility.js +5 -7
- package/dist/helpers/check-surface-compatibility.js.map +1 -1
- package/dist/slack-block-kit.schema.json +7 -4
- package/dist/standalone-validator.js +3909 -3935
- package/dist/types.generated.d.ts +192 -185
- package/dist/types.generated.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-surface-compatibility.d.ts","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"check-surface-compatibility.d.ts","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAmEnD;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAAE,EACjE,OAAO,EAAE,OAAO,GACf,MAAM,EAAE,CAsBV"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// subset of ["Modals", "Messages", "Home tabs"]. Whatever's missing from
|
|
5
5
|
// that array is what we forbid here.
|
|
6
6
|
//
|
|
7
|
-
//
|
|
7
|
+
// Three entries below intentionally deviate from blocks.json — Slack's canonical
|
|
8
8
|
// data lists a surface where the block doesn't actually render. Each is
|
|
9
9
|
// empirically grounded:
|
|
10
10
|
// • card / modals — blocks.json lists Modals; fails to render there.
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
// "You can't add this block to app surfaces directly...").
|
|
14
14
|
// • table / home tabs — blocks.json lists Home tabs; Tightknit testing shows
|
|
15
15
|
// the table block renders on messages only (modals and home drop it).
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
16
|
+
//
|
|
17
|
+
// data_table does NOT inherit table's home-tab deviation: blocks.json and its
|
|
18
|
+
// reference page (https://docs.slack.dev/reference/block-kit/blocks/data-table-block)
|
|
19
|
+
// both list Messages and Home tabs, so it follows the canonical data.
|
|
19
20
|
const BLOCKS_NOT_ALLOWED_IN_MESSAGE = new Set(["alert", "file"]);
|
|
20
21
|
const BLOCKS_NOT_ALLOWED_IN_MODAL = new Set([
|
|
21
22
|
"card",
|
|
@@ -32,10 +33,7 @@ const BLOCKS_NOT_ALLOWED_IN_MODAL = new Set([
|
|
|
32
33
|
]);
|
|
33
34
|
const BLOCKS_NOT_ALLOWED_IN_HOME = new Set([
|
|
34
35
|
"alert",
|
|
35
|
-
"container",
|
|
36
36
|
"context_actions",
|
|
37
|
-
"data_table",
|
|
38
|
-
"data_visualization",
|
|
39
37
|
"file",
|
|
40
38
|
"markdown",
|
|
41
39
|
"plan",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-surface-compatibility.js","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,qCAAqC;AACrC,EAAE;AACF,
|
|
1
|
+
{"version":3,"file":"check-surface-compatibility.js","sourceRoot":"","sources":["../../src/helpers/check-surface-compatibility.ts"],"names":[],"mappings":"AAMA,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,yEAAyE;AACzE,qCAAqC;AACrC,EAAE;AACF,iFAAiF;AACjF,wEAAwE;AACxE,wBAAwB;AACxB,yEAAyE;AACzE,yEAA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C,EAAE,EAAE;QAC1B,IAAI,KAAK,EAAE,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,KAAK,CAAC,IAAI,gCAAgC,OAAO,GAAG,CAAC,CAAC;YACxF,mEAAmE;YACnE,uCAAuC;YACvC,OAAO;QACT,CAAC;QACD,IAAI,KAAK,EAAE,IAAI,KAAK,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE,IAAI,KAAK,YAAY,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;YAC3F,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,uEAAuE,OAAO,IAAI,CAAC,CAAC;QAC7G,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1196,23 +1196,26 @@
|
|
|
1196
1196
|
},
|
|
1197
1197
|
|
|
1198
1198
|
"container_block": {
|
|
1199
|
-
"description": "A general-purpose wrapper that groups child blocks into a single, optionally collapsible unit with a configurable width. Messages
|
|
1199
|
+
"description": "A general-purpose wrapper that groups child blocks into a single, optionally collapsible unit with a configurable width. Messages and Home tabs (https://docs.slack.dev/reference/block-kit/blocks/container-block). At least one of title or rich_text_title is required; Slack renders rich_text_title when both are present. default_collapsed only takes effect when is_collapsible is true; the schema rejects default_collapsed: true without is_collapsible: true. has_header_divider only applies when the block is not collapsible; Slack ignores it otherwise, so the schema accepts it either way.",
|
|
1200
1200
|
"type": "object",
|
|
1201
1201
|
"additionalProperties": false,
|
|
1202
|
-
"required": ["type", "
|
|
1202
|
+
"required": ["type", "child_blocks"],
|
|
1203
|
+
"anyOf": [{ "required": ["title"] }, { "required": ["rich_text_title"] }],
|
|
1203
1204
|
"properties": {
|
|
1204
1205
|
"type": { "const": "container" },
|
|
1205
1206
|
"block_id": { "$ref": "#/$defs/block_id" },
|
|
1206
1207
|
"title": {
|
|
1207
1208
|
"allOf": [{ "$ref": "#/$defs/plain_text_object" }, { "properties": { "text": { "maxLength": 150 } } }]
|
|
1208
1209
|
},
|
|
1210
|
+
"rich_text_title": { "$ref": "#/$defs/rich_text_block" },
|
|
1209
1211
|
"subtitle": {
|
|
1210
|
-
"allOf": [{ "$ref": "#/$defs/
|
|
1212
|
+
"allOf": [{ "$ref": "#/$defs/text_object" }, { "properties": { "text": { "maxLength": 150 } } }]
|
|
1211
1213
|
},
|
|
1212
1214
|
"icon": { "$ref": "#/$defs/image_element" },
|
|
1213
1215
|
"width": { "enum": ["narrow", "standard", "wide", "full"] },
|
|
1214
1216
|
"is_collapsible": { "type": "boolean" },
|
|
1215
1217
|
"default_collapsed": { "type": "boolean" },
|
|
1218
|
+
"has_header_divider": { "type": "boolean" },
|
|
1216
1219
|
"child_blocks": {
|
|
1217
1220
|
"type": "array",
|
|
1218
1221
|
"minItems": 1,
|
|
@@ -1417,7 +1420,7 @@
|
|
|
1417
1420
|
},
|
|
1418
1421
|
|
|
1419
1422
|
"data_visualization_block": {
|
|
1420
|
-
"description": "Renders data as a line, bar, area, or pie chart. Messages
|
|
1423
|
+
"description": "Renders data as a line, bar, area, or pie chart. Messages and Home tabs (https://docs.slack.dev/reference/block-kit/blocks/data-visualization-block). Slack renders at most two data_visualization blocks per message (enforced via the checkDataVisualizationMax helper, since JSON Schema can't count sibling blocks). Two further runtime rules are enforced via checkDataVisualizationConsistency, since they depend on sibling-field values JSON Schema can't compare: series names must be unique within a chart, and each series must contain exactly one data point per axis_config.categories label.",
|
|
1421
1424
|
"type": "object",
|
|
1422
1425
|
"additionalProperties": false,
|
|
1423
1426
|
"required": ["type", "title", "chart"],
|