@nulib/clover 4.0.0 → 4.1.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/dist/components/Body/Body.mjs +16 -1
- package/dist/components/Body/glyphs.mjs +15 -0
- package/dist/components/Canvas/CanvasView.mjs +116 -12
- package/dist/components/Canvas/ChaptersMenu.mjs +105 -0
- package/dist/components/Canvas/ControlMenu.mjs +23 -4
- package/dist/components/Canvas/Controls.mjs +223 -60
- package/dist/components/Canvas/ControlsFade.mjs +16 -0
- package/dist/components/Canvas/ImageControls.mjs +209 -0
- package/dist/components/Canvas/Placeholder.mjs +44 -12
- package/dist/components/Canvas/RowFits.mjs +85 -0
- package/dist/components/Canvas/layout.mjs +11 -0
- package/dist/components/Canvas/media/MediaBody.mjs +105 -46
- package/dist/components/Canvas/media/Player.mjs +0 -55
- package/dist/components/Canvas/media/Transport.mjs +14 -23
- package/dist/components/Canvas/panClearOfControls.mjs +1 -1
- package/dist/components/Collection/Collection.mjs +1 -1
- package/dist/components/Items/CountMenu.mjs +1 -0
- package/dist/components/Items/Item.mjs +4 -3
- package/dist/components/Items/Items.mjs +30 -10
- package/dist/components/Items/PagerLayout.mjs +2 -0
- package/dist/components/Items/TargetItems.mjs +1 -1
- package/dist/components/Items/masonry.mjs +35 -0
- package/dist/components/Panel/About.mjs +25 -8
- package/dist/components/Root/useRootState.mjs +2 -49
- package/dist/components/Scene/SceneView.mjs +13 -2
- package/dist/components/Scene/cloverEngine.mjs +2 -1
- package/dist/components/Timeline/playerSurface.mjs +2 -0
- package/dist/core/clover.mjs +7 -4
- package/dist/core/content-state.mjs +5 -3
- package/dist/i18n/locales/en.json.mjs +1 -1
- package/dist/i18n/locales/es.json.mjs +1 -1
- package/dist/i18n/locales/fi.json.mjs +1 -1
- package/dist/i18n/locales/fr.json.mjs +1 -1
- package/dist/i18n/locales/nb.json.mjs +1 -1
- package/dist/i18n/locales/nn.json.mjs +1 -1
- package/dist/i18n/locales/no.json.mjs +1 -1
- package/dist/i18n/locales/pt.json.mjs +1 -1
- package/dist/index.d.mts +109 -51
- package/dist/lib/gltf/load.mjs +26 -6
- package/dist/lib/renderer/CanvasRenderer.mjs +44 -32
- package/dist/lib/renderer/camera/Camera.mjs +1 -1
- package/dist/react/useContentStateOutput.mjs +71 -0
- package/dist/styles.css +1 -1
- package/dist/templates/default/Default.mjs +37 -128
- package/dist/templates/document/Document.mjs +41 -64
- package/dist/templates/document/Sheets.mjs +13 -5
- package/dist/templates/gallery/Gallery.mjs +90 -18
- package/dist/templates/index.d.mts +299 -17
- package/dist/templates/shared/Lightbox.mjs +161 -69
- package/dist/templates/shared/LightboxView.mjs +118 -0
- package/dist/templates/shared/PanelPane.mjs +104 -0
- package/dist/templates/{document/DocumentPanel.mjs → shared/PanelPart.mjs} +2 -2
- package/dist/templates/shared/dragToClose.mjs +51 -8
- package/dist/templates/shared/givenAnnotations.mjs +13 -0
- package/dist/templates/shared/useDragToClose.mjs +6 -3
- package/dist/templates/shared/useLazyPanelPane.mjs +16 -0
- package/dist/templates/shared/useSlide.mjs +6 -0
- package/dist/templates.css +1 -1
- package/dist/ui/ControlCluster.mjs +15 -17
- package/dist/ui/Sections.mjs +3 -3
- package/dist/ui/mediaIcons.mjs +35 -8
- package/dist/ui/useScrollTrack.mjs +2 -1
- package/dist/web-components/About-DvyvVUK5.mjs +1 -0
- package/dist/web-components/AnnotationItems-BpRcSrOM.mjs +1 -0
- package/dist/web-components/{AnnotationMenu-BCwwwfbb.mjs → AnnotationMenu-BDPec3iI.mjs} +1 -1
- package/dist/web-components/{AnnotationState-CavxnAAq.mjs → AnnotationState-Chs_37Kk.mjs} +1 -1
- package/dist/web-components/{Annotations-DDjSrBL5.mjs → Annotations-6E-oD_wg.mjs} +1 -1
- package/dist/web-components/{Annotations-rBmeI5sR.mjs → Annotations-CLPEq7Ro.mjs} +1 -1
- package/dist/web-components/Body-Ct61yxI7.mjs +1 -0
- package/dist/web-components/{BodyAlert-COKp19lq.mjs → BodyAlert-C_Qh3Up_.mjs} +1 -1
- package/dist/web-components/{Button-DLFYqtz9.mjs → Button-L8ZMy5lY.mjs} +1 -1
- package/dist/web-components/{Camera-Cp5ma-6C.mjs → Camera-BPyLzZjP.mjs} +1 -1
- package/dist/web-components/{Canvas2DBackend-3PToh87Z.mjs → Canvas2DBackend-8wFavYdl.mjs} +1 -1
- package/dist/web-components/CanvasView-2Fj9nT06.mjs +2 -0
- package/dist/web-components/CaptionDetails-DuwS-grE.mjs +1 -0
- package/dist/web-components/ChaptersMenu-Bj2EqtVJ.mjs +1 -0
- package/dist/web-components/{Chevron-r-_hUPn8.mjs → Chevron-Cyr_cc9X.mjs} +1 -1
- package/dist/web-components/ChoiceMenu-ConzybVH.mjs +1 -0
- package/dist/web-components/Collection-CLayN8sv.mjs +1 -0
- package/dist/web-components/{CollectionSelect-CBWUbqQi.mjs → CollectionSelect-D2d8dGJ4.mjs} +1 -1
- package/dist/web-components/{Connected-B2d6EoFl.mjs → Connected-CBQ6xyhr.mjs} +1 -1
- package/dist/web-components/{Connected-BSRM9FJY.mjs → Connected-DMXG3imZ.mjs} +1 -1
- package/dist/web-components/{Connected-BnpxYeJN.mjs → Connected-pyd0EBD3.mjs} +1 -1
- package/dist/web-components/{Contents-D7FPxSH-.mjs → Contents-tCMXBYDK.mjs} +1 -1
- package/dist/web-components/ControlMenu-D1zkB0qX.mjs +1 -0
- package/dist/web-components/ControlsFade-BNXVTL_Q.mjs +1 -0
- package/dist/web-components/{CountMenu-DyTp_J4k.mjs → CountMenu-Dnzb7lKo.mjs} +1 -1
- package/dist/web-components/Cue-CUGmPS3k.mjs +1 -0
- package/dist/web-components/Document-D-8nalCX.mjs +1 -0
- package/dist/web-components/{DomLayers-CTGub6wo.mjs → DomLayers-BxPU05-D.mjs} +1 -1
- package/dist/web-components/{Download-BOYNIb7C.mjs → Download-Bku9Vptk.mjs} +1 -1
- package/dist/web-components/{EntryBodies-Bfd2Z42z.mjs → EntryBodies-77vDudCb.mjs} +1 -1
- package/dist/web-components/{EntryThumbnail-DQE8ajI9.mjs → EntryThumbnail-BxQWKW6e.mjs} +1 -1
- package/dist/web-components/{FieldPill-D5DNJWLy.mjs → FieldPill-nFGsaru9.mjs} +1 -1
- package/dist/web-components/FrameAnimation-BvKiSXcm.mjs +1 -0
- package/dist/web-components/Gallery-4Hd58afA.mjs +1 -0
- package/dist/web-components/{HideToggle-DL911R1Z.mjs → HideToggle-TEhY4TS4.mjs} +1 -1
- package/dist/web-components/ImageControls-CZO7WoPb.mjs +1 -0
- package/dist/web-components/Items-CudZ4Lnb.mjs +1 -0
- package/dist/web-components/Label-f07N5Fld.mjs +1 -0
- package/dist/web-components/{LanguageChoice-DT1UPiDn.mjs → LanguageChoice-B5VM21DV.mjs} +1 -1
- package/dist/web-components/LightboxView-C4OASmkg.mjs +1 -0
- package/dist/web-components/ListEnd-M39M62Cl.mjs +1 -0
- package/dist/web-components/{Loaded-BWfEBJyg.mjs → Loaded-oGFyBuos.mjs} +1 -1
- package/dist/web-components/LoadedCanvas-IvpSzPO6.mjs +1 -0
- package/dist/web-components/LoadedMap-WATGNLxl.mjs +1 -0
- package/dist/web-components/{Loading-zw74TdAz.mjs → Loading-YxuKrDAM.mjs} +1 -1
- package/dist/web-components/{Map--dJhk0_0.mjs → Map-Cw9j3gi3.mjs} +1 -1
- package/dist/web-components/MapView-3OxoCr5l.mjs +3 -0
- package/dist/web-components/Markup-DW75Jx3j.mjs +2 -0
- package/dist/web-components/MediaBody-CLtd0bf0.mjs +1 -0
- package/dist/web-components/MediaBody-JnKnoIqY.mjs +1 -0
- package/dist/web-components/{NavDate-BQHuyLOC.mjs → NavDate-BCCOyycx.mjs} +1 -1
- package/dist/web-components/{Navigator-B3U21_ti.mjs → Navigator-Bx4zS0Yr.mjs} +1 -1
- package/dist/web-components/{Pager-DnJknq92.mjs → Pager-B9GvQ64b.mjs} +1 -1
- package/dist/web-components/PagerLayout-BF33VZL_.mjs +1 -0
- package/dist/web-components/Panel-BvDpCn6K.mjs +1 -0
- package/dist/web-components/PanelPart-Bd4lSUrP.mjs +1 -0
- package/dist/web-components/{PanelToggle-CFtWIeWv.mjs → PanelToggle-bPcIULGZ.mjs} +1 -1
- package/dist/web-components/{PartOfManifest-F87jIrf9.mjs → PartOfManifest-HLg-r00O.mjs} +1 -1
- package/dist/web-components/{Pending-CYAQajKu.mjs → Pending-BxGjjnqq.mjs} +1 -1
- package/dist/web-components/PlaceBox-D-Zhe9-U.mjs +1 -0
- package/dist/web-components/Placeholder-DzY5hcbk.mjs +1 -0
- package/dist/web-components/{Position-BkWBRBfW.mjs → Position-TYnzcm8e.mjs} +1 -1
- package/dist/web-components/{Primitives-BmODPlnK.mjs → Primitives-C6VJXxZD.mjs} +1 -1
- package/dist/web-components/Provider-DyB0wpeO.mjs +1 -0
- package/dist/web-components/{ReadMore-BwGFsLS2.mjs → ReadMore-De_0T7lc.mjs} +1 -1
- package/dist/web-components/Root-Bt3NNBFb.mjs +1 -0
- package/dist/web-components/Scene-DrOM9YlD.mjs +1 -0
- package/dist/web-components/SceneView-DA7Yg20p.mjs +1 -0
- package/dist/web-components/{Search-CbmK9vLp.mjs → Search-DgT8OPsK.mjs} +1 -1
- package/dist/web-components/{Sections-Dy5_pkyQ.mjs → Sections-d1acn7qm.mjs} +2 -2
- package/dist/web-components/{StandaloneItems-BmUnBp0H.mjs → StandaloneItems-DUb4YKCB.mjs} +1 -1
- package/dist/web-components/{Status-Dww3Pyf4.mjs → Status-CcU3u6P4.mjs} +1 -1
- package/dist/web-components/{Steps-o_UprQfZ.mjs → Steps-nlSCzbDQ.mjs} +1 -1
- package/dist/web-components/{TargetItems-BBOGDubv.mjs → TargetItems-BDJM3Ar-.mjs} +1 -1
- package/dist/web-components/Timeline-BfdN3lIv.mjs +1 -0
- package/dist/web-components/{Tip-BbexILXs.mjs → Tip-OCB88zwY.mjs} +1 -1
- package/dist/web-components/{Transcript-ZVXM3ZDA.mjs → Transcript-bSA3cx_K.mjs} +1 -1
- package/dist/web-components/Transport-DaIhfZqC.mjs +1 -0
- package/dist/web-components/Transport-DjOYI-fR.mjs +1 -0
- package/dist/web-components/{annotation-collection-7SS1ELcO.mjs → annotation-collection-D8emkElk.mjs} +1 -1
- package/dist/web-components/{annotation-name-CYkZopdd.mjs → annotation-name-DbWjhgra.mjs} +1 -1
- package/dist/web-components/{annotations-content-Bdtn50sf.mjs → annotations-content-Bg6aVAGC.mjs} +1 -1
- package/dist/web-components/{body-CkOBHlJ0.mjs → body-Ct8dmQdW.mjs} +1 -1
- package/dist/web-components/canvas-goEZLqEd.mjs +1 -0
- package/dist/web-components/cloverEngine-Df7cMwOP.mjs +164 -0
- package/dist/web-components/{content-state-reader-Ahh6artg.mjs → content-state-reader-CNmBpG1L.mjs} +1 -1
- package/dist/web-components/{controls-BJrZVQkS.mjs → controls-BZr16sYQ.mjs} +1 -1
- package/dist/web-components/custom-elements.json +160 -44
- package/dist/web-components/{downloads-CqVWo-yn.mjs → downloads-EjJ6Hpip.mjs} +1 -1
- package/dist/web-components/dragToClose-X9NbZOhA.mjs +1 -0
- package/dist/web-components/{engine-B-sscpLa.mjs → engine-DMoc0tff.mjs} +1 -1
- package/dist/web-components/{engines-DfCHjbt3.mjs → engines-BmB81VXR.mjs} +1 -1
- package/dist/web-components/es-B1NvdYp-.mjs +1 -0
- package/dist/web-components/{fetchManifest-BIzne1Pj.mjs → fetchManifest-CwQC6cCh.mjs} +1 -1
- package/dist/web-components/fi-BjtYZNLo.mjs +1 -0
- package/dist/web-components/fr-Cd22Lziw.mjs +1 -0
- package/dist/web-components/fromManifest-DrAmY1lB.mjs +1 -0
- package/dist/web-components/glyphs-BFK_hvJJ.mjs +1 -0
- package/dist/web-components/hooks-BhtNDs_1.mjs +1 -0
- package/dist/web-components/image-layers-D2nQC4R-.mjs +1 -0
- package/dist/web-components/{imageService-0eTvQ-3h.mjs → imageService-iFElsopt.mjs} +1 -1
- package/dist/web-components/index-FJEpXukG.mjs +1 -0
- package/dist/web-components/index.d.mts +4 -4
- package/dist/web-components/index.mjs +1 -1
- package/dist/web-components/items-BPPrqbeh.mjs +1 -0
- package/dist/web-components/items-BnEnc5ot.mjs +1 -0
- package/dist/web-components/label-DauFa5sg.mjs +1 -0
- package/dist/web-components/layout-Djwu8f4R.mjs +1 -0
- package/dist/web-components/{link-GEdiEwlR.mjs → link-0lUlTZlw.mjs} +1 -1
- package/dist/web-components/logo-DWPxaZaG.mjs +1 -0
- package/dist/web-components/masonry-0QfzOgbB.mjs +1 -0
- package/dist/web-components/{models-59cEeiAA.mjs → models-BF2pqufA.mjs} +1 -1
- package/dist/web-components/nb-CEwZDBiR.mjs +1 -0
- package/dist/web-components/nn-jYQhr9RI.mjs +1 -0
- package/dist/web-components/no-CEwZDBiR.mjs +1 -0
- package/dist/web-components/{nodes-CTw9OqlA.mjs → nodes-ChQRLDGU.mjs} +1 -1
- package/dist/web-components/{overlayImage-BMt4UTlR.mjs → overlayImage-MKrcgDep.mjs} +1 -1
- package/dist/web-components/panClearOfControls-Cn2ZXsZi.mjs +1 -0
- package/dist/web-components/{panel-C17Rl9Ya.mjs → panel-C13V6w6E.mjs} +1 -1
- package/dist/web-components/part-CekFWrtz.mjs +1 -0
- package/dist/web-components/playerSurface-DG1XipTq.mjs +1 -0
- package/dist/web-components/pointer-YQppt0at.mjs +1 -0
- package/dist/web-components/{provider-BpxorEiq.mjs → provider-DiUkZYiW.mjs} +1 -1
- package/dist/web-components/pt-CWR30SzS.mjs +1 -0
- package/dist/web-components/{range-regions-BGQy4E9U.mjs → range-regions-CqGjyM76.mjs} +1 -1
- package/dist/web-components/{read-more-BDM_6CVc.mjs → read-more-D8RJYdtQ.mjs} +1 -1
- package/dist/web-components/readingLanguages-BWOLZK2k.mjs +1 -0
- package/dist/web-components/rendererSurface-BkbGDL_Z.mjs +22 -0
- package/dist/web-components/{renderers-CiB74bQh.mjs → renderers-LtRX5pT0.mjs} +1 -1
- package/dist/web-components/{resource-CRbpf9pX.mjs → resource-Cfydiy4m.mjs} +1 -1
- package/dist/web-components/{save-file-CCuZEuQr.mjs → save-file-dZyOpXgY.mjs} +1 -1
- package/dist/web-components/search-BfUZJM3a.mjs +1 -0
- package/dist/web-components/shared-DkY2a89G.mjs +1 -0
- package/dist/web-components/{show-link-BXm7SNIC.mjs → show-link-DgLJzG7k.mjs} +1 -1
- package/dist/web-components/{sizedImage-k4Q-eyOB.mjs → sizedImage-NHzhcBYk.mjs} +1 -1
- package/dist/web-components/{split-Hp6z-v4h.mjs → split-CuFiKjin.mjs} +1 -1
- package/dist/web-components/{status-BmtuKfAG.mjs → status-C3etlkhY.mjs} +1 -1
- package/dist/web-components/styles-DkkVOSUQ.mjs +1 -0
- package/dist/web-components/three.mjs +1 -1
- package/dist/web-components/{thumbnail-Dp7a8oom.mjs → thumbnail-DecrVnpj.mjs} +1 -1
- package/dist/web-components/{tip-C-oovDZK.mjs → tip-D5YgaIWW.mjs} +1 -1
- package/dist/web-components/{toggle-C7ODWDEZ.mjs → toggle-CZGB65VZ.mjs} +1 -1
- package/dist/web-components/{useContainerName-CrOmY-km.mjs → useContainerName-hKQjEt7a.mjs} +1 -1
- package/dist/web-components/useControlsVisibility-DPg8uAkW.mjs +1 -0
- package/dist/web-components/useLazyPanelPane-eby-OI1V.mjs +1 -0
- package/dist/web-components/{useNearViewport-BqXi9Gn4.mjs → useNearViewport-CDbHQUBk.mjs} +1 -1
- package/dist/web-components/useScrollTrack-D9l_P3_B.mjs +1 -0
- package/dist/web-components/viewer/AnnotationItems-DtsnDXPM.mjs +1 -0
- package/dist/web-components/viewer/{AnnotationMenu-DPOSehBo.mjs → AnnotationMenu-C-Mz6CCn.mjs} +1 -1
- package/dist/web-components/viewer/AnnotationState-5pim5K72.mjs +1 -0
- package/dist/web-components/viewer/Annotations-Cqn1TkzD.mjs +2 -0
- package/dist/web-components/viewer/Annotations-CxwN9FkB.mjs +1 -0
- package/dist/web-components/viewer/{Canvas2DBackend-BTK6ZJh0.mjs → Canvas2DBackend-C-ZMSCak.mjs} +1 -1
- package/dist/web-components/viewer/CaptionDetails-CRD-gSZP.mjs +1 -0
- package/dist/web-components/viewer/ChaptersMenu-Brcq3yJv.mjs +1 -0
- package/dist/web-components/viewer/{ChoiceMenu-DQ1x572Y.mjs → ChoiceMenu-ByGzQQx1.mjs} +1 -1
- package/dist/web-components/viewer/Collection-m0GCcsfQ.mjs +1 -0
- package/dist/web-components/viewer/Connected-Bmc_CdUD.mjs +1 -0
- package/dist/web-components/viewer/Connected-Dvx7wtot.mjs +1 -0
- package/dist/web-components/viewer/Contents-CwDpfiJY.mjs +1 -0
- package/dist/web-components/viewer/ControlMenu-TcO85hDf.mjs +1 -0
- package/dist/web-components/viewer/ControlsFade-BoZ4ABAE.mjs +1 -0
- package/dist/web-components/viewer/{CountMenu-4u6U6yqb.mjs → CountMenu-0-ie8kIZ.mjs} +1 -1
- package/dist/web-components/viewer/Cue-DxmAS9Gx.mjs +1 -0
- package/dist/web-components/viewer/Document-BsryuYJ1.mjs +1 -0
- package/dist/web-components/viewer/{DomLayers-CGkDtemL.mjs → DomLayers-hc0qARQc.mjs} +1 -1
- package/dist/web-components/viewer/Download-MO-1Rik4.mjs +1 -0
- package/dist/web-components/viewer/EntryBodies-g-OEwEsk.mjs +1 -0
- package/dist/web-components/viewer/EntryThumbnail-DcIDYATi.mjs +1 -0
- package/dist/web-components/viewer/{FieldPill-DFXGWrvB.mjs → FieldPill-B9S21lxw.mjs} +1 -1
- package/dist/web-components/viewer/FrameAnimation-qI9cZPEs.mjs +1 -0
- package/dist/web-components/viewer/Gallery-BOgUqfqw.mjs +1 -0
- package/dist/web-components/viewer/{HideToggle-DP5kHzWM.mjs → HideToggle-D8wH49mq.mjs} +1 -1
- package/dist/web-components/viewer/ImageControls-ZoEC9jWd.mjs +1 -0
- package/dist/web-components/viewer/LanguageChoice-CRqsCBAp.mjs +1 -0
- package/dist/web-components/viewer/LightboxView-BB-GcbYr.mjs +1 -0
- package/dist/web-components/viewer/ListEnd-D9Obxie4.mjs +1 -0
- package/dist/web-components/viewer/{MapView-BN9wXQKV.mjs → MapView-DQSwUzd7.mjs} +2 -2
- package/dist/web-components/viewer/MediaBody-CIw2nTlj.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-D5ff6xy-.mjs +1 -0
- package/dist/web-components/viewer/{NavDate-C2-wwLuB.mjs → NavDate-BnfDG57h.mjs} +1 -1
- package/dist/web-components/viewer/{Navigator-C3jghOd3.mjs → Navigator-BNwjmkXY.mjs} +1 -1
- package/dist/web-components/viewer/PagerLayout-C8jraHqs.mjs +1 -0
- package/dist/web-components/viewer/PanelPart-YNbBI9SQ.mjs +1 -0
- package/dist/web-components/viewer/{PartOfManifest-D22yMgCf.mjs → PartOfManifest-DX7H0V4g.mjs} +1 -1
- package/dist/web-components/viewer/PlaceBox-CCWfzsNU.mjs +1 -0
- package/dist/web-components/viewer/Placeholder-CsEkLhz7.mjs +1 -0
- package/dist/web-components/viewer/Search-CsdYzdq1.mjs +1 -0
- package/dist/web-components/viewer/StandaloneItems-BfvBxbUm.mjs +1 -0
- package/dist/web-components/viewer/{Steps-Bw32X5xO.mjs → Steps-BH8ZApS4.mjs} +1 -1
- package/dist/web-components/viewer/{TargetItems-DLhUH1Gq.mjs → TargetItems-BebPFr-c.mjs} +1 -1
- package/dist/web-components/viewer/Transcript-DXLv5WR9.mjs +1 -0
- package/dist/web-components/viewer/Transport-C-fh7Kx2.mjs +1 -0
- package/dist/web-components/viewer/Transport-CY6BWfMi.mjs +1 -0
- package/dist/web-components/viewer/annotation-collection-Cjd8Dgyl.mjs +1 -0
- package/dist/web-components/viewer/annotation-name-CwmgQFia.mjs +1 -0
- package/dist/web-components/viewer/{annotations-content-CbA3eOIC.mjs → annotations-content-BARXoAz-.mjs} +1 -1
- package/dist/web-components/viewer/cloverEngine-CumnJPKO.mjs +164 -0
- package/dist/web-components/viewer/{content-state-reader-C7UBMOq3.mjs → content-state-reader-DuvyLThu.mjs} +1 -1
- package/dist/web-components/viewer/dragToClose-CFCxhUxn.mjs +1 -0
- package/dist/web-components/viewer/{fetchManifest-C2Yxg3x9.mjs → fetchManifest-qNB_KgxL.mjs} +1 -1
- package/dist/web-components/viewer/{host-CZeyjCKR.mjs → host-GTHX2fPK.mjs} +1 -1
- package/dist/web-components/viewer/image-layers-DKOuaRTj.mjs +1 -0
- package/dist/web-components/viewer/index.mjs +1 -1
- package/dist/web-components/viewer/{link-DssZ0Z2N.mjs → link-BlaM0tCa.mjs} +1 -1
- package/dist/web-components/viewer/overlayImage-RVpv69R5.mjs +1 -0
- package/dist/web-components/viewer/range-regions-CIZiAHOp.mjs +1 -0
- package/dist/web-components/viewer/{renderers-DLoqv3QO.mjs → renderers-Dw1klwlx.mjs} +1 -1
- package/dist/web-components/viewer/{save-file-CJT5p5Hg.mjs → save-file-EvzaBEJN.mjs} +1 -1
- package/dist/web-components/viewer/{search-PhOwMKHi.mjs → search-x1QL_bth.mjs} +1 -1
- package/dist/web-components/viewer/styles-I7_LWFGj.mjs +1 -0
- package/dist/web-components/viewer/useControlsVisibility-C_SQHIVR.mjs +1 -0
- package/dist/web-components/viewer/useLazyPanelPane-UuGDJrf_.mjs +1 -0
- package/dist/web-components/viewer/viewer-DJrQuNs1.mjs +29 -0
- package/dist/web-components/viewer/{vtt-1Pk7Dhsj.mjs → vtt-C2G89SWH.mjs} +1 -1
- package/dist/web-components/viewer-Br44EEba.mjs +1 -0
- package/dist/web-components/{vtt-CacHieeN.mjs → vtt-Dd0c7psH.mjs} +1 -1
- package/package.json +1 -1
- package/dist/templates/shared/LightboxBody.mjs +0 -9
- package/dist/web-components/About-DhOGPFaI.mjs +0 -1
- package/dist/web-components/AnnotationItems-CNP4CJiT.mjs +0 -1
- package/dist/web-components/Body-DaY1UJIy.mjs +0 -1
- package/dist/web-components/BodyUnloadable-DcTM7hHF.mjs +0 -1
- package/dist/web-components/CanvasView-BWQ4SK2b.mjs +0 -2
- package/dist/web-components/CaptionDetails-DSziiuQV.mjs +0 -1
- package/dist/web-components/ChoiceMenu-DTuEEUeM.mjs +0 -1
- package/dist/web-components/Collection-B9swJtPW.mjs +0 -1
- package/dist/web-components/ControlMenu-Crtho2cs.mjs +0 -1
- package/dist/web-components/Cue-CbZaGwZh.mjs +0 -1
- package/dist/web-components/Document-BfltLWZZ.mjs +0 -1
- package/dist/web-components/DocumentPanel-ZSe40cV4.mjs +0 -1
- package/dist/web-components/FrameAnimation-IfR1czfc.mjs +0 -1
- package/dist/web-components/Gallery-DD06BDQo.mjs +0 -1
- package/dist/web-components/Items-BHzT9A73.mjs +0 -1
- package/dist/web-components/Label-KabnxuMN.mjs +0 -1
- package/dist/web-components/LightboxBody-BhRhdXo6.mjs +0 -1
- package/dist/web-components/ListEnd-CbwNlty-.mjs +0 -1
- package/dist/web-components/LoadedCanvas-CdZ5WOWz.mjs +0 -1
- package/dist/web-components/LoadedMap-DQyQVRVQ.mjs +0 -1
- package/dist/web-components/MapView-duA5WGsu.mjs +0 -3
- package/dist/web-components/Markup-D-kioDf9.mjs +0 -2
- package/dist/web-components/MediaBody-CoOiVXcv.mjs +0 -1
- package/dist/web-components/MediaBody-d8ErTuwT.mjs +0 -1
- package/dist/web-components/PagerLayout-CvOmKtSW.mjs +0 -1
- package/dist/web-components/Panel-CIdjOznL.mjs +0 -1
- package/dist/web-components/PlaceBox-BtIbIotm.mjs +0 -1
- package/dist/web-components/Placeholder-TIyj4ZjR.mjs +0 -1
- package/dist/web-components/Provider-C8se8i4I.mjs +0 -1
- package/dist/web-components/Root-CAJB0-Mh.mjs +0 -1
- package/dist/web-components/Scene-Ctcdt7CD.mjs +0 -1
- package/dist/web-components/SceneView-B6bEx_7x.mjs +0 -1
- package/dist/web-components/Timeline-CfIF4APc.mjs +0 -1
- package/dist/web-components/canvas-CWf_Fag8.mjs +0 -1
- package/dist/web-components/cloverEngine-6djEHNCD.mjs +0 -164
- package/dist/web-components/dragToClose-C-Pf1IeO.mjs +0 -1
- package/dist/web-components/es-BYfHUZ7P.mjs +0 -1
- package/dist/web-components/fi-B5y2qr8T.mjs +0 -1
- package/dist/web-components/fr-ChezCx6V.mjs +0 -1
- package/dist/web-components/fromManifest-gg5Wx14y.mjs +0 -1
- package/dist/web-components/glyphs-JYl2STEr.mjs +0 -1
- package/dist/web-components/hooks-x7rO95CS.mjs +0 -1
- package/dist/web-components/image-layers-BjbeyHBS.mjs +0 -1
- package/dist/web-components/index-BZ7b9k0N.mjs +0 -1
- package/dist/web-components/items-CnAIl9fS.mjs +0 -1
- package/dist/web-components/items-F6hJgdAS.mjs +0 -1
- package/dist/web-components/label-CI88KH2_.mjs +0 -1
- package/dist/web-components/layout-De1MOSYe.mjs +0 -1
- package/dist/web-components/logo-Ckwj7FlP.mjs +0 -1
- package/dist/web-components/nb-8J22f9Td.mjs +0 -1
- package/dist/web-components/nn-Dv1EvzI1.mjs +0 -1
- package/dist/web-components/no-8J22f9Td.mjs +0 -1
- package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +0 -1
- package/dist/web-components/part-CXts97_M.mjs +0 -1
- package/dist/web-components/playerSurface-HYwEwPK6.mjs +0 -1
- package/dist/web-components/pt-DWYQkATt.mjs +0 -1
- package/dist/web-components/readingLanguages-fs_HqvqQ.mjs +0 -1
- package/dist/web-components/rendererSurface-C0aKlE0v.mjs +0 -22
- package/dist/web-components/search-CkM0O0Z1.mjs +0 -1
- package/dist/web-components/shared-MTsMddHx.mjs +0 -1
- package/dist/web-components/styles-CZV1nbBQ.mjs +0 -1
- package/dist/web-components/useScrollTrack-CEsOU2yT.mjs +0 -1
- package/dist/web-components/viewer/AnnotationItems-CyhVcRFc.mjs +0 -1
- package/dist/web-components/viewer/AnnotationState-Bjztkobn.mjs +0 -1
- package/dist/web-components/viewer/Annotations-Dh_8Tzi0.mjs +0 -2
- package/dist/web-components/viewer/Annotations-wwuOCxzI.mjs +0 -1
- package/dist/web-components/viewer/CaptionDetails-BwCTovy_.mjs +0 -1
- package/dist/web-components/viewer/Collection-DSBxCmXw.mjs +0 -1
- package/dist/web-components/viewer/Connected-CL3N8F2J.mjs +0 -1
- package/dist/web-components/viewer/Connected-DTk1jlyI.mjs +0 -1
- package/dist/web-components/viewer/Contents-DrXckx7d.mjs +0 -1
- package/dist/web-components/viewer/ControlMenu-Bp91s-g_.mjs +0 -1
- package/dist/web-components/viewer/Cue-C-aF8peC.mjs +0 -1
- package/dist/web-components/viewer/Document-BN1rICu3.mjs +0 -1
- package/dist/web-components/viewer/DocumentPanel-CEesxdeY.mjs +0 -1
- package/dist/web-components/viewer/Download-CawEl9MN.mjs +0 -1
- package/dist/web-components/viewer/EntryBodies-nYHMwSSM.mjs +0 -1
- package/dist/web-components/viewer/EntryThumbnail-DrO_0SzR.mjs +0 -1
- package/dist/web-components/viewer/FrameAnimation-CZfzpxaD.mjs +0 -1
- package/dist/web-components/viewer/Gallery-MWHtvjti.mjs +0 -1
- package/dist/web-components/viewer/LanguageChoice-C50T7dPI.mjs +0 -1
- package/dist/web-components/viewer/LightboxBody-C2T7IC29.mjs +0 -1
- package/dist/web-components/viewer/ListEnd-BDuOx__m.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-CEyswliX.mjs +0 -1
- package/dist/web-components/viewer/MediaBody-Dw3DWDjc.mjs +0 -1
- package/dist/web-components/viewer/PagerLayout-Cg2NpqoD.mjs +0 -1
- package/dist/web-components/viewer/PlaceBox-Dckw4Sfk.mjs +0 -1
- package/dist/web-components/viewer/Placeholder-NYVWYg5Q.mjs +0 -1
- package/dist/web-components/viewer/Search-DC259m4f.mjs +0 -1
- package/dist/web-components/viewer/StandaloneItems-E4kpMne9.mjs +0 -1
- package/dist/web-components/viewer/Transcript-D_VGJQxn.mjs +0 -1
- package/dist/web-components/viewer/annotation-collection-DZHa18ir.mjs +0 -1
- package/dist/web-components/viewer/annotation-name-BaNdW2Xk.mjs +0 -1
- package/dist/web-components/viewer/cloverEngine-C04bCSFR.mjs +0 -164
- package/dist/web-components/viewer/image-layers-B09fporZ.mjs +0 -1
- package/dist/web-components/viewer/overlayImage-BR3eJCKq.mjs +0 -1
- package/dist/web-components/viewer/range-regions-By6L5JOK.mjs +0 -1
- package/dist/web-components/viewer/styles-NZLnZPAC.mjs +0 -1
- package/dist/web-components/viewer/viewer-D30YHqyF.mjs +0 -29
- package/dist/web-components/viewer-CH7re5OO.mjs +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -282,13 +282,16 @@ export interface ContentStateOutput {
|
|
|
282
282
|
encoded: string;
|
|
283
283
|
}
|
|
284
284
|
/**
|
|
285
|
-
* Where the reader is, as a content state: the Canvas
|
|
286
|
-
*
|
|
287
|
-
* rounded to whole pixels.
|
|
285
|
+
* Where the reader is, as a content state: the Canvas (or Presentation 4's Timeline or
|
|
286
|
+
* Scene, by its `type`) within its Manifest, and the visible region (`xywh=`) or the
|
|
287
|
+
* media time (`t=`) when there is one. Regions are rounded to whole pixels. A Canvas
|
|
288
|
+
* shown on its own, outside a Manifest (one made around it carries its id, `loneCanvas`),
|
|
289
|
+
* is named without a `partOf`.
|
|
288
290
|
*/
|
|
289
|
-
export declare function buildContentState({ manifestId, canvasId, region, time, }: {
|
|
290
|
-
manifestId
|
|
291
|
+
export declare function buildContentState({ manifestId, canvasId, type, region, time, }: {
|
|
292
|
+
manifestId?: string | null;
|
|
291
293
|
canvasId: string;
|
|
294
|
+
type?: string;
|
|
292
295
|
region?: {
|
|
293
296
|
x: number;
|
|
294
297
|
y: number;
|
|
@@ -653,8 +656,9 @@ export interface RootProps extends Omit<React.HTMLAttributes<HTMLElement>, "chil
|
|
|
653
656
|
*/
|
|
654
657
|
annotationPages?: "view" | "all";
|
|
655
658
|
/**
|
|
656
|
-
* Where the reader is, as a IIIF content state,
|
|
657
|
-
*
|
|
659
|
+
* Where the reader is, as a IIIF content state, as it changes: a move, a pan or zoom,
|
|
660
|
+
* or a pause or seek in media. At most every 150ms while it moves, always its last
|
|
661
|
+
* place, and only when it changed.
|
|
658
662
|
*/
|
|
659
663
|
onContentStateChange?: (state: ContentStateOutput) => void;
|
|
660
664
|
/** The element to render. Default `div`. */
|
|
@@ -988,6 +992,7 @@ export interface CloverCanvasOptions {
|
|
|
988
992
|
* stops moving, as the Player's `hideDelay`. Default 2000; `Infinity` keeps them once
|
|
989
993
|
* shown. A finger, or a pen that does not hover, has no timer: a tap on the picture
|
|
990
994
|
* shows them, and another hides them. Focus that no press brought holds them too.
|
|
995
|
+
* A Timeline's: a Canvas's controls stay in sight, for now (Mat, 2026-11-01).
|
|
991
996
|
*/
|
|
992
997
|
hideDelay?: number;
|
|
993
998
|
/** A time-based Canvas's video or sound. */
|
|
@@ -1116,6 +1121,14 @@ export interface CloverCanvasProps {
|
|
|
1116
1121
|
* the handle `onReady` passes (`home()`, `zoomBy(0.5)`) (WCAG 2.5.1).
|
|
1117
1122
|
*/
|
|
1118
1123
|
controls?: boolean | CanvasControlsConfig;
|
|
1124
|
+
/**
|
|
1125
|
+
* When the view's controls (zoom in and out, the two turns, reset, full screen)
|
|
1126
|
+
* collapse behind one button, at the end of the controls' one row, so the row fits any
|
|
1127
|
+
* width and leaves the media more room: `"auto"` (the default), only where the row
|
|
1128
|
+
* cannot hold them all; `"always"`, wherever the Canvas offers any, so the row holds
|
|
1129
|
+
* only the rest. Pressed, the button opens a tray of them beside the rest.
|
|
1130
|
+
*/
|
|
1131
|
+
collapseControls?: "auto" | "always";
|
|
1119
1132
|
/** Replace any control with your own component — the `Viewer`'s `controlButtons`. */
|
|
1120
1133
|
controlButtons?: ControlButtons;
|
|
1121
1134
|
/**
|
|
@@ -1183,6 +1196,17 @@ export interface CloverCanvasProps {
|
|
|
1183
1196
|
manifestId?: string;
|
|
1184
1197
|
/** The visible world rectangle, at most once per frame while the camera moves. */
|
|
1185
1198
|
onViewportChange?: (bounds: Rect) => void;
|
|
1199
|
+
/**
|
|
1200
|
+
* Where it is, as a IIIF content state, as it changes: as the Canvas changes, the
|
|
1201
|
+
* camera pans or zooms, or its media pauses or seeks. Both forms, the
|
|
1202
|
+
* annotation (`json`) and the same encoded for a URL (`encoded`); the Canvas, within its
|
|
1203
|
+
* Manifest (`manifestId`, the one it loaded, or its Root's), and the region in view or
|
|
1204
|
+
* the time. Of several shown together, it names the one filling most of the view.
|
|
1205
|
+
* Given `canvases`, it names no Manifest unless `manifestId` does; given only `src` or
|
|
1206
|
+
* `body`, it has no Canvas to name, and reports nothing. At most every 150ms while it
|
|
1207
|
+
* moves, always its last place, and only when it changed.
|
|
1208
|
+
*/
|
|
1209
|
+
onContentStateChange?: (state: ContentStateOutput) => void;
|
|
1186
1210
|
/**
|
|
1187
1211
|
* A time-based Canvas's media element once it exists, and `null` when it goes: for a
|
|
1188
1212
|
* host's own transcript, chapters or `#t=` seeks. Sound plays through a `<video>` too.
|
|
@@ -1260,7 +1284,7 @@ export type BodyProps = Omit<CloverCanvasProps, "canvases" | "body" | "src" | "i
|
|
|
1260
1284
|
* shows Clover's loading mark, a line along its top edge, over what it still shows; it
|
|
1261
1285
|
* keeps its size and its background, so nothing moves.
|
|
1262
1286
|
*/
|
|
1263
|
-
export declare function Body({ className, style, renderers, children, ...canvas }: BodyProps): React.JSX.Element;
|
|
1287
|
+
export declare function Body({ className, style, renderers, collapseControls, onContentStateChange, children, ...canvas }: BodyProps): React.JSX.Element;
|
|
1264
1288
|
export interface LabelProps extends Omit<React.HTMLAttributes<HTMLElement>, "lang"> {
|
|
1265
1289
|
/** Whose label: the Manifest's (the default), or the current Canvas's. */
|
|
1266
1290
|
of?: "manifest" | "canvas";
|
|
@@ -1275,6 +1299,44 @@ export interface LabelProps extends Omit<React.HTMLAttributes<HTMLElement>, "lan
|
|
|
1275
1299
|
* none.
|
|
1276
1300
|
*/
|
|
1277
1301
|
export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLElement>>;
|
|
1302
|
+
/**
|
|
1303
|
+
* What `Items` shows: light models of a Manifest's views or a Collection's members, never
|
|
1304
|
+
* the resources themselves, so a long sequence costs a few fields per item.
|
|
1305
|
+
*
|
|
1306
|
+
* Memoized on the resource object, as the selectors are.
|
|
1307
|
+
*/
|
|
1308
|
+
export interface ItemPart {
|
|
1309
|
+
id: string;
|
|
1310
|
+
type: string;
|
|
1311
|
+
label?: LanguageMapLike;
|
|
1312
|
+
/** The resource, for a thumbnail and for `renderItem`. */
|
|
1313
|
+
resource: unknown;
|
|
1314
|
+
/** Seconds, for video and sound. */
|
|
1315
|
+
duration?: number;
|
|
1316
|
+
/** What it mostly paints: `Image`, `Video`, `Audio` (`Sound` in Presentation 3) or `Model`. */
|
|
1317
|
+
media?: string;
|
|
1318
|
+
/**
|
|
1319
|
+
* Its picture, where it is not the resource's own: a region of its Canvas (a content
|
|
1320
|
+
* state's target, Cookbook 0540). Null for none.
|
|
1321
|
+
*/
|
|
1322
|
+
source?: ThumbnailSource | null;
|
|
1323
|
+
}
|
|
1324
|
+
export interface ItemModel {
|
|
1325
|
+
/** The first Canvas of a view, or a member's id. What selecting it goes to. */
|
|
1326
|
+
id: string;
|
|
1327
|
+
/** A Canvas view: one Canvas, or a spread. A member: itself. */
|
|
1328
|
+
parts: ItemPart[];
|
|
1329
|
+
label?: LanguageMapLike;
|
|
1330
|
+
summary?: LanguageMapLike;
|
|
1331
|
+
/** A member's date for navigation, as written (Cookbook 0318). */
|
|
1332
|
+
navDate?: string;
|
|
1333
|
+
/** Where a link to a member goes: its `homepage`, else its id. */
|
|
1334
|
+
href?: string;
|
|
1335
|
+
/** That homepage's own language, where its `language` gives one. */
|
|
1336
|
+
hrefLang?: string;
|
|
1337
|
+
}
|
|
1338
|
+
/** The line under an item's label: its summary, its date (`navDate`), or neither. */
|
|
1339
|
+
export type ItemSecondary = "summary" | "navDate" | "none";
|
|
1278
1340
|
/**
|
|
1279
1341
|
* What the pieces step through inside a Root: its views, its Collection's members, or a
|
|
1280
1342
|
* content state's targets (Cookbook 0540).
|
|
@@ -1318,52 +1380,24 @@ export declare const Previous: React.ForwardRefExoticComponent<StepProps & React
|
|
|
1318
1380
|
/** Go to the next item. `aria-disabled` on the last. */
|
|
1319
1381
|
export declare const Next: React.ForwardRefExoticComponent<StepProps & React.RefAttributes<HTMLButtonElement>>;
|
|
1320
1382
|
/**
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1324
|
-
* Memoized on the resource object, as the selectors are.
|
|
1383
|
+
* A scrolling row of thumbnails (`slider`), a column, a wrapping grid, a grid whose
|
|
1384
|
+
* pictures keep their proportions (`masonry`), or one item at a time (`pager`: Previous,
|
|
1385
|
+
* Position and Next).
|
|
1325
1386
|
*/
|
|
1326
|
-
export
|
|
1327
|
-
id: string;
|
|
1328
|
-
type: string;
|
|
1329
|
-
label?: LanguageMapLike;
|
|
1330
|
-
/** The resource, for a thumbnail and for `renderItem`. */
|
|
1331
|
-
resource: unknown;
|
|
1332
|
-
/** Seconds, for video and sound. */
|
|
1333
|
-
duration?: number;
|
|
1334
|
-
/** What it mostly paints: `Image`, `Video`, `Audio` (`Sound` in Presentation 3) or `Model`. */
|
|
1335
|
-
media?: string;
|
|
1336
|
-
/**
|
|
1337
|
-
* Its picture, where it is not the resource's own: a region of its Canvas (a content
|
|
1338
|
-
* state's target, Cookbook 0540). Null for none.
|
|
1339
|
-
*/
|
|
1340
|
-
source?: ThumbnailSource | null;
|
|
1341
|
-
}
|
|
1342
|
-
export interface ItemModel {
|
|
1343
|
-
/** The first Canvas of a view, or a member's id. What selecting it goes to. */
|
|
1344
|
-
id: string;
|
|
1345
|
-
/** A Canvas view: one Canvas, or a spread. A member: itself. */
|
|
1346
|
-
parts: ItemPart[];
|
|
1347
|
-
label?: LanguageMapLike;
|
|
1348
|
-
summary?: LanguageMapLike;
|
|
1349
|
-
/** A member's date for navigation, as written (Cookbook 0318). */
|
|
1350
|
-
navDate?: string;
|
|
1351
|
-
/** Where a link to a member goes: its `homepage`, else its id. */
|
|
1352
|
-
href?: string;
|
|
1353
|
-
/** That homepage's own language, where its `language` gives one. */
|
|
1354
|
-
hrefLang?: string;
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* A scrolling row of thumbnails (`slider`), a column, a wrapping grid, or one item at a
|
|
1358
|
-
* time (`pager`: Previous, Position and Next).
|
|
1359
|
-
*/
|
|
1360
|
-
export type ItemsLayout = "slider" | "list" | "grid" | "pager";
|
|
1387
|
+
export type ItemsLayout = "slider" | "list" | "grid" | "masonry" | "pager";
|
|
1361
1388
|
export interface ItemsProps extends Omit<React.HTMLAttributes<HTMLElement>, "onSelect" | "children"> {
|
|
1362
1389
|
/**
|
|
1363
|
-
* A scrolling row (the default), a column, a wrapping grid, or `pager`:
|
|
1364
|
-
* Position and Next, stepping one item at a time, with no thumbnails.
|
|
1390
|
+
* A scrolling row (the default), a column, a wrapping grid, `masonry`, or `pager`:
|
|
1391
|
+
* Previous, Position and Next, stepping one item at a time, with no thumbnails.
|
|
1392
|
+
* `masonry` is a grid whose pictures keep their own proportions, each item packed up
|
|
1393
|
+
* under the one above it, still in reading order, left to right.
|
|
1365
1394
|
*/
|
|
1366
1395
|
layout?: ItemsLayout;
|
|
1396
|
+
/**
|
|
1397
|
+
* The line under an item's label, where it has one (a Collection's members do): its
|
|
1398
|
+
* `summary` (the default), its `navDate`, or `none`. Default `"summary"`.
|
|
1399
|
+
*/
|
|
1400
|
+
secondary?: ItemSecondary;
|
|
1367
1401
|
/**
|
|
1368
1402
|
* The pager's size: `large` (the default), round controls; or `small`, its steps and
|
|
1369
1403
|
* count as Search's are, for a header's line. Default `"large"`.
|
|
@@ -1405,6 +1439,12 @@ export interface ItemsProps extends Omit<React.HTMLAttributes<HTMLElement>, "onS
|
|
|
1405
1439
|
headingLevel?: number;
|
|
1406
1440
|
/** Pixels requested for each thumbnail's longer side. Default 200. */
|
|
1407
1441
|
thumbnailSize?: number;
|
|
1442
|
+
/**
|
|
1443
|
+
* Inside a `Root`: list the views even where there is only one, as a gallery's grid
|
|
1444
|
+
* does. The pager, with nothing to step to, still draws nothing. Default `false`: one
|
|
1445
|
+
* view has nothing to choose between.
|
|
1446
|
+
*/
|
|
1447
|
+
singleItem?: boolean;
|
|
1408
1448
|
/** Standalone: credentials, headers and `fetch`. In a `Root`, the Root's are used. */
|
|
1409
1449
|
request?: CloverRequest;
|
|
1410
1450
|
/** Standalone: the language to read IIIF text in. */
|
|
@@ -1967,7 +2007,7 @@ export declare function PanelToggle({ open, onOpenChange, controls, }: PanelTogg
|
|
|
1967
2007
|
* itself.
|
|
1968
2008
|
*/
|
|
1969
2009
|
export declare const Canvas: React.FC<CloverCanvasProps>;
|
|
1970
|
-
export type TimelineProps = Omit<CloverCanvasProps, "canvases" | "body" | "src" | "isTiledImage" | "viewingDirection" | "navigator" | "onViewportChange" | "onReady" | "animateAnnotations"> & {
|
|
2010
|
+
export type TimelineProps = Omit<CloverCanvasProps, "canvases" | "body" | "src" | "isTiledImage" | "viewingDirection" | "navigator" | "collapseControls" | "onViewportChange" | "onReady" | "animateAnnotations"> & {
|
|
1971
2011
|
/**
|
|
1972
2012
|
* A Presentation 4 Timeline to play: its sound, with what it carries (captions, a
|
|
1973
2013
|
* transcript, annotations on its time, an accompanying or placeholder Canvas).
|
|
@@ -2060,6 +2100,13 @@ export interface SceneProps {
|
|
|
2060
2100
|
* rest, and sparse accessors, which Clover's does not draw yet.
|
|
2061
2101
|
*/
|
|
2062
2102
|
engine?: "clover" | "three";
|
|
2103
|
+
/**
|
|
2104
|
+
* Where it is, as a IIIF content state, each time the Scene shown changes: the Scene
|
|
2105
|
+
* within its Manifest (`manifestId`, the one it loaded, or its Root's), as the
|
|
2106
|
+
* annotation (`json`) and the same encoded for a URL (`encoded`). A content state has no
|
|
2107
|
+
* camera to carry, so turning or zooming the models leaves it as it is.
|
|
2108
|
+
*/
|
|
2109
|
+
onContentStateChange?: (state: ContentStateOutput) => void;
|
|
2063
2110
|
/** Rendered after the controls in the cluster: a host's own controls. */
|
|
2064
2111
|
children?: React.ReactNode;
|
|
2065
2112
|
}
|
|
@@ -2503,6 +2550,11 @@ export type DefaultProps = Omit<RootProps, "children"> & {
|
|
|
2503
2550
|
languages?: boolean;
|
|
2504
2551
|
/** The thumbnails under the Body: a layout, or `false` for none. Default `slider`. */
|
|
2505
2552
|
items?: Exclude<ItemsLayout, "pager"> | false;
|
|
2553
|
+
/**
|
|
2554
|
+
* The thumbnails even where the resource has one view, which has nothing to choose
|
|
2555
|
+
* between. Default `false`.
|
|
2556
|
+
*/
|
|
2557
|
+
singleItem?: boolean;
|
|
2506
2558
|
/**
|
|
2507
2559
|
* Where the panel's width is remembered once the reader drags its bar
|
|
2508
2560
|
* (`localStorage`). Default `"clover-template-default"`; `false` forgets it.
|
|
@@ -2515,8 +2567,14 @@ export type DefaultProps = Omit<RootProps, "children"> & {
|
|
|
2515
2567
|
* `--clover-body-height` tall, and the layout as tall as it needs.
|
|
2516
2568
|
*/
|
|
2517
2569
|
fill?: boolean;
|
|
2570
|
+
/**
|
|
2571
|
+
* When the Body's view controls (zoom, the turns, reset, full screen) wait behind
|
|
2572
|
+
* More: `"auto"` (the default), only where its row cannot hold them all; `"always"`.
|
|
2573
|
+
* The Body's `collapseControls`.
|
|
2574
|
+
*/
|
|
2575
|
+
collapseControls?: "auto" | "always";
|
|
2518
2576
|
};
|
|
2519
|
-
declare function Default({ className, header, headingLevel, panel, defaultPanelOpen, panelLayout, download, languages, items, storageKey, fill, ...root }: DefaultProps): React.JSX.Element;
|
|
2577
|
+
declare function Default({ className, header, headingLevel, panel, defaultPanelOpen, panelLayout, download, languages, items, singleItem, storageKey, fill, collapseControls, ...root }: DefaultProps): React.JSX.Element;
|
|
2520
2578
|
/**
|
|
2521
2579
|
* A layout the Viewer draws: one from `@nulib/clover/templates`, or a component of your
|
|
2522
2580
|
* own that takes the `Clover.Root` props.
|
package/dist/lib/gltf/load.mjs
CHANGED
|
@@ -37,19 +37,21 @@ async function fetchBytes(uri, base, request) {
|
|
|
37
37
|
return response.arrayBuffer();
|
|
38
38
|
}
|
|
39
39
|
const loading = /* @__PURE__ */ new WeakMap();
|
|
40
|
-
function loadGltf(url, request) {
|
|
40
|
+
function loadGltf(url, request, maxTextureSize) {
|
|
41
41
|
const run = (request == null ? void 0 : request.fetch) ?? globalThis.fetch;
|
|
42
42
|
const loads = loading.get(run) ?? /* @__PURE__ */ new Map();
|
|
43
43
|
loading.set(run, loads);
|
|
44
|
-
const key = `${requestKey(request)} ${url}`;
|
|
44
|
+
const key = `${requestKey(request)} ${maxTextureSize ?? ""} ${url}`;
|
|
45
45
|
let load = loads.get(key);
|
|
46
46
|
if (!load) {
|
|
47
|
-
load = readGltf(url, request).finally(
|
|
47
|
+
load = readGltf(url, request, maxTextureSize).finally(
|
|
48
|
+
() => loads.delete(key)
|
|
49
|
+
);
|
|
48
50
|
loads.set(key, load);
|
|
49
51
|
}
|
|
50
52
|
return load;
|
|
51
53
|
}
|
|
52
|
-
async function readGltf(url, request) {
|
|
54
|
+
async function readGltf(url, request, maxTextureSize) {
|
|
53
55
|
const data = await fetchBytes(url, location.href, request);
|
|
54
56
|
const glb = new DataView(data).getUint32(0, true) === GLB;
|
|
55
57
|
const { json, bin } = glb ? parseGlb(data) : { json: JSON.parse(new TextDecoder().decode(data)) };
|
|
@@ -88,10 +90,15 @@ async function readGltf(url, request) {
|
|
|
88
90
|
type: image.mimeType
|
|
89
91
|
});
|
|
90
92
|
} else return null;
|
|
91
|
-
|
|
93
|
+
const options = {
|
|
92
94
|
premultiplyAlpha: "none",
|
|
93
95
|
colorSpaceConversion: "none"
|
|
94
|
-
}
|
|
96
|
+
};
|
|
97
|
+
return await fitted(
|
|
98
|
+
await createImageBitmap(blob, options),
|
|
99
|
+
maxTextureSize,
|
|
100
|
+
options
|
|
101
|
+
);
|
|
95
102
|
} catch {
|
|
96
103
|
return null;
|
|
97
104
|
}
|
|
@@ -99,6 +106,19 @@ async function readGltf(url, request) {
|
|
|
99
106
|
);
|
|
100
107
|
return { json, buffers, images };
|
|
101
108
|
}
|
|
109
|
+
async function fitted(bitmap, most, options) {
|
|
110
|
+
const longest = Math.max(bitmap.width, bitmap.height);
|
|
111
|
+
if (!most || longest <= most) return bitmap;
|
|
112
|
+
const ratio = most / longest;
|
|
113
|
+
const resized = await createImageBitmap(bitmap, {
|
|
114
|
+
...options,
|
|
115
|
+
resizeWidth: Math.max(1, Math.floor(bitmap.width * ratio)),
|
|
116
|
+
resizeHeight: Math.max(1, Math.floor(bitmap.height * ratio)),
|
|
117
|
+
resizeQuality: "high"
|
|
118
|
+
});
|
|
119
|
+
bitmap.close();
|
|
120
|
+
return resized;
|
|
121
|
+
}
|
|
102
122
|
const COMPONENTS = {
|
|
103
123
|
SCALAR: 1,
|
|
104
124
|
VEC2: 2,
|
|
@@ -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, visibleWorldRect, screenPointToWorld,
|
|
7
|
+
import { fitCamera, anchoredCenter, visibleWorldRect, screenPointToWorld, worldPointToScreen, sameCamera } 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";
|
|
@@ -12,7 +12,7 @@ import { loadImage } from "./io/decode.mjs";
|
|
|
12
12
|
import { FrameLoop } from "./loop/FrameLoop.mjs";
|
|
13
13
|
import { uploadBudget } from "./scene/uploadBudget.mjs";
|
|
14
14
|
import { apply, compose, rotate, scale } from "./math/affine.mjs";
|
|
15
|
-
import { union, clamp, transformRect } from "./math/rect.mjs";
|
|
15
|
+
import { union, rectCenter, clamp, transformRect } from "./math/rect.mjs";
|
|
16
16
|
import { planFrame } from "./scene/planFrame.mjs";
|
|
17
17
|
import { sameSpec, prepareItem, layoutItems, pixelsToWorld, itemToWorld, MEDIA_KEY_PREFIX } from "./scene/sceneItem.mjs";
|
|
18
18
|
const DEFAULTS = {
|
|
@@ -29,15 +29,15 @@ const MAX_CONTEXT_LOSSES = 3;
|
|
|
29
29
|
const ANNOTATION_PADDING = 0.1;
|
|
30
30
|
const ZOOM_EPSILON = 1e-6;
|
|
31
31
|
const NO_INSET = { top: 0, right: 0, bottom: 0, left: 0 };
|
|
32
|
-
function readInset(
|
|
33
|
-
if (typeof getComputedStyle !== "function") return NO_INSET;
|
|
34
|
-
const style = getComputedStyle(
|
|
35
|
-
const px = (
|
|
32
|
+
function readInset(element, box = "padding") {
|
|
33
|
+
if (!element || typeof getComputedStyle !== "function") return NO_INSET;
|
|
34
|
+
const style = getComputedStyle(element);
|
|
35
|
+
const px = (side) => parseFloat(style.getPropertyValue(`${box}-${side}`)) || 0;
|
|
36
36
|
return {
|
|
37
|
-
top: px(
|
|
38
|
-
right: px(
|
|
39
|
-
bottom: px(
|
|
40
|
-
left: px(
|
|
37
|
+
top: px("top"),
|
|
38
|
+
right: px("right"),
|
|
39
|
+
bottom: px("bottom"),
|
|
40
|
+
left: px("left")
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
const sameInset = (a, b) => a.top === b.top && a.right === b.right && a.bottom === b.bottom && a.left === b.left;
|
|
@@ -329,20 +329,38 @@ class CanvasRenderer {
|
|
|
329
329
|
}
|
|
330
330
|
return true;
|
|
331
331
|
}
|
|
332
|
-
/** Frame `bounds` (world units) in the viewport. */
|
|
333
|
-
fitBounds(bounds, immediate = false) {
|
|
334
|
-
const target =
|
|
335
|
-
bounds,
|
|
336
|
-
this.viewport,
|
|
337
|
-
this.camera.destination.rotation,
|
|
338
|
-
0
|
|
339
|
-
);
|
|
332
|
+
/** Frame `bounds` (world units) in the viewport, or in the part of it `inset` leaves. */
|
|
333
|
+
fitBounds(bounds, immediate = false, inset = NO_INSET) {
|
|
334
|
+
const target = this.fit(bounds, this.camera.destination.rotation, inset);
|
|
340
335
|
this.atHome = false;
|
|
341
336
|
this.animateTo(
|
|
342
337
|
this.constrain(target, { allowBeyondLimits: true }),
|
|
343
338
|
immediate
|
|
344
339
|
);
|
|
345
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* The camera that frames `bounds`, turned by `rotation`, in the part of the viewport
|
|
343
|
+
* `inset` leaves: centered there, off the viewport's center where its sides differ.
|
|
344
|
+
*/
|
|
345
|
+
fit(bounds, rotation, { top, right, bottom, left }) {
|
|
346
|
+
const { width, height } = this.viewport;
|
|
347
|
+
const { zoom } = fitCamera(
|
|
348
|
+
bounds,
|
|
349
|
+
{
|
|
350
|
+
width: Math.max(1, width - left - right),
|
|
351
|
+
height: Math.max(1, height - top - bottom)
|
|
352
|
+
},
|
|
353
|
+
rotation
|
|
354
|
+
);
|
|
355
|
+
const center = anchoredCenter(
|
|
356
|
+
rectCenter(bounds),
|
|
357
|
+
{ x: (width + left - right) / 2, y: (height + top - bottom) / 2 },
|
|
358
|
+
zoom,
|
|
359
|
+
rotation,
|
|
360
|
+
this.viewport
|
|
361
|
+
);
|
|
362
|
+
return { ...center, zoom, rotation };
|
|
363
|
+
}
|
|
346
364
|
/**
|
|
347
365
|
* Zoom to a rectangle in item `index`'s own coordinates — an annotation's `xywh` — with
|
|
348
366
|
* OpenSeadragon's padding.
|
|
@@ -351,8 +369,12 @@ class CanvasRenderer {
|
|
|
351
369
|
const world = this.itemRectToWorld(index, rect);
|
|
352
370
|
if (world) this.fitAnnotation(world, immediate);
|
|
353
371
|
}
|
|
354
|
-
/**
|
|
372
|
+
/**
|
|
373
|
+
* Zoom to a world rectangle with OpenSeadragon's annotation padding, clear of the
|
|
374
|
+
* controls over the view (the hotspots' layer's scroll padding, `Annotations.css`).
|
|
375
|
+
*/
|
|
355
376
|
fitAnnotation(world, immediate = false) {
|
|
377
|
+
var _a;
|
|
356
378
|
const first = this.items[0];
|
|
357
379
|
if (!first) return;
|
|
358
380
|
const pad = first.rect.width * ANNOTATION_PADDING;
|
|
@@ -363,7 +385,8 @@ class CanvasRenderer {
|
|
|
363
385
|
width: world.width + pad * 2,
|
|
364
386
|
height: world.height + pad * 2
|
|
365
387
|
},
|
|
366
|
-
immediate
|
|
388
|
+
immediate,
|
|
389
|
+
readInset((_a = this.overlays) == null ? void 0 : _a.container, "scroll-padding")
|
|
367
390
|
);
|
|
368
391
|
}
|
|
369
392
|
/** The world rectangle currently visible (its bounding box when rotated). */
|
|
@@ -663,18 +686,7 @@ class CanvasRenderer {
|
|
|
663
686
|
if (!this.worldBounds) return null;
|
|
664
687
|
const turn = 2 * Math.PI;
|
|
665
688
|
const upright = Math.round(this.camera.destination.rotation / turn) * turn || 0;
|
|
666
|
-
|
|
667
|
-
const camera = fitCamera(
|
|
668
|
-
this.worldBounds,
|
|
669
|
-
{
|
|
670
|
-
width: Math.max(1, this.viewport.width - left - right),
|
|
671
|
-
height: Math.max(1, this.viewport.height - top - bottom)
|
|
672
|
-
},
|
|
673
|
-
upright
|
|
674
|
-
);
|
|
675
|
-
camera.x -= (left - right) / 2 / camera.zoom;
|
|
676
|
-
camera.y -= (top - bottom) / 2 / camera.zoom;
|
|
677
|
-
return camera;
|
|
689
|
+
return this.fit(this.worldBounds, upright, this.inset);
|
|
678
690
|
}
|
|
679
691
|
/**
|
|
680
692
|
* Keep the camera usable: zoom within limits, and the center over the world so the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { apply, compose, rotate,
|
|
2
|
+
import { apply, compose, rotate, scale, translate } from "../math/affine.mjs";
|
|
3
3
|
import { transformRect, rectCenter } from "../math/rect.mjs";
|
|
4
4
|
function worldToScreen(camera, viewport) {
|
|
5
5
|
return compose(
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useCallback } from "react";
|
|
3
|
+
const REPORT_MS = 100;
|
|
4
|
+
function useContentStateOutput(read, onChange) {
|
|
5
|
+
const latest = useRef({ read, onChange });
|
|
6
|
+
latest.current = { read, onChange };
|
|
7
|
+
const timer = useRef(void 0);
|
|
8
|
+
const last = useRef("");
|
|
9
|
+
useEffect(
|
|
10
|
+
() => () => {
|
|
11
|
+
clearTimeout(timer.current);
|
|
12
|
+
timer.current = void 0;
|
|
13
|
+
},
|
|
14
|
+
[]
|
|
15
|
+
);
|
|
16
|
+
return useCallback(() => {
|
|
17
|
+
if (!latest.current.onChange || timer.current !== void 0) return;
|
|
18
|
+
timer.current = setTimeout(() => {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
timer.current = void 0;
|
|
21
|
+
const state = latest.current.read();
|
|
22
|
+
if (!state || state.encoded === last.current) return;
|
|
23
|
+
last.current = state.encoded;
|
|
24
|
+
(_b = (_a = latest.current).onChange) == null ? void 0 : _b.call(_a, state);
|
|
25
|
+
}, REPORT_MS);
|
|
26
|
+
}, []);
|
|
27
|
+
}
|
|
28
|
+
function watchMedia(element, changed) {
|
|
29
|
+
element == null ? void 0 : element.addEventListener("pause", changed);
|
|
30
|
+
element == null ? void 0 : element.addEventListener("seeked", changed);
|
|
31
|
+
return () => {
|
|
32
|
+
element == null ? void 0 : element.removeEventListener("pause", changed);
|
|
33
|
+
element == null ? void 0 : element.removeEventListener("seeked", changed);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function useRootContentState(clover, onChange) {
|
|
37
|
+
const changed = useContentStateOutput(
|
|
38
|
+
() => clover.getContentState(),
|
|
39
|
+
onChange
|
|
40
|
+
);
|
|
41
|
+
const enabled = Boolean(onChange);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!enabled) return;
|
|
44
|
+
let canvasId = clover.store.get().canvasId;
|
|
45
|
+
const offStore = clover.store.subscribe(() => {
|
|
46
|
+
const next = clover.store.get().canvasId;
|
|
47
|
+
if (next !== canvasId) {
|
|
48
|
+
canvasId = next;
|
|
49
|
+
changed();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const offViewport = clover.viewport.subscribe(changed);
|
|
53
|
+
let offElement = watchMedia(clover.media.get(), changed);
|
|
54
|
+
const offMedia = clover.media.subscribe((element) => {
|
|
55
|
+
offElement();
|
|
56
|
+
offElement = watchMedia(element, changed);
|
|
57
|
+
});
|
|
58
|
+
changed();
|
|
59
|
+
return () => {
|
|
60
|
+
offStore();
|
|
61
|
+
offViewport();
|
|
62
|
+
offMedia();
|
|
63
|
+
offElement();
|
|
64
|
+
};
|
|
65
|
+
}, [clover, enabled, changed]);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
useContentStateOutput,
|
|
69
|
+
useRootContentState,
|
|
70
|
+
watchMedia
|
|
71
|
+
};
|