@nulib/clover 4.2.0 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Canvas/CanvasView.mjs +33 -4
- package/dist/components/Canvas/ChaptersMenu.mjs +6 -1
- package/dist/components/Canvas/ControlMenu.mjs +9 -2
- package/dist/components/Canvas/Controls.mjs +17 -4
- package/dist/components/Canvas/FrameAnimation.mjs +3 -0
- package/dist/components/Canvas/ImageControls.mjs +8 -3
- package/dist/components/Canvas/Placeholder.mjs +5 -2
- package/dist/components/Canvas/RowFits.mjs +3 -1
- package/dist/components/Canvas/media/MediaBody.mjs +3 -0
- package/dist/components/Canvas/media/Player.mjs +3 -0
- package/dist/components/Canvas/media/Transport.mjs +3 -0
- package/dist/components/Canvas/media/useMediaElement.mjs +32 -9
- package/dist/components/Items/masonry.mjs +2 -0
- package/dist/components/Map/MapView.mjs +42 -2
- package/dist/components/Map/maplibre-sheet.mjs +5 -0
- package/dist/components/Map/sheet.mjs +19 -0
- package/dist/components/Map/worker.mjs +28 -1
- package/dist/components/Scene/SceneView.mjs +3 -0
- package/dist/core/content-state.mjs +1 -11
- package/dist/core/load.mjs +9 -1
- package/dist/core/presentation.mjs +4 -5
- package/dist/core/sanitize.mjs +15 -3
- package/dist/core/svg-shape.mjs +2 -1
- package/dist/core/thumbnail.mjs +15 -4
- package/dist/core/trusted.mjs +26 -0
- package/dist/core/vtt.mjs +20 -9
- package/dist/index.d.mts +200 -1
- package/dist/index.mjs +11 -0
- package/dist/lib/renderer/CanvasRenderer.mjs +48 -7
- package/dist/lib/renderer/camera/CameraAnimator.mjs +39 -20
- package/dist/lib/renderer/input/GestureController.mjs +15 -5
- package/dist/map/index.d.mts +6 -1
- package/dist/styles/collection-select.css +1 -0
- package/dist/styles/core.css +1 -0
- package/dist/styles/default.css +1 -0
- package/dist/styles/items.css +1 -0
- package/dist/styles/map.css +1 -0
- package/dist/{web-components/Transport-VUxSEIQO.mjs → styles/media.css} +1 -1
- package/dist/styles/panel.css +1 -0
- package/dist/styles/scene.css +1 -0
- package/dist/styles/split.css +1 -0
- package/dist/styles.css +1 -1
- package/dist/templates/default/Default.mjs +2 -0
- package/dist/templates/document/Document.mjs +12 -2
- package/dist/templates/document/Sheets.mjs +2 -0
- package/dist/templates/gallery/Gallery.mjs +3 -1
- package/dist/templates/index.d.mts +102 -6
- package/dist/templates/shared/Lightbox.mjs +50 -3
- package/dist/templates/shared/LightboxView.mjs +3 -1
- package/dist/templates.css +1 -1
- package/dist/ui/Button.mjs +3 -1
- package/dist/ui/ControlCluster.mjs +6 -3
- package/dist/ui/Markup.mjs +8 -7
- package/dist/ui/Tip.mjs +6 -1
- package/dist/ui/adoptSheet.mjs +19 -0
- package/dist/ui/sheets/map.mjs +5 -0
- package/dist/ui/sheets/media.mjs +5 -0
- package/dist/ui/sheets/scene.mjs +5 -0
- package/dist/web-components/{About-D1TBGGPL.mjs → About-uNCjvWgs.mjs} +1 -1
- package/dist/web-components/{AnnotationItems-DTacmRA9.mjs → AnnotationItems-JwlcCvPo.mjs} +1 -1
- package/dist/web-components/{AnnotationMenu-DYc9ekWS.mjs → AnnotationMenu-BWyKEyvW.mjs} +1 -1
- package/dist/web-components/{AnnotationState--5ghW0C2.mjs → AnnotationState-Bhqs75Br.mjs} +1 -1
- package/dist/web-components/{Annotations-BG8lPjk1.mjs → Annotations-C7y0N8Lj.mjs} +1 -1
- package/dist/web-components/{Annotations-Bvc_FmJ5.mjs → Annotations-ZwcRh2UE.mjs} +2 -2
- package/dist/web-components/{Body-QQ1DmnbP.mjs → Body-DyrvRDkt.mjs} +1 -1
- package/dist/web-components/{BodyAlert-A4xRjOKr.mjs → BodyAlert-XV88XjL8.mjs} +1 -1
- package/dist/web-components/Button-BIaw5k1q.mjs +1 -0
- package/dist/web-components/{Camera-DqT_1MgD.mjs → Camera-7SlnmGtb.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-TZtR3zHf.mjs → Canvas2DBackend-DBGZRGid.mjs} +1 -1
- package/dist/web-components/CanvasView-CmDxczm9.mjs +2 -0
- package/dist/web-components/{CaptionDetails-DMRWmtaY.mjs → CaptionDetails-Bxz8AXMz.mjs} +1 -1
- package/dist/web-components/ChaptersMenu-CMQiBqvx.mjs +1 -0
- package/dist/web-components/{Chevron-DFGbSGPI.mjs → Chevron-B3XaClVT.mjs} +1 -1
- package/dist/web-components/{ChoiceMenu-C80kdxvq.mjs → ChoiceMenu-pugo5zxI.mjs} +1 -1
- package/dist/web-components/{Collection-B4CxBsFL.mjs → Collection-Ch_FeSKp.mjs} +1 -1
- package/dist/web-components/{CollectionSelect-DO8YO2p7.mjs → CollectionSelect-2jDEkOcK.mjs} +1 -1
- package/dist/web-components/{Connected-DthCPaHl.mjs → Connected-3hnIPSWM.mjs} +1 -1
- package/dist/web-components/{Connected-sYBn_9MK.mjs → Connected-Bne3I5E1.mjs} +1 -1
- package/dist/web-components/{Connected-CcbVqzmj.mjs → Connected-DuANHN93.mjs} +1 -1
- package/dist/web-components/{Contents-AVPYYXht.mjs → Contents-DIQrin_-.mjs} +1 -1
- package/dist/web-components/ControlMenu-BydnCTTQ.mjs +1 -0
- package/dist/web-components/ControlsFade-CleBsk-W.mjs +1 -0
- package/dist/web-components/CountMenu-CReBYVwu.mjs +1 -0
- package/dist/web-components/Cue-2zGQuUOC.mjs +1 -0
- package/dist/web-components/Document-pjc2qOX4.mjs +1 -0
- package/dist/web-components/{DomLayers-DlRapZ1u.mjs → DomLayers-D9X_FPto.mjs} +1 -1
- package/dist/web-components/{Download-Ci_JUTVd.mjs → Download-B8MpVqgk.mjs} +1 -1
- package/dist/web-components/{EntryBodies-C0ICfS2R.mjs → EntryBodies-DdpRfU5U.mjs} +1 -1
- package/dist/web-components/{EntryThumbnail-DxHhfRo_.mjs → EntryThumbnail-DM7Zjj1z.mjs} +1 -1
- package/dist/web-components/{FieldPill-CVfeeafm.mjs → FieldPill-BAql8_6s.mjs} +1 -1
- package/dist/web-components/{FrameAnimation-AZpVvu0R.mjs → FrameAnimation-Dj46RxuL.mjs} +1 -1
- package/dist/web-components/Gallery-B9FNA02Z.mjs +1 -0
- package/dist/web-components/{HideToggle-0nlIo-f8.mjs → HideToggle-duXvDvDw.mjs} +1 -1
- package/dist/web-components/ImageControls-DODKjC0d.mjs +1 -0
- package/dist/web-components/{Items-Drd82_Jj.mjs → Items-BHTQJU7T.mjs} +1 -1
- package/dist/web-components/{Label-BIjqJ-_T.mjs → Label-D4dlrtpH.mjs} +1 -1
- package/dist/web-components/{LanguageChoice-DkSc-n6g.mjs → LanguageChoice-DR3X-dtJ.mjs} +1 -1
- package/dist/web-components/LightboxView-D-aBaKfB.mjs +1 -0
- package/dist/web-components/{ListEnd-pq-BgaDI.mjs → ListEnd-CQ4vX-NW.mjs} +1 -1
- package/dist/web-components/{Loaded-CSO5NFhm.mjs → Loaded-DsNSPXWf.mjs} +1 -1
- package/dist/web-components/{LoadedCanvas-DK6xMmM1.mjs → LoadedCanvas-Cq7_O2bw.mjs} +1 -1
- package/dist/web-components/LoadedMap-0_prxuA4.mjs +1 -0
- package/dist/web-components/{Loading-CoJLSRkv.mjs → Loading-4PmhMeZ-.mjs} +1 -1
- package/dist/web-components/{Map-BEVtD52O.mjs → Map-B29Ba50b.mjs} +1 -1
- package/dist/web-components/MapView-nHeg39Kz.mjs +3 -0
- package/dist/web-components/Markup-BZ7l5GbG.mjs +2 -0
- package/dist/web-components/MediaBody-DH-rr_0N.mjs +1 -0
- package/dist/web-components/{MediaBody-Co23JjUJ.mjs → MediaBody-eSThjFzH.mjs} +1 -1
- package/dist/web-components/{NavDate-CYNK0Qmp.mjs → NavDate-0MsHRjBW.mjs} +1 -1
- package/dist/web-components/{Navigator-DrYPepzN.mjs → Navigator-qJ79A8Nk.mjs} +1 -1
- package/dist/web-components/{Pager-CN4lHURv.mjs → Pager-SPd_u0qz.mjs} +1 -1
- package/dist/web-components/{PagerLayout-DeqnSQcF.mjs → PagerLayout-CkSwDAnp.mjs} +1 -1
- package/dist/web-components/{Panel-CFYUlXup.mjs → Panel-C8r3EsWn.mjs} +1 -1
- package/dist/web-components/PanelPart-BA1NoeLA.mjs +1 -0
- package/dist/web-components/{PanelToggle-9ud55NNI.mjs → PanelToggle-CrKP8BqE.mjs} +1 -1
- package/dist/web-components/{PartOfManifest-KUHUq-6q.mjs → PartOfManifest-BdDSxK4k.mjs} +1 -1
- package/dist/web-components/{Pending-mcmdyZPA.mjs → Pending-CmgVU1kF.mjs} +1 -1
- package/dist/web-components/{PlaceBox-DX4ZLDat.mjs → PlaceBox-D7HLNGxE.mjs} +1 -1
- package/dist/web-components/Placeholder-DVAlXejQ.mjs +1 -0
- package/dist/web-components/{Position-DO5qg5Sp.mjs → Position-C6KUAceQ.mjs} +1 -1
- package/dist/web-components/{Primitives-c9sIz0oQ.mjs → Primitives-ClQVjY6x.mjs} +1 -1
- package/dist/web-components/{Provider-a3xY016W.mjs → Provider-C0IUdU6v.mjs} +1 -1
- package/dist/web-components/{ReadMore-D_WmmKEP.mjs → ReadMore-BiEJA4yO.mjs} +1 -1
- package/dist/web-components/Root-Drt5N4_s.mjs +1 -0
- package/dist/web-components/Scene-C7t16NjC.mjs +1 -0
- package/dist/web-components/SceneView-BHg37-rs.mjs +1 -0
- package/dist/web-components/{Search-BgxEW1UT.mjs → Search-Bpd_lGzH.mjs} +1 -1
- package/dist/web-components/{Sections-DZVrhoAC.mjs → Sections-D_bS5IQH.mjs} +1 -1
- package/dist/web-components/{StandaloneItems-6cSw7nbF.mjs → StandaloneItems-YV9O9M8F.mjs} +1 -1
- package/dist/web-components/{Status-DHTzuTkh.mjs → Status-BCG7AN9B.mjs} +1 -1
- package/dist/web-components/{Steps-Dkpy9KiJ.mjs → Steps-Dnn8Ajqf.mjs} +1 -1
- package/dist/web-components/TargetItems-xxbtePln.mjs +1 -0
- package/dist/web-components/Timeline-Danuk_Nn.mjs +1 -0
- package/dist/web-components/Tip-DPFWlNLu.mjs +1 -0
- package/dist/web-components/{Transcript-WvFFAJQM.mjs → Transcript-C-_DbUO5.mjs} +1 -1
- package/dist/web-components/{Transport-FxLp_bdW.mjs → Transport-BKona8RD.mjs} +1 -1
- package/dist/web-components/Transport-Bonmu77-.mjs +1 -0
- package/dist/web-components/{annotation-collection-BkC3nBPA.mjs → annotation-collection-nmxzo_hO.mjs} +1 -1
- package/dist/web-components/{annotation-name-Du2KAWoD.mjs → annotation-name-DoUUo-8D.mjs} +1 -1
- package/dist/web-components/{annotations-content-CEzAS-P2.mjs → annotations-content-Cl1upbdd.mjs} +1 -1
- package/dist/web-components/{body-DPlfbLt3.mjs → body-DC8Oq8rY.mjs} +1 -1
- package/dist/web-components/{canvas-BUwBftJW.mjs → canvas-gzoTnBxw.mjs} +1 -1
- package/dist/web-components/{cloverEngine-UNw5K4Xg.mjs → cloverEngine-CFL1Bd7n.mjs} +1 -1
- package/dist/web-components/{content-state-reader-GgQF2MvJ.mjs → content-state-reader-DYbmXxCp.mjs} +1 -1
- package/dist/web-components/controlGlyphs-d7KUIUwi.mjs +1 -0
- package/dist/web-components/{controls-CC9G5LxK.mjs → controls-VC9D1mwr.mjs} +1 -1
- package/dist/web-components/custom-elements.json +10 -2
- package/dist/web-components/{downloads-CmAYeEIz.mjs → downloads-D2cnWDbs.mjs} +1 -1
- package/dist/web-components/{dragToClose-DK-eM097.mjs → dragToClose-CzYeh_12.mjs} +1 -1
- package/dist/web-components/{engine-Dok0z8WP.mjs → engine-Dcfyp2DV.mjs} +1 -1
- package/dist/web-components/{engines-BD2IfwQF.mjs → engines-BMr7naGM.mjs} +1 -1
- package/dist/web-components/{fetchManifest-tQXcfFiz.mjs → fetchManifest-DxptUh4u.mjs} +1 -1
- package/dist/web-components/{fromManifest-BwQdeAuL.mjs → fromManifest-BpPFLVyZ.mjs} +1 -1
- package/dist/web-components/{glyphs-dp_HK3Ja.mjs → glyphs-BCnJl8py.mjs} +1 -1
- package/dist/web-components/hooks-Dz_5UXXp.mjs +1 -0
- package/dist/web-components/{image-layers-xcBsiad9.mjs → image-layers-BPnq7jk1.mjs} +1 -1
- package/dist/web-components/{imageService-4sFnmAFX.mjs → imageService-DFPkPNfe.mjs} +1 -1
- package/dist/web-components/index-ClM6Kq8w.mjs +1 -0
- package/dist/web-components/index.d.mts +4 -2
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/items-BHporT5i.mjs +1 -0
- package/dist/web-components/{items-BUmOy2QY.mjs → items-D03KhDg6.mjs} +1 -1
- package/dist/web-components/label-r0ki6r1U.mjs +1 -0
- package/dist/web-components/{layout-B29v2RKK.mjs → layout-DVa_DnGH.mjs} +1 -1
- package/dist/web-components/{link-Ct5PpHEY.mjs → link-DxXxMXiw.mjs} +1 -1
- package/dist/web-components/logo-Br42Vlsk.mjs +1 -0
- package/dist/web-components/maplibre-sheet-CfiZ6JFk.mjs +1 -0
- package/dist/web-components/masonry-BZCdA3bV.mjs +1 -0
- package/dist/web-components/{models-BXcT4ijX.mjs → models-pO77sm3z.mjs} +1 -1
- package/dist/web-components/{nodes-BleXuYE6.mjs → nodes-CmL3eoRE.mjs} +1 -1
- package/dist/web-components/{overlayImage-BJtfot4Y.mjs → overlayImage-DFGetjMh.mjs} +1 -1
- package/dist/web-components/{panel-BxxV_JkD.mjs → panel-B1vzUm6_.mjs} +1 -1
- package/dist/web-components/part-DmRBh4pf.mjs +1 -0
- package/dist/web-components/{playerSurface-BXNLaFk0.mjs → playerSurface-CQ1wrIAQ.mjs} +1 -1
- package/dist/web-components/pointer-DWnCT3D3.mjs +1 -0
- package/dist/web-components/{provider-CPp0Sgr_.mjs → provider-U7xzX_0T.mjs} +1 -1
- package/dist/web-components/{range-regions-DAaOu0IS.mjs → range-regions-Di_lmVqZ.mjs} +1 -1
- package/dist/web-components/{read-more-lcqGslUd.mjs → read-more-BtA1sriO.mjs} +1 -1
- package/dist/web-components/{readingLanguages-FyVsSWJ8.mjs → readingLanguages-Ptho-Co9.mjs} +1 -1
- package/dist/web-components/rendererSurface-BgZPnAwj.mjs +22 -0
- package/dist/web-components/{renderers-BFS7hFVU.mjs → renderers-hoD3WKYA.mjs} +1 -1
- package/dist/web-components/{resource-Bufu7lAr.mjs → resource-DuTMsPEj.mjs} +1 -1
- package/dist/web-components/{sanitize-qIOeyIww.mjs → sanitize-BedC_UE5.mjs} +3 -3
- package/dist/web-components/{save-file-CoknKOPz.mjs → save-file-CLB5IM4a.mjs} +1 -1
- package/dist/web-components/{search-5ocrsYmT.mjs → search-Dd2Y1dsZ.mjs} +1 -1
- package/dist/web-components/shared-CCg1Iag8.mjs +1 -0
- package/dist/web-components/{show-link-DBaJj4s_.mjs → show-link-NjacLIdz.mjs} +1 -1
- package/dist/web-components/{sizedImage-jnOGcIIZ.mjs → sizedImage-CKOGmqhN.mjs} +1 -1
- package/dist/web-components/{split-P6J0qqf5.mjs → split-CcoXZcGX.mjs} +1 -1
- package/dist/web-components/{status-honoOMNx.mjs → status-B4a3Izph.mjs} +1 -1
- package/dist/web-components/styles-C7PVxtkQ.mjs +1 -0
- package/dist/web-components/svg-shape-D1K-WNrY.mjs +1 -0
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/thumbnail-ez20ssEY.mjs +1 -0
- package/dist/web-components/{tip-BhNI83aT.mjs → tip-DeFPN33O.mjs} +1 -1
- package/dist/web-components/{toggle-CJKdi5KH.mjs → toggle-CGSnnjW-.mjs} +1 -1
- package/dist/web-components/trusted-Bvpx307M.mjs +1 -0
- package/dist/web-components/{useContainerName-_48Cdi0m.mjs → useContainerName-BfyeBf6_.mjs} +1 -1
- package/dist/web-components/{useControlsVisibility-CieBxGnK.mjs → useControlsVisibility-oRiMiQhD.mjs} +1 -1
- package/dist/web-components/useLazyPanelPane-CReKsr8z.mjs +1 -0
- package/dist/web-components/{useNearViewport-B34ebmIW.mjs → useNearViewport-BADiMpLi.mjs} +1 -1
- package/dist/web-components/{useScrollTrack-DgRGFeP5.mjs → useScrollTrack-9QsMaHSx.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationItems-BNA_92Dv.mjs → AnnotationItems-Cvh3jfmf.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationMenu-BIQYVR4N.mjs → AnnotationMenu-d5PT7q8D.mjs} +1 -1
- package/dist/web-components/viewer/{AnnotationState-BbwQqA1U.mjs → AnnotationState-DbtYTHMy.mjs} +1 -1
- package/dist/web-components/viewer/{Annotations-CZzOZAFP.mjs → Annotations-DKWYJOo2.mjs} +2 -2
- package/dist/web-components/viewer/{Annotations-P4XzAlNc.mjs → Annotations-D_wg4O99.mjs} +1 -1
- package/dist/web-components/viewer/{Canvas2DBackend-DFfCzyjL.mjs → Canvas2DBackend-B4IXvdsN.mjs} +1 -1
- package/dist/web-components/viewer/{CaptionDetails-DPtE-RQQ.mjs → CaptionDetails-Bxh9VD7n.mjs} +1 -1
- package/dist/web-components/viewer/ChaptersMenu-CaAIaRZN.mjs +1 -0
- package/dist/web-components/viewer/{ChoiceMenu-GkqyTQRQ.mjs → ChoiceMenu-Clp4Zeog.mjs} +1 -1
- package/dist/web-components/viewer/{Collection-DjY_6qa6.mjs → Collection-C5BfoUOH.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-DIOuI3Mv.mjs → Connected-9VGl2Xnx.mjs} +1 -1
- package/dist/web-components/viewer/{Connected-D5T-mtiy.mjs → Connected-Cd2qwuuo.mjs} +1 -1
- package/dist/web-components/viewer/{Contents-DV-VxXuf.mjs → Contents-CsG9e7v2.mjs} +1 -1
- package/dist/web-components/viewer/ControlMenu-q_u_UC8q.mjs +1 -0
- package/dist/web-components/viewer/ControlsFade-Db3IWArv.mjs +1 -0
- package/dist/web-components/viewer/CountMenu-Dn0-z5A9.mjs +1 -0
- package/dist/web-components/viewer/Cue-slOJQhPI.mjs +1 -0
- package/dist/web-components/viewer/Document-r3Sz3RfH.mjs +1 -0
- package/dist/web-components/viewer/{DomLayers-BCwCxPDU.mjs → DomLayers-CwHg1jZg.mjs} +1 -1
- package/dist/web-components/viewer/{Download-CL4IClAD.mjs → Download-Clx_e2ga.mjs} +1 -1
- package/dist/web-components/viewer/{EntryBodies-e40y47bl.mjs → EntryBodies-B4SnV6NJ.mjs} +1 -1
- package/dist/web-components/viewer/{EntryThumbnail-B_dP3w4o.mjs → EntryThumbnail-CsAqKh38.mjs} +1 -1
- package/dist/web-components/viewer/{FieldPill-Hse1cDBE.mjs → FieldPill-NQfq8SXA.mjs} +1 -1
- package/dist/web-components/viewer/{FrameAnimation-CE218DCr.mjs → FrameAnimation-wN2VNW7D.mjs} +1 -1
- package/dist/web-components/viewer/Gallery-nX9kQlft.mjs +1 -0
- package/dist/web-components/viewer/{HideToggle-CYoqe_ez.mjs → HideToggle-B843JuKU.mjs} +1 -1
- package/dist/web-components/viewer/ImageControls--qeUY5kg.mjs +1 -0
- package/dist/web-components/viewer/{LanguageChoice-BmO-322r.mjs → LanguageChoice-CZ6K3Mhv.mjs} +1 -1
- package/dist/web-components/viewer/LightboxView-BcbP3cJD.mjs +1 -0
- package/dist/web-components/viewer/{ListEnd-DX1jsvJk.mjs → ListEnd-DbYDv46a.mjs} +1 -1
- package/dist/web-components/viewer/MapView-Dj7Iq7P2.mjs +3 -0
- package/dist/web-components/viewer/MediaBody-TN4XsCm7.mjs +1 -0
- package/dist/web-components/viewer/{MediaBody-SkIgrEMj.mjs → MediaBody-iAxGgXNy.mjs} +1 -1
- package/dist/web-components/viewer/{NavDate-BZgeaMG9.mjs → NavDate-Clj6OMa6.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-Co76p-1n.mjs → Navigator-DPdR3SYX.mjs} +1 -1
- package/dist/web-components/viewer/{PagerLayout-tUkN1-FV.mjs → PagerLayout-CtlmDRjI.mjs} +1 -1
- package/dist/web-components/viewer/PanelPart-DzZWRlK1.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-DXnbEPzS.mjs → PartOfManifest-NAXs2DYd.mjs} +1 -1
- package/dist/web-components/viewer/{PlaceBox-xrJ4CGdN.mjs → PlaceBox-C2k5Fsfo.mjs} +1 -1
- package/dist/web-components/viewer/Placeholder-DF6dRMjt.mjs +1 -0
- package/dist/web-components/viewer/{Search-DTg1cHZ3.mjs → Search-DoUc8tWu.mjs} +1 -1
- package/dist/web-components/viewer/{StandaloneItems-BpBEQG8i.mjs → StandaloneItems-DuXasJO0.mjs} +1 -1
- package/dist/web-components/viewer/{Steps-SpwMQdCL.mjs → Steps-B3MrG4Cv.mjs} +1 -1
- package/dist/web-components/viewer/TargetItems-DOFSQtYR.mjs +1 -0
- package/dist/web-components/viewer/{Transcript-rTAhuXCF.mjs → Transcript-Dy-FHWMo.mjs} +1 -1
- package/dist/web-components/viewer/Transport-C5wkxVOF.mjs +1 -0
- package/dist/web-components/viewer/{Transport-vKIDALE-.mjs → Transport-CUXmY_jW.mjs} +1 -1
- package/dist/web-components/viewer/{annotation-collection-B7pZiLVk.mjs → annotation-collection-A0PNdPhI.mjs} +1 -1
- package/dist/web-components/viewer/annotation-name-CfQs7Mb2.mjs +1 -0
- package/dist/web-components/viewer/{annotations-content-9AtLlPNn.mjs → annotations-content-B52-zM99.mjs} +1 -1
- package/dist/web-components/viewer/{cloverEngine-jRrYLrWa.mjs → cloverEngine-4sgpB7Rz.mjs} +1 -1
- package/dist/web-components/viewer/{content-state-reader-CPvkju6Q.mjs → content-state-reader-vtATl-W3.mjs} +1 -1
- package/dist/web-components/viewer/{dragToClose-Co9kGk9q.mjs → dragToClose-B4rj1D3r.mjs} +1 -1
- package/dist/web-components/viewer/{fetchManifest-D7N9WhhF.mjs → fetchManifest-gAj8phm4.mjs} +1 -1
- package/dist/web-components/viewer/{host-DMD9LE4H.mjs → host-Hv8WXfiF.mjs} +1 -1
- package/dist/web-components/viewer/{image-layers-x_shzPvu.mjs → image-layers-gFEDKVkV.mjs} +1 -1
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-DikPGzNO.mjs → link-DIh6ysyo.mjs} +1 -1
- package/dist/web-components/viewer/{overlayImage-33kKKB0T.mjs → overlayImage-BRjcH40Q.mjs} +1 -1
- package/dist/web-components/viewer/{range-regions-TH6WWGTT.mjs → range-regions-uPqjKIER.mjs} +1 -1
- package/dist/web-components/viewer/{renderers-BxePmixF.mjs → renderers-C5EfPrd7.mjs} +1 -1
- package/dist/web-components/viewer/{save-file-QXKiPlST.mjs → save-file-dIa0LCAn.mjs} +1 -1
- package/dist/web-components/viewer/{search-B_NePyas.mjs → search-Bbv9dCNq.mjs} +1 -1
- package/dist/web-components/viewer/styles-L1HpSoL2.mjs +1 -0
- package/dist/web-components/viewer/{useControlsVisibility-Cu-jTDzs.mjs → useControlsVisibility-jopIdHZi.mjs} +1 -1
- package/dist/web-components/viewer/useLazyPanelPane-CoPgtYkx.mjs +1 -0
- package/dist/web-components/viewer/viewer-DqpSyvH-.mjs +29 -0
- package/dist/web-components/viewer/vtt-DpgB_K8v.mjs +5 -0
- package/dist/web-components/viewer-D2lGdifc.mjs +1 -0
- package/dist/web-components/vtt-KUQbi4PK.mjs +5 -0
- package/dist/web-components/worker-C9aVbya_.mjs +1 -0
- package/package.json +2 -1
- package/dist/web-components/Button-Cx6VE_UW.mjs +0 -1
- package/dist/web-components/CanvasView-DxZASM9E.mjs +0 -2
- package/dist/web-components/ChaptersMenu-BAZVVDrK.mjs +0 -1
- package/dist/web-components/ControlMenu-BjJsWnuZ.mjs +0 -1
- package/dist/web-components/ControlsFade-C-6WhSxB.mjs +0 -1
- package/dist/web-components/CountMenu-Dx8D_RJZ.mjs +0 -1
- package/dist/web-components/Cue-xuo5dgKE.mjs +0 -1
- package/dist/web-components/Document-BWdafeEi.mjs +0 -1
- package/dist/web-components/Gallery-C2PTJmvN.mjs +0 -1
- package/dist/web-components/ImageControls-tKVAMpaj.mjs +0 -1
- package/dist/web-components/LightboxView-Cuqx2H1m.mjs +0 -1
- package/dist/web-components/LoadedMap-DmPH-LKY.mjs +0 -1
- package/dist/web-components/MapView-DHJcn9gW.mjs +0 -3
- package/dist/web-components/Markup-Hm6bWOjm.mjs +0 -2
- package/dist/web-components/MediaBody-BpgNtpKZ.mjs +0 -1
- package/dist/web-components/PanelPart-CpUIRbxr.mjs +0 -1
- package/dist/web-components/Placeholder-0hE8q-SY.mjs +0 -1
- package/dist/web-components/Root-CU1o0wje.mjs +0 -1
- package/dist/web-components/Scene-CboEeptc.mjs +0 -1
- package/dist/web-components/SceneView-hcc78jQT.mjs +0 -1
- package/dist/web-components/TargetItems-CyOI9_Z4.mjs +0 -1
- package/dist/web-components/Timeline-B9tD3Rar.mjs +0 -1
- package/dist/web-components/Tip-nJSTYquc.mjs +0 -1
- package/dist/web-components/hooks-C4dJ5K_D.mjs +0 -1
- package/dist/web-components/index-DspT4wUm.mjs +0 -1
- package/dist/web-components/items-CWMI53aN.mjs +0 -1
- package/dist/web-components/label-BGjL7I4b.mjs +0 -1
- package/dist/web-components/logo-BFstM-0a.mjs +0 -1
- package/dist/web-components/masonry-0QfzOgbB.mjs +0 -1
- package/dist/web-components/part-D4gjnYmT.mjs +0 -1
- package/dist/web-components/pointer-CJELU3gI.mjs +0 -1
- package/dist/web-components/rendererSurface-nh6-EfuZ.mjs +0 -22
- package/dist/web-components/shared-DFAX0n3B.mjs +0 -1
- package/dist/web-components/styles-BwkYiCLC.mjs +0 -1
- package/dist/web-components/svg-shape-DLY3g7oq.mjs +0 -1
- package/dist/web-components/thumbnail-EbURh-UM.mjs +0 -1
- package/dist/web-components/useLazyPanelPane-Da3kJiOt.mjs +0 -1
- package/dist/web-components/viewer/ChaptersMenu-D6Jmujag.mjs +0 -1
- package/dist/web-components/viewer/ControlMenu-BsEpff6N.mjs +0 -1
- package/dist/web-components/viewer/ControlsFade-BowtN96W.mjs +0 -1
- package/dist/web-components/viewer/CountMenu-DCmA6HdK.mjs +0 -1
- package/dist/web-components/viewer/Cue-BjbVzrpl.mjs +0 -1
- package/dist/web-components/viewer/Document-4ZQd3W3o.mjs +0 -1
- package/dist/web-components/viewer/Gallery-F2sVj4ph.mjs +0 -1
- package/dist/web-components/viewer/ImageControls-C2G4x2Es.mjs +0 -1
- package/dist/web-components/viewer/LightboxView-DKR8dXcg.mjs +0 -1
- package/dist/web-components/viewer/MapView-Df0wZjCh.mjs +0 -3
- package/dist/web-components/viewer/MediaBody-CataNonO.mjs +0 -1
- package/dist/web-components/viewer/PanelPart-Cl4Sst60.mjs +0 -1
- package/dist/web-components/viewer/Placeholder-B1AcizHL.mjs +0 -1
- package/dist/web-components/viewer/TargetItems-B6Icep5k.mjs +0 -1
- package/dist/web-components/viewer/Transport-z_kdVisw.mjs +0 -1
- package/dist/web-components/viewer/annotation-name-BKj1O9lA.mjs +0 -1
- package/dist/web-components/viewer/styles-Bedyz7_l.mjs +0 -1
- package/dist/web-components/viewer/useLazyPanelPane-BhLtRixT.mjs +0 -1
- package/dist/web-components/viewer/viewer-nfPJPwwt.mjs +0 -29
- package/dist/web-components/viewer/vtt-CUn4h5JB.mjs +0 -5
- package/dist/web-components/viewer-DN2Mo3vc.mjs +0 -1
- package/dist/web-components/vtt-C5M5WPSG.mjs +0 -5
- package/dist/web-components/worker-CjXN0dku.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -721,6 +721,15 @@ export interface GestureOptions {
|
|
|
721
721
|
* or sound, always fitted to the Body).
|
|
722
722
|
*/
|
|
723
723
|
navigable: boolean;
|
|
724
|
+
/**
|
|
725
|
+
* A mouse or pen drag tracks the pointer 1:1 and glides on after a fast release. Off,
|
|
726
|
+
* the drag is eased instead and stops where the pointer does. A finger always tracks 1:1 and flicks.
|
|
727
|
+
*/
|
|
728
|
+
flickEnabled: boolean;
|
|
729
|
+
/** Release speed, px/s, below which a drag does not flick. */
|
|
730
|
+
flickMinSpeed: number;
|
|
731
|
+
/** Seconds of release velocity the flick travels. */
|
|
732
|
+
flickMomentum: number;
|
|
724
733
|
}
|
|
725
734
|
export type BackendPreference = "auto" | BackendKind;
|
|
726
735
|
export type CanvasRendererEvent =
|
|
@@ -793,6 +802,9 @@ export interface RegionShare {
|
|
|
793
802
|
* nor than its limits, at level 0 only a size it lists (Mat, 2026-10-24: "be
|
|
794
803
|
* responsible when making IIIF image server requests"). What a manifest says of a
|
|
795
804
|
* service is not trusted to say what its server does.
|
|
805
|
+
* - A `thumbnail` whose own `width` and `height` already fit the size (`resolveThumbnail`)
|
|
806
|
+
* is used as the manifest gives it, with no `info.json` read: the publisher's own URL,
|
|
807
|
+
* not one built from what a service says.
|
|
796
808
|
* - Without a service, the image itself is used.
|
|
797
809
|
*/
|
|
798
810
|
export interface ThumbnailSource {
|
|
@@ -807,6 +819,11 @@ export interface ThumbnailSource {
|
|
|
807
819
|
region?: RegionShare | string;
|
|
808
820
|
/** Used if the service cannot answer. */
|
|
809
821
|
fallback?: string;
|
|
822
|
+
/** The pixels `fallback` is, as its own `width` and `height` say (a `thumbnail`'s). */
|
|
823
|
+
fallbackSize?: {
|
|
824
|
+
width: number;
|
|
825
|
+
height: number;
|
|
826
|
+
};
|
|
810
827
|
}
|
|
811
828
|
/**
|
|
812
829
|
* Where a resource's thumbnail comes from, to be sized by `resolveThumbnail`. Null if it
|
|
@@ -823,6 +840,9 @@ export declare function stillSource(resource: unknown): ThumbnailSource | null;
|
|
|
823
840
|
/**
|
|
824
841
|
* A source's URL at about `size` pixels on its longer side: a service's, made from its own
|
|
825
842
|
* `info.json` (`sizedImageUrl`), else the fallback, as where the service cannot answer.
|
|
843
|
+
* The fallback itself, with no `info.json` read, when it is all of the image and its
|
|
844
|
+
* longer side is from `size` to twice it: no blurrier than the service would be asked
|
|
845
|
+
* for, and not much heavier.
|
|
826
846
|
*/
|
|
827
847
|
export declare function resolveThumbnail(source: ThumbnailSource, size?: number, request?: CloverRequest): Promise<string | undefined>;
|
|
828
848
|
/**
|
|
@@ -919,7 +939,14 @@ export type ControlButtonProps = {
|
|
|
919
939
|
lang?: string;
|
|
920
940
|
/** The key the Canvas answers to for this control, when it has one. */
|
|
921
941
|
"aria-keyshortcuts"?: string;
|
|
942
|
+
/** Absent while the control would do nothing, as at the greatest zoom. */
|
|
922
943
|
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
944
|
+
/**
|
|
945
|
+
* `true` while the control would do nothing: zoom in at the greatest zoom, zoom out at
|
|
946
|
+
* the least, reset at home. Spread it with the rest, never as `disabled`, which would
|
|
947
|
+
* take the button from the keyboard (WCAG 2.4.3), and dim it.
|
|
948
|
+
*/
|
|
949
|
+
"aria-disabled"?: true;
|
|
923
950
|
/** On a control that opens a menu (the Choice control): its state and target. */
|
|
924
951
|
"aria-expanded"?: boolean;
|
|
925
952
|
"aria-controls"?: string;
|
|
@@ -987,6 +1014,15 @@ export interface CloverCanvasOptions {
|
|
|
987
1014
|
minZoomImageRatio?: number;
|
|
988
1015
|
/** Seconds for an animation to close most of its distance. 0 disables easing. */
|
|
989
1016
|
animationTime?: number;
|
|
1017
|
+
/**
|
|
1018
|
+
* Seconds each animation (zoom, glide, home) takes, on a fixed-length spring. Unset,
|
|
1019
|
+
* the camera eases by `animationTime` instead.
|
|
1020
|
+
*/
|
|
1021
|
+
animationDuration?: number;
|
|
1022
|
+
/** With `animationDuration`, how much of the movement comes early: higher starts faster. Default 6.5. */
|
|
1023
|
+
springStiffness?: number;
|
|
1024
|
+
/** Hold the image inside its bounds while dragging. Default true; false lets it spring back on release. */
|
|
1025
|
+
constrainDuringPan?: boolean;
|
|
990
1026
|
/**
|
|
991
1027
|
* Milliseconds the controls and navigator stay after a mouse (or a pen that hovers)
|
|
992
1028
|
* stops moving, or a finger lifts, as the Player's `hideDelay`. Default 3000; `Infinity`
|
|
@@ -1991,6 +2027,167 @@ export declare function search(service: SearchService, query: string, { request,
|
|
|
1991
2027
|
request?: CloverRequest;
|
|
1992
2028
|
signal?: AbortSignal;
|
|
1993
2029
|
}): Promise<SearchResults>;
|
|
2030
|
+
/**
|
|
2031
|
+
* Whether a Manifest has anything to put on a map: navPlace on the Collection, Manifest,
|
|
2032
|
+
* a Canvas or an annotation, a GeoJSON annotation body, or a georeferencing annotation.
|
|
2033
|
+
* Only a look, never a read: the panel asks it to offer a Map tab, and the reading
|
|
2034
|
+
* (`core/geo.ts`) belongs to the map entry, so an app without a map carries none of it.
|
|
2035
|
+
*/
|
|
2036
|
+
export declare function hasMapData(manifest: Manifest | null, collection?: Presentation4Collection | null): boolean;
|
|
2037
|
+
/**
|
|
2038
|
+
* Where a IIIF resource is, read for a map: navPlace (on a Collection, Manifest, Canvas
|
|
2039
|
+
* or Annotation, and annotation bodies that are GeoJSON), and Georeference Extension
|
|
2040
|
+
* annotations, reduced to what a basic overlay needs. Framework-free and small: the map
|
|
2041
|
+
* itself, and MapLibre, load only when a `Map` is shown.
|
|
2042
|
+
*
|
|
2043
|
+
* - navPlace: https://iiif.io/api/extension/navplace/
|
|
2044
|
+
* - Georeference: https://iiif.io/api/extension/georef/
|
|
2045
|
+
*/
|
|
2046
|
+
export type Position = [
|
|
2047
|
+
number,
|
|
2048
|
+
number
|
|
2049
|
+
];
|
|
2050
|
+
export interface GeoGeometry {
|
|
2051
|
+
type: string;
|
|
2052
|
+
coordinates?: unknown;
|
|
2053
|
+
geometries?: GeoGeometry[];
|
|
2054
|
+
}
|
|
2055
|
+
export interface MapFeature {
|
|
2056
|
+
type: "Feature";
|
|
2057
|
+
id?: string | number;
|
|
2058
|
+
geometry: GeoGeometry;
|
|
2059
|
+
/**
|
|
2060
|
+
* Flat, for MapLibre (which turns nested objects into strings): the text to show and
|
|
2061
|
+
* its language, the Canvas it belongs to, and any simplestyle keys it carried (`fill`,
|
|
2062
|
+
* `stroke`, …).
|
|
2063
|
+
*/
|
|
2064
|
+
properties: Record<string, string | number | boolean> & {
|
|
2065
|
+
title?: string;
|
|
2066
|
+
titleLang?: string;
|
|
2067
|
+
canvasId?: string;
|
|
2068
|
+
/** The annotation it is a body of (Cookbook 0139), which a press on it selects. */
|
|
2069
|
+
annotationId?: string;
|
|
2070
|
+
/** The Collection's member it locates (Cookbook 0318), which a press on it opens. */
|
|
2071
|
+
manifestId?: string;
|
|
2072
|
+
/** Its owner's `navDate`, as written, shown with its name (Cookbook 0318). */
|
|
2073
|
+
navDate?: string;
|
|
2074
|
+
};
|
|
2075
|
+
}
|
|
2076
|
+
export interface MapFeatureCollection {
|
|
2077
|
+
type: "FeatureCollection";
|
|
2078
|
+
features: MapFeature[];
|
|
2079
|
+
}
|
|
2080
|
+
/** A georeferenced image, reduced to an affine overlay. */
|
|
2081
|
+
export interface Georeference {
|
|
2082
|
+
id: string;
|
|
2083
|
+
/** The Canvas it georeferences, when it targets one. */
|
|
2084
|
+
canvasId?: string;
|
|
2085
|
+
/** Ground control points: image pixel [x, y] ↔ [longitude, latitude]. */
|
|
2086
|
+
points: Array<{
|
|
2087
|
+
resource: Position;
|
|
2088
|
+
geo: Position;
|
|
2089
|
+
}>;
|
|
2090
|
+
/** The extent the points are measured in: the Canvas, or the image service. */
|
|
2091
|
+
width: number;
|
|
2092
|
+
height: number;
|
|
2093
|
+
/** The part of the image that is map (an SvgSelector polygon), in the same units. */
|
|
2094
|
+
mask?: Position[];
|
|
2095
|
+
/** Its name: the annotation's label, or the Canvas's. */
|
|
2096
|
+
label?: LanguageMapLike;
|
|
2097
|
+
/** What to draw: an image body (or a bare image service), sized by `overlayImageUrl`. */
|
|
2098
|
+
image: Record<string, unknown>;
|
|
2099
|
+
}
|
|
2100
|
+
/**
|
|
2101
|
+
* Every navPlace feature of the Root's resource: the Collection's, each of its members'
|
|
2102
|
+
* (Cookbook 0318: a Collection of Manifests, each where it is), the Manifest's, each
|
|
2103
|
+
* Canvas's, and each loaded annotation's (its `navPlace`, or a GeoJSON body as Cookbook
|
|
2104
|
+
* 0139 has). A feature from a member names that member, the open one's place its own
|
|
2105
|
+
* Manifest's where it gives one, in the member's place in the Collection's order; one
|
|
2106
|
+
* from a Canvas or annotation names that Canvas. Memoized on the Manifest (and the
|
|
2107
|
+
* Collection), so the same collection comes back while nothing changes.
|
|
2108
|
+
*/
|
|
2109
|
+
export declare function navPlaceOf(manifest: Manifest | null, collection?: Presentation4Collection | null, language?: string): MapFeatureCollection;
|
|
2110
|
+
/**
|
|
2111
|
+
* One Georeference Extension annotation as an overlay: its control points, the extent
|
|
2112
|
+
* they are measured in, its mask, and the image to draw (the Canvas's painted image, or
|
|
2113
|
+
* the image service it targets directly). Null when it cannot be drawn: fewer than three
|
|
2114
|
+
* points, no extent, or nothing to draw.
|
|
2115
|
+
*/
|
|
2116
|
+
export declare function readGeoreference(annotation: Json, canvas?: Json): Georeference | null;
|
|
2117
|
+
/**
|
|
2118
|
+
* The georeferenced images of the Manifest's Canvases, from their loaded annotation pages.
|
|
2119
|
+
* Memoized on the Manifest: embedding a fetched page makes a new one.
|
|
2120
|
+
*/
|
|
2121
|
+
export declare function georeferencesOf(manifest: Manifest | null): Georeference[];
|
|
2122
|
+
/**
|
|
2123
|
+
* The first-order polynomial (affine) transform that best fits the control points, image
|
|
2124
|
+
* pixels to [longitude, latitude], by least squares in Web Mercator. Exact for three
|
|
2125
|
+
* points. Null when the points are collinear.
|
|
2126
|
+
*/
|
|
2127
|
+
export declare function affineTransform(points: Georeference["points"]): ((pixel: Position) => Position) | null;
|
|
2128
|
+
/**
|
|
2129
|
+
* Where the image's corners land, in the order MapLibre's image and canvas sources take
|
|
2130
|
+
* them: top left, top right, bottom right, bottom left. Null when the points do not fix
|
|
2131
|
+
* a transform.
|
|
2132
|
+
*/
|
|
2133
|
+
export declare function cornersOf(georeference: Georeference): [
|
|
2134
|
+
Position,
|
|
2135
|
+
Position,
|
|
2136
|
+
Position,
|
|
2137
|
+
Position
|
|
2138
|
+
] | null;
|
|
2139
|
+
/** The [[west, south], [east, north]] that holds the features and the overlays. */
|
|
2140
|
+
export declare function boundsOf(features: MapFeature[], overlays?: Georeference[]): [
|
|
2141
|
+
Position,
|
|
2142
|
+
Position
|
|
2143
|
+
] | null;
|
|
2144
|
+
export interface MapProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect"> {
|
|
2145
|
+
/**
|
|
2146
|
+
* Standalone: a IIIF resource (URL or object) to map: its navPlace, and its Canvases'
|
|
2147
|
+
* georeferenced images. Inside a `Root`, leave it out to map the Root's.
|
|
2148
|
+
*/
|
|
2149
|
+
iiifContent?: IIIFContent;
|
|
2150
|
+
/** GeoJSON to draw (a FeatureCollection, Feature or geometry), as navPlace is. */
|
|
2151
|
+
navPlace?: unknown;
|
|
2152
|
+
/** Georeference Extension annotations to overlay, on a Canvas or an image service. */
|
|
2153
|
+
georeferences?: unknown[];
|
|
2154
|
+
/** Draw georeferenced images over the basemap. Default true. */
|
|
2155
|
+
overlay?: boolean;
|
|
2156
|
+
/** The overlays' opacity, 0 to 1. Default 0.75. */
|
|
2157
|
+
overlayOpacity?: number;
|
|
2158
|
+
/** A MapLibre style URL, used as it is. Default: Clover's relief basemap (OpenFreeMap). */
|
|
2159
|
+
styleUrl?: string;
|
|
2160
|
+
/**
|
|
2161
|
+
* Where MapLibre's worker is served from, to serve your own (see the Map docs). By
|
|
2162
|
+
* default Clover brings it, from a `blob:` URL.
|
|
2163
|
+
*/
|
|
2164
|
+
workerUrl?: string;
|
|
2165
|
+
/** Zoom with the wheel or trackpad. Default false, so an embedded map never traps page scroll. */
|
|
2166
|
+
scrollZoom?: boolean;
|
|
2167
|
+
/**
|
|
2168
|
+
* A place was chosen, on the map or in its list. Inside a `Root`, choosing one on a
|
|
2169
|
+
* Canvas also goes there.
|
|
2170
|
+
*/
|
|
2171
|
+
onSelect?: (feature: MapFeature) => void;
|
|
2172
|
+
/** Standalone: credentials, headers and `fetch`. */
|
|
2173
|
+
request?: CloverRequest;
|
|
2174
|
+
/** Standalone: the language to read IIIF text in. */
|
|
2175
|
+
language?: string;
|
|
2176
|
+
/**
|
|
2177
|
+
* Clover's higher-contrast mode: the accent kept to rings, outlines and marks, and never
|
|
2178
|
+
* under words or a glyph, where the controls' dark fill takes its place, edged in the
|
|
2179
|
+
* accent. Inside a `Root`, the Root's too; on wherever the reader's system asks for more
|
|
2180
|
+
* contrast. Default `false`.
|
|
2181
|
+
*/
|
|
2182
|
+
highContrast?: boolean;
|
|
2183
|
+
/**
|
|
2184
|
+
* The basemap's credits, behind an ⓘ in the map's lower corner. Default true. A basemap's license
|
|
2185
|
+
* may ask for its credits: give them on the page yourself before setting this false.
|
|
2186
|
+
*/
|
|
2187
|
+
credits?: boolean;
|
|
2188
|
+
as?: React.ElementType;
|
|
2189
|
+
}
|
|
2190
|
+
declare const CloverMap: React.ForwardRefExoticComponent<MapProps & React.RefAttributes<HTMLElement>>;
|
|
1994
2191
|
/** Serve MapLibre's worker from `url` for every map Clover draws (a Viewer's Map tab included). */
|
|
1995
2192
|
export declare function setMapWorkerUrl(url: string | undefined): void;
|
|
1996
2193
|
export interface CollectionProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -2637,8 +2834,10 @@ export type DefaultProps = Omit<RootProps, "children"> & {
|
|
|
2637
2834
|
* The Body's `collapseControls`.
|
|
2638
2835
|
*/
|
|
2639
2836
|
collapseControls?: "auto" | "always";
|
|
2837
|
+
/** The Body's Canvas `options`: its gestures, zoom limits and motion. */
|
|
2838
|
+
canvasOptions?: CloverCanvasOptions;
|
|
2640
2839
|
};
|
|
2641
|
-
declare function Default({ className, header, headingLevel, panel, defaultPanelOpen, panelLayout, panelSections, panelLabels, download, languages, items, singleItem, storageKey, fill, collapseControls, ...root }: DefaultProps): React.JSX.Element;
|
|
2840
|
+
declare function Default({ className, header, headingLevel, panel, defaultPanelOpen, panelLayout, panelSections, panelLabels, download, languages, items, singleItem, storageKey, fill, collapseControls, canvasOptions, ...root }: DefaultProps): React.JSX.Element;
|
|
2642
2841
|
/**
|
|
2643
2842
|
* A layout the Viewer draws: one from `@nulib/clover/templates`, or a component of your
|
|
2644
2843
|
* own that takes the `Clover.Root` props.
|
package/dist/index.mjs
CHANGED
|
@@ -21,6 +21,9 @@ import { Split, SplitHandle, SplitPane } from "./components/Split/Split.mjs";
|
|
|
21
21
|
import { Search } from "./components/Search/Search.mjs";
|
|
22
22
|
import { search } from "./core/search.mjs";
|
|
23
23
|
import { SEARCH_SET_ID, searchServiceOf } from "./core/search-service.mjs";
|
|
24
|
+
import { CloverMap } from "./components/Map/Map.mjs";
|
|
25
|
+
import { affineTransform, boundsOf, cornersOf, georeferencesOf, navPlaceOf, readGeoreference } from "./core/geo.mjs";
|
|
26
|
+
import { hasMapData } from "./core/geo-detect.mjs";
|
|
24
27
|
import { setMapWorkerUrl } from "./core/map-config.mjs";
|
|
25
28
|
import { Collection } from "./components/Collection/Collection.mjs";
|
|
26
29
|
import { CollectionSelect } from "./components/CollectionSelect/CollectionSelect.mjs";
|
|
@@ -64,6 +67,7 @@ export {
|
|
|
64
67
|
Items,
|
|
65
68
|
Label,
|
|
66
69
|
Logo,
|
|
70
|
+
CloverMap as Map,
|
|
67
71
|
Metadata,
|
|
68
72
|
Next,
|
|
69
73
|
Panel,
|
|
@@ -93,18 +97,25 @@ export {
|
|
|
93
97
|
Transcript,
|
|
94
98
|
Value,
|
|
95
99
|
Viewer,
|
|
100
|
+
affineTransform,
|
|
101
|
+
boundsOf,
|
|
96
102
|
buildContentState,
|
|
97
103
|
chaptersOf,
|
|
104
|
+
cornersOf,
|
|
98
105
|
cueAt,
|
|
99
106
|
currentContents,
|
|
100
107
|
decodeContentState,
|
|
101
108
|
Viewer2 as default,
|
|
102
109
|
encodeContentState,
|
|
110
|
+
georeferencesOf,
|
|
103
111
|
groupViews,
|
|
112
|
+
hasMapData,
|
|
104
113
|
initCloverI18n,
|
|
105
114
|
localize,
|
|
115
|
+
navPlaceOf,
|
|
106
116
|
parseVtt,
|
|
107
117
|
readAs,
|
|
118
|
+
readGeoreference,
|
|
108
119
|
regionSource,
|
|
109
120
|
resolveBehavior,
|
|
110
121
|
resolveDirection,
|
|
@@ -4,7 +4,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
5
|
import { claimContext, returnContext } from "./backends/contexts.mjs";
|
|
6
6
|
import { WebGL2Backend } from "./backends/webgl2/WebGL2Backend.mjs";
|
|
7
|
-
import { fitCamera, anchoredCenter, visibleWorldRect, screenPointToWorld,
|
|
7
|
+
import { fitCamera, anchoredCenter, visibleWorldRect, screenPointToWorld, sameCamera, worldPointToScreen } from "./camera/Camera.mjs";
|
|
8
8
|
import { CameraAnimator } from "./camera/CameraAnimator.mjs";
|
|
9
9
|
import { GestureController, DEFAULT_GESTURES } from "./input/GestureController.mjs";
|
|
10
10
|
import { TileCache } from "./io/TileCache.mjs";
|
|
@@ -19,6 +19,9 @@ const DEFAULTS = {
|
|
|
19
19
|
maxZoomPixelRatio: 1.1,
|
|
20
20
|
minZoomImageRatio: 0.9,
|
|
21
21
|
animationTime: 0.09,
|
|
22
|
+
animationDuration: void 0,
|
|
23
|
+
springStiffness: 6.5,
|
|
24
|
+
constrainDuringPan: true,
|
|
22
25
|
request: void 0,
|
|
23
26
|
byteBudget: 192 * 1024 * 1024,
|
|
24
27
|
maxInFlight: 6,
|
|
@@ -95,6 +98,8 @@ class CanvasRenderer {
|
|
|
95
98
|
__publicField(this, "opened", false);
|
|
96
99
|
/** True until the reader moves the camera; a resize then refits rather than crops. */
|
|
97
100
|
__publicField(this, "atHome", true);
|
|
101
|
+
/** A pointer is down. Without `constrainDuringPan`, the center may leave the world. */
|
|
102
|
+
__publicField(this, "interacting", false);
|
|
98
103
|
__publicField(this, "lastEmitted", null);
|
|
99
104
|
__publicField(this, "generation", 0);
|
|
100
105
|
__publicField(this, "listeners", /* @__PURE__ */ new Map());
|
|
@@ -172,13 +177,21 @@ class CanvasRenderer {
|
|
|
172
177
|
...DEFAULTS,
|
|
173
178
|
...stripUndefined(options)
|
|
174
179
|
};
|
|
175
|
-
if (prefersReducedMotion())
|
|
180
|
+
if (prefersReducedMotion()) {
|
|
181
|
+
this.options.animationTime = 0;
|
|
182
|
+
if (this.options.animationDuration !== void 0) {
|
|
183
|
+
this.options.animationDuration = 0;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const { animationDuration, springStiffness } = this.options;
|
|
176
187
|
this.camera = new CameraAnimator(
|
|
177
188
|
{ x: 0, y: 0, zoom: 1, rotation: 0 },
|
|
178
|
-
this.options.animationTime
|
|
189
|
+
this.options.animationTime,
|
|
190
|
+
animationDuration === void 0 ? void 0 : { duration: animationDuration, stiffness: springStiffness }
|
|
179
191
|
);
|
|
180
192
|
this.loop = new FrameLoop(this.tick);
|
|
181
193
|
this.gestureOptions = stripUndefined(options.gestures ?? {});
|
|
194
|
+
if (prefersReducedMotion()) this.gestureOptions.flickMomentum = 0;
|
|
182
195
|
this.gestures = new GestureController(host, this, {
|
|
183
196
|
...DEFAULT_GESTURES,
|
|
184
197
|
...this.gestureOptions
|
|
@@ -412,13 +425,32 @@ class CanvasRenderer {
|
|
|
412
425
|
home(immediate = false) {
|
|
413
426
|
const home = this.homeCamera();
|
|
414
427
|
if (!home) return;
|
|
428
|
+
const was = this.atHome;
|
|
415
429
|
this.atHome = true;
|
|
416
430
|
this.animateTo(home, immediate);
|
|
431
|
+
if (!was && this.opened) this.emit("viewport");
|
|
417
432
|
}
|
|
418
433
|
/** Zoomed in as far as it goes, or on the way there. */
|
|
419
434
|
atMaxZoom() {
|
|
420
435
|
return this.camera.destination.zoom >= this.getZoomLimits().max * (1 - ZOOM_EPSILON);
|
|
421
436
|
}
|
|
437
|
+
/**
|
|
438
|
+
* Which of zoom in, zoom out and home would change nothing, judged where the camera is
|
|
439
|
+
* heading, as `atMaxZoom` is. Home is `isAtHome` and the same zoom, center and turn, to
|
|
440
|
+
* within half a screen pixel and a thousandth of the zoom: after a zoom in and out by
|
|
441
|
+
* hand the reader is not home, so reset stays, as the Document's sheets (`atHome`)
|
|
442
|
+
* and a resize's refit need it to.
|
|
443
|
+
*/
|
|
444
|
+
viewLimits() {
|
|
445
|
+
const { zoom, x, y, rotation } = this.camera.destination;
|
|
446
|
+
const { min, max } = this.getZoomLimits();
|
|
447
|
+
const home = this.atHome ? this.homeCamera() : null;
|
|
448
|
+
return {
|
|
449
|
+
atMax: zoom >= max * (1 - ZOOM_EPSILON),
|
|
450
|
+
atMin: zoom <= min * (1 + ZOOM_EPSILON),
|
|
451
|
+
atHome: this.atHome && (!home || Math.abs(zoom / home.zoom - 1) < 1e-3 && Math.hypot(x - home.x, y - home.y) * zoom < 0.5 && Math.abs(rotation - home.rotation) < 1e-3)
|
|
452
|
+
};
|
|
453
|
+
}
|
|
422
454
|
zoomBy(factor, at, animate = true) {
|
|
423
455
|
const base = animate ? this.camera.destination : this.camera.current;
|
|
424
456
|
const screen = at ?? {
|
|
@@ -469,9 +501,6 @@ class CanvasRenderer {
|
|
|
469
501
|
this.atHome = false;
|
|
470
502
|
this.animateTo(this.constrain({ ...base, ...point }), immediate);
|
|
471
503
|
}
|
|
472
|
-
flick(vx, vy) {
|
|
473
|
-
this.panBy(vx * 0.25, vy * 0.25, true);
|
|
474
|
-
}
|
|
475
504
|
rotateBy(degrees) {
|
|
476
505
|
const base = this.camera.destination;
|
|
477
506
|
this.setRotation(base.rotation * 180 / Math.PI + degrees);
|
|
@@ -508,7 +537,15 @@ class CanvasRenderer {
|
|
|
508
537
|
});
|
|
509
538
|
}
|
|
510
539
|
setInteracting(interacting) {
|
|
511
|
-
|
|
540
|
+
this.interacting = interacting;
|
|
541
|
+
if (interacting) {
|
|
542
|
+
this.camera.stop();
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (this.options.constrainDuringPan) return;
|
|
546
|
+
const destination = this.camera.destination;
|
|
547
|
+
const settled = this.constrain(destination);
|
|
548
|
+
if (!sameCamera(destination, settled)) this.animateTo(settled, false);
|
|
512
549
|
}
|
|
513
550
|
worldToScreenPoint(point) {
|
|
514
551
|
return worldPointToScreen(this.camera.current, this.viewport, point);
|
|
@@ -697,6 +734,9 @@ class CanvasRenderer {
|
|
|
697
734
|
if (!bounds) return state;
|
|
698
735
|
const { min, max } = this.getZoomLimits();
|
|
699
736
|
const zoom = allowBeyondLimits ? clamp(state.zoom, min, Math.max(max, state.zoom)) : clamp(state.zoom, min, max);
|
|
737
|
+
if (this.interacting && !this.options.constrainDuringPan) {
|
|
738
|
+
return { ...state, zoom };
|
|
739
|
+
}
|
|
700
740
|
return {
|
|
701
741
|
...state,
|
|
702
742
|
zoom,
|
|
@@ -846,6 +886,7 @@ class CanvasRenderer {
|
|
|
846
886
|
this.constrain({ ...current, zoom: current.zoom * ratio })
|
|
847
887
|
);
|
|
848
888
|
}
|
|
889
|
+
this.emit("viewport");
|
|
849
890
|
}
|
|
850
891
|
if (now2) this.loop.drawNow();
|
|
851
892
|
else this.invalidate();
|
|
@@ -8,24 +8,30 @@ const ZOOM_EPSILON = 1e-4;
|
|
|
8
8
|
const PIXEL_EPSILON = 0.05;
|
|
9
9
|
const ROTATION_EPSILON = 1e-4;
|
|
10
10
|
class CameraAnimator {
|
|
11
|
-
constructor(initial, timeConstant = DEFAULT_TIME_CONSTANT) {
|
|
11
|
+
constructor(initial, timeConstant = DEFAULT_TIME_CONSTANT, spring) {
|
|
12
12
|
__publicField(this, "current");
|
|
13
13
|
__publicField(this, "target", null);
|
|
14
14
|
__publicField(this, "timeConstant");
|
|
15
|
+
__publicField(this, "spring");
|
|
16
|
+
__publicField(this, "start");
|
|
17
|
+
__publicField(this, "elapsed", 0);
|
|
15
18
|
this.current = { ...initial };
|
|
19
|
+
this.start = { ...initial };
|
|
16
20
|
this.timeConstant = timeConstant;
|
|
21
|
+
this.spring = spring;
|
|
17
22
|
}
|
|
18
23
|
/** The state the camera is heading to (or at, when idle). */
|
|
19
24
|
get destination() {
|
|
20
25
|
return this.target ? { ...this.target.state } : { ...this.current };
|
|
21
26
|
}
|
|
22
|
-
/** Jump, canceling any animation. Used by drags
|
|
27
|
+
/** Jump, canceling any animation. Used by drags that track the pointer 1:1. */
|
|
23
28
|
set(state) {
|
|
24
29
|
this.current = { ...state };
|
|
25
30
|
this.target = null;
|
|
26
31
|
}
|
|
27
32
|
animateTo(target, viewport, immediate = false) {
|
|
28
|
-
|
|
33
|
+
const off = this.spring ? this.spring.duration <= 0 : this.timeConstant === 0;
|
|
34
|
+
if (immediate || off) {
|
|
29
35
|
this.set(target.state);
|
|
30
36
|
return;
|
|
31
37
|
}
|
|
@@ -41,6 +47,8 @@ class CameraAnimator {
|
|
|
41
47
|
const miss = Math.hypot(landing.x - target.state.x, landing.y - target.state.y) * target.state.zoom;
|
|
42
48
|
if (miss > PIXEL_EPSILON) anchor = void 0;
|
|
43
49
|
}
|
|
50
|
+
this.start = { ...this.current };
|
|
51
|
+
this.elapsed = 0;
|
|
44
52
|
this.target = { state: { ...target.state }, anchor };
|
|
45
53
|
}
|
|
46
54
|
stop() {
|
|
@@ -53,29 +61,40 @@ class CameraAnimator {
|
|
|
53
61
|
step(dt, viewport) {
|
|
54
62
|
const target = this.target;
|
|
55
63
|
if (!target) return false;
|
|
56
|
-
const k = 1 - Math.exp(-Math.max(dt, 0) / this.timeConstant);
|
|
57
|
-
const from = this.current;
|
|
58
64
|
const to = target.state;
|
|
65
|
+
let from;
|
|
66
|
+
let k;
|
|
67
|
+
if (this.spring) {
|
|
68
|
+
this.elapsed += Math.max(dt, 0);
|
|
69
|
+
const t = this.elapsed / this.spring.duration;
|
|
70
|
+
if (t >= 1) {
|
|
71
|
+
this.current = { ...to };
|
|
72
|
+
this.target = null;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const s = this.spring.stiffness;
|
|
76
|
+
from = this.start;
|
|
77
|
+
k = (1 - Math.exp(-s * t)) / (1 - Math.exp(-s));
|
|
78
|
+
} else {
|
|
79
|
+
from = this.current;
|
|
80
|
+
k = 1 - Math.exp(-Math.max(dt, 0) / this.timeConstant);
|
|
81
|
+
}
|
|
59
82
|
const zoom = Math.exp(
|
|
60
83
|
Math.log(from.zoom) + (Math.log(to.zoom) - Math.log(from.zoom)) * k
|
|
61
84
|
);
|
|
62
85
|
const rotation = from.rotation + (to.rotation - from.rotation) * k;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
center = {
|
|
74
|
-
x: from.x + (to.x - from.x) * k,
|
|
75
|
-
y: from.y + (to.y - from.y) * k
|
|
76
|
-
};
|
|
77
|
-
}
|
|
86
|
+
const center = target.anchor ? anchoredCenter(
|
|
87
|
+
target.anchor.world,
|
|
88
|
+
target.anchor.screen,
|
|
89
|
+
zoom,
|
|
90
|
+
rotation,
|
|
91
|
+
viewport
|
|
92
|
+
) : {
|
|
93
|
+
x: from.x + (to.x - from.x) * k,
|
|
94
|
+
y: from.y + (to.y - from.y) * k
|
|
95
|
+
};
|
|
78
96
|
this.current = { x: center.x, y: center.y, zoom, rotation };
|
|
97
|
+
if (this.spring) return true;
|
|
79
98
|
const settled = Math.abs(Math.log(to.zoom / zoom)) < ZOOM_EPSILON && Math.abs(to.rotation - rotation) < ROTATION_EPSILON && Math.hypot(to.x - center.x, to.y - center.y) * zoom < PIXEL_EPSILON;
|
|
80
99
|
if (settled) {
|
|
81
100
|
this.current = { ...to };
|
|
@@ -8,13 +8,15 @@ const DEFAULT_GESTURES = {
|
|
|
8
8
|
dblClickToZoom: true,
|
|
9
9
|
pinchToZoom: true,
|
|
10
10
|
scrollToZoom: false,
|
|
11
|
-
navigable: true
|
|
11
|
+
navigable: true,
|
|
12
|
+
flickEnabled: true,
|
|
13
|
+
flickMinSpeed: 200,
|
|
14
|
+
flickMomentum: 0.25
|
|
12
15
|
};
|
|
13
16
|
const CLICK_ZOOM = 2;
|
|
14
17
|
const KEY_ZOOM = 1.5;
|
|
15
18
|
const KEY_PAN_FRACTION = 0.1;
|
|
16
19
|
const VELOCITY_WINDOW_MS = 100;
|
|
17
|
-
const MIN_FLICK_SPEED = 200;
|
|
18
20
|
const WHEEL_ZOOM_RATE = 2e-3;
|
|
19
21
|
const PINCH_WHEEL_ZOOM_RATE = 0.01;
|
|
20
22
|
class GestureController {
|
|
@@ -58,7 +60,7 @@ class GestureController {
|
|
|
58
60
|
this.down.moved = true;
|
|
59
61
|
}
|
|
60
62
|
if (((_a = this.down) == null ? void 0 : _a.moved) && this.options.navigable) {
|
|
61
|
-
this.target.panBy(dx, dy,
|
|
63
|
+
this.target.panBy(dx, dy, !this.tracksPointer(event.pointerType));
|
|
62
64
|
}
|
|
63
65
|
this.samples.push({ x: p.x, y: p.y, t: event.timeStamp });
|
|
64
66
|
const cutoff = event.timeStamp - VELOCITY_WINDOW_MS;
|
|
@@ -124,14 +126,18 @@ class GestureController {
|
|
|
124
126
|
}
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
|
-
if (!this.options.navigable)
|
|
129
|
+
if (!this.options.navigable || !this.tracksPointer(event.pointerType)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
128
132
|
const first = this.samples[0];
|
|
129
133
|
const last = this.samples[this.samples.length - 1];
|
|
130
134
|
const span = ((last == null ? void 0 : last.t) ?? 0) - ((first == null ? void 0 : first.t) ?? 0);
|
|
131
135
|
if (first && last && span > 0 && event.timeStamp - last.t < 50) {
|
|
132
136
|
const vx = (last.x - first.x) / span * 1e3;
|
|
133
137
|
const vy = (last.y - first.y) / span * 1e3;
|
|
134
|
-
|
|
138
|
+
const momentum = this.options.flickMomentum;
|
|
139
|
+
if (momentum > 0 && Math.hypot(vx, vy) > this.options.flickMinSpeed)
|
|
140
|
+
this.target.panBy(vx * momentum, vy * momentum, true);
|
|
135
141
|
}
|
|
136
142
|
});
|
|
137
143
|
__publicField(this, "onDoubleClick", (event) => {
|
|
@@ -233,6 +239,10 @@ class GestureController {
|
|
|
233
239
|
if ((_b = (_a = this.target).atMaxZoom) == null ? void 0 : _b.call(_a)) this.target.home();
|
|
234
240
|
else this.target.zoomBy(CLICK_ZOOM, at, true);
|
|
235
241
|
}
|
|
242
|
+
/** A drag that follows the pointer exactly, and so may flick on release. */
|
|
243
|
+
tracksPointer(pointerType) {
|
|
244
|
+
return pointerType === "touch" || this.options.flickEnabled;
|
|
245
|
+
}
|
|
236
246
|
pinchState() {
|
|
237
247
|
const [a, b] = [...this.pointers.values()];
|
|
238
248
|
return {
|
package/dist/map/index.d.mts
CHANGED
|
@@ -19,6 +19,12 @@ export type Presentation4Collection = P4.Collection;
|
|
|
19
19
|
* tag, so the text can carry a `lang` attribute.
|
|
20
20
|
*/
|
|
21
21
|
export type LanguageMapLike = string | Record<string, string[] | string | undefined> | null | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* A IIIF resource as JSON, read loosely. One declaration for the modules whose `Json`
|
|
24
|
+
* reaches Clover's types: the bundled declarations (`build:types`) would hold one per
|
|
25
|
+
* module, under the one name, which TypeScript rejects.
|
|
26
|
+
*/
|
|
27
|
+
export type Json = Record<string, any>;
|
|
22
28
|
/**
|
|
23
29
|
* Whether a Manifest has anything to put on a map: navPlace on the Collection, Manifest,
|
|
24
30
|
* a Canvas or an annotation, a GeoJSON annotation body, or a georeferencing annotation.
|
|
@@ -89,7 +95,6 @@ export interface Georeference {
|
|
|
89
95
|
/** What to draw: an image body (or a bare image service), sized by `overlayImageUrl`. */
|
|
90
96
|
image: Record<string, unknown>;
|
|
91
97
|
}
|
|
92
|
-
export type Json = Record<string, any>;
|
|
93
98
|
/**
|
|
94
99
|
* Every navPlace feature of the Root's resource: the Collection's, each of its members'
|
|
95
100
|
* (Cookbook 0318: a Collection of Manifests, each where it is), the Manifest's, each
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer clover{.clover-collection-select{display:flex;flex-wrap:wrap;align-items:center;gap:var(--clover-space-xs)}.clover-collection-select-label{color:var(--clover-color-primary-muted, #26292b);font-size:var(--clover-text-s);font-weight:600}.clover-collection-select-control{min-width:0;max-width:100%;padding-inline-end:var(--clover-space-xl)}}
|