Files
bip-kit/test
CatoandClaude Fable 5 7c06cbea7a fix: survive oklch tokens in MermaidBlock, make shiki loading traceable (v0.2.1) (#21)
Two fixes from fleetcrown's adoption of the v0.2 renderer:

- MermaidBlock: resolved CSS-var colors are normalized through a canvas
  round-trip before reaching mermaid, whose color parser rejects
  oklch()/lab() — it threw inside initialize(), BEFORE render()'s .catch(),
  blanking every diagram for consumers with modern-color tokens. An
  initialize() failure now costs the reader the theme, never the diagram.
  Theme detection is tolerant: data-theme attr wins, then a light/dark
  class (next-themes attribute="class", Tailwind .dark), then the OS —
  re-rendering live on all three signals.

- Optional-peer loading is now traceable: setHighlighterLoader(() =>
  import("shiki")) (or a `highlighter` prop on ArticleBody/CodeBlock) puts
  the literal specifier in consumer code, so bundlers resolve it and
  Next.js output tracing copies shiki into output:"standalone" deploys.
  The Function-hidden import stays as the zero-config fallback — a bare
  import("shiki") inside bip-kit breaks every no-shiki consumer build
  (verified empirically against turbopack, Next 16.3.4: "Module not found:
  Can't resolve 'shiki'"). Both paths verified with real consumer builds,
  with and without shiki, turbopack and webpack; the traced standalone
  output contains shiki and the prerendered page carries --shiki vars.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-07 04:30:42 +00:00
..