Skip to content

Papercut 0.7.0

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 23:01
· 72 commits to main since this release

Added

  • A Gallery page in the docs: a render of every built-in component, with its layout variants and a link to its docs. php site/gallery/render.php rebuilds the images.
  • Three decorators. Stat / <x-doc::stat>: a label, a large value and an optional note on a tinted panel. Totals / <x-doc::totals>: label and amount rows with the amounts right-aligned and total() / <x-doc::kv total> rows emphasised, 45% wide at the right by default, and it doesn't shrink beside a growing paragraph. Signature / <x-doc::signature>: a line to sign on, holding an image, a typed name or nothing, with an optional name, role and date under it. Styled by the new stat.*, totals.* and signature.* named styles.
  • Built-in variants: field line (a form line), badge outline (a border in the tone's colour), card flat (a tinted panel with no border) and section large (a bigger heading). Each badge.<tone> style gains a -300 border colour, which shows only when a border is drawn.
  • KeyValuePair takes a third argument, total; KeyValueList rejects total rows, and in Blade <x-doc::kv total> is only allowed inside <x-doc::totals>.
  • The invoice example uses Totals and the report example's stat cards use Stat (outputs regenerated).
  • Laravel: <x-doc::markup> takes plain HTML in its slot, converted like :html: <x-doc::markup><h3>Results</h3><table>…</table></x-doc::markup>. Blade loops, echoes and components that render HTML work inside; Papercut tags inside throw InvalidStructure.

Fixed

  • A box or table with a percentage width that isn't stretched across its column (align-self or the column's align set to start, center or end) was sized as a share of its own content, not of the column. It is now a share of the column, as in CSS.
  • In a row, an item with a width or basis could shrink to nothing next to a growing item, wrapping every word and sometimes throwing LayoutOverflow. Like CSS's min-width: auto, an item now shrinks no further than the narrowest its content can be (or its own width, if that is smaller).
  • Row sizing follows CSS more closely: growing or shrinking is decided from the sizes after min-width and max-width, the space to share is measured from the base sizes, and an item already held by its minimum or maximum keeps it. Layouts without such limits are unchanged.
  • Word export: a table aligned to the centre or end of its column keeps that alignment.
  • Word export: a badge with a border (such as the outline variant) stays in its line as bordered text, as a filled badge does with shading, instead of turning the whole row into a table.
  • Word export: a box with a background whose children are stacked boxes (a card with a tinted panel, a strip code block) shades every row that has no fill of its own; the body or code area used to come out white.
  • Word export: a box packed to its end or centre (justify) places its content at the bottom or middle of its cell, so a signature rests on its line.

Changed

  • Laravel: <x-doc::markup> with both :html (or :text) and slot content now throws InvalidStructure; the slot used to be dropped. The error for a markup tag with no source now reads "requires one of html, text or HTML in its slot", and for one with two "takes only one of html, text or HTML in its slot".