@uvalib/web-components 1.4.0 → 1.5.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 +10 -0
- package/README.md +16 -4
- package/dist/components/uvalib-image-regions/UvalibImageRegions.d.ts +7 -2
- package/dist/components/uvalib-image-regions/UvalibImageRegions.js +21 -7
- package/dist/components/uvalib-image-regions/UvalibImageRegions.js.map +1 -1
- package/dist/custom-elements.json +9 -2
- package/dist-cdn/custom-elements.json +9 -2
- package/dist-cdn/manifest.json +1 -1
- package/dist-cdn/skills/uvalib-web-components/SKILL.md +1 -1
- package/dist-cdn/skills/uvalib-web-components/reference/components.md +2 -1
- package/dist-cdn/uvalib-image-regions.js +16 -5
- package/dist-cdn/uvalib-image-regions.js.map +1 -1
- package/package.json +1 -1
- package/skills/uvalib-web-components/SKILL.md +1 -1
- package/skills/uvalib-web-components/reference/components.md +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.5.0 — 2026-11-21
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- a cancelable activate event when an outline is clicked (issue #24)
|
|
8
|
+
|
|
9
|
+
### Other
|
|
10
|
+
|
|
11
|
+
- Merge branch 'feat/regions-activate': image-regions activate event (issue #24)
|
|
12
|
+
|
|
3
13
|
## v1.4.0 — 2026-11-21
|
|
4
14
|
|
|
5
15
|
### Features
|
package/README.md
CHANGED
|
@@ -659,15 +659,26 @@ With your own actions in each entry, give the viewer the page's list: `data-regi
|
|
|
659
659
|
</script>
|
|
660
660
|
```
|
|
661
661
|
|
|
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
|
|
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 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
663
|
- **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
664
|
- **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
665
|
- **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
666
|
- **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
667
|
- **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
|
|
668
|
+
- **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.
|
|
669
|
+
|
|
670
|
+
```js
|
|
671
|
+
document.addEventListener('uvalib-image-regions-activate', (e) => {
|
|
672
|
+
const form = e.detail.entry?.querySelector('.who-is-this');
|
|
673
|
+
if (!form) return; // the entry takes focus as usual
|
|
674
|
+
e.preventDefault();
|
|
675
|
+
form.hidden = false;
|
|
676
|
+
form.querySelector('input').focus();
|
|
677
|
+
});
|
|
678
|
+
```
|
|
679
|
+
|
|
669
680
|
- **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.
|
|
681
|
+
- **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
682
|
- **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
683
|
- **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
684
|
|
|
@@ -2662,7 +2673,8 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
|
|
|
2662
2673
|
| Event | Description |
|
|
2663
2674
|
|---|---|
|
|
2664
2675
|
| `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
|
-
| `
|
|
2676
|
+
| `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. |
|
|
2677
|
+
| `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
2678
|
| `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
2679
|
|
|
2668
2680
|
#### CSS custom properties
|
|
@@ -29,7 +29,8 @@ export type { ImageRegion } from './regions.js';
|
|
|
29
29
|
* @csspart region - One outline.
|
|
30
30
|
* @csspart list - The heading and the list.
|
|
31
31
|
* @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
|
|
32
|
+
* @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.
|
|
33
|
+
* @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
34
|
* @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
35
|
* @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).
|
|
35
36
|
* @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).
|
|
@@ -130,7 +131,11 @@ export declare class UvalibImageRegions extends UvalibElement {
|
|
|
130
131
|
private readonly onFocusIn;
|
|
131
132
|
private readonly onFocusOut;
|
|
132
133
|
private readonly onClick;
|
|
133
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,
|
|
136
|
+
* unless the page took it over, focus the entry; then `select`. `entry` is the page's own
|
|
137
|
+
* `<li>` (its child list or a lightbox's lent list), never one this element drew from `items`.
|
|
138
|
+
*/
|
|
134
139
|
private choose;
|
|
135
140
|
private get level();
|
|
136
141
|
private renderOwnList;
|
|
@@ -153,7 +153,8 @@ const entryStyles = unsafeCSS(entryRules(''));
|
|
|
153
153
|
* @csspart region - One outline.
|
|
154
154
|
* @csspart list - The heading and the list.
|
|
155
155
|
* @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
|
|
156
|
+
* @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.
|
|
157
|
+
* @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
158
|
* @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
159
|
* @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).
|
|
159
160
|
* @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).
|
|
@@ -554,18 +555,31 @@ export class UvalibImageRegions extends UvalibElement {
|
|
|
554
555
|
composed: true,
|
|
555
556
|
}));
|
|
556
557
|
}
|
|
557
|
-
/**
|
|
558
|
+
/**
|
|
559
|
+
* An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,
|
|
560
|
+
* unless the page took it over, focus the entry; then `select`. `entry` is the page's own
|
|
561
|
+
* `<li>` (its child list or a lightbox's lent list), never one this element drew from `items`.
|
|
562
|
+
*/
|
|
558
563
|
choose(i) {
|
|
559
564
|
const entry = this.entries[i];
|
|
560
565
|
const el = this.entryEl(i);
|
|
561
566
|
if (!entry || !el)
|
|
562
567
|
return;
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
568
|
+
const detail = { index: i, item: entry.item, entry: entry.el ?? null };
|
|
569
|
+
const go = this.dispatchEvent(new CustomEvent('uvalib-image-regions-activate', {
|
|
570
|
+
detail,
|
|
571
|
+
bubbles: true,
|
|
572
|
+
composed: true,
|
|
573
|
+
cancelable: true,
|
|
574
|
+
}));
|
|
575
|
+
if (go) {
|
|
576
|
+
if (!el.hasAttribute('tabindex'))
|
|
577
|
+
el.tabIndex = -1;
|
|
578
|
+
el.focus();
|
|
579
|
+
el.scrollIntoView({ block: 'nearest', inline: 'nearest' });
|
|
580
|
+
}
|
|
567
581
|
this.dispatchEvent(new CustomEvent('select', {
|
|
568
|
-
detail: { item: entry.item, index: i },
|
|
582
|
+
detail: { item: entry.item, index: i, entry: detail.entry },
|
|
569
583
|
bubbles: true,
|
|
570
584
|
composed: true,
|
|
571
585
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UvalibImageRegions.js","sourceRoot":"","sources":["../../../src/components/uvalib-image-regions/UvalibImageRegions.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAuB,MAAM,KAAK,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM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,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDAAqB;AAEnB;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;uDAAsB;AAGhD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAmB;AAGU;IAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;wDAAuB;AAGlD;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,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"}
|
|
@@ -25665,7 +25665,7 @@
|
|
|
25665
25665
|
}
|
|
25666
25666
|
}
|
|
25667
25667
|
],
|
|
25668
|
-
"description": "An outline was clicked: focus its
|
|
25668
|
+
"description": "An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,\nunless the page took it over, focus the entry; then `select`. `entry` is the page's own\n`<li>` (its child list or a lightbox's lent list), never one this element drew from `items`."
|
|
25669
25669
|
},
|
|
25670
25670
|
{
|
|
25671
25671
|
"kind": "field",
|
|
@@ -25819,12 +25819,19 @@
|
|
|
25819
25819
|
},
|
|
25820
25820
|
"description": "The highlighted region changed by hover or focus: `detail` is `{ item, index }` (`item` null and `index` -1 when none is). Bubbles and is composed."
|
|
25821
25821
|
},
|
|
25822
|
+
{
|
|
25823
|
+
"name": "uvalib-image-regions-activate",
|
|
25824
|
+
"type": {
|
|
25825
|
+
"text": "CustomEvent"
|
|
25826
|
+
},
|
|
25827
|
+
"description": "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."
|
|
25828
|
+
},
|
|
25822
25829
|
{
|
|
25823
25830
|
"name": "select",
|
|
25824
25831
|
"type": {
|
|
25825
25832
|
"text": "CustomEvent"
|
|
25826
25833
|
},
|
|
25827
|
-
"description": "A region's outline was clicked
|
|
25834
|
+
"description": "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."
|
|
25828
25835
|
},
|
|
25829
25836
|
{
|
|
25830
25837
|
"description": "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.",
|
|
@@ -25665,7 +25665,7 @@
|
|
|
25665
25665
|
}
|
|
25666
25666
|
}
|
|
25667
25667
|
],
|
|
25668
|
-
"description": "An outline was clicked: focus its
|
|
25668
|
+
"description": "An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,\nunless the page took it over, focus the entry; then `select`. `entry` is the page's own\n`<li>` (its child list or a lightbox's lent list), never one this element drew from `items`."
|
|
25669
25669
|
},
|
|
25670
25670
|
{
|
|
25671
25671
|
"kind": "field",
|
|
@@ -25819,12 +25819,19 @@
|
|
|
25819
25819
|
},
|
|
25820
25820
|
"description": "The highlighted region changed by hover or focus: `detail` is `{ item, index }` (`item` null and `index` -1 when none is). Bubbles and is composed."
|
|
25821
25821
|
},
|
|
25822
|
+
{
|
|
25823
|
+
"name": "uvalib-image-regions-activate",
|
|
25824
|
+
"type": {
|
|
25825
|
+
"text": "CustomEvent"
|
|
25826
|
+
},
|
|
25827
|
+
"description": "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."
|
|
25828
|
+
},
|
|
25822
25829
|
{
|
|
25823
25830
|
"name": "select",
|
|
25824
25831
|
"type": {
|
|
25825
25832
|
"text": "CustomEvent"
|
|
25826
25833
|
},
|
|
25827
|
-
"description": "A region's outline was clicked
|
|
25834
|
+
"description": "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."
|
|
25828
25835
|
},
|
|
25829
25836
|
{
|
|
25830
25837
|
"description": "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.",
|
package/dist-cdn/manifest.json
CHANGED
|
@@ -720,7 +720,7 @@ Use these instead of a hand-built gallery or a carousel. There is no autoplay.
|
|
|
720
720
|
- `<uvalib-lightbox>` from `uvalib-lightbox.js`: progressive enhancement over plain links. Wrap them (`<a href="full.jpg" data-caption="Page 2"><img alt="Page 2" width="1600" height="2000"></a>`), or point at links elsewhere with `selector="a.pb-image"`. Without JavaScript, and on a modified click, the link opens the image as before. A primary click opens a native `<dialog>` (`showModal()`): the caption names it, Close takes focus, focus returns to the trigger, Escape and the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping; Left is previous in left-to-right), with a polite "3 of 13". Full size opens the original image in a new tab and says so in its accessible name. It is offered for an http(s) URL or a PNG, JPEG, GIF or WebP `data:` image, never an SVG `data:` URL. A IIIF Image API URL keeps its region and only the size becomes `!W,H` for the viewport; TIFF and JPEG2000 URLs are left as written. Full size stays the original href.
|
|
721
721
|
- `url-param="photo"` keeps `?photo=<id>` in sync (the id is `data-id`, else `id`, else the IIIF identifier, else the position from 1): opening pushes a history entry, stepping replaces it, Back closes. On a hash route the parameter is written inside the hash. Opening from a URL that already has it is not an analytics event. With `spa="auto"`, that opening push may count as one Matomo page view.
|
|
722
722
|
- Details: a child with `slot="details"` (`data-for` selects one item by id or position from 1; without it the details show for every image), or `data-details-id` on a link naming an element elsewhere. It is put back when the viewer moves on or closes.
|
|
723
|
-
- `<uvalib-image-regions>` from `uvalib-image-regions.js`: numbered outlines on an image (people, objects, inscriptions) with a list of the same regions beside it. Write the page's own `<img width height alt>` and `<ol>` inside, each `<li data-xywh="percent:x,y,w,h">` (or pixels of the natural size, `160,120,320,240`; `image-width`/`image-height` for a IIIF derivative) holding the region's link and your own action buttons, which stay yours; or set `items` (`{ label, x, y, w, h, unit?, href?, description? }[]`). The list is the accessible route: the outlines are `aria-hidden`, not tab stops, and never the only place a name or action is; hovering or focusing an entry highlights its outline (thicker double outline and label) and back, and clicking an outline focuses its entry. `label` names the list. Listen for `
|
|
723
|
+
- `<uvalib-image-regions>` from `uvalib-image-regions.js`: numbered outlines on an image (people, objects, inscriptions) with a list of the same regions beside it. Write the page's own `<img width height alt>` and `<ol>` inside, each `<li data-xywh="percent:x,y,w,h">` (or pixels of the natural size, `160,120,320,240`; `image-width`/`image-height` for a IIIF derivative) holding the region's link and your own action buttons, which stay yours; or set `items` (`{ label, x, y, w, h, unit?, href?, description? }[]`). The list is the accessible route: the outlines are `aria-hidden`, not tab stops, and never the only place a name or action is; hovering or focusing an entry highlights its outline (thicker double outline and label) and back, and clicking an outline focuses its entry. `label` names the list. Listen for `uvalib-image-regions-activate` (an outline clicked, before its entry takes focus; `detail: { index, item, entry }`, `entry` the page's own `<li>`; cancelable, so the page can focus its own control in the entry, such as a "Who is this?" field) and `highlight`; never read the shadow DOM's outlines for it. Do not hand-build absolutely positioned outlines. It reports outline clicks itself (the list's label and the number, never a region's label).
|
|
724
724
|
- Regions in the viewer: `data-regions` on a lightbox link (a JSON array, or `percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the lightbox's `regions` callback (`({ element, id, href, index }) => regions`). The open image then shows the outlines, their list and a "Show regions" toggle; `regions-label` names the list. For your own buttons in each entry, `data-regions-list="<id>"` (or the `regionsList` callback) names a hidden `<ol>` of `<li data-xywh>` in the page: it is lent to the viewer (same nodes, your listeners and CSS keep working) and put back on close; give each action a unique name ("Confirm Tim Kaine").
|
|
725
725
|
- `<uvalib-photo-grid>` from `uvalib-photo-grid.js`: justified rows. Each direct `<a href>` or `<button>` is one photo and stays a real control. The row is about 220px, and 140px at 767px and below, unless `row-height` is set (a bare number is pixels). Give each image `width` and `height` so the row does not jump when it loads. An image with no visible text gets a caption from its alt, and a repeated alt is cleared (the original is kept for a lightbox). A different alt is kept. Do not set an `aria-label` that differs from the visible text; the grid will not add a caption beside one. Generated "Photo N" captions renumber when the photos change order. A `<span slot="badge">` inside the item, or `data-badge` on it (“seq”, “3 photos”), is drawn over the thumbnail and stays in the accessible name; an existing `aria-label` gains the badge text. A grid inside a lightbox opens the viewer. The grid reports no analytics.
|
|
726
726
|
|
|
@@ -1118,7 +1118,8 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
|
|
|
1118
1118
|
| Event | Description |
|
|
1119
1119
|
|---|---|
|
|
1120
1120
|
| `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. |
|
|
1121
|
-
| `
|
|
1121
|
+
| `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. |
|
|
1122
|
+
| `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. |
|
|
1122
1123
|
| `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. |
|
|
1123
1124
|
|
|
1124
1125
|
### CSS custom properties
|
|
@@ -368,22 +368,33 @@ var v = "Regions", y = 0, b = "button, input, select, textarea, ol, ul, [hidden]
|
|
|
368
368
|
choose(e) {
|
|
369
369
|
let t = this.entries[e], n = this.entryEl(e);
|
|
370
370
|
if (!t || !n) return;
|
|
371
|
-
|
|
371
|
+
let r = {
|
|
372
|
+
index: e,
|
|
373
|
+
item: t.item,
|
|
374
|
+
entry: t.el ?? null
|
|
375
|
+
};
|
|
376
|
+
this.dispatchEvent(new CustomEvent("uvalib-image-regions-activate", {
|
|
377
|
+
detail: r,
|
|
378
|
+
bubbles: !0,
|
|
379
|
+
composed: !0,
|
|
380
|
+
cancelable: !0
|
|
381
|
+
})) && (n.hasAttribute("tabindex") || (n.tabIndex = -1), n.focus(), n.scrollIntoView({
|
|
372
382
|
block: "nearest",
|
|
373
383
|
inline: "nearest"
|
|
374
|
-
}), this.dispatchEvent(new CustomEvent("select", {
|
|
384
|
+
})), this.dispatchEvent(new CustomEvent("select", {
|
|
375
385
|
detail: {
|
|
376
386
|
item: t.item,
|
|
377
|
-
index: e
|
|
387
|
+
index: e,
|
|
388
|
+
entry: r.entry
|
|
378
389
|
},
|
|
379
390
|
bubbles: !0,
|
|
380
391
|
composed: !0
|
|
381
392
|
}));
|
|
382
|
-
let
|
|
393
|
+
let i = f(this.label) || v;
|
|
383
394
|
u(this, [
|
|
384
395
|
"uvalib-image-regions",
|
|
385
396
|
"select",
|
|
386
|
-
|
|
397
|
+
i,
|
|
387
398
|
t.number
|
|
388
399
|
]);
|
|
389
400
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uvalib-image-regions.js","names":["unsafeCSS","nothing","_decorate","property","state","n","i","r$1","b","define","__decorate","r","installLightDomStyles","UvalibElement","trackEvent","precedingHeadingLevel","normalize","safeHref","accessible","toRegion","parseXywh","toPercent","DEFAULT_LABEL","nextId","NOT_LABEL","structuralRules","host","shadowStructure","entryRules","p","entryStyles","UvalibImageRegions","to","hit","root","node","above","options","changed","kids","el","k","img","next","key","sameEls","out","raw","items","item","list","outside","start","li","box","link","label","id","href","parts","walk","imgHost","listHost","w","h","tall","entry","media","e","at","en","name","base","A","light","numbers","image","hasActive"],"sources":["../src/components/uvalib-image-regions/UvalibImageRegions.ts","../src/components/uvalib-image-regions/uvalib-image-regions.ts"],"sourcesContent":["import { css, html, nothing, unsafeCSS, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { precedingHeadingLevel } from '../../base/heading-level.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { normalize, safeHref } from '../../base/source-children.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { parseXywh, toPercent, toRegion, type ImageRegion, type RegionBox } from './regions.js';\n\nexport type { ImageRegion } from './regions.js';\n\n/** One region as drawn: what events carry, its box, its number and its list entry. */\ninterface Entry {\n item: ImageRegion;\n box: RegionBox | null;\n number: number;\n /** The author's list item (children mode); own items are found by index. */\n el: HTMLElement | null;\n}\n\nconst DEFAULT_LABEL = 'Regions';\nlet nextId = 0;\n\n/** Controls inside a list item, which are actions and not part of the region's name. */\nconst NOT_LABEL = 'button, input, select, textarea, ol, ul, [hidden], [aria-hidden=\"true\"]';\n\n/**\n * Kept with `no-style`: the layout (the image at its own width, at most the element's, and\n * the list beside it when at least 14rem is left, else under it: the same wrapping flex row\n * base.css gives the children before the element upgrades, so nothing moves), the overlay\n * over the image, and the double outlines and number badges (without them the regions are\n * not visible). `host` is `:host` (shadow) or the tag (light DOM).\n */\nconst structuralRules = (host: string) => `\n ${host} { display: block; }\n ${host} .layout {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n align-items: flex-start;\n }\n ${host} .media {\n position: relative;\n flex: 0 1 auto;\n width: fit-content;\n min-width: 0;\n max-width: 100%;\n margin: 0;\n }\n ${host} .list { flex: 1 1 14rem; min-width: 0; }\n ${host} .media img, ${host} .img-host > picture${\n host === ':host' ? ', ::slotted(img), ::slotted(picture)' : ''\n } { display: block; max-width: 100%; height: auto; }\n ${host} .overlay {\n position: absolute;\n inset: 0;\n overflow: clip;\n overflow-clip-margin: 0.5rem;\n pointer-events: none;\n forced-color-adjust: none;\n }\n ${host} .region {\n position: absolute;\n box-sizing: border-box;\n border: 2px solid #fff;\n outline: 2px solid #000;\n pointer-events: auto;\n cursor: pointer;\n }\n ${host} .region.active { z-index: 1; border-width: 4px; outline-width: 4px; }\n ${host} .overlay.has-active .region:not(.active) { opacity: 0.6; }\n ${host} .badge {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: flex;\n gap: 0.375em;\n max-width: 16rem;\n padding: 0.0625rem 0.375rem;\n background: #000;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 700;\n line-height: 1.25;\n white-space: nowrap;\n outline: 1px solid #fff;\n }\n ${host} .region:not([data-inside]) .badge {\n inset-block-start: auto;\n inset-block-end: calc(100% + 4px);\n inset-inline-start: -4px;\n }\n ${host} .region.active:not([data-inside]) .badge {\n inset-block-end: calc(100% + 8px);\n inset-inline-start: -8px;\n }\n ${host} .badge .name { overflow: hidden; text-overflow: ellipsis; }\n ${host} .region:not(.active) .badge .name, ${host} .badge:empty { display: none; }\n ${host} .region:not(.active) .badge.no-number { display: none; }\n ${host} .heading { margin: 0 0 0.5rem; }\n ${host} .items { margin: 0; }\n @media (forced-colors: active) {\n ${host} .region { border-color: Canvas; outline-color: CanvasText; }\n ${host} .region.active { outline-color: Highlight; }\n ${host} .badge { background: CanvasText; color: Canvas; outline-color: Canvas; }\n ${host} .region.active .badge { background: Highlight; color: HighlightText; }\n }\n ${host}[hidden], ${host} [hidden] { display: none !important; }\n`;\nconst shadowStructure = unsafeCSS(structuralRules(':host'));\n\n/**\n * A region's list entry: room for the highlight bar, and the bar (with a tint) while its\n * region is highlighted, so it is shown by more than colour. Shadow mode also installs\n * these in the page, scoped to the tag, for the author's own list items.\n */\nconst entryRules = (p: string) => `\n ${p}[data-uvalib-region] {\n box-sizing: border-box;\n padding-block: 0.5rem;\n padding-inline: calc(0.5rem + 0.375rem) 0.5rem;\n overflow-wrap: anywhere;\n }\n ${p}[data-uvalib-region][data-uvalib-active] {\n padding-inline-start: 0.5rem;\n border-inline-start: 0.375rem solid currentColor;\n background: var(--uva-color-surface-hover, #f1f1f1);\n }\n ${p}[data-uvalib-region]:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n ${p}[data-uvalib-region][tabindex='-1']:focus:not(:focus-visible) { outline: none; }\n @media (forced-colors: active) {\n ${p}[data-uvalib-region][data-uvalib-active] { border-inline-start-color: Highlight; }\n }\n`;\nconst entryStyles = unsafeCSS(entryRules(''));\n\n/**\n * An image with numbered region outlines (people, objects, inscriptions) and a list of the\n * same regions beside it (under it on a narrow screen). The list is the way in: the\n * outlines are a visual aid, hidden from assistive technology and not in the tab order, so\n * no region is a second tab stop. Hovering or focusing a list entry (or anything in it)\n * highlights its region with a thicker double outline and its label, and dims the others;\n * hovering a region highlights its entry. Clicking a region moves focus to its entry.\n *\n * The image: an `<img>` (or `<picture>`) child, which keeps its `alt`, or `src` and `alt`.\n * Give it `width` and `height` so its space is reserved before it loads.\n *\n * The regions: an `<ol>` child whose `<li>` items carry `data-xywh` (IIIF / Media Fragments:\n * `percent:10,20,30,40`, or pixels `160,120,320,240` of the image's natural size). The list\n * is shown as written, so it works before the component loads or without JavaScript, and\n * any links and buttons in it stay the page's own (their events are the page's). Or set\n * the `items` property, and the component draws the list. Region numbers are the list's\n * numbers, from 1 (or the `<ol>`'s `start`).\n *\n * @tagname uvalib-image-regions\n * @slot - The region list (`<ol>` with `<li data-xywh>`), shown as written. Not used with `items`.\n * @slot image - The image. A first `<img>` or `<picture>` child is put here by itself.\n * @csspart layout - The grid holding the image and the list.\n * @csspart media - The image and its overlay.\n * @csspart overlay - The outlines over the image (`aria-hidden`).\n * @csspart region - One outline.\n * @csspart list - The heading and the list.\n * @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.\n * @fires select - A region's outline was clicked (focus moved to its list entry): `detail` is `{ item, index }`. Bubbles and is composed.\n * @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.\n * @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).\n * @cssprop --uva-color-link - Dark-mode role token: entry links (else `--uva-brand-blue`).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n * @cssprop --uva-color-text-muted - Dark-mode role token: descriptions (else #4b5563).\n */\nexport class UvalibImageRegions extends UvalibElement {\n static styles = [\n accessible,\n shadowStructure,\n entryStyles,\n css`\n .list {\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n }\n .heading {\n font-size: 1.125rem;\n font-weight: 700;\n line-height: 1.3;\n }\n .items {\n padding-inline-start: 1.75rem;\n }\n .items a {\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n .description {\n display: block;\n color: var(--uva-color-text-muted, #4b5563);\n font-size: 0.9375rem;\n }\n @media (prefers-reduced-motion: no-preference) {\n .region {\n transition: opacity 0.15s ease;\n }\n }\n `,\n ];\n\n /** The regions, when the component draws the list. Overrides the child list. */\n @property({ attribute: false }) items: ImageRegion[] | null = null;\n\n /** Image URL, when there is no `<img>` child. */\n @property({ type: String }) src = '';\n /** The image's alternative text (with `src`). */\n @property({ type: String }) alt = '';\n /** The image's width (with `src`), reserving its space. */\n @property({ type: Number }) width?: number;\n /** The image's height (with `src`). */\n @property({ type: Number }) height?: number;\n\n /**\n * The size pixel regions are measured in, when it is not the image's natural size (for\n * example a IIIF derivative of a larger original: the original's width and height).\n */\n @property({ type: Number, attribute: 'image-width' }) imageWidth?: number;\n /** The height pixel regions are measured in (with `image-width`). */\n @property({ type: Number, attribute: 'image-height' }) imageHeight?: number;\n\n /** The list's heading, and the analytics name. */\n @property({ type: String }) label = 'Regions';\n\n /** The heading's level (2 to 6). Default: one below the heading before the element. */\n @property({ type: Number, attribute: 'heading-level' }) headingLevel?: number;\n\n /** `numbers` (default) shows each region's number on its outline; `none` hides them. */\n @property({ type: String }) numbering: 'numbers' | 'none' = 'numbers';\n\n /** Hide the outlines (the list stays). */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outlines' }) hideOutlines = false;\n\n @state() private entries: Entry[] = [];\n @state() private natural: { w: number; h: number } | null = null;\n @state() private active = -1;\n @state() private inferredLevel = 2;\n\n private hover = -1;\n private focused = -1;\n private readonly headingId = `uvalib-image-regions-heading-${++nextId}`;\n private observer?: MutationObserver;\n private watchedImg: HTMLImageElement | null = null;\n /** A list slotted through a `<slot>` child (from a host element's light DOM), also observed. */\n private slottedList: Element | null = null;\n private key = '';\n /** The image's rendered size decides where badges fit. */\n private resizer?: ResizeObserver;\n private resized = 0;\n\n constructor() {\n super();\n this.addEventListener('pointerover', this.onPointerOver);\n this.addEventListener('pointerleave', this.onPointerLeave);\n this.addEventListener('focusin', this.onFocusIn);\n this.addEventListener('focusout', this.onFocusOut);\n this.addEventListener('click', this.onClick);\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n if (this.noStyle && root instanceof ShadowRoot && shadowStructure.styleSheet)\n root.adoptedStyleSheets = [shadowStructure.styleSheet];\n return root;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n const node = this.getRootNode();\n const root = node instanceof Document || node instanceof ShadowRoot ? node : undefined;\n if (this.lightDom && this.noStyle) {\n installLightDomStyles(\n `${this.localName}::structure`,\n unsafeCSS(structuralRules(this.localName)),\n { root, scope: false },\n );\n } else if (!this.lightDom && !this.noStyle) {\n // The author's list items are page content: their highlight is styled in the page.\n installLightDomStyles(\n `${this.localName}::entries`,\n unsafeCSS(entryRules(`${this.localName} `)),\n { root, scope: false },\n );\n }\n const above = precedingHeadingLevel(this);\n this.inferredLevel = above === null ? 2 : Math.min(Math.max(above + 1, 2), 6);\n this.slottedList = null;\n this.sync();\n this.observe();\n }\n\n /** Watch the children, and a list slotted from outside them (it is not in this subtree). */\n private observe(): void {\n this.observer ??= new MutationObserver(() => this.sync());\n this.observer.disconnect();\n const options: MutationObserverInit = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-xywh', 'data-label', 'data-id', 'href', 'start', 'src', 'srcset'],\n characterData: true,\n };\n this.observer.observe(this, options);\n if (this.slottedList) this.observer.observe(this.slottedList, options);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.resizer?.disconnect();\n this.resizer = undefined;\n this.watchImage(null);\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('items') || changed.has('src')) this.sync();\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n this.arrange();\n this.observeSize();\n this.place();\n this.mark();\n // Reading the image's size may set state: not from inside this update.\n queueMicrotask(() => {\n if (this.isConnected) this.watchImage(this.imageEl());\n });\n }\n\n // ---------------------------------------------------------------- sources\n\n /** The author's image element (`<img>` or `<picture>`), wherever it is now. */\n private sourceImage(): HTMLElement | null {\n if (this.src) return null;\n const kids = this.lightDom\n ? [...this.children, ...(this.imgHost?.children ?? [])]\n : [...this.children];\n const named = kids.find((k) => k.getAttribute('slot') === 'image');\n const el = named ?? kids.find((k) => k.localName === 'img' || k.localName === 'picture');\n return el instanceof HTMLElement ? el : null;\n }\n\n /**\n * The author's list (`<ol>` or `<ul>`), wherever it is now. A `<slot>` child (this element\n * inside another component's shadow root) passes on that host's list, which stays in the\n * page's light DOM (so the page's styles and listeners still apply to it).\n */\n private sourceList(): HTMLOListElement | HTMLUListElement | null {\n const kids = (\n this.lightDom ? [...this.children, ...(this.listHost?.children ?? [])] : [...this.children]\n ).flatMap((k) => (k instanceof HTMLSlotElement ? k.assignedElements({ flatten: true }) : [k]));\n const el = kids.find((k) => k.localName === 'ol' || k.localName === 'ul');\n return (el as HTMLOListElement | HTMLUListElement | undefined) ?? null;\n }\n\n private get imgHost(): HTMLElement | null {\n return this.lightDom ? this.querySelector(':scope > .layout .img-host') : null;\n }\n\n private get listHost(): HTMLElement | null {\n return this.lightDom ? this.querySelector(':scope > .layout .list-host') : null;\n }\n\n /** The `<img>` whose natural size measures pixel regions. */\n private imageEl(): HTMLImageElement | null {\n if (this.src) return this.renderRoot.querySelector<HTMLImageElement>('.media > img');\n const el = this.sourceImage();\n if (!el) return null;\n return el instanceof HTMLImageElement ? el : el.querySelector('img');\n }\n\n /** Re-read the regions (and in shadow mode put the image in its slot). */\n private sync(): void {\n const img = this.sourceImage();\n if (img && !this.lightDom && !img.hasAttribute('slot')) img.setAttribute('slot', 'image');\n const next = this.items ? this.fromItems(this.items) : this.fromList();\n const key = JSON.stringify(next.map((e) => [e.item, e.box, e.number]));\n const sameEls =\n next.length === this.entries.length && next.every((e, i) => e.el === this.entries[i]?.el);\n if (key === this.key && sameEls) return;\n this.key = key;\n this.entries = next;\n if (this.active >= next.length) this.active = -1;\n }\n\n private fromItems(items: unknown[]): Entry[] {\n const out: Entry[] = [];\n for (const raw of Array.isArray(items) ? items : []) {\n const item = toRegion(raw);\n if (!item) continue;\n const { x, y, w, h, unit = 'px' } = item;\n out.push({ item, box: { x, y, w, h, unit }, number: out.length + 1, el: null });\n }\n return out;\n }\n\n private fromList(): Entry[] {\n const list = this.sourceList();\n const outside = list && !this.contains(list) ? list : null;\n if (outside !== this.slottedList) {\n this.slottedList = outside;\n if (this.isConnected) this.observe();\n if (outside && !this.noStyle) {\n // Its entries are styled where the list is (the page), not under this tag.\n const root = outside.getRootNode();\n if (root instanceof Document || root instanceof ShadowRoot)\n installLightDomStyles(`${this.localName}::slotted-entries`, entryStyles, {\n root,\n scope: false,\n });\n }\n }\n if (!list) return [];\n const start = list.localName === 'ol' ? Number(list.getAttribute('start') ?? 1) || 1 : 1;\n const out: Entry[] = [];\n [...list.children].forEach((li, i) => {\n if (li.localName !== 'li' || !(li instanceof HTMLElement)) return;\n const box = parseXywh(li.dataset.xywh);\n const link = li.querySelector('a[href]');\n const label = normalize(li.dataset.label) || normalize(link?.textContent) || this.text(li);\n const item: ImageRegion = box ? { label, ...box } : { label, x: 0, y: 0, w: 0, h: 0 };\n const id = normalize(li.dataset.id) || li.id;\n if (id) item.id = id;\n const href = link?.getAttribute('href');\n if (href) item.href = href;\n out.push({ item, box, number: start + i, el: li });\n });\n return out;\n }\n\n /** A list item's own text, without its actions (buttons, fields) or a nested list. */\n private text(li: Element): string {\n const parts: string[] = [];\n const walk = (n: Node) => {\n if (n.nodeType === Node.TEXT_NODE) parts.push(n.textContent ?? '');\n else if (n instanceof Element && !n.matches(NOT_LABEL)) n.childNodes.forEach(walk);\n };\n li.childNodes.forEach(walk);\n return normalize(parts.join(' '));\n }\n\n // ---------------------------------------------------------------- layout\n\n /** Light DOM: move the author's image and list into the layout (the same nodes). */\n private arrange(): void {\n if (!this.lightDom) return;\n const img = this.sourceImage();\n const imgHost = this.imgHost;\n if (img && imgHost && img.parentElement !== imgHost) imgHost.append(img);\n const list = this.items ? null : this.sourceList();\n const listHost = this.listHost;\n if (list && listHost && list.parentElement !== listHost) listHost.append(list);\n }\n\n private watchImage(img: HTMLImageElement | null): void {\n if (img === this.watchedImg) {\n if (img) this.measure();\n return;\n }\n this.watchedImg?.removeEventListener('load', this.onImageLoad);\n this.watchedImg = img;\n img?.addEventListener('load', this.onImageLoad);\n this.measure();\n }\n\n private readonly onImageLoad = (): void => this.measure();\n\n private measure(): void {\n const img = this.watchedImg;\n const w = img?.complete ? img.naturalWidth : 0;\n const h = img?.complete ? img.naturalHeight : 0;\n const next = w > 0 && h > 0 ? { w, h } : null;\n if (next?.w !== this.natural?.w || next?.h !== this.natural?.h) this.natural = next;\n }\n\n /** The size pixel regions are measured in. */\n private get space(): { w: number; h: number } {\n const w = Number(this.imageWidth);\n const h = Number(this.imageHeight);\n if (w > 0 && h > 0) return { w, h };\n return this.natural ?? { w: 0, h: 0 };\n }\n\n /**\n * Position the outlines in percent of the image, so they scale with it (CSSOM, not markup).\n * A number badge sits above its outline, or inside it when there is no room above.\n */\n private place(): void {\n const { w, h } = this.space;\n const overlay = this.renderRoot.querySelector<HTMLElement>('.overlay');\n const tall = overlay?.clientHeight ?? 0;\n for (const el of this.renderRoot.querySelectorAll<HTMLElement>('.overlay > .region')) {\n const entry = this.entries[Number(el.dataset.index)];\n const box = entry?.box ? toPercent(entry.box, w, h) : null;\n el.hidden = !box;\n if (!box) continue;\n el.style.left = `${box.x}%`;\n el.style.top = `${box.y}%`;\n el.style.width = `${box.w}%`;\n el.style.height = `${box.h}%`;\n el.toggleAttribute('data-inside', (box.y / 100) * tall < 28);\n }\n }\n\n private observeSize(): void {\n const media = this.renderRoot.querySelector<HTMLElement>('.media');\n if (!media || typeof ResizeObserver === 'undefined') return;\n if (!this.resizer) {\n this.resizer = new ResizeObserver(() => {\n // The outlines scale by themselves (percent); only the badges' side may change.\n const h = media.clientHeight;\n if (h === this.resized) return;\n this.resized = h;\n this.place();\n });\n this.resizer.observe(media);\n }\n }\n\n /** The list entry of region `i`. */\n private entryEl(i: number): HTMLElement | null {\n const entry = this.entries[i];\n if (!entry) return null;\n if (entry.el) return entry.el;\n return this.renderRoot.querySelector<HTMLElement>(`.items > li[data-index=\"${i}\"]`);\n }\n\n /** Mark the entries (their padding) and the highlighted one. */\n private mark(): void {\n const list = this.items ? null : this.sourceList();\n this.entries.forEach((e, i) => {\n const el = this.entryEl(i);\n // An author's item that has left the list (given back to the page) is not marked again.\n if (!el || (e.el && e.el.parentElement !== list)) return;\n if (el.getAttribute('data-uvalib-region') !== String(e.number))\n el.setAttribute('data-uvalib-region', String(e.number));\n el.toggleAttribute('data-uvalib-active', i === this.active);\n });\n }\n\n // ---------------------------------------------------------------- interaction\n\n /** The region an event is about: its outline or its list entry (or anything inside it). */\n private indexFrom(e: Event): { i: number; outline: boolean } | null {\n for (const n of e.composedPath()) {\n if (n === this) break;\n if (!(n instanceof HTMLElement)) continue;\n if (n.classList.contains('region') && n.parentElement?.classList.contains('overlay'))\n return { i: Number(n.dataset.index), outline: true };\n const at = this.entries.findIndex((en, i) => (en.el ?? this.entryEl(i)) === n);\n if (at >= 0) return { i: at, outline: false };\n }\n return null;\n }\n\n private setActive(): void {\n const next = this.hover >= 0 ? this.hover : this.focused;\n if (next === this.active) return;\n this.active = next;\n const item = this.entries[next]?.item ?? null;\n this.dispatchEvent(\n new CustomEvent('highlight', {\n detail: { item, index: item ? next : -1 },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private readonly onPointerOver = (e: PointerEvent): void => {\n this.hover = this.indexFrom(e)?.i ?? -1;\n this.setActive();\n };\n\n private readonly onPointerLeave = (): void => {\n this.hover = -1;\n this.setActive();\n };\n\n private readonly onFocusIn = (e: FocusEvent): void => {\n this.focused = this.indexFrom(e)?.i ?? -1;\n this.setActive();\n };\n\n private readonly onFocusOut = (e: FocusEvent): void => {\n const to = e.relatedTarget;\n if (\n to instanceof Node &&\n (this.contains(to) || this.renderRoot.contains(to) || this.slottedList?.contains(to))\n )\n return;\n this.focused = -1;\n this.setActive();\n };\n\n private readonly onClick = (e: MouseEvent): void => {\n const hit = this.indexFrom(e);\n if (!hit?.outline) return;\n this.choose(hit.i);\n };\n\n /** An outline was clicked: focus its entry, and say so. */\n private choose(i: number): void {\n const entry = this.entries[i];\n const el = this.entryEl(i);\n if (!entry || !el) return;\n if (!el.hasAttribute('tabindex')) el.tabIndex = -1;\n el.focus();\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n this.dispatchEvent(\n new CustomEvent('select', {\n detail: { item: entry.item, index: i },\n bubbles: true,\n composed: true,\n }),\n );\n const name = normalize(this.label) || DEFAULT_LABEL;\n trackEvent(this, ['uvalib-image-regions', 'select', name, entry.number]);\n }\n\n // ---------------------------------------------------------------- render\n\n private get level(): number {\n const n = Math.trunc(Number(this.headingLevel));\n return n >= 2 && n <= 6 ? n : this.inferredLevel;\n }\n\n private renderOwnList() {\n const base = this.ownerDocument.baseURI;\n return html`<ol class=\"items\" aria-labelledby=${this.headingId}>\n ${this.entries.map(({ item }, i) => {\n const href = item.href && safeHref(item.href, base) ? item.href : '';\n return html`<li data-index=${i}>\n ${href ? html`<a href=${href}>${item.label}</a>` : html`<span>${item.label}</span>`}\n ${item.description ? html`<span class=\"description\">${item.description}</span>` : nothing}\n </li>`;\n })}\n </ol>`;\n }\n\n protected override render() {\n const light = this.lightDom;\n const numbers = this.numbering !== 'none';\n const image = this.src\n ? html`<img\n part=\"image\"\n src=${this.src}\n alt=${this.alt}\n width=${this.width ?? nothing}\n height=${this.height ?? nothing}\n @load=${this.onImageLoad}\n />`\n : light\n ? html`<div class=\"img-host\"></div>`\n : html`<slot name=\"image\" @slotchange=${() => this.requestUpdate()}></slot>`;\n const list = this.items\n ? this.renderOwnList()\n : light\n ? html`<div class=\"list-host\"></div>`\n : html`<slot @slotchange=${() => this.sync()}></slot>`;\n const hasActive = this.active >= 0 && !!this.entries[this.active]?.box;\n return html`<div class=\"layout\" part=\"layout\">\n <div class=\"media\" part=\"media\">\n ${image}\n <div\n class=\"overlay ${hasActive ? 'has-active' : ''}\"\n part=\"overlay\"\n aria-hidden=\"true\"\n ?hidden=${this.hideOutlines}\n >\n ${this.entries.map((e, i) =>\n e.box\n ? html`<div\n class=\"region ${i === this.active ? 'active' : ''}\"\n part=\"region\"\n data-index=${i}\n >\n <span class=\"badge ${numbers ? '' : 'no-number'}\"\n >${numbers ? html`<span class=\"number\">${e.number}</span>` : nothing}${\n e.item.label ? html`<span class=\"name\">${e.item.label}</span>` : nothing\n }</span\n >\n </div>`\n : nothing,\n )}\n </div>\n </div>\n <div class=\"list\" part=\"list\">\n <div class=\"heading\" role=\"heading\" aria-level=${this.level} id=${this.headingId}>\n ${normalize(this.label) || DEFAULT_LABEL}\n </div>\n ${list}\n </div>\n </div>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { UvalibImageRegions } from './UvalibImageRegions.js';\n\ndefine('uvalib-image-regions', UvalibImageRegions);\n"],"mappings":";;;;;;;AAqBA,IAAMsB,IAAgB,WAClBC,IAAS,GAGPC,IAAY,6EASZC,KAAmB,MAAiB;IACtCC,EAAK;IACLA,EAAK;;;;;;IAMLA,EAAK;;;;;;;;IAQLA,EAAK;IACLA,EAAK,eAAeA,EAAK,sBACzBA,MAAS,UAAU,yCAAyC,GAC7D;IACCA,EAAK;;;;;;;;IAQLA,EAAK;;;;;;;;IAQLA,EAAK;IACLA,EAAK;IACLA,EAAK;;;;;;;;;;;;;;;;IAgBLA,EAAK;;;;;IAKLA,EAAK;;;;IAILA,EAAK;IACLA,EAAK,sCAAsCA,EAAK;IAChDA,EAAK;IACLA,EAAK;IACLA,EAAK;;MAEHA,EAAK;MACLA,EAAK;MACLA,EAAK;MACLA,EAAK;;IAEPA,EAAK,YAAYA,EAAK;GAEpBC,IAAkB3B,EAAUyB,EAAgB,OAAO,CAAC,GAOpDG,KAAc,MAAc;IAC9BC,EAAE;;;;;;IAMFA,EAAE;;;;;IAKFA,EAAE;;;;IAIFA,EAAE;;MAEAA,EAAE;;GAGFC,IAAc9B,EAAU4B,EAAW,EAAE,CAAC,GAqC/BG,IAAb,cAAwClB,EAAc;;EACpC,KAAA,SAAA;GACdK;GACAS;GACAG;GACA,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BL;;CAmDA,cAAc;EAMZ,AALA,MAAM,GAjDsD,KAAA,QAAA,MAG5B,KAAA,MA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AC,EAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAgB,CAAC,CAAA,GAAA4B,EAAA,WAAA,gBAAA,KAAA,CAAA,GAErE7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,WAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,WAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,UAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,iBAAA,KAAA,CAAA,GChPTtB,EAAO,wBAAwBsB,CAAkB"}
|
|
1
|
+
{"version":3,"file":"uvalib-image-regions.js","names":["unsafeCSS","nothing","_decorate","property","state","n","i","r$1","b","define","__decorate","r","installLightDomStyles","UvalibElement","trackEvent","precedingHeadingLevel","normalize","safeHref","accessible","toRegion","parseXywh","toPercent","DEFAULT_LABEL","nextId","NOT_LABEL","structuralRules","host","shadowStructure","entryRules","p","entryStyles","UvalibImageRegions","to","hit","root","node","above","options","changed","kids","el","k","img","next","key","sameEls","out","raw","items","item","list","outside","start","li","box","link","label","id","href","parts","walk","imgHost","listHost","w","h","tall","entry","media","e","at","en","detail","name","base","A","light","numbers","image","hasActive"],"sources":["../src/components/uvalib-image-regions/UvalibImageRegions.ts","../src/components/uvalib-image-regions/uvalib-image-regions.ts"],"sourcesContent":["import { css, html, nothing, unsafeCSS, type PropertyValues } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { trackEvent } from '../../base/analytics.js';\nimport { precedingHeadingLevel } from '../../base/heading-level.js';\nimport { installLightDomStyles } from '../../base/light-dom-styles.js';\nimport { normalize, safeHref } from '../../base/source-children.js';\nimport { UvalibElement } from '../../base/UvalibElement.js';\nimport { accessible } from '../../styles/accessible.js';\nimport { parseXywh, toPercent, toRegion, type ImageRegion, type RegionBox } from './regions.js';\n\nexport type { ImageRegion } from './regions.js';\n\n/** One region as drawn: what events carry, its box, its number and its list entry. */\ninterface Entry {\n item: ImageRegion;\n box: RegionBox | null;\n number: number;\n /** The author's list item (children mode); own items are found by index. */\n el: HTMLElement | null;\n}\n\nconst DEFAULT_LABEL = 'Regions';\nlet nextId = 0;\n\n/** Controls inside a list item, which are actions and not part of the region's name. */\nconst NOT_LABEL = 'button, input, select, textarea, ol, ul, [hidden], [aria-hidden=\"true\"]';\n\n/**\n * Kept with `no-style`: the layout (the image at its own width, at most the element's, and\n * the list beside it when at least 14rem is left, else under it: the same wrapping flex row\n * base.css gives the children before the element upgrades, so nothing moves), the overlay\n * over the image, and the double outlines and number badges (without them the regions are\n * not visible). `host` is `:host` (shadow) or the tag (light DOM).\n */\nconst structuralRules = (host: string) => `\n ${host} { display: block; }\n ${host} .layout {\n display: flex;\n flex-wrap: wrap;\n gap: 1rem;\n align-items: flex-start;\n }\n ${host} .media {\n position: relative;\n flex: 0 1 auto;\n width: fit-content;\n min-width: 0;\n max-width: 100%;\n margin: 0;\n }\n ${host} .list { flex: 1 1 14rem; min-width: 0; }\n ${host} .media img, ${host} .img-host > picture${\n host === ':host' ? ', ::slotted(img), ::slotted(picture)' : ''\n } { display: block; max-width: 100%; height: auto; }\n ${host} .overlay {\n position: absolute;\n inset: 0;\n overflow: clip;\n overflow-clip-margin: 0.5rem;\n pointer-events: none;\n forced-color-adjust: none;\n }\n ${host} .region {\n position: absolute;\n box-sizing: border-box;\n border: 2px solid #fff;\n outline: 2px solid #000;\n pointer-events: auto;\n cursor: pointer;\n }\n ${host} .region.active { z-index: 1; border-width: 4px; outline-width: 4px; }\n ${host} .overlay.has-active .region:not(.active) { opacity: 0.6; }\n ${host} .badge {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n display: flex;\n gap: 0.375em;\n max-width: 16rem;\n padding: 0.0625rem 0.375rem;\n background: #000;\n color: #fff;\n font-size: 0.875rem;\n font-weight: 700;\n line-height: 1.25;\n white-space: nowrap;\n outline: 1px solid #fff;\n }\n ${host} .region:not([data-inside]) .badge {\n inset-block-start: auto;\n inset-block-end: calc(100% + 4px);\n inset-inline-start: -4px;\n }\n ${host} .region.active:not([data-inside]) .badge {\n inset-block-end: calc(100% + 8px);\n inset-inline-start: -8px;\n }\n ${host} .badge .name { overflow: hidden; text-overflow: ellipsis; }\n ${host} .region:not(.active) .badge .name, ${host} .badge:empty { display: none; }\n ${host} .region:not(.active) .badge.no-number { display: none; }\n ${host} .heading { margin: 0 0 0.5rem; }\n ${host} .items { margin: 0; }\n @media (forced-colors: active) {\n ${host} .region { border-color: Canvas; outline-color: CanvasText; }\n ${host} .region.active { outline-color: Highlight; }\n ${host} .badge { background: CanvasText; color: Canvas; outline-color: Canvas; }\n ${host} .region.active .badge { background: Highlight; color: HighlightText; }\n }\n ${host}[hidden], ${host} [hidden] { display: none !important; }\n`;\nconst shadowStructure = unsafeCSS(structuralRules(':host'));\n\n/**\n * A region's list entry: room for the highlight bar, and the bar (with a tint) while its\n * region is highlighted, so it is shown by more than colour. Shadow mode also installs\n * these in the page, scoped to the tag, for the author's own list items.\n */\nconst entryRules = (p: string) => `\n ${p}[data-uvalib-region] {\n box-sizing: border-box;\n padding-block: 0.5rem;\n padding-inline: calc(0.5rem + 0.375rem) 0.5rem;\n overflow-wrap: anywhere;\n }\n ${p}[data-uvalib-region][data-uvalib-active] {\n padding-inline-start: 0.5rem;\n border-inline-start: 0.375rem solid currentColor;\n background: var(--uva-color-surface-hover, #f1f1f1);\n }\n ${p}[data-uvalib-region]:focus-visible {\n outline: 3px solid var(--uva-color-focus, var(--uva-brand-orange, #e57200));\n outline-offset: 2px;\n }\n ${p}[data-uvalib-region][tabindex='-1']:focus:not(:focus-visible) { outline: none; }\n @media (forced-colors: active) {\n ${p}[data-uvalib-region][data-uvalib-active] { border-inline-start-color: Highlight; }\n }\n`;\nconst entryStyles = unsafeCSS(entryRules(''));\n\n/**\n * An image with numbered region outlines (people, objects, inscriptions) and a list of the\n * same regions beside it (under it on a narrow screen). The list is the way in: the\n * outlines are a visual aid, hidden from assistive technology and not in the tab order, so\n * no region is a second tab stop. Hovering or focusing a list entry (or anything in it)\n * highlights its region with a thicker double outline and its label, and dims the others;\n * hovering a region highlights its entry. Clicking a region moves focus to its entry.\n *\n * The image: an `<img>` (or `<picture>`) child, which keeps its `alt`, or `src` and `alt`.\n * Give it `width` and `height` so its space is reserved before it loads.\n *\n * The regions: an `<ol>` child whose `<li>` items carry `data-xywh` (IIIF / Media Fragments:\n * `percent:10,20,30,40`, or pixels `160,120,320,240` of the image's natural size). The list\n * is shown as written, so it works before the component loads or without JavaScript, and\n * any links and buttons in it stay the page's own (their events are the page's). Or set\n * the `items` property, and the component draws the list. Region numbers are the list's\n * numbers, from 1 (or the `<ol>`'s `start`).\n *\n * @tagname uvalib-image-regions\n * @slot - The region list (`<ol>` with `<li data-xywh>`), shown as written. Not used with `items`.\n * @slot image - The image. A first `<img>` or `<picture>` child is put here by itself.\n * @csspart layout - The grid holding the image and the list.\n * @csspart media - The image and its overlay.\n * @csspart overlay - The outlines over the image (`aria-hidden`).\n * @csspart region - One outline.\n * @csspart list - The heading and the list.\n * @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.\n * @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.\n * @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.\n * @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.\n * @cssprop --uva-color-text - Dark-mode role token: text (else `--uva-grey-darkest`).\n * @cssprop --uva-color-surface-hover - Dark-mode role token: the highlighted entry's tint (else #f1f1f1).\n * @cssprop --uva-color-link - Dark-mode role token: entry links (else `--uva-brand-blue`).\n * @cssprop --uva-color-focus - Dark-mode role token: focus ring (else `--uva-brand-orange`).\n * @cssprop --uva-color-text-muted - Dark-mode role token: descriptions (else #4b5563).\n */\nexport class UvalibImageRegions extends UvalibElement {\n static styles = [\n accessible,\n shadowStructure,\n entryStyles,\n css`\n .list {\n color: var(--uva-color-text, var(--uva-grey-darkest, #2b2b2b));\n }\n .heading {\n font-size: 1.125rem;\n font-weight: 700;\n line-height: 1.3;\n }\n .items {\n padding-inline-start: 1.75rem;\n }\n .items a {\n color: var(--uva-color-link, var(--uva-brand-blue, #232d4b));\n }\n .description {\n display: block;\n color: var(--uva-color-text-muted, #4b5563);\n font-size: 0.9375rem;\n }\n @media (prefers-reduced-motion: no-preference) {\n .region {\n transition: opacity 0.15s ease;\n }\n }\n `,\n ];\n\n /** The regions, when the component draws the list. Overrides the child list. */\n @property({ attribute: false }) items: ImageRegion[] | null = null;\n\n /** Image URL, when there is no `<img>` child. */\n @property({ type: String }) src = '';\n /** The image's alternative text (with `src`). */\n @property({ type: String }) alt = '';\n /** The image's width (with `src`), reserving its space. */\n @property({ type: Number }) width?: number;\n /** The image's height (with `src`). */\n @property({ type: Number }) height?: number;\n\n /**\n * The size pixel regions are measured in, when it is not the image's natural size (for\n * example a IIIF derivative of a larger original: the original's width and height).\n */\n @property({ type: Number, attribute: 'image-width' }) imageWidth?: number;\n /** The height pixel regions are measured in (with `image-width`). */\n @property({ type: Number, attribute: 'image-height' }) imageHeight?: number;\n\n /** The list's heading, and the analytics name. */\n @property({ type: String }) label = 'Regions';\n\n /** The heading's level (2 to 6). Default: one below the heading before the element. */\n @property({ type: Number, attribute: 'heading-level' }) headingLevel?: number;\n\n /** `numbers` (default) shows each region's number on its outline; `none` hides them. */\n @property({ type: String }) numbering: 'numbers' | 'none' = 'numbers';\n\n /** Hide the outlines (the list stays). */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outlines' }) hideOutlines = false;\n\n @state() private entries: Entry[] = [];\n @state() private natural: { w: number; h: number } | null = null;\n @state() private active = -1;\n @state() private inferredLevel = 2;\n\n private hover = -1;\n private focused = -1;\n private readonly headingId = `uvalib-image-regions-heading-${++nextId}`;\n private observer?: MutationObserver;\n private watchedImg: HTMLImageElement | null = null;\n /** A list slotted through a `<slot>` child (from a host element's light DOM), also observed. */\n private slottedList: Element | null = null;\n private key = '';\n /** The image's rendered size decides where badges fit. */\n private resizer?: ResizeObserver;\n private resized = 0;\n\n constructor() {\n super();\n this.addEventListener('pointerover', this.onPointerOver);\n this.addEventListener('pointerleave', this.onPointerLeave);\n this.addEventListener('focusin', this.onFocusIn);\n this.addEventListener('focusout', this.onFocusOut);\n this.addEventListener('click', this.onClick);\n }\n\n protected override createRenderRoot(): HTMLElement | DocumentFragment {\n const root = super.createRenderRoot();\n if (this.noStyle && root instanceof ShadowRoot && shadowStructure.styleSheet)\n root.adoptedStyleSheets = [shadowStructure.styleSheet];\n return root;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n const node = this.getRootNode();\n const root = node instanceof Document || node instanceof ShadowRoot ? node : undefined;\n if (this.lightDom && this.noStyle) {\n installLightDomStyles(\n `${this.localName}::structure`,\n unsafeCSS(structuralRules(this.localName)),\n { root, scope: false },\n );\n } else if (!this.lightDom && !this.noStyle) {\n // The author's list items are page content: their highlight is styled in the page.\n installLightDomStyles(\n `${this.localName}::entries`,\n unsafeCSS(entryRules(`${this.localName} `)),\n { root, scope: false },\n );\n }\n const above = precedingHeadingLevel(this);\n this.inferredLevel = above === null ? 2 : Math.min(Math.max(above + 1, 2), 6);\n this.slottedList = null;\n this.sync();\n this.observe();\n }\n\n /** Watch the children, and a list slotted from outside them (it is not in this subtree). */\n private observe(): void {\n this.observer ??= new MutationObserver(() => this.sync());\n this.observer.disconnect();\n const options: MutationObserverInit = {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['data-xywh', 'data-label', 'data-id', 'href', 'start', 'src', 'srcset'],\n characterData: true,\n };\n this.observer.observe(this, options);\n if (this.slottedList) this.observer.observe(this.slottedList, options);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.observer?.disconnect();\n this.resizer?.disconnect();\n this.resizer = undefined;\n this.watchImage(null);\n }\n\n protected override willUpdate(changed: PropertyValues): void {\n if (changed.has('items') || changed.has('src')) this.sync();\n }\n\n protected override updated(changed: PropertyValues): void {\n super.updated(changed);\n this.arrange();\n this.observeSize();\n this.place();\n this.mark();\n // Reading the image's size may set state: not from inside this update.\n queueMicrotask(() => {\n if (this.isConnected) this.watchImage(this.imageEl());\n });\n }\n\n // ---------------------------------------------------------------- sources\n\n /** The author's image element (`<img>` or `<picture>`), wherever it is now. */\n private sourceImage(): HTMLElement | null {\n if (this.src) return null;\n const kids = this.lightDom\n ? [...this.children, ...(this.imgHost?.children ?? [])]\n : [...this.children];\n const named = kids.find((k) => k.getAttribute('slot') === 'image');\n const el = named ?? kids.find((k) => k.localName === 'img' || k.localName === 'picture');\n return el instanceof HTMLElement ? el : null;\n }\n\n /**\n * The author's list (`<ol>` or `<ul>`), wherever it is now. A `<slot>` child (this element\n * inside another component's shadow root) passes on that host's list, which stays in the\n * page's light DOM (so the page's styles and listeners still apply to it).\n */\n private sourceList(): HTMLOListElement | HTMLUListElement | null {\n const kids = (\n this.lightDom ? [...this.children, ...(this.listHost?.children ?? [])] : [...this.children]\n ).flatMap((k) => (k instanceof HTMLSlotElement ? k.assignedElements({ flatten: true }) : [k]));\n const el = kids.find((k) => k.localName === 'ol' || k.localName === 'ul');\n return (el as HTMLOListElement | HTMLUListElement | undefined) ?? null;\n }\n\n private get imgHost(): HTMLElement | null {\n return this.lightDom ? this.querySelector(':scope > .layout .img-host') : null;\n }\n\n private get listHost(): HTMLElement | null {\n return this.lightDom ? this.querySelector(':scope > .layout .list-host') : null;\n }\n\n /** The `<img>` whose natural size measures pixel regions. */\n private imageEl(): HTMLImageElement | null {\n if (this.src) return this.renderRoot.querySelector<HTMLImageElement>('.media > img');\n const el = this.sourceImage();\n if (!el) return null;\n return el instanceof HTMLImageElement ? el : el.querySelector('img');\n }\n\n /** Re-read the regions (and in shadow mode put the image in its slot). */\n private sync(): void {\n const img = this.sourceImage();\n if (img && !this.lightDom && !img.hasAttribute('slot')) img.setAttribute('slot', 'image');\n const next = this.items ? this.fromItems(this.items) : this.fromList();\n const key = JSON.stringify(next.map((e) => [e.item, e.box, e.number]));\n const sameEls =\n next.length === this.entries.length && next.every((e, i) => e.el === this.entries[i]?.el);\n if (key === this.key && sameEls) return;\n this.key = key;\n this.entries = next;\n if (this.active >= next.length) this.active = -1;\n }\n\n private fromItems(items: unknown[]): Entry[] {\n const out: Entry[] = [];\n for (const raw of Array.isArray(items) ? items : []) {\n const item = toRegion(raw);\n if (!item) continue;\n const { x, y, w, h, unit = 'px' } = item;\n out.push({ item, box: { x, y, w, h, unit }, number: out.length + 1, el: null });\n }\n return out;\n }\n\n private fromList(): Entry[] {\n const list = this.sourceList();\n const outside = list && !this.contains(list) ? list : null;\n if (outside !== this.slottedList) {\n this.slottedList = outside;\n if (this.isConnected) this.observe();\n if (outside && !this.noStyle) {\n // Its entries are styled where the list is (the page), not under this tag.\n const root = outside.getRootNode();\n if (root instanceof Document || root instanceof ShadowRoot)\n installLightDomStyles(`${this.localName}::slotted-entries`, entryStyles, {\n root,\n scope: false,\n });\n }\n }\n if (!list) return [];\n const start = list.localName === 'ol' ? Number(list.getAttribute('start') ?? 1) || 1 : 1;\n const out: Entry[] = [];\n [...list.children].forEach((li, i) => {\n if (li.localName !== 'li' || !(li instanceof HTMLElement)) return;\n const box = parseXywh(li.dataset.xywh);\n const link = li.querySelector('a[href]');\n const label = normalize(li.dataset.label) || normalize(link?.textContent) || this.text(li);\n const item: ImageRegion = box ? { label, ...box } : { label, x: 0, y: 0, w: 0, h: 0 };\n const id = normalize(li.dataset.id) || li.id;\n if (id) item.id = id;\n const href = link?.getAttribute('href');\n if (href) item.href = href;\n out.push({ item, box, number: start + i, el: li });\n });\n return out;\n }\n\n /** A list item's own text, without its actions (buttons, fields) or a nested list. */\n private text(li: Element): string {\n const parts: string[] = [];\n const walk = (n: Node) => {\n if (n.nodeType === Node.TEXT_NODE) parts.push(n.textContent ?? '');\n else if (n instanceof Element && !n.matches(NOT_LABEL)) n.childNodes.forEach(walk);\n };\n li.childNodes.forEach(walk);\n return normalize(parts.join(' '));\n }\n\n // ---------------------------------------------------------------- layout\n\n /** Light DOM: move the author's image and list into the layout (the same nodes). */\n private arrange(): void {\n if (!this.lightDom) return;\n const img = this.sourceImage();\n const imgHost = this.imgHost;\n if (img && imgHost && img.parentElement !== imgHost) imgHost.append(img);\n const list = this.items ? null : this.sourceList();\n const listHost = this.listHost;\n if (list && listHost && list.parentElement !== listHost) listHost.append(list);\n }\n\n private watchImage(img: HTMLImageElement | null): void {\n if (img === this.watchedImg) {\n if (img) this.measure();\n return;\n }\n this.watchedImg?.removeEventListener('load', this.onImageLoad);\n this.watchedImg = img;\n img?.addEventListener('load', this.onImageLoad);\n this.measure();\n }\n\n private readonly onImageLoad = (): void => this.measure();\n\n private measure(): void {\n const img = this.watchedImg;\n const w = img?.complete ? img.naturalWidth : 0;\n const h = img?.complete ? img.naturalHeight : 0;\n const next = w > 0 && h > 0 ? { w, h } : null;\n if (next?.w !== this.natural?.w || next?.h !== this.natural?.h) this.natural = next;\n }\n\n /** The size pixel regions are measured in. */\n private get space(): { w: number; h: number } {\n const w = Number(this.imageWidth);\n const h = Number(this.imageHeight);\n if (w > 0 && h > 0) return { w, h };\n return this.natural ?? { w: 0, h: 0 };\n }\n\n /**\n * Position the outlines in percent of the image, so they scale with it (CSSOM, not markup).\n * A number badge sits above its outline, or inside it when there is no room above.\n */\n private place(): void {\n const { w, h } = this.space;\n const overlay = this.renderRoot.querySelector<HTMLElement>('.overlay');\n const tall = overlay?.clientHeight ?? 0;\n for (const el of this.renderRoot.querySelectorAll<HTMLElement>('.overlay > .region')) {\n const entry = this.entries[Number(el.dataset.index)];\n const box = entry?.box ? toPercent(entry.box, w, h) : null;\n el.hidden = !box;\n if (!box) continue;\n el.style.left = `${box.x}%`;\n el.style.top = `${box.y}%`;\n el.style.width = `${box.w}%`;\n el.style.height = `${box.h}%`;\n el.toggleAttribute('data-inside', (box.y / 100) * tall < 28);\n }\n }\n\n private observeSize(): void {\n const media = this.renderRoot.querySelector<HTMLElement>('.media');\n if (!media || typeof ResizeObserver === 'undefined') return;\n if (!this.resizer) {\n this.resizer = new ResizeObserver(() => {\n // The outlines scale by themselves (percent); only the badges' side may change.\n const h = media.clientHeight;\n if (h === this.resized) return;\n this.resized = h;\n this.place();\n });\n this.resizer.observe(media);\n }\n }\n\n /** The list entry of region `i`. */\n private entryEl(i: number): HTMLElement | null {\n const entry = this.entries[i];\n if (!entry) return null;\n if (entry.el) return entry.el;\n return this.renderRoot.querySelector<HTMLElement>(`.items > li[data-index=\"${i}\"]`);\n }\n\n /** Mark the entries (their padding) and the highlighted one. */\n private mark(): void {\n const list = this.items ? null : this.sourceList();\n this.entries.forEach((e, i) => {\n const el = this.entryEl(i);\n // An author's item that has left the list (given back to the page) is not marked again.\n if (!el || (e.el && e.el.parentElement !== list)) return;\n if (el.getAttribute('data-uvalib-region') !== String(e.number))\n el.setAttribute('data-uvalib-region', String(e.number));\n el.toggleAttribute('data-uvalib-active', i === this.active);\n });\n }\n\n // ---------------------------------------------------------------- interaction\n\n /** The region an event is about: its outline or its list entry (or anything inside it). */\n private indexFrom(e: Event): { i: number; outline: boolean } | null {\n for (const n of e.composedPath()) {\n if (n === this) break;\n if (!(n instanceof HTMLElement)) continue;\n if (n.classList.contains('region') && n.parentElement?.classList.contains('overlay'))\n return { i: Number(n.dataset.index), outline: true };\n const at = this.entries.findIndex((en, i) => (en.el ?? this.entryEl(i)) === n);\n if (at >= 0) return { i: at, outline: false };\n }\n return null;\n }\n\n private setActive(): void {\n const next = this.hover >= 0 ? this.hover : this.focused;\n if (next === this.active) return;\n this.active = next;\n const item = this.entries[next]?.item ?? null;\n this.dispatchEvent(\n new CustomEvent('highlight', {\n detail: { item, index: item ? next : -1 },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private readonly onPointerOver = (e: PointerEvent): void => {\n this.hover = this.indexFrom(e)?.i ?? -1;\n this.setActive();\n };\n\n private readonly onPointerLeave = (): void => {\n this.hover = -1;\n this.setActive();\n };\n\n private readonly onFocusIn = (e: FocusEvent): void => {\n this.focused = this.indexFrom(e)?.i ?? -1;\n this.setActive();\n };\n\n private readonly onFocusOut = (e: FocusEvent): void => {\n const to = e.relatedTarget;\n if (\n to instanceof Node &&\n (this.contains(to) || this.renderRoot.contains(to) || this.slottedList?.contains(to))\n )\n return;\n this.focused = -1;\n this.setActive();\n };\n\n private readonly onClick = (e: MouseEvent): void => {\n const hit = this.indexFrom(e);\n if (!hit?.outline) return;\n this.choose(hit.i);\n };\n\n /**\n * An outline was clicked: say so first (`uvalib-image-regions-activate`, cancelable), then,\n * unless the page took it over, focus the entry; then `select`. `entry` is the page's own\n * `<li>` (its child list or a lightbox's lent list), never one this element drew from `items`.\n */\n private choose(i: number): void {\n const entry = this.entries[i];\n const el = this.entryEl(i);\n if (!entry || !el) return;\n const detail = { index: i, item: entry.item, entry: entry.el ?? null };\n const go = this.dispatchEvent(\n new CustomEvent('uvalib-image-regions-activate', {\n detail,\n bubbles: true,\n composed: true,\n cancelable: true,\n }),\n );\n if (go) {\n if (!el.hasAttribute('tabindex')) el.tabIndex = -1;\n el.focus();\n el.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n this.dispatchEvent(\n new CustomEvent('select', {\n detail: { item: entry.item, index: i, entry: detail.entry },\n bubbles: true,\n composed: true,\n }),\n );\n const name = normalize(this.label) || DEFAULT_LABEL;\n trackEvent(this, ['uvalib-image-regions', 'select', name, entry.number]);\n }\n\n // ---------------------------------------------------------------- render\n\n private get level(): number {\n const n = Math.trunc(Number(this.headingLevel));\n return n >= 2 && n <= 6 ? n : this.inferredLevel;\n }\n\n private renderOwnList() {\n const base = this.ownerDocument.baseURI;\n return html`<ol class=\"items\" aria-labelledby=${this.headingId}>\n ${this.entries.map(({ item }, i) => {\n const href = item.href && safeHref(item.href, base) ? item.href : '';\n return html`<li data-index=${i}>\n ${href ? html`<a href=${href}>${item.label}</a>` : html`<span>${item.label}</span>`}\n ${item.description ? html`<span class=\"description\">${item.description}</span>` : nothing}\n </li>`;\n })}\n </ol>`;\n }\n\n protected override render() {\n const light = this.lightDom;\n const numbers = this.numbering !== 'none';\n const image = this.src\n ? html`<img\n part=\"image\"\n src=${this.src}\n alt=${this.alt}\n width=${this.width ?? nothing}\n height=${this.height ?? nothing}\n @load=${this.onImageLoad}\n />`\n : light\n ? html`<div class=\"img-host\"></div>`\n : html`<slot name=\"image\" @slotchange=${() => this.requestUpdate()}></slot>`;\n const list = this.items\n ? this.renderOwnList()\n : light\n ? html`<div class=\"list-host\"></div>`\n : html`<slot @slotchange=${() => this.sync()}></slot>`;\n const hasActive = this.active >= 0 && !!this.entries[this.active]?.box;\n return html`<div class=\"layout\" part=\"layout\">\n <div class=\"media\" part=\"media\">\n ${image}\n <div\n class=\"overlay ${hasActive ? 'has-active' : ''}\"\n part=\"overlay\"\n aria-hidden=\"true\"\n ?hidden=${this.hideOutlines}\n >\n ${this.entries.map((e, i) =>\n e.box\n ? html`<div\n class=\"region ${i === this.active ? 'active' : ''}\"\n part=\"region\"\n data-index=${i}\n >\n <span class=\"badge ${numbers ? '' : 'no-number'}\"\n >${numbers ? html`<span class=\"number\">${e.number}</span>` : nothing}${\n e.item.label ? html`<span class=\"name\">${e.item.label}</span>` : nothing\n }</span\n >\n </div>`\n : nothing,\n )}\n </div>\n </div>\n <div class=\"list\" part=\"list\">\n <div class=\"heading\" role=\"heading\" aria-level=${this.level} id=${this.headingId}>\n ${normalize(this.label) || DEFAULT_LABEL}\n </div>\n ${list}\n </div>\n </div>`;\n }\n}\n","import { define } from '../../base/define.js';\nimport { UvalibImageRegions } from './UvalibImageRegions.js';\n\ndefine('uvalib-image-regions', UvalibImageRegions);\n"],"mappings":";;;;;;;AAqBA,IAAMsB,IAAgB,WAClBC,IAAS,GAGPC,IAAY,6EASZC,KAAmB,MAAiB;IACtCC,EAAK;IACLA,EAAK;;;;;;IAMLA,EAAK;;;;;;;;IAQLA,EAAK;IACLA,EAAK,eAAeA,EAAK,sBACzBA,MAAS,UAAU,yCAAyC,GAC7D;IACCA,EAAK;;;;;;;;IAQLA,EAAK;;;;;;;;IAQLA,EAAK;IACLA,EAAK;IACLA,EAAK;;;;;;;;;;;;;;;;IAgBLA,EAAK;;;;;IAKLA,EAAK;;;;IAILA,EAAK;IACLA,EAAK,sCAAsCA,EAAK;IAChDA,EAAK;IACLA,EAAK;IACLA,EAAK;;MAEHA,EAAK;MACLA,EAAK;MACLA,EAAK;MACLA,EAAK;;IAEPA,EAAK,YAAYA,EAAK;GAEpBC,IAAkB3B,EAAUyB,EAAgB,OAAO,CAAC,GAOpDG,KAAc,MAAc;IAC9BC,EAAE;;;;;;IAMFA,EAAE;;;;;IAKFA,EAAE;;;;IAIFA,EAAE;;MAEAA,EAAE;;GAGFC,IAAc9B,EAAU4B,EAAW,EAAE,CAAC,GAsC/BG,IAAb,cAAwClB,EAAc;;EACpC,KAAA,SAAA;GACdK;GACAS;GACAG;GACA,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;EA0BL;;CAmDA,cAAc;EAMZ,AALA,MAAM,GAjDsD,KAAA,QAAA,MAG5B,KAAA,MAAA,IAEA,KAAA,MAAA,IAeE,KAAA,QAAA,WAMwB,KAAA,YAAA,WAG2B,KAAA,eAAA,IAEnD,KAAA,UAAA,CAAC,GACuB,KAAA,UAAA,MAClC,KAAA,SAAA,IACO,KAAA,gBAAA,GAEjB,KAAA,QAAA,IACE,KAAA,UAAA,IACW,KAAA,YAAA,gCAAgC,EAAEP,KA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AS,SAAS;CAAM,WAAW;AAAgB,CAAC,CAAA,GAAA4B,EAAA,WAAA,gBAAA,KAAA,CAAA,GAErE7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,WAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,WAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,UAAA,KAAA,CAAA,GACN7B,EAAA,CAAAE,EAAM,CAAA,GAAA2B,EAAA,WAAA,iBAAA,KAAA,CAAA,GCjPTtB,EAAO,wBAAwBsB,CAAkB"}
|
package/package.json
CHANGED
|
@@ -720,7 +720,7 @@ Use these instead of a hand-built gallery or a carousel. There is no autoplay.
|
|
|
720
720
|
- `<uvalib-lightbox>` from `uvalib-lightbox.js`: progressive enhancement over plain links. Wrap them (`<a href="full.jpg" data-caption="Page 2"><img alt="Page 2" width="1600" height="2000"></a>`), or point at links elsewhere with `selector="a.pb-image"`. Without JavaScript, and on a modified click, the link opens the image as before. A primary click opens a native `<dialog>` (`showModal()`): the caption names it, Close takes focus, focus returns to the trigger, Escape and the backdrop close it. With more than one image, Previous and Next and the arrow keys move through the set (wrapping; Left is previous in left-to-right), with a polite "3 of 13". Full size opens the original image in a new tab and says so in its accessible name. It is offered for an http(s) URL or a PNG, JPEG, GIF or WebP `data:` image, never an SVG `data:` URL. A IIIF Image API URL keeps its region and only the size becomes `!W,H` for the viewport; TIFF and JPEG2000 URLs are left as written. Full size stays the original href.
|
|
721
721
|
- `url-param="photo"` keeps `?photo=<id>` in sync (the id is `data-id`, else `id`, else the IIIF identifier, else the position from 1): opening pushes a history entry, stepping replaces it, Back closes. On a hash route the parameter is written inside the hash. Opening from a URL that already has it is not an analytics event. With `spa="auto"`, that opening push may count as one Matomo page view.
|
|
722
722
|
- Details: a child with `slot="details"` (`data-for` selects one item by id or position from 1; without it the details show for every image), or `data-details-id` on a link naming an element elsewhere. It is put back when the viewer moves on or closes.
|
|
723
|
-
- `<uvalib-image-regions>` from `uvalib-image-regions.js`: numbered outlines on an image (people, objects, inscriptions) with a list of the same regions beside it. Write the page's own `<img width height alt>` and `<ol>` inside, each `<li data-xywh="percent:x,y,w,h">` (or pixels of the natural size, `160,120,320,240`; `image-width`/`image-height` for a IIIF derivative) holding the region's link and your own action buttons, which stay yours; or set `items` (`{ label, x, y, w, h, unit?, href?, description? }[]`). The list is the accessible route: the outlines are `aria-hidden`, not tab stops, and never the only place a name or action is; hovering or focusing an entry highlights its outline (thicker double outline and label) and back, and clicking an outline focuses its entry. `label` names the list. Listen for `
|
|
723
|
+
- `<uvalib-image-regions>` from `uvalib-image-regions.js`: numbered outlines on an image (people, objects, inscriptions) with a list of the same regions beside it. Write the page's own `<img width height alt>` and `<ol>` inside, each `<li data-xywh="percent:x,y,w,h">` (or pixels of the natural size, `160,120,320,240`; `image-width`/`image-height` for a IIIF derivative) holding the region's link and your own action buttons, which stay yours; or set `items` (`{ label, x, y, w, h, unit?, href?, description? }[]`). The list is the accessible route: the outlines are `aria-hidden`, not tab stops, and never the only place a name or action is; hovering or focusing an entry highlights its outline (thicker double outline and label) and back, and clicking an outline focuses its entry. `label` names the list. Listen for `uvalib-image-regions-activate` (an outline clicked, before its entry takes focus; `detail: { index, item, entry }`, `entry` the page's own `<li>`; cancelable, so the page can focus its own control in the entry, such as a "Who is this?" field) and `highlight`; never read the shadow DOM's outlines for it. Do not hand-build absolutely positioned outlines. It reports outline clicks itself (the list's label and the number, never a region's label).
|
|
724
724
|
- Regions in the viewer: `data-regions` on a lightbox link (a JSON array, or `percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the lightbox's `regions` callback (`({ element, id, href, index }) => regions`). The open image then shows the outlines, their list and a "Show regions" toggle; `regions-label` names the list. For your own buttons in each entry, `data-regions-list="<id>"` (or the `regionsList` callback) names a hidden `<ol>` of `<li data-xywh>` in the page: it is lent to the viewer (same nodes, your listeners and CSS keep working) and put back on close; give each action a unique name ("Confirm Tim Kaine").
|
|
725
725
|
- `<uvalib-photo-grid>` from `uvalib-photo-grid.js`: justified rows. Each direct `<a href>` or `<button>` is one photo and stays a real control. The row is about 220px, and 140px at 767px and below, unless `row-height` is set (a bare number is pixels). Give each image `width` and `height` so the row does not jump when it loads. An image with no visible text gets a caption from its alt, and a repeated alt is cleared (the original is kept for a lightbox). A different alt is kept. Do not set an `aria-label` that differs from the visible text; the grid will not add a caption beside one. Generated "Photo N" captions renumber when the photos change order. A `<span slot="badge">` inside the item, or `data-badge` on it (“seq”, “3 photos”), is drawn over the thumbnail and stays in the accessible name; an existing `aria-label` gains the badge text. A grid inside a lightbox opens the viewer. The grid reports no analytics.
|
|
726
726
|
|
|
@@ -1118,7 +1118,8 @@ An image with numbered region outlines (people, objects, inscriptions) and a lis
|
|
|
1118
1118
|
| Event | Description |
|
|
1119
1119
|
|---|---|
|
|
1120
1120
|
| `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. |
|
|
1121
|
-
| `
|
|
1121
|
+
| `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. |
|
|
1122
|
+
| `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. |
|
|
1122
1123
|
| `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. |
|
|
1123
1124
|
|
|
1124
1125
|
### CSS custom properties
|