@docmentis/udoc-viewer 0.7.20 → 0.8.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 (386) hide show
  1. package/API-COMPARISON.md +441 -0
  2. package/LICENSE-APACHE +202 -0
  3. package/LICENSE-MIT +21 -0
  4. package/README.md +23 -1220
  5. package/dist/index.d.ts +40 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +52 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/version.d.ts +2 -0
  10. package/dist/version.d.ts.map +1 -0
  11. package/dist/version.js +7 -0
  12. package/dist/version.js.map +1 -0
  13. package/dist/worker/worker-source.d.ts +3 -0
  14. package/dist/worker/worker-source.d.ts.map +1 -0
  15. package/dist/worker/worker-source.js +11 -0
  16. package/dist/worker/worker.d.ts +2 -0
  17. package/dist/worker/worker.d.ts.map +1 -0
  18. package/dist/worker/worker.js +5 -0
  19. package/dist/worker/worker.js.map +1 -0
  20. package/package.json +48 -59
  21. package/dist/package.json +0 -79
  22. package/dist/src/UDocClient.d.ts +0 -730
  23. package/dist/src/UDocClient.d.ts.map +0 -1
  24. package/dist/src/UDocClient.js +0 -649
  25. package/dist/src/UDocClient.js.map +0 -1
  26. package/dist/src/UDocViewer.d.ts +0 -883
  27. package/dist/src/UDocViewer.d.ts.map +0 -1
  28. package/dist/src/UDocViewer.js +0 -2180
  29. package/dist/src/UDocViewer.js.map +0 -1
  30. package/dist/src/fonts.d.ts +0 -47
  31. package/dist/src/fonts.d.ts.map +0 -1
  32. package/dist/src/fonts.js +0 -49
  33. package/dist/src/fonts.js.map +0 -1
  34. package/dist/src/index.d.ts +0 -13
  35. package/dist/src/index.d.ts.map +0 -1
  36. package/dist/src/index.js +0 -5
  37. package/dist/src/index.js.map +0 -1
  38. package/dist/src/meta-url.d.ts +0 -2
  39. package/dist/src/meta-url.d.ts.map +0 -1
  40. package/dist/src/meta-url.js +0 -10
  41. package/dist/src/meta-url.js.map +0 -1
  42. package/dist/src/performance/PerformanceCounter.d.ts +0 -132
  43. package/dist/src/performance/PerformanceCounter.d.ts.map +0 -1
  44. package/dist/src/performance/PerformanceCounter.js +0 -129
  45. package/dist/src/performance/PerformanceCounter.js.map +0 -1
  46. package/dist/src/performance/index.d.ts +0 -2
  47. package/dist/src/performance/index.d.ts.map +0 -1
  48. package/dist/src/performance/index.js +0 -2
  49. package/dist/src/performance/index.js.map +0 -1
  50. package/dist/src/ui/framework/component.d.ts +0 -68
  51. package/dist/src/ui/framework/component.d.ts.map +0 -1
  52. package/dist/src/ui/framework/component.js +0 -97
  53. package/dist/src/ui/framework/component.js.map +0 -1
  54. package/dist/src/ui/framework/dom.d.ts +0 -19
  55. package/dist/src/ui/framework/dom.d.ts.map +0 -1
  56. package/dist/src/ui/framework/dom.js +0 -29
  57. package/dist/src/ui/framework/dom.js.map +0 -1
  58. package/dist/src/ui/framework/events.d.ts +0 -18
  59. package/dist/src/ui/framework/events.d.ts.map +0 -1
  60. package/dist/src/ui/framework/events.js +0 -23
  61. package/dist/src/ui/framework/events.js.map +0 -1
  62. package/dist/src/ui/framework/index.d.ts +0 -15
  63. package/dist/src/ui/framework/index.d.ts.map +0 -1
  64. package/dist/src/ui/framework/index.js +0 -15
  65. package/dist/src/ui/framework/index.js.map +0 -1
  66. package/dist/src/ui/framework/selectors.d.ts +0 -51
  67. package/dist/src/ui/framework/selectors.d.ts.map +0 -1
  68. package/dist/src/ui/framework/selectors.js +0 -28
  69. package/dist/src/ui/framework/selectors.js.map +0 -1
  70. package/dist/src/ui/framework/store.d.ts +0 -44
  71. package/dist/src/ui/framework/store.d.ts.map +0 -1
  72. package/dist/src/ui/framework/store.js +0 -79
  73. package/dist/src/ui/framework/store.js.map +0 -1
  74. package/dist/src/ui/viewer/a11y.d.ts +0 -26
  75. package/dist/src/ui/viewer/a11y.d.ts.map +0 -1
  76. package/dist/src/ui/viewer/a11y.js +0 -116
  77. package/dist/src/ui/viewer/a11y.js.map +0 -1
  78. package/dist/src/ui/viewer/actions.d.ts +0 -308
  79. package/dist/src/ui/viewer/actions.d.ts.map +0 -1
  80. package/dist/src/ui/viewer/actions.js +0 -2
  81. package/dist/src/ui/viewer/actions.js.map +0 -1
  82. package/dist/src/ui/viewer/animation-presets.d.ts +0 -37
  83. package/dist/src/ui/viewer/animation-presets.d.ts.map +0 -1
  84. package/dist/src/ui/viewer/animation-presets.js +0 -123
  85. package/dist/src/ui/viewer/animation-presets.js.map +0 -1
  86. package/dist/src/ui/viewer/animation.d.ts +0 -162
  87. package/dist/src/ui/viewer/animation.d.ts.map +0 -1
  88. package/dist/src/ui/viewer/animation.js +0 -506
  89. package/dist/src/ui/viewer/animation.js.map +0 -1
  90. package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts +0 -9
  91. package/dist/src/ui/viewer/annotation/LinkRenderer.d.ts.map +0 -1
  92. package/dist/src/ui/viewer/annotation/LinkRenderer.js +0 -17
  93. package/dist/src/ui/viewer/annotation/LinkRenderer.js.map +0 -1
  94. package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts +0 -21
  95. package/dist/src/ui/viewer/annotation/MarkupRenderer.d.ts.map +0 -1
  96. package/dist/src/ui/viewer/annotation/MarkupRenderer.js +0 -136
  97. package/dist/src/ui/viewer/annotation/MarkupRenderer.js.map +0 -1
  98. package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts +0 -33
  99. package/dist/src/ui/viewer/annotation/ShapeRenderer.d.ts.map +0 -1
  100. package/dist/src/ui/viewer/annotation/ShapeRenderer.js +0 -379
  101. package/dist/src/ui/viewer/annotation/ShapeRenderer.js.map +0 -1
  102. package/dist/src/ui/viewer/annotation/TextRenderer.d.ts +0 -23
  103. package/dist/src/ui/viewer/annotation/TextRenderer.d.ts.map +0 -1
  104. package/dist/src/ui/viewer/annotation/TextRenderer.js +0 -196
  105. package/dist/src/ui/viewer/annotation/TextRenderer.js.map +0 -1
  106. package/dist/src/ui/viewer/annotation/index.d.ts +0 -9
  107. package/dist/src/ui/viewer/annotation/index.d.ts.map +0 -1
  108. package/dist/src/ui/viewer/annotation/index.js +0 -10
  109. package/dist/src/ui/viewer/annotation/index.js.map +0 -1
  110. package/dist/src/ui/viewer/annotation/propertyUtils.d.ts +0 -29
  111. package/dist/src/ui/viewer/annotation/propertyUtils.d.ts.map +0 -1
  112. package/dist/src/ui/viewer/annotation/propertyUtils.js +0 -151
  113. package/dist/src/ui/viewer/annotation/propertyUtils.js.map +0 -1
  114. package/dist/src/ui/viewer/annotation/render.d.ts +0 -24
  115. package/dist/src/ui/viewer/annotation/render.d.ts.map +0 -1
  116. package/dist/src/ui/viewer/annotation/render.js +0 -191
  117. package/dist/src/ui/viewer/annotation/render.js.map +0 -1
  118. package/dist/src/ui/viewer/annotation/types.d.ts +0 -309
  119. package/dist/src/ui/viewer/annotation/types.d.ts.map +0 -1
  120. package/dist/src/ui/viewer/annotation/types.js +0 -7
  121. package/dist/src/ui/viewer/annotation/types.js.map +0 -1
  122. package/dist/src/ui/viewer/annotation/utils.d.ts +0 -75
  123. package/dist/src/ui/viewer/annotation/utils.d.ts.map +0 -1
  124. package/dist/src/ui/viewer/annotation/utils.js +0 -250
  125. package/dist/src/ui/viewer/annotation/utils.js.map +0 -1
  126. package/dist/src/ui/viewer/components/AnnotationPanel.d.ts +0 -20
  127. package/dist/src/ui/viewer/components/AnnotationPanel.d.ts.map +0 -1
  128. package/dist/src/ui/viewer/components/AnnotationPanel.js +0 -276
  129. package/dist/src/ui/viewer/components/AnnotationPanel.js.map +0 -1
  130. package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts +0 -8
  131. package/dist/src/ui/viewer/components/AttachmentsPanel.d.ts.map +0 -1
  132. package/dist/src/ui/viewer/components/AttachmentsPanel.js +0 -16
  133. package/dist/src/ui/viewer/components/AttachmentsPanel.js.map +0 -1
  134. package/dist/src/ui/viewer/components/BookmarksPanel.d.ts +0 -8
  135. package/dist/src/ui/viewer/components/BookmarksPanel.d.ts.map +0 -1
  136. package/dist/src/ui/viewer/components/BookmarksPanel.js +0 -16
  137. package/dist/src/ui/viewer/components/BookmarksPanel.js.map +0 -1
  138. package/dist/src/ui/viewer/components/Branding.d.ts +0 -49
  139. package/dist/src/ui/viewer/components/Branding.d.ts.map +0 -1
  140. package/dist/src/ui/viewer/components/Branding.js +0 -334
  141. package/dist/src/ui/viewer/components/Branding.js.map +0 -1
  142. package/dist/src/ui/viewer/components/ColorSelect.d.ts +0 -26
  143. package/dist/src/ui/viewer/components/ColorSelect.d.ts.map +0 -1
  144. package/dist/src/ui/viewer/components/ColorSelect.js +0 -120
  145. package/dist/src/ui/viewer/components/ColorSelect.js.map +0 -1
  146. package/dist/src/ui/viewer/components/FloatingToolbar.d.ts +0 -10
  147. package/dist/src/ui/viewer/components/FloatingToolbar.d.ts.map +0 -1
  148. package/dist/src/ui/viewer/components/FloatingToolbar.js +0 -396
  149. package/dist/src/ui/viewer/components/FloatingToolbar.js.map +0 -1
  150. package/dist/src/ui/viewer/components/FontsPanel.d.ts +0 -12
  151. package/dist/src/ui/viewer/components/FontsPanel.d.ts.map +0 -1
  152. package/dist/src/ui/viewer/components/FontsPanel.js +0 -141
  153. package/dist/src/ui/viewer/components/FontsPanel.js.map +0 -1
  154. package/dist/src/ui/viewer/components/LayersPanel.d.ts +0 -12
  155. package/dist/src/ui/viewer/components/LayersPanel.d.ts.map +0 -1
  156. package/dist/src/ui/viewer/components/LayersPanel.js +0 -139
  157. package/dist/src/ui/viewer/components/LayersPanel.js.map +0 -1
  158. package/dist/src/ui/viewer/components/LeftPanel.d.ts +0 -11
  159. package/dist/src/ui/viewer/components/LeftPanel.d.ts.map +0 -1
  160. package/dist/src/ui/viewer/components/LeftPanel.js +0 -296
  161. package/dist/src/ui/viewer/components/LeftPanel.js.map +0 -1
  162. package/dist/src/ui/viewer/components/LoadingOverlay.d.ts +0 -13
  163. package/dist/src/ui/viewer/components/LoadingOverlay.d.ts.map +0 -1
  164. package/dist/src/ui/viewer/components/LoadingOverlay.js +0 -146
  165. package/dist/src/ui/viewer/components/LoadingOverlay.js.map +0 -1
  166. package/dist/src/ui/viewer/components/NumberInput.d.ts +0 -32
  167. package/dist/src/ui/viewer/components/NumberInput.d.ts.map +0 -1
  168. package/dist/src/ui/viewer/components/NumberInput.js +0 -101
  169. package/dist/src/ui/viewer/components/NumberInput.js.map +0 -1
  170. package/dist/src/ui/viewer/components/OutlinePanel.d.ts +0 -11
  171. package/dist/src/ui/viewer/components/OutlinePanel.d.ts.map +0 -1
  172. package/dist/src/ui/viewer/components/OutlinePanel.js +0 -307
  173. package/dist/src/ui/viewer/components/OutlinePanel.js.map +0 -1
  174. package/dist/src/ui/viewer/components/PasswordDialog.d.ts +0 -16
  175. package/dist/src/ui/viewer/components/PasswordDialog.d.ts.map +0 -1
  176. package/dist/src/ui/viewer/components/PasswordDialog.js +0 -179
  177. package/dist/src/ui/viewer/components/PasswordDialog.js.map +0 -1
  178. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts +0 -27
  179. package/dist/src/ui/viewer/components/PermitNoticeOverlay.d.ts.map +0 -1
  180. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js +0 -79
  181. package/dist/src/ui/viewer/components/PermitNoticeOverlay.js.map +0 -1
  182. package/dist/src/ui/viewer/components/PrintDialog.d.ts +0 -34
  183. package/dist/src/ui/viewer/components/PrintDialog.d.ts.map +0 -1
  184. package/dist/src/ui/viewer/components/PrintDialog.js +0 -317
  185. package/dist/src/ui/viewer/components/PrintDialog.js.map +0 -1
  186. package/dist/src/ui/viewer/components/RightPanel.d.ts +0 -10
  187. package/dist/src/ui/viewer/components/RightPanel.d.ts.map +0 -1
  188. package/dist/src/ui/viewer/components/RightPanel.js +0 -154
  189. package/dist/src/ui/viewer/components/RightPanel.js.map +0 -1
  190. package/dist/src/ui/viewer/components/SearchPanel.d.ts +0 -21
  191. package/dist/src/ui/viewer/components/SearchPanel.d.ts.map +0 -1
  192. package/dist/src/ui/viewer/components/SearchPanel.js +0 -323
  193. package/dist/src/ui/viewer/components/SearchPanel.js.map +0 -1
  194. package/dist/src/ui/viewer/components/SheetTabBar.d.ts +0 -9
  195. package/dist/src/ui/viewer/components/SheetTabBar.d.ts.map +0 -1
  196. package/dist/src/ui/viewer/components/SheetTabBar.js +0 -57
  197. package/dist/src/ui/viewer/components/SheetTabBar.js.map +0 -1
  198. package/dist/src/ui/viewer/components/Spread.d.ts +0 -85
  199. package/dist/src/ui/viewer/components/Spread.d.ts.map +0 -1
  200. package/dist/src/ui/viewer/components/Spread.js +0 -749
  201. package/dist/src/ui/viewer/components/Spread.js.map +0 -1
  202. package/dist/src/ui/viewer/components/SubToolbar.d.ts +0 -11
  203. package/dist/src/ui/viewer/components/SubToolbar.d.ts.map +0 -1
  204. package/dist/src/ui/viewer/components/SubToolbar.js +0 -722
  205. package/dist/src/ui/viewer/components/SubToolbar.js.map +0 -1
  206. package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts +0 -12
  207. package/dist/src/ui/viewer/components/ThumbnailPanel.d.ts.map +0 -1
  208. package/dist/src/ui/viewer/components/ThumbnailPanel.js +0 -290
  209. package/dist/src/ui/viewer/components/ThumbnailPanel.js.map +0 -1
  210. package/dist/src/ui/viewer/components/Toolbar.d.ts +0 -12
  211. package/dist/src/ui/viewer/components/Toolbar.d.ts.map +0 -1
  212. package/dist/src/ui/viewer/components/Toolbar.js +0 -761
  213. package/dist/src/ui/viewer/components/Toolbar.js.map +0 -1
  214. package/dist/src/ui/viewer/components/ViewModeMenu.d.ts +0 -10
  215. package/dist/src/ui/viewer/components/ViewModeMenu.d.ts.map +0 -1
  216. package/dist/src/ui/viewer/components/ViewModeMenu.js +0 -206
  217. package/dist/src/ui/viewer/components/ViewModeMenu.js.map +0 -1
  218. package/dist/src/ui/viewer/components/Viewport.d.ts +0 -28
  219. package/dist/src/ui/viewer/components/Viewport.d.ts.map +0 -1
  220. package/dist/src/ui/viewer/components/Viewport.js +0 -1721
  221. package/dist/src/ui/viewer/components/Viewport.js.map +0 -1
  222. package/dist/src/ui/viewer/effects.d.ts +0 -8
  223. package/dist/src/ui/viewer/effects.d.ts.map +0 -1
  224. package/dist/src/ui/viewer/effects.js +0 -452
  225. package/dist/src/ui/viewer/effects.js.map +0 -1
  226. package/dist/src/ui/viewer/i18n/ar.d.ts +0 -3
  227. package/dist/src/ui/viewer/i18n/ar.d.ts.map +0 -1
  228. package/dist/src/ui/viewer/i18n/ar.js +0 -198
  229. package/dist/src/ui/viewer/i18n/ar.js.map +0 -1
  230. package/dist/src/ui/viewer/i18n/de.d.ts +0 -3
  231. package/dist/src/ui/viewer/i18n/de.d.ts.map +0 -1
  232. package/dist/src/ui/viewer/i18n/de.js +0 -198
  233. package/dist/src/ui/viewer/i18n/de.js.map +0 -1
  234. package/dist/src/ui/viewer/i18n/en.d.ts +0 -3
  235. package/dist/src/ui/viewer/i18n/en.d.ts.map +0 -1
  236. package/dist/src/ui/viewer/i18n/en.js +0 -200
  237. package/dist/src/ui/viewer/i18n/en.js.map +0 -1
  238. package/dist/src/ui/viewer/i18n/es.d.ts +0 -3
  239. package/dist/src/ui/viewer/i18n/es.d.ts.map +0 -1
  240. package/dist/src/ui/viewer/i18n/es.js +0 -198
  241. package/dist/src/ui/viewer/i18n/es.js.map +0 -1
  242. package/dist/src/ui/viewer/i18n/fr.d.ts +0 -3
  243. package/dist/src/ui/viewer/i18n/fr.d.ts.map +0 -1
  244. package/dist/src/ui/viewer/i18n/fr.js +0 -198
  245. package/dist/src/ui/viewer/i18n/fr.js.map +0 -1
  246. package/dist/src/ui/viewer/i18n/index.d.ts +0 -27
  247. package/dist/src/ui/viewer/i18n/index.d.ts.map +0 -1
  248. package/dist/src/ui/viewer/i18n/index.js +0 -88
  249. package/dist/src/ui/viewer/i18n/index.js.map +0 -1
  250. package/dist/src/ui/viewer/i18n/ja.d.ts +0 -3
  251. package/dist/src/ui/viewer/i18n/ja.d.ts.map +0 -1
  252. package/dist/src/ui/viewer/i18n/ja.js +0 -198
  253. package/dist/src/ui/viewer/i18n/ja.js.map +0 -1
  254. package/dist/src/ui/viewer/i18n/ko.d.ts +0 -3
  255. package/dist/src/ui/viewer/i18n/ko.d.ts.map +0 -1
  256. package/dist/src/ui/viewer/i18n/ko.js +0 -198
  257. package/dist/src/ui/viewer/i18n/ko.js.map +0 -1
  258. package/dist/src/ui/viewer/i18n/pt-BR.d.ts +0 -3
  259. package/dist/src/ui/viewer/i18n/pt-BR.d.ts.map +0 -1
  260. package/dist/src/ui/viewer/i18n/pt-BR.js +0 -198
  261. package/dist/src/ui/viewer/i18n/pt-BR.js.map +0 -1
  262. package/dist/src/ui/viewer/i18n/ru.d.ts +0 -3
  263. package/dist/src/ui/viewer/i18n/ru.d.ts.map +0 -1
  264. package/dist/src/ui/viewer/i18n/ru.js +0 -198
  265. package/dist/src/ui/viewer/i18n/ru.js.map +0 -1
  266. package/dist/src/ui/viewer/i18n/types.d.ts +0 -176
  267. package/dist/src/ui/viewer/i18n/types.d.ts.map +0 -1
  268. package/dist/src/ui/viewer/i18n/types.js +0 -2
  269. package/dist/src/ui/viewer/i18n/types.js.map +0 -1
  270. package/dist/src/ui/viewer/i18n/zh-CN.d.ts +0 -3
  271. package/dist/src/ui/viewer/i18n/zh-CN.d.ts.map +0 -1
  272. package/dist/src/ui/viewer/i18n/zh-CN.js +0 -198
  273. package/dist/src/ui/viewer/i18n/zh-CN.js.map +0 -1
  274. package/dist/src/ui/viewer/i18n/zh-TW.d.ts +0 -3
  275. package/dist/src/ui/viewer/i18n/zh-TW.d.ts.map +0 -1
  276. package/dist/src/ui/viewer/i18n/zh-TW.js +0 -198
  277. package/dist/src/ui/viewer/i18n/zh-TW.js.map +0 -1
  278. package/dist/src/ui/viewer/icons.d.ts +0 -77
  279. package/dist/src/ui/viewer/icons.d.ts.map +0 -1
  280. package/dist/src/ui/viewer/icons.js +0 -109
  281. package/dist/src/ui/viewer/icons.js.map +0 -1
  282. package/dist/src/ui/viewer/index.d.ts +0 -6
  283. package/dist/src/ui/viewer/index.d.ts.map +0 -1
  284. package/dist/src/ui/viewer/index.js +0 -6
  285. package/dist/src/ui/viewer/index.js.map +0 -1
  286. package/dist/src/ui/viewer/layout/index.d.ts +0 -3
  287. package/dist/src/ui/viewer/layout/index.d.ts.map +0 -1
  288. package/dist/src/ui/viewer/layout/index.js +0 -3
  289. package/dist/src/ui/viewer/layout/index.js.map +0 -1
  290. package/dist/src/ui/viewer/layout/pixelAlign.d.ts +0 -8
  291. package/dist/src/ui/viewer/layout/pixelAlign.d.ts.map +0 -1
  292. package/dist/src/ui/viewer/layout/pixelAlign.js +0 -42
  293. package/dist/src/ui/viewer/layout/pixelAlign.js.map +0 -1
  294. package/dist/src/ui/viewer/layout/spreadLayout.d.ts +0 -155
  295. package/dist/src/ui/viewer/layout/spreadLayout.d.ts.map +0 -1
  296. package/dist/src/ui/viewer/layout/spreadLayout.js +0 -574
  297. package/dist/src/ui/viewer/layout/spreadLayout.js.map +0 -1
  298. package/dist/src/ui/viewer/navigation.d.ts +0 -91
  299. package/dist/src/ui/viewer/navigation.d.ts.map +0 -1
  300. package/dist/src/ui/viewer/navigation.js +0 -59
  301. package/dist/src/ui/viewer/navigation.js.map +0 -1
  302. package/dist/src/ui/viewer/reducer.d.ts +0 -4
  303. package/dist/src/ui/viewer/reducer.d.ts.map +0 -1
  304. package/dist/src/ui/viewer/reducer.js +0 -841
  305. package/dist/src/ui/viewer/reducer.js.map +0 -1
  306. package/dist/src/ui/viewer/search/index.d.ts +0 -2
  307. package/dist/src/ui/viewer/search/index.d.ts.map +0 -1
  308. package/dist/src/ui/viewer/search/index.js +0 -2
  309. package/dist/src/ui/viewer/search/index.js.map +0 -1
  310. package/dist/src/ui/viewer/search/search.d.ts +0 -31
  311. package/dist/src/ui/viewer/search/search.d.ts.map +0 -1
  312. package/dist/src/ui/viewer/search/search.js +0 -446
  313. package/dist/src/ui/viewer/search/search.js.map +0 -1
  314. package/dist/src/ui/viewer/shell.d.ts +0 -65
  315. package/dist/src/ui/viewer/shell.d.ts.map +0 -1
  316. package/dist/src/ui/viewer/shell.js +0 -366
  317. package/dist/src/ui/viewer/shell.js.map +0 -1
  318. package/dist/src/ui/viewer/state.d.ts +0 -313
  319. package/dist/src/ui/viewer/state.d.ts.map +0 -1
  320. package/dist/src/ui/viewer/state.js +0 -157
  321. package/dist/src/ui/viewer/state.js.map +0 -1
  322. package/dist/src/ui/viewer/styles-inline.d.ts +0 -2
  323. package/dist/src/ui/viewer/styles-inline.d.ts.map +0 -1
  324. package/dist/src/ui/viewer/styles-inline.js +0 -3526
  325. package/dist/src/ui/viewer/styles-inline.js.map +0 -1
  326. package/dist/src/ui/viewer/text/index.d.ts +0 -6
  327. package/dist/src/ui/viewer/text/index.d.ts.map +0 -1
  328. package/dist/src/ui/viewer/text/index.js +0 -6
  329. package/dist/src/ui/viewer/text/index.js.map +0 -1
  330. package/dist/src/ui/viewer/text/render.d.ts +0 -18
  331. package/dist/src/ui/viewer/text/render.d.ts.map +0 -1
  332. package/dist/src/ui/viewer/text/render.js +0 -480
  333. package/dist/src/ui/viewer/text/render.js.map +0 -1
  334. package/dist/src/ui/viewer/text/selection.d.ts +0 -12
  335. package/dist/src/ui/viewer/text/selection.d.ts.map +0 -1
  336. package/dist/src/ui/viewer/text/selection.js +0 -69
  337. package/dist/src/ui/viewer/text/selection.js.map +0 -1
  338. package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts +0 -21
  339. package/dist/src/ui/viewer/tools/AnnotationDrawController.d.ts.map +0 -1
  340. package/dist/src/ui/viewer/tools/AnnotationDrawController.js +0 -410
  341. package/dist/src/ui/viewer/tools/AnnotationDrawController.js.map +0 -1
  342. package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts +0 -22
  343. package/dist/src/ui/viewer/tools/AnnotationSelectController.d.ts.map +0 -1
  344. package/dist/src/ui/viewer/tools/AnnotationSelectController.js +0 -378
  345. package/dist/src/ui/viewer/tools/AnnotationSelectController.js.map +0 -1
  346. package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts +0 -29
  347. package/dist/src/ui/viewer/tools/AnnotationUndoManager.d.ts.map +0 -1
  348. package/dist/src/ui/viewer/tools/AnnotationUndoManager.js +0 -144
  349. package/dist/src/ui/viewer/tools/AnnotationUndoManager.js.map +0 -1
  350. package/dist/src/ui/viewer/tools/ViewToolController.d.ts +0 -20
  351. package/dist/src/ui/viewer/tools/ViewToolController.d.ts.map +0 -1
  352. package/dist/src/ui/viewer/tools/ViewToolController.js +0 -179
  353. package/dist/src/ui/viewer/tools/ViewToolController.js.map +0 -1
  354. package/dist/src/ui/viewer/transition-gl.d.ts +0 -25
  355. package/dist/src/ui/viewer/transition-gl.d.ts.map +0 -1
  356. package/dist/src/ui/viewer/transition-gl.js +0 -823
  357. package/dist/src/ui/viewer/transition-gl.js.map +0 -1
  358. package/dist/src/ui/viewer/transition.d.ts +0 -26
  359. package/dist/src/ui/viewer/transition.d.ts.map +0 -1
  360. package/dist/src/ui/viewer/transition.js +0 -1383
  361. package/dist/src/ui/viewer/transition.js.map +0 -1
  362. package/dist/src/wasm/LICENSE +0 -112
  363. package/dist/src/wasm/udoc.d.ts +0 -1338
  364. package/dist/src/wasm/udoc.js +0 -2645
  365. package/dist/src/wasm/udoc_bg.wasm +0 -0
  366. package/dist/src/wasm/udoc_bg.wasm.d.ts +0 -58
  367. package/dist/src/worker/WorkerClient.d.ts +0 -489
  368. package/dist/src/worker/WorkerClient.d.ts.map +0 -1
  369. package/dist/src/worker/WorkerClient.js +0 -1383
  370. package/dist/src/worker/WorkerClient.js.map +0 -1
  371. package/dist/src/worker/index.d.ts +0 -4
  372. package/dist/src/worker/index.d.ts.map +0 -1
  373. package/dist/src/worker/index.js +0 -2
  374. package/dist/src/worker/index.js.map +0 -1
  375. package/dist/src/worker/wasmError.d.ts +0 -17
  376. package/dist/src/worker/wasmError.d.ts.map +0 -1
  377. package/dist/src/worker/wasmError.js +0 -28
  378. package/dist/src/worker/wasmError.js.map +0 -1
  379. package/dist/src/worker/worker-inline.d.ts +0 -2
  380. package/dist/src/worker/worker-inline.d.ts.map +0 -1
  381. package/dist/src/worker/worker-inline.js +0 -2
  382. package/dist/src/worker/worker-inline.js.map +0 -1
  383. package/dist/src/worker/worker.d.ts +0 -530
  384. package/dist/src/worker/worker.d.ts.map +0 -1
  385. package/dist/src/worker/worker.js +0 -2935
  386. package/dist/src/worker/worker.js.map +0 -1
@@ -1,883 +0,0 @@
1
- /**
2
- * UDocViewer - Document viewer component.
3
- *
4
- * Binds to a loaded document and optionally provides UI.
5
- * Created via `client.createViewer()`.
6
- */
7
- import type { WorkerClient, PageInfo, FontUsageEntry } from "./worker/index.js";
8
- import type { ViewerOptions } from "./UDocClient.js";
9
- import type { PrintDialogResult } from "./ui/viewer/components/PrintDialog.js";
10
- import type { Destination, OutlineItem, ScrollAlignment } from "./ui/viewer/navigation.js";
11
- import { type Annotation, type AnnotationPatch } from "./ui/viewer/annotation/index.js";
12
- export type { Annotation, AnnotationPatch } from "./ui/viewer/annotation/index.js";
13
- export type { SearchMatch } from "./ui/viewer/state.js";
14
- import type { LayoutPage } from "./worker/index.js";
15
- import { type DocumentFormat, type ViewMode, type PanelTab, type ScrollMode, type LayoutMode, type ZoomMode, type PageRotation, type SpacingMode, type ThemeMode, type SearchMatch, type ActiveTool } from "./ui/viewer/state.js";
16
- import { type IPerformanceCounter } from "./performance/index.js";
17
- /**
18
- * Options for rendering a page.
19
- */
20
- export interface RenderOptions {
21
- /**
22
- * Scale factor for rendering.
23
- * 1 = 72 DPI (1 point = 1 pixel)
24
- * 2 = 144 DPI (retina)
25
- * @default 1
26
- */
27
- scale?: number;
28
- /**
29
- * Output format.
30
- * @default 'image-data'
31
- */
32
- format?: "image-data" | "image-bitmap" | "blob" | "data-url";
33
- /**
34
- * Image type when format is 'blob' or 'data-url'.
35
- * @default 'image/png'
36
- */
37
- imageType?: "image/png" | "image/jpeg";
38
- /**
39
- * JPEG quality (0-1) when imageType is 'image/jpeg'.
40
- * @default 0.92
41
- */
42
- quality?: number;
43
- /**
44
- * Include annotations in render.
45
- * @default true
46
- */
47
- annotations?: boolean;
48
- /**
49
- * Skip all cache and queue, call worker directly.
50
- * Useful for one-off renders that shouldn't affect the render queue.
51
- * @default false
52
- */
53
- force?: boolean;
54
- /**
55
- * Boost render priority by calling boostRenderPage before rendering.
56
- * This prioritizes this page and nearby pages in the render queue.
57
- * @default false
58
- */
59
- boost?: boolean;
60
- }
61
- /**
62
- * Rendered page result.
63
- */
64
- export type RenderedPage = ImageData | ImageBitmap | Blob | string;
65
- /**
66
- * Document metadata.
67
- */
68
- export interface DocumentMetadata {
69
- title?: string;
70
- author?: string;
71
- subject?: string;
72
- keywords?: string;
73
- creator?: string;
74
- producer?: string;
75
- creationDate?: Date;
76
- modificationDate?: Date;
77
- }
78
- /**
79
- * Re-export navigation types for public API.
80
- */
81
- export type { Destination, DestinationDisplay, OutlineItem, ScrollAlignment } from "./ui/viewer/navigation.js";
82
- /**
83
- * Options for {@link UDocViewer.load}.
84
- */
85
- export interface LoadOptions {
86
- /**
87
- * Default filename used by `download()` when called with no argument.
88
- * A `.csv` extension here also identifies the document as CSV.
89
- */
90
- filename?: string;
91
- /**
92
- * Document format. When set it is authoritative: the matching loader is
93
- * used without inspecting the file contents.
94
- *
95
- * Only needed for formats with no signature bytes (CSV) whose source does
96
- * not identify them. When omitted, a CSV is recognised from the File name
97
- * or URL extension, `filename`, the File's type or response
98
- * `Content-Type`, or the response `Content-Disposition` file name; every
99
- * other format is detected from the file contents.
100
- */
101
- format?: DocumentFormat;
102
- }
103
- /**
104
- * Document loading progress information.
105
- */
106
- export interface LoadProgress {
107
- /** Bytes loaded so far. */
108
- loaded: number;
109
- /** Total bytes (may be 0 if Content-Length not available). */
110
- total: number;
111
- /** Progress percentage 0-100 (null if total unknown). */
112
- percent: number | null;
113
- }
114
- /**
115
- * UI component identifier for visibility events.
116
- */
117
- export type UIComponent = "toolbar" | "floatingToolbar" | "leftPanel" | "rightPanel" | "fullscreen" | "download" | "print" | PanelTab;
118
- /**
119
- * Event map for viewer events.
120
- */
121
- export interface ViewerEventMap {
122
- "document:loading": LoadProgress;
123
- "document:load": {
124
- pageCount: number;
125
- };
126
- "document:close": Record<string, never>;
127
- download: {
128
- filename: string;
129
- };
130
- /** Fires on the actual print, not when the print dialog opens. */
131
- print: {
132
- pageCount: number;
133
- };
134
- error: {
135
- error: Error;
136
- phase: "fetch" | "parse" | "render" | "permit";
137
- };
138
- "page:change": {
139
- page: number;
140
- previousPage: number;
141
- };
142
- "ui:visibilityChange": {
143
- component: UIComponent;
144
- visible: boolean;
145
- };
146
- "panel:change": {
147
- panel: PanelTab | null;
148
- previousPanel: PanelTab | null;
149
- };
150
- "font:usageChange": {
151
- entries: FontUsageEntry[];
152
- };
153
- "search:change": {
154
- matches: SearchMatch[];
155
- activeIndex: number;
156
- };
157
- "annotation:add": {
158
- pageIndex: number;
159
- annotation: Annotation;
160
- };
161
- "annotation:update": {
162
- pageIndex: number;
163
- annotation: Annotation;
164
- };
165
- "annotation:remove": {
166
- pageIndex: number;
167
- annotation: Annotation;
168
- };
169
- "annotation:select": {
170
- pageIndex: number;
171
- annotation: Annotation;
172
- } | null;
173
- /**
174
- * Fires when the pointer enters or leaves an annotation element on a
175
- * rendered page. Always emitted regardless of the active tool — including
176
- * during normal viewing. Payload is `null` when the pointer leaves the
177
- * currently hovered annotation without entering another. `clientX`/
178
- * `clientY` are the pointer's browser-viewport coordinates at the moment
179
- * of the hover change (rotation- and zoom-invariant; suitable for placing
180
- * a tooltip in screen space).
181
- */
182
- "annotation:hover": {
183
- pageIndex: number;
184
- annotation: Annotation;
185
- clientX: number;
186
- clientY: number;
187
- } | null;
188
- /**
189
- * Fires when the user clicks an annotation on a rendered page. Always
190
- * emitted regardless of the active tool, in addition to (and before) any
191
- * built-in click handling such as link navigation or sticky-note popups.
192
- * `clientX`/`clientY` are the pointer's browser-viewport coordinates at
193
- * the click (rotation- and zoom-invariant; suitable for anchoring a
194
- * context menu or popover in screen space).
195
- */
196
- "annotation:click": {
197
- pageIndex: number;
198
- annotation: Annotation;
199
- clientX: number;
200
- clientY: number;
201
- };
202
- /**
203
- * Fires when the user's view of the document changes — scroll position,
204
- * zoom, layout, or scroll-mode changes that affect which pages are
205
- * visible. Throttled to once per animation frame, and de-duped so
206
- * adjacent identical payloads are coalesced.
207
- */
208
- "viewport:change": {
209
- /** First page index (0-based) at least partially visible. */
210
- firstVisiblePage: number;
211
- /** Last page index (0-based) at least partially visible. */
212
- lastVisiblePage: number;
213
- /** Current zoom factor (1 = 100%). */
214
- zoom: number;
215
- /** Vertical scroll offset of the viewport in CSS pixels. */
216
- scrollTop: number;
217
- };
218
- }
219
- type EventHandler<K extends keyof ViewerEventMap> = (payload: ViewerEventMap[K]) => void;
220
- /**
221
- * Document viewer component.
222
- *
223
- * Supports both UI mode (with container) and headless mode (without container).
224
- * Use `client.createViewer()` to create instances.
225
- */
226
- export declare class UDocViewer {
227
- private workerClient;
228
- private container;
229
- private uiShell;
230
- private documentId;
231
- private _pageCount;
232
- private _pageInfo;
233
- private destroyed;
234
- private eventHandlers;
235
- private _performanceCounter;
236
- private viewOverrides;
237
- private currentFormat;
238
- private sourceFilename;
239
- private documentDefaultFilename;
240
- private storeUnsub;
241
- private actionUnsub;
242
- private fontUsageUnsub;
243
- private sdkVersion;
244
- /**
245
- * @internal
246
- * Use `client.createViewer()` instead.
247
- */
248
- constructor(workerClient: WorkerClient, options?: ViewerOptions, showAttribution?: boolean, showLoadingOverlay?: boolean, sdkVersion?: string);
249
- /**
250
- * Performance counter for tracking operation timings.
251
- * Only records data when `enablePerformanceCounter` is true.
252
- */
253
- get performanceCounter(): IPerformanceCounter;
254
- private buildStateOverrides;
255
- private buildViewModeOverrides;
256
- private computeViewDefaults;
257
- /**
258
- * Load a document.
259
- *
260
- * @param source - URL string, File object, or raw bytes
261
- * @param options - See {@link LoadOptions}.
262
- */
263
- load(source: string | File | Uint8Array, options?: LoadOptions): Promise<void>;
264
- /**
265
- * Close the current document.
266
- * Viewer returns to empty state.
267
- */
268
- close(): void;
269
- /**
270
- * Whether a document is currently loaded.
271
- */
272
- get isLoaded(): boolean;
273
- /**
274
- * Check if the loaded document requires a password to open.
275
- * @returns True if the document needs authentication before pages can be accessed.
276
- */
277
- needsPassword(): Promise<boolean>;
278
- /**
279
- * Authenticate with a password to unlock an encrypted document.
280
- *
281
- * After successful authentication, page info is reloaded and the document
282
- * becomes fully accessible.
283
- *
284
- * @param password - The password to try
285
- * @returns True if authentication succeeded, false if the password was incorrect.
286
- */
287
- authenticate(password: string): Promise<boolean>;
288
- /**
289
- * Handle password submission from the UI dialog.
290
- * @internal
291
- */
292
- private handlePasswordSubmit;
293
- /**
294
- * Total number of pages.
295
- * Returns 0 if no document is loaded.
296
- */
297
- get pageCount(): number;
298
- /**
299
- * Document metadata (title, author, etc.).
300
- * Returns null if no document is loaded.
301
- */
302
- get metadata(): DocumentMetadata | null;
303
- /**
304
- * Get document outline (table of contents / bookmarks).
305
- */
306
- getOutline(): Promise<OutlineItem[]>;
307
- /**
308
- * Get font usage information for the loaded document.
309
- *
310
- * Returns how each font spec in the document was resolved,
311
- * including primary resolution and any glyph-fallback fonts.
312
- * This information is populated during rendering — call after
313
- * at least one page has been rendered for results.
314
- */
315
- getFontUsage(): Promise<FontUsageEntry[]>;
316
- /**
317
- * Get page dimensions in points (1 point = 1/72 inch).
318
- * @param page - Page index (0-based)
319
- */
320
- getPageInfo(page: number): Promise<PageInfo>;
321
- /**
322
- * Get annotations on a specific page.
323
- *
324
- * Returns the in-memory state if the page has been edited in this
325
- * session; otherwise reads from the worker.
326
- *
327
- * Returned `bounds` (and every other geometry field) are in the page's
328
- * unrotated MediaBox coordinate space — origin top-left, units in PDF
329
- * points, +y downward — regardless of the page's `/Rotate` value.
330
- * See {@link Rect} for the full coordinate convention.
331
- *
332
- * @param page - Page index (0-based)
333
- */
334
- getPageAnnotations(page: number): Promise<Annotation[]>;
335
- /**
336
- * Add a new annotation to a page.
337
- *
338
- * If `annotation.name` is omitted, a UUID is generated and assigned. The
339
- * returned value is the annotation as inserted (with `name` populated),
340
- * which is the same identifier the engine will write to the PDF's NM
341
- * entry on save.
342
- *
343
- * Pass `ephemeral: true` to create a viewer-only annotation that renders
344
- * but is excluded from saved PDF bytes and from print output. The same
345
- * `updatePageAnnotation` / `removePageAnnotation` calls work for both kinds, and
346
- * `updatePageAnnotation` can flip the `ephemeral` flag to promote a preview
347
- * into a saved annotation (or demote a saved one to viewer-only).
348
- *
349
- * **Coordinate space:** `annotation.bounds` and all per-type geometry
350
- * (line endpoints, polygon vertices, ink strokes, quads, callout lines,
351
- * …) must be in the page's **unrotated MediaBox** coordinate space —
352
- * origin top-left, PDF points, +y downward — *not* the displayed/rotated
353
- * orientation. The viewer applies `/Rotate` (and the user's rotation
354
- * toggle) as a display transform on top of MediaBox-space bounds. See
355
- * {@link Rect} for the full convention. The {@link getPageAnnotations}
356
- * round-trip uses the same space, so a value read out and added back is
357
- * always in the right frame.
358
- *
359
- * Annotation editing currently requires UI mode (a `container` was passed
360
- * to `client.createViewer`) and is supported on PDF documents only.
361
- *
362
- * @param page - Page index (0-based)
363
- * @returns The inserted annotation (with `name` populated).
364
- */
365
- addPageAnnotation(page: number, annotation: Annotation): Promise<Annotation>;
366
- /**
367
- * Add multiple annotations to a page in a single batch.
368
- *
369
- * Equivalent to calling {@link addPageAnnotation} once per item, but
370
- * applied as a single store update — one render and one dirty-flag flip
371
- * per page instead of N. Use this when importing or restoring many
372
- * annotations on the same page.
373
- *
374
- * Each annotation gets a generated `name` (UUID) if one is not provided.
375
- * The returned array preserves input order with `name` populated.
376
- *
377
- * `annotation:add` still fires once per annotation, in input order, so
378
- * existing single-event listeners just work.
379
- *
380
- * Geometry coordinate space matches {@link addPageAnnotation} — unrotated
381
- * MediaBox, origin top-left, PDF points, +y downward. See {@link Rect}.
382
- *
383
- * @param page - Page index (0-based)
384
- * @param annotations - Annotations to insert (may mix ephemeral and saved)
385
- * @returns The inserted annotations (each with `name` populated).
386
- */
387
- addPageAnnotations(page: number, annotations: Annotation[]): Promise<Annotation[]>;
388
- /**
389
- * Update an existing annotation, identified by its `name` (NM).
390
- *
391
- * Looks up the annotation on the given page by `name` and replaces it
392
- * with the supplied value. The replacement keeps the same `name` even
393
- * if a different one is passed in `annotation.name`.
394
- *
395
- * Geometry on the replacement must be in unrotated MediaBox coordinates
396
- * — see {@link Rect}.
397
- *
398
- * @param page - Page index (0-based)
399
- * @param name - The annotation's `name` (NM).
400
- * @param annotation - The replacement annotation.
401
- * @returns The updated annotation.
402
- * @throws If no annotation with the given `name` is found on the page.
403
- */
404
- updatePageAnnotation(page: number, name: string, annotation: Annotation): Promise<Annotation>;
405
- /**
406
- * Update multiple annotations on a page in a single batch.
407
- *
408
- * Equivalent to calling {@link updatePageAnnotation} once per item, but
409
- * applied as a single store update — one render and one dirty-flag flip
410
- * per page instead of N. Each entry's existing `name` is preserved even
411
- * if a different one is set on its `annotation`.
412
- *
413
- * `annotation:update` still fires once per entry, in input order.
414
- *
415
- * Validation is atomic: if any `name` cannot be found on the page, the
416
- * call throws *before* any annotation is updated.
417
- *
418
- * @param page - Page index (0-based)
419
- * @param updates - Pairs of `{ name, annotation }` to replace.
420
- * @returns The updated annotations, in input order.
421
- * @throws If any `name` is not found on the page.
422
- */
423
- updatePageAnnotations(page: number, updates: Array<{
424
- name: string;
425
- annotation: Annotation;
426
- }>): Promise<Annotation[]>;
427
- /**
428
- * Patch an existing annotation, identified by its `name` (NM).
429
- *
430
- * Unlike {@link updatePageAnnotation}, which replaces the entire
431
- * annotation, this only overwrites the fields present in `patch`.
432
- * Everything else (geometry, other style fields, contents, etc.) is
433
- * preserved. Use this when you want to tweak one or two properties —
434
- * for example, change a highlight's color — without round-tripping the
435
- * full annotation.
436
- *
437
- * Semantics:
438
- * - `type` and `name` in the patch are silently ignored.
439
- * - `metadata` is shallow-merged one level deep, so patching
440
- * `{ metadata: { contents } }` keeps the existing `author`/`subject`.
441
- * - `undefined` values are skipped, not treated as "clear this field".
442
- * Use `updatePageAnnotation` for full replacement when you need to
443
- * clear fields by omission.
444
- *
445
- * @param page - Page index (0-based)
446
- * @param name - The annotation's `name` (NM).
447
- * @param patch - Fields to merge into the existing annotation.
448
- * @returns The patched annotation.
449
- * @throws If no annotation with the given `name` is found on the page.
450
- */
451
- patchPageAnnotation(page: number, name: string, patch: AnnotationPatch): Promise<Annotation>;
452
- /**
453
- * Patch multiple annotations on a page in a single batch.
454
- *
455
- * Equivalent to calling {@link patchPageAnnotation} once per item, but
456
- * applied as a single store update — one render and one dirty-flag flip
457
- * per page instead of N. Patches are resolved against the *current*
458
- * annotation state (not against each other in sequence); patching the
459
- * same `name` twice in one call applies both, with the second winning.
460
- *
461
- * `annotation:update` still fires once per entry, in input order.
462
- *
463
- * Validation is atomic: if any `name` cannot be found on the page, the
464
- * call throws *before* any annotation is patched.
465
- *
466
- * @param page - Page index (0-based)
467
- * @param patches - Pairs of `{ name, patch }` to apply.
468
- * @returns The patched annotations, in input order.
469
- * @throws If any `name` is not found on the page.
470
- */
471
- patchPageAnnotations(page: number, patches: Array<{
472
- name: string;
473
- patch: AnnotationPatch;
474
- }>): Promise<Annotation[]>;
475
- /**
476
- * Remove an annotation, identified by its `name` (NM).
477
- *
478
- * @param page - Page index (0-based)
479
- * @param name - The annotation's `name` (NM).
480
- * @throws If no annotation with the given `name` is found on the page.
481
- */
482
- removePageAnnotation(page: number, name: string): Promise<void>;
483
- /**
484
- * Ensure pageAnnotations is populated for a page so that mutator actions
485
- * have a baseline list to operate on. The reducer's ADD path tolerates a
486
- * missing page, but UPDATE/REMOVE need the existing annotations loaded
487
- * so we don't silently lose what the worker has.
488
- */
489
- private ensurePageAnnotationsLoaded;
490
- private findAnnotationIndex;
491
- /**
492
- * Synchronous variant of `findAnnotationIndex` for callers that have
493
- * already awaited `ensurePageAnnotationsLoaded` — used by the batch
494
- * mutators so all per-item lookups happen against a stable, loaded list.
495
- */
496
- private requireAnnotationIndex;
497
- /**
498
- * Get the layout structure for a specific page.
499
- * Returns frames, parcels, lines, runs, glyphs, tables, and grids
500
- * without building the full display list.
501
- * All coordinates are in points (1/72 inch).
502
- * @param page - Page index (0-based)
503
- */
504
- getLayoutPage(page: number): Promise<LayoutPage>;
505
- /**
506
- * Get the plain text of a page, matching exactly what the search engine sees.
507
- *
508
- * Text is extracted from the layout model: glyph runs are concatenated in
509
- * visual order, with spaces/tabs rendered as " ", paragraph ends and line
510
- * breaks as "\n", and inline drawings as U+FFFC (object replacement char).
511
- *
512
- * @param page - Page index (0-based)
513
- */
514
- getPageText(page: number): Promise<string>;
515
- /**
516
- * Get the current page number (1-based).
517
- */
518
- get currentPage(): number;
519
- /**
520
- * Navigate to a specific page.
521
- * @param page - Page number (1-based)
522
- */
523
- goToPage(page: number): void;
524
- /**
525
- * Navigate to a destination (page + position + zoom).
526
- * @param destination - Full destination object with page index and display mode
527
- * @param options - Optional navigation options
528
- * @param options.scrollAlignment - How to align the target in the viewport:
529
- * "top" (default), "center", "bottom", or "nearest" (minimal scroll to fit in view)
530
- */
531
- goToDestination(destination: Destination, options?: {
532
- scrollAlignment?: ScrollAlignment;
533
- }): void;
534
- /**
535
- * Navigate to the next page.
536
- */
537
- nextPage(): void;
538
- /**
539
- * Navigate to the previous page.
540
- */
541
- previousPage(): void;
542
- /**
543
- * Current zoom level (1 = 100%).
544
- */
545
- get zoom(): number;
546
- /**
547
- * Current zoom mode.
548
- */
549
- get zoomMode(): ZoomMode;
550
- /**
551
- * Zoom in to the next zoom step.
552
- */
553
- zoomIn(): void;
554
- /**
555
- * Zoom out to the previous zoom step.
556
- */
557
- zoomOut(): void;
558
- /**
559
- * Set zoom to a specific level (1 = 100%). Switches to custom zoom mode.
560
- */
561
- setZoom(zoom: number): void;
562
- /**
563
- * Set zoom mode.
564
- */
565
- setZoomMode(mode: ZoomMode): void;
566
- /** Current scroll mode. */
567
- get scrollMode(): ScrollMode;
568
- /** Current layout mode. */
569
- get layoutMode(): LayoutMode;
570
- /** Current page rotation in degrees. */
571
- get pageRotation(): PageRotation;
572
- /** Current spacing mode. */
573
- get spacingMode(): SpacingMode;
574
- /** Whether the viewer is in fullscreen mode. */
575
- get isFullscreen(): boolean;
576
- /** Current view mode. */
577
- get viewMode(): ViewMode;
578
- /**
579
- * Set view mode (paged or continuous).
580
- */
581
- setViewMode(mode: ViewMode): void;
582
- /**
583
- * Get the current view mode.
584
- */
585
- getViewMode(): ViewMode;
586
- /**
587
- * Set scroll mode.
588
- */
589
- setScrollMode(mode: ScrollMode): void;
590
- /** Default scroll alignment for navigation (outline, links, goToDestination). */
591
- get navigationScrollAlignment(): ScrollAlignment;
592
- /** Default scroll alignment for search result navigation. */
593
- get searchScrollAlignment(): ScrollAlignment;
594
- /**
595
- * Set the default scroll alignment for navigation (outline, links, goToDestination).
596
- */
597
- setNavigationScrollAlignment(alignment: ScrollAlignment): void;
598
- /**
599
- * Set the default scroll alignment for search result navigation.
600
- */
601
- setSearchScrollAlignment(alignment: ScrollAlignment): void;
602
- /**
603
- * Set page layout mode.
604
- */
605
- setLayoutMode(mode: LayoutMode): void;
606
- /**
607
- * Set page rotation.
608
- */
609
- setPageRotation(rotation: PageRotation): void;
610
- /**
611
- * Set spacing mode.
612
- */
613
- setSpacingMode(mode: SpacingMode): void;
614
- /**
615
- * Enter or exit fullscreen mode.
616
- */
617
- setFullscreen(fullscreen: boolean): void;
618
- /**
619
- * Show or hide the top toolbar.
620
- */
621
- setToolbarVisible(visible: boolean): void;
622
- /**
623
- * Show or hide the floating toolbar (page navigation, zoom, view mode controls).
624
- */
625
- setFloatingToolbarVisible(visible: boolean): void;
626
- /**
627
- * Currently active tool, as a tagged union. The `kind` is one of `"pointer"`,
628
- * `"hand"`, `"zoom"`, `"annotate"`, `"markup"`; for `"annotate"` and `"markup"`
629
- * a `sub` field carries the active sub-tool (`"freehand"`, `"highlight"`, etc.).
630
- */
631
- get activeTool(): ActiveTool;
632
- /**
633
- * Switch the currently active tool. Tool-set kinds (`"annotate"`, `"markup"`)
634
- * require a `sub`, e.g. `{ kind: "annotate", sub: "freehand" }`. Calling
635
- * this with the same tool-set kind that's already active toggles back to
636
- * the pointer tool, matching the toolbar UI.
637
- */
638
- setActiveTool(tool: ActiveTool): void;
639
- /**
640
- * Enable or disable the fullscreen button.
641
- */
642
- setFullscreenEnabled(enabled: boolean): void;
643
- /**
644
- * Enable or disable the download button.
645
- */
646
- setDownloadEnabled(enabled: boolean): void;
647
- /**
648
- * Enable or disable the print button.
649
- */
650
- setPrintEnabled(enabled: boolean): void;
651
- /** Current theme mode. */
652
- get theme(): ThemeMode;
653
- /**
654
- * Set the viewer color theme.
655
- * @param theme - 'light', 'dark', or 'system'
656
- */
657
- setTheme(theme: ThemeMode): void;
658
- /**
659
- * Enable or disable the theme toggle button in the toolbar.
660
- */
661
- setThemeSwitchingEnabled(enabled: boolean): void;
662
- /**
663
- * Enable or disable text selection in the viewer.
664
- */
665
- setTextSelectionEnabled(enabled: boolean): void;
666
- /**
667
- * Set the minimum zoom level.
668
- */
669
- setMinZoom(zoom: number): void;
670
- /**
671
- * Set the maximum zoom level.
672
- */
673
- setMaxZoom(zoom: number): void;
674
- /**
675
- * Enable or disable the entire left panel area.
676
- * When disabled, the left panel is hidden and all left panel tabs are inaccessible.
677
- */
678
- setLeftPanelEnabled(enabled: boolean): void;
679
- /**
680
- * Enable or disable the entire right panel area.
681
- * When disabled, the right panel is hidden and all right panel tabs are inaccessible.
682
- */
683
- setRightPanelEnabled(enabled: boolean): void;
684
- /**
685
- * Enable or disable a specific panel tab.
686
- * Disabled panels are removed from the UI and cannot be opened.
687
- * If the panel is currently open and being disabled, it will be closed.
688
- */
689
- setPanelEnabled(panel: PanelTab, enabled: boolean): void;
690
- /**
691
- * Open a specific panel.
692
- * Has no effect if the panel is disabled via `setPanelEnabled()` or a `disable*` option.
693
- */
694
- openPanel(panel: PanelTab): void;
695
- /**
696
- * Close the currently open panel.
697
- */
698
- closePanel(): void;
699
- /**
700
- * Search for text in the document.
701
- * Returns a promise that resolves with the final search matches once all page text
702
- * has been loaded and the search completes. Highlight overlays are rendered automatically.
703
- *
704
- * Results are also available via the `search:change` event (fires for intermediate
705
- * results as pages load) and the `searchMatches` getter.
706
- *
707
- * @param query - The text to search for
708
- * @param options - Search options
709
- * @param options.caseSensitive - Whether to match case (overrides current default)
710
- * @param options.fuzzy - Enable fuzzy matching. When true, all whitespace, control
711
- * characters, pipes (`|`), and zero-width characters are stripped from both the
712
- * query and the document text before comparison. This allows AI-generated citations
713
- * to match even when spacing or separators differ from the original document
714
- * (e.g. `"cell A | cell B"` will match `"cell A\ncell B"`).
715
- * @param options.pageRange - Inclusive 0-based page range `[start, end]` to restrict
716
- * search to. Both text loading and match collection are limited to this range.
717
- * Omit to search the entire document. Each `search()` call is self-contained —
718
- * the range is reset to "all pages" unless explicitly provided.
719
- * @returns Promise resolving with the search matches
720
- */
721
- search(query: string, options?: {
722
- caseSensitive?: boolean;
723
- fuzzy?: boolean;
724
- pageRange?: [number, number] | null;
725
- }): Promise<SearchMatch[]>;
726
- /**
727
- * Navigate to the next search match.
728
- * @param options - Optional overrides for this navigation
729
- * @param options.scrollAlignment - Override scroll alignment for this call only
730
- */
731
- searchNext(options?: {
732
- scrollAlignment?: ScrollAlignment;
733
- }): void;
734
- /**
735
- * Navigate to the previous search match.
736
- * @param options - Optional overrides for this navigation
737
- * @param options.scrollAlignment - Override scroll alignment for this call only
738
- */
739
- searchPrev(options?: {
740
- scrollAlignment?: ScrollAlignment;
741
- }): void;
742
- /**
743
- * Clear the current search query and results.
744
- */
745
- clearSearch(): void;
746
- /**
747
- * Get the current search matches.
748
- */
749
- get searchMatches(): SearchMatch[];
750
- /**
751
- * Get the index of the currently active search match (-1 if none).
752
- */
753
- get searchActiveIndex(): number;
754
- /**
755
- * Set the active search match by index. Navigates the viewport to the match.
756
- *
757
- * @param index - 0-based index into `searchMatches`
758
- * @param options - Optional overrides for this navigation
759
- * @param options.scrollAlignment - Override scroll alignment for this call only
760
- */
761
- setSearchActiveIndex(index: number, options?: {
762
- scrollAlignment?: ScrollAlignment;
763
- }): void;
764
- /**
765
- * Render a page to an image.
766
- *
767
- * @param page - Page index (0-based)
768
- * @param options - Render options (scale, format, etc.)
769
- */
770
- renderPage(page: number, options?: RenderOptions): Promise<RenderedPage>;
771
- /**
772
- * Render a thumbnail of a page.
773
- *
774
- * Similar to renderPage but uses lower priority in the render queue,
775
- * making it suitable for generating thumbnails without blocking main page renders.
776
- *
777
- * @param page - Page index (0-based)
778
- * @param options - Render options (scale, format, etc.)
779
- */
780
- renderThumbnail(page: number, options?: RenderOptions): Promise<RenderedPage>;
781
- /**
782
- * Render a rectangular sub-region of a page.
783
- *
784
- * The rect is expressed in **page points** (1 point = 1/72 inch), with the
785
- * origin at the top-left of the page — the same coordinate space as
786
- * `getPageInfo(page).width` / `.height`.
787
- *
788
- * Output pixel size is `rect.width * scale` × `rect.height * scale`.
789
- *
790
- * Internally this renders the full page at the requested scale (sharing the
791
- * render cache with `renderPage`) and crops the result, so the underlying
792
- * full-page render is bounded by the engine's max-render limits.
793
- *
794
- * @param page - Page index (0-based)
795
- * @param rect - Region to render, in page points (top-left origin)
796
- * @param options - Render options. `scale` controls resolution; `format`,
797
- * `imageType`, `quality`, `force`, and `boost` behave as in `renderPage`.
798
- */
799
- renderRegion(page: number, rect: {
800
- x: number;
801
- y: number;
802
- width: number;
803
- height: number;
804
- }, options?: RenderOptions): Promise<RenderedPage>;
805
- /**
806
- * Internal method to render a page with a specific render type.
807
- */
808
- private renderWithType;
809
- /**
810
- * Convert an ImageBitmap to the requested output format.
811
- */
812
- private convertBitmapToFormat;
813
- /**
814
- * Export document as bytes.
815
- * If annotations have been edited, saves them into the PDF before returning.
816
- */
817
- toBytes(): Promise<Uint8Array>;
818
- /**
819
- * Download document to user's device.
820
- * @param filename - Filename for download (defaults to original source filename)
821
- */
822
- download(filename?: string): Promise<void>;
823
- /**
824
- * Print the document.
825
- * Shows the print dialog when called without options (from public API).
826
- * When called with options (from the dialog), renders selected pages and opens the browser print dialog.
827
- */
828
- print(options?: PrintDialogResult): Promise<void>;
829
- /**
830
- * Resolve a PrintPageRange into an array of 0-based page indices.
831
- * @internal
832
- */
833
- private resolvePageIndices;
834
- /**
835
- * Print PDF by loading original bytes into an iframe — vector quality, no rendering needed.
836
- * @internal
837
- */
838
- private printPdfNative;
839
- /** Map quality preset to DPI scale factor. */
840
- private static qualityToDpiScale;
841
- /**
842
- * Print by rendering selected pages to images.
843
- * @internal
844
- */
845
- private printRendered;
846
- /** Returns the MIME type for the current document format. */
847
- private getMimeType;
848
- /** Returns a default filename based on the source or format. */
849
- private getDefaultFilename;
850
- /**
851
- * Subscribe to an event.
852
- * @returns Unsubscribe function
853
- */
854
- on<K extends keyof ViewerEventMap>(event: K, handler: EventHandler<K>): () => void;
855
- /**
856
- * Unsubscribe from an event.
857
- */
858
- off<K extends keyof ViewerEventMap>(event: K, handler: EventHandler<K>): void;
859
- /**
860
- * Destroy the viewer and release resources.
861
- */
862
- destroy(): void;
863
- /**
864
- * Get the document ID (for internal use).
865
- * @internal
866
- */
867
- getDocumentId(): string | null;
868
- /**
869
- * Initialize the viewer with an already-loaded document ID.
870
- * Used by UDocClient.compose() to create viewers for composed documents.
871
- * @internal
872
- */
873
- initializeFromDocId(docId: string): Promise<void>;
874
- private resolveContainer;
875
- private resolveSourceWithFilename;
876
- private fetchWithProgress;
877
- private emit;
878
- private createEngineAdapter;
879
- private ensureNotDestroyed;
880
- private ensureLoaded;
881
- private ensureUiMode;
882
- }
883
- //# sourceMappingURL=UDocViewer.d.ts.map