@embedpdf/plugin-annotation 2.15.0 → 3.0.0-next.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 (348) hide show
  1. package/LICENSE +192 -21
  2. package/dist/capability-fghl0JmE.js +2680 -0
  3. package/dist/capability-fghl0JmE.js.map +1 -0
  4. package/dist/capability-hb2AU0f6.cjs +2739 -0
  5. package/dist/capability-hb2AU0f6.cjs.map +1 -0
  6. package/dist/index.cjs +593 -2
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +65 -0
  9. package/dist/index.d.ts +65 -1
  10. package/dist/index.js +562 -6998
  11. package/dist/index.js.map +1 -1
  12. package/dist/internal.cjs +5 -0
  13. package/dist/internal.d.cts +13 -0
  14. package/dist/internal.d.ts +13 -0
  15. package/dist/internal.js +2 -0
  16. package/dist/types-BhWgqgbX.d.cts +879 -0
  17. package/dist/types-Da6JRmhw.d.ts +879 -0
  18. package/package.json +26 -66
  19. package/dist/lib/actions.d.ts +0 -192
  20. package/dist/lib/annotation-plugin.d.ts +0 -310
  21. package/dist/lib/geometry/cloudy-border.d.ts +0 -90
  22. package/dist/lib/geometry/index.d.ts +0 -2
  23. package/dist/lib/geometry/rotation.d.ts +0 -32
  24. package/dist/lib/handlers/callout-free-text.handler.d.ts +0 -3
  25. package/dist/lib/handlers/circle.handler.d.ts +0 -3
  26. package/dist/lib/handlers/click-detector.d.ts +0 -27
  27. package/dist/lib/handlers/free-text.handler.d.ts +0 -3
  28. package/dist/lib/handlers/index.d.ts +0 -14
  29. package/dist/lib/handlers/ink.handler.d.ts +0 -3
  30. package/dist/lib/handlers/insert-text.handler.d.ts +0 -8
  31. package/dist/lib/handlers/line.handler.d.ts +0 -3
  32. package/dist/lib/handlers/link.handler.d.ts +0 -3
  33. package/dist/lib/handlers/polygon.handler.d.ts +0 -3
  34. package/dist/lib/handlers/polyline.handler.d.ts +0 -3
  35. package/dist/lib/handlers/replace-text.handler.d.ts +0 -9
  36. package/dist/lib/handlers/selection-utils.d.ts +0 -7
  37. package/dist/lib/handlers/square.handler.d.ts +0 -3
  38. package/dist/lib/handlers/stamp.handler.d.ts +0 -3
  39. package/dist/lib/handlers/text-markup.handler.d.ts +0 -7
  40. package/dist/lib/handlers/text.handler.d.ts +0 -3
  41. package/dist/lib/handlers/types.d.ts +0 -176
  42. package/dist/lib/helpers.d.ts +0 -46
  43. package/dist/lib/index.d.ts +0 -21
  44. package/dist/lib/manifest.d.ts +0 -4
  45. package/dist/lib/patching/base-patch.d.ts +0 -87
  46. package/dist/lib/patching/index.d.ts +0 -6
  47. package/dist/lib/patching/insert-upright.d.ts +0 -20
  48. package/dist/lib/patching/line-ending-handlers.d.ts +0 -20
  49. package/dist/lib/patching/line-endings.d.ts +0 -13
  50. package/dist/lib/patching/patch-registry.d.ts +0 -40
  51. package/dist/lib/patching/patch-utils.d.ts +0 -97
  52. package/dist/lib/patching/patches/callout-freetext.patch.d.ts +0 -3
  53. package/dist/lib/patching/patches/circle.patch.d.ts +0 -3
  54. package/dist/lib/patching/patches/freetext.patch.d.ts +0 -3
  55. package/dist/lib/patching/patches/index.d.ts +0 -9
  56. package/dist/lib/patching/patches/ink.patch.d.ts +0 -3
  57. package/dist/lib/patching/patches/line.patch.d.ts +0 -3
  58. package/dist/lib/patching/patches/polygon.patch.d.ts +0 -3
  59. package/dist/lib/patching/patches/polyline.patch.d.ts +0 -3
  60. package/dist/lib/patching/patches/square.patch.d.ts +0 -3
  61. package/dist/lib/patching/patches/stamp.patch.d.ts +0 -3
  62. package/dist/lib/reducer.d.ts +0 -6
  63. package/dist/lib/selectors.d.ts +0 -139
  64. package/dist/lib/tools/default-tools.d.ts +0 -521
  65. package/dist/lib/tools/tools-utils.d.ts +0 -453
  66. package/dist/lib/tools/types.d.ts +0 -209
  67. package/dist/lib/types.d.ts +0 -671
  68. package/dist/lib/utils/index.d.ts +0 -1
  69. package/dist/lib/utils/use-state.d.ts +0 -12
  70. package/dist/preact/adapter.d.ts +0 -14
  71. package/dist/preact/core.d.ts +0 -1
  72. package/dist/preact/index.cjs +0 -2
  73. package/dist/preact/index.cjs.map +0 -1
  74. package/dist/preact/index.d.ts +0 -1
  75. package/dist/preact/index.js +0 -4013
  76. package/dist/preact/index.js.map +0 -1
  77. package/dist/preact/interaction-manager.d.ts +0 -1
  78. package/dist/preact/selection.d.ts +0 -1
  79. package/dist/preact/utils.d.ts +0 -1
  80. package/dist/react/adapter.d.ts +0 -6
  81. package/dist/react/core.d.ts +0 -1
  82. package/dist/react/index.cjs +0 -2
  83. package/dist/react/index.cjs.map +0 -1
  84. package/dist/react/index.d.ts +0 -1
  85. package/dist/react/index.js +0 -4014
  86. package/dist/react/index.js.map +0 -1
  87. package/dist/react/interaction-manager.d.ts +0 -1
  88. package/dist/react/selection.d.ts +0 -1
  89. package/dist/react/utils.d.ts +0 -1
  90. package/dist/shared/annotation-bounds.d.ts +0 -14
  91. package/dist/shared/components/annotation-container.d.ts +0 -71
  92. package/dist/shared/components/annotation-layer.d.ts +0 -33
  93. package/dist/shared/components/annotation-navigation-handler.d.ts +0 -1
  94. package/dist/shared/components/annotation-paint-layer.d.ts +0 -7
  95. package/dist/shared/components/annotations/callout-free-text-preview.d.ts +0 -15
  96. package/dist/shared/components/annotations/callout-free-text.d.ts +0 -15
  97. package/dist/shared/components/annotations/caret.d.ts +0 -24
  98. package/dist/shared/components/annotations/circle.d.ts +0 -35
  99. package/dist/shared/components/annotations/free-text.d.ts +0 -17
  100. package/dist/shared/components/annotations/ink.d.ts +0 -27
  101. package/dist/shared/components/annotations/line.d.ts +0 -35
  102. package/dist/shared/components/annotations/link-locked.d.ts +0 -3
  103. package/dist/shared/components/annotations/link.d.ts +0 -28
  104. package/dist/shared/components/annotations/polygon.d.ts +0 -23
  105. package/dist/shared/components/annotations/polyline.d.ts +0 -23
  106. package/dist/shared/components/annotations/square.d.ts +0 -35
  107. package/dist/shared/components/annotations/stamp.d.ts +0 -13
  108. package/dist/shared/components/annotations/text.d.ts +0 -14
  109. package/dist/shared/components/annotations.d.ts +0 -22
  110. package/dist/shared/components/appearance-image.d.ts +0 -12
  111. package/dist/shared/components/built-in-renderers.d.ts +0 -2
  112. package/dist/shared/components/group-selection-box.d.ts +0 -40
  113. package/dist/shared/components/index.d.ts +0 -2
  114. package/dist/shared/components/preview-renderer.d.ts +0 -8
  115. package/dist/shared/components/render-annotation.d.ts +0 -13
  116. package/dist/shared/components/text-markup/highlight.d.ts +0 -16
  117. package/dist/shared/components/text-markup/squiggly.d.ts +0 -16
  118. package/dist/shared/components/text-markup/strikeout.d.ts +0 -16
  119. package/dist/shared/components/text-markup/underline.d.ts +0 -16
  120. package/dist/shared/components/text-markup.d.ts +0 -7
  121. package/dist/shared/components/types.d.ts +0 -253
  122. package/dist/shared/context/index.d.ts +0 -1
  123. package/dist/shared/context/renderer-registry.d.ts +0 -21
  124. package/dist/shared/hooks/index.d.ts +0 -2
  125. package/dist/shared/hooks/use-annotation.d.ts +0 -19
  126. package/dist/shared/hooks/use-ios-zoom-prevention.d.ts +0 -16
  127. package/dist/shared/index.d.ts +0 -6
  128. package/dist/shared/types.d.ts +0 -10
  129. package/dist/shared-preact/annotation-bounds.d.ts +0 -14
  130. package/dist/shared-preact/components/annotation-container.d.ts +0 -71
  131. package/dist/shared-preact/components/annotation-layer.d.ts +0 -33
  132. package/dist/shared-preact/components/annotation-navigation-handler.d.ts +0 -1
  133. package/dist/shared-preact/components/annotation-paint-layer.d.ts +0 -7
  134. package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +0 -15
  135. package/dist/shared-preact/components/annotations/callout-free-text.d.ts +0 -15
  136. package/dist/shared-preact/components/annotations/caret.d.ts +0 -24
  137. package/dist/shared-preact/components/annotations/circle.d.ts +0 -35
  138. package/dist/shared-preact/components/annotations/free-text.d.ts +0 -17
  139. package/dist/shared-preact/components/annotations/ink.d.ts +0 -27
  140. package/dist/shared-preact/components/annotations/line.d.ts +0 -35
  141. package/dist/shared-preact/components/annotations/link-locked.d.ts +0 -3
  142. package/dist/shared-preact/components/annotations/link.d.ts +0 -28
  143. package/dist/shared-preact/components/annotations/polygon.d.ts +0 -23
  144. package/dist/shared-preact/components/annotations/polyline.d.ts +0 -23
  145. package/dist/shared-preact/components/annotations/square.d.ts +0 -35
  146. package/dist/shared-preact/components/annotations/stamp.d.ts +0 -13
  147. package/dist/shared-preact/components/annotations/text.d.ts +0 -14
  148. package/dist/shared-preact/components/annotations.d.ts +0 -22
  149. package/dist/shared-preact/components/appearance-image.d.ts +0 -12
  150. package/dist/shared-preact/components/built-in-renderers.d.ts +0 -2
  151. package/dist/shared-preact/components/group-selection-box.d.ts +0 -40
  152. package/dist/shared-preact/components/index.d.ts +0 -2
  153. package/dist/shared-preact/components/preview-renderer.d.ts +0 -8
  154. package/dist/shared-preact/components/render-annotation.d.ts +0 -13
  155. package/dist/shared-preact/components/text-markup/highlight.d.ts +0 -16
  156. package/dist/shared-preact/components/text-markup/squiggly.d.ts +0 -16
  157. package/dist/shared-preact/components/text-markup/strikeout.d.ts +0 -16
  158. package/dist/shared-preact/components/text-markup/underline.d.ts +0 -16
  159. package/dist/shared-preact/components/text-markup.d.ts +0 -7
  160. package/dist/shared-preact/components/types.d.ts +0 -253
  161. package/dist/shared-preact/context/index.d.ts +0 -1
  162. package/dist/shared-preact/context/renderer-registry.d.ts +0 -21
  163. package/dist/shared-preact/hooks/index.d.ts +0 -2
  164. package/dist/shared-preact/hooks/use-annotation.d.ts +0 -19
  165. package/dist/shared-preact/hooks/use-ios-zoom-prevention.d.ts +0 -15
  166. package/dist/shared-preact/index.d.ts +0 -6
  167. package/dist/shared-preact/types.d.ts +0 -10
  168. package/dist/shared-react/annotation-bounds.d.ts +0 -14
  169. package/dist/shared-react/components/annotation-container.d.ts +0 -71
  170. package/dist/shared-react/components/annotation-layer.d.ts +0 -33
  171. package/dist/shared-react/components/annotation-navigation-handler.d.ts +0 -1
  172. package/dist/shared-react/components/annotation-paint-layer.d.ts +0 -7
  173. package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +0 -15
  174. package/dist/shared-react/components/annotations/callout-free-text.d.ts +0 -15
  175. package/dist/shared-react/components/annotations/caret.d.ts +0 -24
  176. package/dist/shared-react/components/annotations/circle.d.ts +0 -35
  177. package/dist/shared-react/components/annotations/free-text.d.ts +0 -17
  178. package/dist/shared-react/components/annotations/ink.d.ts +0 -27
  179. package/dist/shared-react/components/annotations/line.d.ts +0 -35
  180. package/dist/shared-react/components/annotations/link-locked.d.ts +0 -3
  181. package/dist/shared-react/components/annotations/link.d.ts +0 -28
  182. package/dist/shared-react/components/annotations/polygon.d.ts +0 -23
  183. package/dist/shared-react/components/annotations/polyline.d.ts +0 -23
  184. package/dist/shared-react/components/annotations/square.d.ts +0 -35
  185. package/dist/shared-react/components/annotations/stamp.d.ts +0 -13
  186. package/dist/shared-react/components/annotations/text.d.ts +0 -14
  187. package/dist/shared-react/components/annotations.d.ts +0 -22
  188. package/dist/shared-react/components/appearance-image.d.ts +0 -12
  189. package/dist/shared-react/components/built-in-renderers.d.ts +0 -2
  190. package/dist/shared-react/components/group-selection-box.d.ts +0 -40
  191. package/dist/shared-react/components/index.d.ts +0 -2
  192. package/dist/shared-react/components/preview-renderer.d.ts +0 -8
  193. package/dist/shared-react/components/render-annotation.d.ts +0 -13
  194. package/dist/shared-react/components/text-markup/highlight.d.ts +0 -16
  195. package/dist/shared-react/components/text-markup/squiggly.d.ts +0 -16
  196. package/dist/shared-react/components/text-markup/strikeout.d.ts +0 -16
  197. package/dist/shared-react/components/text-markup/underline.d.ts +0 -16
  198. package/dist/shared-react/components/text-markup.d.ts +0 -7
  199. package/dist/shared-react/components/types.d.ts +0 -253
  200. package/dist/shared-react/context/index.d.ts +0 -1
  201. package/dist/shared-react/context/renderer-registry.d.ts +0 -21
  202. package/dist/shared-react/hooks/index.d.ts +0 -2
  203. package/dist/shared-react/hooks/use-annotation.d.ts +0 -19
  204. package/dist/shared-react/hooks/use-ios-zoom-prevention.d.ts +0 -16
  205. package/dist/shared-react/index.d.ts +0 -6
  206. package/dist/shared-react/types.d.ts +0 -10
  207. package/dist/shared-vue/annotation-bounds.d.ts +0 -14
  208. package/dist/svelte/components/AnnotationContainer.svelte.d.ts +0 -26
  209. package/dist/svelte/components/AnnotationLayer.svelte.d.ts +0 -40
  210. package/dist/svelte/components/AnnotationNavigationHandler.svelte.d.ts +0 -3
  211. package/dist/svelte/components/AnnotationPaintLayer.svelte.d.ts +0 -8
  212. package/dist/svelte/components/Annotations.svelte.d.ts +0 -28
  213. package/dist/svelte/components/AppearanceImage.svelte.d.ts +0 -8
  214. package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +0 -40
  215. package/dist/svelte/components/PreviewRenderer.svelte.d.ts +0 -9
  216. package/dist/svelte/components/RenderAnnotation.svelte.d.ts +0 -14
  217. package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +0 -7
  218. package/dist/svelte/components/TextMarkup.svelte.d.ts +0 -8
  219. package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +0 -15
  220. package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +0 -10
  221. package/dist/svelte/components/annotations/Caret.svelte.d.ts +0 -13
  222. package/dist/svelte/components/annotations/Circle.svelte.d.ts +0 -19
  223. package/dist/svelte/components/annotations/CirclePreview.svelte.d.ts +0 -10
  224. package/dist/svelte/components/annotations/FreeText.svelte.d.ts +0 -16
  225. package/dist/svelte/components/annotations/FreeTextPreview.svelte.d.ts +0 -10
  226. package/dist/svelte/components/annotations/Ink.svelte.d.ts +0 -15
  227. package/dist/svelte/components/annotations/InkPreview.svelte.d.ts +0 -10
  228. package/dist/svelte/components/annotations/Line.svelte.d.ts +0 -19
  229. package/dist/svelte/components/annotations/LinePreview.svelte.d.ts +0 -10
  230. package/dist/svelte/components/annotations/Link.svelte.d.ts +0 -24
  231. package/dist/svelte/components/annotations/LinkLockedMode.svelte.d.ts +0 -5
  232. package/dist/svelte/components/annotations/LinkPreview.svelte.d.ts +0 -10
  233. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +0 -21
  234. package/dist/svelte/components/annotations/PolygonPreview.svelte.d.ts +0 -10
  235. package/dist/svelte/components/annotations/Polyline.svelte.d.ts +0 -19
  236. package/dist/svelte/components/annotations/PolylinePreview.svelte.d.ts +0 -10
  237. package/dist/svelte/components/annotations/Square.svelte.d.ts +0 -19
  238. package/dist/svelte/components/annotations/SquarePreview.svelte.d.ts +0 -10
  239. package/dist/svelte/components/annotations/Stamp.svelte.d.ts +0 -13
  240. package/dist/svelte/components/annotations/StampPreview.svelte.d.ts +0 -10
  241. package/dist/svelte/components/annotations/Text.svelte.d.ts +0 -10
  242. package/dist/svelte/components/annotations/index.d.ts +0 -10
  243. package/dist/svelte/components/built-in-renderers.d.ts +0 -2
  244. package/dist/svelte/components/index.d.ts +0 -11
  245. package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +0 -5
  246. package/dist/svelte/components/renderers/CaretRenderer.svelte.d.ts +0 -5
  247. package/dist/svelte/components/renderers/CircleRenderer.svelte.d.ts +0 -5
  248. package/dist/svelte/components/renderers/FreeTextRenderer.svelte.d.ts +0 -5
  249. package/dist/svelte/components/renderers/HighlightRenderer.svelte.d.ts +0 -5
  250. package/dist/svelte/components/renderers/InkRenderer.svelte.d.ts +0 -5
  251. package/dist/svelte/components/renderers/LineRenderer.svelte.d.ts +0 -5
  252. package/dist/svelte/components/renderers/LinkRenderer.svelte.d.ts +0 -5
  253. package/dist/svelte/components/renderers/PolygonRenderer.svelte.d.ts +0 -5
  254. package/dist/svelte/components/renderers/PolylineRenderer.svelte.d.ts +0 -5
  255. package/dist/svelte/components/renderers/SquareRenderer.svelte.d.ts +0 -5
  256. package/dist/svelte/components/renderers/SquigglyRenderer.svelte.d.ts +0 -5
  257. package/dist/svelte/components/renderers/StampRenderer.svelte.d.ts +0 -5
  258. package/dist/svelte/components/renderers/StrikeoutRenderer.svelte.d.ts +0 -5
  259. package/dist/svelte/components/renderers/TextRenderer.svelte.d.ts +0 -5
  260. package/dist/svelte/components/renderers/UnderlineRenderer.svelte.d.ts +0 -5
  261. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +0 -16
  262. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +0 -16
  263. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +0 -16
  264. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +0 -16
  265. package/dist/svelte/components/text-markup/index.d.ts +0 -4
  266. package/dist/svelte/components/types.d.ts +0 -66
  267. package/dist/svelte/context/index.d.ts +0 -2
  268. package/dist/svelte/context/renderer-registry.svelte.d.ts +0 -20
  269. package/dist/svelte/context/types.d.ts +0 -129
  270. package/dist/svelte/hooks/index.d.ts +0 -2
  271. package/dist/svelte/hooks/use-annotation.svelte.d.ts +0 -21
  272. package/dist/svelte/hooks/use-ios-zoom-prevention.svelte.d.ts +0 -6
  273. package/dist/svelte/index.cjs +0 -2
  274. package/dist/svelte/index.cjs.map +0 -1
  275. package/dist/svelte/index.d.ts +0 -6
  276. package/dist/svelte/index.js +0 -5257
  277. package/dist/svelte/index.js.map +0 -1
  278. package/dist/svelte/types.d.ts +0 -126
  279. package/dist/vue/components/annotation-container.vue.d.ts +0 -134
  280. package/dist/vue/components/annotation-layer.vue.d.ts +0 -99
  281. package/dist/vue/components/annotation-navigation-handler.vue.d.ts +0 -3
  282. package/dist/vue/components/annotation-paint-layer.vue.d.ts +0 -8
  283. package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +0 -10
  284. package/dist/vue/components/annotations/callout-free-text.vue.d.ts +0 -25
  285. package/dist/vue/components/annotations/caret.vue.d.ts +0 -24
  286. package/dist/vue/components/annotations/circle-preview.vue.d.ts +0 -10
  287. package/dist/vue/components/annotations/circle.vue.d.ts +0 -37
  288. package/dist/vue/components/annotations/free-text-preview.vue.d.ts +0 -10
  289. package/dist/vue/components/annotations/free-text.vue.d.ts +0 -25
  290. package/dist/vue/components/annotations/index.d.ts +0 -10
  291. package/dist/vue/components/annotations/ink-preview.vue.d.ts +0 -10
  292. package/dist/vue/components/annotations/ink.vue.d.ts +0 -27
  293. package/dist/vue/components/annotations/line-preview.vue.d.ts +0 -10
  294. package/dist/vue/components/annotations/line.vue.d.ts +0 -38
  295. package/dist/vue/components/annotations/link-locked.vue.d.ts +0 -5
  296. package/dist/vue/components/annotations/link-preview.vue.d.ts +0 -10
  297. package/dist/vue/components/annotations/link.vue.d.ts +0 -47
  298. package/dist/vue/components/annotations/polygon-preview.vue.d.ts +0 -10
  299. package/dist/vue/components/annotations/polygon.vue.d.ts +0 -43
  300. package/dist/vue/components/annotations/polyline-preview.vue.d.ts +0 -10
  301. package/dist/vue/components/annotations/polyline.vue.d.ts +0 -38
  302. package/dist/vue/components/annotations/square-preview.vue.d.ts +0 -10
  303. package/dist/vue/components/annotations/square.vue.d.ts +0 -37
  304. package/dist/vue/components/annotations/stamp-preview.vue.d.ts +0 -10
  305. package/dist/vue/components/annotations/stamp.vue.d.ts +0 -19
  306. package/dist/vue/components/annotations/text.vue.d.ts +0 -14
  307. package/dist/vue/components/annotations.vue.d.ts +0 -111
  308. package/dist/vue/components/appearance-image.vue.d.ts +0 -9
  309. package/dist/vue/components/built-in-renderers.d.ts +0 -2
  310. package/dist/vue/components/group-selection-box.vue.d.ts +0 -98
  311. package/dist/vue/components/index.d.ts +0 -11
  312. package/dist/vue/components/preview-renderer.vue.d.ts +0 -9
  313. package/dist/vue/components/render-annotation.vue.d.ts +0 -16
  314. package/dist/vue/components/renderer-registry-provider.vue.d.ts +0 -13
  315. package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +0 -6
  316. package/dist/vue/components/renderers/caret-renderer.vue.d.ts +0 -6
  317. package/dist/vue/components/renderers/circle-renderer.vue.d.ts +0 -6
  318. package/dist/vue/components/renderers/free-text-renderer.vue.d.ts +0 -6
  319. package/dist/vue/components/renderers/highlight-renderer.vue.d.ts +0 -6
  320. package/dist/vue/components/renderers/ink-renderer.vue.d.ts +0 -6
  321. package/dist/vue/components/renderers/line-renderer.vue.d.ts +0 -6
  322. package/dist/vue/components/renderers/link-renderer.vue.d.ts +0 -6
  323. package/dist/vue/components/renderers/polygon-renderer.vue.d.ts +0 -6
  324. package/dist/vue/components/renderers/polyline-renderer.vue.d.ts +0 -6
  325. package/dist/vue/components/renderers/square-renderer.vue.d.ts +0 -6
  326. package/dist/vue/components/renderers/squiggly-renderer.vue.d.ts +0 -6
  327. package/dist/vue/components/renderers/stamp-renderer.vue.d.ts +0 -6
  328. package/dist/vue/components/renderers/strikeout-renderer.vue.d.ts +0 -6
  329. package/dist/vue/components/renderers/text-renderer.vue.d.ts +0 -6
  330. package/dist/vue/components/renderers/underline-renderer.vue.d.ts +0 -6
  331. package/dist/vue/components/text-markup/highlight.vue.d.ts +0 -27
  332. package/dist/vue/components/text-markup/index.d.ts +0 -4
  333. package/dist/vue/components/text-markup/squiggly.vue.d.ts +0 -27
  334. package/dist/vue/components/text-markup/strikeout.vue.d.ts +0 -27
  335. package/dist/vue/components/text-markup/underline.vue.d.ts +0 -27
  336. package/dist/vue/components/text-markup.vue.d.ts +0 -8
  337. package/dist/vue/context/index.d.ts +0 -2
  338. package/dist/vue/context/renderer-registry.d.ts +0 -26
  339. package/dist/vue/context/types.d.ts +0 -129
  340. package/dist/vue/hooks/index.d.ts +0 -2
  341. package/dist/vue/hooks/use-annotation.d.ts +0 -50
  342. package/dist/vue/hooks/use-ios-zoom-prevention.d.ts +0 -7
  343. package/dist/vue/index.cjs +0 -2
  344. package/dist/vue/index.cjs.map +0 -1
  345. package/dist/vue/index.d.ts +0 -6
  346. package/dist/vue/index.js +0 -4984
  347. package/dist/vue/index.js.map +0 -1
  348. package/dist/vue/types.d.ts +0 -94
package/package.json CHANGED
@@ -1,90 +1,50 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-annotation",
3
- "version": "2.15.0",
3
+ "version": "3.0.0-next.0",
4
+ "private": false,
5
+ "description": "Annotation feature plugin: the pure annotation-core wired to the engine repository (optimistic create/patch/delete) + the interaction hub (ambient edit + draw tools). Behaviors (forms) plug in here.",
4
6
  "type": "module",
5
- "license": "MIT",
6
- "main": "./dist/index.cjs",
7
+ "main": "./dist/index.js",
7
8
  "module": "./dist/index.js",
8
9
  "types": "./dist/index.d.ts",
9
10
  "exports": {
10
11
  ".": {
11
- "types": "./dist/index.d.ts",
12
12
  "import": "./dist/index.js",
13
13
  "require": "./dist/index.cjs"
14
14
  },
15
- "./preact": {
16
- "types": "./dist/preact/index.d.ts",
17
- "import": "./dist/preact/index.js",
18
- "require": "./dist/preact/index.cjs"
15
+ "./internal": {
16
+ "import": "./dist/internal.js",
17
+ "require": "./dist/internal.cjs"
19
18
  },
20
- "./react": {
21
- "types": "./dist/react/index.d.ts",
22
- "import": "./dist/react/index.js",
23
- "require": "./dist/react/index.cjs"
24
- },
25
- "./vue": {
26
- "types": "./dist/vue/index.d.ts",
27
- "import": "./dist/vue/index.js",
28
- "require": "./dist/vue/index.cjs"
29
- },
30
- "./svelte": {
31
- "types": "./dist/svelte/index.d.ts",
32
- "svelte": "./dist/svelte/index.js",
33
- "import": "./dist/svelte/index.js",
34
- "require": "./dist/svelte/index.cjs"
35
- }
19
+ "./package.json": "./package.json"
36
20
  },
21
+ "files": [
22
+ "dist"
23
+ ],
37
24
  "dependencies": {
38
- "@embedpdf/models": "2.15.0",
39
- "@embedpdf/utils": "2.15.0"
25
+ "@embedpdf/engine-core": "3.0.0-next.0",
26
+ "@embedpdf/plugin-interaction": "3.0.0-next.0",
27
+ "@embedpdf/core-annotation": "3.0.0-next.0",
28
+ "@embedpdf/plugin-selection": "3.0.0-next.0",
29
+ "@embedpdf/core": "3.0.0-next.0",
30
+ "@embedpdf/core-geometry": "3.0.0-next.0"
40
31
  },
41
32
  "devDependencies": {
42
- "@types/react": "^18.2.0",
43
- "@types/react-dom": "^18.2.0",
44
33
  "typescript": "^5.0.0",
45
- "@embedpdf/build": "1.1.0",
46
- "@embedpdf/plugin-interaction-manager": "2.15.0",
47
- "@embedpdf/plugin-history": "2.15.0",
48
- "@embedpdf/plugin-scroll": "2.15.0",
49
- "@embedpdf/plugin-selection": "2.15.0"
50
- },
51
- "peerDependencies": {
52
- "react": ">=16.8.0",
53
- "react-dom": ">=16.8.0",
54
- "preact": "^10.26.4",
55
- "vue": ">=3.2.0",
56
- "svelte": ">=5 <6",
57
- "@embedpdf/core": "2.15.0",
58
- "@embedpdf/plugin-selection": "2.15.0",
59
- "@embedpdf/plugin-interaction-manager": "2.15.0",
60
- "@embedpdf/plugin-scroll": "2.15.0",
61
- "@embedpdf/plugin-history": "2.15.0"
34
+ "vitest": "^2.1.9",
35
+ "@embedpdf/tooling-build": "0.0.0"
62
36
  },
63
- "files": [
64
- "dist",
65
- "README.md"
66
- ],
37
+ "license": "Apache-2.0",
38
+ "sideEffects": false,
67
39
  "repository": {
68
40
  "type": "git",
69
- "url": "https://github.com/embedpdf/embed-pdf-viewer",
70
- "directory": "packages/plugin-annotation"
71
- },
72
- "homepage": "https://www.embedpdf.com/docs",
73
- "bugs": {
74
- "url": "https://github.com/embedpdf/embed-pdf-viewer/issues"
75
- },
76
- "publishConfig": {
77
- "access": "public"
41
+ "url": "git+https://github.com/embedpdf/embed-pdf-viewer.git",
42
+ "directory": "packages/plugin/annotation"
78
43
  },
79
44
  "scripts": {
80
- "build:base": "vite build --mode base",
81
- "build:react": "vite build --mode react",
82
- "build:preact": "vite build --mode preact",
83
- "build:vue": "vite build --mode vue",
84
- "build:svelte": "vite build --mode svelte",
85
- "build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue,svelte \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\" \"vite build --mode svelte\"",
45
+ "build": "epdf-build",
86
46
  "clean": "rimraf dist",
87
- "lint": "eslint src --color",
88
- "lint:fix": "eslint src --color --fix"
47
+ "typecheck": "tsc -p tsconfig.json --noEmit",
48
+ "test": "vitest run"
89
49
  }
90
50
  }
@@ -1,192 +0,0 @@
1
- import { Action } from '@embedpdf/core';
2
- import { PdfAnnotationObject } from '@embedpdf/models';
3
- import { AnnotationTool } from './tools/types';
4
- import { AnnotationDocumentState, LockMode } from './types';
5
- export declare const INIT_ANNOTATION_STATE = "ANNOTATION/INIT_STATE";
6
- export declare const CLEANUP_ANNOTATION_STATE = "ANNOTATION/CLEANUP_STATE";
7
- export declare const SET_ACTIVE_DOCUMENT = "ANNOTATION/SET_ACTIVE_DOCUMENT";
8
- export declare const SET_ANNOTATIONS = "ANNOTATION/SET_ANNOTATIONS";
9
- export declare const SELECT_ANNOTATION = "ANNOTATION/SELECT_ANNOTATION";
10
- export declare const DESELECT_ANNOTATION = "ANNOTATION/DESELECT_ANNOTATION";
11
- export declare const ADD_TO_SELECTION = "ANNOTATION/ADD_TO_SELECTION";
12
- export declare const REMOVE_FROM_SELECTION = "ANNOTATION/REMOVE_FROM_SELECTION";
13
- export declare const SET_SELECTION = "ANNOTATION/SET_SELECTION";
14
- export declare const SET_ACTIVE_TOOL_ID = "ANNOTATION/SET_ACTIVE_TOOL_ID";
15
- export declare const CREATE_ANNOTATION = "ANNOTATION/CREATE_ANNOTATION";
16
- export declare const PATCH_ANNOTATION = "ANNOTATION/PATCH_ANNOTATION";
17
- export declare const MOVE_ANNOTATION = "ANNOTATION/MOVE_ANNOTATION";
18
- export declare const DELETE_ANNOTATION = "ANNOTATION/DELETE_ANNOTATION";
19
- export declare const COMMIT_PENDING_CHANGES = "ANNOTATION/COMMIT";
20
- export declare const PURGE_ANNOTATION = "ANNOTATION/PURGE_ANNOTATION";
21
- export declare const SET_LOCKED = "ANNOTATION/SET_LOCKED";
22
- export declare const SYNC_ANNOTATION_OBJECT = "ANNOTATION/SYNC_OBJECT";
23
- export declare const ADD_COLOR_PRESET = "ANNOTATION/ADD_COLOR_PRESET";
24
- export declare const SET_TOOL_DEFAULTS = "ANNOTATION/SET_TOOL_DEFAULTS";
25
- export declare const ADD_TOOL = "ANNOTATION/ADD_TOOL";
26
- export interface InitAnnotationStateAction extends Action {
27
- type: typeof INIT_ANNOTATION_STATE;
28
- payload: {
29
- documentId: string;
30
- state: AnnotationDocumentState;
31
- };
32
- }
33
- export interface CleanupAnnotationStateAction extends Action {
34
- type: typeof CLEANUP_ANNOTATION_STATE;
35
- payload: string;
36
- }
37
- export interface SetActiveDocumentAction extends Action {
38
- type: typeof SET_ACTIVE_DOCUMENT;
39
- payload: string | null;
40
- }
41
- export interface SetAnnotationsAction extends Action {
42
- type: typeof SET_ANNOTATIONS;
43
- payload: {
44
- documentId: string;
45
- annotations: Record<number, PdfAnnotationObject[]>;
46
- };
47
- }
48
- export interface SelectAnnotationAction extends Action {
49
- type: typeof SELECT_ANNOTATION;
50
- payload: {
51
- documentId: string;
52
- pageIndex: number;
53
- id: string;
54
- };
55
- }
56
- export interface DeselectAnnotationAction extends Action {
57
- type: typeof DESELECT_ANNOTATION;
58
- payload: {
59
- documentId: string;
60
- };
61
- }
62
- export interface AddToSelectionAction extends Action {
63
- type: typeof ADD_TO_SELECTION;
64
- payload: {
65
- documentId: string;
66
- pageIndex: number;
67
- id: string;
68
- };
69
- }
70
- export interface RemoveFromSelectionAction extends Action {
71
- type: typeof REMOVE_FROM_SELECTION;
72
- payload: {
73
- documentId: string;
74
- id: string;
75
- };
76
- }
77
- export interface SetSelectionAction extends Action {
78
- type: typeof SET_SELECTION;
79
- payload: {
80
- documentId: string;
81
- ids: string[];
82
- };
83
- }
84
- export interface SetActiveToolIdAction extends Action {
85
- type: typeof SET_ACTIVE_TOOL_ID;
86
- payload: {
87
- documentId: string;
88
- toolId: string | null;
89
- context?: Record<string, unknown>;
90
- };
91
- }
92
- export interface CreateAnnotationAction extends Action {
93
- type: typeof CREATE_ANNOTATION;
94
- payload: {
95
- documentId: string;
96
- pageIndex: number;
97
- annotation: PdfAnnotationObject;
98
- };
99
- }
100
- export interface PatchAnnotationAction extends Action {
101
- type: typeof PATCH_ANNOTATION;
102
- payload: {
103
- documentId: string;
104
- pageIndex: number;
105
- id: string;
106
- patch: Partial<PdfAnnotationObject>;
107
- };
108
- }
109
- export interface MoveAnnotationAction extends Action {
110
- type: typeof MOVE_ANNOTATION;
111
- payload: {
112
- documentId: string;
113
- pageIndex: number;
114
- id: string;
115
- patch: Partial<PdfAnnotationObject>;
116
- };
117
- }
118
- export interface DeleteAnnotationAction extends Action {
119
- type: typeof DELETE_ANNOTATION;
120
- payload: {
121
- documentId: string;
122
- pageIndex: number;
123
- id: string;
124
- };
125
- }
126
- export interface CommitAction extends Action {
127
- type: typeof COMMIT_PENDING_CHANGES;
128
- payload: {
129
- documentId: string;
130
- committedUids: string[];
131
- };
132
- }
133
- export interface PurgeAnnotationAction extends Action {
134
- type: typeof PURGE_ANNOTATION;
135
- payload: {
136
- documentId: string;
137
- pageIndex: number;
138
- uid: string;
139
- };
140
- }
141
- export interface SetLockedAction extends Action {
142
- type: typeof SET_LOCKED;
143
- payload: {
144
- documentId: string;
145
- mode: LockMode;
146
- };
147
- }
148
- export interface SyncAnnotationObjectAction extends Action {
149
- type: typeof SYNC_ANNOTATION_OBJECT;
150
- payload: {
151
- documentId: string;
152
- id: string;
153
- patch: Partial<PdfAnnotationObject>;
154
- };
155
- }
156
- export interface AddColorPresetAction extends Action {
157
- type: typeof ADD_COLOR_PRESET;
158
- payload: string;
159
- }
160
- export interface SetToolDefaultsAction extends Action {
161
- type: typeof SET_TOOL_DEFAULTS;
162
- payload: {
163
- toolId: string;
164
- patch: Partial<PdfAnnotationObject> & Record<string, unknown>;
165
- };
166
- }
167
- export interface AddToolAction extends Action {
168
- type: typeof ADD_TOOL;
169
- payload: AnnotationTool<any>;
170
- }
171
- export type AnnotationAction = InitAnnotationStateAction | CleanupAnnotationStateAction | SetActiveDocumentAction | SetAnnotationsAction | SelectAnnotationAction | DeselectAnnotationAction | AddToSelectionAction | RemoveFromSelectionAction | SetSelectionAction | SetActiveToolIdAction | CreateAnnotationAction | PatchAnnotationAction | MoveAnnotationAction | DeleteAnnotationAction | CommitAction | PurgeAnnotationAction | SetLockedAction | SyncAnnotationObjectAction | AddColorPresetAction | SetToolDefaultsAction | AddToolAction;
172
- export declare function initAnnotationState(documentId: string, state: AnnotationDocumentState): InitAnnotationStateAction;
173
- export declare function cleanupAnnotationState(documentId: string): CleanupAnnotationStateAction;
174
- export declare function setActiveDocument(documentId: string | null): SetActiveDocumentAction;
175
- export declare const setAnnotations: (documentId: string, annotations: Record<number, PdfAnnotationObject[]>) => SetAnnotationsAction;
176
- export declare const selectAnnotation: (documentId: string, pageIndex: number, id: string) => SelectAnnotationAction;
177
- export declare const deselectAnnotation: (documentId: string) => DeselectAnnotationAction;
178
- export declare const addToSelection: (documentId: string, pageIndex: number, id: string) => AddToSelectionAction;
179
- export declare const removeFromSelection: (documentId: string, id: string) => RemoveFromSelectionAction;
180
- export declare const setSelection: (documentId: string, ids: string[]) => SetSelectionAction;
181
- export declare const setActiveToolId: (documentId: string, toolId: string | null, context?: Record<string, unknown>) => SetActiveToolIdAction;
182
- export declare const createAnnotation: (documentId: string, pageIndex: number, annotation: PdfAnnotationObject) => CreateAnnotationAction;
183
- export declare const patchAnnotation: (documentId: string, pageIndex: number, id: string, patch: Partial<PdfAnnotationObject>) => PatchAnnotationAction;
184
- export declare const moveAnnotation: (documentId: string, pageIndex: number, id: string, patch: Partial<PdfAnnotationObject>) => MoveAnnotationAction;
185
- export declare const deleteAnnotation: (documentId: string, pageIndex: number, id: string) => DeleteAnnotationAction;
186
- export declare const commitPendingChanges: (documentId: string, committedUids: string[]) => CommitAction;
187
- export declare const purgeAnnotation: (documentId: string, pageIndex: number, uid: string) => PurgeAnnotationAction;
188
- export declare const setLockedAction: (documentId: string, mode: LockMode) => SetLockedAction;
189
- export declare const syncAnnotationObject: (documentId: string, id: string, patch: Partial<PdfAnnotationObject>) => SyncAnnotationObjectAction;
190
- export declare const addColorPreset: (c: string) => AddColorPresetAction;
191
- export declare const setToolDefaults: (toolId: string, patch: Partial<PdfAnnotationObject> & Record<string, unknown>) => SetToolDefaultsAction;
192
- export declare const addTool: (tool: AnnotationTool<any>) => AddToolAction;
@@ -1,310 +0,0 @@
1
- import { BasePlugin, PluginRegistry } from '@embedpdf/core';
2
- import { PdfAnnotationObject, Position, Rect } from '@embedpdf/models';
3
- import { AnnotationCapability, AnnotationPluginConfig, AnnotationState, UnifiedDragOptions, UnifiedDragState, UnifiedDragEvent, UnifiedResizeOptions, UnifiedResizeState, UnifiedResizeEvent, UnifiedRotateOptions, UnifiedRotateState, UnifiedRotateEvent, LockMode } from './types';
4
- import { AnnotationAction } from './actions';
5
- import { AnnotationTool, AnnotationToolMap, ToolById, ToolId } from './tools/types';
6
- import { PreviewState, HandlerServices } from './handlers/types';
7
- export declare class AnnotationPlugin extends BasePlugin<AnnotationPluginConfig, AnnotationCapability, AnnotationState, AnnotationAction> {
8
- static readonly id: "annotation";
9
- private readonly ANNOTATION_HISTORY_TOPIC;
10
- private static readonly defaultHandlerFactories;
11
- readonly config: AnnotationPluginConfig;
12
- private readonly state$;
13
- private readonly interactionManager;
14
- private readonly selection;
15
- private readonly history;
16
- private readonly scroll;
17
- private pendingContexts;
18
- private isInitialLoadComplete;
19
- private importQueue;
20
- private commitInProgress;
21
- private readonly activeTool$;
22
- private readonly events$;
23
- private readonly toolsChange$;
24
- private readonly appearanceCache;
25
- private readonly unifiedDragStates;
26
- private readonly unifiedDrag$;
27
- private readonly unifiedResizeStates;
28
- private readonly unifiedResize$;
29
- private readonly unifiedRotateStates;
30
- private readonly unifiedRotate$;
31
- private readonly navigate$;
32
- constructor(id: string, registry: PluginRegistry, config: AnnotationPluginConfig);
33
- protected onDocumentLoadingStarted(documentId: string): void;
34
- protected onDocumentLoaded(documentId: string): void;
35
- protected onDocumentClosed(documentId: string): void;
36
- initialize(): Promise<void>;
37
- private registerInteractionForTool;
38
- protected buildCapability(): AnnotationCapability;
39
- private createAnnotationScope;
40
- onStoreUpdated(prev: AnnotationState, next: AnnotationState): void;
41
- private transformAnnotation;
42
- registerPageHandlers(documentId: string, pageIndex: number, scale: number, callbacks: {
43
- services: HandlerServices;
44
- onPreview: (toolId: string, state: PreviewState | null) => void;
45
- }): () => void;
46
- private getDocumentState;
47
- private getAllAnnotations;
48
- private getPageAnnotations;
49
- private getSelectedAnnotation;
50
- private getAnnotationById;
51
- private getAnnotationsMethod;
52
- private renderAnnotation;
53
- /**
54
- * Batch-fetch rendered appearance stream images for all annotations on a page.
55
- * Results are cached per document + page. Call invalidatePageAppearances to clear.
56
- */
57
- private getPageAppearances;
58
- /**
59
- * Clear cached appearances for a specific page (e.g. on zoom change).
60
- */
61
- private invalidatePageAppearances;
62
- /**
63
- * Remove a single annotation's entry from the page appearance cache.
64
- * Used after committing changes that regenerate the annotation's appearance.
65
- */
66
- private invalidateAnnotationAppearance;
67
- private exportAnnotationsMethod;
68
- private importAnnotations;
69
- private processImportQueue;
70
- private processImportItems;
71
- private createAnnotation;
72
- private buildPatch;
73
- private updateAnnotation;
74
- private deleteAnnotation;
75
- private deleteAnnotationsMethod;
76
- private deleteAllAnnotationsMethod;
77
- private purgeAnnotationMethod;
78
- private selectAnnotation;
79
- private deselectAnnotation;
80
- /**
81
- * Derive page activity from the current annotation selection.
82
- * Called from onStoreUpdated whenever selectedUids changes,
83
- * so ALL selection code paths are covered automatically.
84
- */
85
- private updateAnnotationSelectionActivity;
86
- private getSelectedAnnotationsMethod;
87
- private getSelectedAnnotationIdsMethod;
88
- private toggleSelectionMethod;
89
- private addToSelectionMethod;
90
- private removeFromSelectionMethod;
91
- private setSelectionMethod;
92
- private getAttachedLinksMethod;
93
- private hasAttachedLinksMethod;
94
- private deleteAttachedLinksMethod;
95
- /**
96
- * Group the currently selected annotations.
97
- * The first selected annotation becomes the group leader.
98
- * All other selected annotations get their IRT set to the leader's ID with RT = Group.
99
- */
100
- private groupAnnotationsMethod;
101
- /**
102
- * Ungroup all annotations in the group containing the specified annotation.
103
- * Clears IRT and RT from all group members (the leader doesn't have them).
104
- */
105
- private ungroupAnnotationsMethod;
106
- /**
107
- * Get all annotations in the same group as the specified annotation.
108
- */
109
- private getGroupMembersMethod;
110
- /**
111
- * Check if an annotation is part of a group.
112
- */
113
- private isInGroupMethod;
114
- /**
115
- * Get the available grouping action for the current selection.
116
- */
117
- private getGroupingActionMethod;
118
- /**
119
- * Compute combined constraints from all selected annotations.
120
- * This finds the "weakest link" in each direction - the annotation with the least
121
- * room to move determines the group's limit.
122
- */
123
- private computeCombinedConstraints;
124
- /**
125
- * Clamp a delta to the combined constraints.
126
- * Negative y = moving up, positive y = moving down
127
- * Negative x = moving left, positive x = moving right
128
- */
129
- private clampDelta;
130
- /**
131
- * Start a unified drag operation.
132
- * The plugin automatically expands the selection to include attached links.
133
- * Framework components should call this instead of building their own logic.
134
- *
135
- * @param documentId - The document ID
136
- * @param options - Drag options (annotationIds and pageSize)
137
- */
138
- startDrag(documentId: string, options: UnifiedDragOptions): void;
139
- /**
140
- * Compute preview patches for all drag participants.
141
- * Uses transformAnnotation to properly handle vertices, inkList, etc.
142
- */
143
- private computeDragPreviewPatches;
144
- /**
145
- * Update the drag delta during a unified drag operation.
146
- * Returns the clamped delta synchronously for the caller's preview.
147
- *
148
- * @param documentId - The document ID
149
- * @param rawDelta - The unconstrained delta from the drag gesture
150
- * @returns The clamped delta
151
- */
152
- updateDrag(documentId: string, rawDelta: Position): Position;
153
- /**
154
- * Commit the drag - plugin builds and applies ALL patches.
155
- * This is the key method that centralizes patch building in the plugin.
156
- *
157
- * @param documentId - The document ID
158
- */
159
- commitDrag(documentId: string): void;
160
- /**
161
- * Cancel the drag without committing.
162
- *
163
- * @param documentId - The document ID
164
- */
165
- cancelDrag(documentId: string): void;
166
- /**
167
- * Get the current unified drag state for a document.
168
- */
169
- getDragState(documentId: string): UnifiedDragState | null;
170
- /**
171
- * Subscribe to unified drag state changes.
172
- * Framework components use this for preview updates.
173
- */
174
- get onDragChange(): import('@embedpdf/core').EventHook<UnifiedDragEvent>;
175
- /**
176
- * Compute the union bounding box of multiple rects.
177
- */
178
- private computeUnifiedGroupBoundingBox;
179
- /**
180
- * Compute relative positions for annotations within a group bounding box.
181
- */
182
- private computeUnifiedRelativePositions;
183
- /**
184
- * Compute new rects for all annotations based on the new group bounding box.
185
- */
186
- private computeUnifiedResizedRects;
187
- /**
188
- * Compute preview patches for all resize participants.
189
- * Uses transformAnnotation to properly handle vertices, inkList, etc.
190
- */
191
- private computeResizePreviewPatches;
192
- /**
193
- * Start a unified resize operation.
194
- * The plugin automatically expands the selection to include attached links.
195
- *
196
- * @param documentId - The document ID
197
- * @param options - Resize options
198
- */
199
- startResize(documentId: string, options: UnifiedResizeOptions): void;
200
- /**
201
- * Update the resize with a new group bounding box.
202
- * Returns the computed rects synchronously for immediate preview use.
203
- *
204
- * @param documentId - The document ID
205
- * @param newGroupBox - The new group bounding box
206
- * @returns Record of annotation ID to new rect
207
- */
208
- updateResize(documentId: string, newGroupBox: Rect): Record<string, Rect>;
209
- /**
210
- * Commit the resize - plugin builds and applies ALL patches.
211
- *
212
- * @param documentId - The document ID
213
- */
214
- commitResize(documentId: string): void;
215
- /**
216
- * Cancel the resize without committing.
217
- *
218
- * @param documentId - The document ID
219
- */
220
- cancelResize(documentId: string): void;
221
- /**
222
- * Get the current unified resize state for a document.
223
- */
224
- getResizeState(documentId: string): UnifiedResizeState | null;
225
- /**
226
- * Subscribe to unified resize state changes.
227
- * Framework components use this for preview updates.
228
- */
229
- get onResizeChange(): import('@embedpdf/core').EventHook<UnifiedResizeEvent>;
230
- private cloneRect;
231
- private translateRect;
232
- private normalizeAngle;
233
- private normalizeDelta;
234
- private buildRotationParticipants;
235
- private computeRotatePreviewPatches;
236
- startRotation(documentId: string, options: UnifiedRotateOptions): void;
237
- updateRotation(documentId: string, cursorAngle: number, rotationDelta?: number): void;
238
- commitRotation(documentId: string): void;
239
- cancelRotation(documentId: string): void;
240
- getRotateState(documentId: string): UnifiedRotateState | null;
241
- /**
242
- * Subscribe to unified rotation state changes.
243
- */
244
- get onRotateChange(): import('@embedpdf/core').EventHook<UnifiedRotateEvent>;
245
- private updateAnnotationsMethod;
246
- private moveAnnotationsMethod;
247
- private moveAnnotationMethod;
248
- getActiveTool(documentId?: string): AnnotationTool | null;
249
- setActiveTool(toolId: string | null, documentId?: string, context?: Record<string, unknown>): void;
250
- getTool<TId extends ToolId<AnnotationToolMap>>(toolId: TId): (ToolById<AnnotationToolMap, TId> & AnnotationTool) | undefined;
251
- getTool(toolId: string): AnnotationTool | undefined;
252
- findToolForAnnotation(annotation: PdfAnnotationObject): AnnotationTool | null;
253
- setLocked(mode: LockMode, documentId?: string): void;
254
- getLocked(documentId?: string): LockMode;
255
- isAnnotationLocked(annotation: PdfAnnotationObject, documentId?: string): boolean;
256
- /**
257
- * Whether the annotation can be interacted with at all (selected, edited, menu shown).
258
- * Returns false for `noView`, `hidden`, `readOnly`, or category-locked annotations.
259
- * This is the spec-compliant "can the user do anything with this?" predicate.
260
- */
261
- isAnnotationInteractive(annotation: PdfAnnotationObject, documentId?: string): boolean;
262
- /**
263
- * Whether the annotation's structure (position, size, rotation, vertices) is locked.
264
- * Non-interactive annotations are treated as structurally locked. PDF `locked` flag
265
- * makes an otherwise-interactive annotation structurally locked while still selectable.
266
- */
267
- isAnnotationStructurallyLocked(annotation: PdfAnnotationObject, documentId?: string): boolean;
268
- /**
269
- * Whether the annotation's content (e.g. FreeText text) is locked.
270
- * Non-interactive annotations are treated as content-locked. PDF `lockedContents`
271
- * flag blocks content edits while still allowing move/resize.
272
- */
273
- isAnnotationContentLocked(annotation: PdfAnnotationObject, documentId?: string): boolean;
274
- /**
275
- * Whether a specific annotation is eligible to be added to the selection store.
276
- * Differs from the subtype-based `isSelectableAnnotation` helper: that answers
277
- * "is this subtype ever selectable?", while this answers "is this specific
278
- * annotation selectable right now given its flags and document lock state?".
279
- */
280
- private isAnnotationSelectable;
281
- isCategoryLockedMethod(category: string, documentId?: string): boolean;
282
- isToolLockedMethod(toolId: string, documentId?: string): boolean;
283
- syncAnnotationObject(id: string, patch: Partial<PdfAnnotationObject>, documentId?: string): void;
284
- private navigateTargetMethod;
285
- /**
286
- * Collects all pending annotation changes for a document into a batch.
287
- * This separates the "what to commit" from "how to commit" for cleaner code.
288
- */
289
- private collectPendingChanges;
290
- /**
291
- * Executes a batch of pending changes by creating engine tasks.
292
- * Returns a task that resolves when all operations complete.
293
- */
294
- private executeCommitBatch;
295
- /**
296
- * Emits commit events for all completed operations.
297
- * Centralizes event emission for cleaner separation of concerns.
298
- */
299
- private emitCommitEvents;
300
- /**
301
- * Attempts to acquire the commit lock for a document.
302
- * Returns true if acquired, false if a commit is already in progress.
303
- */
304
- private acquireCommitLock;
305
- /**
306
- * Releases the commit lock for a document.
307
- */
308
- private releaseCommitLock;
309
- private commit;
310
- }