@uvalib/web-components 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25140,6 +25140,10 @@
25140
25140
  {
25141
25141
  "description": "The image. A first `<img>` or `<picture>` child is put here by itself.",
25142
25142
  "name": "image"
25143
+ },
25144
+ {
25145
+ "description": "Controls for the image (a lightbox's version comparison), under the image and before the list in reading order. Not covered by the outlines.",
25146
+ "name": "controls"
25143
25147
  }
25144
25148
  ],
25145
25149
  "members": [
@@ -25414,6 +25418,15 @@
25414
25418
  "privacy": "private",
25415
25419
  "readonly": true
25416
25420
  },
25421
+ {
25422
+ "kind": "field",
25423
+ "name": "controlsHost",
25424
+ "type": {
25425
+ "text": "HTMLElement | null"
25426
+ },
25427
+ "privacy": "private",
25428
+ "readonly": true
25429
+ },
25417
25430
  {
25418
25431
  "kind": "method",
25419
25432
  "name": "imageEl",
@@ -25665,7 +25678,7 @@
25665
25678
  }
25666
25679
  }
25667
25680
  ],
25668
- "description": "An outline was clicked: focus its entry, and say so."
25681
+ "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
25682
  },
25670
25683
  {
25671
25684
  "kind": "field",
@@ -25819,12 +25832,19 @@
25819
25832
  },
25820
25833
  "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
25834
  },
25835
+ {
25836
+ "name": "uvalib-image-regions-activate",
25837
+ "type": {
25838
+ "text": "CustomEvent"
25839
+ },
25840
+ "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."
25841
+ },
25822
25842
  {
25823
25843
  "name": "select",
25824
25844
  "type": {
25825
25845
  "text": "CustomEvent"
25826
25846
  },
25827
- "description": "A region's outline was clicked (focus moved to its list entry): `detail` is `{ item, index }`. Bubbles and is composed."
25847
+ "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
25848
  },
25829
25849
  {
25830
25850
  "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.",
@@ -26109,7 +26129,7 @@
26109
26129
  "declarations": [
26110
26130
  {
26111
26131
  "kind": "class",
26112
- "description": "An accessible image viewer over a set of plain links. With JavaScript a primary click opens\na modal dialog; without it (or with a modified click) the link opens the image as before.\nWrap the links, or point at them with `selector` (for example `a.pb-image` on a reading\npage). There is no autoplay and no carousel.\n\nThe dialog is labelled by the caption (`data-caption`, else the image alt, else the link\ntext). Focus moves to Close on open and back to the trigger on close. Escape and a click on\nthe backdrop close it. With more than one image, Previous and Next and the arrow keys move\nthrough the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the\noriginal image in a new tab. A IIIF Image API URL keeps its region; only the size becomes\n`!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for\nexample `photo`) keeps `?photo=<id>` in sync, including on a hash route\n(`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and\nBack closes.\n\nOptional details: children with `slot=\"details\"` (and `data-for` equal to the item's id or\nits position from 1; without `data-for` they show for every image), or `data-details-id` on\na link pointing at an element elsewhere on the page. Either is shown inside the dialog and\nput back when the viewer moves on or closes.\n\nOptional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of\n`{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by\n`;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback.\nThe open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use)\nand a list of the regions beside it, with a \"Show regions\" toggle (`aria-pressed`) that\nhides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height`\nwhen set (the viewer shows a resized IIIF image), else in the image's natural size.\n\nOr the page's own list, with its own buttons: `data-regions-list=\"<id>\"` on a link (or the\n`regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page,\nusually `hidden`. While that image is open the list (the same nodes, so the page's listeners\nkeep working) is the region list: in shadow mode it becomes a child of the lightbox slotted\ninto the viewer, not moved into the shadow root, so the page's CSS still applies to it. When\nthe image changes or the viewer closes it goes back where it was, `hidden` as before. It wins\nover `data-regions`.",
26132
+ "description": "An accessible image viewer over a set of plain links. With JavaScript a primary click opens\na modal dialog; without it (or with a modified click) the link opens the image as before.\nWrap the links, or point at them with `selector` (for example `a.pb-image` on a reading\npage). There is no autoplay and no carousel.\n\nThe dialog is labelled by the caption (`data-caption`, else the image alt, else the link\ntext). Focus moves to Close on open and back to the trigger on close. Escape and a click on\nthe backdrop close it. With more than one image, Previous and Next and the arrow keys move\nthrough the set (wrapping), and a polite “3 of 13” counter is shown. Full size opens the\noriginal image in a new tab. A IIIF Image API URL keeps its region; only the size becomes\n`!W,H` for the viewport. TIFF and JPEG2000 URLs are left as written. `url-param` (for\nexample `photo`) keeps `?photo=<id>` in sync, including on a hash route\n(`#/text?photo=<id>`): opening pushes a history entry, stepping replaces it, and\nBack closes.\n\nOptional details: children with `slot=\"details\"` (and `data-for` equal to the item's id or\nits position from 1; without `data-for` they show for every image), or `data-details-id` on\na link pointing at an element elsewhere on the page. Either is shown inside the dialog and\nput back when the viewer moves on or closes.\n\nOptional regions (people, objects, inscriptions): `data-regions` on a link, a JSON array of\n`{ label, x, y, w, h, unit? }` or `xywh` values each followed by its label, separated by\n`;` (`percent:10,20,30,40 Person 1; percent:55,15,20,30 Sign`), or the `regions` callback.\nThe open image then shows numbered outlines (`<uvalib-image-regions>`, loaded on first use)\nand a list of the regions beside it, with a \"Show regions\" toggle (`aria-pressed`) that\nhides the outlines. Pixel regions are measured in `data-image-width` × `data-image-height`\nwhen set (the viewer shows a resized IIIF image), else in the image's natural size.\n\nOr the page's own list, with its own buttons: `data-regions-list=\"<id>\"` on a link (or the\n`regionsList` callback) names an `<ol>` or `<ul>` of `<li data-xywh>` anywhere in the page,\nusually `hidden`. While that image is open the list (the same nodes, so the page's listeners\nkeep working) is the region list: in shadow mode it becomes a child of the lightbox slotted\ninto the viewer, not moved into the shadow root, so the page's CSS still applies to it. When\nthe image changes or the viewer closes it goes back where it was, `hidden` as before. It wins\nover `data-regions`.\n\nOptional versions of an image (an original scan and an AI colorization, a restoration, an\ninfrared capture): `data-versions` on a link, a JSON array of `{ label, href?, note? }`\nwhose first entry is the link's own image, or the `versions` callback. The viewer then\ncompares them over the photo (loaded on first use): Switch (a segmented control), Reveal\n(a divider: click or tap the photo, or use the slider) or Fade (a slider), `compare`\nchoosing the first. A version's `note` shows under the photo while it is visible, and\nthe image's accessible name ends with the label of the version shown. `version-param`\n(with `url-param`) keeps the comparison in the address: `?version=2` (Switch, the version\nfrom 0), `?version=wipe:40` or `?version=fade:60` (the percentage of the other version\nshown; `wipe:40:2` compares the original with version 2).",
26113
26133
  "name": "UvalibLightbox",
26114
26134
  "cssProperties": [
26115
26135
  {
@@ -26197,6 +26217,10 @@
26197
26217
  {
26198
26218
  "description": "The `<uvalib-image-regions>` around an image with regions.",
26199
26219
  "name": "regions"
26220
+ },
26221
+ {
26222
+ "description": "The version comparison controls and notes under the photo.",
26223
+ "name": "compare"
26200
26224
  }
26201
26225
  ],
26202
26226
  "slots": [
@@ -26256,6 +26280,34 @@
26256
26280
  "description": "The heading of the regions list (for example `People`).",
26257
26281
  "attribute": "regions-label"
26258
26282
  },
26283
+ {
26284
+ "kind": "field",
26285
+ "name": "versions",
26286
+ "type": {
26287
+ "text": "LightboxVersions | undefined"
26288
+ },
26289
+ "description": "Versions of each image, instead of `data-versions`: called with\n`{ element, id, href, index }`, it returns `{ label, href?, note? }` objects, the first\nbeing the link's own image (null: none)."
26290
+ },
26291
+ {
26292
+ "kind": "field",
26293
+ "name": "compare",
26294
+ "type": {
26295
+ "text": "'switch' | 'wipe' | 'fade'"
26296
+ },
26297
+ "default": "'switch'",
26298
+ "description": "How an image's versions are compared first: `switch` (default: one at a time, any number\nof versions), `wipe` (a divider over the photo) or `fade` (a cross-fade). The viewer\noffers the others.",
26299
+ "attribute": "compare"
26300
+ },
26301
+ {
26302
+ "kind": "field",
26303
+ "name": "versionParam",
26304
+ "type": {
26305
+ "text": "string"
26306
+ },
26307
+ "default": "''",
26308
+ "description": "Query parameter for the comparison (with `url-param`), for example `version`:\n`?version=1`, `?version=wipe:40`, `?version=fade:60`. Written with replaceState once the\nvisitor's change settles; read when the viewer opens from the address.",
26309
+ "attribute": "version-param"
26310
+ },
26259
26311
  {
26260
26312
  "kind": "field",
26261
26313
  "name": "slides",
@@ -26594,6 +26646,25 @@
26594
26646
  "privacy": "private",
26595
26647
  "default": "false"
26596
26648
  },
26649
+ {
26650
+ "kind": "field",
26651
+ "name": "cmp",
26652
+ "type": {
26653
+ "text": "Compare | undefined"
26654
+ },
26655
+ "privacy": "private",
26656
+ "description": "The comparison controller, once its module has loaded."
26657
+ },
26658
+ {
26659
+ "kind": "field",
26660
+ "name": "pendingVersion",
26661
+ "type": {
26662
+ "text": "string | null"
26663
+ },
26664
+ "privacy": "private",
26665
+ "default": "null",
26666
+ "description": "The comparison from the address, for the image opened from it."
26667
+ },
26597
26668
  {
26598
26669
  "kind": "field",
26599
26670
  "name": "isLight",
@@ -26731,6 +26802,55 @@
26731
26802
  }
26732
26803
  ]
26733
26804
  },
26805
+ {
26806
+ "kind": "method",
26807
+ "name": "versionsOf",
26808
+ "privacy": "private",
26809
+ "parameters": [
26810
+ {
26811
+ "name": "el",
26812
+ "type": {
26813
+ "text": "HTMLAnchorElement"
26814
+ }
26815
+ },
26816
+ {
26817
+ "name": "id",
26818
+ "type": {
26819
+ "text": "string"
26820
+ }
26821
+ },
26822
+ {
26823
+ "name": "href",
26824
+ "type": {
26825
+ "text": "string"
26826
+ }
26827
+ },
26828
+ {
26829
+ "name": "index",
26830
+ "type": {
26831
+ "text": "number"
26832
+ }
26833
+ }
26834
+ ],
26835
+ "description": "`data-versions` (checked by the comparison module), else the `versions` callback's list."
26836
+ },
26837
+ {
26838
+ "kind": "method",
26839
+ "name": "loadCompare",
26840
+ "privacy": "private",
26841
+ "return": {
26842
+ "type": {
26843
+ "text": "void"
26844
+ }
26845
+ },
26846
+ "description": "Load the comparison module (once per page), then make this viewer's controller."
26847
+ },
26848
+ {
26849
+ "kind": "method",
26850
+ "name": "compareHost",
26851
+ "privacy": "private",
26852
+ "description": "What the comparison module may use of this viewer."
26853
+ },
26734
26854
  {
26735
26855
  "kind": "method",
26736
26856
  "name": "regionsOf",
@@ -26847,6 +26967,24 @@
26847
26967
  "description": "The URL the `<img>` should load: a viewport-sized IIIF request, or the href itself.",
26848
26968
  "readonly": true
26849
26969
  },
26970
+ {
26971
+ "kind": "method",
26972
+ "name": "sized",
26973
+ "privacy": "private",
26974
+ "return": {
26975
+ "type": {
26976
+ "text": "string"
26977
+ }
26978
+ },
26979
+ "parameters": [
26980
+ {
26981
+ "name": "href",
26982
+ "type": {
26983
+ "text": "string"
26984
+ }
26985
+ }
26986
+ ]
26987
+ },
26850
26988
  {
26851
26989
  "kind": "method",
26852
26990
  "name": "measure",
@@ -26923,6 +27061,16 @@
26923
27061
  },
26924
27062
  "description": "Restore a viewer the URL already points at. No analytics: it is not a new action."
26925
27063
  },
27064
+ {
27065
+ "kind": "method",
27066
+ "name": "versionFromUrl",
27067
+ "privacy": "private",
27068
+ "return": {
27069
+ "type": {
27070
+ "text": "string | null"
27071
+ }
27072
+ }
27073
+ },
26926
27074
  {
26927
27075
  "kind": "method",
26928
27076
  "name": "step",
@@ -26988,9 +27136,16 @@
26988
27136
  "type": {
26989
27137
  "text": "boolean"
26990
27138
  }
27139
+ },
27140
+ {
27141
+ "name": "version",
27142
+ "default": "null",
27143
+ "type": {
27144
+ "text": "string | null"
27145
+ }
26991
27146
  }
26992
27147
  ],
26993
- "description": "Returns false when this document cannot change the address (for example an iframe srcdoc)."
27148
+ "description": "Returns false when this document cannot change the address (for example an iframe\nsrcdoc). `version` is the comparison (`version-param`), dropped with the image."
26994
27149
  },
26995
27150
  {
26996
27151
  "kind": "field",
@@ -27039,6 +27194,12 @@
27039
27194
  "privacy": "private",
27040
27195
  "readonly": true
27041
27196
  },
27197
+ {
27198
+ "kind": "field",
27199
+ "name": "onStack",
27200
+ "privacy": "private",
27201
+ "readonly": true
27202
+ },
27042
27203
  {
27043
27204
  "kind": "method",
27044
27205
  "name": "bindDialogObserver",
@@ -27336,7 +27497,7 @@
27336
27497
  }
27337
27498
  }
27338
27499
  ],
27339
- "description": "The image, inside `<uvalib-image-regions>` when it has regions (or the page's list)."
27500
+ "description": "The image, inside `<uvalib-image-regions>` when it has regions (or the page's list). An\nimage with versions sits in a `.stack` (the same element before and after the comparison\nloads, so the image is not loaded again), with the comparison's layers over it and its\ncontrols under it."
27340
27501
  },
27341
27502
  {
27342
27503
  "kind": "field",
@@ -27470,7 +27631,11 @@
27470
27631
  ],
27471
27632
  "events": [
27472
27633
  {
27473
- "description": "For `<site-analytics>`: `['uvalib-lightbox', 'open'|'next'|'previous'|'full-size', 'image N', N]` (N from 1, the image's place in the set). Never the URL or the caption. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed.",
27634
+ "description": "The visitor changed the comparison (mode, version or position; once a slider settles): `detail` is `{ id, mode, index, value }` (`mode` `switch`, `wipe` or `fade`; `index` the version shown or compared, from 0; `value` the percentage of it shown, null for Switch). Not fired on open or for a comparison restored from the URL. Bubbles and is composed.",
27635
+ "name": "uvalib-lightbox-version"
27636
+ },
27637
+ {
27638
+ "description": "For `<site-analytics>`: `['uvalib-lightbox', 'open'|'next'|'previous'|'full-size', 'image N', N]` (N from 1, the image's place in the set), and `['uvalib-lightbox', 'compare', 'switch'|'wipe'|'fade', N]` when the visitor changes a comparison (N the version's place from 1; once a slider settles). Never the URL, the caption or a version's label. Not fired for a viewer restored from the URL or from Back and Forward. Bubbles and is composed.",
27474
27639
  "name": "uvalib-analytics-event"
27475
27640
  }
27476
27641
  ],
@@ -27502,6 +27667,24 @@
27502
27667
  "description": "The heading of the regions list (for example `People`).",
27503
27668
  "fieldName": "regionsLabel"
27504
27669
  },
27670
+ {
27671
+ "name": "compare",
27672
+ "type": {
27673
+ "text": "'switch' | 'wipe' | 'fade'"
27674
+ },
27675
+ "default": "'switch'",
27676
+ "description": "How an image's versions are compared first: `switch` (default: one at a time, any number\nof versions), `wipe` (a divider over the photo) or `fade` (a cross-fade). The viewer\noffers the others.",
27677
+ "fieldName": "compare"
27678
+ },
27679
+ {
27680
+ "name": "version-param",
27681
+ "type": {
27682
+ "text": "string"
27683
+ },
27684
+ "default": "''",
27685
+ "description": "Query parameter for the comparison (with `url-param`), for example `version`:\n`?version=1`, `?version=wipe:40`, `?version=fade:60`. Written with replaceState once the\nvisitor's change settles; read when the viewer opens from the address.",
27686
+ "fieldName": "versionParam"
27687
+ },
27505
27688
  {
27506
27689
  "name": "no-shadow-dom",
27507
27690
  "type": {
@@ -27546,6 +27729,677 @@
27546
27729
  }
27547
27730
  ]
27548
27731
  },
27732
+ {
27733
+ "kind": "javascript-module",
27734
+ "path": "src/components/uvalib-lightbox/compare.ts",
27735
+ "declarations": [
27736
+ {
27737
+ "kind": "variable",
27738
+ "name": "compareTiming",
27739
+ "type": {
27740
+ "text": "object"
27741
+ },
27742
+ "default": "{ settle: 400 }",
27743
+ "description": "How long (ms) after the last slider or drag change it counts as settled. Tests shorten it."
27744
+ },
27745
+ {
27746
+ "kind": "class",
27747
+ "description": "The comparison for one lightbox. State: the mode, the version shown (Switch) or compared\nwith the original (Reveal, Fade), and the percentage of it shown. Another version's image\nis requested the first time it is needed, and drawn (and announced) once it has loaded.",
27748
+ "name": "Compare",
27749
+ "members": [
27750
+ {
27751
+ "kind": "field",
27752
+ "name": "list",
27753
+ "type": {
27754
+ "text": "Version[]"
27755
+ },
27756
+ "privacy": "private",
27757
+ "default": "[]"
27758
+ },
27759
+ {
27760
+ "kind": "field",
27761
+ "name": "slideKey",
27762
+ "type": {
27763
+ "text": "string"
27764
+ },
27765
+ "privacy": "private",
27766
+ "default": "''"
27767
+ },
27768
+ {
27769
+ "kind": "field",
27770
+ "name": "id",
27771
+ "type": {
27772
+ "text": "string"
27773
+ },
27774
+ "privacy": "private",
27775
+ "default": "''"
27776
+ },
27777
+ {
27778
+ "kind": "field",
27779
+ "name": "warned",
27780
+ "type": {
27781
+ "text": "boolean"
27782
+ },
27783
+ "privacy": "private",
27784
+ "default": "false"
27785
+ },
27786
+ {
27787
+ "kind": "field",
27788
+ "name": "chosen",
27789
+ "type": {
27790
+ "text": "CompareMode | null"
27791
+ },
27792
+ "privacy": "private",
27793
+ "default": "null",
27794
+ "description": "The mode the visitor (or the address) chose; else the lightbox's `compare`."
27795
+ },
27796
+ {
27797
+ "kind": "field",
27798
+ "name": "mode",
27799
+ "type": {
27800
+ "text": "CompareMode"
27801
+ },
27802
+ "default": "'switch'"
27803
+ },
27804
+ {
27805
+ "kind": "field",
27806
+ "name": "other",
27807
+ "type": {
27808
+ "text": "number"
27809
+ },
27810
+ "privacy": "private",
27811
+ "default": "1",
27812
+ "description": "The version compared with the original (Reveal, Fade), from 1."
27813
+ },
27814
+ {
27815
+ "kind": "field",
27816
+ "name": "value",
27817
+ "type": {
27818
+ "text": "number"
27819
+ },
27820
+ "privacy": "private",
27821
+ "default": "50",
27822
+ "description": "The percentage of `other` shown (Reveal, Fade)."
27823
+ },
27824
+ {
27825
+ "kind": "field",
27826
+ "name": "shown",
27827
+ "type": {
27828
+ "text": "number"
27829
+ },
27830
+ "privacy": "private",
27831
+ "default": "0",
27832
+ "description": "The version shown (Switch), from 0."
27833
+ },
27834
+ {
27835
+ "kind": "field",
27836
+ "name": "holding",
27837
+ "type": {
27838
+ "text": "boolean"
27839
+ },
27840
+ "privacy": "private",
27841
+ "default": "false"
27842
+ },
27843
+ {
27844
+ "kind": "field",
27845
+ "name": "requested",
27846
+ "privacy": "private",
27847
+ "default": "new Set<number>()"
27848
+ },
27849
+ {
27850
+ "kind": "field",
27851
+ "name": "ready",
27852
+ "privacy": "private",
27853
+ "default": "new Set<number>()"
27854
+ },
27855
+ {
27856
+ "kind": "field",
27857
+ "name": "failed",
27858
+ "privacy": "private",
27859
+ "default": "new Set<number>()"
27860
+ },
27861
+ {
27862
+ "kind": "field",
27863
+ "name": "message",
27864
+ "type": {
27865
+ "text": "string"
27866
+ },
27867
+ "privacy": "private",
27868
+ "default": "''"
27869
+ },
27870
+ {
27871
+ "kind": "field",
27872
+ "name": "flip",
27873
+ "type": {
27874
+ "text": "boolean"
27875
+ },
27876
+ "privacy": "private",
27877
+ "default": "false"
27878
+ },
27879
+ {
27880
+ "kind": "field",
27881
+ "name": "pendingAnnounce",
27882
+ "type": {
27883
+ "text": "boolean"
27884
+ },
27885
+ "privacy": "private",
27886
+ "default": "false"
27887
+ },
27888
+ {
27889
+ "kind": "field",
27890
+ "name": "announceNext",
27891
+ "type": {
27892
+ "text": "boolean"
27893
+ },
27894
+ "privacy": "private",
27895
+ "default": "false"
27896
+ },
27897
+ {
27898
+ "kind": "field",
27899
+ "name": "settleTimer",
27900
+ "type": {
27901
+ "text": "number"
27902
+ },
27903
+ "privacy": "private",
27904
+ "default": "0"
27905
+ },
27906
+ {
27907
+ "kind": "field",
27908
+ "name": "settled",
27909
+ "type": {
27910
+ "text": "string"
27911
+ },
27912
+ "privacy": "private",
27913
+ "default": "''"
27914
+ },
27915
+ {
27916
+ "kind": "field",
27917
+ "name": "dragging",
27918
+ "type": {
27919
+ "text": "boolean"
27920
+ },
27921
+ "privacy": "private",
27922
+ "default": "false"
27923
+ },
27924
+ {
27925
+ "kind": "field",
27926
+ "name": "dragEnd",
27927
+ "type": {
27928
+ "text": "number"
27929
+ },
27930
+ "privacy": "private",
27931
+ "default": "0"
27932
+ },
27933
+ {
27934
+ "kind": "field",
27935
+ "name": "uid",
27936
+ "privacy": "private",
27937
+ "readonly": true,
27938
+ "default": "`uvalib-compare-${++nextId}`"
27939
+ },
27940
+ {
27941
+ "kind": "field",
27942
+ "name": "active",
27943
+ "type": {
27944
+ "text": "boolean"
27945
+ },
27946
+ "description": "At least two usable versions.",
27947
+ "readonly": true
27948
+ },
27949
+ {
27950
+ "kind": "method",
27951
+ "name": "sync",
27952
+ "return": {
27953
+ "type": {
27954
+ "text": "void"
27955
+ }
27956
+ },
27957
+ "parameters": [
27958
+ {
27959
+ "name": "slide",
27960
+ "type": {
27961
+ "text": "CompareSlide"
27962
+ }
27963
+ },
27964
+ {
27965
+ "name": "index",
27966
+ "type": {
27967
+ "text": "number"
27968
+ }
27969
+ },
27970
+ {
27971
+ "name": "restore",
27972
+ "type": {
27973
+ "text": "string | null"
27974
+ }
27975
+ }
27976
+ ],
27977
+ "description": "Follow the open image: a new one starts again (in the current mode); `restore` is the address's value."
27978
+ },
27979
+ {
27980
+ "kind": "method",
27981
+ "name": "reset",
27982
+ "return": {
27983
+ "type": {
27984
+ "text": "void"
27985
+ }
27986
+ },
27987
+ "description": "Forget the open image (the viewer closed): report a change still settling first."
27988
+ },
27989
+ {
27990
+ "kind": "method",
27991
+ "name": "parse",
27992
+ "privacy": "private",
27993
+ "return": {
27994
+ "type": {
27995
+ "text": "Version[]"
27996
+ }
27997
+ },
27998
+ "parameters": [
27999
+ {
28000
+ "name": "slide",
28001
+ "type": {
28002
+ "text": "CompareSlide"
28003
+ }
28004
+ }
28005
+ ]
28006
+ },
28007
+ {
28008
+ "kind": "method",
28009
+ "name": "restore",
28010
+ "privacy": "private",
28011
+ "return": {
28012
+ "type": {
28013
+ "text": "void"
28014
+ }
28015
+ },
28016
+ "parameters": [
28017
+ {
28018
+ "name": "param",
28019
+ "type": {
28020
+ "text": "string"
28021
+ }
28022
+ }
28023
+ ],
28024
+ "description": "`2`, `switch:2`, `wipe:40`, `fade:60`, `wipe:40:2` (the version compared, from 1)."
28025
+ },
28026
+ {
28027
+ "kind": "method",
28028
+ "name": "encode",
28029
+ "privacy": "private",
28030
+ "return": {
28031
+ "type": {
28032
+ "text": "string"
28033
+ }
28034
+ }
28035
+ },
28036
+ {
28037
+ "kind": "field",
28038
+ "name": "top",
28039
+ "type": {
28040
+ "text": "number"
28041
+ },
28042
+ "privacy": "private",
28043
+ "description": "The version over the original: shown (Switch) or compared (Reveal, Fade).",
28044
+ "readonly": true
28045
+ },
28046
+ {
28047
+ "kind": "field",
28048
+ "name": "amount",
28049
+ "type": {
28050
+ "text": "number"
28051
+ },
28052
+ "privacy": "private",
28053
+ "description": "The percentage of the top version asked for.",
28054
+ "readonly": true
28055
+ },
28056
+ {
28057
+ "kind": "field",
28058
+ "name": "seen",
28059
+ "type": {
28060
+ "text": "number"
28061
+ },
28062
+ "privacy": "private",
28063
+ "description": "The percentage of it on screen: none until its image has loaded.",
28064
+ "readonly": true
28065
+ },
28066
+ {
28067
+ "kind": "method",
28068
+ "name": "label",
28069
+ "privacy": "private",
28070
+ "return": {
28071
+ "type": {
28072
+ "text": "string"
28073
+ }
28074
+ },
28075
+ "parameters": [
28076
+ {
28077
+ "name": "i",
28078
+ "type": {
28079
+ "text": "number"
28080
+ }
28081
+ }
28082
+ ]
28083
+ },
28084
+ {
28085
+ "kind": "method",
28086
+ "name": "need",
28087
+ "privacy": "private",
28088
+ "return": {
28089
+ "type": {
28090
+ "text": "void"
28091
+ }
28092
+ },
28093
+ "description": "Request the top version's image the first time it is needed."
28094
+ },
28095
+ {
28096
+ "kind": "method",
28097
+ "name": "set",
28098
+ "privacy": "private",
28099
+ "return": {
28100
+ "type": {
28101
+ "text": "void"
28102
+ }
28103
+ },
28104
+ "parameters": [
28105
+ {
28106
+ "name": "v",
28107
+ "type": {
28108
+ "text": "number"
28109
+ }
28110
+ },
28111
+ {
28112
+ "name": "announce",
28113
+ "type": {
28114
+ "text": "boolean"
28115
+ }
28116
+ }
28117
+ ]
28118
+ },
28119
+ {
28120
+ "kind": "method",
28121
+ "name": "change",
28122
+ "privacy": "private",
28123
+ "return": {
28124
+ "type": {
28125
+ "text": "void"
28126
+ }
28127
+ },
28128
+ "parameters": [
28129
+ {
28130
+ "name": "fn",
28131
+ "type": {
28132
+ "text": "() => void"
28133
+ }
28134
+ }
28135
+ ]
28136
+ },
28137
+ {
28138
+ "kind": "method",
28139
+ "name": "settle",
28140
+ "privacy": "private",
28141
+ "return": {
28142
+ "type": {
28143
+ "text": "void"
28144
+ }
28145
+ },
28146
+ "parameters": [
28147
+ {
28148
+ "name": "write",
28149
+ "default": "true"
28150
+ }
28151
+ ],
28152
+ "description": "A visitor's change has settled: the event, analytics, the address and the announcement."
28153
+ },
28154
+ {
28155
+ "kind": "method",
28156
+ "name": "say",
28157
+ "privacy": "private",
28158
+ "return": {
28159
+ "type": {
28160
+ "text": "void"
28161
+ }
28162
+ },
28163
+ "parameters": [
28164
+ {
28165
+ "name": "text",
28166
+ "type": {
28167
+ "text": "string"
28168
+ }
28169
+ }
28170
+ ]
28171
+ },
28172
+ {
28173
+ "kind": "method",
28174
+ "name": "stateText",
28175
+ "privacy": "private",
28176
+ "return": {
28177
+ "type": {
28178
+ "text": "string"
28179
+ }
28180
+ }
28181
+ },
28182
+ {
28183
+ "kind": "method",
28184
+ "name": "setMode",
28185
+ "privacy": "private",
28186
+ "return": {
28187
+ "type": {
28188
+ "text": "void"
28189
+ }
28190
+ },
28191
+ "parameters": [
28192
+ {
28193
+ "name": "mode",
28194
+ "type": {
28195
+ "text": "CompareMode"
28196
+ }
28197
+ }
28198
+ ]
28199
+ },
28200
+ {
28201
+ "kind": "method",
28202
+ "name": "hold",
28203
+ "privacy": "private",
28204
+ "return": {
28205
+ "type": {
28206
+ "text": "void"
28207
+ }
28208
+ },
28209
+ "parameters": [
28210
+ {
28211
+ "name": "on",
28212
+ "type": {
28213
+ "text": "boolean"
28214
+ }
28215
+ }
28216
+ ]
28217
+ },
28218
+ {
28219
+ "kind": "method",
28220
+ "name": "loaded",
28221
+ "privacy": "private",
28222
+ "return": {
28223
+ "type": {
28224
+ "text": "void"
28225
+ }
28226
+ },
28227
+ "parameters": [
28228
+ {
28229
+ "name": "i",
28230
+ "type": {
28231
+ "text": "number"
28232
+ }
28233
+ }
28234
+ ]
28235
+ },
28236
+ {
28237
+ "kind": "method",
28238
+ "name": "errored",
28239
+ "privacy": "private",
28240
+ "return": {
28241
+ "type": {
28242
+ "text": "void"
28243
+ }
28244
+ },
28245
+ "parameters": [
28246
+ {
28247
+ "name": "i",
28248
+ "type": {
28249
+ "text": "number"
28250
+ }
28251
+ }
28252
+ ]
28253
+ },
28254
+ {
28255
+ "kind": "method",
28256
+ "name": "key",
28257
+ "return": {
28258
+ "type": {
28259
+ "text": "boolean"
28260
+ }
28261
+ },
28262
+ "parameters": [
28263
+ {
28264
+ "name": "e",
28265
+ "type": {
28266
+ "text": "KeyboardEvent"
28267
+ }
28268
+ }
28269
+ ],
28270
+ "description": "The `o` key held anywhere in the dialog shows the original. True when handled."
28271
+ },
28272
+ {
28273
+ "kind": "method",
28274
+ "name": "pointer",
28275
+ "return": {
28276
+ "type": {
28277
+ "text": "void"
28278
+ }
28279
+ },
28280
+ "parameters": [
28281
+ {
28282
+ "name": "e",
28283
+ "type": {
28284
+ "text": "PointerEvent"
28285
+ }
28286
+ }
28287
+ ],
28288
+ "description": "A press on the photo in Reveal moves the divider there; a drag keeps moving it."
28289
+ },
28290
+ {
28291
+ "kind": "method",
28292
+ "name": "dragged",
28293
+ "return": {
28294
+ "type": {
28295
+ "text": "boolean"
28296
+ }
28297
+ },
28298
+ "description": "A drag that ended outside the photo must not count as a click on the backdrop."
28299
+ },
28300
+ {
28301
+ "kind": "field",
28302
+ "name": "onInput",
28303
+ "privacy": "private",
28304
+ "readonly": true
28305
+ },
28306
+ {
28307
+ "kind": "field",
28308
+ "name": "onSliderKey",
28309
+ "privacy": "private",
28310
+ "readonly": true,
28311
+ "description": "Shift with an arrow, and Page Up / Page Down, move 10%."
28312
+ },
28313
+ {
28314
+ "kind": "field",
28315
+ "name": "onHold",
28316
+ "privacy": "private",
28317
+ "readonly": true
28318
+ },
28319
+ {
28320
+ "kind": "method",
28321
+ "name": "alt",
28322
+ "return": {
28323
+ "type": {
28324
+ "text": "string"
28325
+ }
28326
+ },
28327
+ "parameters": [
28328
+ {
28329
+ "name": "base",
28330
+ "type": {
28331
+ "text": "string"
28332
+ }
28333
+ }
28334
+ ],
28335
+ "description": "The image's accessible name ends with what is on screen."
28336
+ },
28337
+ {
28338
+ "kind": "field",
28339
+ "name": "stackClass",
28340
+ "type": {
28341
+ "text": "string"
28342
+ },
28343
+ "readonly": true
28344
+ },
28345
+ {
28346
+ "kind": "field",
28347
+ "name": "stackStyle",
28348
+ "type": {
28349
+ "text": "string"
28350
+ },
28351
+ "readonly": true
28352
+ },
28353
+ {
28354
+ "kind": "method",
28355
+ "name": "layers",
28356
+ "description": "The other versions' images (each requested on first use), the divider and the side labels."
28357
+ },
28358
+ {
28359
+ "kind": "method",
28360
+ "name": "controls",
28361
+ "parameters": [
28362
+ {
28363
+ "name": "slot",
28364
+ "type": {
28365
+ "text": "string"
28366
+ }
28367
+ }
28368
+ ],
28369
+ "description": "Notes of the versions on screen, then the controls. `slot` puts them under regions' image."
28370
+ },
28371
+ {
28372
+ "kind": "method",
28373
+ "name": "full",
28374
+ "return": {
28375
+ "type": {
28376
+ "text": "{ href: string; label: string }[]"
28377
+ }
28378
+ },
28379
+ "description": "Full size, in every mode: the original and the version shown (Switch) or compared (Reveal,\nFade), each named. The same two links in every mode keep the toolbar's height, so changing\nmode never moves the photo; and a visitor can always open the original at full size."
28380
+ }
28381
+ ]
28382
+ }
28383
+ ],
28384
+ "exports": [
28385
+ {
28386
+ "kind": "js",
28387
+ "name": "compareTiming",
28388
+ "declaration": {
28389
+ "name": "compareTiming",
28390
+ "module": "src/components/uvalib-lightbox/compare.ts"
28391
+ }
28392
+ },
28393
+ {
28394
+ "kind": "js",
28395
+ "name": "Compare",
28396
+ "declaration": {
28397
+ "name": "Compare",
28398
+ "module": "src/components/uvalib-lightbox/compare.ts"
28399
+ }
28400
+ }
28401
+ ]
28402
+ },
27549
28403
  {
27550
28404
  "kind": "javascript-module",
27551
28405
  "path": "src/components/uvalib-lightbox/media.ts",