Releases: k11k-labs/better-blocks-astro-renderer
Release list
v0.7.0
Minor Changes
-
#22
02fd553Thanks @kkukielka! - Fix cross-origin file downloads and add afilePreviewtoggle for file buttons.File-mode download buttons are now tagged
data-bb-downloadand force a real download via a small scoped progressive-enhancement script (a blob fetch saved from a same-origin object URL). The nativedownloadattribute is ignored for cross-origin assets (Strapi/CDN), which made PDFs, videos and images preview inline instead of saving. Without JavaScript the anchor still works via itshref+downloadattributes, and a CORS-blocked fetch falls back to native navigation.Adds the
filePreviewoption (mirrors the editor field): whentrue, the file opens in a new tab (target="_blank" rel="noopener noreferrer", no download) for preview instead of downloading — this path stays fully zero-JS.filePreviewis also passed through to custombuttonrenderers.
v0.6.0
Minor Changes
- #18
6b5acfbThanks @kkukielka! - Add support for thebuttonblock (WordPress-style CTA + Media Library file download). Link mode renders an<a>withhref/target/rel/aria-label; file mode renders a download link with an optional file-type icon (showFileIcon) and human-readable size (showFileSize). Thestyleobject is applied as inline CSS,alignmentcontrols a block-level wrapper, and hover colors are exposed as--bb-button-hover-*custom properties wired up by a scoped stylesheet (hover transition + keyboard focus ring, zero client-side JavaScript). The block is overridable through theblocks.buttonprop.
v0.5.1
Patch Changes
- #16
d61c771Thanks @kkukielka! - Render Mermaid diagrams in color. Previously diagrams were passed tobeautiful-mermaidwith no palette, so every color was derived from a single dark foreground and the output looked monochrome. They now default to a palette that mirrors mermaid.js's familiar look (lavender node fills, purple borders, dark edges), and a newdiagramThemeprop onBlocksRendereraccepts either a built-in theme name (github-light,github-dark,dracula,nord,tokyo-night, …) or a custom color object ({ bg, fg, line, accent, muted, surface, border }). The theme also propagates to diagrams nested insidecalloutanddetailsblocks.
v0.5.0
Minor Changes
- #12
26e1a4aThanks @kkukielka! - Add support for thedetails(collapsible) block. It renders a native, accessible<details>/<summary>disclosure with zero client-side JavaScript, honorsdefaultOpenvia the HTMLopenattribute, supports arbitrarily nesteddetails, and ships a scoped GitHub-inspired stylesheet (retheme via--bb-details-*custom properties). Replace the markup entirely through theblocks.detailsprop.
v0.4.1
Patch Changes
e242e0aThanks @kkukielka! - Fix bottom-heavy callout spacing and align callout styling with GitHub's light alert palette. The body's outer margins now collapse correctly (the scoped:first-child/:last-childrules are applied via:global()so they reach the cross-component body blocks), an ~8% accent-tinted background is added to match the editor preview, and the title spacing and per-variant colors match GitHub's official tokens.
v0.4.0
Minor Changes
- #6
43d33b5Thanks @kkukielka! - Add support forcallout(admonition) nodes from the Better Blocks plugin ({ type: 'callout', variant, title?, children }). Callouts render GitHub-style in five variants — note, tip, important, warning, caution — as an<aside role="note">with a colored left border, a title row (icon + label, or the node's customtitle), and the nested block children rendered recursively. Colors ship in a scoped<style>(zero client-side JavaScript) and adapt to dark mode viaprefers-color-scheme; the per-variant accent is exposed as a--bb-callout-accentcustom property for easy retheming. The block can be overridden with a customcalloutcomponent that receivesvariantandtitle(children via<slot />).
v0.3.0
Minor Changes
- #4
7930308Thanks @kkukielka! - Add support for block-level Mermaiddiagramnodes from the Better Blocks plugin ({ type: 'diagram', format: 'mermaid', value }). Diagrams are pre-rendered to inline SVG on the server withbeautiful-mermaid, so the output is static HTML with zero client-side JavaScript — no browser, no hydration, no Chromium download. Supported diagram types (flowchart, sequence, state, class, ER, xychart) render to<div class="mermaid-diagram">; unsupported types and parse errors fall back to the raw source in<pre class="mermaid-source">so content is never lost. The block can be overridden with a customdiagramrenderer that receivescodeandformatprops.
v0.2.0
Minor Changes
- #1
237946bThanks @kkukielka! - Initial release. Native Astro renderer for Strapi v5 Blocks content with full Better Blocks support — paragraphs, headings, lists (ordered/unordered/todo), links, quotes, code, images, horizontal lines, tables, media embeds, and KaTeX math, plus all text modifiers (bold, italic, underline, strikethrough, code, uppercase, super/subscript, color, background color, font family, font size). Renders to static HTML with zero client-side JavaScript and supports custom block/modifier renderers via Astro components.