@uvalib/web-components 1.11.1 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +197 -57
  3. package/dist/base.css +56 -2
  4. package/dist/components/uvalib-audio/UvalibAudio.d.ts +186 -0
  5. package/dist/components/uvalib-audio/UvalibAudio.js +1154 -0
  6. package/dist/components/uvalib-audio/UvalibAudio.js.map +1 -0
  7. package/dist/components/uvalib-audio/uvalib-audio.d.ts +1 -0
  8. package/dist/components/uvalib-audio/uvalib-audio.js +4 -0
  9. package/dist/components/uvalib-audio/uvalib-audio.js.map +1 -0
  10. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.d.ts +25 -5
  11. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js +62 -9
  12. package/dist/components/uvalib-pagefind-search/UvalibPagefindSearch.js.map +1 -1
  13. package/dist/custom-elements.json +8487 -7188
  14. package/dist/edition-epub.css +567 -0
  15. package/dist/edition-print.css +51 -0
  16. package/dist/edition.css +61 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/styles/base.js +55 -1
  21. package/dist/styles/base.js.map +1 -1
  22. package/dist/styles/edition.d.ts +6 -0
  23. package/dist/styles/edition.js +114 -20
  24. package/dist/styles/edition.js.map +1 -1
  25. package/dist-cdn/base.css +56 -2
  26. package/dist-cdn/chunks/{base-DtkA4Pgg.js → base-D_oPO5cX.js} +56 -2
  27. package/dist-cdn/chunks/{base-DtkA4Pgg.js.map → base-D_oPO5cX.js.map} +1 -1
  28. package/dist-cdn/custom-elements.json +8487 -7188
  29. package/dist-cdn/edition-epub.css +567 -0
  30. package/dist-cdn/edition-print.css +51 -0
  31. package/dist-cdn/edition.css +61 -0
  32. package/dist-cdn/manifest.json +6 -3
  33. package/dist-cdn/site-page.js +1 -1
  34. package/dist-cdn/site-style.js +1 -1
  35. package/dist-cdn/skills/uvalib-web-components/SKILL.md +35 -6
  36. package/dist-cdn/skills/uvalib-web-components/reference/components.md +53 -1
  37. package/dist-cdn/uvalib-audio.js +747 -0
  38. package/dist-cdn/uvalib-audio.js.map +1 -0
  39. package/dist-cdn/uvalib-pagefind-search.js +70 -44
  40. package/dist-cdn/uvalib-pagefind-search.js.map +1 -1
  41. package/package.json +7 -1
  42. package/skills/uvalib-web-components/SKILL.md +35 -6
  43. package/skills/uvalib-web-components/reference/components.md +53 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.12.1 — 2026-11-30
4
+
5
+ ### Features
6
+
7
+ - uvalib-edition--unclear-underline, a dotted underline for unclear text (issue #45)
8
+
9
+ ### Fixes
10
+
11
+ - notes inside verse lines flush with the stanza; quotations upright (issues #43, #44)
12
+
13
+ ### Other
14
+
15
+ - Merge branch 'fix/edition-43-45': notes in verse lines (issue #43), upright quotations (issue #44), unclear-underline (issue #45); repair SKILL.md frontmatter from 1.12.0
16
+ - one key per frontmatter line, and no merge-conflict markers in shipped text
17
+
18
+ ## v1.12.0 — 2026-11-30
19
+
20
+ ### Features
21
+
22
+ - <uvalib-audio>, a long recording played by chapter (issue #41)
23
+ - edition-epub.css and edition-print.css for EPUB and PDF downloads (issue #42)
24
+ - filter-flags for one-value filters linked as ?x=1 (issue #40)
25
+
26
+ ### Fixes
27
+
28
+ - allow a blob: URL for download-href (a recording made in the page)
29
+
30
+ ### Other
31
+
32
+ - Merge branch 'integrate/xtf2': filter-flags (issue #40), <uvalib-audio> (issue #41), edition-epub.css and edition-print.css (issue #42)
33
+ - Merge branch 'feat/uvalib-audio' into integrate/xtf2
34
+ - Merge branch 'feat/edition-epub' into integrate/xtf2
35
+ - Merge branch 'feat/pagefind-filter-flags' into integrate/xtf2
36
+ - Audiobook by chapter example, with chapters made in the page as WAV tones (issue #41)
37
+ - register uvalib-audio (vite, manifest, exports, index, size budgets, base.css pre-upgrade hold, catalogue tests)
38
+
3
39
  ## v1.11.1 — 2026-11-26
4
40
 
5
41
  ### Fixes
package/README.md CHANGED
@@ -13,7 +13,8 @@ Reusable web components for UVA Library sites, built with Lit and TypeScript:
13
13
  - **Images:** `<uvalib-lightbox>` (an image viewer over plain links), `<uvalib-photo-grid>` (justified rows of thumbnails) and `<uvalib-image-regions>` (numbered region outlines on an image, with their list).
14
14
  - **Maps:** `<uvalib-map>` (places on the page's own Leaflet map, sized by a count, with a linked list).
15
15
  - **Search:** `<uvalib-filter>`, `<uvalib-date-range>`, `<uvalib-date-histogram>`, `<uvalib-combobox>` (a text field that suggests values as you type), `<uvalib-list-filter>` (a field that filters a long list on the page as you type), `<uvalib-filter-drawer>` (the filters as a sidebar, or a modal panel on phones), `<uvalib-dialog>` (a modal dialog for search tips, Cite or a short form) and `<uvalib-pagefind-search>` (with `pagefind.css`, the library theme for Pagefind static-site search).
16
- - **Reading texts:** `edition.css` (reading styles for TEI texts converted to class-annotated HTML).
16
+ - **Reading texts:** `edition.css` (reading styles for TEI texts converted to class-annotated HTML), and `edition-epub.css` / `edition-print.css` for the same texts as EPUB and PDF downloads.
17
+ - **Audio:** `<uvalib-audio>` (a long recording played by chapter: an audiobook, an oral history).
17
18
  - **Library hours:** `<site-hours-section>`, `<library-weekly-hours>` and `<library-hours-setup>`.
18
19
  - **Library events:** `<events-section>`.
19
20
  - **Search results:** `<bento-box>` (library.virginia.edu/search), with its `<catalog-section>`, `<articles-section>`, `<libguides-section>` and `<website-section>`.
@@ -1259,14 +1260,84 @@ A sidebar beside the main content on wide screens, stacked on narrow ones: libra
1259
1260
  </div>
1260
1261
  ```
1261
1262
 
1262
- - **The look** is the library's, not a facsimile's: Franklin Gothic (`--uva-font-family`; serif body text is on the UX team's deprecated list), a 70ch measure at 1.125rem with a 1.7 line height, headings in the theme's colour and scale, epigraphs and quotations as the theme's blockquote (1px orange start border, italic), ornaments as a centred muted ⁂, footnotes after a rule in smaller text, and page breaks as small muted labels (a link to the page image is underlined in the link colour, at least 24px tall, with the library focus ring). Headings and title pages are left-aligned except where the text says `rend-center`.
1263
- - **Class vocabulary.** Structure: `div` (and `div-*`, the TEI `@type`: `div-letter`, `div-poem`, `div-chapter`), `head` (`head-sub`), `p`, `ab`, `seg-*`, `list` (`list-simple`, `label`, `list-head`), `table-wrap`. Verse: `lg`, `l` (with `data-n`, shown as a line number). Drama: `sp`, `speaker`, `stage`. Letters: `opener`, `closer`, `dateline`, `salute`, `signed`, `postscript` (or `seg-postscript`). Front and back matter: `epigraph`, `argument`, `trailer`, `byline`, `dedication`, `bibl`, `cit`, `q`, `titlepage` (or ETC's `titlePage`), `titlePart`, `docTitle`, `docAuthor`, `docImprint`, `docDate`. Figures: `figure`, `figDesc` (or a `head` inside it). Editorial: `add`, `del`, `sic`, `orig`, `reg`, `corr`, `unclear`, `gap`. Notes: `noteref`, `footnotes`, `note` (`note-foot`, `note-end`, `note-n`, `note-body`), `note-inline` (a box as `aside`, bracketed as `span`). Breaks: `lb`, `pb` (`pb-n` for a label, `a.pb-image` for a link to the page image), `ornament`, `textbreak`. Renditions: `rend-italic`, `rend-bold`, `rend-roman`, `rend-smallcaps` (or `rend-small-caps`), `rend-underline`, `rend-sup`, `rend-sub`, `rend-center`, `rend-right`, `rend-left`, `rend-indent`, `rend-indent2`, `rend-indent3` (`rend-indent4` on verse lines), `rend-no-indent`, `rend-hang`.
1264
- - **Editorial marks never rest on colour or strike-through alone.** An addition (raised, smaller) and a deletion (struck through) are announced by screen readers as "added: … (end added)" and "deleted: … (end deleted)" (generated text hidden from sight); an empty deletion shows "[deletion]". Unclear text is followed by a small "[?]" read as "(unclear)"; an empty `gap` shows "[…]" read as "gap in the text". A note reference is read as "Note 1". Line numbers and ornaments are hidden from screen readers.
1263
+ - **The look** is the library's, not a facsimile's: Franklin Gothic (`--uva-font-family`; serif body text is on the UX team's deprecated list), a 70ch measure at 1.125rem with a 1.7 line height, headings in the theme's colour and scale, epigraphs and quotations as the theme's blockquote (1px orange start border; quotations upright, epigraphs italic, see below), ornaments as a centred muted ⁂, footnotes after a rule in smaller text, and page breaks as small muted labels (a link to the page image is underlined in the link colour, at least 24px tall, with the library focus ring). Headings and title pages are left-aligned except where the text says `rend-center`.
1264
+ - **Quotations are upright** (`blockquote`, `quote`, `q`, `cit`), set apart by the orange rule and the indent alone; **epigraphs** (`epigraph`) keep the theme's italic, and italics inside an epigraph (`i`, `em`, `cite`, `rend-italic`, `stage`, `gap`…) turn upright, back to italic in its `bibl`. This departs on purpose from library.virginia.edu's italic blockquote (for UX review): a quoted document can run for pages, and its italics (titles, foreign words, emphasis) must still show; in ETC, 1,296 of 3,450 quotations contain italics.
1265
+ - **Notes inside verse lines** (`<div class="l">…<aside class="note">…</aside></div>`, a TEI `note place="right"` in an `l`) are boxes flush with the stanza at the same width in every line, whatever the line's indent or line numbers, with the number beside the text, as every note in the flow has it.
1266
+ - **Class vocabulary.** Structure: `div` (and `div-*`, the TEI `@type`: `div-letter`, `div-poem`, `div-chapter`), `head` (`head-sub`), `p`, `ab`, `seg-*`, `list` (`list-simple`, `label`, `list-head`), `table-wrap`. Verse: `lg`, `l` (with `data-n`, shown as a line number). Drama: `sp`, `speaker`, `stage`. Letters: `opener`, `closer`, `dateline`, `salute`, `signed`, `postscript` (or `seg-postscript`). Front and back matter: `epigraph`, `argument`, `trailer`, `byline`, `dedication`, `bibl`, `cit`, `q`, `titlepage` (or ETC's `titlePage`), `titlePart`, `docTitle`, `docAuthor`, `docImprint`, `docDate`. Figures: `figure`, `figDesc` (or a `head` inside it). Editorial: `add`, `del`, `sic`, `orig`, `reg`, `corr`, `unclear`, `gap`; the modifier `uvalib-edition--unclear-underline` (on the edition, or on `<body>` in an EPUB) marks unclear text with a dotted underline instead of "[?]". Notes: `noteref`, `footnotes`, `note` (`note-foot`, `note-end`, `note-n`, `note-body`), `note-inline` (a box as `aside`, bracketed as `span`). Breaks: `lb`, `pb` (`pb-n` for a label, `a.pb-image` for a link to the page image), `ornament`, `textbreak`. Renditions: `rend-italic`, `rend-bold`, `rend-roman`, `rend-smallcaps` (or `rend-small-caps`), `rend-underline`, `rend-sup`, `rend-sub`, `rend-center`, `rend-right`, `rend-left`, `rend-indent`, `rend-indent2`, `rend-indent3` (`rend-indent4` on verse lines), `rend-no-indent`, `rend-hang`.
1267
+ - **Editorial marks never rest on colour or strike-through alone.** An addition (raised, smaller) and a deletion (struck through) are announced by screen readers as "added: … (end added)" and "deleted: … (end deleted)" (generated text hidden from sight); an empty deletion shows "[deletion]". Unclear text is followed by a small "[?]" read as "(unclear)". For heavily marked texts, the opt-in class `uvalib-edition--unclear-underline` on the `.uvalib-edition` element or any ancestor (`<body>` in an EPUB or the HTML a PDF is printed from, carried into `edition-epub.css` and `edition-print.css`) gives non-empty `unclear` a muted dotted underline instead (`--uva-color-text-muted`, at least 3:1 in light and dark, fixed grey #4b5563 in the downloads; dotted so it is not taken for a link, and kept in forced colours) with "(unclear)" as visually hidden generated text, as for additions; an empty `unclear` (nothing to underline) keeps its "[?]". Reading systems that speak generated text say "(unclear)"; one that cannot clip it shows "(unclear)" in the text; one without dotted underlines shows no underline. An empty `gap` shows "[…]" read as "gap in the text". A note reference is read as "Note 1". Line numbers and ornaments are hidden from screen readers.
1265
1268
  - **Readings** (`title` on `orig`, `reg`, `sic`, `corr` or `abbr`) get a dotted underline. A `title` shows only on mouse hover and most screen readers do not read it on plain text, so the readings toggle (a checkbox `.uvalib-edition__readings`, or the class `uvalib-edition--readings` on the edition) shows every reading inline in brackets, and print always does. Without the toggle, keyboard and touch users cannot reach them.
1266
1269
  - **Original line breaks.** Prose reflows: `br.lb` is hidden. CSS cannot give a `<br>` a space (browsers ignore `content` on it), so **the converter must keep whitespace before each `<br class="lb">`** or the words on either side run together (ETC's text does: all 12,061 in a sample of 70 pages; a contents label built from a heading's text, which drops the `<br>`, needs the same care); or write `<span class="lb"></span>`, which edition.css spaces itself. A line ending inside a word (`ca<lb/>pite`) needs the converter to drop the break. Lineation is shown by a checked `.uvalib-edition__lines` (a `<label>` round a checkbox, drawn like the library's outline toggle and filled while checked, or the checkbox itself) inside the edition or anywhere in an element before it, or by the class `uvalib-edition--lines` (for a script toggle such as a `.uvalib-button[aria-pressed]`). Verse lines (`l`) always break.
1267
1270
  - **Page images:** `<uvalib-lightbox selector=".uvalib-edition a.pb-image">` opens each `a.pb-image` in the viewer (Previous and Next through the pages); without JavaScript the link opens the image. A page break that starts a section sits on its own line at the end.
1268
1271
  - **Dark mode** via the role tokens; **forced colors** keeps the page labels, the note box and the checked toggle visible; **print** shows the text full width in black, keeps the page-break labels, shows every reading, and hides the toggles. Wide tables in `table-wrap` scroll sideways; give the wrapper `tabindex="0"` and a name in the converter if it can scroll. See the [edition example](https://uvalib.github.io/reusable-web-library/#edition).
1269
1272
 
1273
+ ### Downloads: EPUB and PDF (edition-epub.css, edition-print.css)
1274
+
1275
+ For the same text offered as an EPUB 3 file or a PDF printed from the same HTML, `edition-epub.css` is `edition.css` rewritten at build time (from the same source, so the two can't drift) in CSS that reading systems handle: the same class names and look, with plain unscoped selectors (`.lg`, `.sp > :not(.speaker):not(.stage)`; no `:where()`, `:is()` or `:has()`), fixed light colours (muted text 7.5:1 on white) instead of the role tokens, physical properties instead of logical ones, `:before`/`:after`, and no `@layer`, `@supports`, `var()`, `min()`/`max()`/`clamp()`, `@media` or `@page`. An EPUB content document holds only the text, so no `.uvalib-edition` wrapper is needed (the wrapper's rule applies to `body`). `edition-print.css`, linked after it for a PDF, adds the page (`@page` margins 2cm 2.2cm 2.4cm and the page number at the foot, none on the first page) and `edition.css`'s print rules (black text at 11pt, readings shown inline, no breaks inside stanzas or notes).
1276
+
1277
+ ```xml
1278
+ <!-- In each EPUB content document (copy the file into the EPUB and list it in the manifest) -->
1279
+ <link rel="stylesheet" type="text/css" href="edition-epub.css" />
1280
+ ```
1281
+
1282
+ ```html
1283
+ <!-- The HTML a PDF is printed from (for example by headless Chromium) -->
1284
+ <link
1285
+ rel="stylesheet"
1286
+ href="https://unpkg.internal.lib.virginia.edu/web-components/v1/edition-epub.css"
1287
+ />
1288
+ <link
1289
+ rel="stylesheet"
1290
+ href="https://unpkg.internal.lib.virginia.edu/web-components/v1/edition-print.css"
1291
+ />
1292
+ ```
1293
+
1294
+ - **The reader's choices win:** no font family (the reading system's or the reader's own; a PDF printed with no font of its own gets the browser's default, which the site may set: the UX team's no-serif rule is for the web), no font size, no body text colour (a reading system's night mode sets it) and no measure. Headings stay in the library's blue and muted text in its grey.
1295
+ - **Nothing interactive:** no line-break or readings toggles (prose reflows; verse lines break), no hover, focus or target rules, and readings (`title` on `orig`, `reg`, `sic`, `corr`) keep no dotted underline in the EPUB, where nothing shows a title; the PDF shows them inline.
1296
+ - **Differences from the web edition:** room for a line number is kept on numbered lines only (no `:has()` to find a numbered stanza); the inline note box has its start rule but no grey fill (a night mode that lightens the text and not the fill would hide it); the gap after a note number is a margin, not flex `gap`.
1297
+ - **Screen readers:** the hidden "added:", "deleted:" and "Note" words use `clip` as well as `clip-path`. Generated content can't carry alternative text in these sheets (`content: x / ''` is too new), so line numbers, the ⁂ ornament, "[?]" and "[…]" are read as they are, if the reading system reads generated content at all; VoiceOver in Apple Books usually does, and some readers read none of it.
1298
+ - **Not tested here:** real reading systems (Apple Books, Kobo, Thorium, Adobe Digital Editions) and epubcheck; the test suite checks the sheets avoid the features above and that the text renders as the web edition does in Chromium. Right-to-left texts get left-to-right margins (physical properties).
1299
+
1300
+ ## Audio by chapter
1301
+
1302
+ `<uvalib-audio>` plays a long recording that comes in parts, an audiobook's chapters or an oral history's sessions: one player for the whole list, so starting a chapter stops the one playing. Its children are a plain list of links to the files, so the page works before (and without) the script. Entry: `uvalib-audio.js` on the CDN, `@uvalib/web-components/uvalib-audio.js` on npm. See the [Audiobook by chapter](https://uvalib.github.io/reusable-web-library/#audiobook) example.
1303
+
1304
+ ```html
1305
+ <script
1306
+ type="module"
1307
+ src="https://unpkg.internal.lib.virginia.edu/web-components/v1/uvalib-audio.js"
1308
+ ></script>
1309
+
1310
+ <uvalib-audio
1311
+ label="Alice’s Adventures in Wonderland"
1312
+ download-href="alice.m4b"
1313
+ download-label="Download the whole book"
1314
+ download-size="161234567"
1315
+ >
1316
+ <ol>
1317
+ <li><a href="ch00.mp3" data-duration="1:12">Front matter</a></li>
1318
+ <li>
1319
+ <a href="ch01.mp3" data-duration="12:31">1. Down the Rabbit-Hole</a>
1320
+ <a href="../CarAlic.html#ch1">Read the text</a>
1321
+ </li>
1322
+ <li data-download data-size="9800000">
1323
+ <a href="ch02.mp3" data-duration="10:02">2. The Pool of Tears</a>
1324
+ </li>
1325
+ </ol>
1326
+ </uvalib-audio>
1327
+ ```
1328
+
1329
+ - **Chapters.** The first link in each `<li>` is the chapter: its text is the title (inline markup such as `<i>` and `lang` is kept) and `data-duration` (`12:31`, `1:02:03` or seconds) is shown beside it and gives the slider its length before the file loads. Other links in the item (the chapter's text, a transcript) stay links, after it. `data-download` on the `<li>` adds a Download link for that chapter (its own file, or the URL given), with `data-size`. An item with no link to a file is skipped with a warning.
1330
+ - **Upgraded**, each chapter is a real button whose visible text is its name (“Play 1. Down the Rabbit-Hole”, 44px), with its duration. The current chapter gets `aria-current="true"` and says “Now playing” or “Paused” in text (white on the library blue, AAA), beside an orange bar. Above the list, the player for the current chapter: what is playing (plain text), Back 15 s, Play/Pause and Forward 30 s (the podcast convention: back a missed phrase, ahead past a pause), a native range slider named “Position” and read as “12 minutes 30 seconds of 41 minutes” (the arrow keys move it 1 s), the elapsed and total time as text (never a live region), and a native Speed select (0.75×, 1×, 1.25×, 1.5×, 1.75×, 2×; native for its keyboard and screen-reader support everywhere). Every control is 44px with the library focus ring; keys are the native controls' own (no page-wide shortcuts).
1331
+ - **Nothing plays on its own** and nothing loads until a Play press: one `<audio preload="none">` plays every chapter. `continuous` plays the next chapter when one ends (off by default). Starting one `<uvalib-audio>` pauses any other on the page. Removing the element stops it.
1332
+ - **Resume.** The chapter, position and speed are kept in localStorage for the page (its path, plus `storage-key` when a page has more than one recording), saved on pause, every 5 s while playing and when the page is left, and cleared when the last chapter ends. On the next visit a “Resume “4. The Rabbit Sends in a Little Bill” at 12:30” button offers to carry on; it never plays by itself. `no-resume` turns it off; blocked storage just forgets.
1333
+ - **Announcements** go to one polite status: “Playing <chapter>”, “Paused”, “Speed 1.5 times”, and after Back or Forward where it landed (a burst of presses once, where it ends). The running time is never announced.
1334
+ - **Errors.** A chapter that cannot be played says “This chapter could not be played.” in text, with a link to its file.
1335
+ - **Download.** `download-href` adds a link to the whole recording (an M4B audiobook with chapters plays in Apple Books, most podcast apps and VLC), `download-label` its text (default “Download the whole recording”), `download-size` its size: bytes are shown in decimal units (“161 MB”), text as written.
1336
+ - **Media Session.** Where the browser has it, the lock screen and media keys show the chapter (and `label`, else the page title) and can play, pause, seek and change chapter.
1337
+ - **Before it upgrades**, `base.css` holds the player's height above the list (one, two or three rows of controls by the element's width, and the download line) and lays the links out as the upgraded rows, so the page does not move. On a phone a title or label that wraps differently can still move it a line.
1338
+ - **Analytics.** `['uvalib-audio', 'play', 'chapter <N>', N]` the first time each chapter plays in a page view (N is its place in the list, never the title or URL), `complete` when it plays to its end, `speed` once the visitor settles on one (name and value the speed), `resume` with the chapter, and `download` (`recording` or `chapter <N>`).
1339
+ - Shadow DOM by default; `no-shadow-dom` and `no-style` as for the other components; dark mode, forced colors and 320px reflow. Room for a cast or credits is the page's: a `.uvalib-table` after it.
1340
+
1270
1341
  ## Back to top
1271
1342
 
1272
1343
  `<uvalib-back-to-top>` is a “Back to top” button for long pages: minutes, finding aids, transcriptions, long result lists. Entry: `uvalib-back-to-top.js` on the CDN, `@uvalib/web-components/uvalib-back-to-top.js` on npm. See the [Back to top](https://uvalib.github.io/reusable-web-library/#back-to-top) example.
@@ -2052,6 +2123,18 @@ Static sites that search with [Pagefind](https://pagefind.app) (such as Electron
2052
2123
  - **What it fixes in the stock UI:** text at 16px and up (the stock scale makes it 12.8px), a readable placeholder (stock: 20% opacity), the library focus ring on every control, a hidden Clear button that can no longer take focus (stock: invisible but focusable), native checkboxes (the stock ones vanish in forced colors), 44px targets for the filter headings, rows and buttons, no fixed heights that clip zoomed or spaced text, no arrow glyph read out before each sub-result, and a 320px reflow. Text is 7:1 or more (WCAG AAA) in light and dark, except the Load more button's white on blue-alt in light mode (4.7:1, as on every `.uvalib-button`).
2053
2124
  - **What needs script, done by `<uvalib-pagefind-search>`:** a visible `<label>` for the field (the stock field is named only by its `title` and has no id to point a label at), a polite status region that announces "7 results for virginia" once results settle (the stock message is not a live region), focus kept in the field after Clear and Escape (the stock UI blurs it) and moved to the first new result after "Load more results", and the loading placeholders' dots hidden from screen readers. It also reads `?q=` when it starts (and again on Back and Forward) and writes the settled query back with `history.replaceState` (`query-param`, default `q`; empty turns it off), and reports to `<site-analytics>`: the settled search (`trackSearch`, category `Pagefind`, with the result count, once per query and filter set) and `['uvalib-pagefind-search', 'filter-change', '<filter>: <value>', 1 | 0]`.
2054
2125
  - **Filters in the URL: `filter-params`.** List Pagefind filter names, space-separated (`filter-params="collection author"`), and each becomes a URL parameter of the same name, so a collection page can link to `/search/?collection=Manuscripts` ("Search this collection") or `/search/?q=virginia&collection=Manuscripts`. A repeated parameter (`?collection=A&collection=B`) checks several values; as with boxes checked by hand, Pagefind then wants pages with every one. At start (and on Back and Forward) the element loads the index, waits for Pagefind's filter list, checks the URL's values and applies them with the query, so there is one search; those filter groups start open (added to any `openFilters` in `options`), so the visitor sees why the results are narrowed. Values the index does not have are dropped without an error (matched without regard to case, then written back in the index's own case), so a stale link searches everything rather than showing no results; if the filter list never appears (an index with no filters), it searches without them after 10 s. Checking or unchecking a named filter writes it back with `history.replaceState`, keeping every other parameter; unchecking the last value removes the parameter. Filters not named stay out of the URL. A filter set from the URL is not a `filter-change` event; the settled search is still reported once, with the filters in its key. Without a query, the filters wait for the first search, as in Pagefind. Do not add your own `triggerFilters` script for this.
2126
+ - **One-value filters as on/off links: `filter-flags`.** A "has X" filter (has an audiobook, has page images, digitized) has one value in the index, such as `Available`, and is usually linked as `?audiobook=1`, which `filter-params` would ignore (the index has no value `1`). List such filters in `filter-flags` (`filter-flags="audiobook"`, space-separated): the parameter with any value, or none (`?audiobook`, `?audiobook=1`, `?audiobook=yes`), checks the filter's one value, however the index spells it; `0`, `false`, `no` and `off` (any case) leave it unchecked. Checking its box writes `?audiobook=1`, unchecking removes it, keeping every other parameter. Everything else is as with `filter-params`: read at start with the query as one search, its group open, Back and Forward, the `searching` hold, no `filter-change` event for a value set from the URL. A name in `filter-flags` need not be in `filter-params` too (listing it in both is allowed: it is a flag). If the index has no value or several for a flag filter, the element does not guess: it warns once in the console and reads that filter as `filter-params` (exact values). A page that rewrote `?audiobook=1` to `?audiobook=Available` with its own inline script before the element can drop the script:
2127
+
2128
+ ```html
2129
+ <uvalib-pagefind-search
2130
+ bundle-path="/pagefind/s0/"
2131
+ filter-params="collection"
2132
+ filter-flags="audiobook"
2133
+ ></uvalib-pagefind-search>
2134
+ ```
2135
+
2136
+ There is no general value-alias attribute (`?x=1` meaning some other value of a filter with several values); link with the index's own values for those.
2137
+
2055
2138
  - **A search from the URL holds the page still: `searching`.** Pagefind's results arrive after the page has painted, so a page opened with `?q=` used to push everything below the search (the footer) down as they loaded: Lighthouse measured CLS 0.274 on Electronic Text Collections. Mark the element `searching` when the URL has a query, in the page's HTML before any script runs, with one line after the element (or server-side):
2056
2139
 
2057
2140
  ```html
@@ -2131,59 +2214,64 @@ Static sites that search with [Pagefind](https://pagefind.app) (such as Electron
2131
2214
  - **`<site-page matomo-id="N">`** (and optional `matomo-url` and `matomo-downloads`) adds one `<site-analytics>` for that site and loads its code only then. Off by default. While that code loads, what the components report is kept and handed over, so an early bento search is not lost. If the page already has a `<site-analytics>` or `<uvalib-analytics>` (including the old v0.0.12 one), site-page adds none and that element does the recording.
2132
2215
  - **What the library's components send.** They only fire `uvalib-analytics-*` events, so nothing happens without an analytics element (the old v0.0.12 element records them too). Every event is `[category, action, name?, value?]`: the category is the component's tag, the action a fixed verb, the name a short label from the library's own chrome or data (never a URL, never typed text), the value a number. Each one follows a visitor's action or a real failure: nothing is sent on render, re-render, the initial state or a restored one (a filter value set by the app, a remembered colour scheme). Errors are sent once per element and kind of failure.
2133
2216
 
2134
- | Component | Action | Name | Value |
2135
- | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
2136
- | `site-header` | `link-click` (a utility or site link) | the link's label | |
2137
- | `site-header` | `menu-open` (the phone Menu popover) | | |
2138
- | `site-header` | `skip-link`, `logo-click` | | |
2139
- | `site-header` | `color-scheme` | `light`, `dark` or `system` | |
2140
- | `site-main-nav` | `menu-open` (a group opens, not closes) | the group's label | |
2141
- | `site-main-nav` | `link-click` | `Group > Link` (a top-level link: its label) | |
2142
- | `site-footer` | `link-click` (not the pre-footer's) | `Column: Link`, e.g. `About: Staff directory`; `Contact us: Phone`, `Contact us: Email`; `Social: Facebook`, `Social: Instagram` | |
2143
- | `uvalib-breadcrumbs` | `link-click` | `level N` (never the label) | N, from 1 |
2144
- | `uvalib-card` | `card-click` | `single`, or the card's place in its grid (`1`, `2`, …); never the title or URL | that place, from 1, in a grid |
2145
- | `uvalib-pager` | `page-change` | `next`, `previous` or `number` (never the label or URL) | the page, for `number` only |
2146
- | `uvalib-pager` | `load-more` | (empty) | the next page |
2147
- | `uvalib-tabs` | `change` | the tab's label (capped at 100 characters; not a URL) | |
2148
- | `uvalib-contents` | `link-click` | `level N` (never the label or URL) | N, from 1 (the top level) |
2149
- | `uvalib-contents` | `toggle` (the narrow-screen disclosure) | `open` or `close` | |
2150
- | `uvalib-metadata` | `copy-citation` (downloads are left to Matomo's, or to `downloads="event"`) | | |
2151
- | `uvalib-metadata` | `show-all`, `show-fewer` (a long list's toggle) | `row N` (the row's place in the list; never its label or values) | |
2152
- | `uvalib-citation` | `format` (once the visitor settles on one), `copy`, `download` (the RIS link) | the format's name (`MLA`, `APA`…), or `ris` for `download`; never the citation | |
2153
- | `uvalib-lightbox` | `open`, `next`, `previous`, `full-size` | `image N` (never the URL or the caption) | N, from 1 |
2154
- | `uvalib-lightbox` (versions) | `compare` | `switch`, `wipe` or `fade` (never a version's label or URL) | the version's place, from 1 |
2155
- | `uvalib-image-regions` | `select` (an outline clicked; nothing on hover or focus) | the list's `label` (never a region's label) | the region's number, from 1 |
2156
- | `uvalib-tag-list` | `tag-click` | `list N` (the list's place on the page), or with `track-label` the list's own fixed `label`; never the tag's text or URL | the tag's place, from 1 |
2157
- | `uvalib-tag-list` | `show-all`, `show-fewer` | `list N`, or with `track-label` the `label` | |
2158
- | `site-alerts` | a content impression, once per alert per page view: `trackContentImpression('Library alert', '<severity>: <title>')` | | |
2159
- | `site-alerts` | `dismiss`, `link-click` (a link in an alert's text) | `<severity>: <title>` | |
2160
- | `site-alerts` | `error` (the alerts script failed to load) | `alerts-script` | |
2161
- | `events-section` | `event-click` | the `category` id, or `all` | the event's position, from 1 |
2162
- | `events-section` | `error` | `events-load` | |
2163
- | `site-hours-section` | `link-click` | `See all hours` | |
2164
- | `site-hours-section`, `library-weekly-hours` | `error` | `hours-load` | |
2165
- | `library-weekly-hours` | `week-change` | `next` or `previous` | |
2166
- | `uvalib-chip-group` | `change` (single: 1 s after the last change, and only if it differs from where it started; multi: each toggle) | `<group label>: <chip label>` | the chip's count, when it has one |
2167
- | `uvalib-chip-group` | `select` (links mode) | the group's label (never the chip or its URL) | |
2168
- | `uvalib-combobox` | `select` (a suggestion chosen) | the field's label (never the typed text or the suggestion) | the suggestion's position, from 1 |
2169
- | `uvalib-combobox` | `clear` (the clear button, or Escape on a closed list) | the field's label | |
2170
- | `uvalib-combobox` | `error` (`src` failed to load) | `load` | |
2171
- | `uvalib-list-filter` | `filter` (once the typing settles on a new query, 1 s after the last keystroke) | empty (never the typed text) | how many items match |
2172
- | `uvalib-list-filter` | `clear` (the clear button, Escape, or the field emptied by typing) | | |
2173
- | `uvalib-filter-drawer` | `open`, `close` (by the visitor: the button, Close, Escape or the backdrop; not a resize or a script) | the drawer's `label` | |
2174
- | `uvalib-back-to-top` | `click` | | |
2217
+ | Component | Action | Name | Value |
2218
+ | -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
2219
+ | `site-header` | `link-click` (a utility or site link) | the link's label | |
2220
+ | `site-header` | `menu-open` (the phone Menu popover) | | |
2221
+ | `site-header` | `skip-link`, `logo-click` | | |
2222
+ | `site-header` | `color-scheme` | `light`, `dark` or `system` | |
2223
+ | `site-main-nav` | `menu-open` (a group opens, not closes) | the group's label | |
2224
+ | `site-main-nav` | `link-click` | `Group > Link` (a top-level link: its label) | |
2225
+ | `site-footer` | `link-click` (not the pre-footer's) | `Column: Link`, e.g. `About: Staff directory`; `Contact us: Phone`, `Contact us: Email`; `Social: Facebook`, `Social: Instagram` | |
2226
+ | `uvalib-breadcrumbs` | `link-click` | `level N` (never the label) | N, from 1 |
2227
+ | `uvalib-card` | `card-click` | `single`, or the card's place in its grid (`1`, `2`, …); never the title or URL | that place, from 1, in a grid |
2228
+ | `uvalib-pager` | `page-change` | `next`, `previous` or `number` (never the label or URL) | the page, for `number` only |
2229
+ | `uvalib-pager` | `load-more` | (empty) | the next page |
2230
+ | `uvalib-tabs` | `change` | the tab's label (capped at 100 characters; not a URL) | |
2231
+ | `uvalib-contents` | `link-click` | `level N` (never the label or URL) | N, from 1 (the top level) |
2232
+ | `uvalib-contents` | `toggle` (the narrow-screen disclosure) | `open` or `close` | |
2233
+ | `uvalib-metadata` | `copy-citation` (downloads are left to Matomo's, or to `downloads="event"`) | | |
2234
+ | `uvalib-metadata` | `show-all`, `show-fewer` (a long list's toggle) | `row N` (the row's place in the list; never its label or values) | |
2235
+ | `uvalib-citation` | `format` (once the visitor settles on one), `copy`, `download` (the RIS link) | the format's name (`MLA`, `APA`…), or `ris` for `download`; never the citation | |
2236
+ | `uvalib-lightbox` | `open`, `next`, `previous`, `full-size` | `image N` (never the URL or the caption) | N, from 1 |
2237
+ | `uvalib-lightbox` (versions) | `compare` | `switch`, `wipe` or `fade` (never a version's label or URL) | the version's place, from 1 |
2238
+ | `uvalib-image-regions` | `select` (an outline clicked; nothing on hover or focus) | the list's `label` (never a region's label) | the region's number, from 1 |
2239
+ | `uvalib-tag-list` | `tag-click` | `list N` (the list's place on the page), or with `track-label` the list's own fixed `label`; never the tag's text or URL | the tag's place, from 1 |
2240
+ | `uvalib-tag-list` | `show-all`, `show-fewer` | `list N`, or with `track-label` the `label` | |
2241
+ | `site-alerts` | a content impression, once per alert per page view: `trackContentImpression('Library alert', '<severity>: <title>')` | | |
2242
+ | `site-alerts` | `dismiss`, `link-click` (a link in an alert's text) | `<severity>: <title>` | |
2243
+ | `site-alerts` | `error` (the alerts script failed to load) | `alerts-script` | |
2244
+ | `events-section` | `event-click` | the `category` id, or `all` | the event's position, from 1 |
2245
+ | `events-section` | `error` | `events-load` | |
2246
+ | `site-hours-section` | `link-click` | `See all hours` | |
2247
+ | `site-hours-section`, `library-weekly-hours` | `error` | `hours-load` | |
2248
+ | `library-weekly-hours` | `week-change` | `next` or `previous` | |
2249
+ | `uvalib-chip-group` | `change` (single: 1 s after the last change, and only if it differs from where it started; multi: each toggle) | `<group label>: <chip label>` | the chip's count, when it has one |
2250
+ | `uvalib-chip-group` | `select` (links mode) | the group's label (never the chip or its URL) | |
2251
+ | `uvalib-combobox` | `select` (a suggestion chosen) | the field's label (never the typed text or the suggestion) | the suggestion's position, from 1 |
2252
+ | `uvalib-combobox` | `clear` (the clear button, or Escape on a closed list) | the field's label | |
2253
+ | `uvalib-combobox` | `error` (`src` failed to load) | `load` | |
2254
+ | `uvalib-list-filter` | `filter` (once the typing settles on a new query, 1 s after the last keystroke) | empty (never the typed text) | how many items match |
2255
+ | `uvalib-list-filter` | `clear` (the clear button, Escape, or the field emptied by typing) | | |
2256
+ | `uvalib-audio` | `play` (the first time each chapter plays in a page view) | `chapter <N>` (never the title or URL) | N, the chapter's place in the list |
2257
+ | `uvalib-audio` | `complete` (a chapter played to its end) | `chapter <N>` | N |
2258
+ | `uvalib-audio` | `speed` (1 s after the last change, if it differs) | the speed, such as `1.5` | the speed |
2259
+ | `uvalib-audio` | `resume` (the Resume button) | `chapter <N>` | N |
2260
+ | `uvalib-audio` | `download` | `recording`, or `chapter <N>` | |
2261
+ | `uvalib-filter-drawer` | `open`, `close` (by the visitor: the button, Close, Escape or the backdrop; not a resize or a script) | the drawer's `label` | |
2262
+ | `uvalib-back-to-top` | `click` | | |
2175
2263
  | `uvalib-dialog` | `open` (a visitor's button), `close` (by the visitor: Close, a close button, Escape, the backdrop or a dialog form; not a script) | the dialog's `label` (never its content) |
2176
- | `uvalib-map` | `select` (a marker chosen: click, Enter or Space) | the map's label (never the place's name, coordinates or URL) | the place's position, from 1 |
2177
- | `uvalib-map` | `zoom` (1 s after the last zoom-button press) | the map's label | the zoom level |
2178
- | `uvalib-map` | `expand` (a group of places chosen: it zooms in or opens its ring) | the map's label | the number of places in the group |
2179
- | `uvalib-filter` | `facet-change` | `<filter title>: <value>` (the facet value as the search service returns it, such as a format, library or subject; cut at 100 characters) | 1 checked, 0 unchecked |
2180
- | `uvalib-filter` | `scope-change` | the scope's label | 1 pressed, 0 not |
2181
- | `uvalib-filter` | `see-more`, `see-less` | the filter's title | |
2182
- | `uvalib-date-range` | `range-change` (1 s after the last change, and only if the years differ) | `<from year>–<to year>` | |
2183
- | `uvalib-date-histogram` | `select` (not when the selection is cleared, set in script, or restored from a date range) | `<from>–<to>` when both ends are ISO dates, otherwise `other` | |
2184
- | `bento-box` | `result-click` | the section (`Virgo catalog`, `Virgo articles`, `Subject guides`, `Library website`) | the result's position, from 1 |
2185
- | `bento-box` | `see-all-click`, `retry` | the section | |
2186
- | `bento-box` | `error` | `section-load: <section>` | |
2264
+ | `uvalib-map` | `select` (a marker chosen: click, Enter or Space) | the map's label (never the place's name, coordinates or URL) | the place's position, from 1 |
2265
+ | `uvalib-map` | `zoom` (1 s after the last zoom-button press) | the map's label | the zoom level |
2266
+ | `uvalib-map` | `expand` (a group of places chosen: it zooms in or opens its ring) | the map's label | the number of places in the group |
2267
+ | `uvalib-filter` | `facet-change` | `<filter title>: <value>` (the facet value as the search service returns it, such as a format, library or subject; cut at 100 characters) | 1 checked, 0 unchecked |
2268
+ | `uvalib-filter` | `scope-change` | the scope's label | 1 pressed, 0 not |
2269
+ | `uvalib-filter` | `see-more`, `see-less` | the filter's title | |
2270
+ | `uvalib-date-range` | `range-change` (1 s after the last change, and only if the years differ) | `<from year>–<to year>` | |
2271
+ | `uvalib-date-histogram` | `select` (not when the selection is cleared, set in script, or restored from a date range) | `<from>–<to>` when both ends are ISO dates, otherwise `other` | |
2272
+ | `bento-box` | `result-click` | the section (`Virgo catalog`, `Virgo articles`, `Subject guides`, `Library website`) | the result's position, from 1 |
2273
+ | `bento-box` | `see-all-click`, `retry` | the section | |
2274
+ | `bento-box` | `error` | `section-load: <section>` | |
2187
2275
 
2188
2276
  `<bento-box>` also sends a Matomo site search per section once its results are in (not on an error, not again on a re-render): the query, the section as category, and the section's total (0 when nothing was found). A new query, also by Back or Forward, is a new search. The `<library-weekly-hours>` elements `<library-hours-setup>` creates report as `library-weekly-hours`. Alert severities are `Critical`, `Warning`, `Information`, `Header` or `Regional warning` / `Regional information`. Names are capped at 100 characters. `<uvalib-photo-grid>` and `<uvalib-results-count>` report nothing.
2189
2277
 
@@ -2783,6 +2871,57 @@ Compatibility element. Light mode (`no-shadow-dom`) installs the tokens and base
2783
2871
  | `site-analytics-event` | Listened for on `document` too: the same as `uvalib-analytics-event`. |
2784
2872
  | `site-analytics-content` | Listened for on `document` too: the same as `uvalib-analytics-content`. |
2785
2873
 
2874
+ ### `<uvalib-audio>`
2875
+
2876
+ A long recording played by chapter: an audiobook, an oral history's sessions. One player for the whole list, so starting a chapter stops the one playing. Give the chapters as a list of links to their files, so the page works before (and without) the script: `<ol><li><a href="ch1.mp3" data-duration="12:31">Chapter 1. Down the Rabbit-Hole</a></li>…</ol>`. The first link in each item is the chapter (its text is the title; inline markup such as `<i>` or `lang` is kept); `data-duration` (`12:31`, `1:02:03` or seconds) is shown beside it and gives the slider its length before the file loads. Other links in the item (the chapter's text, a transcript) are kept as links after it. `data-download` on the `<li>` adds a Download link for that chapter (its own file, or the URL given), with `data-size` (bytes or text) after it. Upgraded, each chapter is a real button (“Play Chapter 1. Down the Rabbit-Hole”, its visible text), with its duration; the current chapter gets `aria-current="true"` and says “Now playing” or “Paused” in text, beside an orange bar. Above the list, a player for the current chapter: what is playing (as text, not a live region), Back 15 s, Play/Pause, Forward 30 s, a position slider (a native range, read as “12 minutes 30 seconds of 41 minutes”), the elapsed and total time, and a native Speed select (0.75× to 2×). One `<audio preload="none">` plays everything: nothing loads until the visitor presses Play, and nothing ever plays without a press. `continuous` plays the next chapter when one ends. The position is remembered per page in localStorage (the page's path, plus `storage-key` when a page has more than one recording): on the next visit a “Resume “Chapter 4” at 12:30” button offers to carry on, never playing by itself. Saved on pause, every few seconds while playing, and when the page is left; cleared when the last chapter ends. `no-resume` turns it off. Without storage it simply forgets. Chapter changes, pauses, speed changes and skips are announced politely in one status (a burst of skips once, where it ends); the time is never announced as it runs. A chapter that fails to load says so in text, with a direct link to its file. `download-href` adds a link to the whole recording (an M4B audiobook), with `download-label` and `download-size` (bytes, shown as “312 MB”, or text). Where the browser has the Media Session API, the system's media keys and lock screen show the chapter and can play, pause, seek and change chapter. Before it upgrades, `base.css` holds the player's height above the list and gives each item the height of its upgraded row, so the list does not move.
2877
+
2878
+ #### Attributes
2879
+
2880
+ | Attribute | Type | Default | Description |
2881
+ |---|---|---|---|
2882
+ | `label` | `string` | `''` | The player's accessible name, such as the book's title (default “Player”). |
2883
+ | `continuous` | `boolean` | `false` | Play the next chapter when one ends. |
2884
+ | `no-resume` | `boolean` | `false` | Don't remember the position (nothing is read from or written to localStorage). |
2885
+ | `storage-key` | `string` | `''` | Added to the page's path to name what is remembered, for a page with several recordings. |
2886
+ | `download-href` | `string` | `''` | The whole recording to download (an M4B audiobook with chapters, an MP3). |
2887
+ | `download-label` | `string` | `'Download the whole recording'` | The download link's text. |
2888
+ | `download-size` | `string` | `''` | The download's size: bytes (shown as “312 MB”) or text. |
2889
+ | `no-shadow-dom` | `boolean` | `false` | |
2890
+ | `no-style` | `boolean` | `false` | |
2891
+
2892
+ #### CSS parts
2893
+
2894
+ | Part | Description |
2895
+ |---|---|
2896
+ | `player` | The player box above the list. |
2897
+ | `now` | The line saying what is playing (or the Resume button). |
2898
+ | `controls` | The player's buttons, slider, time and speed. |
2899
+ | `download` | The whole recording's download line. |
2900
+ | `list` | The list of chapters. |
2901
+ | `chapter` | Each chapter's row. |
2902
+
2903
+ #### Events
2904
+
2905
+ | Event | Description |
2906
+ |---|---|
2907
+ | `uvalib-analytics-event` | For `<site-analytics>`, on the visitor's actions only, never titles or URLs: `['uvalib-audio', 'play', 'chapter <N>', N]` the first time each chapter plays in a page view (N is its place in the list), `['uvalib-audio', 'complete', 'chapter <N>', N]` when it plays to its end, `['uvalib-audio', 'speed', '<speed>', speed]` once the visitor settles on a speed, `['uvalib-audio', 'resume', 'chapter <N>', N]`, and `['uvalib-audio', 'download', 'recording' \| 'chapter <N>']`. Bubbles and is composed. |
2908
+
2909
+ #### CSS custom properties
2910
+
2911
+ | Property | Default | Description |
2912
+ |---|---|---|
2913
+ | `--uva-color-text` | | Dark-mode role token: text (else `--uva-grey-darkest`). |
2914
+ | `--uva-color-text-muted` | | Dark-mode role token: durations (else #4b5563). |
2915
+ | `--uva-color-link` | | Dark-mode role token: links and the outline buttons (else `--uva-brand-blue`). |
2916
+ | `--uva-color-button-bg` | | Dark-mode role token: Play/Pause and the slider (else `--uva-blue-alt`). |
2917
+ | `--uva-color-button-text` | | Dark-mode role token: Play/Pause text (else #fff). |
2918
+ | `--uva-color-surface-raised` | | Dark-mode role token: the player's and the controls' background (else #fff). |
2919
+ | `--uva-color-table-border` | | Dark-mode role token: the player's border and the rules between chapters (else #dadada). |
2920
+ | `--uva-color-accent-bg` | | Dark-mode role token: the “Now playing” marker (else `--uva-brand-blue`). |
2921
+ | `--uva-color-on-accent` | | Dark-mode role token: the marker's text (else #fff). |
2922
+ | `--uva-color-current` | | Dark-mode role token: the current chapter's bar (else `--uva-brand-orange`). |
2923
+ | `--uva-color-focus` | | Dark-mode role token: focus ring (else `--uva-brand-orange`). |
2924
+
2786
2925
  ### `<uvalib-back-to-top>`
2787
2926
 
2788
2927
  A “Back to top” button for long pages: minutes, finding aids, transcriptions, long result lists. It stays hidden (`visibility: hidden`, so it is neither a tab stop nor in the accessibility tree) until the top `offset` pixels of the page (default 400) have scrolled out of view, watched with an IntersectionObserver on a small sentinel at the top of the page, never a scroll listener. If it has focus as it hides, focus moves to the target. Activating it scrolls to the top (smoothly unless the visitor prefers reduced motion) and moves focus to the page's `<h1>` (the first in `<main>`, else the first anywhere, else `#top`), or to `target` (a selector), adding `tabindex="-1"` when it is not focusable, so keyboard and screen reader users land at the top too. The button is fixed in the bottom corner (end side), inside the safe-area insets. The element itself is an empty block 4.75rem tall: put it last in the page's main content and that is the space the button needs, so the last lines can always scroll clear of it. When that space comes into view the button sits in it instead of floating, so it never covers the footer either. It is hidden in print.
@@ -3708,7 +3847,7 @@ A record's details as a description list, as on the library's digital collection
3708
3847
 
3709
3848
  ### `<uvalib-pagefind-search>`
3710
3849
 
3711
- Pagefind's default search UI (`PagefindUI`, from the site's own Pagefind bundle) with the library's defaults and the accessibility fixes that need script. Use it with pagefind.css, in place of Pagefind's pagefind-ui.css. It renders in light DOM, so the page's styles reach Pagefind's markup. It loads `<bundle-path>pagefind-ui.js` unless `window.PagefindUI` already exists. What it adds to the stock UI: a visible `<label>` for the field (the stock field is named only by its title); a polite status region that announces the result count ("12 results for virginia") once results settle (the stock message is not a live region); focus kept in the field after Clear or Escape (the stock UI blurs it, dropping focus to the page) and moved to the first new result after "Load more results"; the loading placeholders' dots hidden from screen readers; `?q=` read at start (and on Back and Forward) and the settled query written back with `history.replaceState`, so a search can be shared; with `filter-params`, the named Pagefind filters read from and written to the URL the same way; and reports to `<site-analytics>`. While a search from the URL loads, it can hold the page still (issue #37): with `searching` set in the page's HTML when the URL has a query, the element holds a screen's height from first paint, and placeholder results (aria-hidden) stand in for Pagefind's until they, or "no results", are drawn; the element then still reaches the bottom of the window until the visitor uses the search, so a short list does not pull the footer up. It does the same on Back and Forward to a new query. The `ui` property is the `PagefindUI` instance (for `triggerFilters`), and `ready` resolves with it. Attributes are read once, when the element is first connected.
3850
+ Pagefind's default search UI (`PagefindUI`, from the site's own Pagefind bundle) with the library's defaults and the accessibility fixes that need script. Use it with pagefind.css, in place of Pagefind's pagefind-ui.css. It renders in light DOM, so the page's styles reach Pagefind's markup. It loads `<bundle-path>pagefind-ui.js` unless `window.PagefindUI` already exists. What it adds to the stock UI: a visible `<label>` for the field (the stock field is named only by its title); a polite status region that announces the result count ("12 results for virginia") once results settle (the stock message is not a live region); focus kept in the field after Clear or Escape (the stock UI blurs it, dropping focus to the page) and moved to the first new result after "Load more results"; the loading placeholders' dots hidden from screen readers; `?q=` read at start (and on Back and Forward) and the settled query written back with `history.replaceState`, so a search can be shared; with `filter-params`, the named Pagefind filters read from and written to the URL the same way (and with `filter-flags`, one-value filters linked as `?audiobook=1`); and reports to `<site-analytics>`. While a search from the URL loads, it can hold the page still (issue #37): with `searching` set in the page's HTML when the URL has a query, the element holds a screen's height from first paint, and placeholder results (aria-hidden) stand in for Pagefind's until they, or "no results", are drawn; the element then still reaches the bottom of the window until the visitor uses the search, so a short list does not pull the footer up. It does the same on Back and Forward to a new query. The `ui` property is the `PagefindUI` instance (for `triggerFilters`), and `ready` resolves with it. Attributes are read once, when the element is first connected.
3712
3851
 
3713
3852
  #### Attributes
3714
3853
 
@@ -3729,6 +3868,7 @@ Pagefind's default search UI (`PagefindUI`, from the site's own Pagefind bundle)
3729
3868
  | `searching` | `boolean` | | Set it in the page's HTML when the URL has a query (server-side, or with a one-line inline script after the element): from first paint, before any script loads, it holds a screen's height for the results, and placeholder results show until they are drawn. The element removes it then (and at start without a query), and sets it itself on Back and Forward to a new query. |
3730
3869
  | `no-skeleton` | `boolean` | | Never hold space or show placeholder results (`searching` is ignored). |
3731
3870
  | `filter-params` | `string` | | Space-separated Pagefind filter names read from and written to URL parameters of the same name (`collection author`: `?collection=A&collection=B`). URL filters are applied with the query as one search, their filter groups open; values not in the index are ignored. Empty (the default) turns it off. |
3871
+ | `filter-flags` | `string` | | Space-separated names of one-value Pagefind filters ("has an audiobook": its one value is `Available`), read from and written to the URL as on/off flags (issue #40). The parameter with any value, or none (`?audiobook`, `?audiobook=1`, `?audiobook=yes`), checks the filter's one value, whatever its spelling in the index; `0`, `false`, `no` and `off` leave it unchecked. Checking it writes `?audiobook=1`; unchecking removes it. Otherwise as `filter-params` (one search with the query, Back and Forward); a name need not be repeated there, and a name in both is a flag. If the index has more or fewer than one value for it, a console warning says so once and the filter is read as `filter-params` (exact values). |
3732
3872
 
3733
3873
  #### Events
3734
3874
 
package/dist/base.css CHANGED
@@ -211,7 +211,8 @@
211
211
  uvalib-map,
212
212
  uvalib-filter-drawer,
213
213
  uvalib-filter,
214
- uvalib-list-filter
214
+ uvalib-list-filter,
215
+ uvalib-audio
215
216
  ):not(:defined)[hidden],
216
217
  :where(uvalib-combobox, uvalib-image-regions):not(:defined) > [hidden] {
217
218
  display: none;
@@ -376,6 +377,59 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
376
377
  uvalib-list-filter[hide-label][results-count]:not(:defined) {
377
378
  min-block-size: 44px;
378
379
  }
380
+ /* A recording by chapter (<uvalib-audio>): its list of links shows as it will once
381
+ upgraded (each row 44px plus padding, a rule below, the title where it will sit after the
382
+ Play button, a second 44px line for an item with more links or a download), and the
383
+ player's height is held above it: one row of controls from 44rem of its own width, two
384
+ from 26rem, three below (and the download line). Keep in step with UvalibAudio's rules. */
385
+ uvalib-audio:not(:defined) {
386
+ display: block;
387
+ container-type: inline-size;
388
+ font-size: 1rem;
389
+ line-height: 1.5;
390
+ }
391
+ uvalib-audio:not(:defined)::before {
392
+ content: '';
393
+ display: block;
394
+ block-size: calc(1.5rem + 2px + 44px + 0.5rem + 44px);
395
+ margin-block-end: 1rem;
396
+ }
397
+ uvalib-audio[download-href]:not([download-href='']):not(:defined)::before {
398
+ margin-block-end: calc(1rem + 44px + 1rem);
399
+ }
400
+ @container (width < 44rem) {
401
+ uvalib-audio:not(:defined)::before {
402
+ block-size: calc(1.5rem + 2px + 44px + 0.5rem + 2 * 44px + 0.5rem);
403
+ }
404
+ }
405
+ @container (width < 26rem) {
406
+ uvalib-audio:not(:defined)::before {
407
+ block-size: calc(1.5rem + 2px + 44px + 0.5rem + 3 * 44px + 2 * 0.5rem);
408
+ }
409
+ }
410
+ uvalib-audio:not(:defined) > :is(ol, ul) {
411
+ margin: 0;
412
+ padding: 0;
413
+ list-style: none;
414
+ }
415
+ uvalib-audio:not(:defined) > :is(ol, ul) > li {
416
+ box-sizing: border-box;
417
+ min-block-size: calc(44px + 0.5rem + 1px);
418
+ margin: 0;
419
+ padding: 0.25rem 0 0.25rem 8px;
420
+ border-block-end: 1px solid var(--uva-color-table-border, #dadada);
421
+ align-content: center;
422
+ }
423
+ uvalib-audio:not(:defined) > :is(ol, ul) > li:is([data-download], :has(a[href] ~ a[href])) {
424
+ min-block-size: calc(2 * 44px + 0.5rem + 1px);
425
+ }
426
+ /* Room for the duration the upgraded row shows at its end (about “12:31”). */
427
+ uvalib-audio:not(:defined) > :is(ol, ul) > li:has(> a[data-duration]) {
428
+ padding-inline-end: calc(0.75rem + 2.75em);
429
+ }
430
+ uvalib-audio:not(:defined) > :is(ol, ul) > li > a:first-child {
431
+ margin-inline-start: calc(0.5rem + 5rem + 0.75rem);
432
+ }
379
433
  /* Image regions: the image at its own width and the list beside it (or under it), the
380
434
  layout the element keeps once it upgrades, so the image does not move. */
381
435
  uvalib-image-regions:not(:defined) {
@@ -549,6 +603,7 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
549
603
  :root[data-uva-color-scheme] {
550
604
  --uva-color-text: light-dark(var(--uva-grey-darkest, #2b2b2b), #e8e8e8);
551
605
  --uva-color-surface: light-dark(#ffffff, #10172b);
606
+ --uva-color-table-border: light-dark(var(--uva-grey-100, #dadada), #4f5a7a);
552
607
  --uva-color-text-muted: light-dark(#4b5563, #adadad);
553
608
  --uva-color-button-bg: light-dark(var(--uva-blue-alt, #007bac), #55c4ec);
554
609
  --uva-color-button-text: light-dark(#ffffff, #10172b);
@@ -575,7 +630,6 @@ uvalib-metadata:not(:defined) > dl > dd[data-limit="12"] > :is(ul, ol):has(> li:
575
630
  --uva-color-link: light-dark(var(--uva-brand-blue, #232d4b), #87b9d9);
576
631
  --uva-color-highlight: light-dark(var(--uva-brand-orange-200, #ffc999), #854200);
577
632
  --uva-color-on-highlight: light-dark(var(--uva-grey-darkest, #2b2b2b), #ffffff);
578
- --uva-color-table-border: light-dark(var(--uva-grey-100, #dadada), #4f5a7a);
579
633
  --uva-color-table-stripe: light-dark(var(--uva-grey-200, #f1f1f1), #1a2340);
580
634
  }
581
635
  :root[data-uva-color-scheme='system'] {