@nulib/clover 0.0.0-stage → 4.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) 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 +539 -0
  55. package/dist/components/Map/basemap.mjs +50 -0
  56. package/dist/components/Map/maplibre-worker.mjs +7 -0
  57. package/dist/components/Map/overlayImage.mjs +17 -0
  58. package/dist/components/Map/worker.mjs +22 -0
  59. package/dist/components/Panel/About.mjs +148 -0
  60. package/dist/components/Panel/Panel.mjs +259 -0
  61. package/dist/components/Panel/PanelToggle.mjs +43 -0
  62. package/dist/components/Panel/PartOfManifest.mjs +52 -0
  63. package/dist/components/Primitives/Primitives.mjs +263 -0
  64. package/dist/components/Primitives/resource.mjs +11 -0
  65. package/dist/components/Provider/Provider.mjs +174 -0
  66. package/dist/components/Root/Announcer.mjs +58 -0
  67. package/dist/components/Root/Root.mjs +29 -0
  68. package/dist/components/Root/useRootState.mjs +188 -0
  69. package/dist/components/Scene/Connected.mjs +48 -0
  70. package/dist/components/Scene/Loaded.mjs +56 -0
  71. package/dist/components/Scene/RotatePad.mjs +204 -0
  72. package/dist/components/Scene/Scene.mjs +20 -0
  73. package/dist/components/Scene/SceneView.mjs +539 -0
  74. package/dist/components/Scene/cloverEngine.mjs +105 -0
  75. package/dist/components/Scene/engine.mjs +141 -0
  76. package/dist/components/Scene/engines.mjs +23 -0
  77. package/dist/components/Scene/gestures.mjs +74 -0
  78. package/dist/components/Scene/models.mjs +78 -0
  79. package/dist/components/Scene/orbit.mjs +60 -0
  80. package/dist/components/Search/Search.mjs +246 -0
  81. package/dist/components/Split/Split.mjs +210 -0
  82. package/dist/components/Split/splitting.mjs +203 -0
  83. package/dist/components/Status/Status.mjs +47 -0
  84. package/dist/components/Timeline/Connected.mjs +25 -0
  85. package/dist/components/Timeline/Timeline.mjs +40 -0
  86. package/dist/components/Timeline/playerSurface.mjs +84 -0
  87. package/dist/components/Transcript/Transcript.mjs +377 -0
  88. package/dist/components/Viewer/Viewer.mjs +19 -0
  89. package/dist/core/annotation-bodies.mjs +29 -0
  90. package/dist/core/annotation-collection.mjs +55 -0
  91. package/dist/core/annotation-name.mjs +31 -0
  92. package/dist/core/annotation-sets.mjs +155 -0
  93. package/dist/core/annotations-content.mjs +27 -0
  94. package/dist/core/annotations.mjs +73 -0
  95. package/dist/core/clover.mjs +393 -0
  96. package/dist/core/content-state-reader.mjs +82 -0
  97. package/dist/core/content-state.mjs +43 -0
  98. package/dist/core/direction.mjs +12 -0
  99. package/dist/core/geo-detect.mjs +30 -0
  100. package/dist/core/geo.mjs +283 -0
  101. package/dist/core/items.mjs +76 -0
  102. package/dist/core/keep-fragments.mjs +40 -0
  103. package/dist/core/link.mjs +28 -0
  104. package/dist/core/load.mjs +183 -0
  105. package/dist/core/map-config.mjs +12 -0
  106. package/dist/core/markdown.mjs +139 -0
  107. package/dist/core/pages.mjs +51 -0
  108. package/dist/core/painted-bodies.mjs +20 -0
  109. package/dist/core/painting.mjs +17 -0
  110. package/dist/core/presentation.mjs +27 -0
  111. package/dist/core/ranges.mjs +133 -0
  112. package/dist/core/region.mjs +32 -0
  113. package/dist/core/request.mjs +40 -0
  114. package/dist/core/sanitize.mjs +72 -0
  115. package/dist/core/search-service.mjs +22 -0
  116. package/dist/core/search.mjs +154 -0
  117. package/dist/core/selectors.mjs +94 -0
  118. package/dist/core/sequence.mjs +70 -0
  119. package/dist/core/show-link.mjs +16 -0
  120. package/dist/core/store.mjs +40 -0
  121. package/dist/core/svg-shape.mjs +183 -0
  122. package/dist/core/text.mjs +36 -0
  123. package/dist/core/thumbnail.mjs +55 -0
  124. package/dist/core/value.mjs +39 -0
  125. package/dist/core/vtt.mjs +111 -0
  126. package/dist/hooks/useFullscreen.mjs +21 -0
  127. package/dist/hooks/useFullscreenSupported.mjs +11 -0
  128. package/dist/hooks/useLoaded.mjs +27 -0
  129. package/dist/hooks/useWithinFullscreen.mjs +24 -0
  130. package/dist/i18n/config.mjs +170 -0
  131. package/dist/i18n/hostLanguage.mjs +6 -0
  132. package/dist/i18n/locales/en.json.mjs +5 -0
  133. package/dist/i18n/locales/es.json.mjs +5 -0
  134. package/dist/i18n/locales/fi.json.mjs +5 -0
  135. package/dist/i18n/locales/fr.json.mjs +5 -0
  136. package/dist/i18n/locales/index.mjs +13 -0
  137. package/dist/i18n/locales/nb.json.mjs +5 -0
  138. package/dist/i18n/locales/nn.json.mjs +5 -0
  139. package/dist/i18n/locales/no.json.mjs +5 -0
  140. package/dist/i18n/locales/pt.json.mjs +5 -0
  141. package/dist/i18n/reader.mjs +13 -0
  142. package/dist/i18n/useCloverTranslation.mjs +28 -0
  143. package/dist/index.d.mts +2215 -0
  144. package/dist/index.mjs +133 -0
  145. package/dist/lib/asArray.mjs +5 -0
  146. package/dist/lib/classnames.mjs +5 -0
  147. package/dist/lib/fullscreen.mjs +65 -0
  148. package/dist/lib/gltf/bounds.mjs +44 -0
  149. package/dist/lib/gltf/load.mjs +156 -0
  150. package/dist/lib/gltf/mat4.mjs +150 -0
  151. package/dist/lib/gltf/renderer.mjs +342 -0
  152. package/dist/lib/gltf/shaders.mjs +192 -0
  153. package/dist/lib/hls.mjs +6 -0
  154. package/dist/lib/pointer.mjs +38 -0
  155. package/dist/lib/renderer/CanvasRenderer.mjs +857 -0
  156. package/dist/lib/renderer/backends/backend.mjs +21 -0
  157. package/dist/lib/renderer/backends/canvas2d/Canvas2DBackend.mjs +91 -0
  158. package/dist/lib/renderer/backends/contexts.mjs +27 -0
  159. package/dist/lib/renderer/backends/dom/DomLayers.mjs +91 -0
  160. package/dist/lib/renderer/backends/webgl2/WebGL2Backend.mjs +248 -0
  161. package/dist/lib/renderer/backends/webgl2/shaders.mjs +28 -0
  162. package/dist/lib/renderer/camera/Camera.mjs +64 -0
  163. package/dist/lib/renderer/camera/CameraAnimator.mjs +90 -0
  164. package/dist/lib/renderer/input/GestureController.mjs +252 -0
  165. package/dist/lib/renderer/io/TileCache.mjs +207 -0
  166. package/dist/lib/renderer/io/decode.mjs +156 -0
  167. package/dist/lib/renderer/loop/FrameLoop.mjs +50 -0
  168. package/dist/lib/renderer/math/affine.mjs +68 -0
  169. package/dist/lib/renderer/math/rect.mjs +45 -0
  170. package/dist/lib/renderer/overlays/Navigator.mjs +141 -0
  171. package/dist/lib/renderer/overlays/OverlayLayer.mjs +94 -0
  172. package/dist/lib/renderer/scene/planFrame.mjs +168 -0
  173. package/dist/lib/renderer/scene/regions.mjs +30 -0
  174. package/dist/lib/renderer/scene/sceneItem.mjs +114 -0
  175. package/dist/lib/renderer/scene/uploadBudget.mjs +30 -0
  176. package/dist/lib/renderer/sources/imageService.mjs +160 -0
  177. package/dist/lib/renderer/sources/sizedImage.mjs +38 -0
  178. package/dist/lib/renderer/sources/tilePyramid.mjs +172 -0
  179. package/dist/lib/time.mjs +21 -0
  180. package/dist/map/index.d.mts +195 -0
  181. package/dist/map/index.mjs +16 -0
  182. package/dist/react/context.mjs +46 -0
  183. package/dist/react/hooks.mjs +69 -0
  184. package/dist/react/language.mjs +30 -0
  185. package/dist/styles.css +1 -0
  186. package/dist/templates/default/Default.mjs +229 -0
  187. package/dist/templates/document/Document.mjs +286 -0
  188. package/dist/templates/document/DocumentPanel.mjs +9 -0
  189. package/dist/templates/document/Sheets.mjs +360 -0
  190. package/dist/templates/gallery/Gallery.mjs +62 -0
  191. package/dist/templates/index.d.mts +276 -0
  192. package/dist/templates/index.mjs +11 -0
  193. package/dist/templates/shared/Lightbox.mjs +111 -0
  194. package/dist/templates/shared/LightboxBody.mjs +9 -0
  195. package/dist/templates/shared/dragToClose.mjs +129 -0
  196. package/dist/templates/shared/useDragToClose.mjs +35 -0
  197. package/dist/templates/shared/useDrawer.mjs +113 -0
  198. package/dist/templates/shared/useFollowFocus.mjs +24 -0
  199. package/dist/templates/shared/useSlide.mjs +52 -0
  200. package/dist/templates/shared/useSpine.mjs +26 -0
  201. package/dist/templates.css +1 -0
  202. package/dist/three/index.d.mts +6 -0
  203. package/dist/three/index.mjs +8 -0
  204. package/dist/ui/Button.mjs +53 -0
  205. package/dist/ui/ControlCluster.mjs +87 -0
  206. package/dist/ui/Cue.mjs +13 -0
  207. package/dist/ui/ErrorBoundary.mjs +26 -0
  208. package/dist/ui/ExitFullscreen.mjs +46 -0
  209. package/dist/ui/FieldPill.mjs +153 -0
  210. package/dist/ui/HideToggle.mjs +57 -0
  211. package/dist/ui/Loading.mjs +20 -0
  212. package/dist/ui/Markup.mjs +95 -0
  213. package/dist/ui/ReadMore.mjs +84 -0
  214. package/dist/ui/Sections.mjs +448 -0
  215. package/dist/ui/Steps.mjs +84 -0
  216. package/dist/ui/Tip.mjs +196 -0
  217. package/dist/ui/bringIntoView.mjs +27 -0
  218. package/dist/ui/controlGlyphs.mjs +120 -0
  219. package/dist/ui/heading.mjs +19 -0
  220. package/dist/ui/languageCode.mjs +8 -0
  221. package/dist/ui/mediaIcons.mjs +104 -0
  222. package/dist/ui/useClusterReach.mjs +50 -0
  223. package/dist/ui/useContainerName.mjs +19 -0
  224. package/dist/ui/useOneOpen.mjs +22 -0
  225. package/dist/ui/useRovingFocus.mjs +64 -0
  226. package/dist/ui/useScrollTrack.mjs +150 -0
  227. package/dist/ui/useUniqueId.mjs +10 -0
  228. package/dist/ui/visuallyHidden.mjs +15 -0
  229. package/dist/web-components/About-DbrFSVBm.mjs +1 -0
  230. package/dist/web-components/AnnotationMenu-EBjIQpQl.mjs +1 -0
  231. package/dist/web-components/AnnotationState-DQTaO6Gz.mjs +1 -0
  232. package/dist/web-components/Annotations-Cb9U7HJ_.mjs +2 -0
  233. package/dist/web-components/Annotations-Dl0SgHBS.mjs +1 -0
  234. package/dist/web-components/Body-DxSz3iST.mjs +1 -0
  235. package/dist/web-components/BodyAlert-C8EOXz24.mjs +1 -0
  236. package/dist/web-components/Button-uWgfvqsL.mjs +1 -0
  237. package/dist/web-components/Camera-cdCqKMup.mjs +1 -0
  238. package/dist/web-components/Canvas2DBackend-CnLEHRs4.mjs +1 -0
  239. package/dist/web-components/CanvasView-BI3YzNdK.mjs +1 -0
  240. package/dist/web-components/CaptionDetails-B80ZhZ7v.mjs +1 -0
  241. package/dist/web-components/ChoiceMenu-DCp7-co7.mjs +1 -0
  242. package/dist/web-components/Collection-B1Le2_TU.mjs +1 -0
  243. package/dist/web-components/CollectionSelect-BL_jQog-.mjs +1 -0
  244. package/dist/web-components/Connected-BxqaRL9o.mjs +1 -0
  245. package/dist/web-components/Connected-DCBI-j9H.mjs +1 -0
  246. package/dist/web-components/Connected-DkhfVWxd.mjs +1 -0
  247. package/dist/web-components/Contents-zYEGHLfe.mjs +1 -0
  248. package/dist/web-components/ControlMenu-CAHiLAtl.mjs +1 -0
  249. package/dist/web-components/Cue-BT2V9VAq.mjs +1 -0
  250. package/dist/web-components/Document-BdCjGnJN.mjs +1 -0
  251. package/dist/web-components/DocumentPanel-X_Rta0Wu.mjs +1 -0
  252. package/dist/web-components/DomLayers-BD4QPbl6.mjs +1 -0
  253. package/dist/web-components/Download-DqU-goFi.mjs +1 -0
  254. package/dist/web-components/EntryBodies-DXAQH0vR.mjs +1 -0
  255. package/dist/web-components/ErrorBoundary-chQaO-Up.mjs +1 -0
  256. package/dist/web-components/FieldPill-CyEssPVm.mjs +1 -0
  257. package/dist/web-components/FrameAnimation-Bb0pOoRl.mjs +1 -0
  258. package/dist/web-components/Gallery-BXU3TcT3.mjs +1 -0
  259. package/dist/web-components/HideToggle-BwMrOBMu.mjs +1 -0
  260. package/dist/web-components/Items-DRj1UEpC.mjs +1 -0
  261. package/dist/web-components/Label-D6aVJB9s.mjs +1 -0
  262. package/dist/web-components/LightboxBody-BzXQGMDn.mjs +1 -0
  263. package/dist/web-components/Loaded-D5xmFRSo.mjs +1 -0
  264. package/dist/web-components/LoadedCanvas-DOjtxLSe.mjs +1 -0
  265. package/dist/web-components/LoadedMap-DouDS2lO.mjs +1 -0
  266. package/dist/web-components/Loading-CBKfwsML.mjs +1 -0
  267. package/dist/web-components/Map-Bcgp_R8H.mjs +1 -0
  268. package/dist/web-components/MapView-CD5zkTs8.mjs +1 -0
  269. package/dist/web-components/Markup-C1hMA8wk.mjs +2 -0
  270. package/dist/web-components/MediaBody-B_Gii4we.mjs +1 -0
  271. package/dist/web-components/MediaBody-BfrKIPte.mjs +1 -0
  272. package/dist/web-components/Navigator-BSJbEbuJ.mjs +1 -0
  273. package/dist/web-components/Pager-Di_2hHM3.mjs +1 -0
  274. package/dist/web-components/Panel-DbsC8A9V.mjs +1 -0
  275. package/dist/web-components/PanelToggle-mUDw73zI.mjs +1 -0
  276. package/dist/web-components/PartOfManifest-7eOwURrF.mjs +1 -0
  277. package/dist/web-components/Pending-BPOQ2z1L.mjs +1 -0
  278. package/dist/web-components/Primitives-XQO3m1wG.mjs +1 -0
  279. package/dist/web-components/Provider-B61118lU.mjs +1 -0
  280. package/dist/web-components/ReadMore-BJH-qqte.mjs +1 -0
  281. package/dist/web-components/Root-Dj277K6p.mjs +1 -0
  282. package/dist/web-components/Scene-BTWpLeec.mjs +1 -0
  283. package/dist/web-components/SceneView-BYo7WmPt.mjs +1 -0
  284. package/dist/web-components/Search-ZV8FFN4p.mjs +1 -0
  285. package/dist/web-components/Sections-ejwu1_Sm.mjs +2 -0
  286. package/dist/web-components/StandaloneItems-BYaiyCca.mjs +1 -0
  287. package/dist/web-components/Status-YbQK2KzY.mjs +1 -0
  288. package/dist/web-components/Timeline-ByyVSd7B.mjs +1 -0
  289. package/dist/web-components/Tip-IO11xX4x.mjs +1 -0
  290. package/dist/web-components/Transcript-D0gUxUoA.mjs +1 -0
  291. package/dist/web-components/annotation-collection-Csv7WIlm.mjs +1 -0
  292. package/dist/web-components/annotations-content-BS_OFz5Z.mjs +1 -0
  293. package/dist/web-components/assets/maplibre-gl-worker-kTz9OPxr.js +13831 -0
  294. package/dist/web-components/body-CKjwwFep.mjs +1 -0
  295. package/dist/web-components/bringIntoView-CQH5ZgMM.mjs +1 -0
  296. package/dist/web-components/canvas-CIzpp-Uz.mjs +1 -0
  297. package/dist/web-components/classnames-DukgfdpI.mjs +1 -0
  298. package/dist/web-components/cloverEngine-B4LinbSt.mjs +164 -0
  299. package/dist/web-components/content-state-reader-D1BkpICh.mjs +1 -0
  300. package/dist/web-components/contexts-ByL3eA_T.mjs +1 -0
  301. package/dist/web-components/controls-Dj2BybWb.mjs +1 -0
  302. package/dist/web-components/custom-elements.json +2739 -0
  303. package/dist/web-components/dragToClose-C-Pf1IeO.mjs +1 -0
  304. package/dist/web-components/engine-BSt8LTso.mjs +4228 -0
  305. package/dist/web-components/engines-CC0OEsVE.mjs +1 -0
  306. package/dist/web-components/es-BwMkoRod.mjs +1 -0
  307. package/dist/web-components/fi-gPFOn9RK.mjs +1 -0
  308. package/dist/web-components/fr-DUHmgdJo.mjs +1 -0
  309. package/dist/web-components/fromManifest-BhemHaoA.mjs +1 -0
  310. package/dist/web-components/glyphs-drROkef9.mjs +1 -0
  311. package/dist/web-components/heading-Cjt0f-Eu.mjs +1 -0
  312. package/dist/web-components/hls-CdKrthkC.mjs +40 -0
  313. package/dist/web-components/hooks-BXzQSllm.mjs +1 -0
  314. package/dist/web-components/imageService-dsdmcegU.mjs +1 -0
  315. package/dist/web-components/index-B7nZdqLg.mjs +1 -0
  316. package/dist/web-components/index.d.mts +604 -0
  317. package/dist/web-components/index.mjs +1 -0
  318. package/dist/web-components/index.umd.js +18 -0
  319. package/dist/web-components/items-CB2Uk7ts.mjs +1 -0
  320. package/dist/web-components/items-jfQ5XzEj.mjs +1 -0
  321. package/dist/web-components/keep-fragments-B5nlv2ck.mjs +1 -0
  322. package/dist/web-components/label-Vbg_cMOJ.mjs +1 -0
  323. package/dist/web-components/languageCode-cCpiU0b0.mjs +1 -0
  324. package/dist/web-components/layout-mMHI0lsj.mjs +1 -0
  325. package/dist/web-components/link-ZRnv5NFR.mjs +1 -0
  326. package/dist/web-components/logo-Boy6u4m2.mjs +1 -0
  327. package/dist/web-components/maplibre-gl-CQ4OueXY.mjs +823 -0
  328. package/dist/web-components/markdown-CCYJwzFn.mjs +5 -0
  329. package/dist/web-components/models-D1EE_CmH.mjs +1 -0
  330. package/dist/web-components/nb-BSvnQ6jd.mjs +1 -0
  331. package/dist/web-components/nn-Dg2_HdZu.mjs +1 -0
  332. package/dist/web-components/no-BSvnQ6jd.mjs +1 -0
  333. package/dist/web-components/nodes-B7JRwBgl.mjs +1 -0
  334. package/dist/web-components/overlayImage-0OgQl1TL.mjs +1 -0
  335. package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +1 -0
  336. package/dist/web-components/panel-CjXfre-g.mjs +1 -0
  337. package/dist/web-components/part-cUiPs2-y.mjs +1 -0
  338. package/dist/web-components/playerSurface-CU5XxI1j.mjs +1 -0
  339. package/dist/web-components/provider-C1wKfdjb.mjs +1 -0
  340. package/dist/web-components/pt-B3J80JgO.mjs +1 -0
  341. package/dist/web-components/read-more-DNHNtG-a.mjs +1 -0
  342. package/dist/web-components/rendererSurface-DhIlOjGT.mjs +22 -0
  343. package/dist/web-components/renderers-BMSWEFUR.mjs +1 -0
  344. package/dist/web-components/resource-DLHocQ1C.mjs +1 -0
  345. package/dist/web-components/sanitize-Dc7nOsgO.mjs +3 -0
  346. package/dist/web-components/search-CLy2Wj01.mjs +1 -0
  347. package/dist/web-components/shared-YUjOSBKO.mjs +1 -0
  348. package/dist/web-components/show-link-CyzYE1eS.mjs +1 -0
  349. package/dist/web-components/sizedImage-uv_NlE0l.mjs +1 -0
  350. package/dist/web-components/split-CYuMjp89.mjs +1 -0
  351. package/dist/web-components/splitting-BnQUxxgH.mjs +1 -0
  352. package/dist/web-components/status-Ms5L0ghK.mjs +1 -0
  353. package/dist/web-components/styles-CyuM_fB1.mjs +1 -0
  354. package/dist/web-components/svg-shape-DLY3g7oq.mjs +1 -0
  355. package/dist/web-components/text-BTAkxEfQ.mjs +5 -0
  356. package/dist/web-components/three.mjs +1 -0
  357. package/dist/web-components/thumbnail-c2K_iQsD.mjs +1 -0
  358. package/dist/web-components/time-B9GZoYcm.mjs +1 -0
  359. package/dist/web-components/tip-dWhupWSr.mjs +1 -0
  360. package/dist/web-components/toggle-BQTjR1I3.mjs +1 -0
  361. package/dist/web-components/upgrader-XNxI-5jo.mjs +1 -0
  362. package/dist/web-components/useContainerName-BpJ3IWY0.mjs +1 -0
  363. package/dist/web-components/useNearViewport-CtLyYg9n.mjs +1 -0
  364. package/dist/web-components/useScrollTrack-WbG28FPD.mjs +1 -0
  365. package/dist/web-components/viewer/AnnotationMenu-ZKyBeyUU.mjs +1 -0
  366. package/dist/web-components/viewer/AnnotationState-DO33zokc.mjs +1 -0
  367. package/dist/web-components/viewer/Annotations-BOjhr5ks.mjs +1 -0
  368. package/dist/web-components/viewer/Annotations-DkLueFLK.mjs +2 -0
  369. package/dist/web-components/viewer/Canvas2DBackend-CAmzJD5P.mjs +1 -0
  370. package/dist/web-components/viewer/CaptionDetails-DOJlUtOn.mjs +1 -0
  371. package/dist/web-components/viewer/ChoiceMenu-BDq6H34G.mjs +1 -0
  372. package/dist/web-components/viewer/Collection-By3puO0V.mjs +1 -0
  373. package/dist/web-components/viewer/Connected-DZNO2CPf.mjs +1 -0
  374. package/dist/web-components/viewer/Connected-ESg5y49m.mjs +1 -0
  375. package/dist/web-components/viewer/Contents-B_FqDwTW.mjs +1 -0
  376. package/dist/web-components/viewer/ControlMenu-DdQl-dTf.mjs +1 -0
  377. package/dist/web-components/viewer/Cue-BTRHfiWQ.mjs +1 -0
  378. package/dist/web-components/viewer/Document-B9_PyD2w.mjs +1 -0
  379. package/dist/web-components/viewer/DocumentPanel-CtEJVPoE.mjs +1 -0
  380. package/dist/web-components/viewer/DomLayers-DRdQSEtN.mjs +1 -0
  381. package/dist/web-components/viewer/EntryBodies-CJuTRcTq.mjs +1 -0
  382. package/dist/web-components/viewer/FieldPill-06uwrNwE.mjs +1 -0
  383. package/dist/web-components/viewer/FrameAnimation-3dcDHf5q.mjs +1 -0
  384. package/dist/web-components/viewer/Gallery-BYasTqZc.mjs +1 -0
  385. package/dist/web-components/viewer/HideToggle-BxkNMX-T.mjs +1 -0
  386. package/dist/web-components/viewer/LightboxBody-CXMc1xOH.mjs +1 -0
  387. package/dist/web-components/viewer/MapView-DCerrRRV.mjs +1 -0
  388. package/dist/web-components/viewer/MediaBody-BdkJcyGy.mjs +1 -0
  389. package/dist/web-components/viewer/MediaBody-waF4KvHp.mjs +1 -0
  390. package/dist/web-components/viewer/Navigator-CKwDgG2x.mjs +1 -0
  391. package/dist/web-components/viewer/PartOfManifest-DalHJFwC.mjs +1 -0
  392. package/dist/web-components/viewer/Search-Di_QQfDb.mjs +1 -0
  393. package/dist/web-components/viewer/StandaloneItems-B9J6nnWn.mjs +1 -0
  394. package/dist/web-components/viewer/Transcript-aHOixfna.mjs +1 -0
  395. package/dist/web-components/viewer/annotation-collection-I2UkdobR.mjs +1 -0
  396. package/dist/web-components/viewer/annotations-content-D-i4j9pD.mjs +1 -0
  397. package/dist/web-components/viewer/cloverEngine-CynoKdta.mjs +164 -0
  398. package/dist/web-components/viewer/content-state-reader-D7GIMcKK.mjs +1 -0
  399. package/dist/web-components/viewer/host-DlCltI_c.mjs +1 -0
  400. package/dist/web-components/viewer/index.d.mts +7 -0
  401. package/dist/web-components/viewer/index.mjs +1 -0
  402. package/dist/web-components/viewer/index.umd.js +18 -0
  403. package/dist/web-components/viewer/link-BX-wzj1u.mjs +1 -0
  404. package/dist/web-components/viewer/overlayImage-CHqn1fG8.mjs +1 -0
  405. package/dist/web-components/viewer/renderers-C_wdmw9v.mjs +1 -0
  406. package/dist/web-components/viewer/search-BHLyNxZ6.mjs +1 -0
  407. package/dist/web-components/viewer/styles-BRCkEU3w.mjs +1 -0
  408. package/dist/web-components/viewer/viewer-ipqAA-xQ.mjs +28 -0
  409. package/dist/web-components/viewer/vtt-XiS_-5Ao.mjs +5 -0
  410. package/dist/web-components/viewer-DEHIsIHd.mjs +1 -0
  411. package/dist/web-components/vtt-DYAOuQoK.mjs +5 -0
  412. package/dist/web-components/worker-CjXN0dku.mjs +1 -0
  413. package/package.json +111 -4
@@ -0,0 +1,604 @@
1
+ /*
2
+ * @nulib/clover/web-components: Clover's elements, for pages without React. Written
3
+ * from the elements' specs by build/custom-elements.mjs.
4
+ */
5
+
6
+ export interface CloverI18nOptions {
7
+ /** The language to use: else the page's `<html lang>`, then the browser's. */
8
+ lng?: string;
9
+ /** Languages to try, in order, when a string is missing. English is always last. */
10
+ fallbackLng?: string | readonly string[] | false;
11
+ /** Strings to add or replace: `resources[language].clover[key]`. */
12
+ resources?: Record<string, Record<string, Record<string, string>>>;
13
+ }
14
+
15
+ /** Set the language of Clover's own words, or add strings, for every element on the page. */
16
+ export declare function initCloverI18n(options?: CloverI18nOptions): Promise<unknown>;
17
+
18
+ /** Define Clover's elements: done for you on import; for a build of your own with its own assets. */
19
+ export declare function defineCloverElements(assets: unknown, tags?: readonly string[]): void;
20
+
21
+ export interface CloverRect {
22
+ x: number;
23
+ y: number;
24
+ width: number;
25
+ height: number;
26
+ }
27
+
28
+ export interface CloverPoint {
29
+ x: number;
30
+ y: number;
31
+ }
32
+
33
+ /** Where the camera looks, its zoom and its turn (degrees, clockwise). */
34
+ export interface CloverCamera {
35
+ x: number;
36
+ y: number;
37
+ zoom: number;
38
+ rotation: number;
39
+ }
40
+
41
+ /** A IIIF resource as Clover holds it: Presentation 4, upgraded as it loaded. */
42
+ export type CloverResource = Record<string, unknown> & { id: string; type: string };
43
+
44
+ export type CloverStatus = "idle" | "loading" | "ready" | "error";
45
+
46
+ /** What every part draws from (`CloverState` in React). */
47
+ export interface CloverState {
48
+ status: CloverStatus;
49
+ error: Error | null;
50
+ /** The Manifest shown. */
51
+ manifest: CloverResource | null;
52
+ /** The Collection it was reached through, if any. */
53
+ collection: CloverResource | null;
54
+ /** The Canvas the reader is on: the first of the view that shows it. */
55
+ canvasId: string | null;
56
+ /** The annotation picked, from a list or its hotspot. */
57
+ annotationId: string | null;
58
+ /** Annotation sets switched off. */
59
+ hiddenSets: string[];
60
+ addedSets: CloverAnnotationSet[];
61
+ search: {
62
+ query: string;
63
+ status: CloverStatus;
64
+ hits: Array<{ id: string; canvasId: string; match: string; before?: string; after?: string }>;
65
+ };
66
+ }
67
+
68
+ /** The Canvases Clover can show, in order, grouped into views (each a list of indexes). */
69
+ export interface CloverSequence {
70
+ canvases: CloverResource[];
71
+ views: number[][];
72
+ direction: "left-to-right" | "right-to-left" | "top-to-bottom" | "bottom-to-top";
73
+ }
74
+
75
+ /** Moving between views (`useNavigation()`): a spread moves two pages at a time. */
76
+ export interface CloverNavigation {
77
+ /** Zero-based index of the current view. */
78
+ position: number;
79
+ total: number;
80
+ hasPrevious: boolean;
81
+ hasNext: boolean;
82
+ previous(): void;
83
+ next(): void;
84
+ first(): void;
85
+ last(): void;
86
+ goTo(canvasId: string): void;
87
+ }
88
+
89
+ export interface CloverAnnotationSet {
90
+ id: string;
91
+ label?: CloverLanguageMap;
92
+ source: "manifest" | "added" | "search";
93
+ entries: Array<{
94
+ id: string;
95
+ setId: string;
96
+ canvasId: string;
97
+ motivation: string[];
98
+ /** The annotation as published. */
99
+ annotation: Record<string, unknown>;
100
+ }>;
101
+ }
102
+
103
+ /** A IIIF language map, or a plain string. */
104
+ export type CloverLanguageMap =
105
+ | string
106
+ | Record<string, string[] | string | undefined>
107
+ | null
108
+ | undefined;
109
+
110
+ /** A value that changes too often for the state: the viewport, the media element… */
111
+ export interface CloverChannel<Value> {
112
+ get(): Value;
113
+ emit(value: Value): void;
114
+ subscribe(listener: (value: Value) => void): () => void;
115
+ }
116
+
117
+ /**
118
+ * `root.clover`: a root's Clover, for a part of your own. What React's hooks read, each a
119
+ * method of the same name (`useNavigation()` is `navigation()`), the state and a way to
120
+ * hear of it, the root's language, and the Clover `useClover()` hands a React part: its
121
+ * store, its actions and its channels.
122
+ */
123
+ export interface CloverRootApi {
124
+ /** The state, now. */
125
+ readonly state: CloverState;
126
+ /** Hear of every change of the state; returns the way to stop. */
127
+ subscribe(listener: (state: CloverState) => void): () => void;
128
+ /** The language the root reads IIIF text in, where it is given one. */
129
+ readonly language: string | undefined;
130
+ status(): { status: CloverStatus; error: Error | null };
131
+ manifest(): CloverResource | null;
132
+ sequence(): CloverSequence;
133
+ visibleCanvases(): CloverResource[];
134
+ activeCanvas(): CloverResource | null;
135
+ navigation(): CloverNavigation;
136
+ annotationSets(): CloverAnnotationSet[];
137
+ /** A language map as text in the root's language, with the tag it is in. */
138
+ localize(value: CloverLanguageMap): { text: string; lang?: string };
139
+ /** One of Clover's own strings, in its language now: `t("commonClose")`. */
140
+ t(key: string, values?: Record<string, unknown>): string;
141
+ /** That string's language where it is not the page's, for the `lang` of what shows it. */
142
+ langOf(key: string): string | undefined;
143
+ /**
144
+ * A popup of yours joined to Clover's, which open one at a time (`useOneOpen`): call it as
145
+ * yours opens, with the way to close it; call what it returns as yours closes.
146
+ */
147
+ oneOpen(close: () => void): () => void;
148
+ readonly store: {
149
+ get(): CloverState;
150
+ set(patch: Partial<CloverState>): void;
151
+ subscribe(listener: () => void): () => void;
152
+ };
153
+ goTo(
154
+ canvasId: string,
155
+ target?: { region?: { x: number; y: number; w: number; h: number }; time?: number },
156
+ ): void;
157
+ goToManifest(id: string, canvasId?: string): Promise<void>;
158
+ openCollection(id: string): Promise<void>;
159
+ next(options?: { autoplay?: boolean; wrap?: boolean }): void;
160
+ previous(): void;
161
+ first(): void;
162
+ last(): void;
163
+ selectAnnotation(id: string | null): void;
164
+ search(query: string): Promise<void>;
165
+ setSetVisible(setId: string, visible: boolean): void;
166
+ loadAnnotations(input: unknown): Promise<void>;
167
+ /** Where the reader is, as a content state. */
168
+ getContentState(): { json: Record<string, unknown>; encoded: string } | null;
169
+ readonly viewport: CloverChannel<{
170
+ canvasId: string;
171
+ region: { x: number; y: number; w: number; h: number };
172
+ } | null>;
173
+ readonly media: CloverChannel<HTMLVideoElement | null>;
174
+ readonly captions: CloverChannel<string | null>;
175
+ readonly highlight: CloverChannel<string | null>;
176
+ readonly chapter: CloverChannel<string | null>;
177
+ }
178
+
179
+ /**
180
+ * A renderer of yours, without React: the views it claims, and `render`, which draws one
181
+ * into a box filling the Body and returns what undoes it.
182
+ */
183
+ export interface CloverRenderer {
184
+ /** Views showing one of these Canvases… */
185
+ canvasId?: string[];
186
+ /** …or painting a body of one of these formats (`model/gltf-binary`)… */
187
+ format?: string[];
188
+ /** …or any view this says yes to. */
189
+ match?: (view: { canvases: CloverResource[]; bodies: Array<Record<string, unknown>> }) => boolean;
190
+ render(
191
+ container: HTMLElement,
192
+ view: {
193
+ canvases: CloverResource[];
194
+ bodies: Array<Record<string, unknown>>;
195
+ clover: CloverRootApi | null;
196
+ },
197
+ ): void | (() => void);
198
+ }
199
+
200
+ /** What the function for one of the Body's controls is told. */
201
+ export interface CloverControl {
202
+ name: keyof CloverControlButtons;
203
+ /** Its name, as its `aria-label` says it. */
204
+ label: string;
205
+ /** Clover's icon for it, to put in your button, kept current. */
206
+ icon: HTMLElement;
207
+ }
208
+
209
+ /** The Body's controls, each replaced by a button you make. */
210
+ export interface CloverControlButtons {
211
+ zoomIn?: (control: CloverControl) => Element;
212
+ zoomOut?: (control: CloverControl) => Element;
213
+ fullPage?: (control: CloverControl) => Element;
214
+ rotateRight?: (control: CloverControl) => Element;
215
+ rotateLeft?: (control: CloverControl) => Element;
216
+ reset?: (control: CloverControl) => Element;
217
+ choice?: (control: CloverControl) => Element;
218
+ }
219
+
220
+ /** The Canvas's handle (onReady in React): the camera and its coordinates. <clover-canvas> and <clover-body> keep it as handle. */
221
+ export interface CloverCanvasHandle {
222
+ readonly backendKind: "webgl2" | "canvas2d" | "none";
223
+ /** Whether the view is at home, fitted whole: false once the reader zooms, pans or turns it. */
224
+ readonly atHome: boolean;
225
+ /** Fit the whole view again, as Reset does. */
226
+ home(immediate?: boolean): void;
227
+ /** Zoom by a factor (2 in, 0.5 out), about a point on the screen if given. */
228
+ zoomBy(factor: number, at?: CloverPoint, animate?: boolean): void;
229
+ /** Move the view, in screen pixels. */
230
+ panBy(dx: number, dy: number, animate?: boolean): void;
231
+ /** Turn the view by an angle, clockwise. */
232
+ rotateBy(degrees: number): void;
233
+ /** Turn the view to an angle, clockwise. */
234
+ setRotation(degrees: number, immediate?: boolean): void;
235
+ /** The view's angle, in degrees clockwise. */
236
+ getRotation(): number;
237
+ /** Frame a rectangle, in world units. */
238
+ fitBounds(bounds: CloverRect, immediate?: boolean): void;
239
+ /** Frame a rectangle in one image's own coordinates, by its place among those shown. */
240
+ fitItemRect(index: number, rect: CloverRect, immediate?: boolean): void;
241
+ /** Frame a region of a Canvas shown, in its own coordinates (an xywh): false before it is laid out. */
242
+ fitCanvasRect(canvasId: string, rect: CloverRect, immediate?: boolean): boolean;
243
+ /** Frame an annotation's hotspot and focus it, as picking it does: false while it has none. */
244
+ zoomToAnnotation(id: string): boolean;
245
+ /** The visible rectangle, in world units. */
246
+ getBounds(): CloverRect;
247
+ /** What home fits: the whole view, in world units. */
248
+ getHomeBounds(): CloverRect | null;
249
+ /** The camera: where it looks, its zoom and its turn. */
250
+ getCamera(): CloverCamera;
251
+ /** The visible part of the Canvas filling most of the view, in its own coordinates: what a share link records. */
252
+ getCanvasRegion(): { canvasId: string; rect: CloverRect } | null;
253
+ /** A rectangle in one image's own coordinates, in world units. */
254
+ itemRectToWorld(index: number, rect: CloverRect): CloverRect | null;
255
+ /** A point in world units, on the screen. */
256
+ worldToScreenPoint(point: CloverPoint): CloverPoint;
257
+ /** A point on the screen, in world units. */
258
+ screenToWorldPoint(point: CloverPoint): CloverPoint;
259
+ /** Hear the renderer (viewport: the camera moved; change: new images); returns the way to stop. */
260
+ on(event: "open" | "viewport" | "change" | "error" | "backend" | "tap", listener: (detail?: unknown) => void): () => void;
261
+ }
262
+
263
+ /** Clover's Viewer, in one of its templates: Default (the title over the Body, the thumbnails under it, the information panel beside them), Document (a PDF reader's pages, thumbnails beside them) or Gallery (a grid, each item opening in a lightbox). Each template loads when used, its styles with it. */
264
+ export interface CloverViewerElement extends HTMLElement {
265
+ /** What to show, as the attribute takes it, or a IIIF resource as an object. */
266
+ iiifContent: string | Record<string, unknown> | null;
267
+ /** Annotations to show beside the Manifest's own, as URLs or objects. */
268
+ annotations: string | Record<string, unknown> | Array<string | Record<string, unknown>> | null;
269
+ /** Credentials, headers and a fetch of your own, for every request. */
270
+ request: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch } | null;
271
+ /** Renderers of yours, for its Body: each claims views (canvasId, format or match) and draws one into a box of its own (render), returning what undoes it. */
272
+ renderers: CloverRenderer[] | null;
273
+ }
274
+
275
+ /** The root of a layout of your own: it loads what it is given, holds where the reader is, and gives every part inside it the same state. The page's markup inside it stays as written. */
276
+ export interface CloverRootElement extends HTMLElement {
277
+ /** Its Clover, for a part of your own, once it has loaded (clover-ready): what React's hooks read, as methods of the same name (navigation(), visibleCanvases()…), the table of contents (contents()), its state and subscribe, its actions and channels, and its language. Null before. */
278
+ readonly clover: CloverRootApi | null;
279
+ /** What to show, as the attribute takes it, or a IIIF resource as an object. */
280
+ iiifContent: string | Record<string, unknown> | null;
281
+ /** Annotations to show beside the Manifest's own, as URLs or objects. */
282
+ annotations: string | Record<string, unknown> | Array<string | Record<string, unknown>> | null;
283
+ /** Credentials, headers and a fetch of your own, for every request. */
284
+ request: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch } | null;
285
+ /** Renderers of yours, for every clover-body in it: each claims views (canvasId, format or match) and draws one into a box of its own (render), returning what undoes it. */
286
+ renderers: CloverRenderer[] | null;
287
+ }
288
+
289
+ /** The view of the clover-root it is in, drawn as Body draws it: images, video and sound, or a renderer of yours. It is the Body's box, its height from --clover-body-height (60vh by default) or its own style. A clover-panel-toggle, and a button of yours, in it are among its controls. */
290
+ export interface CloverBodyElement extends HTMLElement {
291
+ /** The Canvas's handle once its view is laid out (clover-ready), as onReady hands it in React: the camera and its coordinates (handle.zoomBy(2), handle.home()). Null before. */
292
+ readonly handle: CloverCanvasHandle | null;
293
+ /** Which of the Body's controls it shows, as Canvas's controls takes it: false for none, or some ({ rotation: false }), in place of the attribute. */
294
+ controls: boolean | { zoom?: boolean; fullPage?: boolean; rotation?: boolean; reset?: boolean; annotations?: boolean; information?: boolean; [option: string]: unknown } | null;
295
+ /** The Canvas's options: the request it loads with (credentials, headers, a fetch of your own), its gestures and more. */
296
+ options: { request?: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch }; [key: string]: unknown } | null;
297
+ /** The Body's controls, each replaced by a button you make: a function given the control's name, label and Clover's icon, returning the button. Clover keeps it named, keyed and in its state, presses the control with it, and adds its popover. */
298
+ controlButtons: CloverControlButtons | null;
299
+ /** Renderers of yours for this Body only, in place of the root's: each claims views (canvasId, format or match) and draws one into a box of its own (render). */
300
+ renderers: CloverRenderer[] | null;
301
+ }
302
+
303
+ /** A label, as Label draws it, marked with the language it is in. Inside a clover-root, the Manifest's or the Canvas's; alone, the one it is given. Nothing is drawn while there is none, so a heading is never left empty. */
304
+ export interface CloverLabelElement extends HTMLElement {
305
+ /** A label to show instead, as text or a IIIF language map. */
306
+ label: string | Record<string, string[]> | null;
307
+ }
308
+
309
+ /** Thumbnails, as Items draws them. Inside a clover-root, its views (or its Collection's members), choosing what it shows; alone, the members or views of what it is given, as links. */
310
+ export interface CloverItemsElement extends HTMLElement {
311
+ /** Alone: what to list, as a URL or a IIIF resource. */
312
+ iiifContent: string | Record<string, unknown> | null;
313
+ /** Alone: a list of IIIF resources to show, as they are. */
314
+ items: unknown[] | null;
315
+ /** Alone: credentials, headers and a fetch of your own. In a root, the root's are used. */
316
+ request: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch } | null;
317
+ /** Your own figure for an item, in place of its thumbnail and label: a node or text, which names the item. A new node each time. */
318
+ renderItem: ((item: { id: string; label?: string | Record<string, string[]>; summary?: string | Record<string, string[]>; href?: string }, state: { selected: boolean }) => Node | string | null | undefined) | null;
319
+ }
320
+
321
+ /** Where the reader is, as a count: Item 3 of 12. It keeps the room of its widest count, so nothing beside it moves. */
322
+ export interface CloverPositionElement extends HTMLElement {
323
+ }
324
+
325
+ /** A button to the previous view (or member), shown disabled where there is none. */
326
+ export interface CloverPreviousElement extends HTMLElement {
327
+ }
328
+
329
+ /** A button to the next view (or member), shown disabled where there is none. */
330
+ export interface CloverNextElement extends HTMLElement {
331
+ }
332
+
333
+ /** What the root is doing: its loading mark while it loads, announced as Loading…, and why it failed if it did, as an alert. Empty and out of sight once it is ready. */
334
+ export interface CloverStatusElement extends HTMLElement {
335
+ }
336
+
337
+ /** The thumbnail (for a Canvas, its first image), its alt text the resource's label. */
338
+ export interface CloverThumbnailElement extends HTMLElement {
339
+ /** A resource to picture (a Manifest, Canvas or Collection), instead of the root's. */
340
+ value: Record<string, unknown> | null;
341
+ }
342
+
343
+ /** The summary, as sanitized HTML, cut to five lines with Read more under it when it runs longer (--clover-summary-lines). */
344
+ export interface CloverSummaryElement extends HTMLElement {
345
+ /** A summary, instead of the root's. */
346
+ value: string | Record<string, string[]> | null;
347
+ }
348
+
349
+ /** The metadata, as a description list of labels and their values. */
350
+ export interface CloverMetadataElement extends HTMLElement {
351
+ /** Metadata, instead of the root's. */
352
+ value: Array<{ label: Record<string, string[]>; value: Record<string, string[]> }> | null;
353
+ /** Your own drawing of a value: a node or text to show in its place, or undefined for Clover's. A new node each time. */
354
+ renderValue: ((item: { label: Record<string, string[]>; value: Record<string, string[]> }) => Node | string | null | undefined) | null;
355
+ }
356
+
357
+ /** The required statement: the attribution that must be shown, as a label and its value. */
358
+ export interface CloverRequiredStatementElement extends HTMLElement {
359
+ /** A required statement, instead of the root's. */
360
+ value: { label: Record<string, string[]>; value: Record<string, string[]> } | null;
361
+ }
362
+
363
+ /** The rights: a link to the license or rights statement. */
364
+ export interface CloverRightsElement extends HTMLElement {
365
+ /** A rights URL, instead of the root's. */
366
+ value: string | null;
367
+ }
368
+
369
+ /** The homepage: the resource's own web page, as a list of links. */
370
+ export interface CloverHomepageElement extends HTMLElement {
371
+ /** Homepages, instead of the root's. */
372
+ value: string | Array<{ id: string; label?: Record<string, string[]>; format?: string }> | null;
373
+ }
374
+
375
+ /** See also: machine-readable descriptions elsewhere, as a list of links. */
376
+ export interface CloverSeeAlsoElement extends HTMLElement {
377
+ /** Descriptions, instead of the root's. */
378
+ value: string | Array<{ id: string; label?: Record<string, string[]>; format?: string }> | null;
379
+ }
380
+
381
+ /** The rendering: alternate formats, such as a PDF of the whole object, as a list of links, each with its format. */
382
+ export interface CloverRenderingElement extends HTMLElement {
383
+ /** Renderings, instead of the root's. */
384
+ value: string | Array<{ id: string; label?: Record<string, string[]>; format?: string }> | null;
385
+ }
386
+
387
+ /** Part of: the Collections the resource belongs to, as a list of links. */
388
+ export interface CloverPartOfElement extends HTMLElement {
389
+ /** Collections, instead of the root's. */
390
+ value: string | Array<{ id: string; label?: Record<string, string[]>; format?: string }> | null;
391
+ }
392
+
393
+ /** The resource's id: a link to its IIIF JSON. */
394
+ export interface CloverIdElement extends HTMLElement {
395
+ /** An id, instead of the root's. */
396
+ value: string | null;
397
+ }
398
+
399
+ /** The providers: who provided the resource, each its logo and its name, linked to its homepage. With a clover-logo in it, each provider's logo alone, linked, its alt text the provider's name. */
400
+ export interface CloverProviderElement extends HTMLElement {
401
+ /** Providers (IIIF Agents), instead of the root's. */
402
+ value: Record<string, unknown> | Array<Record<string, unknown>> | null;
403
+ }
404
+
405
+ /** A provider's logo, its alt text the provider's name: each of the resource's providers' in turn. Inside a clover-provider it draws nothing itself, and the provider draws each provider's logo in its place. */
406
+ export interface CloverLogoElement extends HTMLElement {
407
+ /** Logos: images, or Agents with theirs, instead of the root's. */
408
+ value: Record<string, unknown> | Array<Record<string, unknown>> | null;
409
+ }
410
+
411
+ /** Any IIIF language map in the reader's language, read strictly by its format: text/html as sanitized HTML, text/plain as written, text/markdown as Markdown. */
412
+ export interface CloverValueElement extends HTMLElement {
413
+ /** What to show. */
414
+ value: string | Record<string, string[]> | null;
415
+ }
416
+
417
+ /** The information panel's first section, on its own: the label and thumbnail, summary, metadata, required statement, rights, homepage, see also, downloads and address. */
418
+ export interface CloverAboutElement extends HTMLElement {
419
+ }
420
+
421
+ /** The annotations, by layer and then by Canvas: each to pick, which frames it on the Body, with its region pictured. */
422
+ export interface CloverAnnotationsElement extends HTMLElement {
423
+ /** Your own drawing of an annotation's content: a node or text, in place of its bodies. A new node each time. */
424
+ renderEntry: ((entry: { id: string; canvasId: string; annotation: Record<string, unknown> }) => Node | string | null | undefined) | null;
425
+ }
426
+
427
+ /** The Collection the Manifest was reached through: its label, summary and members, each to open, its homepage and its address. */
428
+ export interface CloverCollectionElement extends HTMLElement {
429
+ }
430
+
431
+ /** A menu of the Collection's members, choosing the Manifest shown. A key steps through it and Enter opens the one stepped to. */
432
+ export interface CloverCollectionSelectElement extends HTMLElement {
433
+ }
434
+
435
+ /** The Manifest's table of contents (its Ranges), as a tree of links to each section, the one in view marked. */
436
+ export interface CloverContentsElement extends HTMLElement {
437
+ }
438
+
439
+ /** A Content Search of the Manifest, where it offers one: a field, and its hits by Canvas, each going to its place, with Previous and Next through them. */
440
+ export interface CloverSearchElement extends HTMLElement {
441
+ }
442
+
443
+ /** The recording's captions as a transcript, following where it plays, and any plain-text transcript after them. Each cue goes to its time; a field over the captions finds words in them, with steps through the cues that have them. */
444
+ export interface CloverTranscriptElement extends HTMLElement {
445
+ }
446
+
447
+ /** The renderings of the page in view and of the Manifest (a PDF, a text, a full-size file), as links in two groups, This page and All pages. Nothing while there are none. */
448
+ export interface CloverDownloadElement extends HTMLElement {
449
+ }
450
+
451
+ /** A map: inside a clover-root, its places (navPlace) and the view's georeferenced images; alone, those of the iiif-content it is given. Its places are listed under it as buttons, for the keyboard. */
452
+ export interface CloverMapElement extends HTMLElement {
453
+ /** Alone: what to map, by URL or as a IIIF resource. */
454
+ iiifContent: string | Record<string, unknown> | null;
455
+ /** Alone: GeoJSON to draw, as navPlace is. */
456
+ navPlace: Record<string, unknown> | null;
457
+ /** Alone: Georeference Extension annotations to overlay. */
458
+ georeferences: unknown[] | null;
459
+ /** Alone: credentials, headers and a fetch of your own. */
460
+ request: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch } | null;
461
+ }
462
+
463
+ /** The information panel of the clover-root it is in, in tabs or stacked boxes: the sections Clover has data for (About, Contents, Search, a Map, the Transcript, Annotations, the Collection), or its clover-tab children, in their order. */
464
+ export interface CloverPanelElement extends HTMLElement {
465
+ }
466
+
467
+ /** One tab of the clover-panel it is in: its label, and what it holds, which the panel shows in its section, moved there when the section first opens. It draws nothing itself. */
468
+ export interface CloverTabElement extends HTMLElement {
469
+ }
470
+
471
+ /** A button that shows and hides an element, the information panel's or any, by its id: open while it is not hidden. In a clover-body, it is one of the Body's controls; elsewhere, a button where it is. */
472
+ export interface CloverPanelToggleElement extends HTMLElement {
473
+ }
474
+
475
+ /** Panes side by side, its clover-split-pane children, divided by clover-split-handle bars the reader drags, clicks or moves by keyboard to share the width. */
476
+ export interface CloverSplitElement extends HTMLElement {
477
+ }
478
+
479
+ /** One side of a clover-split. One pane beside each handle has a size; the other takes the width that is left. */
480
+ export interface CloverSplitPaneElement extends HTMLElement {
481
+ }
482
+
483
+ /** The bar between two clover-split-panes, a focusable separator with a grip at its middle: drag it; click or tap it to step the pane through its narrowest, own and widest widths; or move it with the arrow keys, Home and End. Named Resize panels, or by its aria-label. */
484
+ export interface CloverSplitHandleElement extends HTMLElement {
485
+ }
486
+
487
+ /** Clover's renderer for images, video and sound. Alone, it draws what it is given: a IIIF resource by URL (a Manifest gives its first Canvas), image URLs, or Canvases as a property. Inside a clover-root, given nothing, the root's view. As tall as --clover-body-height (60vh) or its own style. */
488
+ export interface CloverCanvasElement extends HTMLElement {
489
+ /** The Canvas's handle once its view is laid out (clover-ready), as onReady hands it in React: the camera and its coordinates (handle.zoomBy(2), handle.home()). Null before. */
490
+ readonly handle: CloverCanvasHandle | null;
491
+ /** What to load and draw, as a URL or a IIIF resource. */
492
+ iiifContent: string | Record<string, unknown> | null;
493
+ /** Presentation 4 Canvases to draw, one or several shown together (a spread). */
494
+ canvases: Record<string, unknown>[] | null;
495
+ /** Image URLs, or image services with tiled. */
496
+ src: string | string[] | null;
497
+ /** Annotations to draw as hotspots, with rectangular (xywh) targets in the image's own coordinates. */
498
+ annotations: Array<{ id: string; target: string; label?: string; [key: string]: unknown }> | null;
499
+ /** The Canvas's options: the request it loads with (credentials, headers, a fetch of your own), its gestures and more. */
500
+ options: { request?: { credentials?: RequestCredentials; headers?: Record<string, string>; fetch?: typeof fetch }; [key: string]: unknown } | null;
501
+ /** The Body's controls, each replaced by a button you make: a function given the control's name, label and Clover's icon, returning the button. Clover keeps it named, keyed and in its state, presses the control with it, and adds its popover. */
502
+ controlButtons: CloverControlButtons | null;
503
+ /** Which of the Body's controls it shows, as Canvas's controls takes it: false for none, or some ({ rotation: false }), in place of the attribute. */
504
+ controls: boolean | { zoom?: boolean; fullPage?: boolean; rotation?: boolean; reset?: boolean; annotations?: boolean; information?: boolean; [option: string]: unknown } | null;
505
+ }
506
+
507
+ /** A IIIF Presentation 4 Timeline (sound), played through Canvas, with its transport, captions, chapters and annotations on its time, and its accompanying or placeholder Canvas while it plays. Alone, it plays what it is given; inside a clover-root, given nothing, the root's view when that is a Timeline. As tall as --clover-body-height (60vh) or its own style. */
508
+ export interface CloverTimelineElement extends HTMLElement {
509
+ /** What to load and play, as a URL or a IIIF resource. */
510
+ iiifContent: string | Record<string, unknown> | null;
511
+ /** A Presentation 4 Timeline to play. */
512
+ timeline: Record<string, unknown> | null;
513
+ /** Annotations on its time, each shown as a cue while its stretch plays, as Canvas's annotations property takes them. */
514
+ annotations: Record<string, unknown>[] | null;
515
+ /** As Canvas's options: request (credentials, headers) and hideDelay among them. */
516
+ options: Record<string, unknown> | null;
517
+ /** Which of the Body's controls it shows, as Canvas's controls takes it, in place of the attribute. */
518
+ controls: boolean | { information?: boolean; annotations?: boolean; [option: string]: unknown } | null;
519
+ }
520
+
521
+ /** A IIIF Presentation 4 Scene, drawn in 3D: the glTF models it paints, lit and framed, turned and zoomed by pointer, key or control. Its 3D library loads only when one is drawn. Alone, it draws what it is given; inside a clover-root, given nothing, the root's view when that is a Scene. As tall as --clover-body-height (60vh) or its own style. */
522
+ export interface CloverSceneElement extends HTMLElement {
523
+ /** What to load and draw, as a URL or a IIIF resource. */
524
+ iiifContent: string | Record<string, unknown> | null;
525
+ /** A Presentation 4 Scene to draw. */
526
+ scene: Record<string, unknown> | null;
527
+ /** request: credentials and headers for the Scene and its models; hideDelay: how long the controls stay after a mouse stops, in milliseconds. */
528
+ options: { request?: Record<string, unknown>; hideDelay?: number } | null;
529
+ /** Which of the Body's controls it shows: false for none, or some ({ rotation: false }), in place of the attribute. */
530
+ controls: boolean | { zoom?: boolean; fullPage?: boolean; rotation?: boolean; reset?: boolean; information?: boolean } | null;
531
+ }
532
+
533
+ /** The popover Clover's controls show on hover and on keyboard focus, for a control of your own: written inside your button, it shows there its label and its key. Give the button the same name (aria-label) and the key (aria-keyshortcuts): the popover is hidden from assistive technology, which reads the button. The element itself shows nothing. */
534
+ export interface CloverTipElement extends HTMLElement {
535
+ /** The key, as Clover.Tip takes it: in place of keys and glyph. */
536
+ shortcut: { keys: string; glyph: string } | null;
537
+ }
538
+
539
+ /** Read more, for text of your own: its one child, clamped by your CSS (a -webkit-line-clamp), gets a button under it once the text runs past its box, which opens it in full (aria-expanded) and cuts it short again. While open, the child carries data-read-more="open", which your clamp should leave alone. */
540
+ export interface CloverReadMoreElement extends HTMLElement {
541
+ }
542
+
543
+ declare global {
544
+ interface HTMLElementTagNameMap {
545
+ "clover-viewer": CloverViewerElement;
546
+ "clover-root": CloverRootElement;
547
+ "clover-body": CloverBodyElement;
548
+ "clover-label": CloverLabelElement;
549
+ "clover-items": CloverItemsElement;
550
+ "clover-position": CloverPositionElement;
551
+ "clover-previous": CloverPreviousElement;
552
+ "clover-next": CloverNextElement;
553
+ "clover-status": CloverStatusElement;
554
+ "clover-thumbnail": CloverThumbnailElement;
555
+ "clover-summary": CloverSummaryElement;
556
+ "clover-metadata": CloverMetadataElement;
557
+ "clover-required-statement": CloverRequiredStatementElement;
558
+ "clover-rights": CloverRightsElement;
559
+ "clover-homepage": CloverHomepageElement;
560
+ "clover-see-also": CloverSeeAlsoElement;
561
+ "clover-rendering": CloverRenderingElement;
562
+ "clover-part-of": CloverPartOfElement;
563
+ "clover-id": CloverIdElement;
564
+ "clover-provider": CloverProviderElement;
565
+ "clover-logo": CloverLogoElement;
566
+ "clover-value": CloverValueElement;
567
+ "clover-about": CloverAboutElement;
568
+ "clover-annotations": CloverAnnotationsElement;
569
+ "clover-collection": CloverCollectionElement;
570
+ "clover-collection-select": CloverCollectionSelectElement;
571
+ "clover-contents": CloverContentsElement;
572
+ "clover-search": CloverSearchElement;
573
+ "clover-transcript": CloverTranscriptElement;
574
+ "clover-download": CloverDownloadElement;
575
+ "clover-map": CloverMapElement;
576
+ "clover-panel": CloverPanelElement;
577
+ "clover-tab": CloverTabElement;
578
+ "clover-panel-toggle": CloverPanelToggleElement;
579
+ "clover-split": CloverSplitElement;
580
+ "clover-split-pane": CloverSplitPaneElement;
581
+ "clover-split-handle": CloverSplitHandleElement;
582
+ "clover-canvas": CloverCanvasElement;
583
+ "clover-timeline": CloverTimelineElement;
584
+ "clover-scene": CloverSceneElement;
585
+ "clover-tip": CloverTipElement;
586
+ "clover-read-more": CloverReadMoreElement;
587
+ }
588
+ interface GlobalEventHandlersEventMap {
589
+ "clover-canvas-change": CustomEvent<{ canvasId: string }>;
590
+ "clover-manifest-change": CustomEvent<{ manifestId: string }>;
591
+ "clover-status-change": CustomEvent<{ status: "loading" | "ready" | "error"; error: Error | null }>;
592
+ "clover-content-state-change": CustomEvent<{ json: Record<string, unknown>; encoded: string }>;
593
+ "clover-ready": CustomEvent<{ clover: CloverRootApi } | { handle: CloverCanvasHandle }>;
594
+ "clover-annotation-active": CustomEvent<{ id: string | null }>;
595
+ "clover-caption-change": CustomEvent<{ caption: { id: string; language?: string } | null }>;
596
+ "clover-ended": CustomEvent<Record<string, never>>;
597
+ "clover-select": CustomEvent<{ item: { id: string; label?: string | Record<string, string[]>; summary?: string | Record<string, string[]>; href?: string } } | { feature: { title?: string; canvasId?: string; [key: string]: unknown } }>;
598
+ "clover-change": CustomEvent<{ manifestId: string }>;
599
+ "clover-value-change": CustomEvent<{ value: string }>;
600
+ "clover-close": CustomEvent<Record<string, never>>;
601
+ "clover-open-change": CustomEvent<{ open: boolean }>;
602
+ "clover-annotation-select": CustomEvent<{ id: string | null }>;
603
+ }
604
+ }
@@ -0,0 +1 @@
1
+ import{d as n,i as o}from"./index-B7nZdqLg.mjs";export{n as defineCloverElements,o as initCloverI18n};
@@ -0,0 +1,18 @@
1
+ // Preserve the classic script URL while letting the browser load feature chunks.
2
+ // Resolve against this script, not the embedding page (including on a CDN).
3
+ (function () {
4
+ var script = document.currentScript;
5
+ if (!script || !script.src) {
6
+ throw new Error("Load Clover web components using an external script src.");
7
+ }
8
+ var url = new URL("./index.mjs", script.src).href;
9
+ // Say so when it cannot load: a CDN must serve the module beside this script, with CORS.
10
+ import(url).catch(function (error) {
11
+ console.error(
12
+ "Clover's web components could not load from " +
13
+ url +
14
+ ". Serve index.mjs and its chunks beside index.umd.js, with CORS if from another origin.",
15
+ error,
16
+ );
17
+ });
18
+ })();
@@ -0,0 +1 @@
1
+ import{j as p,E as u,o as r,O as v}from"./shared-YUjOSBKO.mjs";function g(t){var i;return(i=v(t).find(({body:a})=>a.type))==null?void 0:i.body.type}function o(t){const i=g(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:i}}const s=new WeakMap;function m(t){if(!t)return[];let i=s.get(t);if(!i){const{canvases:a,views:e}=u(t);i=e.map(y=>{const n=y.map(l=>o(a[l]));return{id:n[0].id,parts:n,label:n.length===1?n[0].label:{none:[n.map(l=>r(l.label).text).filter(Boolean).join(" \u2013 ")]}}}),s.set(t,i)}return i}const d=new WeakMap;function f(t){if(!t)return[];let i=d.get(t);return i||(i=p(t.items).filter(a=>a==null?void 0:a.id).map(a=>{var e;return{id:a.id,parts:[o(a)],label:a.label,summary:a.summary,href:((e=p(a.homepage)[0])==null?void 0:e.id)??a.id}}),d.set(t,i)),i}function O(t){return t?Array.isArray(t)?f({items:t}):t.type==="Collection"?f(t):m(t):[]}export{m as a,O as b,f as i};
@@ -0,0 +1 @@
1
+ import{T as m,u as r}from"./shared-YUjOSBKO.mjs";import{I as o}from"./Items-DRj1UEpC.mjs";import{w as n}from"./nodes-B7JRwBgl.mjs";function I({props:t}){const e=m(()=>n(t,["renderItem"]),[t]);return r(o,{...e})}export{I as ItemsElement};
@@ -0,0 +1 @@
1
+ const s=r=>!!r&&typeof r=="object"&&!Array.isArray(r)&&typeof r.id=="string"&&r.id.includes("#")&&r.type!=="SpecificResource";function c(r){if(Array.isArray(r))return r.some(c);if(!r||typeof r!="object")return false;for(const[n,e]of Object.entries(r))if(n==="target"&&(Array.isArray(e)?e:[e]).some(s)||c(e))return true;return false}function f(r){const{id:n,...e}=r,[t,i]=n.split("#");return{type:"SpecificResource",source:{...e,id:t},selector:{type:"FragmentSelector",value:i}}}function o(r){if(Array.isArray(r))return r.map(o);if(!r||typeof r!="object")return r;const n={};for(const[e,t]of Object.entries(r))n[e]=e==="target"?Array.isArray(t)?t.map(i=>s(i)?f(i):o(i)):s(t)?f(t):o(t):o(t);return n}function y(r){return c(r)?o(r):r}export{y as keepFragments};
@@ -0,0 +1 @@
1
+ import{u as e}from"./shared-YUjOSBKO.mjs";import{L as o}from"./Label-D6aVJB9s.mjs";function n({props:r}){return e(o,{...r})}export{n as LabelElement};
@@ -0,0 +1 @@
1
+ function n(e){if(!(!e||e==="none"))return e.toUpperCase()}export{n as l};