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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (413) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +120 -2
  3. package/dist/components/Annotations/Annotations.mjs +674 -0
  4. package/dist/components/Annotations/EntryBodies.mjs +52 -0
  5. package/dist/components/Annotations/languages.mjs +43 -0
  6. package/dist/components/Body/Body.mjs +51 -0
  7. package/dist/components/Body/BodyAlert.mjs +25 -0
  8. package/dist/components/Body/Caption.mjs +90 -0
  9. package/dist/components/Body/CaptionDetails.mjs +50 -0
  10. package/dist/components/Body/Pending.mjs +9 -0
  11. package/dist/components/Body/glyphs.mjs +66 -0
  12. package/dist/components/Body/renderers.mjs +30 -0
  13. package/dist/components/Body/useControlsVisibility.mjs +204 -0
  14. package/dist/components/Body/useNearViewport.mjs +27 -0
  15. package/dist/components/Canvas/AnnotationMenu.mjs +128 -0
  16. package/dist/components/Canvas/AnnotationState.mjs +338 -0
  17. package/dist/components/Canvas/Annotations.mjs +497 -0
  18. package/dist/components/Canvas/CanvasView.mjs +669 -0
  19. package/dist/components/Canvas/ChoiceMenu.mjs +77 -0
  20. package/dist/components/Canvas/Connected.mjs +228 -0
  21. package/dist/components/Canvas/ControlMenu.mjs +67 -0
  22. package/dist/components/Canvas/Controls.mjs +233 -0
  23. package/dist/components/Canvas/FrameAnimation.mjs +344 -0
  24. package/dist/components/Canvas/LoadedCanvas.mjs +177 -0
  25. package/dist/components/Canvas/Placeholder.mjs +105 -0
  26. package/dist/components/Canvas/fromManifest.mjs +44 -0
  27. package/dist/components/Canvas/index.mjs +19 -0
  28. package/dist/components/Canvas/layout.mjs +369 -0
  29. package/dist/components/Canvas/media/MediaBody.mjs +285 -0
  30. package/dist/components/Canvas/media/Player.mjs +193 -0
  31. package/dist/components/Canvas/media/Transport.mjs +511 -0
  32. package/dist/components/Canvas/media/TransportButton.mjs +39 -0
  33. package/dist/components/Canvas/media/useBarHeight.mjs +28 -0
  34. package/dist/components/Canvas/media/useCaptionTracks.mjs +131 -0
  35. package/dist/components/Canvas/media/useMediaController.mjs +77 -0
  36. package/dist/components/Canvas/media/useMediaElement.mjs +100 -0
  37. package/dist/components/Canvas/panClearOfControls.mjs +92 -0
  38. package/dist/components/Canvas/rendererSurface.mjs +6 -0
  39. package/dist/components/Canvas/surface.mjs +5 -0
  40. package/dist/components/Canvas/track.mjs +43 -0
  41. package/dist/components/Canvas/useSvgReader.mjs +23 -0
  42. package/dist/components/Collection/Collection.mjs +76 -0
  43. package/dist/components/CollectionSelect/CollectionSelect.mjs +114 -0
  44. package/dist/components/Contents/Contents.mjs +120 -0
  45. package/dist/components/Download/Download.mjs +105 -0
  46. package/dist/components/Items/Item.mjs +184 -0
  47. package/dist/components/Items/Items.mjs +455 -0
  48. package/dist/components/Items/Pager.mjs +190 -0
  49. package/dist/components/Items/StandaloneItems.mjs +80 -0
  50. package/dist/components/Items/clamped.mjs +90 -0
  51. package/dist/components/Label/Label.mjs +39 -0
  52. package/dist/components/Map/LoadedMap.mjs +26 -0
  53. package/dist/components/Map/Map.mjs +38 -0
  54. package/dist/components/Map/MapView.mjs +539 -0
  55. package/dist/components/Map/basemap.mjs +50 -0
  56. package/dist/components/Map/maplibre-worker.mjs +7 -0
  57. package/dist/components/Map/overlayImage.mjs +17 -0
  58. package/dist/components/Map/worker.mjs +22 -0
  59. package/dist/components/Panel/About.mjs +148 -0
  60. package/dist/components/Panel/Panel.mjs +259 -0
  61. package/dist/components/Panel/PanelToggle.mjs +43 -0
  62. package/dist/components/Panel/PartOfManifest.mjs +52 -0
  63. package/dist/components/Primitives/Primitives.mjs +263 -0
  64. package/dist/components/Primitives/resource.mjs +11 -0
  65. package/dist/components/Provider/Provider.mjs +174 -0
  66. package/dist/components/Root/Announcer.mjs +58 -0
  67. package/dist/components/Root/Root.mjs +29 -0
  68. package/dist/components/Root/useRootState.mjs +188 -0
  69. package/dist/components/Scene/Connected.mjs +48 -0
  70. package/dist/components/Scene/Loaded.mjs +56 -0
  71. package/dist/components/Scene/RotatePad.mjs +204 -0
  72. package/dist/components/Scene/Scene.mjs +20 -0
  73. package/dist/components/Scene/SceneView.mjs +539 -0
  74. package/dist/components/Scene/cloverEngine.mjs +105 -0
  75. package/dist/components/Scene/engine.mjs +141 -0
  76. package/dist/components/Scene/engines.mjs +23 -0
  77. package/dist/components/Scene/gestures.mjs +74 -0
  78. package/dist/components/Scene/models.mjs +78 -0
  79. package/dist/components/Scene/orbit.mjs +60 -0
  80. package/dist/components/Search/Search.mjs +246 -0
  81. package/dist/components/Split/Split.mjs +210 -0
  82. package/dist/components/Split/splitting.mjs +203 -0
  83. package/dist/components/Status/Status.mjs +47 -0
  84. package/dist/components/Timeline/Connected.mjs +25 -0
  85. package/dist/components/Timeline/Timeline.mjs +40 -0
  86. package/dist/components/Timeline/playerSurface.mjs +84 -0
  87. package/dist/components/Transcript/Transcript.mjs +377 -0
  88. package/dist/components/Viewer/Viewer.mjs +19 -0
  89. package/dist/core/annotation-bodies.mjs +29 -0
  90. package/dist/core/annotation-collection.mjs +55 -0
  91. package/dist/core/annotation-name.mjs +31 -0
  92. package/dist/core/annotation-sets.mjs +155 -0
  93. package/dist/core/annotations-content.mjs +27 -0
  94. package/dist/core/annotations.mjs +73 -0
  95. package/dist/core/clover.mjs +393 -0
  96. package/dist/core/content-state-reader.mjs +82 -0
  97. package/dist/core/content-state.mjs +43 -0
  98. package/dist/core/direction.mjs +12 -0
  99. package/dist/core/geo-detect.mjs +30 -0
  100. package/dist/core/geo.mjs +283 -0
  101. package/dist/core/items.mjs +76 -0
  102. package/dist/core/keep-fragments.mjs +40 -0
  103. package/dist/core/link.mjs +28 -0
  104. package/dist/core/load.mjs +183 -0
  105. package/dist/core/map-config.mjs +12 -0
  106. package/dist/core/markdown.mjs +139 -0
  107. package/dist/core/pages.mjs +51 -0
  108. package/dist/core/painted-bodies.mjs +20 -0
  109. package/dist/core/painting.mjs +17 -0
  110. package/dist/core/presentation.mjs +27 -0
  111. package/dist/core/ranges.mjs +133 -0
  112. package/dist/core/region.mjs +32 -0
  113. package/dist/core/request.mjs +40 -0
  114. package/dist/core/sanitize.mjs +72 -0
  115. package/dist/core/search-service.mjs +22 -0
  116. package/dist/core/search.mjs +154 -0
  117. package/dist/core/selectors.mjs +94 -0
  118. package/dist/core/sequence.mjs +70 -0
  119. package/dist/core/show-link.mjs +16 -0
  120. package/dist/core/store.mjs +40 -0
  121. package/dist/core/svg-shape.mjs +183 -0
  122. package/dist/core/text.mjs +36 -0
  123. package/dist/core/thumbnail.mjs +55 -0
  124. package/dist/core/value.mjs +39 -0
  125. package/dist/core/vtt.mjs +111 -0
  126. package/dist/hooks/useFullscreen.mjs +21 -0
  127. package/dist/hooks/useFullscreenSupported.mjs +11 -0
  128. package/dist/hooks/useLoaded.mjs +27 -0
  129. package/dist/hooks/useWithinFullscreen.mjs +24 -0
  130. package/dist/i18n/config.mjs +170 -0
  131. package/dist/i18n/hostLanguage.mjs +6 -0
  132. package/dist/i18n/locales/en.json.mjs +5 -0
  133. package/dist/i18n/locales/es.json.mjs +5 -0
  134. package/dist/i18n/locales/fi.json.mjs +5 -0
  135. package/dist/i18n/locales/fr.json.mjs +5 -0
  136. package/dist/i18n/locales/index.mjs +13 -0
  137. package/dist/i18n/locales/nb.json.mjs +5 -0
  138. package/dist/i18n/locales/nn.json.mjs +5 -0
  139. package/dist/i18n/locales/no.json.mjs +5 -0
  140. package/dist/i18n/locales/pt.json.mjs +5 -0
  141. package/dist/i18n/reader.mjs +13 -0
  142. package/dist/i18n/useCloverTranslation.mjs +28 -0
  143. package/dist/index.d.mts +2215 -0
  144. package/dist/index.mjs +133 -0
  145. package/dist/lib/asArray.mjs +5 -0
  146. package/dist/lib/classnames.mjs +5 -0
  147. package/dist/lib/fullscreen.mjs +65 -0
  148. package/dist/lib/gltf/bounds.mjs +44 -0
  149. package/dist/lib/gltf/load.mjs +156 -0
  150. package/dist/lib/gltf/mat4.mjs +150 -0
  151. package/dist/lib/gltf/renderer.mjs +342 -0
  152. package/dist/lib/gltf/shaders.mjs +192 -0
  153. package/dist/lib/hls.mjs +6 -0
  154. package/dist/lib/pointer.mjs +38 -0
  155. package/dist/lib/renderer/CanvasRenderer.mjs +857 -0
  156. package/dist/lib/renderer/backends/backend.mjs +21 -0
  157. package/dist/lib/renderer/backends/canvas2d/Canvas2DBackend.mjs +91 -0
  158. package/dist/lib/renderer/backends/contexts.mjs +27 -0
  159. package/dist/lib/renderer/backends/dom/DomLayers.mjs +91 -0
  160. package/dist/lib/renderer/backends/webgl2/WebGL2Backend.mjs +248 -0
  161. package/dist/lib/renderer/backends/webgl2/shaders.mjs +28 -0
  162. package/dist/lib/renderer/camera/Camera.mjs +64 -0
  163. package/dist/lib/renderer/camera/CameraAnimator.mjs +90 -0
  164. package/dist/lib/renderer/input/GestureController.mjs +252 -0
  165. package/dist/lib/renderer/io/TileCache.mjs +207 -0
  166. package/dist/lib/renderer/io/decode.mjs +156 -0
  167. package/dist/lib/renderer/loop/FrameLoop.mjs +50 -0
  168. package/dist/lib/renderer/math/affine.mjs +68 -0
  169. package/dist/lib/renderer/math/rect.mjs +45 -0
  170. package/dist/lib/renderer/overlays/Navigator.mjs +141 -0
  171. package/dist/lib/renderer/overlays/OverlayLayer.mjs +94 -0
  172. package/dist/lib/renderer/scene/planFrame.mjs +168 -0
  173. package/dist/lib/renderer/scene/regions.mjs +30 -0
  174. package/dist/lib/renderer/scene/sceneItem.mjs +114 -0
  175. package/dist/lib/renderer/scene/uploadBudget.mjs +30 -0
  176. package/dist/lib/renderer/sources/imageService.mjs +160 -0
  177. package/dist/lib/renderer/sources/sizedImage.mjs +38 -0
  178. package/dist/lib/renderer/sources/tilePyramid.mjs +172 -0
  179. package/dist/lib/time.mjs +21 -0
  180. package/dist/map/index.d.mts +195 -0
  181. package/dist/map/index.mjs +16 -0
  182. package/dist/react/context.mjs +46 -0
  183. package/dist/react/hooks.mjs +69 -0
  184. package/dist/react/language.mjs +30 -0
  185. package/dist/styles.css +1 -0
  186. package/dist/templates/default/Default.mjs +229 -0
  187. package/dist/templates/document/Document.mjs +286 -0
  188. package/dist/templates/document/DocumentPanel.mjs +9 -0
  189. package/dist/templates/document/Sheets.mjs +360 -0
  190. package/dist/templates/gallery/Gallery.mjs +62 -0
  191. package/dist/templates/index.d.mts +276 -0
  192. package/dist/templates/index.mjs +11 -0
  193. package/dist/templates/shared/Lightbox.mjs +111 -0
  194. package/dist/templates/shared/LightboxBody.mjs +9 -0
  195. package/dist/templates/shared/dragToClose.mjs +129 -0
  196. package/dist/templates/shared/useDragToClose.mjs +35 -0
  197. package/dist/templates/shared/useDrawer.mjs +113 -0
  198. package/dist/templates/shared/useFollowFocus.mjs +24 -0
  199. package/dist/templates/shared/useSlide.mjs +52 -0
  200. package/dist/templates/shared/useSpine.mjs +26 -0
  201. package/dist/templates.css +1 -0
  202. package/dist/three/index.d.mts +6 -0
  203. package/dist/three/index.mjs +8 -0
  204. package/dist/ui/Button.mjs +53 -0
  205. package/dist/ui/ControlCluster.mjs +87 -0
  206. package/dist/ui/Cue.mjs +13 -0
  207. package/dist/ui/ErrorBoundary.mjs +26 -0
  208. package/dist/ui/ExitFullscreen.mjs +46 -0
  209. package/dist/ui/FieldPill.mjs +153 -0
  210. package/dist/ui/HideToggle.mjs +57 -0
  211. package/dist/ui/Loading.mjs +20 -0
  212. package/dist/ui/Markup.mjs +95 -0
  213. package/dist/ui/ReadMore.mjs +84 -0
  214. package/dist/ui/Sections.mjs +448 -0
  215. package/dist/ui/Steps.mjs +84 -0
  216. package/dist/ui/Tip.mjs +196 -0
  217. package/dist/ui/bringIntoView.mjs +27 -0
  218. package/dist/ui/controlGlyphs.mjs +120 -0
  219. package/dist/ui/heading.mjs +19 -0
  220. package/dist/ui/languageCode.mjs +8 -0
  221. package/dist/ui/mediaIcons.mjs +104 -0
  222. package/dist/ui/useClusterReach.mjs +50 -0
  223. package/dist/ui/useContainerName.mjs +19 -0
  224. package/dist/ui/useOneOpen.mjs +22 -0
  225. package/dist/ui/useRovingFocus.mjs +64 -0
  226. package/dist/ui/useScrollTrack.mjs +150 -0
  227. package/dist/ui/useUniqueId.mjs +10 -0
  228. package/dist/ui/visuallyHidden.mjs +15 -0
  229. package/dist/web-components/About-DbrFSVBm.mjs +1 -0
  230. package/dist/web-components/AnnotationMenu-EBjIQpQl.mjs +1 -0
  231. package/dist/web-components/AnnotationState-DQTaO6Gz.mjs +1 -0
  232. package/dist/web-components/Annotations-Cb9U7HJ_.mjs +2 -0
  233. package/dist/web-components/Annotations-Dl0SgHBS.mjs +1 -0
  234. package/dist/web-components/Body-DxSz3iST.mjs +1 -0
  235. package/dist/web-components/BodyAlert-C8EOXz24.mjs +1 -0
  236. package/dist/web-components/Button-uWgfvqsL.mjs +1 -0
  237. package/dist/web-components/Camera-cdCqKMup.mjs +1 -0
  238. package/dist/web-components/Canvas2DBackend-CnLEHRs4.mjs +1 -0
  239. package/dist/web-components/CanvasView-BI3YzNdK.mjs +1 -0
  240. package/dist/web-components/CaptionDetails-B80ZhZ7v.mjs +1 -0
  241. package/dist/web-components/ChoiceMenu-DCp7-co7.mjs +1 -0
  242. package/dist/web-components/Collection-B1Le2_TU.mjs +1 -0
  243. package/dist/web-components/CollectionSelect-BL_jQog-.mjs +1 -0
  244. package/dist/web-components/Connected-BxqaRL9o.mjs +1 -0
  245. package/dist/web-components/Connected-DCBI-j9H.mjs +1 -0
  246. package/dist/web-components/Connected-DkhfVWxd.mjs +1 -0
  247. package/dist/web-components/Contents-zYEGHLfe.mjs +1 -0
  248. package/dist/web-components/ControlMenu-CAHiLAtl.mjs +1 -0
  249. package/dist/web-components/Cue-BT2V9VAq.mjs +1 -0
  250. package/dist/web-components/Document-BdCjGnJN.mjs +1 -0
  251. package/dist/web-components/DocumentPanel-X_Rta0Wu.mjs +1 -0
  252. package/dist/web-components/DomLayers-BD4QPbl6.mjs +1 -0
  253. package/dist/web-components/Download-DqU-goFi.mjs +1 -0
  254. package/dist/web-components/EntryBodies-DXAQH0vR.mjs +1 -0
  255. package/dist/web-components/ErrorBoundary-chQaO-Up.mjs +1 -0
  256. package/dist/web-components/FieldPill-CyEssPVm.mjs +1 -0
  257. package/dist/web-components/FrameAnimation-Bb0pOoRl.mjs +1 -0
  258. package/dist/web-components/Gallery-BXU3TcT3.mjs +1 -0
  259. package/dist/web-components/HideToggle-BwMrOBMu.mjs +1 -0
  260. package/dist/web-components/Items-DRj1UEpC.mjs +1 -0
  261. package/dist/web-components/Label-D6aVJB9s.mjs +1 -0
  262. package/dist/web-components/LightboxBody-BzXQGMDn.mjs +1 -0
  263. package/dist/web-components/Loaded-D5xmFRSo.mjs +1 -0
  264. package/dist/web-components/LoadedCanvas-DOjtxLSe.mjs +1 -0
  265. package/dist/web-components/LoadedMap-DouDS2lO.mjs +1 -0
  266. package/dist/web-components/Loading-CBKfwsML.mjs +1 -0
  267. package/dist/web-components/Map-Bcgp_R8H.mjs +1 -0
  268. package/dist/web-components/MapView-CD5zkTs8.mjs +1 -0
  269. package/dist/web-components/Markup-C1hMA8wk.mjs +2 -0
  270. package/dist/web-components/MediaBody-B_Gii4we.mjs +1 -0
  271. package/dist/web-components/MediaBody-BfrKIPte.mjs +1 -0
  272. package/dist/web-components/Navigator-BSJbEbuJ.mjs +1 -0
  273. package/dist/web-components/Pager-Di_2hHM3.mjs +1 -0
  274. package/dist/web-components/Panel-DbsC8A9V.mjs +1 -0
  275. package/dist/web-components/PanelToggle-mUDw73zI.mjs +1 -0
  276. package/dist/web-components/PartOfManifest-7eOwURrF.mjs +1 -0
  277. package/dist/web-components/Pending-BPOQ2z1L.mjs +1 -0
  278. package/dist/web-components/Primitives-XQO3m1wG.mjs +1 -0
  279. package/dist/web-components/Provider-B61118lU.mjs +1 -0
  280. package/dist/web-components/ReadMore-BJH-qqte.mjs +1 -0
  281. package/dist/web-components/Root-Dj277K6p.mjs +1 -0
  282. package/dist/web-components/Scene-BTWpLeec.mjs +1 -0
  283. package/dist/web-components/SceneView-BYo7WmPt.mjs +1 -0
  284. package/dist/web-components/Search-ZV8FFN4p.mjs +1 -0
  285. package/dist/web-components/Sections-ejwu1_Sm.mjs +2 -0
  286. package/dist/web-components/StandaloneItems-BYaiyCca.mjs +1 -0
  287. package/dist/web-components/Status-YbQK2KzY.mjs +1 -0
  288. package/dist/web-components/Timeline-ByyVSd7B.mjs +1 -0
  289. package/dist/web-components/Tip-IO11xX4x.mjs +1 -0
  290. package/dist/web-components/Transcript-D0gUxUoA.mjs +1 -0
  291. package/dist/web-components/annotation-collection-Csv7WIlm.mjs +1 -0
  292. package/dist/web-components/annotations-content-BS_OFz5Z.mjs +1 -0
  293. package/dist/web-components/assets/maplibre-gl-worker-kTz9OPxr.js +13831 -0
  294. package/dist/web-components/body-CKjwwFep.mjs +1 -0
  295. package/dist/web-components/bringIntoView-CQH5ZgMM.mjs +1 -0
  296. package/dist/web-components/canvas-CIzpp-Uz.mjs +1 -0
  297. package/dist/web-components/classnames-DukgfdpI.mjs +1 -0
  298. package/dist/web-components/cloverEngine-B4LinbSt.mjs +164 -0
  299. package/dist/web-components/content-state-reader-D1BkpICh.mjs +1 -0
  300. package/dist/web-components/contexts-ByL3eA_T.mjs +1 -0
  301. package/dist/web-components/controls-Dj2BybWb.mjs +1 -0
  302. package/dist/web-components/custom-elements.json +2739 -0
  303. package/dist/web-components/dragToClose-C-Pf1IeO.mjs +1 -0
  304. package/dist/web-components/engine-BSt8LTso.mjs +4228 -0
  305. package/dist/web-components/engines-CC0OEsVE.mjs +1 -0
  306. package/dist/web-components/es-BwMkoRod.mjs +1 -0
  307. package/dist/web-components/fi-gPFOn9RK.mjs +1 -0
  308. package/dist/web-components/fr-DUHmgdJo.mjs +1 -0
  309. package/dist/web-components/fromManifest-BhemHaoA.mjs +1 -0
  310. package/dist/web-components/glyphs-drROkef9.mjs +1 -0
  311. package/dist/web-components/heading-Cjt0f-Eu.mjs +1 -0
  312. package/dist/web-components/hls-CdKrthkC.mjs +40 -0
  313. package/dist/web-components/hooks-BXzQSllm.mjs +1 -0
  314. package/dist/web-components/imageService-dsdmcegU.mjs +1 -0
  315. package/dist/web-components/index-B7nZdqLg.mjs +1 -0
  316. package/dist/web-components/index.d.mts +604 -0
  317. package/dist/web-components/index.mjs +1 -0
  318. package/dist/web-components/index.umd.js +18 -0
  319. package/dist/web-components/items-CB2Uk7ts.mjs +1 -0
  320. package/dist/web-components/items-jfQ5XzEj.mjs +1 -0
  321. package/dist/web-components/keep-fragments-B5nlv2ck.mjs +1 -0
  322. package/dist/web-components/label-Vbg_cMOJ.mjs +1 -0
  323. package/dist/web-components/languageCode-cCpiU0b0.mjs +1 -0
  324. package/dist/web-components/layout-mMHI0lsj.mjs +1 -0
  325. package/dist/web-components/link-ZRnv5NFR.mjs +1 -0
  326. package/dist/web-components/logo-Boy6u4m2.mjs +1 -0
  327. package/dist/web-components/maplibre-gl-CQ4OueXY.mjs +823 -0
  328. package/dist/web-components/markdown-CCYJwzFn.mjs +5 -0
  329. package/dist/web-components/models-D1EE_CmH.mjs +1 -0
  330. package/dist/web-components/nb-BSvnQ6jd.mjs +1 -0
  331. package/dist/web-components/nn-Dg2_HdZu.mjs +1 -0
  332. package/dist/web-components/no-BSvnQ6jd.mjs +1 -0
  333. package/dist/web-components/nodes-B7JRwBgl.mjs +1 -0
  334. package/dist/web-components/overlayImage-0OgQl1TL.mjs +1 -0
  335. package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +1 -0
  336. package/dist/web-components/panel-CjXfre-g.mjs +1 -0
  337. package/dist/web-components/part-cUiPs2-y.mjs +1 -0
  338. package/dist/web-components/playerSurface-CU5XxI1j.mjs +1 -0
  339. package/dist/web-components/provider-C1wKfdjb.mjs +1 -0
  340. package/dist/web-components/pt-B3J80JgO.mjs +1 -0
  341. package/dist/web-components/read-more-DNHNtG-a.mjs +1 -0
  342. package/dist/web-components/rendererSurface-DhIlOjGT.mjs +22 -0
  343. package/dist/web-components/renderers-BMSWEFUR.mjs +1 -0
  344. package/dist/web-components/resource-DLHocQ1C.mjs +1 -0
  345. package/dist/web-components/sanitize-Dc7nOsgO.mjs +3 -0
  346. package/dist/web-components/search-CLy2Wj01.mjs +1 -0
  347. package/dist/web-components/shared-YUjOSBKO.mjs +1 -0
  348. package/dist/web-components/show-link-CyzYE1eS.mjs +1 -0
  349. package/dist/web-components/sizedImage-uv_NlE0l.mjs +1 -0
  350. package/dist/web-components/split-CYuMjp89.mjs +1 -0
  351. package/dist/web-components/splitting-BnQUxxgH.mjs +1 -0
  352. package/dist/web-components/status-Ms5L0ghK.mjs +1 -0
  353. package/dist/web-components/styles-CyuM_fB1.mjs +1 -0
  354. package/dist/web-components/svg-shape-DLY3g7oq.mjs +1 -0
  355. package/dist/web-components/text-BTAkxEfQ.mjs +5 -0
  356. package/dist/web-components/three.mjs +1 -0
  357. package/dist/web-components/thumbnail-c2K_iQsD.mjs +1 -0
  358. package/dist/web-components/time-B9GZoYcm.mjs +1 -0
  359. package/dist/web-components/tip-dWhupWSr.mjs +1 -0
  360. package/dist/web-components/toggle-BQTjR1I3.mjs +1 -0
  361. package/dist/web-components/upgrader-XNxI-5jo.mjs +1 -0
  362. package/dist/web-components/useContainerName-BpJ3IWY0.mjs +1 -0
  363. package/dist/web-components/useNearViewport-CtLyYg9n.mjs +1 -0
  364. package/dist/web-components/useScrollTrack-WbG28FPD.mjs +1 -0
  365. package/dist/web-components/viewer/AnnotationMenu-ZKyBeyUU.mjs +1 -0
  366. package/dist/web-components/viewer/AnnotationState-DO33zokc.mjs +1 -0
  367. package/dist/web-components/viewer/Annotations-BOjhr5ks.mjs +1 -0
  368. package/dist/web-components/viewer/Annotations-DkLueFLK.mjs +2 -0
  369. package/dist/web-components/viewer/Canvas2DBackend-CAmzJD5P.mjs +1 -0
  370. package/dist/web-components/viewer/CaptionDetails-DOJlUtOn.mjs +1 -0
  371. package/dist/web-components/viewer/ChoiceMenu-BDq6H34G.mjs +1 -0
  372. package/dist/web-components/viewer/Collection-By3puO0V.mjs +1 -0
  373. package/dist/web-components/viewer/Connected-DZNO2CPf.mjs +1 -0
  374. package/dist/web-components/viewer/Connected-ESg5y49m.mjs +1 -0
  375. package/dist/web-components/viewer/Contents-B_FqDwTW.mjs +1 -0
  376. package/dist/web-components/viewer/ControlMenu-DdQl-dTf.mjs +1 -0
  377. package/dist/web-components/viewer/Cue-BTRHfiWQ.mjs +1 -0
  378. package/dist/web-components/viewer/Document-B9_PyD2w.mjs +1 -0
  379. package/dist/web-components/viewer/DocumentPanel-CtEJVPoE.mjs +1 -0
  380. package/dist/web-components/viewer/DomLayers-DRdQSEtN.mjs +1 -0
  381. package/dist/web-components/viewer/EntryBodies-CJuTRcTq.mjs +1 -0
  382. package/dist/web-components/viewer/FieldPill-06uwrNwE.mjs +1 -0
  383. package/dist/web-components/viewer/FrameAnimation-3dcDHf5q.mjs +1 -0
  384. package/dist/web-components/viewer/Gallery-BYasTqZc.mjs +1 -0
  385. package/dist/web-components/viewer/HideToggle-BxkNMX-T.mjs +1 -0
  386. package/dist/web-components/viewer/LightboxBody-CXMc1xOH.mjs +1 -0
  387. package/dist/web-components/viewer/MapView-DCerrRRV.mjs +1 -0
  388. package/dist/web-components/viewer/MediaBody-BdkJcyGy.mjs +1 -0
  389. package/dist/web-components/viewer/MediaBody-waF4KvHp.mjs +1 -0
  390. package/dist/web-components/viewer/Navigator-CKwDgG2x.mjs +1 -0
  391. package/dist/web-components/viewer/PartOfManifest-DalHJFwC.mjs +1 -0
  392. package/dist/web-components/viewer/Search-Di_QQfDb.mjs +1 -0
  393. package/dist/web-components/viewer/StandaloneItems-B9J6nnWn.mjs +1 -0
  394. package/dist/web-components/viewer/Transcript-aHOixfna.mjs +1 -0
  395. package/dist/web-components/viewer/annotation-collection-I2UkdobR.mjs +1 -0
  396. package/dist/web-components/viewer/annotations-content-D-i4j9pD.mjs +1 -0
  397. package/dist/web-components/viewer/cloverEngine-CynoKdta.mjs +164 -0
  398. package/dist/web-components/viewer/content-state-reader-D7GIMcKK.mjs +1 -0
  399. package/dist/web-components/viewer/host-DlCltI_c.mjs +1 -0
  400. package/dist/web-components/viewer/index.d.mts +7 -0
  401. package/dist/web-components/viewer/index.mjs +1 -0
  402. package/dist/web-components/viewer/index.umd.js +18 -0
  403. package/dist/web-components/viewer/link-BX-wzj1u.mjs +1 -0
  404. package/dist/web-components/viewer/overlayImage-CHqn1fG8.mjs +1 -0
  405. package/dist/web-components/viewer/renderers-C_wdmw9v.mjs +1 -0
  406. package/dist/web-components/viewer/search-BHLyNxZ6.mjs +1 -0
  407. package/dist/web-components/viewer/styles-BRCkEU3w.mjs +1 -0
  408. package/dist/web-components/viewer/viewer-ipqAA-xQ.mjs +28 -0
  409. package/dist/web-components/viewer/vtt-XiS_-5Ao.mjs +5 -0
  410. package/dist/web-components/viewer-DEHIsIHd.mjs +1 -0
  411. package/dist/web-components/vtt-DYAOuQoK.mjs +5 -0
  412. package/dist/web-components/worker-CjXN0dku.mjs +1 -0
  413. package/package.json +111 -4
@@ -0,0 +1,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,8 @@
1
+ "use client";
2
+ function languageCode(tag) {
3
+ if (!tag || tag === "none") return void 0;
4
+ return tag.toUpperCase();
5
+ }
6
+ export {
7
+ languageCode
8
+ };
@@ -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
+ };