@docmentis/udoc-viewer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. package/README.md +180 -0
  2. package/dist/UDocClient.d.ts +197 -0
  3. package/dist/UDocClient.d.ts.map +1 -0
  4. package/dist/UDocClient.js +170 -0
  5. package/dist/UDocClient.js.map +1 -0
  6. package/dist/UDocViewer.d.ts +196 -0
  7. package/dist/UDocViewer.d.ts.map +1 -0
  8. package/dist/UDocViewer.js +427 -0
  9. package/dist/UDocViewer.js.map +1 -0
  10. package/dist/WorkerClient.d.ts +36 -0
  11. package/dist/WorkerClient.d.ts.map +1 -0
  12. package/dist/WorkerClient.js +121 -0
  13. package/dist/WorkerClient.js.map +1 -0
  14. package/dist/annotation/AnnotationLayer.d.ts +166 -0
  15. package/dist/annotation/AnnotationLayer.d.ts.map +1 -0
  16. package/dist/annotation/AnnotationLayer.js +1090 -0
  17. package/dist/annotation/AnnotationLayer.js.map +1 -0
  18. package/dist/annotation/index.d.ts +6 -0
  19. package/dist/annotation/index.d.ts.map +1 -0
  20. package/dist/annotation/index.js +6 -0
  21. package/dist/annotation/index.js.map +1 -0
  22. package/dist/components/FloatingBar.d.ts +102 -0
  23. package/dist/components/FloatingBar.d.ts.map +1 -0
  24. package/dist/components/FloatingBar.js +513 -0
  25. package/dist/components/FloatingBar.js.map +1 -0
  26. package/dist/components/Header.d.ts +46 -0
  27. package/dist/components/Header.d.ts.map +1 -0
  28. package/dist/components/Header.js +93 -0
  29. package/dist/components/Header.js.map +1 -0
  30. package/dist/components/index.d.ts +6 -0
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/dist/components/index.js +4 -0
  33. package/dist/components/index.js.map +1 -0
  34. package/dist/components/panels/CommentsPanel.d.ts +33 -0
  35. package/dist/components/panels/CommentsPanel.d.ts.map +1 -0
  36. package/dist/components/panels/CommentsPanel.js +176 -0
  37. package/dist/components/panels/CommentsPanel.js.map +1 -0
  38. package/dist/components/panels/OutlinePanel.d.ts +30 -0
  39. package/dist/components/panels/OutlinePanel.d.ts.map +1 -0
  40. package/dist/components/panels/OutlinePanel.js +144 -0
  41. package/dist/components/panels/OutlinePanel.js.map +1 -0
  42. package/dist/components/panels/ThumbnailsPanel.d.ts +51 -0
  43. package/dist/components/panels/ThumbnailsPanel.d.ts.map +1 -0
  44. package/dist/components/panels/ThumbnailsPanel.js +160 -0
  45. package/dist/components/panels/ThumbnailsPanel.js.map +1 -0
  46. package/dist/components/panels/index.d.ts +7 -0
  47. package/dist/components/panels/index.d.ts.map +1 -0
  48. package/dist/components/panels/index.js +4 -0
  49. package/dist/components/panels/index.js.map +1 -0
  50. package/dist/constants.d.ts +25 -0
  51. package/dist/constants.d.ts.map +1 -0
  52. package/dist/constants.js +46 -0
  53. package/dist/constants.js.map +1 -0
  54. package/dist/core/NavigationController.d.ts +54 -0
  55. package/dist/core/NavigationController.d.ts.map +1 -0
  56. package/dist/core/NavigationController.js +145 -0
  57. package/dist/core/NavigationController.js.map +1 -0
  58. package/dist/core/PerfTimer.d.ts +12 -0
  59. package/dist/core/PerfTimer.d.ts.map +1 -0
  60. package/dist/core/PerfTimer.js +32 -0
  61. package/dist/core/PerfTimer.js.map +1 -0
  62. package/dist/core/ViewerState.d.ts +108 -0
  63. package/dist/core/ViewerState.d.ts.map +1 -0
  64. package/dist/core/ViewerState.js +179 -0
  65. package/dist/core/ViewerState.js.map +1 -0
  66. package/dist/core/constants.d.ts +24 -0
  67. package/dist/core/constants.d.ts.map +1 -0
  68. package/dist/core/constants.js +42 -0
  69. package/dist/core/constants.js.map +1 -0
  70. package/dist/core/index.d.ts +8 -0
  71. package/dist/core/index.d.ts.map +1 -0
  72. package/dist/core/index.js +11 -0
  73. package/dist/core/index.js.map +1 -0
  74. package/dist/core/types.d.ts +573 -0
  75. package/dist/core/types.d.ts.map +1 -0
  76. package/dist/core/types.js +5 -0
  77. package/dist/core/types.js.map +1 -0
  78. package/dist/icons/icons.d.ts +41 -0
  79. package/dist/icons/icons.d.ts.map +1 -0
  80. package/dist/icons/icons.js +51 -0
  81. package/dist/icons/icons.js.map +1 -0
  82. package/dist/icons/index.d.ts +3 -0
  83. package/dist/icons/index.d.ts.map +1 -0
  84. package/dist/icons/index.js +2 -0
  85. package/dist/icons/index.js.map +1 -0
  86. package/dist/index.d.ts +7 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +6 -0
  89. package/dist/index.js.map +1 -0
  90. package/dist/layout/BandManager.d.ts +87 -0
  91. package/dist/layout/BandManager.d.ts.map +1 -0
  92. package/dist/layout/BandManager.js +185 -0
  93. package/dist/layout/BandManager.js.map +1 -0
  94. package/dist/layout/LayoutCalculator.d.ts +42 -0
  95. package/dist/layout/LayoutCalculator.d.ts.map +1 -0
  96. package/dist/layout/LayoutCalculator.js +180 -0
  97. package/dist/layout/LayoutCalculator.js.map +1 -0
  98. package/dist/layout/LayoutState.d.ts +46 -0
  99. package/dist/layout/LayoutState.d.ts.map +1 -0
  100. package/dist/layout/LayoutState.js +109 -0
  101. package/dist/layout/LayoutState.js.map +1 -0
  102. package/dist/layout/TransitionCoordinator.d.ts +11 -0
  103. package/dist/layout/TransitionCoordinator.d.ts.map +1 -0
  104. package/dist/layout/TransitionCoordinator.js +22 -0
  105. package/dist/layout/TransitionCoordinator.js.map +1 -0
  106. package/dist/layout/index.d.ts +7 -0
  107. package/dist/layout/index.d.ts.map +1 -0
  108. package/dist/layout/index.js +4 -0
  109. package/dist/layout/index.js.map +1 -0
  110. package/dist/rendering/BandManager.d.ts +87 -0
  111. package/dist/rendering/BandManager.d.ts.map +1 -0
  112. package/dist/rendering/BandManager.js +185 -0
  113. package/dist/rendering/BandManager.js.map +1 -0
  114. package/dist/rendering/PageCache.d.ts +75 -0
  115. package/dist/rendering/PageCache.d.ts.map +1 -0
  116. package/dist/rendering/PageCache.js +122 -0
  117. package/dist/rendering/PageCache.js.map +1 -0
  118. package/dist/rendering/RenderQueue.d.ts +75 -0
  119. package/dist/rendering/RenderQueue.d.ts.map +1 -0
  120. package/dist/rendering/RenderQueue.js +105 -0
  121. package/dist/rendering/RenderQueue.js.map +1 -0
  122. package/dist/rendering/ThumbnailQueue.d.ts +57 -0
  123. package/dist/rendering/ThumbnailQueue.d.ts.map +1 -0
  124. package/dist/rendering/ThumbnailQueue.js +85 -0
  125. package/dist/rendering/ThumbnailQueue.js.map +1 -0
  126. package/dist/rendering/index.d.ts +13 -0
  127. package/dist/rendering/index.d.ts.map +1 -0
  128. package/dist/rendering/index.js +10 -0
  129. package/dist/rendering/index.js.map +1 -0
  130. package/dist/rendering/types.d.ts +72 -0
  131. package/dist/rendering/types.d.ts.map +1 -0
  132. package/dist/rendering/types.js +5 -0
  133. package/dist/rendering/types.js.map +1 -0
  134. package/dist/styles/index.d.ts +6 -0
  135. package/dist/styles/index.d.ts.map +1 -0
  136. package/dist/styles/index.js +1221 -0
  137. package/dist/styles/index.js.map +1 -0
  138. package/dist/types.d.ts +6 -0
  139. package/dist/types.d.ts.map +1 -0
  140. package/dist/types.js +6 -0
  141. package/dist/types.js.map +1 -0
  142. package/dist/ui/Component.d.ts +127 -0
  143. package/dist/ui/Component.d.ts.map +1 -0
  144. package/dist/ui/Component.js +201 -0
  145. package/dist/ui/Component.js.map +1 -0
  146. package/dist/ui/annotation/AnnotationLayer.d.ts +90 -0
  147. package/dist/ui/annotation/AnnotationLayer.d.ts.map +1 -0
  148. package/dist/ui/annotation/AnnotationLayer.js +322 -0
  149. package/dist/ui/annotation/AnnotationLayer.js.map +1 -0
  150. package/dist/ui/annotation/LinkRenderer.d.ts +32 -0
  151. package/dist/ui/annotation/LinkRenderer.d.ts.map +1 -0
  152. package/dist/ui/annotation/LinkRenderer.js +74 -0
  153. package/dist/ui/annotation/LinkRenderer.js.map +1 -0
  154. package/dist/ui/annotation/MarkupRenderer.d.ts +40 -0
  155. package/dist/ui/annotation/MarkupRenderer.d.ts.map +1 -0
  156. package/dist/ui/annotation/MarkupRenderer.js +154 -0
  157. package/dist/ui/annotation/MarkupRenderer.js.map +1 -0
  158. package/dist/ui/annotation/ShapeRenderer.d.ts +46 -0
  159. package/dist/ui/annotation/ShapeRenderer.d.ts.map +1 -0
  160. package/dist/ui/annotation/ShapeRenderer.js +376 -0
  161. package/dist/ui/annotation/ShapeRenderer.js.map +1 -0
  162. package/dist/ui/annotation/TextRenderer.d.ts +36 -0
  163. package/dist/ui/annotation/TextRenderer.d.ts.map +1 -0
  164. package/dist/ui/annotation/TextRenderer.js +199 -0
  165. package/dist/ui/annotation/TextRenderer.js.map +1 -0
  166. package/dist/ui/annotation/index.d.ts +17 -0
  167. package/dist/ui/annotation/index.d.ts.map +1 -0
  168. package/dist/ui/annotation/index.js +13 -0
  169. package/dist/ui/annotation/index.js.map +1 -0
  170. package/dist/ui/annotation/utils.d.ts +40 -0
  171. package/dist/ui/annotation/utils.d.ts.map +1 -0
  172. package/dist/ui/annotation/utils.js +62 -0
  173. package/dist/ui/annotation/utils.js.map +1 -0
  174. package/dist/ui/components/CommentsContent.d.ts +35 -0
  175. package/dist/ui/components/CommentsContent.d.ts.map +1 -0
  176. package/dist/ui/components/CommentsContent.js +203 -0
  177. package/dist/ui/components/CommentsContent.js.map +1 -0
  178. package/dist/ui/components/FloatingBar.d.ts +55 -0
  179. package/dist/ui/components/FloatingBar.d.ts.map +1 -0
  180. package/dist/ui/components/FloatingBar.js +585 -0
  181. package/dist/ui/components/FloatingBar.js.map +1 -0
  182. package/dist/ui/components/Header.d.ts +29 -0
  183. package/dist/ui/components/Header.d.ts.map +1 -0
  184. package/dist/ui/components/Header.js +127 -0
  185. package/dist/ui/components/Header.js.map +1 -0
  186. package/dist/ui/components/LeftPanel.d.ts +54 -0
  187. package/dist/ui/components/LeftPanel.d.ts.map +1 -0
  188. package/dist/ui/components/LeftPanel.js +202 -0
  189. package/dist/ui/components/LeftPanel.js.map +1 -0
  190. package/dist/ui/components/OutlineContent.d.ts +34 -0
  191. package/dist/ui/components/OutlineContent.d.ts.map +1 -0
  192. package/dist/ui/components/OutlineContent.js +147 -0
  193. package/dist/ui/components/OutlineContent.js.map +1 -0
  194. package/dist/ui/components/RightPanel.d.ts +52 -0
  195. package/dist/ui/components/RightPanel.d.ts.map +1 -0
  196. package/dist/ui/components/RightPanel.js +142 -0
  197. package/dist/ui/components/RightPanel.js.map +1 -0
  198. package/dist/ui/components/Viewport.d.ts +70 -0
  199. package/dist/ui/components/Viewport.d.ts.map +1 -0
  200. package/dist/ui/components/Viewport.js +173 -0
  201. package/dist/ui/components/Viewport.js.map +1 -0
  202. package/dist/ui/components/index.d.ts +11 -0
  203. package/dist/ui/components/index.d.ts.map +1 -0
  204. package/dist/ui/components/index.js +10 -0
  205. package/dist/ui/components/index.js.map +1 -0
  206. package/dist/ui/framework/component.d.ts +68 -0
  207. package/dist/ui/framework/component.d.ts.map +1 -0
  208. package/dist/ui/framework/component.js +87 -0
  209. package/dist/ui/framework/component.js.map +1 -0
  210. package/dist/ui/framework/dom.d.ts +19 -0
  211. package/dist/ui/framework/dom.d.ts.map +1 -0
  212. package/dist/ui/framework/dom.js +29 -0
  213. package/dist/ui/framework/dom.js.map +1 -0
  214. package/dist/ui/framework/events.d.ts +18 -0
  215. package/dist/ui/framework/events.d.ts.map +1 -0
  216. package/dist/ui/framework/events.js +23 -0
  217. package/dist/ui/framework/events.js.map +1 -0
  218. package/dist/ui/framework/index.d.ts +15 -0
  219. package/dist/ui/framework/index.d.ts.map +1 -0
  220. package/dist/ui/framework/index.js +15 -0
  221. package/dist/ui/framework/index.js.map +1 -0
  222. package/dist/ui/framework/selectors.d.ts +51 -0
  223. package/dist/ui/framework/selectors.d.ts.map +1 -0
  224. package/dist/ui/framework/selectors.js +30 -0
  225. package/dist/ui/framework/selectors.js.map +1 -0
  226. package/dist/ui/framework/store.d.ts +37 -0
  227. package/dist/ui/framework/store.d.ts.map +1 -0
  228. package/dist/ui/framework/store.js +54 -0
  229. package/dist/ui/framework/store.js.map +1 -0
  230. package/dist/ui/icons/icons.d.ts +43 -0
  231. package/dist/ui/icons/icons.d.ts.map +1 -0
  232. package/dist/ui/icons/icons.js +46 -0
  233. package/dist/ui/icons/icons.js.map +1 -0
  234. package/dist/ui/icons/index.d.ts +11 -0
  235. package/dist/ui/icons/index.d.ts.map +1 -0
  236. package/dist/ui/icons/index.js +18 -0
  237. package/dist/ui/icons/index.js.map +1 -0
  238. package/dist/ui/index.d.ts +7 -0
  239. package/dist/ui/index.d.ts.map +1 -0
  240. package/dist/ui/index.js +9 -0
  241. package/dist/ui/index.js.map +1 -0
  242. package/dist/ui/styles/base.css.d.ts +5 -0
  243. package/dist/ui/styles/base.css.d.ts.map +1 -0
  244. package/dist/ui/styles/base.css.js +49 -0
  245. package/dist/ui/styles/base.css.js.map +1 -0
  246. package/dist/ui/styles/floating-bar.css.d.ts +5 -0
  247. package/dist/ui/styles/floating-bar.css.d.ts.map +1 -0
  248. package/dist/ui/styles/floating-bar.css.js +417 -0
  249. package/dist/ui/styles/floating-bar.css.js.map +1 -0
  250. package/dist/ui/styles/header.css.d.ts +5 -0
  251. package/dist/ui/styles/header.css.d.ts.map +1 -0
  252. package/dist/ui/styles/header.css.js +49 -0
  253. package/dist/ui/styles/header.css.js.map +1 -0
  254. package/dist/ui/styles/index.d.ts +21 -0
  255. package/dist/ui/styles/index.d.ts.map +1 -0
  256. package/dist/ui/styles/index.js +48 -0
  257. package/dist/ui/styles/index.js.map +1 -0
  258. package/dist/ui/styles/panels.css.d.ts +5 -0
  259. package/dist/ui/styles/panels.css.d.ts.map +1 -0
  260. package/dist/ui/styles/panels.css.js +446 -0
  261. package/dist/ui/styles/panels.css.js.map +1 -0
  262. package/dist/ui/styles/responsive.css.d.ts +5 -0
  263. package/dist/ui/styles/responsive.css.d.ts.map +1 -0
  264. package/dist/ui/styles/responsive.css.js +201 -0
  265. package/dist/ui/styles/responsive.css.js.map +1 -0
  266. package/dist/ui/styles/variables.css.d.ts +6 -0
  267. package/dist/ui/styles/variables.css.d.ts.map +1 -0
  268. package/dist/ui/styles/variables.css.js +75 -0
  269. package/dist/ui/styles/variables.css.js.map +1 -0
  270. package/dist/ui/styles/viewport.css.d.ts +5 -0
  271. package/dist/ui/styles/viewport.css.d.ts.map +1 -0
  272. package/dist/ui/styles/viewport.css.js +87 -0
  273. package/dist/ui/styles/viewport.css.js.map +1 -0
  274. package/dist/ui/viewer/actions.d.ts +103 -0
  275. package/dist/ui/viewer/actions.d.ts.map +1 -0
  276. package/dist/ui/viewer/actions.js +2 -0
  277. package/dist/ui/viewer/actions.js.map +1 -0
  278. package/dist/ui/viewer/annotation/LinkRenderer.d.ts +9 -0
  279. package/dist/ui/viewer/annotation/LinkRenderer.d.ts.map +1 -0
  280. package/dist/ui/viewer/annotation/LinkRenderer.js +17 -0
  281. package/dist/ui/viewer/annotation/LinkRenderer.js.map +1 -0
  282. package/dist/ui/viewer/annotation/MarkupRenderer.d.ts +21 -0
  283. package/dist/ui/viewer/annotation/MarkupRenderer.d.ts.map +1 -0
  284. package/dist/ui/viewer/annotation/MarkupRenderer.js +138 -0
  285. package/dist/ui/viewer/annotation/MarkupRenderer.js.map +1 -0
  286. package/dist/ui/viewer/annotation/ShapeRenderer.d.ts +33 -0
  287. package/dist/ui/viewer/annotation/ShapeRenderer.d.ts.map +1 -0
  288. package/dist/ui/viewer/annotation/ShapeRenderer.js +378 -0
  289. package/dist/ui/viewer/annotation/ShapeRenderer.js.map +1 -0
  290. package/dist/ui/viewer/annotation/TextRenderer.d.ts +23 -0
  291. package/dist/ui/viewer/annotation/TextRenderer.d.ts.map +1 -0
  292. package/dist/ui/viewer/annotation/TextRenderer.js +196 -0
  293. package/dist/ui/viewer/annotation/TextRenderer.js.map +1 -0
  294. package/dist/ui/viewer/annotation/index.d.ts +8 -0
  295. package/dist/ui/viewer/annotation/index.d.ts.map +1 -0
  296. package/dist/ui/viewer/annotation/index.js +8 -0
  297. package/dist/ui/viewer/annotation/index.js.map +1 -0
  298. package/dist/ui/viewer/annotation/render.d.ts +24 -0
  299. package/dist/ui/viewer/annotation/render.d.ts.map +1 -0
  300. package/dist/ui/viewer/annotation/render.js +184 -0
  301. package/dist/ui/viewer/annotation/render.js.map +1 -0
  302. package/dist/ui/viewer/annotation/types.d.ts +239 -0
  303. package/dist/ui/viewer/annotation/types.d.ts.map +1 -0
  304. package/dist/ui/viewer/annotation/types.js +7 -0
  305. package/dist/ui/viewer/annotation/types.js.map +1 -0
  306. package/dist/ui/viewer/annotation/utils.d.ts +37 -0
  307. package/dist/ui/viewer/annotation/utils.d.ts.map +1 -0
  308. package/dist/ui/viewer/annotation/utils.js +82 -0
  309. package/dist/ui/viewer/annotation/utils.js.map +1 -0
  310. package/dist/ui/viewer/components/AnnotationPanel.d.ts +19 -0
  311. package/dist/ui/viewer/components/AnnotationPanel.d.ts.map +1 -0
  312. package/dist/ui/viewer/components/AnnotationPanel.js +284 -0
  313. package/dist/ui/viewer/components/AnnotationPanel.js.map +1 -0
  314. package/dist/ui/viewer/components/FloatingToolbar.d.ts +9 -0
  315. package/dist/ui/viewer/components/FloatingToolbar.d.ts.map +1 -0
  316. package/dist/ui/viewer/components/FloatingToolbar.js +305 -0
  317. package/dist/ui/viewer/components/FloatingToolbar.js.map +1 -0
  318. package/dist/ui/viewer/components/LeftPanel.d.ts +10 -0
  319. package/dist/ui/viewer/components/LeftPanel.d.ts.map +1 -0
  320. package/dist/ui/viewer/components/LeftPanel.js +165 -0
  321. package/dist/ui/viewer/components/LeftPanel.js.map +1 -0
  322. package/dist/ui/viewer/components/OutlinePanel.d.ts +10 -0
  323. package/dist/ui/viewer/components/OutlinePanel.d.ts.map +1 -0
  324. package/dist/ui/viewer/components/OutlinePanel.js +169 -0
  325. package/dist/ui/viewer/components/OutlinePanel.js.map +1 -0
  326. package/dist/ui/viewer/components/RightPanel.d.ts +9 -0
  327. package/dist/ui/viewer/components/RightPanel.d.ts.map +1 -0
  328. package/dist/ui/viewer/components/RightPanel.js +102 -0
  329. package/dist/ui/viewer/components/RightPanel.js.map +1 -0
  330. package/dist/ui/viewer/components/Spread.d.ts +41 -0
  331. package/dist/ui/viewer/components/Spread.d.ts.map +1 -0
  332. package/dist/ui/viewer/components/Spread.js +278 -0
  333. package/dist/ui/viewer/components/Spread.js.map +1 -0
  334. package/dist/ui/viewer/components/ThumbnailPanel.d.ts +11 -0
  335. package/dist/ui/viewer/components/ThumbnailPanel.d.ts.map +1 -0
  336. package/dist/ui/viewer/components/ThumbnailPanel.js +206 -0
  337. package/dist/ui/viewer/components/ThumbnailPanel.js.map +1 -0
  338. package/dist/ui/viewer/components/Toolbar.d.ts +9 -0
  339. package/dist/ui/viewer/components/Toolbar.d.ts.map +1 -0
  340. package/dist/ui/viewer/components/Toolbar.js +93 -0
  341. package/dist/ui/viewer/components/Toolbar.js.map +1 -0
  342. package/dist/ui/viewer/components/ViewModeMenu.d.ts +9 -0
  343. package/dist/ui/viewer/components/ViewModeMenu.d.ts.map +1 -0
  344. package/dist/ui/viewer/components/ViewModeMenu.js +169 -0
  345. package/dist/ui/viewer/components/ViewModeMenu.js.map +1 -0
  346. package/dist/ui/viewer/components/Viewport.d.ts +10 -0
  347. package/dist/ui/viewer/components/Viewport.d.ts.map +1 -0
  348. package/dist/ui/viewer/components/Viewport.js +793 -0
  349. package/dist/ui/viewer/components/Viewport.js.map +1 -0
  350. package/dist/ui/viewer/effects.d.ts +9 -0
  351. package/dist/ui/viewer/effects.d.ts.map +1 -0
  352. package/dist/ui/viewer/effects.js +179 -0
  353. package/dist/ui/viewer/effects.js.map +1 -0
  354. package/dist/ui/viewer/icons.d.ts +32 -0
  355. package/dist/ui/viewer/icons.d.ts.map +1 -0
  356. package/dist/ui/viewer/icons.js +44 -0
  357. package/dist/ui/viewer/icons.js.map +1 -0
  358. package/dist/ui/viewer/index.d.ts +6 -0
  359. package/dist/ui/viewer/index.d.ts.map +1 -0
  360. package/dist/ui/viewer/index.js +6 -0
  361. package/dist/ui/viewer/index.js.map +1 -0
  362. package/dist/ui/viewer/layout/index.d.ts +3 -0
  363. package/dist/ui/viewer/layout/index.d.ts.map +1 -0
  364. package/dist/ui/viewer/layout/index.js +3 -0
  365. package/dist/ui/viewer/layout/index.js.map +1 -0
  366. package/dist/ui/viewer/layout/pixelAlign.d.ts +7 -0
  367. package/dist/ui/viewer/layout/pixelAlign.d.ts.map +1 -0
  368. package/dist/ui/viewer/layout/pixelAlign.js +22 -0
  369. package/dist/ui/viewer/layout/pixelAlign.js.map +1 -0
  370. package/dist/ui/viewer/layout/spreadLayout.d.ts +93 -0
  371. package/dist/ui/viewer/layout/spreadLayout.d.ts.map +1 -0
  372. package/dist/ui/viewer/layout/spreadLayout.js +303 -0
  373. package/dist/ui/viewer/layout/spreadLayout.js.map +1 -0
  374. package/dist/ui/viewer/navigation.d.ts +80 -0
  375. package/dist/ui/viewer/navigation.d.ts.map +1 -0
  376. package/dist/ui/viewer/navigation.js +59 -0
  377. package/dist/ui/viewer/navigation.js.map +1 -0
  378. package/dist/ui/viewer/reducer.d.ts +4 -0
  379. package/dist/ui/viewer/reducer.d.ts.map +1 -0
  380. package/dist/ui/viewer/reducer.js +229 -0
  381. package/dist/ui/viewer/reducer.js.map +1 -0
  382. package/dist/ui/viewer/rendering/RenderManager.d.ts +76 -0
  383. package/dist/ui/viewer/rendering/RenderManager.d.ts.map +1 -0
  384. package/dist/ui/viewer/rendering/RenderManager.js +236 -0
  385. package/dist/ui/viewer/rendering/RenderManager.js.map +1 -0
  386. package/dist/ui/viewer/shell.d.ts +29 -0
  387. package/dist/ui/viewer/shell.d.ts.map +1 -0
  388. package/dist/ui/viewer/shell.js +70 -0
  389. package/dist/ui/viewer/shell.js.map +1 -0
  390. package/dist/ui/viewer/state.d.ts +72 -0
  391. package/dist/ui/viewer/state.d.ts.map +1 -0
  392. package/dist/ui/viewer/state.js +47 -0
  393. package/dist/ui/viewer/state.js.map +1 -0
  394. package/dist/view/LayoutCalculator.d.ts +42 -0
  395. package/dist/view/LayoutCalculator.d.ts.map +1 -0
  396. package/dist/view/LayoutCalculator.js +180 -0
  397. package/dist/view/LayoutCalculator.js.map +1 -0
  398. package/dist/view/TransitionCoordinator.d.ts +11 -0
  399. package/dist/view/TransitionCoordinator.d.ts.map +1 -0
  400. package/dist/view/TransitionCoordinator.js +22 -0
  401. package/dist/view/TransitionCoordinator.js.map +1 -0
  402. package/dist/view/ViewState.d.ts +46 -0
  403. package/dist/view/ViewState.d.ts.map +1 -0
  404. package/dist/view/ViewState.js +109 -0
  405. package/dist/view/ViewState.js.map +1 -0
  406. package/dist/view/index.d.ts +7 -0
  407. package/dist/view/index.d.ts.map +1 -0
  408. package/dist/view/index.js +4 -0
  409. package/dist/view/index.js.map +1 -0
  410. package/dist/wasm/udoc.d.ts +202 -0
  411. package/dist/wasm/udoc.js +929 -0
  412. package/dist/wasm/udoc_bg.wasm +0 -0
  413. package/dist/wasm/udoc_bg.wasm.d.ts +28 -0
  414. package/dist/worker/WorkerClient.d.ts +103 -0
  415. package/dist/worker/WorkerClient.d.ts.map +1 -0
  416. package/dist/worker/WorkerClient.js +182 -0
  417. package/dist/worker/WorkerClient.js.map +1 -0
  418. package/dist/worker/index.d.ts +4 -0
  419. package/dist/worker/index.d.ts.map +1 -0
  420. package/dist/worker/index.js +2 -0
  421. package/dist/worker/index.js.map +1 -0
  422. package/dist/worker/types.d.ts +81 -0
  423. package/dist/worker/types.d.ts.map +1 -0
  424. package/dist/worker/types.js +6 -0
  425. package/dist/worker/types.js.map +1 -0
  426. package/dist/worker/worker.d.ts +191 -0
  427. package/dist/worker/worker.d.ts.map +1 -0
  428. package/dist/worker/worker.js +127 -0
  429. package/dist/worker/worker.js.map +1 -0
  430. package/dist/worker.d.ts +2 -0
  431. package/dist/worker.d.ts.map +1 -0
  432. package/dist/worker.js +205 -0
  433. package/dist/worker.js.map +1 -0
  434. package/package.json +32 -0
@@ -0,0 +1,196 @@
1
+ import { colorToRgb, scaleBounds, createSvgOverlay, createSvgElement } from "./utils";
2
+ /** Fixed icon size for sticky note annotations (in CSS pixels). */
3
+ const STICKY_NOTE_ICON_SIZE = 18;
4
+ /** Default sticky note color (yellow-orange). */
5
+ const DEFAULT_STICKY_NOTE_COLOR = { r: 1, g: 0.8, b: 0.2 };
6
+ /**
7
+ * Create SVG icon for sticky note with specified color.
8
+ */
9
+ function createStickyNoteSvg(color) {
10
+ const r = Math.round(color.r * 255);
11
+ const g = Math.round(color.g * 255);
12
+ const b = Math.round(color.b * 255);
13
+ const fill = `rgb(${r}, ${g}, ${b})`;
14
+ // Darker shade for stroke
15
+ const strokeR = Math.round(color.r * 180);
16
+ const strokeG = Math.round(color.g * 180);
17
+ const strokeB = Math.round(color.b * 180);
18
+ const stroke = `rgb(${strokeR}, ${strokeG}, ${strokeB})`;
19
+ return `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
20
+ <path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z" fill="${fill}" stroke="${stroke}" stroke-width="1"/>
21
+ </svg>`;
22
+ }
23
+ /**
24
+ * Render a text (sticky note) annotation.
25
+ */
26
+ export function renderText(layer, annotation, scale, onShowPopup) {
27
+ const el = document.createElement("div");
28
+ el.className = "udoc-annotation udoc-annotation--text";
29
+ // Position at bottom-left of bounds (PDF anchor point), with fixed icon size
30
+ el.style.position = "absolute";
31
+ el.style.left = `${annotation.bounds.x * scale}px`;
32
+ el.style.top = `${(annotation.bounds.y + annotation.bounds.height) * scale - STICKY_NOTE_ICON_SIZE}px`;
33
+ el.style.width = `${STICKY_NOTE_ICON_SIZE}px`;
34
+ el.style.height = `${STICKY_NOTE_ICON_SIZE}px`;
35
+ el.style.pointerEvents = "auto";
36
+ el.style.cursor = "pointer";
37
+ // Create SVG with annotation color or default
38
+ const color = annotation.color || DEFAULT_STICKY_NOTE_COLOR;
39
+ el.innerHTML = createStickyNoteSvg(color);
40
+ // Store annotation data for popup
41
+ el.dataset.annotationType = "text";
42
+ el.dataset.annotation = JSON.stringify({
43
+ contents: annotation.contents,
44
+ metadata: annotation.metadata
45
+ });
46
+ // Set tooltip as fallback
47
+ const contents = annotation.metadata?.contents || annotation.contents;
48
+ if (contents) {
49
+ el.title = contents;
50
+ }
51
+ // Add click handler for popup
52
+ if (annotation.metadata && onShowPopup) {
53
+ const colorStr = colorToRgb(color, "rgb(255, 208, 0)");
54
+ el.addEventListener("click", (e) => {
55
+ e.stopPropagation();
56
+ onShowPopup(el, annotation.metadata, colorStr);
57
+ });
58
+ }
59
+ layer.appendChild(el);
60
+ return el;
61
+ }
62
+ /**
63
+ * Render a free text annotation.
64
+ */
65
+ export function renderFreeText(layer, annotation, scale) {
66
+ const scaled = scaleBounds(annotation.bounds, scale);
67
+ const color = colorToRgb(annotation.color, "rgb(0, 0, 0)");
68
+ const borderColor = colorToRgb(annotation.borderColor, "transparent");
69
+ const el = document.createElement("div");
70
+ el.className = "udoc-annotation udoc-annotation--freetext";
71
+ el.style.position = "absolute";
72
+ el.style.left = `${scaled.x}px`;
73
+ el.style.top = `${scaled.y}px`;
74
+ el.style.width = `${scaled.width}px`;
75
+ el.style.height = `${scaled.height}px`;
76
+ el.style.color = color;
77
+ el.style.border = `1px solid ${borderColor}`;
78
+ el.style.fontSize = `${12 * (scale / 96 * 72)}px`; // Approximate font scaling
79
+ el.style.fontFamily = "Helvetica, Arial, sans-serif";
80
+ el.style.textAlign = annotation.justification || "left";
81
+ el.style.overflow = "hidden";
82
+ el.style.wordWrap = "break-word";
83
+ el.style.pointerEvents = "none";
84
+ el.style.padding = "2px";
85
+ el.style.boxSizing = "border-box";
86
+ if (annotation.contents) {
87
+ el.textContent = annotation.contents;
88
+ }
89
+ // Render callout line if present
90
+ if (annotation.calloutLine && annotation.calloutLine.length >= 2) {
91
+ const svg = createSvgOverlay();
92
+ const lineColor = colorToRgb(annotation.borderColor, "rgb(0, 0, 0)");
93
+ const strokeWidth = Math.max(1, scale);
94
+ const pathData = annotation.calloutLine
95
+ .map((point, i) => {
96
+ const x = point.x * scale;
97
+ const y = point.y * scale;
98
+ return `${i === 0 ? "M" : "L"} ${x} ${y}`;
99
+ })
100
+ .join(" ");
101
+ const path = createSvgElement("path");
102
+ path.setAttribute("d", pathData);
103
+ path.setAttribute("stroke", lineColor);
104
+ path.setAttribute("stroke-width", String(strokeWidth));
105
+ path.setAttribute("fill", "none");
106
+ svg.appendChild(path);
107
+ layer.appendChild(svg);
108
+ }
109
+ layer.appendChild(el);
110
+ return el;
111
+ }
112
+ /**
113
+ * Render a stamp annotation.
114
+ */
115
+ export function renderStamp(layer, annotation, scale) {
116
+ const scaled = scaleBounds(annotation.bounds, scale);
117
+ const color = colorToRgb(annotation.color, "rgb(255, 0, 0)");
118
+ const el = document.createElement("div");
119
+ el.className = "udoc-annotation udoc-annotation--stamp";
120
+ el.style.position = "absolute";
121
+ el.style.left = `${scaled.x}px`;
122
+ el.style.top = `${scaled.y}px`;
123
+ el.style.width = `${scaled.width}px`;
124
+ el.style.height = `${scaled.height}px`;
125
+ el.style.display = "flex";
126
+ el.style.alignItems = "center";
127
+ el.style.justifyContent = "center";
128
+ el.style.pointerEvents = "none";
129
+ // Only show text for standard stamps without custom appearance
130
+ if (!annotation.hasCustomAppearance && annotation.name) {
131
+ // Estimate zoom factor from scale (scale ≈ 1.333 * zoom at 96 DPI)
132
+ const zoomFactor = scale / 1.333;
133
+ const label = document.createElement("span");
134
+ label.style.color = color;
135
+ label.style.fontSize = `${Math.min(scaled.height * 0.4, 16 * zoomFactor)}px`;
136
+ label.style.fontWeight = "bold";
137
+ label.style.fontFamily = "Helvetica, Arial, sans-serif";
138
+ label.style.textTransform = "uppercase";
139
+ label.style.border = `2px solid ${color}`;
140
+ label.style.padding = `${2 * zoomFactor}px ${4 * zoomFactor}px`;
141
+ label.style.transform = "rotate(-15deg)";
142
+ label.style.whiteSpace = "nowrap";
143
+ label.textContent = annotation.name;
144
+ el.appendChild(label);
145
+ }
146
+ layer.appendChild(el);
147
+ return el;
148
+ }
149
+ /** Fixed caret icon size (in CSS pixels at 100% zoom) */
150
+ const CARET_ICON_SIZE = 12;
151
+ /**
152
+ * Render a caret annotation.
153
+ */
154
+ export function renderCaret(layer, annotation, scale) {
155
+ const svg = createSvgOverlay();
156
+ const color = colorToRgb(annotation.color, "rgb(0, 128, 255)");
157
+ const opacity = annotation.opacity ?? 1;
158
+ const scaled = scaleBounds(annotation.bounds, scale);
159
+ const g = createSvgElement("g");
160
+ g.setAttribute("opacity", String(opacity));
161
+ // Use fixed icon size scaled by zoom (scale already includes zoom factor)
162
+ // At 100% zoom with 96 DPI, scale is approximately 1.333
163
+ const zoomFactor = scale / 1.333; // Approximate zoom factor
164
+ const iconSize = Math.max(CARET_ICON_SIZE * zoomFactor, scaled.height);
165
+ // Draw caret symbol (^) or paragraph marker
166
+ if (annotation.symbol === "P") {
167
+ // Paragraph symbol (pilcrow)
168
+ const text = createSvgElement("text");
169
+ text.setAttribute("x", String(scaled.x + scaled.width / 2));
170
+ text.setAttribute("y", String(scaled.y + scaled.height * 0.8));
171
+ text.setAttribute("fill", color);
172
+ text.setAttribute("font-size", String(iconSize));
173
+ text.setAttribute("text-anchor", "middle");
174
+ text.textContent = "\u00B6"; // Pilcrow sign
175
+ g.appendChild(text);
176
+ }
177
+ else {
178
+ // Default caret (^) - draw as an inverted V
179
+ const caretHeight = Math.min(scaled.height, iconSize);
180
+ const caretWidth = caretHeight * 0.8;
181
+ const centerX = scaled.x + scaled.width / 2;
182
+ const bottomY = scaled.y + scaled.height;
183
+ const path = createSvgElement("path");
184
+ path.setAttribute("d", `M ${centerX - caretWidth / 2} ${bottomY} L ${centerX} ${bottomY - caretHeight} L ${centerX + caretWidth / 2} ${bottomY}`);
185
+ path.setAttribute("stroke", color);
186
+ path.setAttribute("stroke-width", String(Math.max(2, 2 * zoomFactor)));
187
+ path.setAttribute("fill", "none");
188
+ path.setAttribute("stroke-linecap", "round");
189
+ path.setAttribute("stroke-linejoin", "round");
190
+ g.appendChild(path);
191
+ }
192
+ svg.appendChild(g);
193
+ layer.appendChild(svg);
194
+ return svg;
195
+ }
196
+ //# sourceMappingURL=TextRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextRenderer.js","sourceRoot":"","sources":["../../../../src/ui/viewer/annotation/TextRenderer.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEtF,mEAAmE;AACnE,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC,iDAAiD;AACjD,MAAM,yBAAyB,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC;AAS3D;;GAEG;AACH,SAAS,mBAAmB,CAAC,KAA0C;IACnE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACpC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;IACrC,0BAA0B;IAC1B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC1C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAG,OAAO,OAAO,KAAK,OAAO,KAAK,OAAO,GAAG,CAAC;IAEzD,OAAO;0GAC+F,IAAI,aA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AAC;QACF,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACnC,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,YAAY,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;QAC7C,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAED,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IACnB,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACvB,OAAO,GAAG,CAAC;AACf,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Annotation module - types, utilities, and renderers.
3
+ */
4
+ export type { Annotation, AnnotationType, Rect, Point, Quad, AnnotationColor, MarkupMetadata, Destination, DestinationDisplay, LinkAction, LinkAnnotation, HighlightAnnotation, UnderlineAnnotation, StrikeOutAnnotation, SquigglyAnnotation, TextAnnotation, FreeTextAnnotation, StampAnnotation, CaretAnnotation, LineAnnotation, SquareAnnotation, CircleAnnotation, PolygonAnnotation, PolyLineAnnotation, InkAnnotation, RedactAnnotation, TextAnnotationIcon, TextJustification, CaretSymbol, LineEnding, BorderStyle } from "./types";
5
+ export { colorToRgba, colorToRgb, scalePoint, scaleBounds, applyBoundsStyle, createSvgOverlay, createSvgElement, boundsMatch } from "./utils";
6
+ export { renderAnnotation, renderAnnotationsToLayer, closeAnnotationPopup, showAnnotationPopup } from "./render";
7
+ export type { ShowPopupCallback } from "./render";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/viewer/annotation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EACR,UAAU,EACV,cAAc,EACd,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,eAAe,EACf,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,UAAU,EAEV,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAEhB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,UAAU,EACV,WAAW,EACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACH,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACd,MAAM,SAAS,CAAC;AAGjB,OAAO,EACH,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACtB,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Annotation module - types, utilities, and renderers.
3
+ */
4
+ // Utilities
5
+ export { colorToRgba, colorToRgb, scalePoint, scaleBounds, applyBoundsStyle, createSvgOverlay, createSvgElement, boundsMatch } from "./utils";
6
+ // Render functions
7
+ export { renderAnnotation, renderAnnotationsToLayer, closeAnnotationPopup, showAnnotationPopup } from "./render";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ui/viewer/annotation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuCH,YAAY;AACZ,OAAO,EACH,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACd,MAAM,SAAS,CAAC;AAEjB,mBAAmB;AACnB,OAAO,EACH,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EACtB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Main annotation rendering module.
3
+ *
4
+ * Coordinates all specialized renderers and provides a unified API.
5
+ */
6
+ import type { Annotation, Rect, MarkupMetadata } from "./types";
7
+ import * as TextRenderer from "./TextRenderer";
8
+ export type { ShowPopupCallback } from "./TextRenderer";
9
+ /**
10
+ * Render a single annotation element.
11
+ */
12
+ export declare function renderAnnotation(layer: HTMLElement, annotation: Annotation, scale: number, onShowPopup?: TextRenderer.ShowPopupCallback): Element | null;
13
+ /**
14
+ * Render all annotations into an annotation layer element.
15
+ */
16
+ export declare function renderAnnotationsToLayer(layer: HTMLDivElement, annotations: Annotation[], scale: number, highlightBounds?: Rect | null, onShowPopup?: TextRenderer.ShowPopupCallback): void;
17
+ /** Close the currently active popup. */
18
+ export declare function closeAnnotationPopup(): void;
19
+ /** Show popup for an annotation. */
20
+ export declare function showAnnotationPopup(annotation: {
21
+ metadata?: MarkupMetadata;
22
+ contents?: string;
23
+ }, anchorEl: HTMLElement, container: HTMLElement): void;
24
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/ui/viewer/annotation/render.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACR,UAAU,EAiBV,IAAI,EACJ,cAAc,EACjB,MAAM,SAAS,CAAC;AAIjB,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAG/C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAiCxD;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,YAAY,CAAC,iBAAiB,GAC7C,OAAO,GAAG,IAAI,CA8ChB;AAiBD;;GAEG;AACH,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,UAAU,EAAE,EACzB,KAAK,EAAE,MAAM,EACb,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,EAC7B,WAAW,CAAC,EAAE,YAAY,CAAC,iBAAiB,GAC7C,IAAI,CA2BN;AASD,wCAAwC;AACxC,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C;AAED,oCAAoC;AACpC,wBAAgB,mBAAmB,CAC/B,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5D,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAE,WAAW,GACvB,IAAI,CAgEN"}
@@ -0,0 +1,184 @@
1
+ import { boundsMatch, applyBoundsStyle } from "./utils";
2
+ import * as MarkupRenderer from "./MarkupRenderer";
3
+ import * as LinkRenderer from "./LinkRenderer";
4
+ import * as TextRenderer from "./TextRenderer";
5
+ import * as ShapeRenderer from "./ShapeRenderer";
6
+ /** Check if annotation type uses full-layer SVG overlay or inset: 0 container. */
7
+ function isSvgBasedAnnotation(type) {
8
+ // These annotation types render as full-layer SVG overlays
9
+ return (type === "caret" ||
10
+ type === "line" ||
11
+ type === "square" ||
12
+ type === "circle" ||
13
+ type === "polygon" ||
14
+ type === "polyLine" ||
15
+ type === "ink" ||
16
+ type === "redact");
17
+ }
18
+ /** Check if annotation type uses full-layer container (inset: 0). */
19
+ function isFullLayerAnnotation(type) {
20
+ return type === "highlight" || type === "underline" || type === "strikeOut" || type === "squiggly";
21
+ }
22
+ /**
23
+ * Create a highlight indicator element for an annotation.
24
+ * Used for full-layer annotations where we can't just add a class to the container.
25
+ */
26
+ function createHighlightIndicator(bounds, scale) {
27
+ const el = document.createElement("div");
28
+ el.className = "udoc-annotation-highlight-indicator";
29
+ applyBoundsStyle(el, bounds, scale);
30
+ return el;
31
+ }
32
+ /**
33
+ * Render a single annotation element.
34
+ */
35
+ export function renderAnnotation(layer, annotation, scale, onShowPopup) {
36
+ switch (annotation.type) {
37
+ // Link
38
+ case "link":
39
+ return LinkRenderer.renderLink(layer, annotation, scale);
40
+ // Markup annotations
41
+ case "highlight":
42
+ return MarkupRenderer.renderHighlight(layer, annotation, scale);
43
+ case "underline":
44
+ return MarkupRenderer.renderUnderline(layer, annotation, scale);
45
+ case "strikeOut":
46
+ return MarkupRenderer.renderStrikeOut(layer, annotation, scale);
47
+ case "squiggly":
48
+ return MarkupRenderer.renderSquiggly(layer, annotation, scale);
49
+ // Text annotations
50
+ case "text":
51
+ return TextRenderer.renderText(layer, annotation, scale, onShowPopup);
52
+ case "freeText":
53
+ return TextRenderer.renderFreeText(layer, annotation, scale);
54
+ case "stamp":
55
+ return TextRenderer.renderStamp(layer, annotation, scale);
56
+ case "caret":
57
+ return TextRenderer.renderCaret(layer, annotation, scale);
58
+ // Shape annotations
59
+ case "line":
60
+ return ShapeRenderer.renderLine(layer, annotation, scale);
61
+ case "square":
62
+ return ShapeRenderer.renderSquare(layer, annotation, scale);
63
+ case "circle":
64
+ return ShapeRenderer.renderCircle(layer, annotation, scale);
65
+ case "polygon":
66
+ return ShapeRenderer.renderPolygon(layer, annotation, scale);
67
+ case "polyLine":
68
+ return ShapeRenderer.renderPolyLine(layer, annotation, scale);
69
+ case "ink":
70
+ return ShapeRenderer.renderInk(layer, annotation, scale);
71
+ case "redact":
72
+ return ShapeRenderer.renderRedact(layer, annotation, scale);
73
+ default:
74
+ // Unknown annotation type - create generic placeholder
75
+ return createGenericAnnotation(layer, annotation, scale);
76
+ }
77
+ }
78
+ /**
79
+ * Create a generic placeholder for unknown annotation types.
80
+ */
81
+ function createGenericAnnotation(layer, annotation, scale) {
82
+ const el = document.createElement("div");
83
+ el.className = `udoc-annotation udoc-annotation--${annotation.type}`;
84
+ applyBoundsStyle(el, annotation.bounds, scale);
85
+ layer.appendChild(el);
86
+ return el;
87
+ }
88
+ /**
89
+ * Render all annotations into an annotation layer element.
90
+ */
91
+ export function renderAnnotationsToLayer(layer, annotations, scale, highlightBounds, onShowPopup) {
92
+ // Skip if no annotations to render
93
+ if (annotations.length === 0) {
94
+ if (layer.childElementCount > 0) {
95
+ layer.innerHTML = "";
96
+ }
97
+ return;
98
+ }
99
+ layer.innerHTML = "";
100
+ for (const annotation of annotations) {
101
+ const el = renderAnnotation(layer, annotation, scale, onShowPopup);
102
+ if (el) {
103
+ // Check if this annotation should be highlighted
104
+ if (highlightBounds && boundsMatch(annotation.bounds, highlightBounds)) {
105
+ if (isFullLayerAnnotation(annotation.type) || isSvgBasedAnnotation(annotation.type)) {
106
+ // For full-layer or SVG-based annotations, add a separate highlight indicator
107
+ const indicator = createHighlightIndicator(annotation.bounds, scale);
108
+ layer.appendChild(indicator);
109
+ }
110
+ else {
111
+ // For bounded annotations, add class directly
112
+ el.classList.add("udoc-annotation--highlighted");
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+ // =============================================================================
119
+ // Popup Management
120
+ // =============================================================================
121
+ /** Currently active popup element (only one popup at a time). */
122
+ let activePopup = null;
123
+ /** Close the currently active popup. */
124
+ export function closeAnnotationPopup() {
125
+ if (activePopup) {
126
+ activePopup.remove();
127
+ activePopup = null;
128
+ }
129
+ }
130
+ /** Show popup for an annotation. */
131
+ export function showAnnotationPopup(annotation, anchorEl, container) {
132
+ // Close any existing popup
133
+ closeAnnotationPopup();
134
+ const contents = annotation.metadata?.contents || annotation.contents;
135
+ if (!contents)
136
+ return;
137
+ const popup = document.createElement("div");
138
+ popup.className = "udoc-annotation-popup";
139
+ // Header with author and close button
140
+ const header = document.createElement("div");
141
+ header.className = "udoc-annotation-popup__header";
142
+ const author = document.createElement("span");
143
+ author.className = "udoc-annotation-popup__author";
144
+ author.textContent = annotation.metadata?.author || "Note";
145
+ header.appendChild(author);
146
+ const closeBtn = document.createElement("button");
147
+ closeBtn.className = "udoc-annotation-popup__close";
148
+ closeBtn.innerHTML = `<svg viewBox="0 0 24 24" fill="currentColor"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>`;
149
+ closeBtn.onclick = (e) => {
150
+ e.stopPropagation();
151
+ closeAnnotationPopup();
152
+ };
153
+ header.appendChild(closeBtn);
154
+ popup.appendChild(header);
155
+ // Content
156
+ const content = document.createElement("div");
157
+ content.className = "udoc-annotation-popup__content";
158
+ content.textContent = contents;
159
+ popup.appendChild(content);
160
+ // Position popup near the anchor element
161
+ const anchorRect = anchorEl.getBoundingClientRect();
162
+ const containerRect = container.getBoundingClientRect();
163
+ // Position to the right of the icon, within the container
164
+ const left = anchorRect.right - containerRect.left + 4;
165
+ const top = anchorRect.top - containerRect.top;
166
+ popup.style.left = `${left}px`;
167
+ popup.style.top = `${top}px`;
168
+ container.appendChild(popup);
169
+ activePopup = popup;
170
+ // Adjust if popup goes outside container
171
+ requestAnimationFrame(() => {
172
+ const popupRect = popup.getBoundingClientRect();
173
+ // Check right edge
174
+ if (popupRect.right > containerRect.right - 8) {
175
+ // Position to the left of the icon instead
176
+ popup.style.left = `${anchorRect.left - containerRect.left - popupRect.width - 4}px`;
177
+ }
178
+ // Check bottom edge
179
+ if (popupRect.bottom > containerRect.bottom - 8) {
180
+ popup.style.top = `${containerRect.bottom - containerRect.top - popupRect.height - 8}px`;
181
+ }
182
+ });
183
+ }
184
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/ui/viewer/annotation/render.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,KAAK,cAAc,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,YAAY,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,YAAY,MAA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