diff --git a/.agent/mise-tasks/check/comments b/.agent/mise-tasks/check/comments new file mode 100755 index 0000000..9974210 --- /dev/null +++ b/.agent/mise-tasks/check/comments @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +#MISE description="Run the check's comments step, the width of every comment line in the tracked TS, JS, CSS, shell, and TOML files, 100 columns at most" +# Runs scripts/check/comments.sh, one step of the check. +set -euo pipefail +exec scripts/check/comments.sh "$@" diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cba4fd..376d76c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,47 @@ All notable changes to `@standards-lab/web-components` are documented here. The [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the package adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.4.0] - 2026-12-01 + +This minor release breaks a consumer on web-foundation 0.4: the foundation peer is `^0.5.0`. It +also changes how the frameless lists lay out: `sl-pagination`, `sl-document-list`, and +`sl-search-results` scroll their list inside a host whose height is held, where the page scrolled +past them, and `sl-pagination` insets its list and the rows around it by `--focus-reach`, so a page +that measured or padded around them checks its layout. + +### Added + +- `sl-drawer` gains the `initial-focus` attribute, the `initialFocus` property, which names the id + of a child control for the modal drawer to focus as it opens, in place of its heading. With no + child of that id, the drawer opens on its heading; docked, it focuses nothing. The drawer + specimen's Documents drawer names its filter. +- A browser test opens every example page's dialogs and drawers and checks that each opens on its + first control that edits or chooses, or else on its heading, and never on Close. +- The check gains a comments step, `scripts/check/comments.sh`, which fails on any comment line + longer than 100 columns in the tracked TS, JS, CSS, shell, and TOML files, naming the file and + line; it skips `#MISE` lines. The comment lines it found are rewrapped. +- `sl-pagination` gains a `before` slot, whose children sit on lines of their own between the + summary and the entries, outside the page that scrolls. + +### Changed + +- **Breaking:** the foundation peer is `@standards-lab/web-foundation` at `^0.5.0`, up from + `^0.4.0`, and the development pin is its v0.5.0 tag; a consumer on 0.4 takes 0.5 beside the + components. +- The example pages' Help and Settings dialogs hold `sl-shortcuts` and `sl-settings` in the + foundation's `.dialog-body`, which scrolls under the dialog's header, as the README's markup does. +- The repository's tooling takes pnpm 12.25.1 and globals 17.15.0. +- `sl-pagination`, `sl-document-list`, and `sl-search-results` fill a host whose height is held, + by a size on the host or a sized flex or grid parent, and scroll their list inside it while the + summary, the status line, and the pagination's controls stay in view. When the host's height + isn't held, each is as tall as its content. Each is a flex column whose list, and the rows above + and below it, are inset by the focus outline's reach, so a focused item's outline stays whole + inside the scroller. +- `sl-document-list`'s status line, when it doesn't join the summary, sits in the pagination's + `before` slot, so it stays in view as the entries scroll. +- The specimen pages' narrow section is 390px wide, the narrow case at text 100%, in place of + 20rem. + ## [0.3.0] - 2026-11-30 ### Added @@ -119,6 +160,7 @@ All notable changes to `@standards-lab/web-components` are documented here. The - Releases by tag: each `v` tag marks a pack commit whose tree is the pack, the build included, and whose one parent is main's merge commit; its GitHub release carries the tarball. +[0.4.0]: https://github.com/standards-lab/web-components/releases/tag/v0.4.0 [0.3.0]: https://github.com/standards-lab/web-components/releases/tag/v0.3.0 [0.2.0]: https://github.com/standards-lab/web-components/releases/tag/v0.2.0 [0.1.0]: https://github.com/standards-lab/web-components/releases/tag/v0.1.0 diff --git a/README.md b/README.md index a1b9b72..35dad60 100644 --- a/README.md +++ b/README.md @@ -14,15 +14,15 @@ Each release is a tag, `v`, of [standards-lab/web-components](https://github.com/standards-lab/web-components), whose tree is the package as `pnpm pack` builds it: `package.json`, this README, the LICENSE, and `dist/`, the build. The build lives only in the tag's tree, so the tag installs with no build step, and its manifest -has no scripts. It depends on lit 3.3.3 and marked 18.2.1, and takes the foundation as a peer at -`^0.4.0` and the icons at `^0.1.0`: a consumer declares each beside the components, so the page +has no scripts. It depends on lit 3.3.3 and marked 18.4.0, and takes the foundation as a peer at +`^0.5.0` and the icons at `^0.1.0`: a consumer declares each beside the components, so the page and the components share one copy of each, and a restyle of the foundation's sheets by package name reaches the components' shadow roots too. Install all three by their tags: ``` -pnpm add github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0 -bun add github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0 -npm install --allow-git=root github:standards-lab/web-components#v0.3.0 github:standards-lab/web-foundation#v0.4.0 github:standards-lab/web-icons#v0.1.0 +pnpm add github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0 +bun add github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0 +npm install --allow-git=root github:standards-lab/web-components#v0.4.0 github:standards-lab/web-foundation#v0.5.0 github:standards-lab/web-icons#v0.1.0 ``` npm 12 refuses git dependencies unless `--allow-git` allows them; `root` allows the ones the @@ -57,7 +57,7 @@ the foundation's `page.css`: - `./pagination.js`: `sl-pagination`, a page of entries between its summary and its controls. - `./drawer.js`: `sl-drawer`, its children docked inline on a wide viewport, in a modal drawer below, or in the modal drawer at every width with `modal`; `frameless` docks them with no frame - and no visible heading. + and no visible heading, and `initial-focus` names the child the modal drawer opens on. - `./shortcuts.js`: `sl-shortcuts`, the keyboard shortcuts of the dialog that holds it, as a table. - `./settings.js`: `sl-settings`, the reader's theme and keyboard settings, applied and stored at once. @@ -82,11 +82,11 @@ documents each module in full, and its example pages. The components bind no key, so the page binds S and ? itself, as `examples/components.html` does. Two glyph buttons in the header's `.header-actions` open the dialogs with `command="show-modal"`, and the foundation's `keys.js` binds each to its key through `data-keys`. Help is a `.dialog-fit` -dialog holding `sl-shortcuts`, and Settings is a `.dialog-wide` dialog holding `sl-settings`; each -has a `.dialog-header` whose Close shows the Esc hint. Close and Escape close either dialog with no -script, and focus returns to the element that held it. The page links the foundation's -`glyph-button.css`, `dialog.css`, and `layout.css` after its entry, and web-icons' `iconFill()` -fills the glyphs' markers: +dialog holding `sl-shortcuts`, and Settings is a `.dialog-wide` dialog holding `sl-settings`, each +in a `.dialog-body` that scrolls under a `.dialog-header` whose Close shows the Esc hint. Close and +Escape close either dialog with no script, and focus returns to the element that held it. The page +links the foundation's `glyph-button.css`, `dialog.css`, and `layout.css` after its entry, and +web-icons' `iconFill()` fills the glyphs' markers: ```html
@@ -139,7 +139,9 @@ fills the glyphs' markers:
- +
+ +
@@ -158,7 +160,9 @@ fills the glyphs' markers:
- +
+ +