Skip to content

mdxts@0.18.0

Compare
Choose a tag to compare
@github-actions github-actions released this 10 May 09:38
· 61 commits to main since this release
be128e1

Minor Changes

  • b796c3f: Removes LineHighlights component in favor of simpler CSS approach for highlighting lines.

  • cccf278: Renames CodeBlock lineHighlights prop to highlightedLines.

    Breaking Changes

    • CodeBlock lineHighlights prop has been renamed to highlightedLines.
  • 044d1ca: Renames CodeBlock toolbar prop to showToolbar.

    Breaking Changes

    • CodeBlock toolbar prop has been renamed to showToolbar.
  • dfa9384: Fixes CodeBlock accessibility and markup by swapping divs with spans and using a code element around tokens.

  • 564806a: Renames CodeBlock lineNumbers prop to showLineNumbers.

    Breaking Changes

    • CodeBlock lineNumbers prop has been renamed to showLineNumbers.
  • bd646c4: Adds focusedLines and unfocusedLinesOpacity props to the CodeBlock component to control focusing a set of lines and dimming the other lines. It uses an image mask to dim out the lines which can be controlled using unfocusedLinesOpacity:

    ```tsx focusedLines="3-4"
    const a = 1;
    const b = 2;
    const result = a + b;
    console.log(result); // 3
    ```
    <CodeBlock
      value={`const a = 1;\nconst b = 2;\n\nconst add = a + b\nconst subtract = a - b`}
      focusedLines="2, 4"
    />

Patch Changes

  • a02b1d8: Fixes copy button overlapping CodeBlock content by only showing the button when hovering the code block. The button now also sticks to the top right of the code block when scrolling.