react-blockkit 0.3.3 → 0.4.0

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.
Files changed (32) hide show
  1. package/README.md +13 -6
  2. package/dist/blocks/AdvancedBlocks.d.ts.map +1 -1
  3. package/dist/blocks/BasicBlocks.d.ts.map +1 -1
  4. package/dist/blocks/InteractiveBlocks.d.ts.map +1 -1
  5. package/dist/elements/Elements.d.ts.map +1 -1
  6. package/dist/index.cjs +4 -4
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.js +252 -249
  9. package/dist/index.js.map +1 -1
  10. package/dist/validation.d.ts.map +1 -1
  11. package/package.json +3 -3
  12. package/docs/coverage-matrix.md +0 -80
  13. package/docs/parity/chart-bar-3-w580-dark.png +0 -0
  14. package/docs/parity/chart-bar-3-w580-light.png +0 -0
  15. package/docs/parity/chart-line-3-w580-light.png +0 -0
  16. package/docs/parity/chart-pie-12-w400-light.png +0 -0
  17. package/docs/parity/chart-pie-5-w580-light.png +0 -0
  18. package/docs/parity/data-table-w580-dark.png +0 -0
  19. package/docs/parity/data-table-w580-light.png +0 -0
  20. package/docs/parity/headers-levels-w580-light.png +0 -0
  21. package/docs/parity/icons-alert-info.png +0 -0
  22. package/docs/parity/icons-card-slack-icon.png +0 -0
  23. package/docs/parity/icons-context-actions.png +0 -0
  24. package/docs/parity/icons-data-table-header.png +0 -0
  25. package/docs/parity/icons-datepicker.png +0 -0
  26. package/docs/parity/icons-overflow.png +0 -0
  27. package/docs/parity/icons-pagination.png +0 -0
  28. package/docs/parity/icons-select-chevron.png +0 -0
  29. package/docs/parity/rich-text-full-w580-light.png +0 -0
  30. package/docs/parity/spacing-rhythm-w580-light.png +0 -0
  31. package/docs/parity/table-align-wrap-w580-light.png +0 -0
  32. package/docs/parity/table-basic-w580-light.png +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AA8CA,OA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C;AAuIpB,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,IAAI,GAAE,MAAe,EACrB,GAAG,GAAE,MAA8B,GAClC,IAAI,CAEN;AA6CD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI,CAErF;AAgLD,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,MAAkB,GAAG,IAAI,CAE3F;AAmJD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,MAAgB,GAAG,IAAI,CAEpF;AAktBD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,eAA2B,EACpC,IAAI,GAAE,MAAgB,GACrB,OAAO,CAAC,KAAK,IAAI,eAAe,CAkFlC;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,EACjC,OAAO,GAAE,eAA2B,EACpC,IAAI,GAAE,MAAgB,GACrB,IAAI,CAGN;AAWD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,GAAE,eAA2B,EACpC,IAAI,GAAE,MAAe,GACpB,OAAO,CAAC,KAAK,IAAI,YAAY,CA+D/B;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,eAA2B,GACnC,YAAY,CAcd;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,SAAS,eAAe,EAAE,CAEvE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-blockkit",
3
- "version": "0.3.3",
3
+ "version": "0.4.0",
4
4
  "description": "React components that render Slack Block Kit JSON exactly as Slack does.",
5
5
  "keywords": [
6
6
  "block kit",
@@ -23,7 +23,7 @@
23
23
  "style": "./dist/styles.css",
24
24
  "files": [
25
25
  "dist",
26
- "docs",
26
+ "docs/slack-style-baseline.md",
27
27
  "LICENSE",
28
28
  "README.md"
29
29
  ],
@@ -66,7 +66,7 @@
66
66
  "react-dom": "^19.2.7",
67
67
  "vite": "^8.1.5",
68
68
  "vitest": "^4.1.7",
69
- "slackmark": "0.6.0"
69
+ "slackmark": "0.6.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": ">=18.2.0 <20",
@@ -1,80 +0,0 @@
1
- # react-blockkit coverage matrix
2
-
3
- Audited against `slackmark`'s `packages/core/src/blocks/types.ts`,
4
- `@slack/types` 3.0.0, and the `react-blockkit` implementation on July 20, 2026.
5
- “Fallback” means the renderer keeps a visible DOM node and human-readable
6
- label; it never silently drops the value or stringifies an object.
7
-
8
- ## Blocks
9
-
10
- | Block | `slackmark` emits | Before | After |
11
- | --- | --- | --- | --- |
12
- | `rich_text` | Yes | Partial | Full containers and inline inventory; unknown descendants render a fallback |
13
- | `header` + `level` | Yes | Levels 1–4; other numbers threw | Semantic `h1`–`h4`; out-of-range levels clamp safely |
14
- | `divider` | Yes | Full | Full |
15
- | `section` + `fields` + `accessory` | Yes (`accessory` is accepted from Slack payloads) | Full for known elements | Full; unknown accessories render a fallback |
16
- | `image` + `slack_file` | Yes | URL images and an alt-labelled placeholder for file IDs | Same deliberate placeholder; never drops `alt_text` |
17
- | `context` | Yes | Full | Full; unknown or text-less elements render a fallback |
18
- | `markdown` | Yes | Full for the existing minimal Markdown subset | Same feature scope, hardened rendering |
19
- | `table` (`raw_text`, `raw_number`, `rich_text`, alignment, wrapping) | Yes | Cells, alignment, and wrapping; first row used data cells | First row uses column-header semantics; unknown cells render a fallback |
20
- | `data_table` | Yes | Header/row semantics and paging; empty rows or zero page size threw | Safe empty state, real `caption`, bounded page size, header/row semantics |
21
- | `data_visualization` (`pie`, `bar`, `area`, `line`) | Yes | All chart types; an empty/zero-total pie failed | All chart types plus a labelled no-data fallback; unknown chart types render a fallback |
22
- | `container` + collapsible state | Yes | Legal Slack child subset only | Legal Slack child subset, collapsible state, and visible illegal/future-child fallback |
23
- | `actions` | No | Full for current element inventory | Same, plus unknown-element fallback |
24
- | `alert` | No | Full | Full |
25
- | `card` | No | Full | Full |
26
- | `carousel` | No | Full | Full |
27
- | `context_actions` | No | Full | Full |
28
- | `file` | No | Full | Full |
29
- | `input` | No | Full | Full |
30
- | `plan` | No | Full | Full |
31
- | `task_card` | No | Full | Full |
32
- | `video` | No | Full | Full |
33
- | Unknown future discriminator | Possible in retrieved Slack data | Threw `unsupported_block` | Visible `data-block-type` fallback |
34
-
35
- ## Rich-text containers
36
-
37
- | Element | Before | After |
38
- | --- | --- | --- |
39
- | `rich_text_section` | Rendered inline values | Same, with unknown-inline fallback and multiline preservation |
40
- | `rich_text_list` | Real list and ordered `offset`; every indent used the same marker; indent over 8 threw | Real `ul`/`ol`, ordered offset, per-indent marker cycle, indent bounded to 0–8, `border` honored |
41
- | `rich_text_preformatted` | Language exposed; `border` ignored | Language and `border` honored; empty content is safe |
42
- | `rich_text_quote` | Always drew a border; payload `border` ignored | Payload `border: 0 \| 1` controls the inline border |
43
- | Unknown future container | Threw `unsupported_element` | Visible fallback |
44
-
45
- ## Rich-text inline elements and styles
46
-
47
- | Element/style | Before | After |
48
- | --- | --- | --- |
49
- | `text` | Bold, italic, strike, underline, and code as combined CSS | Deterministically nested semantic elements; multiline text preserved |
50
- | `link` | Safe protocols and labels | Same, with nested inline styles |
51
- | `emoji` | Resolver, explicit Unicode, then `:shortcode:` | Resolver, explicit Unicode, core’s emitted shortcode set, then custom shortcode fallback |
52
- | `user`, `channel`, `usergroup`, `team`, `broadcast` | Resolved mentions; inline style was lost | Resolved mentions with inline styles preserved |
53
- | `date` | Resolver or fallback/ISO date; ignored format tokens and URL | Resolver or deterministic UTC Slack-token formatter; fallback on relative/unknown tokens; safe URL |
54
- | `color` | Swatch and value | Same, with inline styles preserved |
55
- | `citation` and Slack reference mentions | Compact textual fallback | Same documented fallback |
56
- | Unknown future inline discriminator | Threw `unsupported_element` | Visible text/reference fallback |
57
-
58
- ## Mrkdwn basics
59
-
60
- | Behavior | Before | After |
61
- | --- | --- | --- |
62
- | `&amp;`, `&lt;`, `&gt;` | Decoded in ordinary text only | Also decoded in links, labels, and code |
63
- | Bold/italic/strike/code nesting | Parsed recursively | Parsed recursively and snapshot-covered |
64
- | `<url\|label>` | Rendered, but entities remained encoded in URL/label | Rendered with decoded entities and protocol guard |
65
- | Date tokens | Fallback or ISO date only | Deterministic UTC token formatting with Slack fallback |
66
- | Emoji shortcodes | Left as colon text | Core-known shortcodes render glyphs; custom names stay readable |
67
-
68
- ## Deliberate fallbacks
69
-
70
- - A `slack_file.id` has no renderable URL, so it remains an alt-labelled image
71
- placeholder. A resolver would require new public API and is outside this
72
- correctness pass.
73
- - Workspace-specific names and custom emoji still require existing resolvers;
74
- IDs/shortcodes remain visible when no resolver is supplied.
75
- - Unknown future blocks/elements use a neutral fallback rather than guessed
76
- Slack UI.
77
- - Malformed JSON still throws `BlockKitInvariantError`. The never-throw
78
- guarantee applies after JSON has a valid block-shaped structure.
79
- - Pixel parity for unharvested Slack Builder permutations remains separate
80
- style-harvest work; this pass does not guess or redesign those styles.
Binary file
Binary file
Binary file
Binary file