@uvalib/web-components 1.4.0 → 1.6.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.6.0 — 2026-11-22
4
+
5
+ ### Features
6
+
7
+ - versions of an image compared over the photo: switch, reveal, fade (issue #25)
8
+
9
+ ### Fixes
10
+
11
+ - changing the comparison mode never moves the photo
12
+ - version-param without parsing the URL (an iframe srcdoc), analytics catalogue entry (issue #25)
13
+
14
+ ### Other
15
+
16
+ - Merge branch 'feat/lightbox-versions': image versions compared in the lightbox (issue #25)
17
+
18
+ ## v1.5.0 — 2026-11-21
19
+
20
+ ### Features
21
+
22
+ - a cancelable activate event when an outline is clicked (issue #24)
23
+
24
+ ### Other
25
+
26
+ - Merge branch 'feat/regions-activate': image-regions activate event (issue #24)
27
+
3
28
  ## v1.4.0 — 2026-11-21
4
29
 
5
30
  ### Features
package/README.md CHANGED
@@ -570,6 +570,38 @@ Both follow dark mode through the role tokens and reflow at 320px; `no-style` ke
570
570
  - **Photo grid.** Each direct child that is an `<a href>` or a `<button>` is one photo. The row is about 220px tall, and 140px when the viewport is 767px or narrower, unless `row-height` is set (a bare number is pixels; `rem`, `em` and the other CSS lengths are kept). Each image keeps its shape from its `width` and `height` attributes, or from the loaded image, so the row does not jump. Every item stays a real link or button. An image with no visible text gets a visible caption from its alt, and an alt that repeats that caption is cleared so it is not announced twice. The original alt is kept for a lightbox. A different alt is kept (the accessible name still contains the visible text). An `aria-label` is left as the name. Generated "Photo N" captions renumber when the photos change order. An item with no name is captioned "Photo N" and warned about once. A child that is not a link or a button is skipped, with one warning. A badge sits on the thumbnail: `<span slot="badge">` inside the item, or `data-badge` on the item (“seq”, “3 photos”). It is part of the item’s accessible name; when the item already has an `aria-label`, the badge is appended and the author’s words stay in `data-uvalib-label`. The grid reports no analytics. Put it inside `<uvalib-lightbox>` and a plain click opens the viewer.
571
571
  - **Motion and colour.** `prefers-reduced-motion` turns the dialog's short fade off. The backdrop, surface and focus ring use the dark-mode role tokens. Controls are at least 44px. `no-style` keeps the dialog's structure and, for the grid, the row layout: the thumbnails stay in light DOM, and those rules are what reserve each image's space.
572
572
 
573
+ #### Versions
574
+
575
+ A photo can have more than one version of the same picture: the original scan, an AI colorization of a black-and-white photograph, a restoration, an infrared or UV capture. Name them with `data-versions` on the link, a JSON array of `{ label, href?, note? }` whose first entry is the link's own image (its `href` may be left out), and the viewer compares them over the photo. Every version must have the same size and framing, so regions, the caption and the details stay as they are. See the [Image versions](https://uvalib.github.io/reusable-web-library/#image-versions) example.
576
+
577
+ ```html
578
+ <uvalib-lightbox url-param="photo" version-param="version" compare="wipe">
579
+ <a
580
+ href="https://iiif.lib.virginia.edu/iiif/uva-lib:1040162/full/!1600,1600/0/default.jpg"
581
+ data-id="lawn-games"
582
+ data-caption="Lawn games, 1914"
583
+ data-versions='[
584
+ {"label": "Original"},
585
+ {"label": "AI colorization",
586
+ "href": "/media/color/lawn-games.jpg",
587
+ "note": "The colours are an AI model’s guess; the photograph is black and white."}
588
+ ]'
589
+ >
590
+ <img src="…/full/,200/0/default.jpg" alt="Lawn games, 1914" width="249" height="200" />
591
+ </a>
592
+ </uvalib-lightbox>
593
+ ```
594
+
595
+ - **Ways to compare.** **Switch** (the default, and the only one that shows any number of versions): a segmented control (`aria-pressed` buttons) shows one version at a time. **Reveal** (`compare="wipe"`): the other version on the start side of a divider, the original on the end side, each labelled on the photo. Click or tap anywhere on the photo to move the divider there (no drag is needed, though dragging works), or use the slider "Reveal AI colorization". **Fade** (`compare="fade"`): the slider "Fade to AI colorization" cross-fades from the original (0%) to the other version (100%). `compare` picks the first mode; the viewer always offers the others ("Compare versions": Switch, Reveal, Fade). Reveal and Fade compare the first version with one other: with three or more, "Compare Original with" picks which.
596
+ - **Keyboard and screen readers.** The sliders are native range inputs, in the tab order after the image's controls and before the regions list, with `aria-valuetext` ("40% AI colorization"): arrows move 1%, Shift+arrow, Page Up and Page Down 10%, Home and End to either end. "Original", "50/50" and the version's label jump to set positions. Hold "Hold for Original", or the O key, to see the original until you let go. A change is announced politely once it settles ("AI colorization shown", "40% AI colorization"; never while the version is still loading, and not for the slider, which speaks for itself). The image's accessible name ends with what is on screen: "Lawn games, 1914 (AI colorization)", "(Original and AI colorization, compared side by side)", "(Original and AI colorization, blended)".
597
+ - **Labelling AI.** A version's `note` is shown under the photo while that version is on screen (both notes while both are), so a derived version is never taken for the original. Always give an AI colorization or other generated version a label that says so ("AI colorization", not "Colour") and a note saying what was predicted ("The colours are an AI model’s guess; the photograph is black and white."). Keep the original first, so it is the default and the version Full size offers first.
598
+ - **Loading.** The comparison's code is loaded the first time an open image has versions; pages without versions never load it. Another version's image is requested the first time it is shown (with `decoding="async"`); until it has loaded the original stays on screen. Both are drawn in the same box, so showing another version never moves the page. With `prefers-reduced-motion: reduce` versions change instantly. In forced colors the divider and handle use the system colours.
599
+ - **Full size** offers two named links in every mode: the original and the version shown or compared ("Full size, Original" and "Full size, AI colorization"). The toolbar keeps the same height whatever the mode, and the original is always one click away.
600
+ - **Nothing moves when the mode changes.** The controls for Switch and for Reveal and Fade share one space as tall as the taller of them (the other is hidden and inert), so the photo stays put even on a phone, where the controls wrap.
601
+ - **In the address.** With `url-param`, `version-param="version"` keeps the comparison in sync: `?version=1` (Switch: the version shown, from 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version shown), `?version=wipe:40:2` (compared with version 2). It is written with `replaceState` once a change settles (never one history entry per step), dropped on Previous, Next and Close, and read when the viewer opens from the address, so a link can open a photo in colour or half revealed. A click on a thumbnail starts fresh.
602
+ - **Apps.** The `versions` property is a function from `{ element, id, href, index }` to the versions (or null). An entry without a label, or whose `href` is not http(s), relative or a PNG, JPEG, GIF or WebP `data:` image, is left out with one console warning; with fewer than two usable versions the image is shown as before. Previous and Next show each image's own versions (or none) in the mode the visitor chose.
603
+ - **Event.** `uvalib-lightbox-version` when the visitor changes the comparison (once a slider settles): `detail: { id, mode, index, value }` (`mode` `switch`, `wipe` or `fade`; `index` the version shown or compared, from 0; `value` the percentage of it shown, `null` in Switch). Not fired on open or for a comparison restored from the address. Bubbles and is composed. Analytics: `['uvalib-lightbox', 'compare', '<mode>', N]` (N the version's place from 1), never a label or URL.
604
+
573
605
  ### Image regions
574
606
 
575
607
  `<uvalib-image-regions>` outlines regions of an image (people, objects, inscriptions, page areas), numbered, with a list of the same regions beside it (under it on a narrow screen). Entry: `uvalib-image-regions.js` on the CDN, `@uvalib/web-components/uvalib-image-regions.js` on npm. See the [Image regions](https://uvalib.github.io/reusable-web-library/#image-regions) example.
@@ -659,15 +691,26 @@ With your own actions in each entry, give the viewer the page's list: `data-regi
659
691
  </script>
660
692
  ```
661
693
 
662
- - **The list is the way in.** Every region is an entry in the list, with the same name and the page's own links and buttons. The outlines are a visual aid: the overlay is `aria-hidden` and the outlines are not focusable, so no region is a second tab stop. Clicking an outline moves focus to its entry (and fires `select`); from there Tab reaches its links and buttons. Labels shown on a highlighted outline are the list's text, so nothing is only on hover.
694
+ - **The list is the way in.** Every region is an entry in the list, with the same name and the page's own links and buttons. The outlines are a visual aid: the overlay is `aria-hidden` and the outlines are not focusable, so no region is a second tab stop. Clicking an outline fires `uvalib-image-regions-activate`, then moves focus to its entry; from there Tab reaches its links and buttons. Labels shown on a highlighted outline are the list's text, so nothing is only on hover.
663
695
  - **Regions.** An `<ol>` child whose `<li>` items carry `data-xywh`, IIIF and Media Fragments style: `percent:x,y,w,h`, or pixels (`x,y,w,h`, `pixel:x,y,w,h` or `xywh=…`) of the image's natural size, or of `image-width` × `image-height` when the image is a smaller derivative of the original (a IIIF `,880` size, say). A label is `data-label`, else the entry's first link, else its text without its buttons. `data-id` (or `id`) is sent back in events. Or set `items` (`{ id?, label, x, y, w, h, unit?: 'px' | 'percent', href?, description? }[]`): it replaces the child list. A pixel region is drawn once the image's size is known.
664
696
  - **Host content.** The child list and everything in it stay the page's: the element only numbers, positions and highlights them (it adds `data-uvalib-region` and, while highlighted, `data-uvalib-active` to each `<li>`, and `tabindex="-1"` when an outline moves focus to one). Your buttons' events are yours.
665
697
  - **Numbers and highlight.** Outline numbers are the list's numbers (from 1, or the `<ol>`'s `start`); `numbering="none"` hides them on the outlines. Hovering or focusing an entry, or anything in it, highlights its region: a thicker double outline with its label, the others dimmed, and the entry gets a bar at its start and a tint. Hovering an outline highlights its entry. Not colour alone.
666
698
  - **Contrast on any image.** Each outline is white inside black (2px each, 4px highlighted), with black number badges, on light and dark photos alike and in dark mode; in forced colors they are Canvas and CanvasText, the highlight is Highlight (the overlay alone has `forced-color-adjust: none`).
667
699
  - **Layout.** The image keeps its own width (at most the element's) and the list sits beside it when 14rem is left, else under it, so it reflows at 320px. Outlines are in percent and scale with the image; give the image `width` and `height` so its space is reserved. `base.css` gives the children the same layout before the element upgrades, so the image does not move. `hide-outlines` hides the outlines and keeps the list. `label` (default “Regions”) is the list's heading; `heading-level` sets its level (default: one below the heading before it).
668
- - **Events.** `highlight` (`detail: { item, index }`, `item` null when none) as hover or focus changes the highlight; `select` (`detail: { item, index }`) when an outline is clicked. Both bubble and are composed.
700
+ - **Events.** `uvalib-image-regions-activate` when an outline is clicked, before its entry takes focus: `detail: { index, item, entry }` (`index` from 0; `item` the region's record; `entry` the page's own `<li>`, from the child list or a lightbox's `data-regions-list`, or `null` when the list was drawn from `items`). It is cancelable: call `preventDefault()` and focus your own control in the entry instead, for example the field of a "Who is this?" form you just revealed. Keep focus in the entry, so keyboard and screen-reader users land in the same place. `highlight` (`detail: { item, index }`, `item` null when none) as hover or focus changes the highlight. `select` (`detail: { item, index, entry }`) still follows every outline click, after focus moved; prefer the activate event, since `select` is also the native text-selection event, which a `document` listener hears from every input. All bubble and are composed, so a page hears them from inside `<uvalib-lightbox>` too. Never reach into the shadow DOM's outlines (`part="region"`, `data-index`) for clicks: they can change in any release.
701
+
702
+ ```js
703
+ document.addEventListener('uvalib-image-regions-activate', (e) => {
704
+ const form = e.detail.entry?.querySelector('.who-is-this');
705
+ if (!form) return; // the entry takes focus as usual
706
+ e.preventDefault();
707
+ form.hidden = false;
708
+ form.querySelector('input').focus();
709
+ });
710
+ ```
711
+
669
712
  - **Lightbox.** On `<uvalib-lightbox>`, `data-regions` on a link is a JSON array of region objects, or `xywh` values each followed by its label, separated by `;` (`percent:10,20,30,40 Person 1; 160,120,320,240 Sign`; use JSON when a label contains `;`). Or set the lightbox's `regions` property to a function from `{ element, id, href, index }` to regions. An image with regions shows the outlines over it and their list beside it, and a “Show regions” toggle (`aria-pressed`) hides the outlines; `regions-label` names the list. `<uvalib-image-regions>` is loaded the first time it is needed. Because the viewer asks for a resized IIIF image, give pixel regions `data-image-width` and `data-image-height` (the original's size), or use percent. Images without regions are unchanged.
670
- - **The page's own list in the viewer.** `data-regions-list="<id>"` on a lightbox link (or the lightbox's `regionsList` property, a function from `{ element, id, href, index }` to the list element, for apps) names an `<ol>` or `<ul>` of `<li data-xywh>` entries in the same page (or the same shadow root as the lightbox), usually `hidden`. While that image is open the list is its region list, exactly as `<uvalib-image-regions>` uses its child list: the numbers, the highlight both ways and an outline click focusing its entry are the component's; the entries and their buttons and links stay yours. It is the same element, not a copy, so listeners you added (on the buttons or on the list) keep working, and when the image changes or the viewer closes it goes back where it was, with its own `hidden` state, and without the `data-uvalib-*` attributes or `tabindex` the viewer added. Change it while it is home (a name confirmed, a person added) and the next open shows the change; changes while it is open are seen too. If an image has both, the list wins over `data-regions` and the `regions` callback (with one console warning). **Styles:** in shadow mode the list becomes a child of `<uvalib-lightbox>` (with `slot="uvalib-regions-list"`) and is slotted into the viewer, never moved into the shadow root, so the page's CSS keeps applying; with `no-shadow-dom` it is moved into the viewer's `<uvalib-image-regions>`, still in the page. Either way it leaves its parent while open, so style it by its own id or class (`.people button`), not by where it sits in the page (`.sidebar ol button`). **Names:** the accessible names of your actions are yours, and must be unique in the list: “Confirm Tim Kaine”, “Not Tim Kaine”, “Name person 2”, never three “Confirm” buttons. A region's label is `data-label`, else the entry's first link, else its text without its buttons. If focus is in the list when the visitor moves to the next image, it goes to Close. Analytics are unchanged: outline clicks report the list's heading (`regions-label`) and the number, never a label.
713
+ - **The page's own list in the viewer.** `data-regions-list="<id>"` on a lightbox link (or the lightbox's `regionsList` property, a function from `{ element, id, href, index }` to the list element, for apps) names an `<ol>` or `<ul>` of `<li data-xywh>` entries in the same page (or the same shadow root as the lightbox), usually `hidden`. While that image is open the list is its region list, exactly as `<uvalib-image-regions>` uses its child list: the numbers, the highlight both ways and an outline click focusing its entry are the component's; the entries and their buttons and links stay yours. An outline click first fires `uvalib-image-regions-activate` with your own `<li>` as `detail.entry` (cancelable, to focus your own control in it; see [Image regions](#image-regions) events). It is the same element, not a copy, so listeners you added (on the buttons or on the list) keep working, and when the image changes or the viewer closes it goes back where it was, with its own `hidden` state, and without the `data-uvalib-*` attributes or `tabindex` the viewer added. Change it while it is home (a name confirmed, a person added) and the next open shows the change; changes while it is open are seen too. If an image has both, the list wins over `data-regions` and the `regions` callback (with one console warning). **Styles:** in shadow mode the list becomes a child of `<uvalib-lightbox>` (with `slot="uvalib-regions-list"`) and is slotted into the viewer, never moved into the shadow root, so the page's CSS keeps applying; with `no-shadow-dom` it is moved into the viewer's `<uvalib-image-regions>`, still in the page. Either way it leaves its parent while open, so style it by its own id or class (`.people button`), not by where it sits in the page (`.sidebar ol button`). **Names:** the accessible names of your actions are yours, and must be unique in the list: “Confirm Tim Kaine”, “Not Tim Kaine”, “Name person 2”, never three “Confirm” buttons. A region's label is `data-label`, else the entry's first link, else its text without its buttons. If focus is in the list when the visitor moves to the next image, it goes to Close. Analytics are unchanged: outline clicks report the list's heading (`regions-label`) and the number, never a label.
671
714
  - **Analytics.** `select` when an outline is clicked, with the list's `label` and the region's number. Never a region's label: it may be a person's name. Nothing on hover or focus.
672
715
  - **Motion and styles.** The dimming fades only without `prefers-reduced-motion: reduce`. Shadow and light DOM; `no-style` keeps the layout and the outlines.
673
716
 
@@ -1500,6 +1543,7 @@ Static sites that search with [Pagefind](https://pagefind.app) (such as Electron
1500
1543
  | `uvalib-metadata` | `copy-citation` (downloads are left to Matomo's, or to `downloads="event"`) | | |
1501
1544
  | `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) | |
1502
1545
  | `uvalib-lightbox` | `open`, `next`, `previous`, `full-size` | `image N` (never the URL or the caption) | N, from 1 |
1546
+ | `uvalib-lightbox` (versions) | `compare` | `switch`, `wipe` or `fade` (never a version's label or URL) | the version's place, from 1 |
1503
1547
  | `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 |
1504
1548
  | `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 |
1505
1549
  | `uvalib-tag-list` | `show-all`, `show-fewer` | `list N`, or with `track-label` the `label` | |
@@ -2646,6 +2690,7 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
2646
2690
  |---|---|
2647
2691
  | (default) | The region list (`<ol>` with `<li data-xywh>`), shown as written. Not used with `items`. |
2648
2692
  | `image` | The image. A first `<img>` or `<picture>` child is put here by itself. |
2693
+ | `controls` | Controls for the image (a lightbox's version comparison), under the image and before the list in reading order. Not covered by the outlines. |
2649
2694
 
2650
2695
  #### CSS parts
2651
2696
 
@@ -2662,7 +2707,8 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
2662
2707
  | Event | Description |
2663
2708
  |---|---|
2664
2709
  | `highlight` | The highlighted region changed by hover or focus: `detail` is `{ item, index }` (`item` null and `index` -1 when none is). Bubbles and is composed. |
2665
- | `select` | A region's outline was clicked (focus moved to its list entry): `detail` is `{ item, index }`. Bubbles and is composed. |
2710
+ | `uvalib-image-regions-activate` | A region's outline was clicked, before its list entry takes focus: `detail` is `{ index, item, entry }` (`index` from 0; `item` the region's record; `entry` the page's own `<li>`, from its child list or a lightbox's lent list, or null when this element drew the list from `items`). Cancelable: `preventDefault()` keeps the entry from taking focus, so the page can focus its own control in it instead (a "Who is this?" field). Bubbles and is composed. |
2711
+ | `select` | A region's outline was clicked, after its entry took focus (or the page took the activate over): `detail` is `{ item, index, entry }`. Bubbles and is composed. Prefer `uvalib-image-regions-activate`: `select` is also the name of the native text-selection event. |
2666
2712
  | `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-image-regions', 'select', '<label>', <number>]` when an outline is clicked (the list's `label`, and the region's number from 1). Never a region's label (it may be a person's name). Nothing on hover or focus. Bubbles and is composed. |
2667
2713
 
2668
2714
  #### CSS custom properties
@@ -2677,7 +2723,7 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
2677
2723
 
2678
2724
  ### `<uvalib-lightbox>`
2679
2725
 
2680
- An accessible image viewer over a set of plain links. With JavaScript a primary click opens a modal dialog; without it (or with a modified click) the link opens the image as before. Wrap the links, or point at them with `selector` (for example `a.pb-image` on a reading page). There is no autoplay and no carousel. The dialog is labelled by the caption (`data-caption`, else the image alt, else the link text). Focus moves to Close on open and back to the trigger on close. Escape and a click on the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the original image in a new tab. A IIIF Image API URL keeps its region; only the size becomes `!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for example `photo`) keeps `?photo=<id>` in sync, including on a hash route (`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and Back closes. Optional details: children with `slot="details"` (and `data-for` equal to the item's id or its position from 1; without `data-for` they show for every image), or `data-details-id` on a link pointing at an element elsewhere on the page. Either is shown inside the dialog and put back when the viewer moves on or closes. Optional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of `{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by `;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback. The open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use) and a list of the regions beside it, with a "Show regions" toggle (`aria-pressed`) that hides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height` when set (the viewer shows a resized IIIF image), else in the image's natural size. Or the page's own list, with its own buttons: `data-regions-list="<id>"` on a link (or the `regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page, usually `hidden`. While that image is open the list (the same nodes, so the page's listeners keep working) is the region list: in shadow mode it becomes a child of the lightbox slotted into the viewer, not moved into the shadow root, so the page's CSS still applies to it. When the image changes or the viewer closes it goes back where it was, `hidden` as before. It wins over `data-regions`.
2726
+ An accessible image viewer over a set of plain links. With JavaScript a primary click opens a modal dialog; without it (or with a modified click) the link opens the image as before. Wrap the links, or point at them with `selector` (for example `a.pb-image` on a reading page). There is no autoplay and no carousel. The dialog is labelled by the caption (`data-caption`, else the image alt, else the link text). Focus moves to Close on open and back to the trigger on close. Escape and a click on the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the original image in a new tab. A IIIF Image API URL keeps its region; only the size becomes `!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for example `photo`) keeps `?photo=<id>` in sync, including on a hash route (`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and Back closes. Optional details: children with `slot="details"` (and `data-for` equal to the item's id or its position from 1; without `data-for` they show for every image), or `data-details-id` on a link pointing at an element elsewhere on the page. Either is shown inside the dialog and put back when the viewer moves on or closes. Optional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of `{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by `;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback. The open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use) and a list of the regions beside it, with a "Show regions" toggle (`aria-pressed`) that hides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height` when set (the viewer shows a resized IIIF image), else in the image's natural size. Or the page's own list, with its own buttons: `data-regions-list="<id>"` on a link (or the `regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page, usually `hidden`. While that image is open the list (the same nodes, so the page's listeners keep working) is the region list: in shadow mode it becomes a child of the lightbox slotted into the viewer, not moved into the shadow root, so the page's CSS still applies to it. When the image changes or the viewer closes it goes back where it was, `hidden` as before. It wins over `data-regions`. Optional versions of an image (an original scan and an AI colorization, a restoration, an infrared capture): `data-versions` on a link, a JSON array of `{ label, href?, note? }` whose first entry is the link's own image, or the `versions` callback. The viewer then compares them over the photo (loaded on first use): Switch (a segmented control), Reveal (a divider: click or tap the photo, or use the slider) or Fade (a slider), `compare` choosing the first. A version's `note` shows under the photo while it is visible, and the image's accessible name ends with the label of the version shown. `version-param` (with `url-param`) keeps the comparison in the address: `?version=2` (Switch, the version from 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version shown; `wipe:40:2` compares the original with version 2).
2681
2727
 
2682
2728
  #### Attributes
2683
2729
 
@@ -2686,6 +2732,8 @@ An accessible image viewer over a set of plain links. With JavaScript a primary
2686
2732
  | `selector` | `string` | `''` | CSS selector for image links elsewhere in this root (the page, or the shadow root the component sits in). Combined with any links inside the component. Example: `a.pb-image`. |
2687
2733
  | `url-param` | `string` | `''` | Query parameter kept in sync with the open image, for example `photo` → `?photo=<id>`. The id is the link's `data-id`, else its `id`, else the IIIF identifier, else its position from 1. On a hash route the parameter is written inside the hash. Empty: no deep link. |
2688
2734
  | `regions-label` | `string` | `'Regions'` | The heading of the regions list (for example `People`). |
2735
+ | `compare` | `'switch' \| 'wipe' \| 'fade'` | `'switch'` | How an image's versions are compared first: `switch` (default: one at a time, any number of versions), `wipe` (a divider over the photo) or `fade` (a cross-fade). The viewer offers the others. |
2736
+ | `version-param` | `string` | `''` | Query parameter for the comparison (with `url-param`), for example `version`: `?version=1`, `?version=wipe:40`, `?version=fade:60`. Written with replaceState once the visitor's change settles; read when the viewer opens from the address. |
2689
2737
  | `no-shadow-dom` | `boolean` | `false` | |
2690
2738
  | `no-style` | `boolean` | `false` | |
2691
2739
 
@@ -2707,12 +2755,14 @@ An accessible image viewer over a set of plain links. With JavaScript a primary
2707
2755
  | `controls` | Previous, Next, the counter and Full size. |
2708
2756
  | `details` | The details panel. |
2709
2757
  | `regions` | The `<uvalib-image-regions>` around an image with regions. |
2758
+ | `compare` | The version comparison controls and notes under the photo. |
2710
2759
 
2711
2760
  #### Events
2712
2761
 
2713
2762
  | Event | Description |
2714
2763
  |---|---|
2715
- | `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-lightbox', 'open'\|'next'\|'previous'\|'full-size', 'image N', N]` (N from 1, the image's place in the set). Never the URL or the caption. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed. |
2764
+ | `uvalib-lightbox-version` | The visitor changed the comparison (mode, version or position; once a slider settles): `detail` is `{ id, mode, index, value }` (`mode` `switch`, `wipe` or `fade`; `index` the version shown or compared, from 0; `value` the percentage of it shown, null for Switch). Not fired on open or for a comparison restored from the URL. Bubbles and is composed. |
2765
+ | `uvalib-analytics-event` | For `<site-analytics>`: `['uvalib-lightbox', 'open'\|'next'\|'previous'\|'full-size', 'image N', N]` (N from 1, the image's place in the set), and `['uvalib-lightbox', 'compare', 'switch'\|'wipe'\|'fade', N]` when the visitor changes a comparison (N the version's place from 1; once a slider settles). Never the URL, the caption or a version's label. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed. |
2716
2766
 
2717
2767
  #### CSS custom properties
2718
2768
 
@@ -23,13 +23,15 @@ export type { ImageRegion } from './regions.js';
23
23
  * @tagname uvalib-image-regions
24
24
  * @slot - The region list (`<ol>` with `<li data-xywh>`), shown as written. Not used with `items`.
25
25
  * @slot image - The image. A first `<img>` or `<picture>` child is put here by itself.
26
+ * @slot controls - Controls for the image (a lightbox's version comparison), under the image and before the list in reading order. Not covered by the outlines.
26
27
  * @csspart layout - The grid holding the image and the list.
27
28
  * @csspart media - The image and its overlay.
28
29
  * @csspart overlay - The outlines over the image (`aria-hidden`).
29
30
  * @csspart region - One outline.
30
31
  * @csspart list - The heading and the list.
31
32
  * @fires highlight - The highlighted region changed by hover or focus: `detail` is `{ item, index }` (`item` null and `index` -1 when none is). Bubbles and is composed.
32
- * @fires select - A region's outline was clicked (focus moved to its list entry): `detail` is `{ item, index }`. Bubbles and is composed.
33
+ * @fires uvalib-image-regions-activate - A region's outline was clicked, before its list entry takes focus: `detail` is `{ index, item, entry }` (`index` from 0; `item` the region's record; `entry` the page's own `<li>`, from its child list or a lightbox's lent list, or null when this element drew the list from `items`). Cancelable: `preventDefault()` keeps the entry from taking focus, so the page can focus its own control in it instead (a "Who is this?" field). Bubbles and is composed.
34
+ * @fires select - A region's outline was clicked, after its entry took focus (or the page took the activate over): `detail` is `{ item, index, entry }`. Bubbles and is composed. Prefer `uvalib-image-regions-activate`: `select` is also the name of the native text-selection event.
33
35
  * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-image-regions', 'select', '<label>', <number>]` when an outline is clicked (the list's `label`, and the region's number from 1). Never a region's label (it may be a person's name). Nothing on hover or focus. Bubbles and is composed.
34
36
  * @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).
35
37
  * @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).
@@ -97,6 +99,7 @@ export declare class UvalibImageRegions extends UvalibElement {
97
99
  private sourceList;
98
100
  private get imgHost();
99
101
  private get listHost();
102
+ private get controlsHost();
100
103
  /** The `<img>` whose natural size measures pixel regions. */
101
104
  private imageEl;
102
105
  /** Re-read the regions (and in shadow mode put the image in its slot). */
@@ -130,7 +133,11 @@ export declare class UvalibImageRegions extends UvalibElement {
130
133
  private readonly onFocusIn;
131
134
  private readonly onFocusOut;
132
135
  private readonly onClick;
133
- /** An outline was clicked: focus its entry, and say so. */
136
+ /**
137
+ * An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,
138
+ * unless the page took it over, focus the entry; then `select`. `entry` is the page's own
139
+ * `<li>` (its child list or a lightbox's lent list), never one this element drew from `items`.
140
+ */
134
141
  private choose;
135
142
  private get level();
136
143
  private renderOwnList;
@@ -32,9 +32,9 @@ const structuralRules = (host) => `
32
32
  gap: 1rem;
33
33
  align-items: flex-start;
34
34
  }
35
+ ${host} .column { flex: 0 1 auto; min-width: 0; max-width: 100%; }
35
36
  ${host} .media {
36
37
  position: relative;
37
- flex: 0 1 auto;
38
38
  width: fit-content;
39
39
  min-width: 0;
40
40
  max-width: 100%;
@@ -147,13 +147,15 @@ const entryStyles = unsafeCSS(entryRules(''));
147
147
  * @tagname uvalib-image-regions
148
148
  * @slot - The region list (`<ol>` with `<li data-xywh>`), shown as written. Not used with `items`.
149
149
  * @slot image - The image. A first `<img>` or `<picture>` child is put here by itself.
150
+ * @slot controls - Controls for the image (a lightbox's version comparison), under the image and before the list in reading order. Not covered by the outlines.
150
151
  * @csspart layout - The grid holding the image and the list.
151
152
  * @csspart media - The image and its overlay.
152
153
  * @csspart overlay - The outlines over the image (`aria-hidden`).
153
154
  * @csspart region - One outline.
154
155
  * @csspart list - The heading and the list.
155
156
  * @fires highlight - The highlighted region changed by hover or focus: `detail` is `{ item, index }` (`item` null and `index` -1 when none is). Bubbles and is composed.
156
- * @fires select - A region's outline was clicked (focus moved to its list entry): `detail` is `{ item, index }`. Bubbles and is composed.
157
+ * @fires uvalib-image-regions-activate - A region's outline was clicked, before its list entry takes focus: `detail` is `{ index, item, entry }` (`index` from 0; `item` the region's record; `entry` the page's own `<li>`, from its child list or a lightbox's lent list, or null when this element drew the list from `items`). Cancelable: `preventDefault()` keeps the entry from taking focus, so the page can focus its own control in it instead (a "Who is this?" field). Bubbles and is composed.
158
+ * @fires select - A region's outline was clicked, after its entry took focus (or the page took the activate over): `detail` is `{ item, index, entry }`. Bubbles and is composed. Prefer `uvalib-image-regions-activate`: `select` is also the name of the native text-selection event.
157
159
  * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-image-regions', 'select', '<label>', <number>]` when an outline is clicked (the list's `label`, and the region's number from 1). Never a region's label (it may be a person's name). Nothing on hover or focus. Bubbles and is composed.
158
160
  * @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).
159
161
  * @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).
@@ -341,6 +343,9 @@ export class UvalibImageRegions extends UvalibElement {
341
343
  get listHost() {
342
344
  return this.lightDom ? this.querySelector(':scope > .layout .list-host') : null;
343
345
  }
346
+ get controlsHost() {
347
+ return this.lightDom ? this.querySelector(':scope > .layout .controls-host') : null;
348
+ }
344
349
  /** The `<img>` whose natural size measures pixel regions. */
345
350
  imageEl() {
346
351
  if (this.src)
@@ -439,6 +444,9 @@ export class UvalibImageRegions extends UvalibElement {
439
444
  const listHost = this.listHost;
440
445
  if (list && listHost && list.parentElement !== listHost)
441
446
  listHost.append(list);
447
+ const controls = this.querySelector(':scope > [slot="controls"]');
448
+ if (controls)
449
+ this.controlsHost?.append(controls);
442
450
  }
443
451
  watchImage(img) {
444
452
  if (img === this.watchedImg) {
@@ -554,18 +562,31 @@ export class UvalibImageRegions extends UvalibElement {
554
562
  composed: true,
555
563
  }));
556
564
  }
557
- /** An outline was clicked: focus its entry, and say so. */
565
+ /**
566
+ * An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,
567
+ * unless the page took it over, focus the entry; then `select`. `entry` is the page's own
568
+ * `<li>` (its child list or a lightbox's lent list), never one this element drew from `items`.
569
+ */
558
570
  choose(i) {
559
571
  const entry = this.entries[i];
560
572
  const el = this.entryEl(i);
561
573
  if (!entry || !el)
562
574
  return;
563
- if (!el.hasAttribute('tabindex'))
564
- el.tabIndex = -1;
565
- el.focus();
566
- el.scrollIntoView({ block: 'nearest', inline: 'nearest' });
575
+ const detail = { index: i, item: entry.item, entry: entry.el ?? null };
576
+ const go = this.dispatchEvent(new CustomEvent('uvalib-image-regions-activate', {
577
+ detail,
578
+ bubbles: true,
579
+ composed: true,
580
+ cancelable: true,
581
+ }));
582
+ if (go) {
583
+ if (!el.hasAttribute('tabindex'))
584
+ el.tabIndex = -1;
585
+ el.focus();
586
+ el.scrollIntoView({ block: 'nearest', inline: 'nearest' });
587
+ }
567
588
  this.dispatchEvent(new CustomEvent('select', {
568
- detail: { item: entry.item, index: i },
589
+ detail: { item: entry.item, index: i, entry: detail.entry },
569
590
  bubbles: true,
570
591
  composed: true,
571
592
  }));
@@ -611,26 +632,29 @@ export class UvalibImageRegions extends UvalibElement {
611
632
  : html `<slot @slotchange=${() => this.sync()}></slot>`;
612
633
  const hasActive = this.active >= 0 && !!this.entries[this.active]?.box;
613
634
  return html `<div class="layout" part="layout">
614
- <div class="media" part="media">
615
- ${image}
616
- <div
617
- class="overlay ${hasActive ? 'has-active' : ''}"
618
- part="overlay"
619
- aria-hidden="true"
620
- ?hidden=${this.hideOutlines}
621
- >
622
- ${this.entries.map((e, i) => e.box
635
+ <div class="column">
636
+ <div class="media" part="media">
637
+ ${image}
638
+ <div
639
+ class="overlay ${hasActive ? 'has-active' : ''}"
640
+ part="overlay"
641
+ aria-hidden="true"
642
+ ?hidden=${this.hideOutlines}
643
+ >
644
+ ${this.entries.map((e, i) => e.box
623
645
  ? html `<div
624
- class="region ${i === this.active ? 'active' : ''}"
625
- part="region"
626
- data-index=${i}
627
- >
628
- <span class="badge ${numbers ? '' : 'no-number'}"
629
- >${numbers ? html `<span class="number">${e.number}</span>` : nothing}${e.item.label ? html `<span class="name">${e.item.label}</span>` : nothing}</span
646
+ class="region ${i === this.active ? 'active' : ''}"
647
+ part="region"
648
+ data-index=${i}
630
649
  >
631
- </div>`
650
+ <span class="badge ${numbers ? '' : 'no-number'}"
651
+ >${numbers ? html `<span class="number">${e.number}</span>` : nothing}${e.item.label ? html `<span class="name">${e.item.label}</span>` : nothing}</span
652
+ >
653
+ </div>`
632
654
  : nothing)}
655
+ </div>
633
656
  </div>
657
+ ${light ? html `<div class="controls-host"></div>` : html `<slot name="controls"></slot>`}
634
658
  </div>
635
659
  <div class="list" part="list">
636
660
  <div class="heading" role="heading" aria-level=${this.level} id=${this.headingId}>
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MAAM,EAAE,CAAC;qDAA2C;AAGE;IAAvE,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;wDAAsB;AAE5E;IAAhB,KAAK,EAAE;mDAA+B;AACtB;IAAhB,KAAK,EAAE;mDAAyD;AAChD;IAAhB,KAAK,EAAE;kDAAqB;AACZ;IAAhB,KAAK,EAAE;yDAA2B"}
@@ -14,6 +14,17 @@ export interface LightboxRegionsItem {
14
14
  }
15
15
  /** Maps an image to its regions (none: an empty array, null or undefined). */
16
16
  export type LightboxRegions = (item: LightboxRegionsItem) => readonly ImageRegion[] | null | undefined;
17
+ /** One version of an image: the first is the link's own `href` (which it may omit). */
18
+ export interface LightboxVersion {
19
+ /** Its name, shown on the controls and at the end of the image's accessible name. */
20
+ label: string;
21
+ /** The image (http(s), relative, or a PNG, JPEG, GIF or WebP `data:` URL). */
22
+ href?: string;
23
+ /** Shown under the photo while this version is visible (for example how it was made). */
24
+ note?: string;
25
+ }
26
+ /** Maps an image to its versions (none: null or undefined). */
27
+ export type LightboxVersions = (item: LightboxRegionsItem) => readonly LightboxVersion[] | null | undefined;
17
28
  /** Returns the page's own region list for an image: an `<ol>` or `<ul>` of `<li data-xywh>`. */
18
29
  export type LightboxRegionsList = (item: LightboxRegionsItem) => Element | null | undefined;
19
30
  /**
@@ -53,6 +64,17 @@ export type LightboxRegionsList = (item: LightboxRegionsItem) => Element | null
53
64
  * the image changes or the viewer closes it goes back where it was, `hidden` as before. It wins
54
65
  * over `data-regions`.
55
66
  *
67
+ * Optional versions of an image (an original scan and an AI colorization, a restoration, an
68
+ * infrared capture): `data-versions` on a link, a JSON array of `{ label, href?, note? }`
69
+ * whose first entry is the link's own image, or the `versions` callback. The viewer then
70
+ * compares them over the photo (loaded on first use): Switch (a segmented control), Reveal
71
+ * (a divider: click or tap the photo, or use the slider) or Fade (a slider), `compare`
72
+ * choosing the first. A version's `note` shows under the photo while it is visible, and
73
+ * the image's accessible name ends with the label of the version shown. `version-param`
74
+ * (with `url-param`) keeps the comparison in the address: `?version=2` (Switch, the version
75
+ * from 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version
76
+ * shown; `wipe:40:2` compares the original with version 2).
77
+ *
56
78
  * @tagname uvalib-lightbox
57
79
  * @slot - The image links. A plain click opens the viewer; without JavaScript they open the image.
58
80
  * @slot details - Details for the open image. `data-for` selects one item by its id or position (from 1); without it the details show for every image.
@@ -63,7 +85,9 @@ export type LightboxRegionsList = (item: LightboxRegionsItem) => Element | null
63
85
  * @csspart controls - Previous, Next, the counter and Full size.
64
86
  * @csspart details - The details panel.
65
87
  * @csspart regions - The `<uvalib-image-regions>` around an image with regions.
66
- * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-lightbox', 'open'|'next'|'previous'|'full-size', 'image N', N]` (N from 1, the image's place in the set). Never the URL or the caption. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed.
88
+ * @csspart compare - The version comparison controls and notes under the photo.
89
+ * @fires uvalib-lightbox-version - The visitor changed the comparison (mode, version or position; once a slider settles): `detail` is `{ id, mode, index, value }` (`mode` `switch`, `wipe` or `fade`; `index` the version shown or compared, from 0; `value` the percentage of it shown, null for Switch). Not fired on open or for a comparison restored from the URL. Bubbles and is composed.
90
+ * @fires uvalib-analytics-event - For `<site-analytics>`: `['uvalib-lightbox', 'open'|'next'|'previous'|'full-size', 'image N', N]` (N from 1, the image's place in the set), and `['uvalib-lightbox', 'compare', 'switch'|'wipe'|'fade', N]` when the visitor changes a comparison (N the version's place from 1; once a slider settles). Never the URL, the caption or a version's label. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed.
67
91
  * @cssprop --uva-color-surface-raised - Dark-mode role token: dialog surface (else `--uva-color-surface`, else #fff).
68
92
  * @cssprop --uva-color-surface - Dark-mode role token: the figure behind the image (else #fff).
69
93
  * @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).
@@ -108,6 +132,24 @@ export declare class UvalibLightbox extends UvalibElement {
108
132
  regionsList?: LightboxRegionsList;
109
133
  /** The heading of the regions list (for example `People`). */
110
134
  regionsLabel: string;
135
+ /**
136
+ * Versions of each image, instead of `data-versions`: called with
137
+ * `{ element, id, href, index }`, it returns `{ label, href?, note? }` objects, the first
138
+ * being the link's own image (null: none).
139
+ */
140
+ versions?: LightboxVersions;
141
+ /**
142
+ * How an image's versions are compared first: `switch` (default: one at a time, any number
143
+ * of versions), `wipe` (a divider over the photo) or `fade` (a cross-fade). The viewer
144
+ * offers the others.
145
+ */
146
+ compare: 'switch' | 'wipe' | 'fade';
147
+ /**
148
+ * Query parameter for the comparison (with `url-param`), for example `version`:
149
+ * `?version=1`, `?version=wipe:40`, `?version=fade:60`. Written with replaceState once the
150
+ * visitor's change settles; read when the viewer opens from the address.
151
+ */
152
+ versionParam: string;
111
153
  private slides;
112
154
  private index;
113
155
  private open;
@@ -166,6 +208,10 @@ export declare class UvalibLightbox extends UvalibElement {
166
208
  private entryTabindex;
167
209
  private warnedList;
168
210
  private refocus;
211
+ /** The comparison controller, once its module has loaded. */
212
+ private cmp?;
213
+ /** The comparison from the address, for the image opened from it. */
214
+ private pendingVersion;
169
215
  /** Shadow mode follows the base class. Light mode renders into `.viewer`. */
170
216
  private get isLight();
171
217
  protected createRenderRoot(): HTMLElement | DocumentFragment;
@@ -184,6 +230,12 @@ export declare class UvalibLightbox extends UvalibElement {
184
230
  private scheduleSync;
185
231
  private collect;
186
232
  private slide;
233
+ /** `data-versions` (checked by the comparison module), else the `versions` callback's list. */
234
+ private versionsOf;
235
+ /** Load the comparison module (once per page), then make this viewer's controller. */
236
+ private loadCompare;
237
+ /** What the comparison module may use of this viewer. */
238
+ private compareHost;
187
239
  /** `data-regions`, then whatever the `regions` callback adds. */
188
240
  private regionsOf;
189
241
  /** `data-regions-list` (an id in this root), else the `regionsList` callback's element. */
@@ -194,6 +246,7 @@ export declare class UvalibLightbox extends UvalibElement {
194
246
  private get multiple();
195
247
  /** The URL the `<img>` should load: a viewport-sized IIIF request, or the href itself. */
196
248
  private get displaySrc();
249
+ private sized;
197
250
  private measure;
198
251
  private readonly onResize;
199
252
  private readonly onClick;
@@ -202,6 +255,7 @@ export declare class UvalibLightbox extends UvalibElement {
202
255
  private activate;
203
256
  /** Restore a viewer the URL already points at. No analytics: it is not a new action. */
204
257
  private openFromUrl;
258
+ private versionFromUrl;
205
259
  private step;
206
260
  /**
207
261
  * Close. `ui` is Close, Escape or the backdrop (Back when this viewer pushed, else drop the
@@ -209,7 +263,10 @@ export declare class UvalibLightbox extends UvalibElement {
209
263
  * last image leaving the page: drop the param and do not reopen from it.
210
264
  */
211
265
  private dismiss;
212
- /** Returns false when this document cannot change the address (for example an iframe srcdoc). */
266
+ /**
267
+ * Returns false when this document cannot change the address (for example an iframe
268
+ * srcdoc). `version` is the comparison (`version-param`), dropped with the image.
269
+ */
213
270
  private writeParam;
214
271
  private readonly onPop;
215
272
  /** Ignore the close event a history traversal fires on the dialog it just opened. */
@@ -217,6 +274,7 @@ export declare class UvalibLightbox extends UvalibElement {
217
274
  private readonly onKey;
218
275
  private typing;
219
276
  private readonly onDialogClick;
277
+ private readonly onStack;
220
278
  /** The dialog element is stable across renders. Watch `open` on whichever node is current. */
221
279
  private bindDialogObserver;
222
280
  private readonly onDialogClose;
@@ -277,7 +335,12 @@ export declare class UvalibLightbox extends UvalibElement {
277
335
  private returnList;
278
336
  private get statusText();
279
337
  private readonly toggleRegions;
280
- /** The image, inside `<uvalib-image-regions>` when it has regions (or the page's list). */
338
+ /**
339
+ * The image, inside `<uvalib-image-regions>` when it has regions (or the page's list). An
340
+ * image with versions sits in a `.stack` (the same element before and after the comparison
341
+ * loads, so the image is not loaded again), with the comparison's layers over it and its
342
+ * controls under it.
343
+ */
281
344
  private renderImage;
282
345
  protected render(): import("lit").TemplateResult<1>;
283
346
  }