@nulib/clover 0.0.0-stage → 4.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +120 -2
- package/dist/components/Annotations/Annotations.mjs +674 -0
- package/dist/components/Annotations/EntryBodies.mjs +52 -0
- package/dist/components/Annotations/languages.mjs +43 -0
- package/dist/components/Body/Body.mjs +51 -0
- package/dist/components/Body/BodyAlert.mjs +25 -0
- package/dist/components/Body/Caption.mjs +90 -0
- package/dist/components/Body/CaptionDetails.mjs +50 -0
- package/dist/components/Body/Pending.mjs +9 -0
- package/dist/components/Body/glyphs.mjs +66 -0
- package/dist/components/Body/renderers.mjs +30 -0
- package/dist/components/Body/useControlsVisibility.mjs +204 -0
- package/dist/components/Body/useNearViewport.mjs +27 -0
- package/dist/components/Canvas/AnnotationMenu.mjs +128 -0
- package/dist/components/Canvas/AnnotationState.mjs +338 -0
- package/dist/components/Canvas/Annotations.mjs +497 -0
- package/dist/components/Canvas/CanvasView.mjs +669 -0
- package/dist/components/Canvas/ChoiceMenu.mjs +77 -0
- package/dist/components/Canvas/Connected.mjs +228 -0
- package/dist/components/Canvas/ControlMenu.mjs +67 -0
- package/dist/components/Canvas/Controls.mjs +233 -0
- package/dist/components/Canvas/FrameAnimation.mjs +344 -0
- package/dist/components/Canvas/LoadedCanvas.mjs +177 -0
- package/dist/components/Canvas/Placeholder.mjs +105 -0
- package/dist/components/Canvas/fromManifest.mjs +44 -0
- package/dist/components/Canvas/index.mjs +19 -0
- package/dist/components/Canvas/layout.mjs +369 -0
- package/dist/components/Canvas/media/MediaBody.mjs +285 -0
- package/dist/components/Canvas/media/Player.mjs +193 -0
- package/dist/components/Canvas/media/Transport.mjs +511 -0
- package/dist/components/Canvas/media/TransportButton.mjs +39 -0
- package/dist/components/Canvas/media/useBarHeight.mjs +28 -0
- package/dist/components/Canvas/media/useCaptionTracks.mjs +131 -0
- package/dist/components/Canvas/media/useMediaController.mjs +77 -0
- package/dist/components/Canvas/media/useMediaElement.mjs +100 -0
- package/dist/components/Canvas/panClearOfControls.mjs +92 -0
- package/dist/components/Canvas/rendererSurface.mjs +6 -0
- package/dist/components/Canvas/surface.mjs +5 -0
- package/dist/components/Canvas/track.mjs +43 -0
- package/dist/components/Canvas/useSvgReader.mjs +23 -0
- package/dist/components/Collection/Collection.mjs +76 -0
- package/dist/components/CollectionSelect/CollectionSelect.mjs +114 -0
- package/dist/components/Contents/Contents.mjs +120 -0
- package/dist/components/Download/Download.mjs +105 -0
- package/dist/components/Items/Item.mjs +184 -0
- package/dist/components/Items/Items.mjs +455 -0
- package/dist/components/Items/Pager.mjs +190 -0
- package/dist/components/Items/StandaloneItems.mjs +80 -0
- package/dist/components/Items/clamped.mjs +90 -0
- package/dist/components/Label/Label.mjs +39 -0
- package/dist/components/Map/LoadedMap.mjs +26 -0
- package/dist/components/Map/Map.mjs +38 -0
- package/dist/components/Map/MapView.mjs +538 -0
- package/dist/components/Map/basemap.mjs +50 -0
- package/dist/components/Map/overlayImage.mjs +17 -0
- package/dist/components/Panel/About.mjs +143 -0
- package/dist/components/Panel/Panel.mjs +259 -0
- package/dist/components/Panel/PanelToggle.mjs +43 -0
- package/dist/components/Panel/PartOfManifest.mjs +52 -0
- package/dist/components/Primitives/Primitives.mjs +263 -0
- package/dist/components/Primitives/resource.mjs +11 -0
- package/dist/components/Provider/Provider.mjs +174 -0
- package/dist/components/Root/Announcer.mjs +58 -0
- package/dist/components/Root/Root.mjs +29 -0
- package/dist/components/Root/useRootState.mjs +188 -0
- package/dist/components/Scene/Connected.mjs +48 -0
- package/dist/components/Scene/Loaded.mjs +56 -0
- package/dist/components/Scene/RotatePad.mjs +204 -0
- package/dist/components/Scene/Scene.mjs +20 -0
- package/dist/components/Scene/SceneView.mjs +539 -0
- package/dist/components/Scene/cloverEngine.mjs +105 -0
- package/dist/components/Scene/engine.mjs +141 -0
- package/dist/components/Scene/engines.mjs +23 -0
- package/dist/components/Scene/gestures.mjs +74 -0
- package/dist/components/Scene/models.mjs +78 -0
- package/dist/components/Scene/orbit.mjs +60 -0
- package/dist/components/Search/Search.mjs +246 -0
- package/dist/components/Split/Split.mjs +203 -0
- package/dist/components/Split/splitting.mjs +203 -0
- package/dist/components/Status/Status.mjs +47 -0
- package/dist/components/Timeline/Connected.mjs +25 -0
- package/dist/components/Timeline/Timeline.mjs +40 -0
- package/dist/components/Timeline/playerSurface.mjs +84 -0
- package/dist/components/Transcript/Transcript.mjs +377 -0
- package/dist/components/Viewer/Viewer.mjs +19 -0
- package/dist/core/annotation-bodies.mjs +29 -0
- package/dist/core/annotation-collection.mjs +55 -0
- package/dist/core/annotation-name.mjs +31 -0
- package/dist/core/annotation-sets.mjs +155 -0
- package/dist/core/annotations-content.mjs +27 -0
- package/dist/core/annotations.mjs +73 -0
- package/dist/core/clover.mjs +393 -0
- package/dist/core/content-state-reader.mjs +82 -0
- package/dist/core/content-state.mjs +43 -0
- package/dist/core/direction.mjs +12 -0
- package/dist/core/geo-detect.mjs +30 -0
- package/dist/core/geo.mjs +283 -0
- package/dist/core/items.mjs +74 -0
- package/dist/core/keep-fragments.mjs +40 -0
- package/dist/core/link.mjs +28 -0
- package/dist/core/load.mjs +176 -0
- package/dist/core/map-config.mjs +12 -0
- package/dist/core/markdown.mjs +139 -0
- package/dist/core/pages.mjs +51 -0
- package/dist/core/painted-bodies.mjs +20 -0
- package/dist/core/painting.mjs +17 -0
- package/dist/core/presentation.mjs +27 -0
- package/dist/core/ranges.mjs +133 -0
- package/dist/core/region.mjs +32 -0
- package/dist/core/request.mjs +40 -0
- package/dist/core/sanitize.mjs +72 -0
- package/dist/core/search-service.mjs +22 -0
- package/dist/core/search.mjs +154 -0
- package/dist/core/selectors.mjs +94 -0
- package/dist/core/sequence.mjs +70 -0
- package/dist/core/show-link.mjs +16 -0
- package/dist/core/store.mjs +40 -0
- package/dist/core/svg-shape.mjs +183 -0
- package/dist/core/text.mjs +36 -0
- package/dist/core/thumbnail.mjs +55 -0
- package/dist/core/value.mjs +39 -0
- package/dist/core/vtt.mjs +111 -0
- package/dist/hooks/useFullscreen.mjs +21 -0
- package/dist/hooks/useFullscreenSupported.mjs +11 -0
- package/dist/hooks/useLoaded.mjs +27 -0
- package/dist/hooks/useWithinFullscreen.mjs +24 -0
- package/dist/i18n/config.mjs +170 -0
- package/dist/i18n/hostLanguage.mjs +6 -0
- package/dist/i18n/locales/en.json.mjs +5 -0
- package/dist/i18n/locales/es.json.mjs +5 -0
- package/dist/i18n/locales/fi.json.mjs +5 -0
- package/dist/i18n/locales/fr.json.mjs +5 -0
- package/dist/i18n/locales/index.mjs +13 -0
- package/dist/i18n/locales/nb.json.mjs +5 -0
- package/dist/i18n/locales/nn.json.mjs +5 -0
- package/dist/i18n/locales/no.json.mjs +5 -0
- package/dist/i18n/locales/pt.json.mjs +5 -0
- package/dist/i18n/reader.mjs +13 -0
- package/dist/i18n/useCloverTranslation.mjs +28 -0
- package/dist/index.d.mts +2204 -0
- package/dist/index.mjs +133 -0
- package/dist/lib/asArray.mjs +5 -0
- package/dist/lib/classnames.mjs +5 -0
- package/dist/lib/fullscreen.mjs +65 -0
- package/dist/lib/gltf/bounds.mjs +44 -0
- package/dist/lib/gltf/load.mjs +156 -0
- package/dist/lib/gltf/mat4.mjs +150 -0
- package/dist/lib/gltf/renderer.mjs +342 -0
- package/dist/lib/gltf/shaders.mjs +192 -0
- package/dist/lib/hls.mjs +6 -0
- package/dist/lib/pointer.mjs +38 -0
- package/dist/lib/renderer/CanvasRenderer.mjs +857 -0
- package/dist/lib/renderer/backends/backend.mjs +21 -0
- package/dist/lib/renderer/backends/canvas2d/Canvas2DBackend.mjs +91 -0
- package/dist/lib/renderer/backends/contexts.mjs +27 -0
- package/dist/lib/renderer/backends/dom/DomLayers.mjs +91 -0
- package/dist/lib/renderer/backends/webgl2/WebGL2Backend.mjs +248 -0
- package/dist/lib/renderer/backends/webgl2/shaders.mjs +28 -0
- package/dist/lib/renderer/camera/Camera.mjs +64 -0
- package/dist/lib/renderer/camera/CameraAnimator.mjs +90 -0
- package/dist/lib/renderer/input/GestureController.mjs +252 -0
- package/dist/lib/renderer/io/TileCache.mjs +207 -0
- package/dist/lib/renderer/io/decode.mjs +156 -0
- package/dist/lib/renderer/loop/FrameLoop.mjs +50 -0
- package/dist/lib/renderer/math/affine.mjs +68 -0
- package/dist/lib/renderer/math/rect.mjs +45 -0
- package/dist/lib/renderer/overlays/Navigator.mjs +141 -0
- package/dist/lib/renderer/overlays/OverlayLayer.mjs +94 -0
- package/dist/lib/renderer/scene/planFrame.mjs +168 -0
- package/dist/lib/renderer/scene/regions.mjs +30 -0
- package/dist/lib/renderer/scene/sceneItem.mjs +114 -0
- package/dist/lib/renderer/scene/uploadBudget.mjs +30 -0
- package/dist/lib/renderer/sources/imageService.mjs +160 -0
- package/dist/lib/renderer/sources/sizedImage.mjs +38 -0
- package/dist/lib/renderer/sources/tilePyramid.mjs +172 -0
- package/dist/lib/time.mjs +21 -0
- package/dist/map/index.d.mts +184 -0
- package/dist/map/index.mjs +16 -0
- package/dist/react/context.mjs +46 -0
- package/dist/react/hooks.mjs +69 -0
- package/dist/react/language.mjs +30 -0
- package/dist/styles.css +1 -0
- package/dist/templates/default/Default.mjs +229 -0
- package/dist/templates/document/Document.mjs +286 -0
- package/dist/templates/document/DocumentPanel.mjs +9 -0
- package/dist/templates/document/Sheets.mjs +360 -0
- package/dist/templates/gallery/Gallery.mjs +62 -0
- package/dist/templates/index.d.mts +273 -0
- package/dist/templates/index.mjs +11 -0
- package/dist/templates/shared/Lightbox.mjs +111 -0
- package/dist/templates/shared/LightboxBody.mjs +9 -0
- package/dist/templates/shared/dragToClose.mjs +129 -0
- package/dist/templates/shared/useDragToClose.mjs +35 -0
- package/dist/templates/shared/useDrawer.mjs +113 -0
- package/dist/templates/shared/useFollowFocus.mjs +24 -0
- package/dist/templates/shared/useSlide.mjs +52 -0
- package/dist/templates/shared/useSpine.mjs +26 -0
- package/dist/templates.css +1 -0
- package/dist/three/index.d.mts +6 -0
- package/dist/three/index.mjs +8 -0
- package/dist/ui/Button.mjs +53 -0
- package/dist/ui/ControlCluster.mjs +87 -0
- package/dist/ui/Cue.mjs +13 -0
- package/dist/ui/ErrorBoundary.mjs +26 -0
- package/dist/ui/ExitFullscreen.mjs +46 -0
- package/dist/ui/FieldPill.mjs +153 -0
- package/dist/ui/HideToggle.mjs +57 -0
- package/dist/ui/Loading.mjs +20 -0
- package/dist/ui/Markup.mjs +95 -0
- package/dist/ui/ReadMore.mjs +84 -0
- package/dist/ui/Sections.mjs +448 -0
- package/dist/ui/Steps.mjs +84 -0
- package/dist/ui/Tip.mjs +196 -0
- package/dist/ui/bringIntoView.mjs +27 -0
- package/dist/ui/controlGlyphs.mjs +120 -0
- package/dist/ui/heading.mjs +19 -0
- package/dist/ui/languageCode.mjs +8 -0
- package/dist/ui/mediaIcons.mjs +104 -0
- package/dist/ui/useClusterReach.mjs +50 -0
- package/dist/ui/useContainerName.mjs +19 -0
- package/dist/ui/useOneOpen.mjs +22 -0
- package/dist/ui/useRovingFocus.mjs +64 -0
- package/dist/ui/useScrollTrack.mjs +150 -0
- package/dist/ui/useUniqueId.mjs +10 -0
- package/dist/ui/visuallyHidden.mjs +15 -0
- package/dist/web-components/About-uKa1wfDr.mjs +1 -0
- package/dist/web-components/AnnotationMenu-BGIYRXW6.mjs +1 -0
- package/dist/web-components/AnnotationState-D2UIgIEC.mjs +1 -0
- package/dist/web-components/Annotations-BhwAv3ah.mjs +1 -0
- package/dist/web-components/Annotations-C_tBJHo3.mjs +2 -0
- package/dist/web-components/Body-DMEERFuB.mjs +1 -0
- package/dist/web-components/BodyAlert-BP8voSLv.mjs +1 -0
- package/dist/web-components/Button-Cl02BFDd.mjs +1 -0
- package/dist/web-components/Camera-Dw51CAfF.mjs +1 -0
- package/dist/web-components/Canvas2DBackend-RRN2bEkc.mjs +1 -0
- package/dist/web-components/CanvasView-B8lMMSou.mjs +1 -0
- package/dist/web-components/CaptionDetails-KLMDv-ec.mjs +1 -0
- package/dist/web-components/ChoiceMenu-CXrVOmJl.mjs +1 -0
- package/dist/web-components/Collection-DL4Ui4hF.mjs +1 -0
- package/dist/web-components/CollectionSelect-DL-bbpwJ.mjs +1 -0
- package/dist/web-components/Connected-B0S1HXQb.mjs +1 -0
- package/dist/web-components/Connected-BcjRA5si.mjs +1 -0
- package/dist/web-components/Connected-Q7iizBb8.mjs +1 -0
- package/dist/web-components/Contents-ZC8TiGaW.mjs +1 -0
- package/dist/web-components/ControlMenu-DIoU797-.mjs +1 -0
- package/dist/web-components/Cue-CJxnDMEy.mjs +1 -0
- package/dist/web-components/Document-DHBRAFEK.mjs +1 -0
- package/dist/web-components/DocumentPanel-CqvE2pu9.mjs +1 -0
- package/dist/web-components/DomLayers-BsR2AOy-.mjs +1 -0
- package/dist/web-components/Download-DBksL1C0.mjs +1 -0
- package/dist/web-components/EntryBodies-VwEkTVrw.mjs +1 -0
- package/dist/web-components/ErrorBoundary-Cy9PGoZv.mjs +1 -0
- package/dist/web-components/FieldPill-DCJBz6Vj.mjs +1 -0
- package/dist/web-components/FrameAnimation-DRbmgGpF.mjs +1 -0
- package/dist/web-components/Gallery-BM7-VJkB.mjs +1 -0
- package/dist/web-components/HideToggle-BdYgG7us.mjs +1 -0
- package/dist/web-components/Items-_1Jz3FMs.mjs +1 -0
- package/dist/web-components/Label-CAiJ49eA.mjs +1 -0
- package/dist/web-components/LightboxBody-DyhUZiDf.mjs +1 -0
- package/dist/web-components/Loaded-wQurAeJz.mjs +1 -0
- package/dist/web-components/LoadedCanvas-DWz5IK5m.mjs +1 -0
- package/dist/web-components/LoadedMap-DIeW313M.mjs +1 -0
- package/dist/web-components/Loading-BmA--pzr.mjs +1 -0
- package/dist/web-components/Map-DzVGblIS.mjs +1 -0
- package/dist/web-components/MapView-BJaN7VBI.mjs +1 -0
- package/dist/web-components/Markup-D91DbxLk.mjs +2 -0
- package/dist/web-components/MediaBody-BYcVPo2X.mjs +1 -0
- package/dist/web-components/MediaBody-FEzH8VVw.mjs +1 -0
- package/dist/web-components/Navigator-CIJFA3q1.mjs +1 -0
- package/dist/web-components/Pager-BGwCurxE.mjs +1 -0
- package/dist/web-components/Panel-B-GXOkzF.mjs +1 -0
- package/dist/web-components/PanelToggle-BYjV2t1j.mjs +1 -0
- package/dist/web-components/PartOfManifest-ClbGepVM.mjs +1 -0
- package/dist/web-components/Pending-BspZajh5.mjs +1 -0
- package/dist/web-components/Primitives-CTh59wvs.mjs +1 -0
- package/dist/web-components/Provider-C6rIiDXH.mjs +1 -0
- package/dist/web-components/ReadMore-BJ2i-0uN.mjs +1 -0
- package/dist/web-components/Root-DkkYDtur.mjs +1 -0
- package/dist/web-components/Scene-B_PU_TiX.mjs +1 -0
- package/dist/web-components/SceneView-qcW_sT3j.mjs +1 -0
- package/dist/web-components/Search-UOneIUcP.mjs +1 -0
- package/dist/web-components/Sections-we9U9fXq.mjs +2 -0
- package/dist/web-components/StandaloneItems-DU8oCFc_.mjs +1 -0
- package/dist/web-components/Status-Cs5ZvFvL.mjs +1 -0
- package/dist/web-components/Timeline-WtYZ1bIJ.mjs +1 -0
- package/dist/web-components/Tip-C8J3qsIK.mjs +1 -0
- package/dist/web-components/Transcript-CRL2zToL.mjs +1 -0
- package/dist/web-components/annotation-collection-ZPyvpLFc.mjs +1 -0
- package/dist/web-components/annotations-content-BZChKhJZ.mjs +1 -0
- package/dist/web-components/assets/maplibre-gl-worker-kTz9OPxr.js +13831 -0
- package/dist/web-components/body-UntgrmoV.mjs +1 -0
- package/dist/web-components/bringIntoView-CQH5ZgMM.mjs +1 -0
- package/dist/web-components/canvas-d_U4v_mh.mjs +1 -0
- package/dist/web-components/classnames-DukgfdpI.mjs +1 -0
- package/dist/web-components/cloverEngine-Dbv-26NP.mjs +164 -0
- package/dist/web-components/content-state-reader-DjdKWjit.mjs +1 -0
- package/dist/web-components/contexts-ByL3eA_T.mjs +1 -0
- package/dist/web-components/controls-qRYf2jO2.mjs +1 -0
- package/dist/web-components/custom-elements.json +2739 -0
- package/dist/web-components/dragToClose-C-Pf1IeO.mjs +1 -0
- package/dist/web-components/engine-D8JLgzqq.mjs +4228 -0
- package/dist/web-components/engines-BwVb9R_A.mjs +1 -0
- package/dist/web-components/es-BwMkoRod.mjs +1 -0
- package/dist/web-components/fi-gPFOn9RK.mjs +1 -0
- package/dist/web-components/fr-DUHmgdJo.mjs +1 -0
- package/dist/web-components/fromManifest-UrMJgktp.mjs +1 -0
- package/dist/web-components/glyphs-BoX0a88P.mjs +1 -0
- package/dist/web-components/heading-Cjt0f-Eu.mjs +1 -0
- package/dist/web-components/hls-CdKrthkC.mjs +40 -0
- package/dist/web-components/hooks-Dp8pjU8l.mjs +1 -0
- package/dist/web-components/imageService-C3yg9DxB.mjs +1 -0
- package/dist/web-components/index-DWxMuwDL.mjs +1 -0
- package/dist/web-components/index.d.mts +604 -0
- package/dist/web-components/index.mjs +1 -0
- package/dist/web-components/index.umd.js +18 -0
- package/dist/web-components/items--Tu7ZM3L.mjs +1 -0
- package/dist/web-components/items-W2vrwArM.mjs +1 -0
- package/dist/web-components/keep-fragments-B5nlv2ck.mjs +1 -0
- package/dist/web-components/label-CYQ7tVl6.mjs +1 -0
- package/dist/web-components/languageCode-cCpiU0b0.mjs +1 -0
- package/dist/web-components/layout-KL0V-iJu.mjs +1 -0
- package/dist/web-components/link-DRRTY4lY.mjs +1 -0
- package/dist/web-components/logo-CnQUCB3Y.mjs +1 -0
- package/dist/web-components/maplibre-gl-CQ4OueXY.mjs +823 -0
- package/dist/web-components/markdown-CCYJwzFn.mjs +5 -0
- package/dist/web-components/models-BP2qp9nT.mjs +1 -0
- package/dist/web-components/nb-BSvnQ6jd.mjs +1 -0
- package/dist/web-components/nn-Dg2_HdZu.mjs +1 -0
- package/dist/web-components/no-BSvnQ6jd.mjs +1 -0
- package/dist/web-components/nodes-Bf-Fb7e5.mjs +1 -0
- package/dist/web-components/overlayImage-DdPs2EGY.mjs +1 -0
- package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +1 -0
- package/dist/web-components/panel-CiqEFDzv.mjs +1 -0
- package/dist/web-components/part-CUBY90_b.mjs +1 -0
- package/dist/web-components/playerSurface-i2TJz-F4.mjs +1 -0
- package/dist/web-components/provider-LUmAQSoP.mjs +1 -0
- package/dist/web-components/pt-B3J80JgO.mjs +1 -0
- package/dist/web-components/read-more-BaaO77el.mjs +1 -0
- package/dist/web-components/rendererSurface-DAvatpMF.mjs +22 -0
- package/dist/web-components/renderers-Bg4QqawN.mjs +1 -0
- package/dist/web-components/resource-DzIvB_4m.mjs +1 -0
- package/dist/web-components/sanitize-Dc7nOsgO.mjs +3 -0
- package/dist/web-components/search-DgcgsI3I.mjs +1 -0
- package/dist/web-components/shared-J3w3gnXD.mjs +1 -0
- package/dist/web-components/show-link-DWRRXSBy.mjs +1 -0
- package/dist/web-components/sizedImage-DfjlV2-i.mjs +1 -0
- package/dist/web-components/split-m-_XivaW.mjs +1 -0
- package/dist/web-components/splitting-BnQUxxgH.mjs +1 -0
- package/dist/web-components/status-DDS7jLNd.mjs +1 -0
- package/dist/web-components/styles-Ypl9KrSK.mjs +1 -0
- package/dist/web-components/svg-shape-DLY3g7oq.mjs +1 -0
- package/dist/web-components/text-BTAkxEfQ.mjs +5 -0
- package/dist/web-components/three.mjs +1 -0
- package/dist/web-components/thumbnail-BZvLSwWW.mjs +1 -0
- package/dist/web-components/time-B9GZoYcm.mjs +1 -0
- package/dist/web-components/tip-BXByhOJ9.mjs +1 -0
- package/dist/web-components/toggle-AS72kq6v.mjs +1 -0
- package/dist/web-components/upgrader-XNxI-5jo.mjs +1 -0
- package/dist/web-components/useContainerName-DCbE5JXi.mjs +1 -0
- package/dist/web-components/useNearViewport-CyoK3l8W.mjs +1 -0
- package/dist/web-components/useScrollTrack-dLFWnT8N.mjs +1 -0
- package/dist/web-components/viewer/AnnotationMenu-Dd4tnzNV.mjs +1 -0
- package/dist/web-components/viewer/AnnotationState-DZaSy5lH.mjs +1 -0
- package/dist/web-components/viewer/Annotations-D1h-Yi5J.mjs +1 -0
- package/dist/web-components/viewer/Annotations-sj79EMen.mjs +2 -0
- package/dist/web-components/viewer/Canvas2DBackend-CkvI0wUT.mjs +1 -0
- package/dist/web-components/viewer/CaptionDetails-B_JdNjJ7.mjs +1 -0
- package/dist/web-components/viewer/ChoiceMenu-xa51a1DV.mjs +1 -0
- package/dist/web-components/viewer/Collection-CxuLCspj.mjs +1 -0
- package/dist/web-components/viewer/Connected-BSUBc3Ci.mjs +1 -0
- package/dist/web-components/viewer/Connected-CPIxNjF2.mjs +1 -0
- package/dist/web-components/viewer/Contents-DNh9mnsF.mjs +1 -0
- package/dist/web-components/viewer/ControlMenu-DdgIvBdf.mjs +1 -0
- package/dist/web-components/viewer/Cue-90H9_dXz.mjs +1 -0
- package/dist/web-components/viewer/Document-CNCpzkiN.mjs +1 -0
- package/dist/web-components/viewer/DocumentPanel-BdG4TVLE.mjs +1 -0
- package/dist/web-components/viewer/DomLayers-Dybz_aJv.mjs +1 -0
- package/dist/web-components/viewer/EntryBodies-DGXjFP3N.mjs +1 -0
- package/dist/web-components/viewer/FieldPill-Icmd98OY.mjs +1 -0
- package/dist/web-components/viewer/FrameAnimation-DJZN3Rd4.mjs +1 -0
- package/dist/web-components/viewer/Gallery-CEp3-bh2.mjs +1 -0
- package/dist/web-components/viewer/HideToggle-DB6HTmAO.mjs +1 -0
- package/dist/web-components/viewer/LightboxBody-ClQ4yrTh.mjs +1 -0
- package/dist/web-components/viewer/MapView-BVSdybIC.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-BBbSMT1i.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-BzMXMHIF.mjs +1 -0
- package/dist/web-components/viewer/Navigator-Duc69Yes.mjs +1 -0
- package/dist/web-components/viewer/PartOfManifest-X9_q-2t6.mjs +1 -0
- package/dist/web-components/viewer/Search-S4N5QU4R.mjs +1 -0
- package/dist/web-components/viewer/StandaloneItems-BO4VyWRW.mjs +1 -0
- package/dist/web-components/viewer/Transcript-BbDaS064.mjs +1 -0
- package/dist/web-components/viewer/annotation-collection-BjZ1DAHq.mjs +1 -0
- package/dist/web-components/viewer/annotations-content-jn3n5Y2-.mjs +1 -0
- package/dist/web-components/viewer/cloverEngine-CjuYjUhI.mjs +164 -0
- package/dist/web-components/viewer/content-state-reader-CPiShIjP.mjs +1 -0
- package/dist/web-components/viewer/host-yWi4R1bP.mjs +1 -0
- package/dist/web-components/viewer/index.d.mts +7 -0
- package/dist/web-components/viewer/index.mjs +1 -0
- package/dist/web-components/viewer/index.umd.js +18 -0
- package/dist/web-components/viewer/link-CwE-fg5G.mjs +1 -0
- package/dist/web-components/viewer/overlayImage-BpOgqsZ0.mjs +1 -0
- package/dist/web-components/viewer/renderers-L-IlGI1r.mjs +1 -0
- package/dist/web-components/viewer/search-DWkwRPo_.mjs +1 -0
- package/dist/web-components/viewer/styles-BRCkEU3w.mjs +1 -0
- package/dist/web-components/viewer/viewer--TreVlJ_.mjs +28 -0
- package/dist/web-components/viewer/vtt-1ZJwtElI.mjs +5 -0
- package/dist/web-components/viewer-DyV864Qe.mjs +1 -0
- package/dist/web-components/vtt-GFssZH8Y.mjs +5 -0
- package/package.json +110 -4
package/dist/ui/Tip.mjs
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useRef, useEffect } from "react";
|
|
4
|
+
import { useCloverTranslation } from "../i18n/useCloverTranslation.mjs";
|
|
5
|
+
const SHORTCUTS = {
|
|
6
|
+
zoomIn: { keys: "Plus", glyph: "+" },
|
|
7
|
+
zoomOut: { keys: "-", glyph: "−" },
|
|
8
|
+
reset: { keys: "0", glyph: "0" },
|
|
9
|
+
rotateRight: { keys: "R", glyph: "R" },
|
|
10
|
+
rotateLeft: { keys: "Shift+R", glyph: "⇧R" },
|
|
11
|
+
play: { keys: "K Space", glyph: "K" },
|
|
12
|
+
mute: { keys: "M", glyph: "M" }
|
|
13
|
+
};
|
|
14
|
+
const SHORTCUT_KEYS = /* @__PURE__ */ new Set([
|
|
15
|
+
"+",
|
|
16
|
+
"=",
|
|
17
|
+
"-",
|
|
18
|
+
"_",
|
|
19
|
+
"0",
|
|
20
|
+
"r",
|
|
21
|
+
"R",
|
|
22
|
+
"k",
|
|
23
|
+
"K",
|
|
24
|
+
"m",
|
|
25
|
+
"M",
|
|
26
|
+
"j",
|
|
27
|
+
"J",
|
|
28
|
+
"l",
|
|
29
|
+
"L"
|
|
30
|
+
]);
|
|
31
|
+
function Tip({
|
|
32
|
+
label,
|
|
33
|
+
lang,
|
|
34
|
+
shortcut,
|
|
35
|
+
scrolls = false,
|
|
36
|
+
image
|
|
37
|
+
}) {
|
|
38
|
+
const { t } = useCloverTranslation();
|
|
39
|
+
const ref = useRef(null);
|
|
40
|
+
const text = shortcut ? t("controlShortcut", { label, shortcut: shortcut.glyph }) : label;
|
|
41
|
+
useTips();
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const tip = ref.current;
|
|
44
|
+
if (tip && isShown(tip)) keepInside(tip);
|
|
45
|
+
}, [text]);
|
|
46
|
+
return /* @__PURE__ */ jsxs(
|
|
47
|
+
"span",
|
|
48
|
+
{
|
|
49
|
+
ref,
|
|
50
|
+
className: "clover-tip",
|
|
51
|
+
"aria-hidden": "true",
|
|
52
|
+
lang,
|
|
53
|
+
...scrolls && {
|
|
54
|
+
tabIndex: -1,
|
|
55
|
+
onMouseDown: (event) => {
|
|
56
|
+
var _a;
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
(_a = event.currentTarget.parentElement) == null ? void 0 : _a.focus({ preventScroll: true });
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
children: [
|
|
62
|
+
image && /* @__PURE__ */ jsx(
|
|
63
|
+
"img",
|
|
64
|
+
{
|
|
65
|
+
className: "clover-tip-image",
|
|
66
|
+
src: image,
|
|
67
|
+
alt: "",
|
|
68
|
+
loading: "lazy",
|
|
69
|
+
onLoad: () => {
|
|
70
|
+
const tip = ref.current;
|
|
71
|
+
if (tip && isShown(tip)) keepInside(tip);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
text
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function placeTip(event) {
|
|
81
|
+
const control = event.target instanceof Element && controlOf(event.target);
|
|
82
|
+
const tip = control && tipOf(control);
|
|
83
|
+
if (tip) keepInside(tip);
|
|
84
|
+
}
|
|
85
|
+
function tipOf(control) {
|
|
86
|
+
return Array.from(control.children).find(
|
|
87
|
+
(child) => child.classList.contains("clover-tip")
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
function controlOf(element) {
|
|
91
|
+
const holder = element.matches("input") ? element.parentElement : null;
|
|
92
|
+
return holder && tipOf(holder) ? holder : element;
|
|
93
|
+
}
|
|
94
|
+
function isShown(tip) {
|
|
95
|
+
var _a;
|
|
96
|
+
try {
|
|
97
|
+
return Boolean(
|
|
98
|
+
(_a = tip.parentElement) == null ? void 0 : _a.matches(
|
|
99
|
+
":hover, :focus-visible, :has(> input:focus-visible)"
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
} catch {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function keepInside(tip) {
|
|
107
|
+
const control = tip.parentElement;
|
|
108
|
+
if (!control) return;
|
|
109
|
+
tip.style.removeProperty("--clover-tip-room");
|
|
110
|
+
tip.style.removeProperty("--clover-tip-shift");
|
|
111
|
+
const bounds = clipOf(control);
|
|
112
|
+
const clear = parseFloat(getComputedStyle(tip).paddingLeft) || 0;
|
|
113
|
+
const start = bounds.left + clear;
|
|
114
|
+
const end = bounds.right - clear;
|
|
115
|
+
const own = control.getBoundingClientRect();
|
|
116
|
+
let box = tip.getBoundingClientRect();
|
|
117
|
+
const room = box.right <= own.left ? box.right - start : box.left >= own.right ? end - box.left : end - start;
|
|
118
|
+
if (box.width > room) {
|
|
119
|
+
tip.style.setProperty("--clover-tip-room", `${Math.max(room, 0)}px`);
|
|
120
|
+
box = tip.getBoundingClientRect();
|
|
121
|
+
}
|
|
122
|
+
const shift = box.left < start ? start - box.left : box.right > end ? end - box.right : 0;
|
|
123
|
+
if (shift) tip.style.setProperty("--clover-tip-shift", `${shift}px`);
|
|
124
|
+
}
|
|
125
|
+
function clipOf(element) {
|
|
126
|
+
let left = 0;
|
|
127
|
+
let right = document.documentElement.clientWidth || window.innerWidth;
|
|
128
|
+
for (let node = element.parentElement; node && node !== document.documentElement; node = node.parentElement) {
|
|
129
|
+
const { display, overflow, overflowX } = getComputedStyle(node);
|
|
130
|
+
if (display === "inline" || display === "contents") continue;
|
|
131
|
+
const across = overflowX || overflow;
|
|
132
|
+
if (!across || across === "visible") continue;
|
|
133
|
+
const rect = node.getBoundingClientRect();
|
|
134
|
+
left = Math.max(left, rect.left + node.clientLeft);
|
|
135
|
+
right = Math.min(right, rect.left + node.clientLeft + node.clientWidth);
|
|
136
|
+
}
|
|
137
|
+
return { left, right };
|
|
138
|
+
}
|
|
139
|
+
let listening = 0;
|
|
140
|
+
function hideTips(event) {
|
|
141
|
+
if (event.key !== "Escape") return;
|
|
142
|
+
const shown = /* @__PURE__ */ new Set();
|
|
143
|
+
document.querySelectorAll(":hover > .clover-tip").forEach((tip) => tip.parentElement && shown.add(tip.parentElement));
|
|
144
|
+
const focused = document.activeElement;
|
|
145
|
+
const control = focused && controlOf(focused);
|
|
146
|
+
if (control && tipOf(control)) shown.add(control);
|
|
147
|
+
shown.forEach(
|
|
148
|
+
(control2) => hideUntilBack(control2, "tipHidden", ["pointerenter", "focusout"])
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function hideUntilBack(element, key, back) {
|
|
152
|
+
element.dataset[key] = "";
|
|
153
|
+
const show = () => {
|
|
154
|
+
delete element.dataset[key];
|
|
155
|
+
back.forEach((type) => element.removeEventListener(type, show));
|
|
156
|
+
};
|
|
157
|
+
back.forEach((type) => element.addEventListener(type, show));
|
|
158
|
+
}
|
|
159
|
+
function useTips() {
|
|
160
|
+
useEffect(() => {
|
|
161
|
+
if (listening++ === 0) {
|
|
162
|
+
document.addEventListener("keydown", hideTips, true);
|
|
163
|
+
document.addEventListener("pointerenter", placeTip, true);
|
|
164
|
+
document.addEventListener("focus", placeTip, true);
|
|
165
|
+
}
|
|
166
|
+
return () => {
|
|
167
|
+
if (--listening) return;
|
|
168
|
+
document.removeEventListener("keydown", hideTips, true);
|
|
169
|
+
document.removeEventListener("pointerenter", placeTip, true);
|
|
170
|
+
document.removeEventListener("focus", placeTip, true);
|
|
171
|
+
};
|
|
172
|
+
}, []);
|
|
173
|
+
}
|
|
174
|
+
function forwardShortcut(event, viewport) {
|
|
175
|
+
const target = event.target;
|
|
176
|
+
if (!viewport || target === viewport || viewport.contains(target)) return;
|
|
177
|
+
if (!SHORTCUT_KEYS.has(event.key)) return;
|
|
178
|
+
if (event.altKey || event.metaKey || event.ctrlKey) return;
|
|
179
|
+
if (target.closest("input, select, textarea, [contenteditable]")) return;
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
viewport.dispatchEvent(
|
|
182
|
+
new KeyboardEvent("keydown", {
|
|
183
|
+
key: event.key,
|
|
184
|
+
shiftKey: event.shiftKey,
|
|
185
|
+
bubbles: true,
|
|
186
|
+
cancelable: true
|
|
187
|
+
})
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
export {
|
|
191
|
+
SHORTCUTS,
|
|
192
|
+
SHORTCUT_KEYS,
|
|
193
|
+
Tip,
|
|
194
|
+
forwardShortcut,
|
|
195
|
+
hideUntilBack
|
|
196
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function scrollerOf(node) {
|
|
3
|
+
for (let at = node.parentElement; at && at !== document.body; at = at.parentElement) {
|
|
4
|
+
if (/auto|scroll/.test(getComputedStyle(at).overflowY)) return at;
|
|
5
|
+
}
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
function bringIntoView(target, where) {
|
|
9
|
+
var _a;
|
|
10
|
+
const scroller = scrollerOf(target);
|
|
11
|
+
if (!scroller) return;
|
|
12
|
+
const style = getComputedStyle(target);
|
|
13
|
+
const above = parseFloat(style.scrollMarginTop) || 0;
|
|
14
|
+
const below = parseFloat(style.scrollMarginBottom) || 0;
|
|
15
|
+
const box = target.getBoundingClientRect();
|
|
16
|
+
const port = scroller.getBoundingClientRect();
|
|
17
|
+
const top = box.top - port.top - above;
|
|
18
|
+
const bottom = box.bottom - port.bottom + below;
|
|
19
|
+
const by = where === "start" || top < 0 ? top : bottom > 0 ? Math.min(bottom, top) : 0;
|
|
20
|
+
if (Math.abs(by) < 1) return;
|
|
21
|
+
const still = (_a = window.matchMedia) == null ? void 0 : _a.call(window, "(prefers-reduced-motion: reduce)").matches;
|
|
22
|
+
scroller.scrollBy({ top: by, behavior: still ? "auto" : "smooth" });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
bringIntoView,
|
|
26
|
+
scrollerOf
|
|
27
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
|
+
const ZoomIn = () => {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
strokeLinecap: "round",
|
|
8
|
+
strokeMiterlimit: "10",
|
|
9
|
+
strokeWidth: "45",
|
|
10
|
+
d: "M256 112v288M400 256H112"
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
const ZoomOut = () => {
|
|
15
|
+
return /* @__PURE__ */ jsx(
|
|
16
|
+
"path",
|
|
17
|
+
{
|
|
18
|
+
strokeLinecap: "round",
|
|
19
|
+
strokeMiterlimit: "10",
|
|
20
|
+
strokeWidth: "45",
|
|
21
|
+
d: "M400 256H112"
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
const ZoomFullScreen = () => {
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
fill: "none",
|
|
30
|
+
stroke: "currentColor",
|
|
31
|
+
strokeLinecap: "round",
|
|
32
|
+
strokeLinejoin: "round",
|
|
33
|
+
strokeWidth: "32",
|
|
34
|
+
d: "M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
const ZoomExitFullScreen = () => {
|
|
39
|
+
return /* @__PURE__ */ jsx(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
fill: "none",
|
|
43
|
+
stroke: "currentColor",
|
|
44
|
+
strokeLinecap: "round",
|
|
45
|
+
strokeLinejoin: "round",
|
|
46
|
+
strokeWidth: "32",
|
|
47
|
+
d: "M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
const Reset = () => {
|
|
52
|
+
return /* @__PURE__ */ jsx("path", { d: "M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z" });
|
|
53
|
+
};
|
|
54
|
+
const Rotate = () => {
|
|
55
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
fill: "none",
|
|
60
|
+
strokeLinecap: "round",
|
|
61
|
+
strokeMiterlimit: "10",
|
|
62
|
+
strokeWidth: "45",
|
|
63
|
+
d: "M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx("path", { d: "M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z" })
|
|
67
|
+
] });
|
|
68
|
+
};
|
|
69
|
+
const Choice = () => {
|
|
70
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
71
|
+
/* @__PURE__ */ jsx(
|
|
72
|
+
"path",
|
|
73
|
+
{
|
|
74
|
+
fill: "none",
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
strokeWidth: "64",
|
|
77
|
+
d: "M112 144h0M112 256h0M112 368h0"
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
"path",
|
|
82
|
+
{
|
|
83
|
+
fill: "none",
|
|
84
|
+
strokeLinecap: "round",
|
|
85
|
+
strokeWidth: "40",
|
|
86
|
+
d: "M208 144h208M208 256h208M208 368h208"
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
] });
|
|
90
|
+
};
|
|
91
|
+
const ControlIcon = ({
|
|
92
|
+
children,
|
|
93
|
+
label
|
|
94
|
+
}) => /* @__PURE__ */ jsx(
|
|
95
|
+
"svg",
|
|
96
|
+
{
|
|
97
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
98
|
+
width: "16",
|
|
99
|
+
height: "16",
|
|
100
|
+
viewBox: "0 0 512 512",
|
|
101
|
+
fill: "currentColor",
|
|
102
|
+
stroke: "currentColor",
|
|
103
|
+
focusable: "false",
|
|
104
|
+
"aria-hidden": "true",
|
|
105
|
+
role: "presentation",
|
|
106
|
+
"data-testid": "clover-canvas-button-svg",
|
|
107
|
+
"data-label": label,
|
|
108
|
+
children
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
export {
|
|
112
|
+
Choice,
|
|
113
|
+
ControlIcon,
|
|
114
|
+
Reset,
|
|
115
|
+
Rotate,
|
|
116
|
+
ZoomExitFullScreen,
|
|
117
|
+
ZoomFullScreen,
|
|
118
|
+
ZoomIn,
|
|
119
|
+
ZoomOut
|
|
120
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function headingTag(level) {
|
|
3
|
+
const whole = Math.max(1, Math.round(level));
|
|
4
|
+
return whole <= 6 ? `h${whole}` : null;
|
|
5
|
+
}
|
|
6
|
+
const titleTag = (level, fallback = "p") => headingTag(level) ?? fallback;
|
|
7
|
+
function titled(level, id, fallback = "p") {
|
|
8
|
+
const tag = headingTag(level);
|
|
9
|
+
return tag ? { as: tag, title: {}, group: {} } : {
|
|
10
|
+
as: fallback,
|
|
11
|
+
title: { id },
|
|
12
|
+
group: { role: "group", "aria-labelledby": id }
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
headingTag,
|
|
17
|
+
titleTag,
|
|
18
|
+
titled
|
|
19
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ZoomExitFullScreen, ZoomFullScreen } from "./controlGlyphs.mjs";
|
|
4
|
+
const svgProps = {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
// Their own size, so they never fill a button without the stylesheet.
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
viewBox: "0 0 512 512",
|
|
10
|
+
"aria-hidden": true,
|
|
11
|
+
focusable: false
|
|
12
|
+
};
|
|
13
|
+
const PlayIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx("path", { d: "M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61.11L151.23 435a35.5 35.5 0 01-18.23 5z" }) });
|
|
14
|
+
const PauseIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx("path", { d: "M224 432h-80V80h80zm144 0h-80V80h80z" }) });
|
|
15
|
+
const VolumeHighIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
|
|
16
|
+
/* @__PURE__ */ jsx("path", { d: "M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z" }),
|
|
17
|
+
/* @__PURE__ */ jsx(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
d: "M320 336a16 16 0 01-14.29-23.16c8.34-16.63 12.29-34.5 12.29-56.84s-3.95-40.21-12.29-56.84a16 16 0 0128.58-14.32C345.06 205.86 350 228.13 350 256s-4.94 50.14-15.71 71.16A16 16 0 01320 336zM368 384a16 16 0 01-13.87-24C373.85 325.75 384 292.28 384 256c0-36.28-10.15-69.75-29.87-104a16 16 0 0127.74-16C404.19 174.71 416 214.17 416 256s-11.81 81.29-34.13 120A16 16 0 01368 384z",
|
|
21
|
+
fillOpacity: "0.85"
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
] });
|
|
25
|
+
const VolumeMutedIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
|
|
26
|
+
/* @__PURE__ */ jsx("path", { d: "M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z" }),
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"path",
|
|
29
|
+
{
|
|
30
|
+
d: "M320 196l128 120M448 196L320 316",
|
|
31
|
+
fill: "none",
|
|
32
|
+
stroke: "currentColor",
|
|
33
|
+
strokeLinecap: "round",
|
|
34
|
+
strokeWidth: "32"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] });
|
|
38
|
+
const CaptionsIcon = ({ on = false }) => /* @__PURE__ */ jsxs("svg", { ...svgProps, "data-on": on || void 0, className: "clover-captions-icon", children: [
|
|
39
|
+
on ? (
|
|
40
|
+
// Filled: the outlined card's outer edge, so the two are one size. No `stroke`,
|
|
41
|
+
// which the transport's glyph rules read as an outline (`Transport.css`).
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"rect",
|
|
44
|
+
{
|
|
45
|
+
x: "22",
|
|
46
|
+
y: "86",
|
|
47
|
+
width: "468",
|
|
48
|
+
height: "340",
|
|
49
|
+
rx: "74",
|
|
50
|
+
fill: "currentColor"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
) : /* @__PURE__ */ jsx(
|
|
54
|
+
"rect",
|
|
55
|
+
{
|
|
56
|
+
x: "40",
|
|
57
|
+
y: "104",
|
|
58
|
+
width: "432",
|
|
59
|
+
height: "304",
|
|
60
|
+
rx: "56",
|
|
61
|
+
fill: "none",
|
|
62
|
+
stroke: "currentColor",
|
|
63
|
+
strokeWidth: "36"
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"path",
|
|
68
|
+
{
|
|
69
|
+
className: "clover-captions-icon-letters",
|
|
70
|
+
d: "M228 216a48 48 0 1 0 0 80M356 216a48 48 0 1 0 0 80",
|
|
71
|
+
fill: "none",
|
|
72
|
+
stroke: on ? "var(--clover-color-control, #1a1d1e)" : "currentColor",
|
|
73
|
+
strokeLinecap: "round",
|
|
74
|
+
strokeWidth: "36"
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] });
|
|
78
|
+
const ChaptersIcon = () => /* @__PURE__ */ jsxs("svg", { ...svgProps, children: [
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
"path",
|
|
81
|
+
{
|
|
82
|
+
d: "M160 144h288M160 256h288M160 368h288",
|
|
83
|
+
fill: "none",
|
|
84
|
+
stroke: "currentColor",
|
|
85
|
+
strokeLinecap: "round",
|
|
86
|
+
strokeWidth: "32"
|
|
87
|
+
}
|
|
88
|
+
),
|
|
89
|
+
/* @__PURE__ */ jsx("circle", { cx: "80", cy: "144", r: "20" }),
|
|
90
|
+
/* @__PURE__ */ jsx("circle", { cx: "80", cy: "256", r: "20" }),
|
|
91
|
+
/* @__PURE__ */ jsx("circle", { cx: "80", cy: "368", r: "20" })
|
|
92
|
+
] });
|
|
93
|
+
const FullScreenIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx(ZoomFullScreen, {}) });
|
|
94
|
+
const ExitFullScreenIcon = () => /* @__PURE__ */ jsx("svg", { ...svgProps, children: /* @__PURE__ */ jsx(ZoomExitFullScreen, {}) });
|
|
95
|
+
export {
|
|
96
|
+
CaptionsIcon,
|
|
97
|
+
ChaptersIcon,
|
|
98
|
+
ExitFullScreenIcon,
|
|
99
|
+
FullScreenIcon,
|
|
100
|
+
PauseIcon,
|
|
101
|
+
PlayIcon,
|
|
102
|
+
VolumeHighIcon,
|
|
103
|
+
VolumeMutedIcon
|
|
104
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useLayoutEffect } from "react";
|
|
3
|
+
const BELOW_MIN = 112;
|
|
4
|
+
const BESIDE_MIN = 128;
|
|
5
|
+
function useClusterReach(cluster) {
|
|
6
|
+
useLayoutEffect(() => {
|
|
7
|
+
const canvas = cluster == null ? void 0 : cluster.closest(".clover-canvas");
|
|
8
|
+
if (!cluster || !canvas) return;
|
|
9
|
+
const write = (gone = false) => {
|
|
10
|
+
let start = cluster.offsetWidth;
|
|
11
|
+
let bottom = 0;
|
|
12
|
+
for (const control of gone ? [] : Array.from(cluster.children)) {
|
|
13
|
+
if (!(control instanceof HTMLElement) || !control.offsetParent)
|
|
14
|
+
continue;
|
|
15
|
+
start = Math.min(start, control.offsetLeft);
|
|
16
|
+
bottom = Math.max(bottom, control.offsetTop + control.offsetHeight);
|
|
17
|
+
}
|
|
18
|
+
const reach = { width: cluster.offsetWidth - start, height: bottom };
|
|
19
|
+
for (const [name, value] of Object.entries(reach)) {
|
|
20
|
+
const property = `--clover-canvas-controls-${name}`;
|
|
21
|
+
if (bottom) canvas.style.setProperty(property, `${value}px`);
|
|
22
|
+
else canvas.style.removeProperty(property);
|
|
23
|
+
}
|
|
24
|
+
const inset = cluster.offsetTop;
|
|
25
|
+
const transport = canvas.querySelector(
|
|
26
|
+
":scope > .clover-canvas-media > .clover-canvas-transport"
|
|
27
|
+
);
|
|
28
|
+
const below = canvas.clientHeight - 2 * inset - reach.height - ((transport == null ? void 0 : transport.offsetHeight) ?? 0);
|
|
29
|
+
const beside = cluster.offsetLeft + start - inset;
|
|
30
|
+
if (bottom && below < BELOW_MIN && beside >= BESIDE_MIN)
|
|
31
|
+
canvas.dataset.popups = "beside";
|
|
32
|
+
else delete canvas.dataset.popups;
|
|
33
|
+
};
|
|
34
|
+
write();
|
|
35
|
+
const resize = new ResizeObserver(() => write());
|
|
36
|
+
resize.observe(cluster);
|
|
37
|
+
resize.observe(canvas);
|
|
38
|
+
const mutation = new MutationObserver(() => write());
|
|
39
|
+
mutation.observe(cluster, { childList: true });
|
|
40
|
+
mutation.observe(canvas, { childList: true });
|
|
41
|
+
return () => {
|
|
42
|
+
resize.disconnect();
|
|
43
|
+
mutation.disconnect();
|
|
44
|
+
write(true);
|
|
45
|
+
};
|
|
46
|
+
}, [cluster]);
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
useClusterReach
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useUniqueId } from "./useUniqueId.mjs";
|
|
4
|
+
import { langWithin } from "../i18n/config.mjs";
|
|
5
|
+
import { useCloverTranslation } from "../i18n/useCloverTranslation.mjs";
|
|
6
|
+
function useContainerName(text, lang, named = false, hostLanguage) {
|
|
7
|
+
const id = useUniqueId();
|
|
8
|
+
const { hostLanguage: host } = useCloverTranslation(void 0, hostLanguage);
|
|
9
|
+
if (named) return { props: {}, node: null };
|
|
10
|
+
const other = langWithin(lang, host);
|
|
11
|
+
if (other === void 0) return { props: { "aria-label": text }, node: null };
|
|
12
|
+
return {
|
|
13
|
+
props: { "aria-labelledby": id },
|
|
14
|
+
node: /* @__PURE__ */ jsx("span", { hidden: true, id, lang: other, children: text })
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
useContainerName
|
|
19
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { useUniqueId } from "./useUniqueId.mjs";
|
|
4
|
+
const opened = /* @__PURE__ */ new Map();
|
|
5
|
+
function useOneOpen(open, close) {
|
|
6
|
+
const id = useUniqueId();
|
|
7
|
+
const latest = useRef(close);
|
|
8
|
+
latest.current = close;
|
|
9
|
+
useEffect(() => open ? join(id, latest) : void 0, [open, id]);
|
|
10
|
+
}
|
|
11
|
+
function join(id, close) {
|
|
12
|
+
for (const [other, closeOther] of [...opened]) {
|
|
13
|
+
if (other !== id) closeOther.current();
|
|
14
|
+
}
|
|
15
|
+
opened.set(id, close);
|
|
16
|
+
return () => {
|
|
17
|
+
opened.delete(id);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
useOneOpen
|
|
22
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
3
|
+
function useRovingFocus(count, selected, {
|
|
4
|
+
orientation = "both",
|
|
5
|
+
rtl = false,
|
|
6
|
+
onActivate,
|
|
7
|
+
onMove
|
|
8
|
+
} = {}) {
|
|
9
|
+
const [focused, setFocused] = useState(Math.max(0, selected));
|
|
10
|
+
const elements = useRef([]);
|
|
11
|
+
const activate = useRef(onActivate);
|
|
12
|
+
activate.current = onActivate;
|
|
13
|
+
const move = useRef(onMove);
|
|
14
|
+
move.current = onMove;
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (selected >= 0) setFocused(selected);
|
|
17
|
+
}, [selected]);
|
|
18
|
+
const clamped = Math.min(focused, Math.max(0, count - 1));
|
|
19
|
+
const focusAt = useCallback((index) => {
|
|
20
|
+
var _a;
|
|
21
|
+
setFocused(index);
|
|
22
|
+
(_a = elements.current[index]) == null ? void 0 : _a.focus();
|
|
23
|
+
}, []);
|
|
24
|
+
const onKeyDown = useCallback(
|
|
25
|
+
(event, index) => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const forward = rtl ? "ArrowLeft" : "ArrowRight";
|
|
28
|
+
const backward = rtl ? "ArrowRight" : "ArrowLeft";
|
|
29
|
+
const horizontal = orientation !== "vertical";
|
|
30
|
+
const vertical = orientation !== "horizontal";
|
|
31
|
+
let next = null;
|
|
32
|
+
if (horizontal && event.key === forward || vertical && event.key === "ArrowDown") {
|
|
33
|
+
next = Math.min(count - 1, index + 1);
|
|
34
|
+
} else if (horizontal && event.key === backward || vertical && event.key === "ArrowUp") {
|
|
35
|
+
next = Math.max(0, index - 1);
|
|
36
|
+
} else if (event.key === "Home") {
|
|
37
|
+
next = 0;
|
|
38
|
+
} else if (event.key === "End") {
|
|
39
|
+
next = count - 1;
|
|
40
|
+
} else if (event.key === "Enter" || event.key === " ") {
|
|
41
|
+
(_a = activate.current) == null ? void 0 : _a.call(activate, index, event);
|
|
42
|
+
event.preventDefault();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (next === null) return;
|
|
46
|
+
event.preventDefault();
|
|
47
|
+
focusAt(next);
|
|
48
|
+
if (next !== index) (_b = move.current) == null ? void 0 : _b.call(move, next, event);
|
|
49
|
+
},
|
|
50
|
+
[count, orientation, rtl, focusAt]
|
|
51
|
+
);
|
|
52
|
+
const itemProps = (index) => ({
|
|
53
|
+
ref: (element) => {
|
|
54
|
+
elements.current[index] = element;
|
|
55
|
+
},
|
|
56
|
+
tabIndex: index === clamped ? 0 : -1,
|
|
57
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
58
|
+
onFocus: () => setFocused(index)
|
|
59
|
+
});
|
|
60
|
+
return { focused: clamped, itemProps };
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
useRovingFocus
|
|
64
|
+
};
|