@nulib/clover 0.0.0-stage → 4.0.0-beta.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.
Files changed (410) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +120 -2
  3. package/dist/components/Annotations/Annotations.mjs +674 -0
  4. package/dist/components/Annotations/EntryBodies.mjs +52 -0
  5. package/dist/components/Annotations/languages.mjs +43 -0
  6. package/dist/components/Body/Body.mjs +51 -0
  7. package/dist/components/Body/BodyAlert.mjs +25 -0
  8. package/dist/components/Body/Caption.mjs +90 -0
  9. package/dist/components/Body/CaptionDetails.mjs +50 -0
  10. package/dist/components/Body/Pending.mjs +9 -0
  11. package/dist/components/Body/glyphs.mjs +66 -0
  12. package/dist/components/Body/renderers.mjs +30 -0
  13. package/dist/components/Body/useControlsVisibility.mjs +204 -0
  14. package/dist/components/Body/useNearViewport.mjs +27 -0
  15. package/dist/components/Canvas/AnnotationMenu.mjs +128 -0
  16. package/dist/components/Canvas/AnnotationState.mjs +338 -0
  17. package/dist/components/Canvas/Annotations.mjs +497 -0
  18. package/dist/components/Canvas/CanvasView.mjs +669 -0
  19. package/dist/components/Canvas/ChoiceMenu.mjs +77 -0
  20. package/dist/components/Canvas/Connected.mjs +228 -0
  21. package/dist/components/Canvas/ControlMenu.mjs +67 -0
  22. package/dist/components/Canvas/Controls.mjs +233 -0
  23. package/dist/components/Canvas/FrameAnimation.mjs +344 -0
  24. package/dist/components/Canvas/LoadedCanvas.mjs +177 -0
  25. package/dist/components/Canvas/Placeholder.mjs +105 -0
  26. package/dist/components/Canvas/fromManifest.mjs +44 -0
  27. package/dist/components/Canvas/index.mjs +19 -0
  28. package/dist/components/Canvas/layout.mjs +369 -0
  29. package/dist/components/Canvas/media/MediaBody.mjs +285 -0
  30. package/dist/components/Canvas/media/Player.mjs +193 -0
  31. package/dist/components/Canvas/media/Transport.mjs +511 -0
  32. package/dist/components/Canvas/media/TransportButton.mjs +39 -0
  33. package/dist/components/Canvas/media/useBarHeight.mjs +28 -0
  34. package/dist/components/Canvas/media/useCaptionTracks.mjs +131 -0
  35. package/dist/components/Canvas/media/useMediaController.mjs +77 -0
  36. package/dist/components/Canvas/media/useMediaElement.mjs +100 -0
  37. package/dist/components/Canvas/panClearOfControls.mjs +92 -0
  38. package/dist/components/Canvas/rendererSurface.mjs +6 -0
  39. package/dist/components/Canvas/surface.mjs +5 -0
  40. package/dist/components/Canvas/track.mjs +43 -0
  41. package/dist/components/Canvas/useSvgReader.mjs +23 -0
  42. package/dist/components/Collection/Collection.mjs +76 -0
  43. package/dist/components/CollectionSelect/CollectionSelect.mjs +114 -0
  44. package/dist/components/Contents/Contents.mjs +120 -0
  45. package/dist/components/Download/Download.mjs +105 -0
  46. package/dist/components/Items/Item.mjs +184 -0
  47. package/dist/components/Items/Items.mjs +455 -0
  48. package/dist/components/Items/Pager.mjs +190 -0
  49. package/dist/components/Items/StandaloneItems.mjs +80 -0
  50. package/dist/components/Items/clamped.mjs +90 -0
  51. package/dist/components/Label/Label.mjs +39 -0
  52. package/dist/components/Map/LoadedMap.mjs +26 -0
  53. package/dist/components/Map/Map.mjs +38 -0
  54. package/dist/components/Map/MapView.mjs +538 -0
  55. package/dist/components/Map/basemap.mjs +50 -0
  56. package/dist/components/Map/overlayImage.mjs +17 -0
  57. package/dist/components/Panel/About.mjs +143 -0
  58. package/dist/components/Panel/Panel.mjs +259 -0
  59. package/dist/components/Panel/PanelToggle.mjs +43 -0
  60. package/dist/components/Panel/PartOfManifest.mjs +52 -0
  61. package/dist/components/Primitives/Primitives.mjs +263 -0
  62. package/dist/components/Primitives/resource.mjs +11 -0
  63. package/dist/components/Provider/Provider.mjs +174 -0
  64. package/dist/components/Root/Announcer.mjs +58 -0
  65. package/dist/components/Root/Root.mjs +29 -0
  66. package/dist/components/Root/useRootState.mjs +188 -0
  67. package/dist/components/Scene/Connected.mjs +48 -0
  68. package/dist/components/Scene/Loaded.mjs +56 -0
  69. package/dist/components/Scene/RotatePad.mjs +204 -0
  70. package/dist/components/Scene/Scene.mjs +20 -0
  71. package/dist/components/Scene/SceneView.mjs +539 -0
  72. package/dist/components/Scene/cloverEngine.mjs +105 -0
  73. package/dist/components/Scene/engine.mjs +141 -0
  74. package/dist/components/Scene/engines.mjs +23 -0
  75. package/dist/components/Scene/gestures.mjs +74 -0
  76. package/dist/components/Scene/models.mjs +78 -0
  77. package/dist/components/Scene/orbit.mjs +60 -0
  78. package/dist/components/Search/Search.mjs +246 -0
  79. package/dist/components/Split/Split.mjs +203 -0
  80. package/dist/components/Split/splitting.mjs +203 -0
  81. package/dist/components/Status/Status.mjs +47 -0
  82. package/dist/components/Timeline/Connected.mjs +25 -0
  83. package/dist/components/Timeline/Timeline.mjs +40 -0
  84. package/dist/components/Timeline/playerSurface.mjs +84 -0
  85. package/dist/components/Transcript/Transcript.mjs +377 -0
  86. package/dist/components/Viewer/Viewer.mjs +19 -0
  87. package/dist/core/annotation-bodies.mjs +29 -0
  88. package/dist/core/annotation-collection.mjs +55 -0
  89. package/dist/core/annotation-name.mjs +31 -0
  90. package/dist/core/annotation-sets.mjs +155 -0
  91. package/dist/core/annotations-content.mjs +27 -0
  92. package/dist/core/annotations.mjs +73 -0
  93. package/dist/core/clover.mjs +393 -0
  94. package/dist/core/content-state-reader.mjs +82 -0
  95. package/dist/core/content-state.mjs +43 -0
  96. package/dist/core/direction.mjs +12 -0
  97. package/dist/core/geo-detect.mjs +30 -0
  98. package/dist/core/geo.mjs +283 -0
  99. package/dist/core/items.mjs +74 -0
  100. package/dist/core/keep-fragments.mjs +40 -0
  101. package/dist/core/link.mjs +28 -0
  102. package/dist/core/load.mjs +176 -0
  103. package/dist/core/map-config.mjs +12 -0
  104. package/dist/core/markdown.mjs +139 -0
  105. package/dist/core/pages.mjs +51 -0
  106. package/dist/core/painted-bodies.mjs +20 -0
  107. package/dist/core/painting.mjs +17 -0
  108. package/dist/core/presentation.mjs +27 -0
  109. package/dist/core/ranges.mjs +133 -0
  110. package/dist/core/region.mjs +32 -0
  111. package/dist/core/request.mjs +40 -0
  112. package/dist/core/sanitize.mjs +72 -0
  113. package/dist/core/search-service.mjs +22 -0
  114. package/dist/core/search.mjs +154 -0
  115. package/dist/core/selectors.mjs +94 -0
  116. package/dist/core/sequence.mjs +70 -0
  117. package/dist/core/show-link.mjs +16 -0
  118. package/dist/core/store.mjs +40 -0
  119. package/dist/core/svg-shape.mjs +183 -0
  120. package/dist/core/text.mjs +36 -0
  121. package/dist/core/thumbnail.mjs +55 -0
  122. package/dist/core/value.mjs +39 -0
  123. package/dist/core/vtt.mjs +111 -0
  124. package/dist/hooks/useFullscreen.mjs +21 -0
  125. package/dist/hooks/useFullscreenSupported.mjs +11 -0
  126. package/dist/hooks/useLoaded.mjs +27 -0
  127. package/dist/hooks/useWithinFullscreen.mjs +24 -0
  128. package/dist/i18n/config.mjs +170 -0
  129. package/dist/i18n/hostLanguage.mjs +6 -0
  130. package/dist/i18n/locales/en.json.mjs +5 -0
  131. package/dist/i18n/locales/es.json.mjs +5 -0
  132. package/dist/i18n/locales/fi.json.mjs +5 -0
  133. package/dist/i18n/locales/fr.json.mjs +5 -0
  134. package/dist/i18n/locales/index.mjs +13 -0
  135. package/dist/i18n/locales/nb.json.mjs +5 -0
  136. package/dist/i18n/locales/nn.json.mjs +5 -0
  137. package/dist/i18n/locales/no.json.mjs +5 -0
  138. package/dist/i18n/locales/pt.json.mjs +5 -0
  139. package/dist/i18n/reader.mjs +13 -0
  140. package/dist/i18n/useCloverTranslation.mjs +28 -0
  141. package/dist/index.d.mts +2204 -0
  142. package/dist/index.mjs +133 -0
  143. package/dist/lib/asArray.mjs +5 -0
  144. package/dist/lib/classnames.mjs +5 -0
  145. package/dist/lib/fullscreen.mjs +65 -0
  146. package/dist/lib/gltf/bounds.mjs +44 -0
  147. package/dist/lib/gltf/load.mjs +156 -0
  148. package/dist/lib/gltf/mat4.mjs +150 -0
  149. package/dist/lib/gltf/renderer.mjs +342 -0
  150. package/dist/lib/gltf/shaders.mjs +192 -0
  151. package/dist/lib/hls.mjs +6 -0
  152. package/dist/lib/pointer.mjs +38 -0
  153. package/dist/lib/renderer/CanvasRenderer.mjs +857 -0
  154. package/dist/lib/renderer/backends/backend.mjs +21 -0
  155. package/dist/lib/renderer/backends/canvas2d/Canvas2DBackend.mjs +91 -0
  156. package/dist/lib/renderer/backends/contexts.mjs +27 -0
  157. package/dist/lib/renderer/backends/dom/DomLayers.mjs +91 -0
  158. package/dist/lib/renderer/backends/webgl2/WebGL2Backend.mjs +248 -0
  159. package/dist/lib/renderer/backends/webgl2/shaders.mjs +28 -0
  160. package/dist/lib/renderer/camera/Camera.mjs +64 -0
  161. package/dist/lib/renderer/camera/CameraAnimator.mjs +90 -0
  162. package/dist/lib/renderer/input/GestureController.mjs +252 -0
  163. package/dist/lib/renderer/io/TileCache.mjs +207 -0
  164. package/dist/lib/renderer/io/decode.mjs +156 -0
  165. package/dist/lib/renderer/loop/FrameLoop.mjs +50 -0
  166. package/dist/lib/renderer/math/affine.mjs +68 -0
  167. package/dist/lib/renderer/math/rect.mjs +45 -0
  168. package/dist/lib/renderer/overlays/Navigator.mjs +141 -0
  169. package/dist/lib/renderer/overlays/OverlayLayer.mjs +94 -0
  170. package/dist/lib/renderer/scene/planFrame.mjs +168 -0
  171. package/dist/lib/renderer/scene/regions.mjs +30 -0
  172. package/dist/lib/renderer/scene/sceneItem.mjs +114 -0
  173. package/dist/lib/renderer/scene/uploadBudget.mjs +30 -0
  174. package/dist/lib/renderer/sources/imageService.mjs +160 -0
  175. package/dist/lib/renderer/sources/sizedImage.mjs +38 -0
  176. package/dist/lib/renderer/sources/tilePyramid.mjs +172 -0
  177. package/dist/lib/time.mjs +21 -0
  178. package/dist/map/index.d.mts +184 -0
  179. package/dist/map/index.mjs +16 -0
  180. package/dist/react/context.mjs +46 -0
  181. package/dist/react/hooks.mjs +69 -0
  182. package/dist/react/language.mjs +30 -0
  183. package/dist/styles.css +1 -0
  184. package/dist/templates/default/Default.mjs +229 -0
  185. package/dist/templates/document/Document.mjs +286 -0
  186. package/dist/templates/document/DocumentPanel.mjs +9 -0
  187. package/dist/templates/document/Sheets.mjs +360 -0
  188. package/dist/templates/gallery/Gallery.mjs +62 -0
  189. package/dist/templates/index.d.mts +273 -0
  190. package/dist/templates/index.mjs +11 -0
  191. package/dist/templates/shared/Lightbox.mjs +111 -0
  192. package/dist/templates/shared/LightboxBody.mjs +9 -0
  193. package/dist/templates/shared/dragToClose.mjs +129 -0
  194. package/dist/templates/shared/useDragToClose.mjs +35 -0
  195. package/dist/templates/shared/useDrawer.mjs +113 -0
  196. package/dist/templates/shared/useFollowFocus.mjs +24 -0
  197. package/dist/templates/shared/useSlide.mjs +52 -0
  198. package/dist/templates/shared/useSpine.mjs +26 -0
  199. package/dist/templates.css +1 -0
  200. package/dist/three/index.d.mts +6 -0
  201. package/dist/three/index.mjs +8 -0
  202. package/dist/ui/Button.mjs +53 -0
  203. package/dist/ui/ControlCluster.mjs +87 -0
  204. package/dist/ui/Cue.mjs +13 -0
  205. package/dist/ui/ErrorBoundary.mjs +26 -0
  206. package/dist/ui/ExitFullscreen.mjs +46 -0
  207. package/dist/ui/FieldPill.mjs +153 -0
  208. package/dist/ui/HideToggle.mjs +57 -0
  209. package/dist/ui/Loading.mjs +20 -0
  210. package/dist/ui/Markup.mjs +95 -0
  211. package/dist/ui/ReadMore.mjs +84 -0
  212. package/dist/ui/Sections.mjs +448 -0
  213. package/dist/ui/Steps.mjs +84 -0
  214. package/dist/ui/Tip.mjs +196 -0
  215. package/dist/ui/bringIntoView.mjs +27 -0
  216. package/dist/ui/controlGlyphs.mjs +120 -0
  217. package/dist/ui/heading.mjs +19 -0
  218. package/dist/ui/languageCode.mjs +8 -0
  219. package/dist/ui/mediaIcons.mjs +104 -0
  220. package/dist/ui/useClusterReach.mjs +50 -0
  221. package/dist/ui/useContainerName.mjs +19 -0
  222. package/dist/ui/useOneOpen.mjs +22 -0
  223. package/dist/ui/useRovingFocus.mjs +64 -0
  224. package/dist/ui/useScrollTrack.mjs +150 -0
  225. package/dist/ui/useUniqueId.mjs +10 -0
  226. package/dist/ui/visuallyHidden.mjs +15 -0
  227. package/dist/web-components/About-uKa1wfDr.mjs +1 -0
  228. package/dist/web-components/AnnotationMenu-BGIYRXW6.mjs +1 -0
  229. package/dist/web-components/AnnotationState-D2UIgIEC.mjs +1 -0
  230. package/dist/web-components/Annotations-BhwAv3ah.mjs +1 -0
  231. package/dist/web-components/Annotations-C_tBJHo3.mjs +2 -0
  232. package/dist/web-components/Body-DMEERFuB.mjs +1 -0
  233. package/dist/web-components/BodyAlert-BP8voSLv.mjs +1 -0
  234. package/dist/web-components/Button-Cl02BFDd.mjs +1 -0
  235. package/dist/web-components/Camera-Dw51CAfF.mjs +1 -0
  236. package/dist/web-components/Canvas2DBackend-RRN2bEkc.mjs +1 -0
  237. package/dist/web-components/CanvasView-B8lMMSou.mjs +1 -0
  238. package/dist/web-components/CaptionDetails-KLMDv-ec.mjs +1 -0
  239. package/dist/web-components/ChoiceMenu-CXrVOmJl.mjs +1 -0
  240. package/dist/web-components/Collection-DL4Ui4hF.mjs +1 -0
  241. package/dist/web-components/CollectionSelect-DL-bbpwJ.mjs +1 -0
  242. package/dist/web-components/Connected-B0S1HXQb.mjs +1 -0
  243. package/dist/web-components/Connected-BcjRA5si.mjs +1 -0
  244. package/dist/web-components/Connected-Q7iizBb8.mjs +1 -0
  245. package/dist/web-components/Contents-ZC8TiGaW.mjs +1 -0
  246. package/dist/web-components/ControlMenu-DIoU797-.mjs +1 -0
  247. package/dist/web-components/Cue-CJxnDMEy.mjs +1 -0
  248. package/dist/web-components/Document-DHBRAFEK.mjs +1 -0
  249. package/dist/web-components/DocumentPanel-CqvE2pu9.mjs +1 -0
  250. package/dist/web-components/DomLayers-BsR2AOy-.mjs +1 -0
  251. package/dist/web-components/Download-DBksL1C0.mjs +1 -0
  252. package/dist/web-components/EntryBodies-VwEkTVrw.mjs +1 -0
  253. package/dist/web-components/ErrorBoundary-Cy9PGoZv.mjs +1 -0
  254. package/dist/web-components/FieldPill-DCJBz6Vj.mjs +1 -0
  255. package/dist/web-components/FrameAnimation-DRbmgGpF.mjs +1 -0
  256. package/dist/web-components/Gallery-BM7-VJkB.mjs +1 -0
  257. package/dist/web-components/HideToggle-BdYgG7us.mjs +1 -0
  258. package/dist/web-components/Items-_1Jz3FMs.mjs +1 -0
  259. package/dist/web-components/Label-CAiJ49eA.mjs +1 -0
  260. package/dist/web-components/LightboxBody-DyhUZiDf.mjs +1 -0
  261. package/dist/web-components/Loaded-wQurAeJz.mjs +1 -0
  262. package/dist/web-components/LoadedCanvas-DWz5IK5m.mjs +1 -0
  263. package/dist/web-components/LoadedMap-DIeW313M.mjs +1 -0
  264. package/dist/web-components/Loading-BmA--pzr.mjs +1 -0
  265. package/dist/web-components/Map-DzVGblIS.mjs +1 -0
  266. package/dist/web-components/MapView-BJaN7VBI.mjs +1 -0
  267. package/dist/web-components/Markup-D91DbxLk.mjs +2 -0
  268. package/dist/web-components/MediaBody-BYcVPo2X.mjs +1 -0
  269. package/dist/web-components/MediaBody-FEzH8VVw.mjs +1 -0
  270. package/dist/web-components/Navigator-CIJFA3q1.mjs +1 -0
  271. package/dist/web-components/Pager-BGwCurxE.mjs +1 -0
  272. package/dist/web-components/Panel-B-GXOkzF.mjs +1 -0
  273. package/dist/web-components/PanelToggle-BYjV2t1j.mjs +1 -0
  274. package/dist/web-components/PartOfManifest-ClbGepVM.mjs +1 -0
  275. package/dist/web-components/Pending-BspZajh5.mjs +1 -0
  276. package/dist/web-components/Primitives-CTh59wvs.mjs +1 -0
  277. package/dist/web-components/Provider-C6rIiDXH.mjs +1 -0
  278. package/dist/web-components/ReadMore-BJ2i-0uN.mjs +1 -0
  279. package/dist/web-components/Root-DkkYDtur.mjs +1 -0
  280. package/dist/web-components/Scene-B_PU_TiX.mjs +1 -0
  281. package/dist/web-components/SceneView-qcW_sT3j.mjs +1 -0
  282. package/dist/web-components/Search-UOneIUcP.mjs +1 -0
  283. package/dist/web-components/Sections-we9U9fXq.mjs +2 -0
  284. package/dist/web-components/StandaloneItems-DU8oCFc_.mjs +1 -0
  285. package/dist/web-components/Status-Cs5ZvFvL.mjs +1 -0
  286. package/dist/web-components/Timeline-WtYZ1bIJ.mjs +1 -0
  287. package/dist/web-components/Tip-C8J3qsIK.mjs +1 -0
  288. package/dist/web-components/Transcript-CRL2zToL.mjs +1 -0
  289. package/dist/web-components/annotation-collection-ZPyvpLFc.mjs +1 -0
  290. package/dist/web-components/annotations-content-BZChKhJZ.mjs +1 -0
  291. package/dist/web-components/assets/maplibre-gl-worker-kTz9OPxr.js +13831 -0
  292. package/dist/web-components/body-UntgrmoV.mjs +1 -0
  293. package/dist/web-components/bringIntoView-CQH5ZgMM.mjs +1 -0
  294. package/dist/web-components/canvas-d_U4v_mh.mjs +1 -0
  295. package/dist/web-components/classnames-DukgfdpI.mjs +1 -0
  296. package/dist/web-components/cloverEngine-Dbv-26NP.mjs +164 -0
  297. package/dist/web-components/content-state-reader-DjdKWjit.mjs +1 -0
  298. package/dist/web-components/contexts-ByL3eA_T.mjs +1 -0
  299. package/dist/web-components/controls-qRYf2jO2.mjs +1 -0
  300. package/dist/web-components/custom-elements.json +2739 -0
  301. package/dist/web-components/dragToClose-C-Pf1IeO.mjs +1 -0
  302. package/dist/web-components/engine-D8JLgzqq.mjs +4228 -0
  303. package/dist/web-components/engines-BwVb9R_A.mjs +1 -0
  304. package/dist/web-components/es-BwMkoRod.mjs +1 -0
  305. package/dist/web-components/fi-gPFOn9RK.mjs +1 -0
  306. package/dist/web-components/fr-DUHmgdJo.mjs +1 -0
  307. package/dist/web-components/fromManifest-UrMJgktp.mjs +1 -0
  308. package/dist/web-components/glyphs-BoX0a88P.mjs +1 -0
  309. package/dist/web-components/heading-Cjt0f-Eu.mjs +1 -0
  310. package/dist/web-components/hls-CdKrthkC.mjs +40 -0
  311. package/dist/web-components/hooks-Dp8pjU8l.mjs +1 -0
  312. package/dist/web-components/imageService-C3yg9DxB.mjs +1 -0
  313. package/dist/web-components/index-DWxMuwDL.mjs +1 -0
  314. package/dist/web-components/index.d.mts +604 -0
  315. package/dist/web-components/index.mjs +1 -0
  316. package/dist/web-components/index.umd.js +18 -0
  317. package/dist/web-components/items--Tu7ZM3L.mjs +1 -0
  318. package/dist/web-components/items-W2vrwArM.mjs +1 -0
  319. package/dist/web-components/keep-fragments-B5nlv2ck.mjs +1 -0
  320. package/dist/web-components/label-CYQ7tVl6.mjs +1 -0
  321. package/dist/web-components/languageCode-cCpiU0b0.mjs +1 -0
  322. package/dist/web-components/layout-KL0V-iJu.mjs +1 -0
  323. package/dist/web-components/link-DRRTY4lY.mjs +1 -0
  324. package/dist/web-components/logo-CnQUCB3Y.mjs +1 -0
  325. package/dist/web-components/maplibre-gl-CQ4OueXY.mjs +823 -0
  326. package/dist/web-components/markdown-CCYJwzFn.mjs +5 -0
  327. package/dist/web-components/models-BP2qp9nT.mjs +1 -0
  328. package/dist/web-components/nb-BSvnQ6jd.mjs +1 -0
  329. package/dist/web-components/nn-Dg2_HdZu.mjs +1 -0
  330. package/dist/web-components/no-BSvnQ6jd.mjs +1 -0
  331. package/dist/web-components/nodes-Bf-Fb7e5.mjs +1 -0
  332. package/dist/web-components/overlayImage-DdPs2EGY.mjs +1 -0
  333. package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +1 -0
  334. package/dist/web-components/panel-CiqEFDzv.mjs +1 -0
  335. package/dist/web-components/part-CUBY90_b.mjs +1 -0
  336. package/dist/web-components/playerSurface-i2TJz-F4.mjs +1 -0
  337. package/dist/web-components/provider-LUmAQSoP.mjs +1 -0
  338. package/dist/web-components/pt-B3J80JgO.mjs +1 -0
  339. package/dist/web-components/read-more-BaaO77el.mjs +1 -0
  340. package/dist/web-components/rendererSurface-DAvatpMF.mjs +22 -0
  341. package/dist/web-components/renderers-Bg4QqawN.mjs +1 -0
  342. package/dist/web-components/resource-DzIvB_4m.mjs +1 -0
  343. package/dist/web-components/sanitize-Dc7nOsgO.mjs +3 -0
  344. package/dist/web-components/search-DgcgsI3I.mjs +1 -0
  345. package/dist/web-components/shared-J3w3gnXD.mjs +1 -0
  346. package/dist/web-components/show-link-DWRRXSBy.mjs +1 -0
  347. package/dist/web-components/sizedImage-DfjlV2-i.mjs +1 -0
  348. package/dist/web-components/split-m-_XivaW.mjs +1 -0
  349. package/dist/web-components/splitting-BnQUxxgH.mjs +1 -0
  350. package/dist/web-components/status-DDS7jLNd.mjs +1 -0
  351. package/dist/web-components/styles-Ypl9KrSK.mjs +1 -0
  352. package/dist/web-components/svg-shape-DLY3g7oq.mjs +1 -0
  353. package/dist/web-components/text-BTAkxEfQ.mjs +5 -0
  354. package/dist/web-components/three.mjs +1 -0
  355. package/dist/web-components/thumbnail-BZvLSwWW.mjs +1 -0
  356. package/dist/web-components/time-B9GZoYcm.mjs +1 -0
  357. package/dist/web-components/tip-BXByhOJ9.mjs +1 -0
  358. package/dist/web-components/toggle-AS72kq6v.mjs +1 -0
  359. package/dist/web-components/upgrader-XNxI-5jo.mjs +1 -0
  360. package/dist/web-components/useContainerName-DCbE5JXi.mjs +1 -0
  361. package/dist/web-components/useNearViewport-CyoK3l8W.mjs +1 -0
  362. package/dist/web-components/useScrollTrack-dLFWnT8N.mjs +1 -0
  363. package/dist/web-components/viewer/AnnotationMenu-Dd4tnzNV.mjs +1 -0
  364. package/dist/web-components/viewer/AnnotationState-DZaSy5lH.mjs +1 -0
  365. package/dist/web-components/viewer/Annotations-D1h-Yi5J.mjs +1 -0
  366. package/dist/web-components/viewer/Annotations-sj79EMen.mjs +2 -0
  367. package/dist/web-components/viewer/Canvas2DBackend-CkvI0wUT.mjs +1 -0
  368. package/dist/web-components/viewer/CaptionDetails-B_JdNjJ7.mjs +1 -0
  369. package/dist/web-components/viewer/ChoiceMenu-xa51a1DV.mjs +1 -0
  370. package/dist/web-components/viewer/Collection-CxuLCspj.mjs +1 -0
  371. package/dist/web-components/viewer/Connected-BSUBc3Ci.mjs +1 -0
  372. package/dist/web-components/viewer/Connected-CPIxNjF2.mjs +1 -0
  373. package/dist/web-components/viewer/Contents-DNh9mnsF.mjs +1 -0
  374. package/dist/web-components/viewer/ControlMenu-DdgIvBdf.mjs +1 -0
  375. package/dist/web-components/viewer/Cue-90H9_dXz.mjs +1 -0
  376. package/dist/web-components/viewer/Document-CNCpzkiN.mjs +1 -0
  377. package/dist/web-components/viewer/DocumentPanel-BdG4TVLE.mjs +1 -0
  378. package/dist/web-components/viewer/DomLayers-Dybz_aJv.mjs +1 -0
  379. package/dist/web-components/viewer/EntryBodies-DGXjFP3N.mjs +1 -0
  380. package/dist/web-components/viewer/FieldPill-Icmd98OY.mjs +1 -0
  381. package/dist/web-components/viewer/FrameAnimation-DJZN3Rd4.mjs +1 -0
  382. package/dist/web-components/viewer/Gallery-CEp3-bh2.mjs +1 -0
  383. package/dist/web-components/viewer/HideToggle-DB6HTmAO.mjs +1 -0
  384. package/dist/web-components/viewer/LightboxBody-ClQ4yrTh.mjs +1 -0
  385. package/dist/web-components/viewer/MapView-BVSdybIC.mjs +1 -0
  386. package/dist/web-components/viewer/MediaBody-BBbSMT1i.mjs +1 -0
  387. package/dist/web-components/viewer/MediaBody-BzMXMHIF.mjs +1 -0
  388. package/dist/web-components/viewer/Navigator-Duc69Yes.mjs +1 -0
  389. package/dist/web-components/viewer/PartOfManifest-X9_q-2t6.mjs +1 -0
  390. package/dist/web-components/viewer/Search-S4N5QU4R.mjs +1 -0
  391. package/dist/web-components/viewer/StandaloneItems-BO4VyWRW.mjs +1 -0
  392. package/dist/web-components/viewer/Transcript-BbDaS064.mjs +1 -0
  393. package/dist/web-components/viewer/annotation-collection-BjZ1DAHq.mjs +1 -0
  394. package/dist/web-components/viewer/annotations-content-jn3n5Y2-.mjs +1 -0
  395. package/dist/web-components/viewer/cloverEngine-CjuYjUhI.mjs +164 -0
  396. package/dist/web-components/viewer/content-state-reader-CPiShIjP.mjs +1 -0
  397. package/dist/web-components/viewer/host-yWi4R1bP.mjs +1 -0
  398. package/dist/web-components/viewer/index.d.mts +7 -0
  399. package/dist/web-components/viewer/index.mjs +1 -0
  400. package/dist/web-components/viewer/index.umd.js +18 -0
  401. package/dist/web-components/viewer/link-CwE-fg5G.mjs +1 -0
  402. package/dist/web-components/viewer/overlayImage-BpOgqsZ0.mjs +1 -0
  403. package/dist/web-components/viewer/renderers-L-IlGI1r.mjs +1 -0
  404. package/dist/web-components/viewer/search-DWkwRPo_.mjs +1 -0
  405. package/dist/web-components/viewer/styles-BRCkEU3w.mjs +1 -0
  406. package/dist/web-components/viewer/viewer--TreVlJ_.mjs +28 -0
  407. package/dist/web-components/viewer/vtt-1ZJwtElI.mjs +5 -0
  408. package/dist/web-components/viewer-DyV864Qe.mjs +1 -0
  409. package/dist/web-components/vtt-GFssZH8Y.mjs +5 -0
  410. package/package.json +110 -4
@@ -0,0 +1,2204 @@
1
+ // Generated by dts-bundle-generator v8.0.1
2
+
3
+ import { Canvas, Collection, Manifest, Scene, Timeline } from '@iiif/parser/presentation-4/types';
4
+ import { Annotation, IIIFExternalWebResource, InternationalString, MetadataItem } from '@iiif/presentation-3';
5
+ import React from 'react';
6
+ import { CSSProperties, ReactNode } from 'react';
7
+
8
+ /**
9
+ * Where an annotation points, read from any form of Presentation 4 target:
10
+ *
11
+ * - a URI, `canvas#xywh=x,y,w,h` or `canvas#t=start,end`;
12
+ * - a reference, `{ id, type }`, whose id carries the same fragments (what the upgrader
13
+ * makes of a Presentation 3 string target);
14
+ * - a `SpecificResource`, `{ source, selector }`, with a `FragmentSelector`,
15
+ * `PointSelector` or `SvgSelector` (or an array of them, of which the first that
16
+ * applies wins);
17
+ * - several of these, as Presentation 4 groups them (`Independents`, `List`,
18
+ * `Composite`, which the upgrader makes of a Presentation 3 array), of which this reads
19
+ * the first; `annotationTargets` (`components/Canvas/track.ts`, with the hotspots that
20
+ * follow a recording) reads them all.
21
+ *
22
+ * A fragment may give a region and a time at once (`xywh=…&t=…`, both dimensions of a
23
+ * Media Fragment): the region through that stretch of a recording.
24
+ */
25
+ export interface ParsedAnnotationTarget {
26
+ /** The Canvas (or other resource) targeted, without its fragment. */
27
+ id: string;
28
+ point?: {
29
+ x: number;
30
+ y: number;
31
+ };
32
+ rect?: {
33
+ x: number;
34
+ y: number;
35
+ w: number;
36
+ h: number;
37
+ };
38
+ svg?: string;
39
+ /** A media fragment's time, as written: `start` or `start,end`. */
40
+ t?: string;
41
+ }
42
+ /**
43
+ * IIIF language maps as text: the closest language to the reader's, and that language's
44
+ * tag, so the text can carry a `lang` attribute.
45
+ */
46
+ export type LanguageMapLike = string | Record<string, string[] | string | undefined> | null | undefined;
47
+ export interface LocalizedValue {
48
+ text: string;
49
+ /** The tag the text is in; undefined for `none` (no language) or plain strings. */
50
+ lang?: string;
51
+ }
52
+ export declare function localize(value: LanguageMapLike, language?: string, separator?: string): LocalizedValue;
53
+ /**
54
+ * What an annotation says: its text bodies (plain, HTML or Markdown, as their `format`
55
+ * says) and its images (Cookbook 0377). Caption files belong to the media transcript, so
56
+ * are left out. Light, for the Canvas's caption as well as the lists.
57
+ */
58
+ export interface AnnotationBodyEntry {
59
+ /** `TextualBody` text, as published: plain, or IIIF's limited HTML. */
60
+ value?: string;
61
+ format?: string;
62
+ language?: string;
63
+ /** An image body (Cookbook 0377): its URL. */
64
+ image?: string;
65
+ /** An image body's label, else its annotation's: the image's text alternative. */
66
+ label?: LanguageMapLike;
67
+ }
68
+ /**
69
+ * A IIIF resource Clover can show directly, a Manifest's item: a Canvas (`Canvas`), a
70
+ * Timeline (`Timeline`, sound) or a Scene (`Scene`, 3D).
71
+ */
72
+ export type Container = Canvas | Timeline | Scene;
73
+ /**
74
+ * `resource` as Presentation 4: a Manifest, Collection, Canvas, Timeline or Scene from any
75
+ * supported version. Presentation 4 input is returned as it is.
76
+ */
77
+ export declare function toPresentation4<T = Manifest | Collection | Container>(resource: unknown): Promise<T>;
78
+ /**
79
+ * Annotations to read and to point at: everything a Manifest's Canvases carry in their
80
+ * `annotations` (comments, tags, transcriptions, descriptions), and pages a host adds.
81
+ * Painting annotations are the picture, not commentary, and caption files belong to the
82
+ * media transcript, so neither is listed here.
83
+ *
84
+ * A set is one AnnotationPage. Sets are memoized on the Manifest and the added pages, so
85
+ * the same arrays come back while nothing changes.
86
+ */
87
+ export interface AnnotationEntry {
88
+ id: string;
89
+ /** The set it came from. */
90
+ setId: string;
91
+ /** The Canvas it targets. */
92
+ canvasId: string;
93
+ target: ParsedAnnotationTarget;
94
+ motivation: string[];
95
+ bodies: AnnotationBodyEntry[];
96
+ /** The annotation as published, for a host's own rendering. */
97
+ annotation: Record<string, any>;
98
+ }
99
+ export interface AnnotationSet {
100
+ id: string;
101
+ label?: LanguageMapLike;
102
+ /** Where it came from: the Manifest's Canvases, the host, or a Content Search. */
103
+ source: "manifest" | "added" | "search";
104
+ entries: AnnotationEntry[];
105
+ }
106
+ /**
107
+ * How Clover asks for things: one setting for every request it makes — the IIIF resource,
108
+ * referenced annotation pages, `info.json`, tiles, captions and HLS segments.
109
+ *
110
+ * A `<video>` or `<img>` element cannot send headers, so where Clover must use one (media
111
+ * without HLS, an image served without CORS) only `credentials` applies.
112
+ */
113
+ export interface CloverRequest {
114
+ /** Cookies and HTTP authentication: `"include"` sends them cross-origin. */
115
+ credentials?: RequestCredentials;
116
+ /** Extra headers, such as `Authorization`. They force a CORS preflight. */
117
+ headers?: Record<string, string>;
118
+ /** Your own `fetch`, to sign, log or proxy requests. */
119
+ fetch?: typeof fetch;
120
+ }
121
+ /**
122
+ * Annotations a host adds to what the Manifest carries: an AnnotationPage, an
123
+ * AnnotationCollection (its pages followed from `first` through `next`), or a list of
124
+ * either, as URLs or objects. Each page becomes one set.
125
+ */
126
+ export type AnnotationsInput = string | Record<string, unknown> | unknown[];
127
+ /**
128
+ * IIIF Content State: a link that opens a resource at a place — a Canvas, a region of it,
129
+ * a moment in it. Clover reads the forms the spec gives (an annotation with the
130
+ * `contentState` motivation, or its bare target) as JSON or base64url-encoded, and turns
131
+ * them into what to load and where to go once it has (`content-state-reader.ts`, loaded
132
+ * only for one), and writes where the reader is as one (here).
133
+ *
134
+ * @see https://iiif.io/api/content-state/
135
+ */
136
+ /** Where to go once a resource has loaded. Consumed once it has been applied. */
137
+ export interface Target {
138
+ canvasId: string;
139
+ /** In the Canvas's own coordinates. */
140
+ region?: {
141
+ x: number;
142
+ y: number;
143
+ w: number;
144
+ h: number;
145
+ };
146
+ /** Seconds into a time-based Canvas. */
147
+ time?: number;
148
+ /** Start playback on arrival (auto-advance from the previous Canvas). */
149
+ autoplay?: boolean;
150
+ }
151
+ /** A content state as a link carries it: base64url of the URI-encoded JSON, unpadded. */
152
+ export declare function encodeContentState(json: unknown): string;
153
+ export interface ContentStateOutput {
154
+ /** The content state annotation. */
155
+ json: Record<string, unknown>;
156
+ /** The same, encoded for a URL. */
157
+ encoded: string;
158
+ }
159
+ /**
160
+ * Where the reader is, as a content state: the Canvas within its Manifest, and the
161
+ * visible region (`xywh=`) or the media time (`t=`) when there is one. Regions are
162
+ * rounded to whole pixels.
163
+ */
164
+ export declare function buildContentState({ manifestId, canvasId, region, time, }: {
165
+ manifestId: string;
166
+ canvasId: string;
167
+ region?: {
168
+ x: number;
169
+ y: number;
170
+ w: number;
171
+ h: number;
172
+ } | null;
173
+ time?: number | null;
174
+ }): ContentStateOutput;
175
+ /**
176
+ * Turning whatever a `Root` is handed into a Manifest to show.
177
+ *
178
+ * `iiifContent` may be a URL, a IIIF resource object (Presentation 2, 3 or 4), or a content
179
+ * state (JSON or base64url). The resource may be a Manifest, a Collection (its first
180
+ * Manifest is shown), a lone Canvas (its `partOf` Manifest, or a Manifest made around
181
+ * it), or annotations, an AnnotationPage or AnnotationCollection (the Manifest their first
182
+ * annotation's Canvas is `partOf`, at that Canvas). Everything is fetched once, with the
183
+ * request settings, and upgraded to Presentation 4.
184
+ */
185
+ export type IIIFContent = string | Record<string, unknown>;
186
+ /**
187
+ * IIIF Content Search, versions 1 and 2: finding the Manifest's service, asking it, and
188
+ * reading the answer into hits to list and an annotation set to draw.
189
+ *
190
+ * - **Version 2** answers with an AnnotationPage of `highlighting` annotations on the
191
+ * Canvases, and (optionally) `contextualizing` annotations whose TextQuoteSelectors give
192
+ * the words around each match. Further pages hang from `next`.
193
+ * - **Version 1** answers with a Presentation 2 AnnotationList: `resources` (annotations
194
+ * `on` a Canvas region, their text in `resource.chars`) and `hits` grouping them with
195
+ * `before`, `match` and `after`. Further pages hang from `next` (or `within.next`).
196
+ *
197
+ * Neither is upgraded through `@iiif/parser`: the two shapes are small, and read
198
+ * directly. Finding the service is here; asking it and reading the answer are in
199
+ * `core/search.ts`. Both load statically: measured through esbuild, a lazy split cost
200
+ * more than it saved (shared modules are hoisted into an extra chunk).
201
+ */
202
+ export interface SearchService {
203
+ id: string;
204
+ version: 1 | 2;
205
+ }
206
+ export interface SearchHit {
207
+ id: string;
208
+ /** The Canvas the hit is on. */
209
+ canvasId: string;
210
+ /** The annotations (regions) it highlights; the first is the one to go to. */
211
+ entryIds: string[];
212
+ before?: string;
213
+ match: string;
214
+ after?: string;
215
+ }
216
+ export interface SearchResults {
217
+ query: string;
218
+ hits: SearchHit[];
219
+ /** The hits as an annotation set, so the Canvas draws them where they are. */
220
+ set: AnnotationSet;
221
+ }
222
+ /** The set's id, so hosts and parts can tell search hotspots from annotations. */
223
+ export declare const SEARCH_SET_ID = "content-search";
224
+ /** The Manifest's Content Search service (2 preferred over 1), or null. */
225
+ export declare function searchServiceOf(manifest: Manifest | null): SearchService | null;
226
+ /**
227
+ * The smallest store Clover needs: state, a way to change it, and subscribers. React reads
228
+ * it through `useSyncExternalStore`, so a part re-renders only when what it selected
229
+ * changed.
230
+ */
231
+ export interface Store<State> {
232
+ get(): State;
233
+ /** Merge a patch. Subscribers hear of it only if some value actually changed. */
234
+ set(patch: Partial<State> | ((state: State) => Partial<State>)): void;
235
+ subscribe(listener: () => void): () => void;
236
+ }
237
+ /**
238
+ * A stream of values that change too often for the store: the viewport on every frame,
239
+ * the media element and its time. Emitting never touches the store, so panning or playback
240
+ * re-renders nothing that has not subscribed.
241
+ */
242
+ export interface Channel<Value> {
243
+ get(): Value;
244
+ emit(value: Value): void;
245
+ subscribe(listener: (value: Value) => void): () => void;
246
+ }
247
+ /**
248
+ * One Clover: what a `Root` owns. Framework-free, so it can be tested — and driven —
249
+ * without React.
250
+ *
251
+ * The store holds only what parts render from. Everything that changes per frame (the
252
+ * viewport) or per tick (media time) goes through channels, so panning or playback
253
+ * re-renders nothing that has not asked to hear about it.
254
+ */
255
+ export type CloverStatus = "idle" | "loading" | "ready" | "error";
256
+ export interface CloverState {
257
+ status: CloverStatus;
258
+ error: Error | null;
259
+ /** The Manifest shown, in Presentation 4. */
260
+ manifest: Manifest | null;
261
+ /** The Collection it was reached through, if any. */
262
+ collection: Collection | null;
263
+ /** The Canvas the reader is on: the first of the view that shows it. */
264
+ canvasId: string | null;
265
+ /** Where to go once the view is drawn: a region, a time. Consumed once applied. */
266
+ target: Target | null;
267
+ /** The annotation picked, from a list or its hotspot; the Canvas frames it. */
268
+ annotationId: string | null;
269
+ /** Annotation sets switched off: their hotspots are not drawn. */
270
+ hiddenSets: string[];
271
+ /**
272
+ * Sets that start hidden (a still Canvas's OCR, `startsHidden`) switched on. What is
273
+ * drawn is `selectHiddenSets`'s.
274
+ */
275
+ shownSets: string[];
276
+ /** Sets the host added through `annotations`, beside the Manifest's own. */
277
+ addedSets: AnnotationSet[];
278
+ /** A Content Search of the Manifest: its query, progress and hits. */
279
+ search: SearchState;
280
+ }
281
+ export interface SearchState {
282
+ query: string;
283
+ status: "idle" | "loading" | "ready" | "error";
284
+ hits: SearchHit[];
285
+ /** The hits as a set the Canvas draws; null until there are any. */
286
+ set: AnnotationSet | null;
287
+ }
288
+ export interface ViewportState {
289
+ /** The visible region, in the coordinates of the Canvas holding most of the view. */
290
+ canvasId: string;
291
+ region: {
292
+ x: number;
293
+ y: number;
294
+ w: number;
295
+ h: number;
296
+ };
297
+ }
298
+ export interface CloverOptions {
299
+ request?: CloverRequest;
300
+ /**
301
+ * Called with the Canvas the reader moves to. When `isControlled()` is true the store
302
+ * is not changed: the host decides, and hands the id back through `syncCanvas`.
303
+ */
304
+ onCanvasChange?: (canvasId: string) => void;
305
+ isControlled?: () => boolean;
306
+ /**
307
+ * Called with the Manifest the reader moves to within a Collection. When
308
+ * `isManifestControlled()` is true nothing moves: the host decides, and hands the id
309
+ * back through `syncManifest`.
310
+ */
311
+ onManifestChange?: (manifestId: string) => void;
312
+ isManifestControlled?: () => boolean;
313
+ }
314
+ export interface Clover {
315
+ store: Store<CloverState>;
316
+ viewport: Channel<ViewportState | null>;
317
+ media: Channel<HTMLVideoElement | null>;
318
+ /**
319
+ * The caption file the reader chose in a Canvas's own Captions menu, by its `id` (the
320
+ * WebVTT's address): `null` until they choose, or for Off. A transcript follows it.
321
+ */
322
+ captions: Channel<string | null>;
323
+ /** The annotation hovered or focused, in a list or on the Canvas. */
324
+ highlight: Channel<string | null>;
325
+ /** The chapter (its Range's id) under the pointer on a seek bar, or in `Contents`. */
326
+ chapter: Channel<string | null>;
327
+ readonly request: CloverRequest | undefined;
328
+ setRequest(request: CloverRequest | undefined): void;
329
+ /** Load content. `canvasId` wins over everything; `defaultCanvasId` over `start`. */
330
+ load(content: IIIFContent, initial?: Initial): Promise<void>;
331
+ goTo(canvasId: string, target?: Omit<Target, "canvasId">): void;
332
+ /**
333
+ * Show another member of the Collection: a Manifest (fetched if only referenced), or a
334
+ * nested Collection, which is entered as `load` would.
335
+ */
336
+ goToManifest(id: string, canvasId?: string): Promise<void>;
337
+ /** A controlled host's Manifest, shown without asking it again. */
338
+ syncManifest(id: string | null): Promise<void>;
339
+ /**
340
+ * Show a Collection the Manifest is part of (its `partOf`) beside it: the Collection's
341
+ * members become a choice, while the Manifest and the reader's place stay as they are.
342
+ * Nothing changes if it will not load, or the reader has moved on meanwhile. The
343
+ * information panel calls it when its Collection section first opens.
344
+ */
345
+ openCollection(id: string): Promise<void>;
346
+ next(options?: {
347
+ autoplay?: boolean;
348
+ wrap?: boolean;
349
+ }): void;
350
+ previous(): void;
351
+ first(): void;
352
+ last(): void;
353
+ /** Mark the pending target applied, so it is not applied again. */
354
+ consumeTarget(): void;
355
+ /** A controlled host's Canvas, applied without asking it again. */
356
+ syncCanvas(canvasId: string | null): void;
357
+ /**
358
+ * Pick an annotation (null to clear). On another Canvas, go there first; in a hidden
359
+ * set, show the set.
360
+ */
361
+ selectAnnotation(id: string | null): void;
362
+ /**
363
+ * Search the Manifest through its Content Search service (1 or 2). The hits are listed
364
+ * in `state.search` and drawn on the Canvas; an empty query clears them.
365
+ */
366
+ search(query: string): Promise<void>;
367
+ /** Show or hide a set's hotspots. */
368
+ setSetVisible(setId: string, visible: boolean): void;
369
+ /** Add annotations beside the Manifest's: pages, collections, or a list of either. */
370
+ loadAnnotations(input: AnnotationsInput | null): Promise<void>;
371
+ /** Where the reader is, as a content state: the Canvas and its region or time. */
372
+ getContentState(): ContentStateOutput | null;
373
+ /**
374
+ * Whose referenced annotation pages to fetch: the view's (default, as the reader moves)
375
+ * or every Canvas's (a page listing all of them).
376
+ */
377
+ setAnnotationPages(scope: "view" | "all"): void;
378
+ /**
379
+ * Fetch every Canvas's referenced annotation pages while held, whatever
380
+ * `setAnnotationPages` says: for a listing of all of them (`Annotations`'
381
+ * `scope="all"`). Returns the release.
382
+ */
383
+ holdAllAnnotationPages(): () => void;
384
+ /** Abandon any load in flight. The instance stays usable. */
385
+ dispose(): void;
386
+ }
387
+ export interface Navigation {
388
+ /** Zero-based index of the current view. */
389
+ position: number;
390
+ total: number;
391
+ hasPrevious: boolean;
392
+ hasNext: boolean;
393
+ previous(): void;
394
+ next(): void;
395
+ first(): void;
396
+ last(): void;
397
+ goTo(canvasId: string): void;
398
+ }
399
+ /** Where to open: the host's Canvas, its default, and in a Collection its Manifest. */
400
+ export interface Initial {
401
+ canvasId?: string | null;
402
+ defaultCanvasId?: string | null;
403
+ manifestId?: string | null;
404
+ }
405
+ /**
406
+ * Renderers of your own for some views, drawn by `Body` in place of `Canvas`: a 3D
407
+ * model, a PDF, a map, anything a Canvas paints that Clover does not draw, or draws
408
+ * differently than you want. The successor to 3.x's `customDisplays`.
409
+ */
410
+ export interface BodyRendererProps {
411
+ /** The view's Canvases, in Presentation 4: one, or two for a spread. */
412
+ canvases: Container[];
413
+ /**
414
+ * The bodies the view's Canvases paint, unwrapped: a `Choice` as its first item, a
415
+ * `SpecificResource` as its `source`, Presentation 4's groups as their items.
416
+ */
417
+ bodies: Array<Record<string, any>>;
418
+ /** `Body`'s children (its controls), to place if the renderer wants them. */
419
+ children?: React.ReactNode;
420
+ }
421
+ export interface BodyRenderer {
422
+ /** Draws a view showing one of these Canvases… */
423
+ canvasId?: string[];
424
+ /** …or painting a body of one of these formats (`model/gltf-binary`, `application/pdf`)… */
425
+ format?: string[];
426
+ /** …or any view this says yes to. */
427
+ match?: (view: Omit<BodyRendererProps, "children">) => boolean;
428
+ /**
429
+ * What draws it. It renders inside the Root, so Clover's hooks work in it
430
+ * (`useActiveCanvas`, `useNavigation`, `useClover`…), as 3.x's `hooks` prop gave.
431
+ */
432
+ component: React.ComponentType<BodyRendererProps>;
433
+ }
434
+ export interface RootProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
435
+ /**
436
+ * What to show: a URL, a IIIF resource (Presentation 2, 3 or 4: a Manifest, Collection
437
+ * or Canvas), or a content state (JSON or base64url).
438
+ */
439
+ iiifContent: IIIFContent;
440
+ /** The Canvas to show, controlled: moving asks `onCanvasChange` to change it. */
441
+ canvasId?: string;
442
+ /** The Canvas to start on, uncontrolled. A content state or `start` still wins. */
443
+ defaultCanvasId?: string;
444
+ /** The reader moved to a Canvas (the first of the view that shows it). */
445
+ onCanvasChange?: (canvasId: string) => void;
446
+ /**
447
+ * In a Collection, the member Manifest to show, controlled: choosing another asks
448
+ * `onManifestChange` to change it.
449
+ */
450
+ manifestId?: string;
451
+ /** In a Collection, the member Manifest to open first, uncontrolled. */
452
+ defaultManifestId?: string;
453
+ /** In a Collection, the reader moved (or, controlled, asks to move) to a Manifest. */
454
+ onManifestChange?: (manifestId: string) => void;
455
+ onStatusChange?: (status: CloverStatus, error: Error | null) => void;
456
+ /**
457
+ * A Content Search query to run once the Manifest is shown, and again whenever it
458
+ * changes (3.x's `iiifContentSearchQuery`). The reader can search on from `Search`.
459
+ */
460
+ searchQuery?: string;
461
+ /** Credentials, headers and `fetch` for every request any part makes. */
462
+ request?: CloverRequest;
463
+ /** The language to read IIIF text in. The reader's, by default. */
464
+ language?: string;
465
+ /**
466
+ * Renderers of your own for some views — by Canvas id, painting format, or a test —
467
+ * drawn by every `Body` inside in place of `Canvas` (3.x's `customDisplays`).
468
+ */
469
+ renderers?: BodyRenderer[];
470
+ /**
471
+ * Annotations to show beside the Manifest's own: an AnnotationPage or
472
+ * AnnotationCollection (or a list of them), as URLs or objects.
473
+ */
474
+ annotations?: AnnotationsInput;
475
+ /**
476
+ * Whose referenced annotation pages to fetch: the view's as the reader moves (default),
477
+ * or every Canvas's at once, for a layout that shows them all.
478
+ */
479
+ annotationPages?: "view" | "all";
480
+ /**
481
+ * Where the reader is, as a IIIF content state, whenever it settles: after a move, a
482
+ * pan or zoom, or a pause or seek in media. Debounced, and only when it changed.
483
+ */
484
+ onContentStateChange?: (state: ContentStateOutput) => void;
485
+ /** The element to render. Default `div`. */
486
+ as?: React.ElementType;
487
+ children?: React.ReactNode;
488
+ }
489
+ /**
490
+ * The root of any Clover composition. It loads `iiifContent`, holds where the reader is,
491
+ * and gives every part inside it the same state. Render parts — `Clover.Body`,
492
+ * `Clover.Label`, `Clover.Items` — anywhere within it, in any layout.
493
+ */
494
+ export declare const Root: React.ForwardRefExoticComponent<RootProps & React.RefAttributes<HTMLElement>>;
495
+ export interface Point {
496
+ x: number;
497
+ y: number;
498
+ }
499
+ /** An axis-aligned rectangle in whatever space the caller is working in. */
500
+ export interface Rect {
501
+ x: number;
502
+ y: number;
503
+ width: number;
504
+ height: number;
505
+ }
506
+ export type BackendKind = "webgl2" | "canvas2d" | "none";
507
+ /**
508
+ * Where the camera looks, in world units.
509
+ *
510
+ * - `x`, `y`: the world point at the center of the viewport.
511
+ * - `zoom`: CSS pixels per world unit.
512
+ * - `rotation`: radians, clockwise on screen.
513
+ *
514
+ * World units are the pixels of the first image in the scene, so for a single image
515
+ * "world" and "image" coordinates are the same thing — which is what a content-state
516
+ * `xywh=` fragment wants.
517
+ */
518
+ export interface CameraState {
519
+ x: number;
520
+ y: number;
521
+ zoom: number;
522
+ rotation: number;
523
+ }
524
+ export interface GestureOptions {
525
+ /**
526
+ * A mouse click zooms in; with Shift, out. With this or `dblClickToZoom`, a double tap
527
+ * (a finger, or a pen that does not hover) zooms in.
528
+ */
529
+ clickToZoom: boolean;
530
+ /** A double click zooms in. Only consulted when `clickToZoom` is off. */
531
+ dblClickToZoom: boolean;
532
+ pinchToZoom: boolean;
533
+ /**
534
+ * Plain wheel zooms. Off by default, matching Clover's OpenSeadragon setting, so an
535
+ * embedded viewer never swallows page scroll. A trackpad pinch (a wheel event with
536
+ * `ctrlKey`) always zooms the image, since it is never a page scroll.
537
+ */
538
+ scrollToZoom: boolean;
539
+ /**
540
+ * The reader may move the camera at all: drag, pinch, wheel, double-click and keys.
541
+ * Off, the view stays where the host puts it and only taps are reported (a lone video
542
+ * or sound, always fitted to the Body).
543
+ */
544
+ navigable: boolean;
545
+ }
546
+ export type BackendPreference = "auto" | BackendKind;
547
+ export type CanvasRendererEvent =
548
+ /** The first set of images is laid out and fitted. Fires once. */
549
+ "open"
550
+ /** The camera moved. Fires at most once per frame. */
551
+ | "viewport"
552
+ /** A new set of images replaced the previous one. */
553
+ | "change" | "error"
554
+ /** The backend changed (fallback, or a context released and reacquired). */
555
+ | "backend"
556
+ /** A click that is not a zoom, with click-to-zoom turned off. */
557
+ | "tap";
558
+ /**
559
+ * Manifest-level layout: which Canvases of a sequence are shown together.
560
+ *
561
+ * This is the host's decision — a Viewer stepping through a Manifest — not `Canvas`'s.
562
+ * `Canvas` draws whatever Canvases it is handed; a host uses this to decide what to hand
563
+ * it from the Manifest's `behavior`, and steps through the result itself.
564
+ *
565
+ * @see https://iiif.io/api/presentation/3.0/#behavior
566
+ */
567
+ /** The order to lay several Canvases out in, along their reading axis. */
568
+ export type ViewingDirection = "left-to-right" | "right-to-left" | "top-to-bottom" | "bottom-to-top";
569
+ /** The spec's default is `left-to-right`. */
570
+ export declare function resolveDirection(declared: unknown): ViewingDirection;
571
+ /** The behaviors that arrange a sequence. Other behaviors do not affect layout. */
572
+ export type SequenceBehavior = "individuals" | "paged" | "continuous" | "unordered";
573
+ /** The Canvases shown together, as indexes into the sequence. */
574
+ export type View = number[];
575
+ /**
576
+ * The layout behavior to use: the first recognized layout value, so a `behavior` array
577
+ * may carry values from other sets (`auto-advance`, `hidden`) alongside it. The spec's
578
+ * default is `individuals`.
579
+ */
580
+ export declare function resolveBehavior(declared: unknown): SequenceBehavior;
581
+ /**
582
+ * Group a sequence into views.
583
+ *
584
+ * - `individuals` and `unordered`: one Canvas per view.
585
+ * - `continuous`: every Canvas in one view, a single joined object.
586
+ * - `paged`: spreads. The first Canvas stands alone (a cover), as does any Canvas whose
587
+ * own behavior is `facing-pages` (it is already a spread) or `non-paged` (never
588
+ * paired); the rest pair up. These are `@iiif/helpers`' `getManifestSequence` rules,
589
+ * which the Viewer uses, so the two never disagree about what a spread is.
590
+ */
591
+ export declare function groupViews(canvases: Array<{
592
+ behavior?: unknown;
593
+ }>, behavior: SequenceBehavior): View[];
594
+ /** A region of the image as shares of it: 0 to 1 across and down. */
595
+ export interface RegionShare {
596
+ x: number;
597
+ y: number;
598
+ width: number;
599
+ height: number;
600
+ }
601
+ /**
602
+ * A small picture of a IIIF resource, for a list or a strip of them.
603
+ *
604
+ * - The resource's own `thumbnail` comes first; then, for a Canvas, the first image it
605
+ * paints; then its placeholder or accompanying Canvas's (video and sound).
606
+ * - An image service is asked for nothing until its own `info.json` has been read (the
607
+ * renderer's cached fetch, so a Canvas shown later does not ask again), and then only
608
+ * as strictly as it says it can answer (`sizedImageUrl`): never more than the image has,
609
+ * nor than its limits, at level 0 only a size it lists (Mat, 2026-10-24: "be
610
+ * responsible when making IIIF image server requests"). What a manifest says of a
611
+ * service is not trusted to say what its server does.
612
+ * - Without a service, the image itself is used.
613
+ */
614
+ export interface ThumbnailSource {
615
+ /** Ready to use: an image with no service. */
616
+ src?: string;
617
+ /** An image service: its `info.json` is read before a URL is made (`resolveThumbnail`). */
618
+ service?: string;
619
+ /**
620
+ * Only part of the image: shares of it (a target's region), or a region in Image API
621
+ * syntax in the service's own pixels (a painting's selector), read against its `info.json`.
622
+ */
623
+ region?: RegionShare | string;
624
+ /** Used if the service cannot answer. */
625
+ fallback?: string;
626
+ }
627
+ /**
628
+ * Where a resource's thumbnail comes from, to be sized by `resolveThumbnail`. Null if it
629
+ * has nothing to show.
630
+ */
631
+ export declare function thumbnailSource(resource: unknown): ThumbnailSource | null;
632
+ /**
633
+ * A picture to stand in for a Canvas as large as it is drawn, to be sized by
634
+ * `resolveThumbnail`: the first image it paints first, then its placeholder's or
635
+ * accompanying Canvas's, and only then its own `thumbnail`, which is often small. Null if
636
+ * it has nothing to show.
637
+ */
638
+ export declare function stillSource(resource: unknown): ThumbnailSource | null;
639
+ /**
640
+ * A source's URL at about `size` pixels on its longer side: a service's, made from its own
641
+ * `info.json` (`sizedImageUrl`), else the fallback, as where the service cannot answer.
642
+ */
643
+ export declare function resolveThumbnail(source: ThumbnailSource, size?: number, request?: CloverRequest): Promise<string | undefined>;
644
+ /**
645
+ * What `Canvas` draws: the IIIF Canvases it is handed, each with the images, video and
646
+ * sound it paints.
647
+ *
648
+ * Pure and React-free. It reads Presentation 4 Canvases and Timelines (Clover's one data
649
+ * shape; see `core/presentation.ts`), with their annotation pages embedded, and turns them
650
+ * into scene images placed in the world. Which Canvases to hand over — one, or a spread —
651
+ * is the host's decision; see `core/sequence.ts`.
652
+ */
653
+ /** The parts of a Presentation 4 Canvas (or Timeline) this module reads. */
654
+ export interface IIIFCanvas {
655
+ id: string;
656
+ type?: string;
657
+ width?: number;
658
+ height?: number;
659
+ behavior?: string[] | string;
660
+ label?: unknown;
661
+ /** Descriptive text and label/value pairs, shown from the Canvas's information control. */
662
+ summary?: unknown;
663
+ metadata?: Array<{
664
+ label?: unknown;
665
+ value?: unknown;
666
+ }>;
667
+ /** Seconds, on a time-based Canvas. */
668
+ duration?: number;
669
+ items?: Array<{
670
+ items?: Array<IIIFAnnotation>;
671
+ }>;
672
+ /** Non-painting annotations, embedded: captions are `supplementing` WebVTT here. */
673
+ annotations?: Array<{
674
+ items?: Array<IIIFAnnotation>;
675
+ }>;
676
+ /** Other forms of it: a transcript as plain text, among them. */
677
+ rendering?: unknown;
678
+ /** Shown before the Canvas is opened, and before playback begins. */
679
+ placeholderContainer?: IIIFCanvas;
680
+ /** Shown while sound plays, which has no picture of its own. */
681
+ accompanyingContainer?: IIIFCanvas;
682
+ }
683
+ export interface IIIFAnnotation {
684
+ id?: string;
685
+ motivation?: string | string[];
686
+ body?: unknown;
687
+ target?: unknown;
688
+ }
689
+ /**
690
+ * Where a `linking` annotation leads (Cookbook 0022): its first body that is not text. A
691
+ * Canvas, with the Manifest its `partOf` names; a Manifest or Collection; or a web page.
692
+ */
693
+ export interface AnnotationLink {
694
+ /** Its address: the Canvas's or Manifest's id, or the page's. */
695
+ id: string;
696
+ canvasId?: string;
697
+ manifestId?: string;
698
+ }
699
+ export interface CanvasAnnotation {
700
+ annotation: Annotation;
701
+ /** Which image in the scene the annotation targets (its index in `body`/`src`). */
702
+ targetIndex: number;
703
+ /** Its AnnotationPage's `label`, which the menu and a recording's cues show it under. */
704
+ pageLabel?: LanguageMapLike;
705
+ /** Its AnnotationPage's `id`, by which the menu hides its page (`hiddenPages`). */
706
+ pageId?: string;
707
+ }
708
+ /**
709
+ * Everything a control needs in order to work, ready to spread onto a button: the id, the
710
+ * accessible name, the click handler and the icon. Spreading `buttonProps` keeps the wiring
711
+ * while the element, its shape and its styling stay the consumer's.
712
+ */
713
+ export type ControlButtonProps = {
714
+ buttonProps: {
715
+ id: string;
716
+ type: "button";
717
+ "aria-label": string;
718
+ /**
719
+ * The language of the name, when it is not the page's: a Choice's own label, or one
720
+ * of Clover's strings in another language. Spread it with the rest (WCAG 3.1.2).
721
+ */
722
+ lang?: string;
723
+ /** The key the Canvas answers to for this control, when it has one. */
724
+ "aria-keyshortcuts"?: string;
725
+ onClick?: React.MouseEventHandler<HTMLButtonElement>;
726
+ /** On a control that opens a menu (the Choice control): its state and target. */
727
+ "aria-expanded"?: boolean;
728
+ "aria-controls"?: string;
729
+ };
730
+ icon: React.ReactNode;
731
+ label: string;
732
+ /**
733
+ * The popover Clover's own controls show on hover and focus: the name, and the key when
734
+ * there is one. Render it inside your button, last, to keep it.
735
+ */
736
+ tip: React.ReactNode;
737
+ };
738
+ /**
739
+ * Replacements for the controls over a Canvas. Each key is optional, so a consumer can
740
+ * override one control and leave the rest as they are. A replacement owns the whole
741
+ * button, not just the glyph, so it can change shape as well as appearance.
742
+ */
743
+ export type ControlButtons = {
744
+ zoomIn?: React.ComponentType<ControlButtonProps>;
745
+ zoomOut?: React.ComponentType<ControlButtonProps>;
746
+ fullPage?: React.ComponentType<ControlButtonProps>;
747
+ rotateRight?: React.ComponentType<ControlButtonProps>;
748
+ rotateLeft?: React.ComponentType<ControlButtonProps>;
749
+ /** A Scene's: its models turned up, or down, about the horizontal axis. */
750
+ rotateUp?: React.ComponentType<ControlButtonProps>;
751
+ rotateDown?: React.ComponentType<ControlButtonProps>;
752
+ reset?: React.ComponentType<ControlButtonProps>;
753
+ choice?: React.ComponentType<ControlButtonProps>;
754
+ };
755
+ /** A painting body as `body` takes it: a web resource that may carry a `label`. */
756
+ export interface LabeledIIIFExternalWebResource extends IIIFExternalWebResource {
757
+ label?: InternationalString;
758
+ region?: string;
759
+ }
760
+ /** Which controls to show. All are on by default, as in `Image`. */
761
+ export interface CanvasControlsConfig {
762
+ zoom?: boolean;
763
+ fullPage?: boolean;
764
+ rotation?: boolean;
765
+ reset?: boolean;
766
+ /**
767
+ * A control listing the `annotations` by their text; picking one zooms to it. Shown
768
+ * only when some annotation can be drawn.
769
+ */
770
+ annotations?: boolean;
771
+ /**
772
+ * An `i` control that slides out the Canvases' `summary` and `metadata` as a caption.
773
+ * Shown only when a Canvas has either.
774
+ */
775
+ information?: boolean;
776
+ }
777
+ export interface CloverCanvasOptions {
778
+ /** Which painter to use. `auto` (default) tries WebGL2, then Canvas2D. */
779
+ backend?: BackendPreference;
780
+ /** Pointer, wheel and keyboard behavior. Wheel zoom is off by default. */
781
+ gestures?: Partial<GestureOptions>;
782
+ /** Largest zoom, in CSS pixels per image pixel. Default 1.1. */
783
+ maxZoomPixelRatio?: number;
784
+ /** Smallest zoom, as a fraction of the home zoom. Default 0.9. */
785
+ minZoomImageRatio?: number;
786
+ /** Seconds for an animation to close most of its distance. 0 disables easing. */
787
+ animationTime?: number;
788
+ /**
789
+ * Milliseconds the controls and navigator stay after a mouse (or a pen that hovers)
790
+ * stops moving, as the Player's `hideDelay`. Default 2000; `Infinity` keeps them once
791
+ * shown. A finger, or a pen that does not hover, has no timer: a tap on the picture
792
+ * shows them, and another hides them. Focus that no press brought holds them too.
793
+ */
794
+ hideDelay?: number;
795
+ /** A time-based Canvas's video or sound. */
796
+ /**
797
+ * An animation Canvas (painting annotations at `#t=` times, one per frame): play on
798
+ * arrival, and loop at the end (the reader can turn looping off and on). Inside a `Root`,
799
+ * `auto-advance` and `repeat` behaviors set them, and a Manifest's `auto-advance` moves
800
+ * on when a non-looping animation ends (`onEnded`, as for video). Neither by default; a
801
+ * reader asking for reduced motion is never autoplayed.
802
+ */
803
+ animation?: {
804
+ autoplay?: boolean;
805
+ loop?: boolean;
806
+ };
807
+ /**
808
+ * Credentials, headers and a custom `fetch` for every request the Canvas makes:
809
+ * `info.json`, tiles, captions and HLS. A `<video>` or an image without CORS can only
810
+ * send credentials. Inside a `Root`, the Root's `request` is used.
811
+ */
812
+ request?: CloverRequest;
813
+ }
814
+ /**
815
+ * Imperative control over a mounted `Canvas`, handed to `onReady`. Coordinates are world
816
+ * units — the pixels of the first image — so `getBounds()` is directly an `xywh=` region.
817
+ */
818
+ export interface CanvasHandle {
819
+ readonly backendKind: BackendKind;
820
+ /**
821
+ * Whether the view is at home, fitted whole: false once the reader zooms, pans or turns
822
+ * it, true again on `home()`. A resize keeps it, refitting home. Read it on `viewport`.
823
+ */
824
+ readonly atHome: boolean;
825
+ fitBounds(bounds: Rect, immediate?: boolean): void;
826
+ /** Zoom to a rectangle in image `index`'s own coordinates, padded as `Image` pads. */
827
+ fitItemRect(index: number, rect: Rect, immediate?: boolean): void;
828
+ /** A rectangle in image `index`'s own coordinates, in world units. */
829
+ itemRectToWorld(index: number, rect: Rect): Rect | null;
830
+ getBounds(): Rect;
831
+ getHomeBounds(): Rect | null;
832
+ getCamera(): CameraState;
833
+ home(immediate?: boolean): void;
834
+ zoomBy(factor: number, at?: Point, animate?: boolean): void;
835
+ panBy(dx: number, dy: number, animate?: boolean): void;
836
+ /** Degrees, clockwise. */
837
+ setRotation(degrees: number, immediate?: boolean): void;
838
+ getRotation(): number;
839
+ rotateBy(degrees: number): void;
840
+ worldToScreenPoint(point: Point): Point;
841
+ screenToWorldPoint(point: Point): Point;
842
+ on(event: CanvasRendererEvent, listener: (detail?: unknown) => void): () => void;
843
+ /**
844
+ * Zoom to an annotation's hotspot, as picking it does, and focus it. False while there
845
+ * is no hotspot for that id (not among `annotations`, or not yet placed).
846
+ */
847
+ zoomToAnnotation(id: string): boolean;
848
+ /**
849
+ * Frame a rectangle in one shown Canvas's own coordinates (an `xywh=` region of it).
850
+ * False while that Canvas is not laid out yet.
851
+ */
852
+ fitCanvasRect(canvasId: string, rect: Rect, immediate?: boolean): boolean;
853
+ /**
854
+ * The visible part of whichever shown Canvas fills most of the view, in its own
855
+ * coordinates: what a content state or a share link records. Null before layout.
856
+ */
857
+ getCanvasRegion(): {
858
+ canvasId: string;
859
+ rect: Rect;
860
+ } | null;
861
+ }
862
+ export interface CloverCanvasProps {
863
+ /**
864
+ * Presentation 4 Canvases (or Timelines) to draw: one, or several shown together (a
865
+ * spread). Each one's painting annotations are composed at their targets. Upgrade
866
+ * Presentation 2 or 3 with `toPresentation4()` first. Inside a `Root`, leave this (and
867
+ * `body` and `src`) out and the Canvas shows the Root's current view.
868
+ */
869
+ canvases?: IIIFCanvas[];
870
+ /**
871
+ * A Canvas to load and draw, on its own, outside any `Root`: a URL or an object, in any
872
+ * Presentation version (upgraded as it loads), fetched with `options.request`. A
873
+ * Manifest gives its first Canvas. Nothing is drawn until it arrives, or if it will
874
+ * not load. Takes precedence over the Root's view, as `canvases` does.
875
+ */
876
+ iiifContent?: string | Record<string, unknown>;
877
+ /** How to lay out several Canvases: in reading order along this direction. */
878
+ viewingDirection?: ViewingDirection;
879
+ /** IIIF painting bodies (Image resources). Takes precedence over `src`. */
880
+ body?: LabeledIIIFExternalWebResource | LabeledIIIFExternalWebResource[];
881
+ /** Plain image URLs — or, with `isTiledImage`, image service URIs. */
882
+ src?: string | string[];
883
+ /** Treat each `src` as a IIIF Image API service (its base URI or `info.json`). */
884
+ isTiledImage?: boolean;
885
+ /** Accessible name for the viewport. */
886
+ label?: InternationalString | string;
887
+ /**
888
+ * What the view is part of, named under its title where a lone recording plays as a
889
+ * player: the Manifest's label, by default, inside a `Root` or given `iiifContent`.
890
+ */
891
+ partOf?: InternationalString | string;
892
+ /**
893
+ * The language to read IIIF text in: labels, Choices, annotations. The reader's, by
894
+ * default; inside a `Root`, the Root's.
895
+ */
896
+ language?: string;
897
+ /** Stable id for this instance. A new id remounts the renderer. */
898
+ instanceId?: string;
899
+ className?: string;
900
+ options?: CloverCanvasOptions;
901
+ /**
902
+ * Show an overview of the whole image with the visible region outlined; press or drag
903
+ * in it to move there. Off by default; never shown for a Canvas of video or sound.
904
+ */
905
+ navigator?: boolean;
906
+ /**
907
+ * Show the control cluster (`true`, the default), none (`false`), or some. Without the
908
+ * zoom and reset controls, one pointer can still zoom back out: at the largest zoom, a
909
+ * click or a double tap goes home. With the click zooms off as well (`gestures`), a
910
+ * pinch is the only zoom left on touch, so give the reader one of your own, through
911
+ * the handle `onReady` passes (`home()`, `zoomBy(0.5)`) (WCAG 2.5.1).
912
+ */
913
+ controls?: boolean | CanvasControlsConfig;
914
+ /** Replace any control with your own component — the `Viewer`'s `controlButtons`. */
915
+ controlButtons?: ControlButtons;
916
+ /**
917
+ * Annotations to draw as hotspots, as `Image` takes them. Only rectangular (`xywh`)
918
+ * targets are drawn; coordinates are the target image's own.
919
+ */
920
+ annotations?: CanvasAnnotation[];
921
+ /**
922
+ * The AnnotationPages (each annotation's `pageId`) whose annotations are hidden: none
923
+ * of them is drawn, but the annotations menu still lists them under their page, with
924
+ * its hide toggle, to show them again. Leave it out for the Canvas to keep its own.
925
+ */
926
+ hiddenPages?: string[];
927
+ /**
928
+ * AnnotationPages drawn (while not hidden) but never offered in the annotations menu,
929
+ * as the Annotations list leaves them out: a search's hits, which Search lists, and a
930
+ * still Canvas's OCR, which a search finds in. Leave it out for the Canvas to keep its
931
+ * own OCR out.
932
+ */
933
+ unlistedPages?: string[];
934
+ /** The reader hid AnnotationPages from the picture (`visible` false), or showed them. */
935
+ onPageVisibilityChange?: (pageIds: string[], visible: boolean) => void;
936
+ /** The hovered or focused annotation's id, or null when none is. */
937
+ onAnnotationActive?: (id: string | null) => void;
938
+ /**
939
+ * The picked annotation, controlled. A new id is framed once its hotspot is placed;
940
+ * `null` clears the pick. Leave it out for the Canvas to keep its own.
941
+ */
942
+ selectedAnnotation?: string | null;
943
+ /**
944
+ * Glide to a picked annotation, as the camera eases to anywhere else, rather than
945
+ * framing it at once. Default `false`: an annotation picked on the Canvas, in a list
946
+ * beside it or by a link is framed in one cut, once its view is drawn. A reader who
947
+ * asks for reduced motion gets the cut either way.
948
+ */
949
+ animateAnnotations?: boolean;
950
+ /** An annotation to highlight, as hovering it in a list beside the Canvas does. */
951
+ highlightedAnnotation?: string | null;
952
+ /**
953
+ * A hotspot (or the annotations menu) picked an annotation; `null` when the reader let
954
+ * it go, by a click or tap off it on the Canvas, or Escape.
955
+ */
956
+ onAnnotationSelect?: (id: string | null) => void;
957
+ /**
958
+ * A linking annotation's hotspot pressed (Cookbook 0022), leading to a Canvas or a
959
+ * Manifest: show it. Inside a `Root`, or loading its own (`iiifContent`), the Canvas
960
+ * shows it itself unless you take this; otherwise, without it, the hotspot is picked as
961
+ * any other. A link to a web page is a link, and opens the page in a new tab.
962
+ */
963
+ onAnnotationLink?: (link: AnnotationLink) => void;
964
+ /** Called once, when the first images are laid out and fitted. */
965
+ onReady?: (handle: CanvasHandle) => void;
966
+ /**
967
+ * The id of the Manifest these Canvases are from. When it changes (another of a
968
+ * Collection's members, say) the Canvas is cleared at once, so the last Manifest's
969
+ * images never show beside the next one's while those load. Within one Manifest,
970
+ * moving from Canvas to Canvas keeps the last one drawn until the next is ready, so a
971
+ * page turn never flashes empty.
972
+ */
973
+ manifestId?: string;
974
+ /** The visible world rectangle, at most once per frame while the camera moves. */
975
+ onViewportChange?: (bounds: Rect) => void;
976
+ /**
977
+ * A time-based Canvas's media element once it exists, and `null` when it goes: for a
978
+ * host's own transcript, chapters or `#t=` seeks. Sound plays through a `<video>` too.
979
+ */
980
+ onMediaElement?: (element: HTMLVideoElement | null) => void;
981
+ /**
982
+ * The reader chose a caption track in the Canvas's own Captions menu: the Manifest's
983
+ * caption file (its `id`, the WebVTT's address, and the `language` of its cues), or
984
+ * `null` for Off or a track the media carries itself. For a host's own transcript to
985
+ * follow, as Clover's `Transcript` does.
986
+ */
987
+ onCaptionChange?: (caption: {
988
+ id: string;
989
+ language?: string;
990
+ } | null) => void;
991
+ /**
992
+ * Which of the Manifest's caption files to show while captions are on, by its `id`:
993
+ * for a host's own transcript to lead the captions' language as well as follow it
994
+ * (`onCaptionChange`). It changes the track shown, never whether one shows: Off stays
995
+ * off. Inside a `Root` the Canvas takes it from the Root, which Clover's `Transcript`
996
+ * sets.
997
+ */
998
+ caption?: string | null;
999
+ /** Playback reached the end — a host's cue to move to the next Canvas. */
1000
+ onEnded?: () => void;
1001
+ /**
1002
+ * Chapters of the Canvas's video or sound: marked on the seek bar, listed in a menu, and
1003
+ * named beside the time. Inside a `Root`, they come from the Manifest's Ranges. `lang`
1004
+ * is the language a label is written in, set on it where it shows.
1005
+ */
1006
+ chapters?: Array<{
1007
+ /** Its own id (a Range's), by which `highlightedChapter` names it. */
1008
+ id?: string;
1009
+ label: string;
1010
+ lang?: string;
1011
+ start: number;
1012
+ end?: number;
1013
+ }>;
1014
+ /** A chapter (by its `id`) to mark on the seek bar, as hovering it in a list does. */
1015
+ highlightedChapter?: string | null;
1016
+ /** The chapter under the pointer on the seek bar (its `id`), or null as it leaves. */
1017
+ onChapterHighlight?: (id: string | null) => void;
1018
+ /**
1019
+ * Show a Canvas's `placeholderContainer` first (the default). `false` opens the Canvas
1020
+ * straight away, as a host does when a link or content state points into it.
1021
+ */
1022
+ placeholder?: boolean;
1023
+ /** Rendered after the controls in the cluster: a host's own controls. */
1024
+ children?: ReactNode;
1025
+ }
1026
+ export type BodyProps = Omit<CloverCanvasProps, "canvases" | "body" | "src" | "isTiledImage" | "viewingDirection"> & {
1027
+ /** Props for the wrapping element, which gives the Body its size. */
1028
+ style?: React.CSSProperties;
1029
+ /** Renderers for this Body only; the Root's (`renderers` on `Root`) otherwise. */
1030
+ renderers?: BodyRenderer[];
1031
+ };
1032
+ /**
1033
+ * The current view of the Root, drawn by the part for its container: `Canvas` (images,
1034
+ * video), `Timeline` (sound) or `Scene` (3D), as Presentation 4 names them; or by a
1035
+ * renderer of your own that claims the view (by Canvas id, painting format or a test,
1036
+ * from `renderers` here or on the `Root`), which goes first. Children become controls in
1037
+ * the cluster, or are handed to the renderer.
1038
+ *
1039
+ * The Body needs a height to draw into. It is set inline, so it holds without the
1040
+ * stylesheet, through `--clover-body-height` (default `60vh`): set that property to
1041
+ * size it, `100%` to fill a sized parent.
1042
+ *
1043
+ * While the Root loads (the first Manifest, or the next one chosen) the Body is busy and
1044
+ * shows Clover's loading mark, a line along its top edge, over what it still shows; it
1045
+ * keeps its size and its background, so nothing moves.
1046
+ */
1047
+ export declare function Body({ className, style, renderers, children, ...canvas }: BodyProps): React.JSX.Element;
1048
+ export interface LabelProps extends Omit<React.HTMLAttributes<HTMLElement>, "lang"> {
1049
+ /** Whose label: the Manifest's (the default), or the current Canvas's. */
1050
+ of?: "manifest" | "canvas";
1051
+ /** A label to show instead of the Root's. Outside a `Root`, the label to show. */
1052
+ label?: LanguageMapLike;
1053
+ /** The element to render, such as `h1`. Default `span`. */
1054
+ as?: React.ElementType;
1055
+ }
1056
+ /**
1057
+ * A label, in the Root's language and marked with the language it is in: the Manifest's,
1058
+ * the Canvas's, or inside a `Provider` the provider's name. Renders nothing while there is
1059
+ * none.
1060
+ */
1061
+ export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLElement>>;
1062
+ /** What the pieces step through inside a Root: its views, or its Collection's members. */
1063
+ export type StepsOf = "views" | "members";
1064
+ export type ButtonProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "type" | "children">;
1065
+ export interface StepProps extends ButtonProps {
1066
+ /** What it steps through: the Root's views (default), or its Collection's members. */
1067
+ of?: StepsOf;
1068
+ }
1069
+ /** Go to the previous item. `aria-disabled` on the first. */
1070
+ export declare const Previous: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLButtonElement>>;
1071
+ /** Go to the next item. `aria-disabled` on the last. */
1072
+ export declare const Next: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLButtonElement>>;
1073
+ export interface PositionProps extends React.HTMLAttributes<HTMLElement> {
1074
+ /** What it counts: the Root's views (default), or its Collection's members. */
1075
+ of?: StepsOf;
1076
+ as?: React.ElementType;
1077
+ }
1078
+ /**
1079
+ * Where the reader is, counted in items: "2 / 5", the same in every language. Assistive
1080
+ * technology reads the sentence instead, "Item 2 of 5" in the reader's language, which a
1081
+ * bare slash would leave to guesswork.
1082
+ */
1083
+ export declare const Position: React.ForwardRefExoticComponent<PositionProps & React.RefAttributes<HTMLElement>>;
1084
+ /**
1085
+ * What `Items` shows: light models of a Manifest's views or a Collection's members, never
1086
+ * the resources themselves, so a long sequence costs a few fields per item.
1087
+ *
1088
+ * Memoized on the resource object, as the selectors are.
1089
+ */
1090
+ export interface ItemPart {
1091
+ id: string;
1092
+ type: string;
1093
+ label?: LanguageMapLike;
1094
+ /** The resource, for a thumbnail and for `renderItem`. */
1095
+ resource: unknown;
1096
+ /** Seconds, for video and sound. */
1097
+ duration?: number;
1098
+ /** What it mostly paints: `Image`, `Video`, `Audio` (`Sound` in Presentation 3) or `Model`. */
1099
+ media?: string;
1100
+ }
1101
+ export interface ItemModel {
1102
+ /** The first Canvas of a view, or a member's id. What selecting it goes to. */
1103
+ id: string;
1104
+ /** A Canvas view: one Canvas, or a spread. A member: itself. */
1105
+ parts: ItemPart[];
1106
+ label?: LanguageMapLike;
1107
+ summary?: LanguageMapLike;
1108
+ /** Where a link to a member goes: its `homepage`, else its id. */
1109
+ href?: string;
1110
+ }
1111
+ /**
1112
+ * A scrolling row of thumbnails (`slider`), a column, a wrapping grid, or one item at a
1113
+ * time (`pager`: Previous, Position and Next).
1114
+ */
1115
+ export type ItemsLayout = "slider" | "list" | "grid" | "pager";
1116
+ export interface ItemsProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "children"> {
1117
+ /**
1118
+ * A scrolling row (the default), a column, a wrapping grid, or `pager`: Previous,
1119
+ * Position and Next, stepping one item at a time, with no thumbnails.
1120
+ */
1121
+ layout?: ItemsLayout;
1122
+ /**
1123
+ * Inside a `Root`: the Manifest's views (default), or the members of the Collection it
1124
+ * belongs to, choosing one to show.
1125
+ */
1126
+ of?: "views" | "members";
1127
+ /**
1128
+ * Standalone: a Collection (its members), a Manifest (its views) or a URL to one. Inside
1129
+ * a `Root`, leave it out to list the Root's views.
1130
+ */
1131
+ iiifContent?: IIIFContent;
1132
+ /** Standalone: a list of IIIF resources (Manifests, Collections, Canvases) as they are. */
1133
+ items?: unknown[];
1134
+ /**
1135
+ * `id` selects: a listbox whose options go to a view (in a `Root`). `homepage` leaves: a
1136
+ * list of links to each item's `homepage`. Defaults to `id` for views and `homepage`
1137
+ * for a Collection's members or a list.
1138
+ */
1139
+ navigation?: "id" | "homepage";
1140
+ /**
1141
+ * An item was chosen, with the click's or the key's own event. For a link, call
1142
+ * `event.preventDefault()` to stay on the page and handle it yourself.
1143
+ */
1144
+ onSelect?: (item: ItemModel, event: React.SyntheticEvent) => void;
1145
+ /** Standalone: show the resource's label, summary and homepage link. Default true. */
1146
+ header?: boolean;
1147
+ /**
1148
+ * Standalone: the level of the header's title, to fit the outline of the page around
1149
+ * it (a slider under an `h2` takes 3). Default 2.
1150
+ */
1151
+ headingLevel?: number;
1152
+ /** Pixels requested for each thumbnail's longer side. Default 200. */
1153
+ thumbnailSize?: number;
1154
+ /** Standalone: credentials, headers and `fetch`. In a `Root`, the Root's are used. */
1155
+ request?: CloverRequest;
1156
+ /** Standalone: the language to read IIIF text in. */
1157
+ language?: string;
1158
+ /** Replace an item's figure with your own. */
1159
+ renderItem?: (item: ItemModel, state: {
1160
+ selected: boolean;
1161
+ }) => React.ReactNode;
1162
+ as?: React.ElementType;
1163
+ }
1164
+ /**
1165
+ * Thumbnails of a sequence: the views of a Manifest, or the members of a Collection.
1166
+ * The successor to 3.x's `Slider` and the Viewer's thumbnail rail.
1167
+ *
1168
+ * - **Inside a `Root`**, a single-select listbox of the Root's views (a spread is one
1169
+ * item). One tab stop; arrows move, Enter or Space selects; the selection follows the
1170
+ * pager and stays in view.
1171
+ * - **Standalone**, a list of links to each item's `homepage` — a Collection slider.
1172
+ *
1173
+ * The slider is the browser's own scrolling with CSS snap points: wheel, trackpad,
1174
+ * touch and keyboard all work, and a mouse can drag it.
1175
+ */
1176
+ export declare const Items: React.ForwardRefExoticComponent<ItemsProps & React.RefAttributes<HTMLElement>>;
1177
+ export interface StatusProps {
1178
+ className?: string;
1179
+ /**
1180
+ * Shown while loading. Default: Clover's loading mark (three pulsing dots), announced
1181
+ * as a translated "Loading…". `false` shows nothing and only announces it, for a
1182
+ * layout with a `Body`, which shows its own loading, so nothing moves.
1183
+ */
1184
+ loading?: React.ReactNode;
1185
+ /** Shown when loading failed. Default: a translated message and the error's own. */
1186
+ error?: (error: Error) => React.ReactNode;
1187
+ }
1188
+ /**
1189
+ * Loading and error states, announced: a `role="status"` region while loading and
1190
+ * `role="alert"` on failure. The region stays for the Status's whole life, empty and out
1191
+ * of sight once the content is ready, and only its words change: many screen readers
1192
+ * announce words put into a region already there, but not a region inserted with them
1193
+ * (WCAG 4.1.3).
1194
+ */
1195
+ export declare function Status({ className, loading, error: renderError, }: StatusProps): React.JSX.Element;
1196
+ /** Whose property a part reads: the Root's Manifest, or the Canvas in view. */
1197
+ export type Of = "manifest" | "canvas";
1198
+ export type Json = Record<string, any>;
1199
+ /** The provider a part is drawn for, inside `Provider`; null outside one. */
1200
+ export declare const useProvider: () => Json | null;
1201
+ export interface PartProps<Value> extends Omit<React.HTMLAttributes<HTMLElement>, "lang"> {
1202
+ /** Whose property: the Manifest's (default) or the current Canvas's. */
1203
+ of?: Of;
1204
+ /** The element to render. */
1205
+ as?: React.ElementType;
1206
+ /** Show this value instead of the Root's. */
1207
+ value?: Value;
1208
+ }
1209
+ /**
1210
+ * `summary`, as sanitized HTML, cut to five lines, with "Read more" under it when it runs
1211
+ * longer (`ReadMore`). Every summary Clover shows is this part: About's, a Collection's, a
1212
+ * Canvas's in its information box.
1213
+ *
1214
+ * The number of lines is a CSS custom property, `--clover-summary-lines` (default `5`),
1215
+ * set on `.clover-summary` or on any element around it; `none` shows it whole.
1216
+ *
1217
+ * ```css
1218
+ * .my-layout .clover-summary {
1219
+ * --clover-summary-lines: 3;
1220
+ * }
1221
+ * ```
1222
+ */
1223
+ export declare function Summary({ of, as, value, className, ...rest }: PartProps<LanguageMapLike>): React.JSX.Element | null;
1224
+ /**
1225
+ * Any IIIF language map — an annotation's text, a label you hold — in the reader's
1226
+ * language, read strictly by `format` (`readAs`): `text/html` as sanitized HTML,
1227
+ * `text/plain` as written, and none by IIIF's rule (HTML only from `<` to `>`).
1228
+ * `format="text/markdown"` reads Markdown, its lists as lists and its headings as
1229
+ * headings, the first at `headingLevel` (default 3).
1230
+ */
1231
+ export declare function Value({ value, format, headingLevel, as, className, ...rest }: Omit<PartProps<LanguageMapLike>, "of"> & {
1232
+ format?: string;
1233
+ /** With Markdown, the level of its first heading; the rest follow under it. Default 3. */
1234
+ headingLevel?: number;
1235
+ }): React.JSX.Element;
1236
+ /** `metadata`, as a description list of label and value pairs. */
1237
+ export declare function Metadata({ of, value, className, renderValue, ...rest }: Omit<PartProps<MetadataItem[]>, "as"> & {
1238
+ /** Your own rendering of a value; Clover's when it returns undefined. */
1239
+ renderValue?: (item: MetadataItem) => React.ReactNode;
1240
+ }): React.JSX.Element;
1241
+ /** `requiredStatement`: the attribution that must be shown, as a label and value. */
1242
+ export declare function RequiredStatement({ of, value, className, ...rest }: Omit<PartProps<MetadataItem>, "as">): React.JSX.Element;
1243
+ /** `rights`: a link to the license or rights statement. */
1244
+ export declare function Rights({ of, value, className, ...rest }: Omit<PartProps<string>, "as">): React.JSX.Element | null;
1245
+ /** The resource's `id`: a link to its IIIF JSON. */
1246
+ export declare function Id({ of, value, className, ...rest }: Omit<PartProps<string>, "as">): React.JSX.Element | null;
1247
+ export interface LinkedResource {
1248
+ id?: string;
1249
+ label?: LanguageMapLike;
1250
+ format?: string;
1251
+ type?: string;
1252
+ }
1253
+ export type LinksProps = Omit<PartProps<LinkedResource[]>, "as">;
1254
+ /** `homepage`: the resource's own web page. */
1255
+ export declare const Homepage: ({ className, ...props }: LinksProps) => React.JSX.Element;
1256
+ /** `rendering`: alternate formats, such as a PDF of the whole object. */
1257
+ export declare const Rendering: ({ className, ...props }: LinksProps) => React.JSX.Element;
1258
+ /** `seeAlso`: machine-readable descriptions elsewhere. */
1259
+ export declare const SeeAlso: ({ className, ...props }: LinksProps) => React.JSX.Element;
1260
+ /** `partOf`: the Collections the resource belongs to. */
1261
+ export declare const PartOf: ({ className, ...props }: LinksProps) => React.JSX.Element;
1262
+ /**
1263
+ * The resource's `thumbnail` (or, for a Canvas, its first image), at `size` pixels on
1264
+ * the longer side. Its `alt` is the resource's label.
1265
+ */
1266
+ export declare function Thumbnail({ of, value, size, className, ...rest }: Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> & {
1267
+ of?: Of;
1268
+ /** A resource to picture instead of the Root's: a Manifest, Canvas or Collection. */
1269
+ value?: unknown;
1270
+ size?: number;
1271
+ }): React.JSX.Element | null;
1272
+ export interface ProviderProps extends Omit<React.HTMLAttributes<HTMLUListElement>, "lang" | "children"> {
1273
+ /** Whose providers: the Manifest's (default) or the current Canvas's. */
1274
+ of?: Of;
1275
+ /** Providers to show instead of the Root's: an Agent, or a list of them. */
1276
+ value?: unknown;
1277
+ /** Link each provider to its homepage, when it has one. Default `true`. */
1278
+ link?: boolean;
1279
+ /**
1280
+ * What to draw for each provider, inside its link: `Logo`, `Label` and the link parts,
1281
+ * which read that provider, and anything of your own (`useProvider`). Default: its logo
1282
+ * and its name.
1283
+ */
1284
+ children?: React.ReactNode;
1285
+ }
1286
+ /**
1287
+ * `provider`: who provided the resource, each as a list item, its logo and its name
1288
+ * linked to its homepage. A compound part: what it holds is drawn once for each provider,
1289
+ * so `<Provider><Logo /></Provider>` shows each one's logo alone, linked, named for
1290
+ * assistive technology by the provider's name. Renders nothing without a provider.
1291
+ */
1292
+ export declare function Provider({ of, value, link, children, className, ...rest }: ProviderProps): React.JSX.Element | null;
1293
+ export interface LogoProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "src"> {
1294
+ /** Whose providers' logos: the Manifest's (default) or the current Canvas's. */
1295
+ of?: Of;
1296
+ /** Logos to show instead: an image (`{ id, width?, height? }`), an Agent, or a list. */
1297
+ value?: unknown;
1298
+ }
1299
+ /**
1300
+ * `logo`: a provider's logo, the first it gives, at `--clover-logo-height`. Inside a
1301
+ * `Provider`, the logo of the provider it is drawn for; elsewhere, each of the resource's
1302
+ * providers' in turn. Its `alt` is the provider's name (else its homepage's, else "Logo"),
1303
+ * unless one is given; `alt=""` where its name is written beside it. Renders nothing
1304
+ * without a logo, and nothing for a logo that fails to load, never the browser's broken
1305
+ * picture.
1306
+ */
1307
+ export declare function Logo({ of, value, alt, className, ...rest }: LogoProps): React.JSX.Element | null;
1308
+ /** How the sections are laid out. */
1309
+ export type SectionsLayout = "tabs" | "accordion";
1310
+ export interface TabProps {
1311
+ /** Identifies the tab, for `value` / `defaultValue` on the panel. */
1312
+ value: string;
1313
+ /** What the tab says. */
1314
+ label: React.ReactNode;
1315
+ children?: React.ReactNode;
1316
+ }
1317
+ /**
1318
+ * One tab of an `Panel`: its label and what it shows. Anything can go in a
1319
+ * tab — `Clover.About`, your own component reading the Root through hooks — which is how
1320
+ * 3.x's information panel plugins are written now.
1321
+ *
1322
+ * It renders nothing itself: `Panel` reads its props and renders the tab.
1323
+ */
1324
+ export declare const Tab: React.FC<TabProps>;
1325
+ /** How an information panel lays out its sections. */
1326
+ export type PanelLayout = SectionsLayout;
1327
+ export interface PanelProps extends Omit<React.HTMLAttributes<HTMLElement>, "defaultValue"> {
1328
+ /**
1329
+ * `tabs` (the default): a row of tabs, one section shown at a time. `accordion`: the
1330
+ * sections stacked as boxes, each opened by its heading, one always open.
1331
+ */
1332
+ layout?: PanelLayout;
1333
+ /** The tab shown, controlled (`tabs`). */
1334
+ value?: string;
1335
+ /**
1336
+ * The tab shown first (`tabs`), or the box open to start with (`accordion`). Default:
1337
+ * the first.
1338
+ */
1339
+ defaultValue?: string;
1340
+ /** Called with the tab chosen, or the box opened. */
1341
+ onValueChange?: (value: string) => void;
1342
+ /**
1343
+ * The panel can be closed: a close button appears in it. Closing from inside the panel
1344
+ * hands focus back to the control that opens it (whatever has `aria-controls` naming the
1345
+ * panel or an element around it), so focus is never left on something hidden.
1346
+ */
1347
+ onClose?: () => void;
1348
+ /**
1349
+ * The panel floats over the page: Escape inside it closes it too, and its close button
1350
+ * sits at its inner edge (the start, for a panel over the end of the page) rather than
1351
+ * the end of its first row. A panel docked beside the Body needs neither, and is
1352
+ * better without `onClose` at all: the toggle that opens it closes it.
1353
+ */
1354
+ closeOnEscape?: boolean;
1355
+ /**
1356
+ * The level of the sections' headings (`accordion`), one under the heading the panel
1357
+ * belongs to. The default sections' own headings are a level below them; tabs are not
1358
+ * headings, so there they start at this level. Default 3.
1359
+ */
1360
+ headingLevel?: number;
1361
+ /** The element to render. Default `aside`. */
1362
+ as?: React.ElementType;
1363
+ /** Whether the default About lists the downloads (`About`'s `download`). Default `true`. */
1364
+ download?: boolean;
1365
+ /**
1366
+ * `Clover.Tab`s. Without any, the panel has the tabs Clover has data for: About,
1367
+ * Contents when the Manifest has Ranges, Search when it has a Content Search service, a
1368
+ * Map when it (or a Canvas or annotation) has navPlace or a georeference,
1369
+ * a Transcript when the view's media has captions or a plain-text transcript, and
1370
+ * Annotations when there are any.
1371
+ */
1372
+ children?: React.ReactNode;
1373
+ }
1374
+ /**
1375
+ * Information about the Root's resource, in sections: tabs by default, or stacked boxes
1376
+ * with `layout="accordion"`. Its default sections are the ones Clover has data for; give
1377
+ * it `Clover.Tab` children to choose them, in order, including your own (a `Tab` is a
1378
+ * section in either layout):
1379
+ *
1380
+ * ```jsx
1381
+ * <Clover.Panel>
1382
+ * <Clover.Tab value="about" label="About"><Clover.About /></Clover.Tab>
1383
+ * <Clover.Tab value="notes" label="Notes"><MyNotes /></Clover.Tab>
1384
+ * </Clover.Panel>
1385
+ * ```
1386
+ */
1387
+ export declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<HTMLElement>>;
1388
+ export interface AboutProps extends React.HTMLAttributes<HTMLElement> {
1389
+ /** Also show the current Canvas's summary, for Manifests that describe each image. */
1390
+ canvasSummary?: boolean;
1391
+ /**
1392
+ * The heading level for each section's title. Default 3. Past 6 a title is not a
1393
+ * heading, and names its section instead (`ui/heading.ts`).
1394
+ */
1395
+ headingLevel?: number;
1396
+ /** List the downloads, Download's links, in a section of their own. Default `true`. */
1397
+ download?: boolean;
1398
+ /**
1399
+ * The Manifest's thumbnail first, small, at its own shape, floated at the end of the
1400
+ * label's lines, over the summary (Mat, 2026-10-26: "float it right to the side of the
1401
+ * label. and above summary"). Named by the label where there is none beside it, and
1402
+ * decorative where there is. Default `true`.
1403
+ */
1404
+ thumbnail?: boolean;
1405
+ /**
1406
+ * The resource's label again, as a heading at `headingLevel`, over what About says of
1407
+ * it (Mat, 2026-10-26: "repeat label as a heading"). Default `true`.
1408
+ */
1409
+ label?: boolean;
1410
+ }
1411
+ /**
1412
+ * Everything the Manifest says about itself, in the order 3.x's About tab shows it:
1413
+ * what a Canvas shown on its own is part of, then summary, metadata, required statement,
1414
+ * provider (its logo and name, linked to its homepage), rights, homepage, see also,
1415
+ * downloads, and the Manifest's own address, its thumbnail over them all (`thumbnail`).
1416
+ * Each part renders only if the Manifest has
1417
+ * it. The downloads are Download's: the `rendering` of the page in view ("This page")
1418
+ * and of the Manifest ("All pages").
1419
+ */
1420
+ export declare function About({ canvasSummary, headingLevel, download, thumbnail, label, className, ...rest }: AboutProps): React.JSX.Element | null;
1421
+ export interface AnnotationsProps extends React.HTMLAttributes<HTMLElement> {
1422
+ /**
1423
+ * Every annotation in the Manifest (default), as the Viewer's panel lists them: by
1424
+ * layer (AnnotationPages that share a label, or have none), then by Canvas, under each
1425
+ * Canvas's label, the ones in view marked current and kept in sight as the reader
1426
+ * moves. Or `"view"`: the view's alone, by set.
1427
+ */
1428
+ scope?: "view" | "all";
1429
+ /** Your own rendering of an annotation's content. */
1430
+ renderEntry?: (entry: AnnotationEntry) => React.ReactNode;
1431
+ /**
1432
+ * The heading level for each set's title. Headings in an annotation's Markdown sit a
1433
+ * level below it, or at it in a set with no title. Default 3.
1434
+ */
1435
+ headingLevel?: number;
1436
+ as?: React.ElementType;
1437
+ }
1438
+ /**
1439
+ * The annotations of the Root's resource — comments, tags, transcriptions — grouped by
1440
+ * set, as a list to read and to point with.
1441
+ *
1442
+ * - Each entry shows its content (IIIF's limited HTML, sanitized; an image body as an
1443
+ * image). Pressing it frames the annotation on the Canvas, going to its Canvas first if
1444
+ * need be. For the keyboard, a button inside it does the same, out of sight, its focus
1445
+ * drawn around the entry.
1446
+ * - Hovering or focusing an entry highlights its hotspot, and hovering a hotspot
1447
+ * highlights its entry: one highlight, shared through the Root, with no timers.
1448
+ * - Each set is headed by its AnnotationPage's own label, when it has one, and at the
1449
+ * header's end a toggle that hides its annotations from the Canvas (`HideToggle`: an
1450
+ * eye, "Hide" and the page's label, or "Hide annotations" for a page without one).
1451
+ * Pointed at or focused, it lights every entry it hides.
1452
+ * - Where the same words come as separate annotations, one per language (a transcription
1453
+ * and its translation), the set's header offers their languages by code ("AR", "EN"),
1454
+ * and lists one at a time: the Root's `language` to start, else the reader's
1455
+ * (`LanguageChoice`). Annotations in no language show whichever is chosen.
1456
+ */
1457
+ export declare const Annotations: React.ForwardRefExoticComponent<AnnotationsProps & React.RefAttributes<HTMLElement>>;
1458
+ export interface TranscriptProps extends React.HTMLAttributes<HTMLElement> {
1459
+ as?: React.ElementType;
1460
+ /** Keep the current cue in view as it plays. Default true. */
1461
+ follow?: boolean;
1462
+ /**
1463
+ * A field over the captions' cues to find words in, and steps through the cues that
1464
+ * have them, as Search steps through hits. Default true; captions only.
1465
+ */
1466
+ find?: boolean;
1467
+ /**
1468
+ * The find field held in view as the cues scroll under it: at the top of the box that
1469
+ * scrolls them, or, in a Panel's accordion, under the stuck headings, as Search's is.
1470
+ * Default `false`.
1471
+ */
1472
+ sticky?: boolean;
1473
+ /**
1474
+ * The find field's size, as Search's: `large` (the default), or `small`, a tad smaller,
1475
+ * for a narrow column, as the templates' Panels take it.
1476
+ */
1477
+ size?: "large" | "small";
1478
+ }
1479
+ /**
1480
+ * The words of the video or sound in view. From its WebVTT captions: one entry per cue,
1481
+ * the current one marked as it plays, and a press on any entry seeking there. From a
1482
+ * transcript as plain text (Cookbook 0017's `rendering`, 0253's `provides: transcript`):
1483
+ * its paragraphs, untimed, in the file's language. The captions come first.
1484
+ *
1485
+ * Playback re-renders the transcript only when the current cue changes, and writes nothing
1486
+ * to the Root's store. A caption file is the one the Canvas loads for its captions,
1487
+ * fetched once.
1488
+ *
1489
+ * With several caption files (one per language), a row of their language codes ("EN",
1490
+ * "IT") picks one: native radios, each named by its code and its file's label, in that
1491
+ * label's language. In an information panel's accordion the row sits beside the
1492
+ * Transcript's heading (`useSectionActions`), where it is not lost in the cues; elsewhere
1493
+ * it is over them.
1494
+ */
1495
+ export declare const Transcript: React.ForwardRefExoticComponent<TranscriptProps & React.RefAttributes<HTMLElement>>;
1496
+ export interface ContentsProps extends React.HTMLAttributes<HTMLElement> {
1497
+ as?: React.ElementType;
1498
+ }
1499
+ /**
1500
+ * The Manifest's table of contents, from its Ranges: chapters of a book, acts of an opera,
1501
+ * nested as they nest. The entry the reader is in is marked, following playback through a
1502
+ * time-based Canvas. Choosing an entry goes to its Canvas, and to its region or its moment.
1503
+ * Hovering or focusing one marks its chapter on the Canvas's seek bar, and the chapter
1504
+ * under the pointer there marks its entry here: one highlight, through the Root
1505
+ * (`clover.chapter`), as the annotations share theirs.
1506
+ */
1507
+ export declare const Contents: React.ForwardRefExoticComponent<ContentsProps & React.RefAttributes<HTMLElement>>;
1508
+ export interface DownloadProps extends Omit<React.HTMLAttributes<HTMLElement>, "children"> {
1509
+ /**
1510
+ * The level of its groups' titles ("This page", "All pages"), a level under the
1511
+ * heading it sits beneath. Default 3.
1512
+ */
1513
+ headingLevel?: number;
1514
+ }
1515
+ /**
1516
+ * Downloads, as 3.x's Viewer offers them: the `rendering` of the Canvases in view ("This
1517
+ * page") and of the Manifest ("All pages") — a PDF, a text, a high-resolution file —
1518
+ * each a link, as Homepage lists a resource's pages (Mat, 2026-10-21: links, not a
1519
+ * button that opens them). Renders nothing when there is nothing to download.
1520
+ */
1521
+ export declare function Download({ className, headingLevel, ...rest }: DownloadProps): React.JSX.Element | null;
1522
+ /** A length: pixels as a number, or a CSS length in `px`, `rem` or `%` of the split. */
1523
+ export type SplitLength = number | string;
1524
+ export type SplitProps = React.HTMLAttributes<HTMLElement> & {
1525
+ as?: React.ElementType;
1526
+ /**
1527
+ * Remember the sizes the reader drags to, in `localStorage` under this key, so the
1528
+ * same layout opens at them next time.
1529
+ */
1530
+ storageKey?: string;
1531
+ };
1532
+ /**
1533
+ * Panes side by side, divided by handles the reader drags (or moves by keyboard) to share
1534
+ * the width between them. One pane beside each handle is given a `size`; the other takes
1535
+ * what is left. Not tied to any part: split the Body from the information panel, or
1536
+ * anything from anything.
1537
+ *
1538
+ * ```jsx
1539
+ * <Clover.Split>
1540
+ * <Clover.SplitPane min="16rem"><Clover.Body /></Clover.SplitPane>
1541
+ * <Clover.SplitHandle />
1542
+ * <Clover.SplitPane size="24rem" min="14rem"><Clover.Panel /></Clover.SplitPane>
1543
+ * </Clover.Split>
1544
+ * ```
1545
+ *
1546
+ * Without the stylesheet the panes still sit side by side (that much is inline); the
1547
+ * sizes, the bar and its grip are the stylesheet's.
1548
+ */
1549
+ export declare const Split: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
1550
+ as?: React.ElementType;
1551
+ /**
1552
+ * Remember the sizes the reader drags to, in `localStorage` under this key, so the
1553
+ * same layout opens at them next time.
1554
+ */
1555
+ storageKey?: string;
1556
+ } & React.RefAttributes<HTMLElement>>;
1557
+ export type SplitPaneProps = React.HTMLAttributes<HTMLElement> & {
1558
+ as?: React.ElementType;
1559
+ /** Its width to start with. A pane without one takes the width that is left. */
1560
+ size?: SplitLength;
1561
+ /** The narrowest it may be, beside the others and under a handle. */
1562
+ min?: SplitLength;
1563
+ /** The widest a handle may make it. */
1564
+ max?: SplitLength;
1565
+ /**
1566
+ * The name its size is remembered under (with the Split's `storageKey`). Default: its
1567
+ * place among the Split's panes.
1568
+ */
1569
+ name?: string;
1570
+ };
1571
+ /** One side of a `Split`. */
1572
+ export declare const SplitPane: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
1573
+ as?: React.ElementType;
1574
+ /** Its width to start with. A pane without one takes the width that is left. */
1575
+ size?: SplitLength;
1576
+ /** The narrowest it may be, beside the others and under a handle. */
1577
+ min?: SplitLength;
1578
+ /** The widest a handle may make it. */
1579
+ max?: SplitLength;
1580
+ /**
1581
+ * The name its size is remembered under (with the Split's `storageKey`). Default: its
1582
+ * place among the Split's panes.
1583
+ */
1584
+ name?: string;
1585
+ } & React.RefAttributes<HTMLElement>>;
1586
+ export type SplitHandleProps = React.HTMLAttributes<HTMLDivElement>;
1587
+ /**
1588
+ * The bar between two panes, with a grip at its middle. Drag it. Or click or tap it: each
1589
+ * click steps the pane on to its next width, from its narrowest to its own size to its
1590
+ * widest and around again, so one pointer resizes it without a drag (WCAG 2.5.7). A double
1591
+ * click steps it once. Or focus it and use the arrow keys (Shift for bigger steps, Home
1592
+ * and End for the limits). It is a focusable `separator` carrying the sized pane's share
1593
+ * of the width, and names itself in a popover on hover and focus.
1594
+ */
1595
+ export declare const SplitHandle: React.ForwardRefExoticComponent<SplitHandleProps & React.RefAttributes<HTMLDivElement>>;
1596
+ export interface SearchProps extends React.HTMLAttributes<HTMLElement> {
1597
+ /** The heading level of each Canvas's group of hits. Default 3. */
1598
+ headingLevel?: number;
1599
+ /**
1600
+ * The field held in view as the hits scroll under it: at the top of the box that
1601
+ * scrolls them, or, in a Panel's accordion, under the stuck headings. Default `false`.
1602
+ */
1603
+ sticky?: boolean;
1604
+ /**
1605
+ * The field's size: `large` (the default), its submit a round control's; or `small`,
1606
+ * a tad smaller, for a narrow column. Default `"large"`.
1607
+ */
1608
+ size?: "large" | "small";
1609
+ /** The element to render. Default `div`. */
1610
+ as?: React.ElementType;
1611
+ }
1612
+ export declare const Search: React.ForwardRefExoticComponent<SearchProps & React.RefAttributes<HTMLElement>>;
1613
+ /** Ask the service, following further pages, and read the hits. */
1614
+ export declare function search(service: SearchService, query: string, { request, signal }?: {
1615
+ request?: CloverRequest;
1616
+ signal?: AbortSignal;
1617
+ }): Promise<SearchResults>;
1618
+ /** Serve MapLibre's worker from `url` for every map Clover draws (a Viewer's Map tab included). */
1619
+ export declare function setMapWorkerUrl(url: string | undefined): void;
1620
+ export interface CollectionProps extends React.HTMLAttributes<HTMLElement> {
1621
+ /**
1622
+ * The level of its headings: the Collection's label, Homepage and its address. Default
1623
+ * 3. Past 6 each is not a heading, and names what it heads instead (`ui/heading.ts`).
1624
+ */
1625
+ headingLevel?: number;
1626
+ }
1627
+ /**
1628
+ * The Collection the Manifest was reached through, or else the first it is `partOf`, as
1629
+ * About describes a Manifest: its label and summary, its members as a list (each opening
1630
+ * its Manifest in the Root, `Items of="members"`), then its homepage and its own address.
1631
+ * The `Panel`'s Collection section is this part.
1632
+ *
1633
+ * A `partOf` Collection is fetched only when the part first shows (the panel mounts a
1634
+ * section's content then), never ahead of the reader; until it arrives, what the
1635
+ * Manifest's `partOf` says of it is shown. Renders nothing when there is no Collection.
1636
+ */
1637
+ export declare const Collection: React.ForwardRefExoticComponent<CollectionProps & React.RefAttributes<HTMLDivElement>>;
1638
+ export interface CollectionSelectProps extends Omit<React.HTMLAttributes<HTMLElement>, "onChange"> {
1639
+ /** Called with the member chosen, before Clover moves there. */
1640
+ onChange?: (id: string) => void;
1641
+ }
1642
+ /**
1643
+ * A native `<select>` of the Collection's members, labeled by the Collection: choosing a
1644
+ * Manifest shows it, choosing a nested Collection enters it. Renders nothing outside a
1645
+ * Collection, or for a Collection of one.
1646
+ *
1647
+ * Each choice loads a whole Manifest, so a keyboard only moves through the members, and
1648
+ * Enter makes the choice (WCAG 3.2.2). Escape, or leaving the menu, takes the step back:
1649
+ * loaded once focus had moved on, a Manifest could take away the control focus moved to
1650
+ * (WCAG 2.4.3). A choice from the menu's own list (a pointer, a phone's picker, a list
1651
+ * opened with Alt+↓ or on macOS) is made at once.
1652
+ */
1653
+ export declare const CollectionSelect: React.ForwardRefExoticComponent<CollectionSelectProps & React.RefAttributes<HTMLElement>>;
1654
+ export interface PanelToggleProps {
1655
+ /** Whether the panel is showing. */
1656
+ open: boolean;
1657
+ onOpenChange: (open: boolean) => void;
1658
+ /** The panel's `id`, for `aria-controls`. */
1659
+ controls?: string;
1660
+ }
1661
+ /**
1662
+ * A button that shows and hides an `Panel`. It is styled as a Canvas control,
1663
+ * so it sits in the cluster when given to `Clover.Body` as a child:
1664
+ *
1665
+ * ```jsx
1666
+ * <Clover.Body>
1667
+ * <Clover.PanelToggle open={open} onOpenChange={setOpen} controls="panel" />
1668
+ * </Clover.Body>
1669
+ * <Clover.Panel id="panel" hidden={!open} />
1670
+ * ```
1671
+ */
1672
+ export declare function PanelToggle({ open, onOpenChange, controls, }: PanelToggleProps): React.JSX.Element;
1673
+ /**
1674
+ * EXPERIMENTAL. Clover's own 2D renderer for images, video and sound, drawn with WebGL2
1675
+ * and falling back to Canvas2D.
1676
+ *
1677
+ * - **Inside a `Root`**, given no `canvases`, `body` or `src`, it shows the Root's current
1678
+ * view and reports back to it: a deep link's region or time, the media element, the end
1679
+ * of playback for auto-advance.
1680
+ * - **Standalone** (or given something to draw), it draws exactly what it is handed and
1681
+ * knows nothing of the Manifest around it; given `iiifContent`, it loads that Canvas
1682
+ * itself.
1683
+ */
1684
+ export declare const Canvas: React.FC<CloverCanvasProps>;
1685
+ export type TimelineProps = Omit<CloverCanvasProps, "canvases" | "body" | "src" | "isTiledImage" | "viewingDirection" | "navigator" | "onViewportChange" | "onReady" | "animateAnnotations"> & {
1686
+ /**
1687
+ * A Presentation 4 Timeline to play: its sound, with what it carries (captions, a
1688
+ * transcript, annotations on its time, an accompanying or placeholder Canvas).
1689
+ * Upgrade older resources with `toPresentation4()`; a Presentation 3 Canvas of sound
1690
+ * alone upgrades to one. Inside a `Root`, leave it out to play the Root's view.
1691
+ */
1692
+ timeline?: IIIFCanvas;
1693
+ };
1694
+ /**
1695
+ * A IIIF Presentation 4 Timeline, played: sound, which has a duration and
1696
+ * no picture. It is drawn on Canvas's Body, with Canvas's transport, captions, chapters
1697
+ * and annotations on its time, and shows the Timeline's accompanying Canvas (or its
1698
+ * placeholder) while it plays, as the Viewer has shown sound. It draws on a surface of its
1699
+ * own (`playerSurface`), not Canvas's image renderer, which it never loads.
1700
+ *
1701
+ * - **Inside a `Root`**, given nothing to play, it plays the Root's view when that is a
1702
+ * Timeline, and draws nothing otherwise. `Body` draws a Timeline view with it.
1703
+ * - **Standalone**, it plays the `timeline` it is handed; given `iiifContent`, it loads a
1704
+ * Timeline itself (a Manifest gives its first).
1705
+ */
1706
+ export declare function Timeline({ timeline, className, ...props }: TimelineProps): React.JSX.Element | null;
1707
+ /** The parts of a Presentation 4 Scene this module reads. */
1708
+ export interface IIIFScene {
1709
+ id: string;
1710
+ type?: string;
1711
+ label?: unknown;
1712
+ summary?: unknown;
1713
+ metadata?: Array<{
1714
+ label?: unknown;
1715
+ value?: unknown;
1716
+ }>;
1717
+ backgroundColor?: string | null;
1718
+ items?: Array<{
1719
+ items?: Array<Record<string, any>>;
1720
+ }>;
1721
+ }
1722
+ /** Which of the Scene's controls to show. All are on by default. */
1723
+ export interface SceneControlsConfig {
1724
+ zoom?: boolean;
1725
+ fullPage?: boolean;
1726
+ rotation?: boolean;
1727
+ reset?: boolean;
1728
+ /** An `i` control that slides out the Scene's `summary` and `metadata`. */
1729
+ information?: boolean;
1730
+ }
1731
+ export interface SceneProps {
1732
+ /**
1733
+ * A Presentation 4 Scene to draw: the models it paints, where it places them. Upgrade
1734
+ * older resources with `toPresentation4()`. Inside a `Root`, leave it out to draw the
1735
+ * Root's view.
1736
+ */
1737
+ scene?: IIIFScene;
1738
+ /**
1739
+ * A Scene to load and draw, on its own, outside any `Root`: a URL or an object, in any
1740
+ * Presentation version, fetched with `options.request`. A Manifest gives its first
1741
+ * Scene.
1742
+ */
1743
+ iiifContent?: string | Record<string, unknown>;
1744
+ /** The view's accessible name: the Scene's own label by default. */
1745
+ label?: unknown;
1746
+ /** The language to read IIIF text in. The reader's, by default; inside a `Root`, the Root's. */
1747
+ language?: string;
1748
+ className?: string;
1749
+ /** All of Clover's controls (`true`, the default), none (`false`), or all but those set `false`. */
1750
+ controls?: boolean | SceneControlsConfig;
1751
+ /** Replace any control with your own component, as `Canvas` takes them. */
1752
+ controlButtons?: ControlButtons;
1753
+ options?: {
1754
+ /** Credentials and headers for the Scene and its models. Inside a `Root`, the Root's. */
1755
+ request?: CloverRequest;
1756
+ /** Milliseconds the controls stay after a mouse stops moving, as `Canvas`'s. */
1757
+ hideDelay?: number;
1758
+ };
1759
+ /**
1760
+ * The Manifest the Scene is from: when it changes, the last one's models go at once. A
1761
+ * `Root` sets it.
1762
+ */
1763
+ manifestId?: string;
1764
+ /**
1765
+ * What draws the models: Clover's own WebGL2 renderer (`"clover"`, the default), or
1766
+ * three.js (`"three"`), once the page registers it (`registerThreeEngine`, from
1767
+ * `@nulib/clover/three`), for glTF's material extensions, skins and morph targets at
1768
+ * rest, and sparse accessors, which Clover's does not draw yet.
1769
+ */
1770
+ engine?: "clover" | "three";
1771
+ /** Rendered after the controls in the cluster: a host's own controls. */
1772
+ children?: React.ReactNode;
1773
+ }
1774
+ /**
1775
+ * A IIIF Presentation 4 Scene, drawn in 3D: the glTF models it paints, each
1776
+ * where the Scene places it, lit as a neutral room lights them and framed by a default
1777
+ * camera, which the reader turns and zooms by pointer, key or control. Its drawing, Clover's
1778
+ * own WebGL2 glTF renderer (or three.js, `engine="three"`, once the page registers it from
1779
+ * `@nulib/clover/three`), loads only when a Scene first comes near the window.
1780
+ *
1781
+ * - **Inside a `Root`**, given nothing to draw, it draws the Root's view when that is a
1782
+ * Scene, and nothing otherwise. `Body` draws a Scene view with it.
1783
+ * - **Standalone**, it draws the `scene` it is handed; given `iiifContent`, it loads a
1784
+ * Scene itself (a Manifest gives its first).
1785
+ */
1786
+ export declare function Scene(props: SceneProps): React.JSX.Element | null;
1787
+ export interface Sequence {
1788
+ /** The Canvases, Timelines and Scenes Clover can show, in order. */
1789
+ canvases: Container[];
1790
+ views: View[];
1791
+ direction: ViewingDirection;
1792
+ }
1793
+ /**
1794
+ * Hooks for building parts of your own. Each reads one slice of the nearest `Root`'s
1795
+ * state and re-renders only when that slice changes.
1796
+ */
1797
+ /** Loading, ready or error, and the error. */
1798
+ export declare function useStatus(): {
1799
+ status: CloverStatus;
1800
+ error: Error | null;
1801
+ };
1802
+ /** The Manifest shown, in Presentation 4; null until loaded. */
1803
+ export declare function useManifest(): Manifest | null;
1804
+ /** The Canvases, Timelines and Scenes, their grouping into views, and the reading direction. */
1805
+ export declare function useSequence(): Sequence;
1806
+ /** The Canvases of the current view: one, or a spread. */
1807
+ export declare function useVisibleCanvases(): Container[];
1808
+ /** The Canvas the reader is on (the first of the current view). */
1809
+ export declare function useActiveCanvas(): Container | null;
1810
+ /** Moving between views. Steps by view, so a spread moves two pages at a time. */
1811
+ export declare function useNavigation(): Navigation;
1812
+ /** Every annotation set: the Manifest's own (fetched so far) and any the host added. */
1813
+ export declare function useAnnotationSets(): AnnotationSet[];
1814
+ /** A IIIF language map as text in the Root's language, with the tag it is in. */
1815
+ export declare function useLocalized(value: LanguageMapLike): LocalizedValue;
1816
+ /** Clover's interface strings in the current language: `t("commonClose")`. */
1817
+ export declare function useT(): (key: string, values?: Record<string, unknown>) => string;
1818
+ /**
1819
+ * The language of one of Clover's strings where it is not the page's (a French reader on
1820
+ * an English page, or a key that fell back to English), for the element that shows it, or
1821
+ * is named by it, to carry as `lang` (WCAG 3.1.2). Undefined otherwise: the string takes
1822
+ * the page's language. The page's is the nearest `lang` around the Root.
1823
+ *
1824
+ * ```jsx
1825
+ * const t = Clover.useT();
1826
+ * const langOf = Clover.useLangOf();
1827
+ * <button aria-label={t("commonClose")} lang={langOf("commonClose")} />
1828
+ * ```
1829
+ */
1830
+ export declare function useLangOf(): (key: string) => string | undefined;
1831
+ /**
1832
+ * Hidden from sight, present for assistive technology. Inline, not a class: it has to
1833
+ * hold without the stylesheet, or the text it hides would show.
1834
+ */
1835
+ export declare const visuallyHidden: CSSProperties;
1836
+ /**
1837
+ * A key a control answers to: as `aria-keyshortcuts` names it (WAI-ARIA key names, `Plus`
1838
+ * and `Space` spelled out, alternatives space-separated), and as its popover shows it.
1839
+ */
1840
+ export interface Shortcut {
1841
+ keys: string;
1842
+ glyph: string;
1843
+ }
1844
+ /**
1845
+ * The popover a control shows on hover and on keyboard focus: its name, the same string
1846
+ * its `aria-label` gives assistive technology (WCAG 2.5.3, Label in Name), and its key
1847
+ * when it has one. Put it inside the control, last; the control carries the name and
1848
+ * `aria-keyshortcuts`, so the popover itself is hidden from assistive technology.
1849
+ *
1850
+ * WCAG 1.4.13 (Content on Hover or Focus): it shows on focus as well as hover; Escape
1851
+ * hides it without moving the pointer or focus; the pointer can move onto it without it
1852
+ * closing; and it stays until the pointer or focus leaves. Styles are `ui/Tip.css`.
1853
+ */
1854
+ export declare function Tip({ label, lang, shortcut, scrolls, image, }: {
1855
+ label: string;
1856
+ /** The language of `label`, where it is not its control's. */
1857
+ lang?: string;
1858
+ shortcut?: Shortcut;
1859
+ /**
1860
+ * It may run longer than the room it is kept in (a hotspot's note, kept inside the
1861
+ * Body): capped there, it scrolls (`scrollNote` in `Canvas/Annotations.tsx`). It never takes focus, which a scroller
1862
+ * might, hidden as it is from assistive technology: a press on it focuses its control.
1863
+ */
1864
+ scrolls?: boolean;
1865
+ /**
1866
+ * A picture above the words (a hotspot's image, Cookbook 0377): fetched only once it
1867
+ * shows, and named by them, as the control is.
1868
+ */
1869
+ image?: string;
1870
+ }): React.JSX.Element;
1871
+ /**
1872
+ * Clover's popups open one at a time: the Canvas's menus (annotations, Choice, an
1873
+ * animation's frames) and its information, and the playback controls' menus. Opening
1874
+ * one closes whichever other is open, anywhere on the page, as a menu bar
1875
+ * does, and however it was opened: a key opens a popup without the press outside that
1876
+ * closes a menu.
1877
+ *
1878
+ * Each still closes itself as it did (Escape, a press outside). Closed by another, a popup
1879
+ * leaves focus where it is, since it has moved on to the one that opened. A popup of your
1880
+ * own joins them with its open state and the way to close it:
1881
+ *
1882
+ * ```tsx
1883
+ * const [open, setOpen] = useState(false);
1884
+ * Clover.useOneOpen(open, () => setOpen(false));
1885
+ * ```
1886
+ */
1887
+ export declare function useOneOpen(open: boolean, close: () => void): void;
1888
+ /**
1889
+ * An id unique on the page, across every render root, React's or Preact's: what Clover
1890
+ * uses wherever it would call `useId`, and what a part of your own can use too.
1891
+ */
1892
+ export declare function useUniqueId(): string;
1893
+ /**
1894
+ * "Read more" for text cut short. Its one child is clamped by its own CSS (a
1895
+ * `-webkit-line-clamp`, as `Summary` is: `components/Primitives/Primitives.css`); a
1896
+ * button under it, shown only once the text runs past that, opens it in full ("Read
1897
+ * more", `aria-expanded`) and cuts it short again ("Read less"). While open, the child
1898
+ * carries `data-read-more="open"`, which its clamp leaves alone.
1899
+ *
1900
+ * For text of your own: wrap one element (or a component that forwards its ref), and
1901
+ * clamp it in your CSS.
1902
+ *
1903
+ * ```tsx
1904
+ * <Clover.ReadMore>
1905
+ * <p className="my-note">{text}</p>
1906
+ * </Clover.ReadMore>
1907
+ * ```
1908
+ */
1909
+ export declare function ReadMore({ children }: {
1910
+ children: React.ReactElement;
1911
+ }): React.JSX.Element;
1912
+ /** A title at a level, and what goes on it and on the group it heads. */
1913
+ export interface Titled {
1914
+ /** The title's element: its heading, or past 6 the fallback, a `p`. */
1915
+ as: React.ElementType;
1916
+ /** For the title: past 6, the `id` its group is named by. */
1917
+ title: {
1918
+ id?: string;
1919
+ };
1920
+ /** For the element around what it heads: past 6, a group the title names. */
1921
+ group: {
1922
+ role?: "group";
1923
+ "aria-labelledby"?: string;
1924
+ };
1925
+ }
1926
+ /**
1927
+ * A title at `level` with this `id`, and the group it heads, for a layout of your own.
1928
+ * To h6 the title is a heading, and its group needs nothing. Past 6 it is a `p` (or
1929
+ * `fallback`) that names the group: spread `title` on the title and `group` on the
1930
+ * element around what it heads.
1931
+ *
1932
+ * ```tsx
1933
+ * const title = Clover.titled(headingLevel, "viewer-title");
1934
+ * <Clover.Root iiifContent={url} {...title.group}>
1935
+ * <Clover.Label as={title.as} {...title.title} />
1936
+ * ```
1937
+ */
1938
+ export declare function titled(level: number, id: string, fallback?: React.ElementType): Titled;
1939
+ /**
1940
+ * The Clover a `Root` owns, and the language it reads IIIF text in. The context value is
1941
+ * set once per Root (and when `language` changes), so parts never re-render through it:
1942
+ * they subscribe to the store for exactly what they read.
1943
+ */
1944
+ export interface CloverContextValue {
1945
+ clover: Clover;
1946
+ language?: string;
1947
+ /** Renderers of the host's own, for `Body` to draw some views with. */
1948
+ renderers?: BodyRenderer[];
1949
+ }
1950
+ /** The Clover of the nearest `Root`. Throws outside one, naming the part. */
1951
+ export declare function useClover(part?: string): CloverContextValue;
1952
+ /**
1953
+ * A value derived from the store, re-rendering only when it changes. Selectors should
1954
+ * return the same object for the same state (the core's are memoized), or pass `isEqual`.
1955
+ */
1956
+ export declare function useCloverSelector<Value>(selector: (state: CloverState) => Value, isEqual?: (a: Value, b: Value) => boolean, part?: string): Value;
1957
+ /**
1958
+ * Reading a content state: what a Root handed one (JSON or base64url, not a URL) loads
1959
+ * and where it goes. Its own chunk, loaded only for a content state (`loadContent`): a
1960
+ * page that opens a URL never carries it. Writing one stays in `content-state.ts`.
1961
+ */
1962
+ export type Json = Record<string, any>;
1963
+ /** A content state string (JSON, or base64url-encoded JSON) as JSON; null if neither. */
1964
+ export declare function decodeContentState(value: string): Json | null;
1965
+ /**
1966
+ * WebVTT, read by Clover: cues with their start, end and text. The Canvas's captions and
1967
+ * the `Transcript` share one fetch per file through `loadVtt`.
1968
+ *
1969
+ * @see https://www.w3.org/TR/webvtt1/
1970
+ */
1971
+ export interface Cue {
1972
+ start: number;
1973
+ end: number;
1974
+ /** The cue text with voice and styling tags (`<v Speaker>`, `<i>`) removed. */
1975
+ text: string;
1976
+ /** The speaker, when a `<v>` tag names one. */
1977
+ voice?: string;
1978
+ }
1979
+ export declare function parseVtt(text: string): Cue[];
1980
+ /**
1981
+ * The cue playing at `time`: the latest to start at or before it that has not ended.
1982
+ * Binary search, so a long transcript costs a few comparisons per tick. -1 if none.
1983
+ */
1984
+ export declare function cueAt(cues: Cue[], time: number): number;
1985
+ /**
1986
+ * Chapters of a time-based Canvas, from the Manifest's Ranges: a Range whose items name
1987
+ * the Canvas with a time fragment (`#t=0,30`, or a `FragmentSelector` with `t=`) is a
1988
+ * chapter. Ranges nest, and a reference cycle is walked once. Chapters come back by start
1989
+ * time with the gaps closed, as a seek bar draws them contiguous.
1990
+ */
1991
+ export interface Chapter {
1992
+ /** Its Range's id, as `Contents` keys the Range. */
1993
+ id?: string;
1994
+ label?: LanguageMapLike;
1995
+ start: number;
1996
+ end?: number;
1997
+ }
1998
+ export declare function chaptersOf(manifest: Manifest | null, canvasId: string | null, duration?: number): Chapter[];
1999
+ /** One entry of a table of contents: a Range, where it starts, and the Ranges within. */
2000
+ export interface ContentsNode {
2001
+ id: string;
2002
+ label?: LanguageMapLike;
2003
+ /** The first Canvas the Range (or its first descendant) names; none for an empty Range. */
2004
+ canvasId?: string;
2005
+ /** Every Canvas the Range covers, its own and its descendants'. */
2006
+ canvasIds: string[];
2007
+ /** The span on that Canvas, for time-based media. */
2008
+ time?: {
2009
+ start: number;
2010
+ end?: number;
2011
+ };
2012
+ /** The region on that Canvas, when the Range names one. */
2013
+ region?: {
2014
+ x: number;
2015
+ y: number;
2016
+ w: number;
2017
+ h: number;
2018
+ };
2019
+ children: ContentsNode[];
2020
+ }
2021
+ /**
2022
+ * The Manifest's table of contents, from `structures`. A single top Range that only wraps
2023
+ * others is unwrapped, as a reader expects its chapters, not one entry holding them.
2024
+ * Ranges marked `no-nav` are left out (their children are kept), and a cycle is walked once.
2025
+ */
2026
+ export declare function tableOfContents(manifest: Manifest | null): ContentsNode[];
2027
+ /**
2028
+ * The entry the reader is in: the deepest covering `canvasId` whose span holds `time` (or
2029
+ * that has no span). Null when none is.
2030
+ */
2031
+ export declare function currentContents(nodes: ContentsNode[], canvasId: string | null, time?: number): string | null;
2032
+ export declare function toPlainText(html: string): string;
2033
+ /**
2034
+ * How a text is read, strictly by its `format`'s media type: `text/html` as IIIF's HTML,
2035
+ * sanitized to what the Presentation API allows; `text/markdown` as Markdown; `text/plain`
2036
+ * (and any other type) as written, a `<` included. With no format, as IIIF's property
2037
+ * values come, by IIIF's rule: HTML only from a first `<` to a last `>`, whitespace
2038
+ * aside; anything else is plain text.
2039
+ */
2040
+ export declare function readAs(format: string | undefined, value?: string): "markdown" | "html" | "plain";
2041
+ export type Json = Record<string, any>;
2042
+ /**
2043
+ * A small picture of a region of a Canvas (an annotation's `xywh`, in the Canvas's own
2044
+ * coordinates), to be cut by the image server (`resolveThumbnail`): the image painted
2045
+ * there is found, and the region read as shares of it (scaled from where it is painted),
2046
+ * so the service's own `info.json` decides how it is asked for, never more than the
2047
+ * region has, and from a server that cannot cut a region, nothing (no fallback: all of
2048
+ * the image is not the region). Null where no image with a service is painted there.
2049
+ */
2050
+ export declare function regionSource(canvas: Json | undefined, rect: {
2051
+ x: number;
2052
+ y: number;
2053
+ w: number;
2054
+ h: number;
2055
+ }): ThumbnailSource | null;
2056
+ /**
2057
+ * Clover's translations, without a translation library.
2058
+ *
2059
+ * Clover needs a key lookup with a fallback chain, `{{name}}` interpolation and language
2060
+ * detection. i18next did that at about 20 kB gzipped across three packages;
2061
+ * this does it in well under one. Languages are still defined the way i18next defines
2062
+ * them, so existing `initCloverI18n` calls keep working:
2063
+ *
2064
+ * initCloverI18n({
2065
+ * lng: "de",
2066
+ * fallbackLng: ["de", "en"],
2067
+ * resources: { de: { clover: { informationPanelTabsAbout: "Über" } } },
2068
+ * });
2069
+ *
2070
+ * English ships with Clover. Each other language it ships loads the first time Clover is
2071
+ * to speak it, so until it arrives a string shows in English, marked as English by
2072
+ * `langOf`, and the readers re-render when it does. `cloverI18n.ready()` waits for it.
2073
+ */
2074
+ export declare const CLOVER_I18N_NAMESPACE = "clover";
2075
+ /** `resources[language][namespace][key]` — i18next's resource shape. */
2076
+ export type CloverI18nResources = Record<string, Record<string, Record<string, string>>>;
2077
+ export interface CloverI18nOptions {
2078
+ /**
2079
+ * The language to use. When not given: the page's `<html lang>`, then the browser's
2080
+ * languages, so Clover speaks the language of the page around it.
2081
+ */
2082
+ lng?: string;
2083
+ /** Languages to try, in order, when a key is missing. English is always last. */
2084
+ fallbackLng?: string | readonly string[] | false;
2085
+ /** Strings to add or override, merged into what Clover ships. */
2086
+ resources?: CloverI18nResources;
2087
+ }
2088
+ /** One of Clover's strings, and the language it is written in. */
2089
+ export interface CloverString {
2090
+ text: string;
2091
+ /** The language the string came from; undefined when no language has the key. */
2092
+ lang?: string;
2093
+ }
2094
+ declare const cloverI18n: {
2095
+ /** The language set, or else the first of the reader's that Clover has strings for. */
2096
+ readonly language: string;
2097
+ /**
2098
+ * The language Clover's strings are in: the first of the lookup chain that has any. A
2099
+ * language set with no strings of its own resolves to the next, English at the last.
2100
+ */
2101
+ readonly resolvedLanguage: string;
2102
+ changeLanguage(lng: string): void;
2103
+ /** A string and the language it came from, which a missing key leaves in another. */
2104
+ resolve(key: string, values?: Record<string, unknown>, namespace?: string): CloverString;
2105
+ t(key: string, values?: Record<string, unknown>, namespace?: string): string;
2106
+ /**
2107
+ * The language of a key's string where it is not the page's (`hostLanguage`), for the
2108
+ * element that shows it, or is named by it, to carry as `lang` (WCAG 3.1.2). Otherwise
2109
+ * undefined: the string takes the page's language. Without `hostLanguage`, only a
2110
+ * string that fell back to another language than the interface's is marked.
2111
+ */
2112
+ langOf(key: string, hostLanguage?: string, namespace?: string): string | undefined;
2113
+ /**
2114
+ * Settles once the language Clover speaks has loaded, or failed to: for a server render,
2115
+ * or a test, that needs the strings in place before it draws.
2116
+ *
2117
+ * await initCloverI18n({ lng: "fr" }).ready();
2118
+ */
2119
+ ready(): Promise<void>;
2120
+ /** For `useSyncExternalStore`: re-render readers when the language or strings change. */
2121
+ subscribe(listener: () => void): () => void;
2122
+ getSnapshot(): number;
2123
+ };
2124
+ export type CloverI18n = typeof cloverI18n;
2125
+ /**
2126
+ * Set Clover's language and add or override strings. Safe to call more than once: each
2127
+ * call merges its `resources` and applies any `lng` or `fallbackLng` it is given.
2128
+ */
2129
+ export declare function initCloverI18n(options?: CloverI18nOptions): CloverI18n;
2130
+ export type DefaultProps = Omit<RootProps, "children"> & {
2131
+ /** The header over the Body: the resource's title and provider. Default `true`. */
2132
+ header?: boolean;
2133
+ /**
2134
+ * The title's heading level, to fit the outline of the page around the layout (under
2135
+ * an `h2`, 3). The panel's sections are a level below it, or at it with no header,
2136
+ * taking the title's place. Default 2.
2137
+ */
2138
+ headingLevel?: number;
2139
+ /** The information panel beside the Body, with its toggle. Default `true`. */
2140
+ panel?: boolean;
2141
+ /**
2142
+ * Whether the panel starts open beside the Body. Default `true`. Where it has no room
2143
+ * there and would slide over the Body, it starts closed.
2144
+ */
2145
+ defaultPanelOpen?: boolean;
2146
+ /**
2147
+ * How the information panel lays out its sections: `"accordion"` (the default),
2148
+ * stacked boxes each opened by its heading, or `"tabs"`.
2149
+ */
2150
+ panelLayout?: PanelLayout;
2151
+ /** The downloads in the panel's About, as links. Default `true`. */
2152
+ download?: boolean;
2153
+ /** The thumbnails under the Body: a layout, or `false` for none. Default `slider`. */
2154
+ items?: Exclude<ItemsLayout, "pager"> | false;
2155
+ /**
2156
+ * Where the panel's width is remembered once the reader drags its bar
2157
+ * (`localStorage`). Default `"clover-template-default"`; `false` forgets it.
2158
+ */
2159
+ storageKey?: string | false;
2160
+ /**
2161
+ * Fill the box it sits in: as tall as that box, the Body taking what the header and
2162
+ * the strip leave, so nothing runs below it. For a box of a set height, the window
2163
+ * under a page's own header say. Default `false`: the Body is
2164
+ * `--clover-body-height` tall, and the layout as tall as it needs.
2165
+ */
2166
+ fill?: boolean;
2167
+ };
2168
+ declare function Default({ className, header, headingLevel, panel, defaultPanelOpen, panelLayout, download, items, storageKey, fill, ...root }: DefaultProps): React.JSX.Element;
2169
+ /**
2170
+ * A layout the Viewer draws: one from `@nulib/clover/templates`, or a component of your
2171
+ * own that takes the `Clover.Root` props.
2172
+ */
2173
+ export type ViewerTemplate = React.ComponentType<any>;
2174
+ /**
2175
+ * The Viewer's props are its template's: `Default`'s when there is none, and those of the
2176
+ * one passed otherwise, so `template={Document}` brings `defaultSidebarOpen` with it.
2177
+ */
2178
+ export type ViewerProps<T extends ViewerTemplate = typeof Default> = {
2179
+ /** The layout. Default `Default`, Clover 3.x's Viewer, loaded when first needed. */
2180
+ template?: T;
2181
+ } & React.ComponentProps<T>;
2182
+ /**
2183
+ * Clover's Viewer: a Manifest (or Collection, or content state) in a layout. The default
2184
+ * export of `@nulib/clover`.
2185
+ *
2186
+ * ```jsx
2187
+ * import Viewer from "@nulib/clover";
2188
+ * import { Document } from "@nulib/clover/templates";
2189
+ *
2190
+ * <Viewer iiifContent={url} />
2191
+ * <Viewer iiifContent={url} template={Document} />
2192
+ * ```
2193
+ *
2194
+ * The Viewer is a shell that holds no layout of its own, so a page ships only the
2195
+ * template it passes. With none it loads `Default` on first render: one request more,
2196
+ * and nothing drawn on the server. Pass `template={Default}` to have it up front.
2197
+ */
2198
+ export declare function Viewer<T extends ViewerTemplate = typeof Default>({ template, ...props }: ViewerProps<T>): React.JSX.Element;
2199
+
2200
+ export {
2201
+ Viewer as default,
2202
+ };
2203
+
2204
+ export {};