@embedpdf/plugin-annotation 2.15.0 → 3.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -1,90 +0,0 @@
1
- /**
2
- * Cloudy border path generator for PDF annotations.
3
- *
4
- * Framework-agnostic utility that generates SVG path `d` strings for cloudy
5
- * (scalloped) borders on Rectangle, Ellipse, and Polygon shapes.
6
- *
7
- * Derived from Apache PDFBox's CloudyBorder.java:
8
- * https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/CloudyBorder.java
9
- *
10
- * Original code licensed under the Apache License, Version 2.0:
11
- * https://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Substantially modified: ported from Java to TypeScript, adapted for SVG
14
- * path output, and reworked curl distribution and merging logic.
15
- *
16
- * Copyright (c) 2026 CloudPDF / EmbedPDF
17
- *
18
- * @module
19
- */
20
- interface BBox {
21
- minX: number;
22
- minY: number;
23
- maxX: number;
24
- maxY: number;
25
- }
26
- /** Rect differences (inset from annotation Rect to drawn shape). */
27
- export interface RectDifferences {
28
- left: number;
29
- top: number;
30
- right: number;
31
- bottom: number;
32
- }
33
- export interface CloudyPathResult {
34
- /** SVG path `d` attribute string */
35
- path: string;
36
- /** Bounding box of the generated cloudy border (in annotation-local coords) */
37
- bbox: BBox;
38
- }
39
- /**
40
- * Returns the per-side outward extent of a cloudy border (how far the
41
- * scallop peaks + stroke extend beyond the inner shape boundary).
42
- *
43
- * Use this to compute `rectangleDifferences` for Square/Circle or the
44
- * padding for Polygon Rect computation.
45
- */
46
- export declare function getCloudyBorderExtent(intensity: number, lineWidth: number, isEllipse: boolean): number;
47
- /**
48
- * Generates a cloudy border SVG path for a rectangle (Square annotation).
49
- *
50
- * @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
51
- * @param rd - Rectangle differences (inset), or undefined
52
- * @param intensity - Cloudy border intensity (typically 1 or 2)
53
- * @param lineWidth - Stroke width of the annotation border
54
- */
55
- export declare function generateCloudyRectanglePath(rect: {
56
- x: number;
57
- y: number;
58
- width: number;
59
- height: number;
60
- }, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
61
- /**
62
- * Generates a cloudy border SVG path for an ellipse (Circle annotation).
63
- *
64
- * @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
65
- * @param rd - Rectangle differences (inset), or undefined
66
- * @param intensity - Cloudy border intensity (typically 1 or 2)
67
- * @param lineWidth - Stroke width of the annotation border
68
- */
69
- export declare function generateCloudyEllipsePath(rect: {
70
- x: number;
71
- y: number;
72
- width: number;
73
- height: number;
74
- }, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
75
- /**
76
- * Generates a cloudy border SVG path for a polygon.
77
- *
78
- * @param vertices - The polygon vertices in annotation-local coordinates
79
- * @param rectOrigin - The annotation rect origin `{ x, y }` for coordinate translation
80
- * @param intensity - Cloudy border intensity (typically 1 or 2)
81
- * @param lineWidth - Stroke width of the annotation border
82
- */
83
- export declare function generateCloudyPolygonPath(vertices: ReadonlyArray<{
84
- x: number;
85
- y: number;
86
- }>, rectOrigin: {
87
- x: number;
88
- y: number;
89
- }, intensity: number, lineWidth: number): CloudyPathResult;
90
- export {};
@@ -1,2 +0,0 @@
1
- export * from './rotation';
2
- export * from './cloudy-border';
@@ -1,32 +0,0 @@
1
- import { Rect } from '@embedpdf/models';
2
- /**
3
- * Re-export rotation geometry utilities from @embedpdf/models.
4
- *
5
- * These functions used to live here but have been promoted to the shared models
6
- * package so that both @embedpdf/utils (DragResizeController) and
7
- * @embedpdf/plugin-annotation (patches) can import from the same source.
8
- *
9
- * Existing imports from this module continue to work unchanged.
10
- */
11
- export { rotatePointAround as rotatePointAroundCenter, rotateVertices, getRectCenter, calculateRotatedRectAABBAroundPoint, calculateRotatedRectAABB, inferRotationCenterFromRects, } from '@embedpdf/models';
12
- /**
13
- * Convert an AABB-space rect to unrotated space.
14
- *
15
- * During group resize the pipeline works in AABB space (axis-aligned bounding
16
- * box), but `baseResizeScaling` expects the incoming rect in unrotated space.
17
- *
18
- * The AABB of a rect rotated by θ around its center is:
19
- * AABB_w = w·|cosθ| + h·|sinθ|
20
- * AABB_h = w·|sinθ| + h·|cosθ|
21
- *
22
- * This function inverts that system to recover (w, h) from the new AABB size.
23
- * Near 45° the system is degenerate (the AABB is always square), so we fall
24
- * back to uniform scaling based on the area ratio.
25
- *
26
- * @param newAABBRect - the proportionally scaled AABB rect from the group resize
27
- * @param originalAABBRect - the original AABB rect captured at resize start
28
- * @param originalUnrotatedRect - the original unrotated rect captured at resize start
29
- * @param rotationDegrees - the annotation's rotation in degrees
30
- * @returns the equivalent rect in unrotated space
31
- */
32
- export declare function convertAABBRectToUnrotatedSpace(newAABBRect: Rect, originalAABBRect: Rect, originalUnrotatedRect: Rect, rotationDegrees: number): Rect;
@@ -1,3 +0,0 @@
1
- import { PdfFreeTextAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const calloutFreeTextHandlerFactory: HandlerFactory<PdfFreeTextAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfCircleAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const circleHandlerFactory: HandlerFactory<PdfCircleAnnoObject>;
@@ -1,27 +0,0 @@
1
- import { PdfAnnotationObject } from '@embedpdf/models';
2
- import { AnnotationTool } from '../tools/types';
3
- interface ClickDetectorOptions<T extends PdfAnnotationObject> {
4
- threshold?: number;
5
- getTool: () => AnnotationTool<T> | undefined;
6
- onClickDetected: (pos: {
7
- x: number;
8
- y: number;
9
- }, tool: AnnotationTool<T>) => void;
10
- }
11
- export declare function useClickDetector<T extends PdfAnnotationObject>({ threshold, getTool, onClickDetected, }: ClickDetectorOptions<T>): {
12
- onStart: (pos: {
13
- x: number;
14
- y: number;
15
- }) => void;
16
- onMove: (pos: {
17
- x: number;
18
- y: number;
19
- }) => void;
20
- onEnd: (pos: {
21
- x: number;
22
- y: number;
23
- }) => void;
24
- hasMoved: () => boolean;
25
- reset: () => void;
26
- };
27
- export {};
@@ -1,3 +0,0 @@
1
- import { PdfFreeTextAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const freeTextHandlerFactory: HandlerFactory<PdfFreeTextAnnoObject>;
@@ -1,14 +0,0 @@
1
- export * from './ink.handler';
2
- export * from './text.handler';
3
- export * from './free-text.handler';
4
- export * from './callout-free-text.handler';
5
- export * from './line.handler';
6
- export * from './polyline.handler';
7
- export * from './polygon.handler';
8
- export * from './square.handler';
9
- export * from './stamp.handler';
10
- export * from './circle.handler';
11
- export * from './link.handler';
12
- export * from './text-markup.handler';
13
- export * from './insert-text.handler';
14
- export * from './replace-text.handler';
@@ -1,3 +0,0 @@
1
- import { PdfInkAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const inkHandlerFactory: HandlerFactory<PdfInkAnnoObject>;
@@ -1,8 +0,0 @@
1
- import { PdfCaretAnnoObject } from '@embedpdf/models';
2
- import { SelectionHandlerFactory } from './types';
3
- /**
4
- * Selection handler for the "Insert Text" tool.
5
- * Creates a single Caret annotation at the end of the text selection
6
- * with intent "Insert".
7
- */
8
- export declare const insertTextSelectionHandler: SelectionHandlerFactory<PdfCaretAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfLineAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const lineHandlerFactory: HandlerFactory<PdfLineAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfLinkAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const linkHandlerFactory: HandlerFactory<PdfLinkAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfPolygonAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const polygonHandlerFactory: HandlerFactory<PdfPolygonAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfPolylineAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const polylineHandlerFactory: HandlerFactory<PdfPolylineAnnoObject>;
@@ -1,9 +0,0 @@
1
- import { PdfStrikeOutAnnoObject } from '@embedpdf/models';
2
- import { SelectionHandlerFactory } from './types';
3
- /**
4
- * Selection handler for the "Replace Text" tool.
5
- * Creates a Caret annotation (group leader, intent "Replace") at the end
6
- * of the selection, plus a StrikeOut annotation (intent "StrikeOutTextEdit")
7
- * over the full selection, linked to the Caret via IRT/RT=Group.
8
- */
9
- export declare const replaceTextSelectionHandler: SelectionHandlerFactory<PdfStrikeOutAnnoObject>;
@@ -1,7 +0,0 @@
1
- import { Rect } from '@embedpdf/models';
2
- /**
3
- * Compute a caret annotation rect at the end of a text selection.
4
- * The caret is half the line height, bottom-aligned with the line,
5
- * and horizontally centered on the line's end edge.
6
- */
7
- export declare function computeCaretRect(lastSegRect: Rect): Rect;
@@ -1,3 +0,0 @@
1
- import { PdfSquareAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const squareHandlerFactory: HandlerFactory<PdfSquareAnnoObject>;
@@ -1,3 +0,0 @@
1
- import { PdfStampAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const stampHandlerFactory: HandlerFactory<PdfStampAnnoObject>;
@@ -1,7 +0,0 @@
1
- import { SelectionHandlerFactory } from './types';
2
- /**
3
- * Default selection handler for text-markup tools (highlight, underline,
4
- * strikeout, squiggly). Used as a fallback when no tool-specific
5
- * SelectionHandlerFactory is registered.
6
- */
7
- export declare const textMarkupSelectionHandler: SelectionHandlerFactory;
@@ -1,3 +0,0 @@
1
- import { PdfTextAnnoObject } from '@embedpdf/models';
2
- import { HandlerFactory } from './types';
3
- export declare const textHandlerFactory: HandlerFactory<PdfTextAnnoObject>;
@@ -1,176 +0,0 @@
1
- import { PointerEventHandlersWithLifecycle } from '@embedpdf/plugin-interaction-manager';
2
- import { PdfAnnotationObject, PdfAnnotationSubtype, Rect, Rotation, Size, AnnotationCreateContext, PdfAnnotationBorderStyle, Position, LineEndings, PdfInkListObject, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment, PdfBlendMode, PdfAnnotationLineEnding } from '@embedpdf/models';
3
- import { FormattedSelection } from '@embedpdf/plugin-selection';
4
- import { AnnotationTool } from '../tools/types';
5
- export interface CirclePreviewData {
6
- rect: Rect;
7
- color: string;
8
- opacity: number;
9
- strokeWidth: number;
10
- strokeColor: string;
11
- strokeStyle: PdfAnnotationBorderStyle;
12
- strokeDashArray: number[];
13
- }
14
- export interface SquarePreviewData extends CirclePreviewData {
15
- }
16
- export interface PolygonPreviewData {
17
- rect: Rect;
18
- vertices: Position[];
19
- currentVertex: Position;
20
- color?: string;
21
- opacity?: number;
22
- strokeWidth: number;
23
- strokeColor?: string;
24
- strokeStyle?: PdfAnnotationBorderStyle;
25
- strokeDashArray?: number[];
26
- }
27
- export interface PolylinePreviewData {
28
- rect: Rect;
29
- vertices: Position[];
30
- currentVertex: Position;
31
- color: string;
32
- strokeColor: string;
33
- opacity: number;
34
- strokeWidth: number;
35
- lineEndings?: LineEndings;
36
- }
37
- export interface LinePreviewData {
38
- rect: Rect;
39
- linePoints: {
40
- start: Position;
41
- end: Position;
42
- };
43
- strokeWidth: number;
44
- color: string;
45
- strokeColor: string;
46
- opacity: number;
47
- lineEndings?: LineEndings;
48
- strokeStyle: PdfAnnotationBorderStyle;
49
- strokeDashArray: number[];
50
- }
51
- export interface InkPreviewData {
52
- rect: Rect;
53
- inkList: PdfInkListObject[];
54
- strokeWidth: number;
55
- strokeColor: string;
56
- opacity: number;
57
- blendMode?: PdfBlendMode;
58
- }
59
- export interface FreeTextPreviewData {
60
- rect: Rect;
61
- fontColor?: string;
62
- opacity?: number;
63
- fontSize?: number;
64
- fontFamily?: PdfStandardFont;
65
- backgroundColor?: string;
66
- textAlign?: PdfTextAlignment;
67
- verticalAlign?: PdfVerticalAlignment;
68
- contents?: string;
69
- calloutLine?: Position[];
70
- textBox?: Rect;
71
- strokeColor?: string;
72
- strokeWidth?: number;
73
- lineEnding?: PdfAnnotationLineEnding;
74
- color?: string;
75
- }
76
- export interface LinkPreviewData {
77
- rect: Rect;
78
- strokeColor: string;
79
- strokeWidth: number;
80
- strokeStyle: PdfAnnotationBorderStyle;
81
- strokeDashArray: number[];
82
- }
83
- export interface StampPreviewData {
84
- rect: Rect;
85
- ghostUrl: string;
86
- pageRotation: Rotation;
87
- }
88
- /**
89
- * Map types to their preview data
90
- */
91
- export interface PreviewDataMap {
92
- [PdfAnnotationSubtype.CIRCLE]: CirclePreviewData;
93
- [PdfAnnotationSubtype.SQUARE]: SquarePreviewData;
94
- [PdfAnnotationSubtype.POLYGON]: PolygonPreviewData;
95
- [PdfAnnotationSubtype.POLYLINE]: PolylinePreviewData;
96
- [PdfAnnotationSubtype.LINE]: LinePreviewData;
97
- [PdfAnnotationSubtype.INK]: InkPreviewData;
98
- [PdfAnnotationSubtype.FREETEXT]: FreeTextPreviewData;
99
- [PdfAnnotationSubtype.LINK]: LinkPreviewData;
100
- [PdfAnnotationSubtype.STAMP]: StampPreviewData;
101
- }
102
- /**
103
- * Typed preview state - constrain T to keys that exist in PreviewDataMap
104
- */
105
- export type TypedPreviewState<T extends keyof PreviewDataMap> = {
106
- type: T;
107
- bounds: Rect;
108
- data: PreviewDataMap[T];
109
- };
110
- /**
111
- * Union of all preview states
112
- */
113
- export type AnyPreviewState = {
114
- [K in keyof PreviewDataMap]: TypedPreviewState<K>;
115
- }[keyof PreviewDataMap];
116
- /**
117
- * Generic version for handlers - use conditional type for safety
118
- */
119
- export interface PreviewState<T extends PdfAnnotationSubtype = PdfAnnotationSubtype> {
120
- type: T;
121
- bounds: Rect;
122
- data: T extends keyof PreviewDataMap ? PreviewDataMap[T] : any;
123
- }
124
- /**
125
- * Defines the DOM-based services that the UI layer must provide to the handlers.
126
- * This is the bridge that keeps the core logic framework-agnostic.
127
- */
128
- export interface HandlerServices {
129
- requestFile(options: {
130
- accept: string;
131
- onFile: (file: File) => void;
132
- }): void;
133
- }
134
- /**
135
- * Extensible map from tool ID to per-activation context data.
136
- * Plugins extend this via declaration merging to provide typed context
137
- * for their custom tools (e.g. stamp appearance data, ghost image URL).
138
- */
139
- export interface ToolContextMap {
140
- }
141
- /**
142
- * Resolves the tool context type for a given tool ID.
143
- * Returns the mapped type if known, otherwise a generic record.
144
- */
145
- export type ResolvedToolContext<TId extends string> = TId extends keyof ToolContextMap ? ToolContextMap[TId] : Record<string, unknown>;
146
- /**
147
- * The context object passed to a handler factory when creating a handler.
148
- * It contains all the necessary information and callbacks.
149
- */
150
- export interface HandlerFactory<A extends PdfAnnotationObject, TId extends string = string> {
151
- annotationType: PdfAnnotationSubtype;
152
- create(context: HandlerContext<A, TId>): PointerEventHandlersWithLifecycle;
153
- }
154
- export interface HandlerContext<A extends PdfAnnotationObject, TId extends string = string> {
155
- getTool: () => AnnotationTool<A> | undefined;
156
- getToolContext: () => ResolvedToolContext<TId> | undefined;
157
- pageIndex: number;
158
- pageSize: Size;
159
- /** Effective page rotation (page intrinsic + document rotation), as a quarter-turn value (0-3). */
160
- pageRotation: Rotation;
161
- scale: number;
162
- services: HandlerServices;
163
- onPreview: (state: PreviewState<A['type']> | null) => void;
164
- onCommit: (annotation: A, context?: AnnotationCreateContext<A>) => void;
165
- }
166
- export interface SelectionHandlerContext<A extends PdfAnnotationObject = PdfAnnotationObject> {
167
- toolId: string;
168
- documentId: string;
169
- getTool: () => AnnotationTool<A> | null;
170
- createAnnotation: (pageIndex: number, annotation: PdfAnnotationObject) => void;
171
- selectAnnotation: (pageIndex: number, id: string) => void;
172
- }
173
- export interface SelectionHandlerFactory<A extends PdfAnnotationObject = PdfAnnotationObject> {
174
- toolId: string;
175
- handle(context: SelectionHandlerContext<A>, selections: FormattedSelection[], getText: () => Promise<string | undefined>): void;
176
- }
@@ -1,46 +0,0 @@
1
- import { PdfAnnotationSubtype, PdfAnnotationObject, PdfAnnotationOf, Rect } from '@embedpdf/models';
2
- import { LockMode, TrackedAnnotation } from './types';
3
- import { AnnotationTool } from './tools/types';
4
- /**
5
- * Check if two rectangles intersect
6
- */
7
- export declare function rectsIntersect(a: Rect, b: Rect): boolean;
8
- export type AnnoOf<S extends PdfAnnotationSubtype> = PdfAnnotationOf<S>;
9
- export type TextMarkupSubtype = PdfAnnotationSubtype.HIGHLIGHT | PdfAnnotationSubtype.UNDERLINE | PdfAnnotationSubtype.STRIKEOUT | PdfAnnotationSubtype.SQUIGGLY;
10
- export type SidebarSubtype = TextMarkupSubtype | PdfAnnotationSubtype.TEXT | PdfAnnotationSubtype.INK | PdfAnnotationSubtype.SQUARE | PdfAnnotationSubtype.CIRCLE | PdfAnnotationSubtype.POLYGON | PdfAnnotationSubtype.LINE | PdfAnnotationSubtype.POLYLINE | PdfAnnotationSubtype.FREETEXT | PdfAnnotationSubtype.STAMP | PdfAnnotationSubtype.REDACT | PdfAnnotationSubtype.CARET;
11
- /** True when `a.object.type === INK` – and narrows the generic. */
12
- export declare function isInk(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.INK>>;
13
- /** Example for Circle – create similar ones for Square, Line, etc. */
14
- export declare function isCircle(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.CIRCLE>>;
15
- export declare function isPolygon(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.POLYGON>>;
16
- export declare function isSquare(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.SQUARE>>;
17
- export declare function isLine(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.LINE>>;
18
- export declare function isPolyline(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.POLYLINE>>;
19
- export declare function isHighlight(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.HIGHLIGHT>>;
20
- export declare function isUnderline(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.UNDERLINE>>;
21
- export declare function isStrikeout(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.STRIKEOUT>>;
22
- export declare function isSquiggly(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.SQUIGGLY>>;
23
- export declare function isTextMarkup(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<TextMarkupSubtype>>;
24
- export declare function isFreeText(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.FREETEXT>>;
25
- export declare function isStamp(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.STAMP>>;
26
- export declare function isText(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.TEXT>>;
27
- export declare function isLink(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.LINK>>;
28
- export declare function isRedact(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.REDACT>>;
29
- export declare function isCaret(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.CARET>>;
30
- export declare function isWidget(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.WIDGET>>;
31
- export declare function isSidebarAnnotation(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<SidebarSubtype>>;
32
- export declare function isSelectableAnnotation(a: TrackedAnnotation): boolean;
33
- /** Extract the category tags from a tool (returns `[]` for uncategorized). */
34
- export declare function getAnnotationCategories(tool: AnnotationTool | null): string[];
35
- /** Check if the category-based LockMode locks annotations with these categories. */
36
- export declare function isCategoryLocked(categories: string[], mode: LockMode): boolean;
37
- /** Check if the annotation itself has the PDF 'locked' flag (bit 7). */
38
- export declare function hasLockedFlag(annotation: PdfAnnotationObject): boolean;
39
- /** Check if the annotation has the PDF 'noView' flag (bit 6). */
40
- export declare function hasNoViewFlag(annotation: PdfAnnotationObject): boolean;
41
- /** Check if the annotation has the PDF 'hidden' flag (bit 2): do not render, do not interact, do not print. */
42
- export declare function hasHiddenFlag(annotation: PdfAnnotationObject): boolean;
43
- /** Check if the annotation has the PDF 'readOnly' flag (bit 7): do not allow user interaction. Ignored for widgets per spec. */
44
- export declare function hasReadOnlyFlag(annotation: PdfAnnotationObject): boolean;
45
- /** Check if the annotation has the PDF 'lockedContents' flag (bit 10): content cannot be modified by the user. */
46
- export declare function hasLockedContentsFlag(annotation: PdfAnnotationObject): boolean;
@@ -1,21 +0,0 @@
1
- import { PluginPackage } from '@embedpdf/core';
2
- import { AnnotationPluginConfig, AnnotationState } from './types';
3
- import { AnnotationPlugin } from './annotation-plugin';
4
- import { AnnotationAction } from './actions';
5
- export declare const AnnotationPluginPackage: PluginPackage<AnnotationPlugin, AnnotationPluginConfig, AnnotationState, AnnotationAction>;
6
- export * from './annotation-plugin';
7
- export * from './types';
8
- export * from './manifest';
9
- export * from './selectors';
10
- export * from './helpers';
11
- export * from './handlers/types';
12
- export * from './tools/types';
13
- export type { DefaultAnnotationTool, DefaultAnnotationToolMap } from './tools/default-tools';
14
- export * from './tools/tools-utils';
15
- export * from './geometry';
16
- export * as patching from './patching';
17
- export type { PatchFunction, TransformContext } from './patching/patch-registry';
18
- export * from './patching/insert-upright';
19
- export { initialState, initialDocumentState } from './reducer';
20
- export { useState } from './utils/use-state';
21
- export { useClickDetector } from './handlers/click-detector';
@@ -1,4 +0,0 @@
1
- import { PluginManifest } from '@embedpdf/core';
2
- import { AnnotationPluginConfig } from './types';
3
- export declare const ANNOTATION_PLUGIN_ID = "annotation";
4
- export declare const manifest: PluginManifest<AnnotationPluginConfig>;
@@ -1,87 +0,0 @@
1
- import { Rect } from '@embedpdf/models';
2
- import { TransformContext } from './patch-registry';
3
- /**
4
- * Minimal shape required by the shared patch helpers.
5
- * All annotation objects satisfy this through PdfAnnotationObject.
6
- */
7
- export interface RotatableAnnotation {
8
- rect: Rect;
9
- unrotatedRect?: Rect;
10
- rotation?: number;
11
- }
12
- /**
13
- * Shared rotate logic.
14
- * Returns the full patch (rect, unrotatedRect, rotation) or `null` when the
15
- * context doesn't carry a rotationAngle (in which case the caller should
16
- * fall through to `ctx.changes`).
17
- */
18
- export declare function baseRotateChanges(orig: RotatableAnnotation, ctx: TransformContext<any>): Partial<{
19
- rect: Rect;
20
- unrotatedRect: Rect;
21
- rotation: number;
22
- }> | null;
23
- /**
24
- * Shared property-update rotation logic.
25
- * Recomputes rect and unrotatedRect for a new rotation angle, preserving
26
- * the annotation's rotation center. Works for all annotation types since
27
- * it only touches rect/unrotatedRect/rotation.
28
- */
29
- export declare function basePropertyRotationChanges(orig: RotatableAnnotation, newRotation: number): {
30
- rotation: number;
31
- rect: Rect;
32
- unrotatedRect: Rect;
33
- };
34
- /**
35
- * Shared move logic: computes dx/dy and translates rect + unrotatedRect.
36
- * Callers use the returned `dx`/`dy` to translate their own type-specific
37
- * data (vertices, linePoints, inkList, etc.).
38
- */
39
- export declare function baseMoveChanges(orig: RotatableAnnotation, newRect: Rect): {
40
- dx: number;
41
- dy: number;
42
- rects: {
43
- rect: Rect;
44
- unrotatedRect?: Rect;
45
- };
46
- };
47
- export interface ResizeScalingResult {
48
- /** Horizontal scale factor */
49
- scaleX: number;
50
- /** Vertical scale factor */
51
- scaleY: number;
52
- /** The old rect used as the scaling reference (unrotatedRect ?? rect) */
53
- oldRect: Rect;
54
- /** The adjusted new rect after min-size and aspect-ratio enforcement */
55
- resolvedRect: Rect;
56
- /** The final rect + unrotatedRect patches to spread into the result */
57
- rects: {
58
- rect: Rect;
59
- unrotatedRect?: Rect;
60
- };
61
- }
62
- /**
63
- * Shared resize scaling logic:
64
- * 1. Determines scale factors from oldRect → newRect
65
- * 2. Enforces a minimum size of 10
66
- * 3. Optionally maintains aspect ratio
67
- * 4. Resolves rect vs unrotatedRect for rotated annotations
68
- *
69
- * Callers use `scaleX`, `scaleY`, `oldRect`, and `resolvedRect` to scale
70
- * their own type-specific data (vertices, linePoints, etc.), then spread
71
- * `rects` into their result.
72
- */
73
- export declare function baseResizeScaling(orig: RotatableAnnotation, newRect: Rect, metadata?: {
74
- maintainAspectRatio?: boolean;
75
- }): ResizeScalingResult;
76
- /**
77
- * Compute the orbit translation (dx/dy) from a rotation result.
78
- * Point-based annotations (line, polyline, polygon, ink) use this to
79
- * translate their vertices/points alongside the rect orbit during
80
- * group rotation. For single-annotation rotation the delta is zero.
81
- */
82
- export declare function rotateOrbitDelta(orig: RotatableAnnotation, rotateResult: {
83
- unrotatedRect?: Rect;
84
- }): {
85
- dx: number;
86
- dy: number;
87
- };
@@ -1,6 +0,0 @@
1
- export * from './patch-utils';
2
- export * from './line-ending-handlers';
3
- export * from './line-endings';
4
- export * from './patch-registry';
5
- export * from './insert-upright';
6
- export * from './patches';
@@ -1,20 +0,0 @@
1
- import { PdfAnnotationObject, Rotation, Size } from '@embedpdf/models';
2
- /**
3
- * Applies a counter-rotation to make an annotation appear visually upright
4
- * on a rotated page. Uses `basePropertyRotationChanges` to correctly compute
5
- * rect, unrotatedRect, and rotation for the annotation.
6
- *
7
- * @param annotation - The annotation to transform
8
- * @param pageRotation - Effective page rotation as quarter-turn value (0-3)
9
- * @param rectWasDrawn - `true` if the rect was produced by a marquee drag
10
- * (PagePointerProvider transposes dimensions on 90/270 pages),
11
- * `false` if the rect was placed from config/content (click-to-place, stamp)
12
- * @returns The annotation with rotation, unrotatedRect, and rect set
13
- */
14
- export declare function applyInsertUpright<T extends PdfAnnotationObject>(annotation: T, pageRotation: Rotation, rectWasDrawn: boolean): T;
15
- /**
16
- * Clamps an annotation's rect to stay within page bounds.
17
- * If the annotation has an unrotatedRect, it is shifted by the same delta
18
- * to keep the geometry consistent.
19
- */
20
- export declare function clampAnnotationToPage<T extends PdfAnnotationObject>(annotation: T, pageSize: Size): T;
@@ -1,20 +0,0 @@
1
- import { PdfAnnotationLineEnding, Position } from '@embedpdf/models';
2
- /**
3
- * A handler that encapsulates all logic for a specific line ending type,
4
- * including SVG path generation, geometric vertex calculation, and rotation logic.
5
- * This is the single source of truth for each ending.
6
- */
7
- export interface LineEndingHandler {
8
- /** Returns the SVG `d` attribute string for rendering. */
9
- getSvgPath: (strokeWidth: number) => string;
10
- /** Returns the vertices used for calculating the geometric bounding box. */
11
- getLocalPoints: (strokeWidth: number) => Position[];
12
- /** Returns the final rotation angle in radians based on the line segment's angle. */
13
- getRotation: (segmentAngle: number) => number;
14
- /** True if the shape should be filled, false if only stroked. */
15
- filled: boolean;
16
- }
17
- /**
18
- * A map containing the authoritative handler for each line ending type.
19
- */
20
- export declare const LINE_ENDING_HANDLERS: Partial<Record<PdfAnnotationLineEnding, LineEndingHandler>>;