@embedpdf/vue 0.0.0-stage → 3.0.0-next.16

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 (417) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +258 -2
  3. package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs +124 -0
  4. package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs.map +1 -0
  5. package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js +125 -0
  6. package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js.map +1 -0
  7. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs +20 -0
  8. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs.map +1 -0
  9. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js +21 -0
  10. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js.map +1 -0
  11. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js +192 -0
  12. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js.map +1 -0
  13. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs +191 -0
  14. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs.map +1 -0
  15. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs +682 -0
  16. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs.map +1 -0
  17. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js +683 -0
  18. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js.map +1 -0
  19. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs +174 -0
  20. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs.map +1 -0
  21. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js +175 -0
  22. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js.map +1 -0
  23. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js +33 -0
  24. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js.map +1 -0
  25. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs +32 -0
  26. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs.map +1 -0
  27. package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs +151 -0
  28. package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs.map +1 -0
  29. package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js +152 -0
  30. package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js.map +1 -0
  31. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs +480 -0
  32. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs.map +1 -0
  33. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js +481 -0
  34. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js.map +1 -0
  35. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js +118 -0
  36. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js.map +1 -0
  37. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs +117 -0
  38. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs.map +1 -0
  39. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js +302 -0
  40. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js.map +1 -0
  41. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs +301 -0
  42. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs.map +1 -0
  43. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs +38 -0
  44. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs.map +1 -0
  45. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js +39 -0
  46. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js.map +1 -0
  47. package/dist/actions.cjs +42 -0
  48. package/dist/actions.cjs.map +1 -0
  49. package/dist/actions.d.cts +41 -0
  50. package/dist/actions.d.ts +41 -0
  51. package/dist/actions.js +37 -0
  52. package/dist/actions.js.map +1 -0
  53. package/dist/anchored/Anchored.vue.d.cts +40 -0
  54. package/dist/anchored/Anchored.vue.d.ts +40 -0
  55. package/dist/anchored/AnchoredScope.vue.d.cts +17 -0
  56. package/dist/anchored/AnchoredScope.vue.d.ts +17 -0
  57. package/dist/anchored/PlacedAnchored.vue.d.cts +19 -0
  58. package/dist/anchored/PlacedAnchored.vue.d.ts +19 -0
  59. package/dist/anchored/projector.d.cts +32 -0
  60. package/dist/anchored/projector.d.ts +32 -0
  61. package/dist/anchored.cjs +13 -0
  62. package/dist/anchored.cjs.map +1 -0
  63. package/dist/anchored.d.cts +15 -0
  64. package/dist/anchored.d.ts +15 -0
  65. package/dist/anchored.js +13 -0
  66. package/dist/anchored.js.map +1 -0
  67. package/dist/annotation/AnnotationChrome.vue.d.cts +20 -0
  68. package/dist/annotation/AnnotationChrome.vue.d.ts +20 -0
  69. package/dist/annotation/AnnotationDraftMenu.vue.d.cts +26 -0
  70. package/dist/annotation/AnnotationDraftMenu.vue.d.ts +26 -0
  71. package/dist/annotation/AnnotationFrame.vue.d.cts +25 -0
  72. package/dist/annotation/AnnotationFrame.vue.d.ts +25 -0
  73. package/dist/annotation/AnnotationLayer.vue.d.cts +23 -0
  74. package/dist/annotation/AnnotationLayer.vue.d.ts +23 -0
  75. package/dist/annotation/AnnotationLook.vue.d.cts +21 -0
  76. package/dist/annotation/AnnotationLook.vue.d.ts +21 -0
  77. package/dist/annotation/AnnotationMenu.vue.d.cts +23 -0
  78. package/dist/annotation/AnnotationMenu.vue.d.ts +23 -0
  79. package/dist/annotation/AnnotationRotationBadge.vue.d.cts +26 -0
  80. package/dist/annotation/AnnotationRotationBadge.vue.d.ts +26 -0
  81. package/dist/annotation/AnnotationScene.vue.d.cts +7 -0
  82. package/dist/annotation/AnnotationScene.vue.d.ts +7 -0
  83. package/dist/annotation/FreeTextBox.vue.d.cts +9 -0
  84. package/dist/annotation/FreeTextBox.vue.d.ts +9 -0
  85. package/dist/annotation/NativeDrawing.vue.d.cts +10 -0
  86. package/dist/annotation/NativeDrawing.vue.d.ts +10 -0
  87. package/dist/annotation/StampGhost.vue.d.cts +7 -0
  88. package/dist/annotation/StampGhost.vue.d.ts +7 -0
  89. package/dist/annotation/composables.d.cts +76 -0
  90. package/dist/annotation/composables.d.ts +76 -0
  91. package/dist/annotation/state.d.cts +19 -0
  92. package/dist/annotation/state.d.ts +19 -0
  93. package/dist/annotation/text-box.d.cts +28 -0
  94. package/dist/annotation/text-box.d.ts +28 -0
  95. package/dist/annotation/types.d.cts +154 -0
  96. package/dist/annotation/types.d.ts +154 -0
  97. package/dist/annotation.cjs +29 -0
  98. package/dist/annotation.cjs.map +1 -0
  99. package/dist/annotation.d.cts +35 -0
  100. package/dist/annotation.d.ts +35 -0
  101. package/dist/annotation.js +23 -0
  102. package/dist/annotation.js.map +1 -0
  103. package/dist/attachment.cjs +22 -0
  104. package/dist/attachment.cjs.map +1 -0
  105. package/dist/attachment.d.cts +34 -0
  106. package/dist/attachment.d.ts +34 -0
  107. package/dist/attachment.js +17 -0
  108. package/dist/attachment.js.map +1 -0
  109. package/dist/capabilities-C7YzgPCX.js +164 -0
  110. package/dist/capabilities-C7YzgPCX.js.map +1 -0
  111. package/dist/capabilities-DVNJmgy7.cjs +163 -0
  112. package/dist/capabilities-DVNJmgy7.cjs.map +1 -0
  113. package/dist/commands.cjs +81 -0
  114. package/dist/commands.cjs.map +1 -0
  115. package/dist/commands.d.cts +61 -0
  116. package/dist/commands.d.ts +61 -0
  117. package/dist/commands.js +76 -0
  118. package/dist/commands.js.map +1 -0
  119. package/dist/composables-BGBsNDf9.cjs +25 -0
  120. package/dist/composables-BGBsNDf9.cjs.map +1 -0
  121. package/dist/composables-Bi6QvJpj.cjs +978 -0
  122. package/dist/composables-Bi6QvJpj.cjs.map +1 -0
  123. package/dist/composables-DK3lwh38.js +979 -0
  124. package/dist/composables-DK3lwh38.js.map +1 -0
  125. package/dist/composables-DwsZdg06.js +26 -0
  126. package/dist/composables-DwsZdg06.js.map +1 -0
  127. package/dist/dev-CtMlvxjZ.js +17 -0
  128. package/dist/dev-CtMlvxjZ.js.map +1 -0
  129. package/dist/dev-eeIS2B4c.cjs +16 -0
  130. package/dist/dev-eeIS2B4c.cjs.map +1 -0
  131. package/dist/dev.d.cts +11 -0
  132. package/dist/dev.d.ts +11 -0
  133. package/dist/documents-DUu5H4yH.js +34 -0
  134. package/dist/documents-DUu5H4yH.js.map +1 -0
  135. package/dist/documents-TQ1fMdWI.cjs +33 -0
  136. package/dist/documents-TQ1fMdWI.cjs.map +1 -0
  137. package/dist/form/ButtonControl.vue.d.cts +11 -0
  138. package/dist/form/ButtonControl.vue.d.ts +11 -0
  139. package/dist/form/ComboControl.vue.d.cts +11 -0
  140. package/dist/form/ComboControl.vue.d.ts +11 -0
  141. package/dist/form/FieldPictures.vue.d.cts +3 -0
  142. package/dist/form/FieldPictures.vue.d.ts +3 -0
  143. package/dist/form/FormFocusRing.vue.d.cts +8 -0
  144. package/dist/form/FormFocusRing.vue.d.ts +8 -0
  145. package/dist/form/FormLayer.vue.d.cts +3 -0
  146. package/dist/form/FormLayer.vue.d.ts +3 -0
  147. package/dist/form/ListControl.vue.d.cts +11 -0
  148. package/dist/form/ListControl.vue.d.ts +11 -0
  149. package/dist/form/NativeListBox.vue.d.cts +27 -0
  150. package/dist/form/NativeListBox.vue.d.ts +27 -0
  151. package/dist/form/SignatureControl.vue.d.cts +11 -0
  152. package/dist/form/SignatureControl.vue.d.ts +11 -0
  153. package/dist/form/TextControl.vue.d.cts +11 -0
  154. package/dist/form/TextControl.vue.d.ts +11 -0
  155. package/dist/form/ToggleControl.vue.d.cts +11 -0
  156. package/dist/form/ToggleControl.vue.d.ts +11 -0
  157. package/dist/form/composables.d.cts +52 -0
  158. package/dist/form/composables.d.ts +52 -0
  159. package/dist/form/widget-box.d.cts +34 -0
  160. package/dist/form/widget-box.d.ts +34 -0
  161. package/dist/form.cjs +17 -0
  162. package/dist/form.cjs.map +1 -0
  163. package/dist/form.d.cts +12 -0
  164. package/dist/form.d.ts +12 -0
  165. package/dist/form.js +11 -0
  166. package/dist/form.js.map +1 -0
  167. package/dist/history.cjs +22 -0
  168. package/dist/history.cjs.map +1 -0
  169. package/dist/history.d.cts +31 -0
  170. package/dist/history.d.ts +31 -0
  171. package/dist/history.js +17 -0
  172. package/dist/history.js.map +1 -0
  173. package/dist/i18n.cjs +29 -0
  174. package/dist/i18n.cjs.map +1 -0
  175. package/dist/i18n.d.cts +36 -0
  176. package/dist/i18n.d.ts +36 -0
  177. package/dist/i18n.js +24 -0
  178. package/dist/i18n.js.map +1 -0
  179. package/dist/index.cjs +414 -0
  180. package/dist/index.cjs.map +1 -0
  181. package/dist/index.d.cts +32 -0
  182. package/dist/index.d.ts +32 -0
  183. package/dist/index.js +234 -0
  184. package/dist/index.js.map +1 -0
  185. package/dist/interaction/PagePointerSource.vue.d.cts +3 -0
  186. package/dist/interaction/PagePointerSource.vue.d.ts +3 -0
  187. package/dist/interaction.cjs +63 -0
  188. package/dist/interaction.cjs.map +1 -0
  189. package/dist/interaction.d.cts +40 -0
  190. package/dist/interaction.d.ts +40 -0
  191. package/dist/interaction.js +47 -0
  192. package/dist/interaction.js.map +1 -0
  193. package/dist/link/LinkAnchor.vue.d.cts +9 -0
  194. package/dist/link/LinkAnchor.vue.d.ts +9 -0
  195. package/dist/link/LinkLayer.vue.d.cts +22 -0
  196. package/dist/link/LinkLayer.vue.d.ts +22 -0
  197. package/dist/link/composables.d.cts +29 -0
  198. package/dist/link/composables.d.ts +29 -0
  199. package/dist/link.cjs +14 -0
  200. package/dist/link.cjs.map +1 -0
  201. package/dist/link.d.cts +11 -0
  202. package/dist/link.d.ts +11 -0
  203. package/dist/link.js +8 -0
  204. package/dist/link.js.map +1 -0
  205. package/dist/measurement.cjs +43 -0
  206. package/dist/measurement.cjs.map +1 -0
  207. package/dist/measurement.d.cts +51 -0
  208. package/dist/measurement.d.ts +51 -0
  209. package/dist/measurement.js +38 -0
  210. package/dist/measurement.js.map +1 -0
  211. package/dist/metadata.cjs +22 -0
  212. package/dist/metadata.cjs.map +1 -0
  213. package/dist/metadata.d.cts +31 -0
  214. package/dist/metadata.d.ts +31 -0
  215. package/dist/metadata.js +17 -0
  216. package/dist/metadata.js.map +1 -0
  217. package/dist/outline.cjs +22 -0
  218. package/dist/outline.cjs.map +1 -0
  219. package/dist/outline.d.cts +36 -0
  220. package/dist/outline.d.ts +36 -0
  221. package/dist/outline.js +17 -0
  222. package/dist/outline.js.map +1 -0
  223. package/dist/page-D9XIuLSj.js +16 -0
  224. package/dist/page-D9XIuLSj.js.map +1 -0
  225. package/dist/page-Doy4_Sdz.cjs +15 -0
  226. package/dist/page-Doy4_Sdz.cjs.map +1 -0
  227. package/dist/page-edit.cjs +18 -0
  228. package/dist/page-edit.cjs.map +1 -0
  229. package/dist/page-edit.d.cts +28 -0
  230. package/dist/page-edit.d.ts +28 -0
  231. package/dist/page-edit.js +13 -0
  232. package/dist/page-edit.js.map +1 -0
  233. package/dist/page-layers-c-CJYAUO.cjs +30 -0
  234. package/dist/page-layers-c-CJYAUO.cjs.map +1 -0
  235. package/dist/page-layers-rlh4-1qr.js +31 -0
  236. package/dist/page-layers-rlh4-1qr.js.map +1 -0
  237. package/dist/page-layers.d.cts +21 -0
  238. package/dist/page-layers.d.ts +21 -0
  239. package/dist/page-view/PageView.vue.d.cts +42 -0
  240. package/dist/page-view/PageView.vue.d.ts +42 -0
  241. package/dist/page-view.cjs +5 -0
  242. package/dist/page-view.cjs.map +1 -0
  243. package/dist/page-view.d.cts +10 -0
  244. package/dist/page-view.d.ts +10 -0
  245. package/dist/page-view.js +5 -0
  246. package/dist/page-view.js.map +1 -0
  247. package/dist/projector-CDZn1kh1.js +32 -0
  248. package/dist/projector-CDZn1kh1.js.map +1 -0
  249. package/dist/projector-Cf7879sx.cjs +31 -0
  250. package/dist/projector-Cf7879sx.cjs.map +1 -0
  251. package/dist/redaction.cjs +34 -0
  252. package/dist/redaction.cjs.map +1 -0
  253. package/dist/redaction.d.cts +44 -0
  254. package/dist/redaction.d.ts +44 -0
  255. package/dist/redaction.js +29 -0
  256. package/dist/redaction.js.map +1 -0
  257. package/dist/render/RenderLayer.vue.d.cts +23 -0
  258. package/dist/render/RenderLayer.vue.d.ts +23 -0
  259. package/dist/render/TileImage.vue.d.cts +13 -0
  260. package/dist/render/TileImage.vue.d.ts +13 -0
  261. package/dist/render/TilePlane.vue.d.cts +7 -0
  262. package/dist/render/TilePlane.vue.d.ts +7 -0
  263. package/dist/render.cjs +262 -0
  264. package/dist/render.cjs.map +1 -0
  265. package/dist/render.d.cts +16 -0
  266. package/dist/render.d.ts +16 -0
  267. package/dist/render.js +257 -0
  268. package/dist/render.js.map +1 -0
  269. package/dist/runtime/DocumentGate.vue.d.cts +24 -0
  270. package/dist/runtime/DocumentGate.vue.d.ts +24 -0
  271. package/dist/runtime/DocumentScope.vue.d.cts +16 -0
  272. package/dist/runtime/DocumentScope.vue.d.ts +16 -0
  273. package/dist/runtime/KernelProvider.vue.d.cts +17 -0
  274. package/dist/runtime/KernelProvider.vue.d.ts +17 -0
  275. package/dist/runtime/SvgShapes.vue.d.cts +7 -0
  276. package/dist/runtime/SvgShapes.vue.d.ts +7 -0
  277. package/dist/runtime/Viewer.vue.d.cts +57 -0
  278. package/dist/runtime/Viewer.vue.d.ts +57 -0
  279. package/dist/runtime/capabilities.d.cts +52 -0
  280. package/dist/runtime/capabilities.d.ts +52 -0
  281. package/dist/runtime/documents.d.cts +42 -0
  282. package/dist/runtime/documents.d.ts +42 -0
  283. package/dist/runtime/kernel.d.cts +36 -0
  284. package/dist/runtime/kernel.d.ts +36 -0
  285. package/dist/runtime/page.d.cts +15 -0
  286. package/dist/runtime/page.d.ts +15 -0
  287. package/dist/runtime/refs.d.cts +12 -0
  288. package/dist/runtime/refs.d.ts +12 -0
  289. package/dist/runtime/surface-box.d.cts +12 -0
  290. package/dist/runtime/surface-box.d.ts +12 -0
  291. package/dist/runtime.cjs +53 -0
  292. package/dist/runtime.cjs.map +1 -0
  293. package/dist/runtime.d.cts +24 -0
  294. package/dist/runtime.d.ts +24 -0
  295. package/dist/runtime.js +38 -0
  296. package/dist/runtime.js.map +1 -0
  297. package/dist/scope-BQA4toWB.cjs +17 -0
  298. package/dist/scope-BQA4toWB.cjs.map +1 -0
  299. package/dist/scope-BgdCqnYb.js +18 -0
  300. package/dist/scope-BgdCqnYb.js.map +1 -0
  301. package/dist/search/SearchLayer.vue.d.cts +17 -0
  302. package/dist/search/SearchLayer.vue.d.ts +17 -0
  303. package/dist/search/composables.d.cts +31 -0
  304. package/dist/search/composables.d.ts +31 -0
  305. package/dist/search.cjs +17 -0
  306. package/dist/search.cjs.map +1 -0
  307. package/dist/search.d.cts +10 -0
  308. package/dist/search.d.ts +10 -0
  309. package/dist/search.js +11 -0
  310. package/dist/search.js.map +1 -0
  311. package/dist/selection/SelectionClipboard.vue.d.cts +24 -0
  312. package/dist/selection/SelectionClipboard.vue.d.ts +24 -0
  313. package/dist/selection/SelectionHandles.vue.d.cts +8 -0
  314. package/dist/selection/SelectionHandles.vue.d.ts +8 -0
  315. package/dist/selection/SelectionLayer.vue.d.cts +3 -0
  316. package/dist/selection/SelectionLayer.vue.d.ts +3 -0
  317. package/dist/selection/SelectionMenu.vue.d.cts +23 -0
  318. package/dist/selection/SelectionMenu.vue.d.ts +23 -0
  319. package/dist/selection/composables.d.cts +24 -0
  320. package/dist/selection/composables.d.ts +24 -0
  321. package/dist/selection.cjs +24 -0
  322. package/dist/selection.cjs.map +1 -0
  323. package/dist/selection.d.cts +16 -0
  324. package/dist/selection.d.ts +16 -0
  325. package/dist/selection.js +15 -0
  326. package/dist/selection.js.map +1 -0
  327. package/dist/shell.cjs +72 -0
  328. package/dist/shell.cjs.map +1 -0
  329. package/dist/shell.d.cts +56 -0
  330. package/dist/shell.d.ts +56 -0
  331. package/dist/shell.js +67 -0
  332. package/dist/shell.js.map +1 -0
  333. package/dist/signature/composables.d.cts +39 -0
  334. package/dist/signature/composables.d.ts +39 -0
  335. package/dist/signature.cjs +16 -0
  336. package/dist/signature.cjs.map +1 -0
  337. package/dist/signature.d.cts +15 -0
  338. package/dist/signature.d.ts +15 -0
  339. package/dist/signature.js +10 -0
  340. package/dist/signature.js.map +1 -0
  341. package/dist/stage/PageSurface.vue.d.cts +29 -0
  342. package/dist/stage/PageSurface.vue.d.ts +29 -0
  343. package/dist/stage/Scrollbar.vue.d.cts +32 -0
  344. package/dist/stage/Scrollbar.vue.d.ts +32 -0
  345. package/dist/stage/Stage.vue.d.cts +44 -0
  346. package/dist/stage/Stage.vue.d.ts +44 -0
  347. package/dist/stage/StageScope.vue.d.cts +17 -0
  348. package/dist/stage/StageScope.vue.d.ts +17 -0
  349. package/dist/stage/composables.d.cts +41 -0
  350. package/dist/stage/composables.d.ts +41 -0
  351. package/dist/stage/scope.d.cts +12 -0
  352. package/dist/stage/scope.d.ts +12 -0
  353. package/dist/stage.cjs +21 -0
  354. package/dist/stage.cjs.map +1 -0
  355. package/dist/stage.d.cts +17 -0
  356. package/dist/stage.d.ts +17 -0
  357. package/dist/stage.js +15 -0
  358. package/dist/stage.js.map +1 -0
  359. package/dist/stamp.cjs +68 -0
  360. package/dist/stamp.cjs.map +1 -0
  361. package/dist/stamp.d.cts +61 -0
  362. package/dist/stamp.d.ts +61 -0
  363. package/dist/stamp.js +61 -0
  364. package/dist/stamp.js.map +1 -0
  365. package/dist/state-DZg8q3v6.js +52 -0
  366. package/dist/state-DZg8q3v6.js.map +1 -0
  367. package/dist/state-M22NDJQo.cjs +51 -0
  368. package/dist/state-M22NDJQo.cjs.map +1 -0
  369. package/dist/state.d.cts +32 -0
  370. package/dist/state.d.ts +32 -0
  371. package/dist/strip-BSDB39Xh.cjs +743 -0
  372. package/dist/strip-BSDB39Xh.cjs.map +1 -0
  373. package/dist/strip-C3wLonKB.js +744 -0
  374. package/dist/strip-C3wLonKB.js.map +1 -0
  375. package/dist/surface-box-B9oa4YoG.js +12 -0
  376. package/dist/surface-box-B9oa4YoG.js.map +1 -0
  377. package/dist/surface-box-C7EvUOXp.cjs +11 -0
  378. package/dist/surface-box-C7EvUOXp.cjs.map +1 -0
  379. package/dist/theme.d.cts +13 -0
  380. package/dist/theme.d.ts +13 -0
  381. package/dist/toolbar/DefaultCollapsed.vue.d.cts +9 -0
  382. package/dist/toolbar/DefaultCollapsed.vue.d.ts +9 -0
  383. package/dist/toolbar/DefaultCommand.vue.d.cts +8 -0
  384. package/dist/toolbar/DefaultCommand.vue.d.ts +8 -0
  385. package/dist/toolbar/DefaultGroupTrigger.vue.d.cts +9 -0
  386. package/dist/toolbar/DefaultGroupTrigger.vue.d.ts +9 -0
  387. package/dist/toolbar/DefaultOverflowMenu.vue.d.cts +9 -0
  388. package/dist/toolbar/DefaultOverflowMenu.vue.d.ts +9 -0
  389. package/dist/toolbar/DefaultOverflowTrigger.vue.d.cts +10 -0
  390. package/dist/toolbar/DefaultOverflowTrigger.vue.d.ts +10 -0
  391. package/dist/toolbar/Measured.vue.d.cts +21 -0
  392. package/dist/toolbar/Measured.vue.d.ts +21 -0
  393. package/dist/toolbar/NativeSlotSocket.vue.d.cts +22 -0
  394. package/dist/toolbar/NativeSlotSocket.vue.d.ts +22 -0
  395. package/dist/toolbar/Toolbar.vue.d.cts +82 -0
  396. package/dist/toolbar/Toolbar.vue.d.ts +82 -0
  397. package/dist/toolbar/ToolbarPart.vue.d.cts +42 -0
  398. package/dist/toolbar/ToolbarPart.vue.d.ts +42 -0
  399. package/dist/toolbar/paint.d.cts +3 -0
  400. package/dist/toolbar/paint.d.ts +3 -0
  401. package/dist/toolbar/strip.d.cts +14 -0
  402. package/dist/toolbar/strip.d.ts +14 -0
  403. package/dist/toolbar/views.d.cts +15 -0
  404. package/dist/toolbar/views.d.ts +15 -0
  405. package/dist/toolbar.cjs +27 -0
  406. package/dist/toolbar.cjs.map +1 -0
  407. package/dist/toolbar.d.cts +14 -0
  408. package/dist/toolbar.d.ts +14 -0
  409. package/dist/toolbar.js +12 -0
  410. package/dist/toolbar.js.map +1 -0
  411. package/dist/view-manager.cjs +22 -0
  412. package/dist/view-manager.cjs.map +1 -0
  413. package/dist/view-manager.d.cts +24 -0
  414. package/dist/view-manager.d.ts +24 -0
  415. package/dist/view-manager.js +17 -0
  416. package/dist/view-manager.js.map +1 -0
  417. package/package.json +179 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composables-DK3lwh38.js","sources":["../src/annotation/state.ts","../src/annotation/AnnotationChrome.vue","../src/annotation/AnnotationFrame.vue","../src/annotation/text-box.ts","../src/annotation/AnnotationLook.vue","../src/annotation/FreeTextBox.vue","../src/annotation/AnnotationScene.vue","../src/annotation/NativeDrawing.vue","../src/annotation/StampGhost.vue","../src/annotation/AnnotationLayer.vue","../src/annotation/AnnotationMenu.vue","../src/annotation/AnnotationDraftMenu.vue","../src/annotation/AnnotationRotationBadge.vue","../src/annotation/composables.ts"],"sourcesContent":["/**\n * The annotation composables other feature entries use too (the form layer\n * reads the selection and the settings), kept apart so they don't import the\n * whole annotation feature: the state and the settings, each from its\n * declaration.\n */\nimport { AnnotationToken, annotationState } from '@embedpdf/plugin-annotation/contract';\nimport { settingsComposable, stateComposable } from '../state';\n\n/**\n * The annotation state as refs: `status` (`'loading'` until every annotation\n * is in, then `'ready'`), the `selected` annotations, the one `hovered` under\n * the pointer and the text box being typed in (`editing`). With a selector,\n * one ref that updates only when the value it picks changes. Empty without a\n * document.\n */\nexport const useAnnotationState = stateComposable(annotationState);\n\n/**\n * The annotation settings (`snap`, `chrome`, `afterCreate`, `tools`) as refs,\n * or one ref for the value `select` picks. They belong to the plugin, so they\n * read without a document; change them with `useAnnotation().updateSettings()`.\n */\nexport const useAnnotationSettings = settingsComposable(AnnotationToken);\n","<!--\n The selection's chrome on one page: its outline, handles, rotation handle,\n snapping guides, the lines of a turn in progress and the box dragged to\n select. The plugin lists the nodes and sizes the screen-constant parts for\n the page's zoom; `@embedpdf/web` puts them in pixels and paints them through\n their `--epdf-annotation-*` variables. The layer draws them as SVG; a\n `#handle` or `#rotation-handle` slot draws its handles as HTML over the page\n instead. The viewer still decides where a handle can be grabbed, so what a\n slot draws can't break dragging.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { shallowEqual } from '@embedpdf/core';\nimport type { ChromeNode } from '@embedpdf/core-annotation';\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport { annotationChromePaint, chromeInPixels } from '@embedpdf/web';\nimport { useOptionalSelector } from '../runtime/capabilities';\nimport { useViewerSettings } from '../runtime/documents';\nimport type { PageContextValue } from '../runtime/page';\nimport { useAnnotationSettings } from './state';\nimport type { HandleProps, RotationHandleProps } from './types';\n\nconst props = defineProps<{ page: PageContextValue }>();\n\nconst slots = defineSlots<{\n /** One handle, drawn your way. */\n handle?(props: HandleProps): unknown;\n /** The rotation handle, drawn your way. */\n 'rotation-handle'?(props: RotationHandleProps): unknown;\n}>();\n\nconst NO_NODES: readonly ChromeNode[] = Object.freeze([]);\n\n// The page's view scale converts the screen-pixel chrome settings into\n// content units inside the plugin (the rotation handle's offset, grab zones):\n// screen-constant at every zoom. What this draws is in screen pixels already.\nconst nodes = useOptionalSelector(\n AnnotationHostToken,\n (host) => {\n const { transform, ref } = props.page;\n return host.listChromeNodes(ref, transform.viewScale, transform.rotation, transform.zoom);\n },\n NO_NODES,\n shallowEqual,\n);\nconst chrome = useAnnotationSettings((settings) => settings.chrome);\nconst accent = useViewerSettings((settings) => settings.accent);\n/**\n * The chrome settings, painted, as each part's `style`: follows the settings\n * and the viewer's accent live. Paint goes in `style`, never in SVG\n * attributes, which don't read the `var(--epdf-…)` the paint starts with.\n */\nconst painted = computed(() => {\n const paint = annotationChromePaint(chrome.value, accent.value);\n const style = (part: object): CSSProperties => ({ ...part });\n return {\n outline: style(paint.outline),\n handle: style(paint.handle),\n rotationHandle: style(paint.rotationHandle),\n rotationStalk: style({ stroke: paint.rotationHandle.stroke }),\n guide: style(paint.guide),\n rotationGuide: style(paint.rotationGuide),\n marquee: style(paint.marquee),\n };\n});\nconst pixels = computed(() => chromeInPixels(nodes.value, props.page.transform));\n\n/** Whether there are handles a slot could draw: the slots' own element exists only then. */\nconst hasHandles = computed(() =>\n pixels.value.some((node) => node.kind === 'handle' || node.kind === 'rotation-handle'),\n);\n</script>\n\n<template>\n <svg :style=\"{ position: 'absolute', inset: 0, overflow: 'visible', pointerEvents: 'none' }\">\n <template v-for=\"(node, index) in pixels\" :key=\"index\">\n <template v-if=\"node.kind === 'handle'\">\n <template v-if=\"!slots.handle\">\n <circle\n v-if=\"chrome.handles.shape === 'circle'\"\n :cx=\"node.at.x\"\n :cy=\"node.at.y\"\n :r=\"chrome.handles.size / 2\"\n stroke-width=\"1.5\"\n :style=\"painted.handle\"\n />\n <!-- The square rides a turned box's orientation (it spins about itself). -->\n <rect\n v-else\n :x=\"node.at.x - chrome.handles.size / 2\"\n :y=\"node.at.y - chrome.handles.size / 2\"\n :width=\"chrome.handles.size\"\n :height=\"chrome.handles.size\"\n stroke-width=\"1.5\"\n :style=\"painted.handle\"\n :transform=\"node.rotation ? `rotate(${node.rotation} ${node.at.x} ${node.at.y})` : undefined\"\n />\n </template>\n </template>\n <line\n v-else-if=\"node.kind === 'guide'\"\n :x1=\"node.from.x\"\n :y1=\"node.from.y\"\n :x2=\"node.to.x\"\n :y2=\"node.to.y\"\n shape-rendering=\"crispEdges\"\n :style=\"painted.guide\"\n />\n <polygon\n v-else-if=\"node.kind === 'turned-outline'\"\n :points=\"node.points\"\n fill=\"none\"\n :style=\"painted.outline\"\n />\n <g v-else-if=\"node.kind === 'rotation-guides'\">\n <line\n v-for=\"(line, lineIndex) in node.lines\"\n :key=\"lineIndex\"\n :x1=\"line.from.x\"\n :y1=\"line.from.y\"\n :x2=\"line.to.x\"\n :y2=\"line.to.y\"\n :opacity=\"line.opacity\"\n :style=\"painted.rotationGuide\"\n />\n </g>\n <template v-else-if=\"node.kind === 'rotation-handle'\">\n <g v-if=\"!slots['rotation-handle']\">\n <line\n v-if=\"chrome.rotationHandle.stalk\"\n :x1=\"node.from.x\"\n :y1=\"node.from.y\"\n :x2=\"node.at.x\"\n :y2=\"node.at.y\"\n stroke-width=\"1\"\n :style=\"painted.rotationStalk\"\n />\n <circle\n :cx=\"node.at.x\"\n :cy=\"node.at.y\"\n :r=\"chrome.rotationHandle.size / 2\"\n stroke-width=\"1.5\"\n :style=\"painted.rotationHandle\"\n />\n </g>\n </template>\n <!-- The box dragged to select keeps its own look (a see-through accent\n fill, always dashed); the selection outline follows the settings. -->\n <rect\n v-else-if=\"node.kind === 'marquee'\"\n :x=\"node.box.left\"\n :y=\"node.box.top\"\n :width=\"node.box.width\"\n :height=\"node.box.height\"\n stroke-width=\"1\"\n stroke-dasharray=\"4 3\"\n :style=\"painted.marquee\"\n />\n <rect\n v-else-if=\"node.kind === 'outline'\"\n :x=\"node.box.left\"\n :y=\"node.box.top\"\n :width=\"node.box.width\"\n :height=\"node.box.height\"\n fill=\"none\"\n :style=\"painted.outline\"\n />\n </template>\n </svg>\n <div\n v-if=\"hasHandles && (slots.handle || slots['rotation-handle'])\"\n :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\"\n >\n <template v-for=\"(node, index) in pixels\" :key=\"index\">\n <slot\n v-if=\"node.kind === 'handle' && slots.handle\"\n name=\"handle\"\n :at=\"node.at\"\n :size=\"chrome.handles.size\"\n :rotation=\"node.rotation\"\n :kind=\"node.role\"\n :active=\"node.active\"\n />\n <slot\n v-else-if=\"node.kind === 'rotation-handle' && slots['rotation-handle']\"\n name=\"rotation-handle\"\n :at=\"node.at\"\n :from=\"node.from\"\n :size=\"chrome.rotationHandle.size\"\n :rotation=\"0\"\n :active=\"false\"\n />\n </template>\n </div>\n</template>\n","<!--\n The box an annotation draws into, placed, sized and turned like the\n annotation (`item.frame`) inside the page layer, which the page itself\n turns. The annotation's own drawing and any look of yours draw inside it.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport type { RenderItem } from '@embedpdf/core-annotation';\nimport { frameInPixels } from '@embedpdf/web';\nimport type { PageContextValue } from '../runtime/page';\n\nconst props = withDefaults(\n defineProps<{\n item: RenderItem;\n page: PageContextValue;\n /** An interactive renderer takes the pointer: the layer's own `none` ends here. */\n interactive?: boolean;\n /** No pointer and no focus for the whole subtree: a renderer that only draws. */\n inert?: boolean;\n }>(),\n { interactive: false, inert: false },\n);\n\ndefineSlots<{ default?(): unknown }>();\n\nconst style = computed((): CSSProperties => {\n const box = frameInPixels(props.item.frame, props.page.transform);\n return {\n position: 'absolute',\n left: `${box.left}px`,\n top: `${box.top}px`,\n width: `${box.width}px`,\n height: `${box.height}px`,\n transform: box.transform,\n transformOrigin: 'center',\n // On the frame: a turned frame groups what is inside it, so blending on\n // an inner element would stop blending with the page.\n mixBlendMode: props.item.blend as CSSProperties['mixBlendMode'],\n pointerEvents: props.interactive ? 'auto' : 'none',\n };\n});\n</script>\n\n<template>\n <div :inert=\"inert || undefined\" :style=\"style\">\n <slot />\n </div>\n</template>\n","/**\n * Text boxes you type in. `@embedpdf/web`'s text box editor makes an element\n * the editor of a free text box (rich text, focus and `contentEditable`\n * following the plugin's `editing`, presses kept inside), and its follower\n * attaches when the element and the capability are there and takes the box\n * and the scale whenever they change; this binds the follower to Vue. The\n * layer's own text boxes use it, and so does `useRichTextEditor()`, for a\n * renderer that draws its text box itself.\n */\nimport { computed, inject, onScopeDispose, provide, shallowRef, toValue, watch } from 'vue';\nimport type {\n ComponentPublicInstance,\n CSSProperties,\n InjectionKey,\n MaybeRefOrGetter,\n Ref,\n} from 'vue';\nimport type { Annotation, AnnotationRef, TextItem } from '@embedpdf/plugin-annotation';\n// Typing reaches the plugin through its host lens (drafts, the text selection).\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport { createTextBoxEditorFollower, ownTextBoxOf, textBoxEditorScaleOf } from '@embedpdf/web';\nimport { useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { usePage } from '../runtime/page';\nimport type { RichTextEditor } from './types';\n\n/**\n * Make an element the editor of a text box, following `item` and `scale`\n * (pixels per point). Returns the element's ref: put it on the element, and\n * render nothing inside it, since the editor owns its children.\n */\nexport function useTextBoxEditor(\n item: MaybeRefOrGetter<TextItem | null>,\n scale: MaybeRefOrGetter<number>,\n): Ref<HTMLElement | null> {\n const element = shallowRef<HTMLElement | null>(null);\n const annotation = useOptionalCapability(AnnotationHostToken);\n const follower = createTextBoxEditorFollower<AnnotationRef>();\n // `post`: the element is in the document by then, so focusing it works. The\n // editor redraws only when the text differs, so the caret never jumps while\n // typing; focus follows `editing`.\n watch(\n [annotation, element, () => toValue(item), () => toValue(scale)],\n ([capability, target, current, pixelsPerPoint]) =>\n follower.follow(target, capability, current, pixelsPerPoint),\n { immediate: true, flush: 'post' },\n );\n onScopeDispose(() => follower.detach());\n return element;\n}\n\n/** How much the layer scales the look around it: 1 outside a look, or in one drawn at its size on screen. */\nconst LookScaleKey: InjectionKey<Readonly<Ref<number>>> = Symbol('embedpdf annotation look scale');\nconst UNSCALED = computed(() => 1);\n\n/** Installed by the layer around a look it scales, not by app code. */\nexport function provideLookScale(scale: Readonly<Ref<number>>): void {\n provide(LookScaleKey, scale);\n}\n\nconst NO_STYLE: CSSProperties = Object.freeze({});\n\n/**\n * Make your own element the editor of a text box you draw yourself (a\n * renderer for free text): it draws the runs, turns typing back into runs,\n * keeps the caret when the style changes, and handles pasting, input methods\n * and the format shortcuts. The formatting calls (`text.toggleFormat`,\n * `selection.update`) work on it as they do on the built-in one.\n *\n * ```vue\n * const { ref: editorRef, editing, style } = useRichTextEditor(() => props.annotation);\n * <div :ref=\"editorRef\" :class=\"{ editing }\" :style=\"style\" />\n * ```\n *\n * `ref` goes on your element (render nothing inside it: the editor owns what's\n * in it); `style` and `editing` are refs. `style` fills the element's parent at\n * a legible size: draw the box's frame on the parent.\n */\nexport function useRichTextEditor(annotation: MaybeRefOrGetter<Annotation>): RichTextEditor {\n const page = usePage();\n // Saved and idle too: your element draws its text, no engine picture does.\n const item = useOptionalSelector(\n AnnotationHostToken,\n (host) => {\n const { transform } = page.value;\n return host.getTextItem(toValue(annotation).ref, {\n zoom: transform.zoom,\n rotation: transform.rotation,\n });\n },\n null,\n );\n // Pixels per point where the element is: inside a scaled look, at the\n // annotation's 100% size; the look's scale does the rest.\n const lookScale = inject(LookScaleKey, UNSCALED);\n const scale = computed(() =>\n textBoxEditorScaleOf(item.value, page.value.transform, lookScale.value),\n );\n const own = computed(() => (item.value ? ownTextBoxOf(item.value, scale.value) : null));\n const element = useTextBoxEditor(item, () => own.value?.scale ?? scale.value);\n const style = computed((): CSSProperties => own.value?.style ?? NO_STYLE);\n return {\n ref: (target: Element | ComponentPublicInstance | null) => {\n element.value = target instanceof HTMLElement ? target : null;\n },\n style,\n editing: computed(() => item.value?.editing ?? false),\n };\n}\n","<!--\n Your look for one annotation, inside its frame: your renderer's component,\n drawn at the annotation's 100% size and scaled with the page, unless the\n renderer opts out (`scale: false`) and draws at its size on screen.\n `useRichTextEditor()` inside it divides by that scale.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { Component, CSSProperties } from 'vue';\nimport type { RenderItem } from '@embedpdf/core-annotation';\nimport type { Annotation } from '@embedpdf/plugin-annotation';\nimport { frameInPixels, lookFrameOf } from '@embedpdf/web';\nimport type { PageContextValue } from '../runtime/page';\nimport { provideLookScale } from './text-box';\n\nconst props = defineProps<{\n /** Your renderer's component. */\n component: Component;\n /** Draw at the annotation's 100% size and let the layer scale it (the default), or at its size on screen. */\n scaled: boolean;\n annotation: Annotation;\n item: RenderItem;\n page: PageContextValue;\n native: Component;\n appearance: { url: string } | null;\n interactive: boolean;\n}>();\n\nconst pixels = computed(() => frameInPixels(props.item.frame, props.page.transform));\nconst frame = computed(() => lookFrameOf(pixels.value, props.scaled));\n// What `useRichTextEditor()` in the look divides by: 1 when it draws at its size on screen.\nprovideLookScale(computed(() => (props.scaled ? pixels.value.scale : 1)));\n\nconst scaledBox = computed(\n (): CSSProperties => ({\n position: 'absolute',\n left: 0,\n top: 0,\n width: `${pixels.value.design.width}px`,\n height: `${pixels.value.design.height}px`,\n transform: `scale(${pixels.value.scale})`,\n transformOrigin: '0 0',\n }),\n);\n</script>\n\n<template>\n <div v-if=\"scaled\" :style=\"scaledBox\">\n <component\n :is=\"component\"\n :annotation=\"annotation\"\n :frame=\"frame\"\n :native=\"native\"\n :appearance=\"appearance\"\n :hovered=\"item.hovered ?? false\"\n :selected=\"item.selected\"\n :interactive=\"interactive\"\n />\n </div>\n <component\n :is=\"component\"\n v-else\n :annotation=\"annotation\"\n :frame=\"frame\"\n :native=\"native\"\n :appearance=\"appearance\"\n :hovered=\"item.hovered ?? false\"\n :selected=\"item.selected\"\n :interactive=\"interactive\"\n />\n</template>\n","<!--\n A free text annotation's text: the same styled element for reading and for\n typing, placed on the engine's text plate (the box inset by its padding).\n The editor binding owns what's inside it, so the template renders nothing\n there, and the element lives as long as the text box does (keyed by its id),\n so the caret never jumps while someone types. Focus and `contentEditable`\n follow the plugin's `editing`.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { TextItem } from '@embedpdf/plugin-annotation';\nimport { annotationChromePaint, freeTextBoxOf } from '@embedpdf/web';\nimport { useViewerSettings } from '../runtime/documents';\nimport type { PageContextValue } from '../runtime/page';\nimport { useAnnotationSettings } from './state';\nimport { useTextBoxEditor } from './text-box';\n\nconst props = defineProps<{ item: TextItem; page: PageContextValue }>();\n\nconst chrome = useAnnotationSettings((settings) => settings.chrome);\nconst accent = useViewerSettings((settings) => settings.accent);\nconst outline = computed(() => annotationChromePaint(chrome.value, accent.value).textOutline);\n\n// On the engine's text plate (the box inset by its padding), laid out at a legible size.\nconst box = computed(() => freeTextBoxOf(props.item, props.page.transform, outline.value));\nconst element = useTextBoxEditor(\n () => props.item,\n () => box.value.scale,\n);\n</script>\n\n<template>\n <div ref=\"element\" :style=\"box.style\" />\n</template>\n","<!--\n An annotation's scene, filling its frame: drawn upright in it, the frame\n turns it. The core computed the box and the painted scene; `@embedpdf/web`\n describes each scene node as one SVG element (its tag, its attributes under\n their SVG names, its text), so there is no per-kind logic and no bounds math\n here: one loop draws every kind.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { MITER_LIMIT, scene } from '@embedpdf/core-annotation';\nimport type { RenderItem } from '@embedpdf/core-annotation';\nimport { ghostOpacity, sceneViewBox, svgShapesOf } from '@embedpdf/web';\nimport SvgShapes from '../runtime/SvgShapes.vue';\n\nconst props = defineProps<{ item: RenderItem }>();\n\n// Nothing to draw until the annotation has area (the 0×0 draft at mouse-down).\nconst viewBox = computed(() => sceneViewBox(props.item.box));\nconst shapes = computed(() => svgShapesOf(scene(props.item), { miterLimit: MITER_LIMIT }));\nconst style = computed(\n (): CSSProperties => ({\n position: 'absolute',\n left: 0,\n top: 0,\n width: '100%',\n height: '100%',\n overflow: 'visible',\n pointerEvents: 'none',\n // A ghost is see-through as a whole, so its fill and stroke don't stack.\n ...(props.item.source === 'ghost'\n ? { opacity: ghostOpacity(props.item.ghostOpacity ?? 0.5) }\n : {}),\n }),\n);\n</script>\n\n<template>\n <svg v-if=\"viewBox\" :viewBox=\"viewBox\" :style=\"style\">\n <SvgShapes :shapes=\"shapes\" />\n </svg>\n</template>\n","<!--\n The layer's own drawing of one annotation, inside its frame: the engine's\n raster where the core places it (following a move as it happens), or the\n vector scene for everything drawn live (shapes, clouds, markup, a drawing\n in progress, a tool's ghost, a picture older than the annotation). One rule\n picks (`pictureOrPainting`). A renderer gets it as `native`.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { hasLiveDrawing, type RenderItem } from '@embedpdf/core-annotation';\nimport {\n pictureOrPainting,\n rasterInFrame,\n shownAppearance,\n type AppearanceUrl,\n} from '@embedpdf/web';\nimport AnnotationScene from './AnnotationScene.vue';\n\nconst props = defineProps<{\n item: RenderItem;\n /** The page's loaded pictures, by item and state; `null` until the first ones arrive. */\n urls: Readonly<Record<string, AppearanceUrl>> | null;\n}>();\n\nconst shows = computed(() => {\n const { item, urls } = props;\n return pictureOrPainting({\n pending: item.source !== 'baked',\n picture: urls && shownAppearance(urls, item.id, item.annotation?.appearanceState ?? null),\n version: item.pictureVersion ?? 0,\n loaded: urls !== null,\n paint: () => (hasLiveDrawing(item) ? item : null),\n });\n});\n\n/** The engine's raster inside the item's frame, where `item.raster` puts it, at any frame size. */\nconst baked = computed((): { url: string; style: CSSProperties } | null => {\n const { item } = props;\n const look = shows.value;\n if (look?.kind !== 'picture' || !item.raster) return null;\n const box = rasterInFrame(item.raster, item.frame);\n return {\n url: look.picture.url,\n style: {\n position: 'absolute',\n left: box.left,\n top: box.top,\n width: box.width,\n height: box.height,\n // The appearance box is sized in content units; a global\n // `img { max-width: 100% }` reset would otherwise clamp it to the\n // containing block and distort the aspect (a landscape stamp on a turned,\n // portrait page), so honour the explicit size.\n maxWidth: 'none',\n maxHeight: 'none',\n pointerEvents: 'none',\n // The turn the engine took out of the raster, put back about its middle.\n transform: box.transform,\n transformOrigin: 'center',\n },\n };\n});\n</script>\n\n<template>\n <img v-if=\"baked\" :src=\"baked.url\" alt=\"\" draggable=\"false\" :style=\"baked.style\" />\n <AnnotationScene v-else-if=\"shows?.kind === 'painting'\" :item=\"item\" />\n</template>\n","<!--\n The armed stamp's ghost: a see-through render of the stamp, in the exact box\n a click would place it (the plugin computes it with the same fit and clamp\n as the placement). Every other tool's ghost is a render item, drawn like a\n drawing in progress. The preview bytes live in the plugin; this owns only\n the object URL, keyed on the armed stamp: a new arm swaps the image, a\n disarm (or another tool) drops it.\n-->\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport {\n AnnotationToken as AnnotationHostToken,\n previewBucket,\n} from '@embedpdf/plugin-annotation/contract/host';\nimport { ghostOpacity, loadObjectUrl, rectInPixels } from '@embedpdf/web';\nimport { useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport type { PageContextValue } from '../runtime/page';\n\nconst props = defineProps<{ page: PageContextValue }>();\n\nconst annotation = useOptionalCapability(AnnotationHostToken);\nconst ghost = useOptionalSelector(\n AnnotationHostToken,\n (host) => host.getImageGhost(props.page.ref),\n null,\n);\nconst armed = useOptionalSelector(AnnotationHostToken, (host) => host.getArmedStamp(), null);\n// The ghost is a bitmap of vector artwork, right at one size: ask for the\n// bucket that covers the box's device width (points × device pixels per\n// point), so it stays sharp at every zoom and density. The plugin caches per\n// bucket.\nconst bucket = computed(() =>\n ghost.value ? previewBucket(ghost.value.box.width * props.page.transform.renderScale) : 0,\n);\n\nconst url = ref<string | null>(null);\nwatch(\n [annotation, armed, bucket],\n ([host, _armed, size], _previous, onCleanup) => {\n if (!host || !size) {\n url.value = null;\n return;\n }\n // The previous bucket's image stays up until this one arrives: no flicker\n // while a zoom crosses a bucket boundary.\n onCleanup(\n loadObjectUrl(\n () => host.renderArmedStampPreview(size),\n (next) => (url.value = next),\n ),\n );\n },\n { immediate: true },\n);\n\nconst style = computed((): CSSProperties | null => {\n const current = ghost.value;\n if (!current) return null;\n const frame = rectInPixels(current.box, props.page.transform);\n return {\n position: 'absolute',\n left: `${frame.left}px`,\n top: `${frame.top}px`,\n width: `${frame.width}px`,\n height: `${frame.height}px`,\n // Never let a global `img` reset clamp the box and distort the aspect.\n maxWidth: 'none',\n maxHeight: 'none',\n pointerEvents: 'none',\n opacity: ghostOpacity(current.opacity),\n ...(current.rot ? { transform: `rotate(${current.rot}deg)`, transformOrigin: 'center' } : {}),\n };\n});\n</script>\n\n<template>\n <img v-if=\"style && url\" :src=\"url\" alt=\"\" draggable=\"false\" :style=\"style\" />\n</template>\n","<!--\n <AnnotationLayer>: a page's annotations, the selection's outline and\n handles, the tool's preview and the text boxes being typed in. Put it in the\n Stage's #page slot above the rendered page: while it's there, the render\n layer leaves the annotations out of the page's picture.\n\n Pure paint: it reads the plugin's per-page render items and chrome and draws\n them. Pointer events reach the plugin through the interaction hub (the\n Stage forwards them), and so does the cursor. Each annotation is one drawing:\n its vector scene, the engine's baked appearance, or a look of yours from\n `renderers`, which may keep the layer's own drawing (`native`) and add to it.\n The `#handle` and `#rotation-handle` slots draw the handles your way.\n-->\n<script setup lang=\"ts\">\nimport { computed, h, markRaw, onUnmounted, shallowRef, toRaw, watch } from 'vue';\nimport type { Component } from 'vue';\nimport { annotationKey, shallowEqual } from '@embedpdf/core';\nimport type { RenderItem } from '@embedpdf/core-annotation';\nimport type { Annotation, TextItem } from '@embedpdf/plugin-annotation';\n// The layer is framework code, so it resolves the full host lens (page items,\n// chrome, appearances…): the same runtime token as the public one, typed wider.\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport { InteractionToken } from '@embedpdf/plugin-interaction/contract';\nimport { RenderToken } from '@embedpdf/plugin-render/contract/host';\nimport {\n annotationDrawingOf,\n bakedAppearanceOf,\n createShownUrls,\n editingTextKeyOf,\n layerTextBoxesOf,\n loadAppearanceUrls,\n registerRendererBehaviors,\n} from '@embedpdf/web';\nimport type { AnnotationDrawing, AppearanceUrl } from '@embedpdf/web';\nimport { devWarn } from '../dev';\nimport { usePaintsPagePart } from '../page-layers';\nimport { useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { usePage } from '../runtime/page';\nimport AnnotationChrome from './AnnotationChrome.vue';\nimport AnnotationFrame from './AnnotationFrame.vue';\nimport AnnotationLook from './AnnotationLook.vue';\nimport FreeTextBox from './FreeTextBox.vue';\nimport NativeDrawing from './NativeDrawing.vue';\nimport StampGhost from './StampGhost.vue';\nimport type { AnnotationRenderer, HandleProps, RotationHandleProps } from './types';\n\nconst props = defineProps<{\n /**\n * Your own look for some annotations: each renderer says which ones (`for`)\n * and with which component. Define the list once, in `<script setup>`.\n */\n renderers?: AnnotationRenderer[];\n}>();\n\nconst slots = defineSlots<{\n /** Draw each handle yourself, in place of the layer's: it gets {@link HandleProps}. */\n handle?(props: HandleProps): unknown;\n /** Draw the rotation handle yourself: it gets {@link RotationHandleProps}. */\n 'rotation-handle'?(props: RotationHandleProps): unknown;\n}>();\n\ntype Drawing = AnnotationDrawing<AnnotationRenderer>;\n\nconst NO_ITEMS: readonly RenderItem[] = Object.freeze([]);\nconst NO_TEXTS: readonly TextItem[] = Object.freeze([]);\n\nconst page = usePage();\n// While it's here, the page's picture leaves the annotations to it.\nusePaintsPagePart(\n computed(() => page.value.ref),\n 'annotations',\n);\nconst annotation = useOptionalCapability(AnnotationHostToken);\nconst interaction = useOptionalCapability(InteractionToken);\n// The active tool decides which interactive renderers take the pointer, so a\n// tool change draws the layer again (`interactive` functions read it live).\nconst activeToolId = useOptionalSelector(\n InteractionToken,\n (hub) => hub.getActiveToolId() as string,\n '',\n);\n\n// The page's view (its zoom and turn) projects annotations that keep their\n// size or stay upright on screen (`noZoom`, `noRotate`) inside the plugin: no\n// flag logic lives here. `zoom`, not `viewScale`: 1 is the page's 100%.\nconst items = useOptionalSelector(\n AnnotationHostToken,\n (host) => {\n const { transform, ref } = page.value;\n return host.listPageItems(ref, { zoom: transform.zoom, rotation: transform.rotation });\n },\n NO_ITEMS,\n shallowEqual,\n);\nconst texts = useOptionalSelector(\n AnnotationHostToken,\n (host) => {\n const { transform, ref } = page.value;\n return host.listTextItems(ref, { zoom: transform.zoom, rotation: transform.rotation });\n },\n NO_TEXTS,\n shallowEqual,\n);\n\n// ── your renderers ───────────────────────────────────────────────────────────\n\n/** Bumped when the renderers' behaviors register again, so the drawings are read again. */\nconst registrations = shallowRef(0);\n// An `interactive` renderer takes the pointer through a behavior the plugin\n// knows, registered once per capability and entry however many pages mount\n// the layer. Entry identity is the key, so a list written inline in the\n// template (a new array on every render) registers again each time: say so.\nwatch(\n [annotation, () => props.renderers],\n ([host, renderers], previous, onCleanup) => {\n const before = previous?.[1];\n if (renderers && before && renderers !== before && shallowEqual(renderers, before)) {\n devWarn(\n 'annotation-renderers-inline',\n '<AnnotationLayer :renderers> was given a new array with the same entries — define it ' +\n 'once in <script setup>, because entry identity keys the behavior registration.',\n );\n }\n if (host && renderers) {\n onCleanup(\n registerRendererBehaviors(host, renderers, () =>\n String(interaction.value?.getActiveToolId() ?? ''),\n ),\n );\n }\n registrations.value += 1;\n },\n { immediate: true },\n);\n\n// ── baked appearances ────────────────────────────────────────────────────────\n\n// `null` until the page's first pictures arrive.\nconst urls = shallowRef<Record<string, AppearanceUrl> | null>(null);\n// The pictures shown stay valid until the next ones are shown.\nconst shown = createShownUrls();\nonUnmounted(() => shown.release());\n// Baked annotations draw from engine rasters: load them again when the page's\n// baked set or an appearance version changes (a stamp just placed, a resize\n// whose new appearance arrived), and when the bake scale does. A move or a\n// turn leaves the epoch as it is (the same pixels, placed elsewhere), and live\n// gestures don't touch it: nothing loads mid-drag.\nconst bakedKey = useOptionalSelector(\n AnnotationHostToken,\n (host) => host.getAppearanceEpoch(page.value.ref),\n '',\n);\n// The appearance scale follows the document's render policy: zoom steps inside\n// one rung of the appearance lattice bake nothing again. Without the render\n// plugin, only this session's pictures load.\nconst bakeScale = useOptionalSelector(\n RenderToken,\n (render) => render.getAppearanceScale(page.value.transform.renderScale),\n page.value.transform.renderScale,\n);\nwatch(\n [annotation, () => page.value.ref, bakeScale, bakedKey],\n ([host, pageRef, scale], _previous, onCleanup) => {\n if (!host || !scale) return;\n onCleanup(\n loadAppearanceUrls(\n shown,\n (signal) => host.renderAppearances(pageRef, scale, signal),\n annotationKey,\n (loaded) => (urls.value = loaded),\n ),\n );\n },\n { immediate: true },\n);\n\n// ── what each annotation draws ───────────────────────────────────────────────\n\n/** The text box being typed in, by key: while it is, a look's editor takes the keys. */\nconst editingKey = computed(() => editingTextKeyOf(texts.value, annotationKey));\n\ninterface Drawn {\n item: RenderItem;\n annotation: Annotation | null;\n drawing: Drawing;\n}\n\n/** The layer's own drawing, for what isn't an annotation yet (a drawing in progress, a ghost). */\nconst NATIVE: Drawing = { kind: 'native', inert: false };\n\n// Ownership beats looks: an engaged behavior's renderer is authoritative (the\n// form plugin's controls own their DOM); `for` rules apply only to what the\n// layer owns, and draw without the pointer. Read whenever the items, the\n// active tool or the registrations change: `interactive` functions and the\n// plugin's behaviors are asked here.\nconst drawn = computed((): Drawn[] => {\n void activeToolId.value;\n void registrations.value;\n const host = annotation.value;\n const renderers = props.renderers;\n return items.value.map((item): Drawn => {\n const record = item.annotation ?? null;\n if (!record || !host) return { item, annotation: null, drawing: NATIVE };\n const typing = editingKey.value !== null && annotationKey(record.ref) === editingKey.value;\n return { item, annotation: record, drawing: annotationDrawingOf(record, host, renderers, typing) };\n });\n});\n\n/** The text boxes the layer draws itself: one your renderer draws is edited there (`useRichTextEditor()`). */\nconst ownTexts = computed(() =>\n layerTextBoxesOf(texts.value, items.value, props.renderers, annotationKey),\n);\n\n// `native` for a renderer: one component per annotation, kept by its id, that\n// draws the layer's current drawing of it. The same component across renders,\n// so a drag moves the drawing instead of replacing it.\nconst itemsById = computed(() => new Map(items.value.map((item) => [item.id, item])));\nconst natives = new Map<string, Component>();\nconst framedNatives = new Map<string, Component>();\nfunction nativeOf(id: string): Component {\n let native = natives.get(id);\n if (!native) {\n native = markRaw(() => {\n const item = itemsById.value.get(id);\n return item ? h(NativeDrawing, { item, urls: urls.value }) : null;\n });\n natives.set(id, native);\n }\n return native;\n}\n/** The native drawing in its frame: what a sibling plugin's renderer keeps where the layer draws it. */\nfunction framedNativeOf(id: string): Component {\n let native = framedNatives.get(id);\n if (!native) {\n native = markRaw(() => {\n const item = itemsById.value.get(id);\n return item\n ? h(AnnotationFrame, { item, page: page.value }, () => h(nativeOf(id)))\n : null;\n });\n framedNatives.set(id, native);\n }\n return native;\n}\n// Forget the drawings of annotations that are gone.\nwatch(itemsById, (shown) => {\n for (const id of natives.keys()) if (!shown.has(id)) natives.delete(id);\n for (const id of framedNatives.keys()) if (!shown.has(id)) framedNatives.delete(id);\n});\n\n/** A renderer's component, never a reactive proxy of it (a list kept in a `ref`). */\nconst componentOf = (component: Component): Component => toRaw(component);\n</script>\n\n<template>\n <div :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"{ item, annotation: record, drawing } in drawn\" :key=\"item.id\">\n <component\n :is=\"componentOf(drawing.entry.component)\"\n v-if=\"drawing.kind === 'owned' && record\"\n :annotation=\"record\"\n :item=\"item\"\n :page=\"page\"\n :native=\"framedNativeOf(item.id)\"\n :hovered=\"item.hovered ?? false\"\n :selected=\"item.selected\"\n :interactive=\"true\"\n />\n <AnnotationFrame\n v-else-if=\"drawing.kind === 'look' && record\"\n :item=\"item\"\n :page=\"page\"\n :interactive=\"drawing.interactive\"\n :inert=\"drawing.inert\"\n >\n <AnnotationLook\n :component=\"componentOf(drawing.entry.component)\"\n :scaled=\"drawing.entry.scale !== false\"\n :annotation=\"record\"\n :item=\"item\"\n :page=\"page\"\n :native=\"nativeOf(item.id)\"\n :appearance=\"\n urls && bakedAppearanceOf(urls, item.id, item.annotation?.appearanceState ?? null)\n \"\n :interactive=\"drawing.interactive\"\n />\n </AnnotationFrame>\n <!-- Inert when an engaged behavior has no renderer of yours: its plugin\n owns the input (a link's anchor takes the click), and the annotation\n keeps its own look. -->\n <AnnotationFrame\n v-else\n :item=\"item\"\n :page=\"page\"\n :inert=\"drawing.kind === 'native' && drawing.inert\"\n >\n <NativeDrawing :item=\"item\" :urls=\"urls\" />\n </AnnotationFrame>\n </template>\n <FreeTextBox v-for=\"text in ownTexts\" :key=\"text.id\" :item=\"text\" :page=\"page\" />\n <StampGhost :page=\"page\" />\n <AnnotationChrome :page=\"page\">\n <template v-if=\"slots.handle\" #handle=\"handle\">\n <slot name=\"handle\" v-bind=\"handle\" />\n </template>\n <template v-if=\"slots['rotation-handle']\" #rotation-handle=\"handle\">\n <slot name=\"rotation-handle\" v-bind=\"handle\" />\n </template>\n </AnnotationChrome>\n </div>\n</template>\n","<!--\n <AnnotationMenu>: your own menu next to the selection (one anchor, also for a\n selection over several pages), clear of the rotation handle. It hides while\n the selection is dragged, resized or turned. What's in it is yours: build it\n from `useAnnotation()` and `useAnnotationState()`. Put it in the Stage's\n #overlay slot; it works inside a <PageView> too (the surface provides the\n projection).\n-->\n<script setup lang=\"ts\">\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport { sameSelectionAnchor } from '@embedpdf/web';\nimport type { AnchoredPlacement } from '@embedpdf/web';\nimport Anchored from '../anchored/Anchored.vue';\nimport { useProjectorBinding } from '../anchored/projector';\nimport { useOptionalSelector } from '../runtime/capabilities';\n\nwithDefaults(\n defineProps<{\n /** Gap in screen px between the selection box and the menu. Default 15. */\n gap?: number;\n /** Where the menu sits around the selection. Default `'top'`. */\n placement?: AnchoredPlacement;\n }>(),\n { gap: 15, placement: 'top' },\n);\n\ndefineSlots<{\n /** The menu: compose it from `useAnnotation()` and `useAnnotationState()`. */\n default?(): unknown;\n}>();\n\n// Reading the binding makes the anchor follow projection changes in the same\n// update as the pages: the rotation handle's offset is screen-constant, so its\n// place on the page depends on the page's live view scale.\nconst binding = useProjectorBinding();\nconst anchor = useOptionalSelector(\n AnnotationHostToken,\n (host) => {\n const selection = host.selection.getAnchor();\n if (!selection) return null;\n const view = binding.value.projector.viewEnv(selection.page);\n return view ? host.getSelectionAnchorIn(view) : selection;\n },\n null,\n sameSelectionAnchor,\n);\n</script>\n\n<template>\n <Anchored\n v-if=\"anchor\"\n :anchor=\"{\n page: anchor.page,\n bounds: anchor.bounds,\n ...(anchor.rotationHandle ? { avoid: [anchor.rotationHandle] } : {}),\n }\"\n :placement=\"placement\"\n :gap=\"gap\"\n >\n <slot />\n </Anchored>\n</template>\n","<!--\n <AnnotationDraftMenu>: floats over a shape being drawn with several clicks\n (a polygon, a polyline). Its default slot gets the `draft`: its `subtype`,\n `pointCount`, `minPoints`, `canFinish` and where it is. The verbs are\n capability calls: `useAnnotation().draft.finish()` and `.draft.cancel()`.\n-->\n<script setup lang=\"ts\">\nimport type { CreationDraftAnchor } from '@embedpdf/core-annotation';\nimport { AnnotationToken } from '@embedpdf/plugin-annotation';\nimport { sameCreationDraftAnchor } from '@embedpdf/web';\nimport type { AnchoredPlacement } from '@embedpdf/web';\nimport Anchored from '../anchored/Anchored.vue';\nimport { useOptionalSelector } from '../runtime/capabilities';\n\nwithDefaults(\n defineProps<{\n /** Gap in screen px between the shape and the menu. Default 8. */\n gap?: number;\n /** Where the menu sits around the shape. Default `'top'`. */\n placement?: AnchoredPlacement;\n }>(),\n { gap: 8, placement: 'top' },\n);\n\ndefineSlots<{\n /** The menu, with the shape being drawn. */\n default?(props: { draft: CreationDraftAnchor }): unknown;\n}>();\n\n// The plugin reads a new anchor object every time: compared by value, so the\n// menu moves only when the shape did.\nconst draft = useOptionalSelector(\n AnnotationToken,\n (annotation) => annotation.draft.get(),\n null,\n sameCreationDraftAnchor,\n);\n</script>\n\n<template>\n <Anchored v-if=\"draft\" :anchor=\"draft\" :placement=\"placement\" :gap=\"gap\">\n <slot :draft=\"draft\" />\n </Anchored>\n</template>\n","<!--\n <AnnotationRotationBadge>: follows the pointer while a selection is being\n turned, upright however the page is shown: it floats over the page like the\n menus, not in it. Shows nothing when no turn is in progress. Without a slot\n it shows the angle in the `chrome.readout` colors, when\n `chrome.readout.enabled`; its default slot gets the `rotation` (`angle`,\n degrees clockwise, as the commit will apply it) to draw it your way.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport type { RotationAnchor } from '@embedpdf/core-annotation';\nimport { AnnotationToken } from '@embedpdf/plugin-annotation';\nimport { paint, paintDefault, sameRotationAnchor } from '@embedpdf/web';\nimport type { AnchoredPlacement } from '@embedpdf/web';\nimport Anchored from '../anchored/Anchored.vue';\nimport { useOptionalSelector } from '../runtime/capabilities';\nimport { useAnnotationSettings } from './state';\n\nwithDefaults(\n defineProps<{\n /** Gap in screen px between the pointer and the badge. Default 16. */\n gap?: number;\n /** Where the badge sits around the pointer. Default `'right'`. */\n placement?: AnchoredPlacement;\n }>(),\n { gap: 16, placement: 'right' },\n);\n\nconst slots = defineSlots<{\n /** The badge, drawn your way, with the turn in progress. */\n default?(props: { rotation: RotationAnchor }): unknown;\n}>();\n\nconst rotation = useOptionalSelector(\n AnnotationToken,\n (annotation) => annotation.selection.getRotationAnchor(),\n null,\n sameRotationAnchor,\n);\nconst readout = useAnnotationSettings((settings) => settings.chrome.readout);\n\nconst badge = computed(\n (): CSSProperties => ({\n pointerEvents: 'none',\n whiteSpace: 'nowrap',\n borderRadius: '4px',\n padding: '2px 6px',\n fontFamily: paintDefault('font-mono'),\n fontSize: '12px',\n background: paint('readout-background', readout.value.background),\n color: paint('readout-color', readout.value.color),\n }),\n);\n</script>\n\n<template>\n <Anchored\n v-if=\"rotation && (slots.default || readout.enabled)\"\n :anchor=\"{ page: rotation.page, bounds: { ...rotation.at, width: 0, height: 0 } }\"\n :placement=\"placement\"\n :gap=\"gap\"\n >\n <slot v-if=\"slots.default\" :rotation=\"rotation\" />\n <div v-else :style=\"badge\">{{ rotation.angle }}°</div>\n </Anchored>\n</template>\n","/**\n * The annotation composables: `useAnnotation()` (the API) and\n * `useAnnotationEvent()`; the reads a component follows on their own, each a\n * ref (`useAnnotationList()`, `useAnnotationDefaults()`,\n * `useAnnotationProperties()`, `useAnnotationAnchor()`); the comments\n * (`useComments()`, `useCommentThreads()`, `useCommentThread()`); and\n * `useFilePickerProvider()`, the file dialog behind click-then-pick tools.\n * The state and the settings are in `./state`.\n */\nimport { computed, markRaw, toValue, unref, watch } from 'vue';\nimport type { MaybeRef, MaybeRefOrGetter, Ref } from 'vue';\nimport { annotationKey, shallowEqual } from '@embedpdf/core';\nimport type { EventHook, PageLayout } from '@embedpdf/core';\nimport { AnnotationToken } from '@embedpdf/plugin-annotation';\nimport type {\n Annotation,\n AnnotationAnchor,\n AnnotationCapability,\n AnnotationFilter,\n AnnotationProperties,\n AnnotationRef,\n CommentThread,\n CommentsApi,\n FilePickerProvider,\n ToolDefaults,\n} from '@embedpdf/plugin-annotation';\n// The anchor of one annotation is a host read: it projects a drag in progress.\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport {\n enrichCommentThreads,\n installFilePickerProvider,\n pickRequestedFile,\n sameAnnotationAnchor,\n} from '@embedpdf/web';\nimport { devWarn } from '../dev';\nimport {\n useCapability,\n useCapabilityEvent,\n useOptionalCapability,\n useOptionalSelector,\n} from '../runtime/capabilities';\nimport { useDocumentId, useKernelValue } from '../runtime/kernel';\nimport type { CommentThreadView } from './types';\n\n/**\n * The annotation API (`create`, `update`, `selection`, `tools`, `text`,\n * `comments`, …) for your chrome. The object never changes, so it's safe to\n * keep in a closure; keep it whole (`annotation.selection.delete()`), since a\n * member taken out of it once stays the one of that moment.\n */\nexport function useAnnotation(): AnnotationCapability {\n return useCapability(AnnotationToken);\n}\n\n/** Subscribe to one annotation event while the component lives: `useAnnotationEvent((annotation) => annotation.onCreated, handler)`. */\nexport function useAnnotationEvent<Event>(\n select: (annotation: AnnotationCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(AnnotationToken, select, handler);\n}\n\nconst NO_ANNOTATIONS: readonly Annotation[] = Object.freeze([]);\n\n/**\n * The annotations matching `filter` (some pages, one kind), in drawing order,\n * as the user sees them, as a ref: the same array while they stay the same.\n * A getter follows a filter that changes. Empty without a document.\n */\nexport function useAnnotationList(\n filter?: MaybeRefOrGetter<AnnotationFilter | undefined>,\n): Readonly<Ref<readonly Annotation[]>> {\n return useOptionalSelector(\n AnnotationToken,\n (annotation) => annotation.list(toValue(filter)),\n NO_ANNOTATIONS,\n shallowEqual,\n );\n}\n\nconst NO_DEFAULTS: ToolDefaults = Object.freeze({});\n\n/**\n * A tool's defaults, as a ref: the fields its next annotation starts with,\n * over the engine's. It follows them, so a color picker always shows the\n * current color. Empty without a document.\n */\nexport function useAnnotationDefaults(toolId: MaybeRefOrGetter<string>): Readonly<Ref<ToolDefaults>> {\n return useOptionalSelector(\n AnnotationToken,\n (annotation) => annotation.tools.getDefaults(toValue(toolId)),\n NO_DEFAULTS,\n );\n}\n\nconst NO_PROPERTIES: AnnotationProperties = Object.freeze({\n properties: [],\n values: {},\n mixed: [],\n});\n\n/**\n * What a style panel shows, as a ref: the selection's properties\n * (`selection.getProperties()`), or, given a tool id, the tool's\n * (`tools.getProperties(id)`). It follows them. Empty without a document.\n */\nexport function useAnnotationProperties(\n toolId?: MaybeRefOrGetter<string | undefined>,\n): Readonly<Ref<AnnotationProperties>> {\n return useOptionalSelector(\n AnnotationToken,\n (annotation) => {\n const tool = toValue(toolId);\n return tool === undefined\n ? annotation.selection.getProperties()\n : annotation.tools.getProperties(tool);\n },\n NO_PROPERTIES,\n );\n}\n\n/**\n * An anchor for `<Anchored>` that keeps a card or a badge attached to one\n * annotation, as a ref: its page and the box around what it shows, following\n * a move as it happens. `null` for `null`, or an annotation that isn't here.\n * It changes when the annotation moves, not while people scroll or zoom: a\n * note that keeps its size on screen hands `<Anchored>` its `boundsIn`. A\n * getter follows a ref that changes (`() => hovered.value?.ref ?? null`).\n */\nexport function useAnnotationAnchor(\n ref: MaybeRefOrGetter<AnnotationRef | null>,\n): Readonly<Ref<AnnotationAnchor | null>> {\n return useOptionalSelector(\n AnnotationHostToken,\n (annotation) => {\n const wanted = toValue(ref);\n return wanted ? annotation.getAnnotationAnchor(wanted) : null;\n },\n null,\n sameAnnotationAnchor,\n );\n}\n\n// ── comments (the conversation plane) ────────────────────────────────────────\n\n/**\n * The comments API: the `comments` part of `useAnnotation()`, for the\n * document in scope. Like `useAnnotation()`, the object never changes and\n * always reaches the current document. Pair it with {@link useCommentThreads}\n * for the threads to show.\n */\nexport function useComments(): CommentsApi {\n const annotation = useAnnotation();\n // Read `comments` at each use, never once here: the document in scope may change.\n const target = markRaw({});\n return new Proxy(target, {\n get: (_target, key) =>\n typeof key === 'string' && key.startsWith('__v_')\n ? Reflect.get(target, key)\n : Reflect.get(annotation.comments, key),\n has: (_target, key) => Reflect.has(annotation.comments, key),\n }) as CommentsApi;\n}\n\nconst NO_PAGES: readonly PageLayout[] = Object.freeze([]);\nconst NO_THREADS: readonly CommentThread[] = Object.freeze([]);\n\n/**\n * Every comment thread in the document as a ref, display-ordered (page\n * position, then top of page, then creation date) and with where its page is\n * shown (`pageIndex`, `pageLabel`). It follows annotation writes (your own,\n * remote ones, loading) and page moves and deletes; the same array between\n * changes.\n */\nexport function useCommentThreads(): Readonly<Ref<readonly CommentThreadView[]>> {\n const documentId = useDocumentId();\n const threads = useOptionalSelector(\n AnnotationToken,\n (annotation) => annotation.comments.listThreads(),\n NO_THREADS,\n );\n const pages = useKernelValue((kernel) =>\n documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES,\n );\n return computed(() => enrichCommentThreads(threads.value, pages.value));\n}\n\n/**\n * The thread holding any of its annotations (the root, a reply, a grouped\n * part, a review state), as a ref, or null. A getter follows a ref that changes.\n */\nexport function useCommentThread(\n ref: MaybeRefOrGetter<AnnotationRef | null>,\n): Readonly<Ref<CommentThreadView | null>> {\n const views = useCommentThreads();\n const annotation = useOptionalCapability(AnnotationToken);\n return computed(() => {\n const wanted = toValue(ref);\n const api = annotation.value;\n if (wanted == null || !api) return null;\n const thread = api.comments.getThread(wanted);\n if (!thread) return null;\n const root = annotationKey(thread.root.ref);\n return views.value.find((view) => annotationKey(view.root.ref) === root) ?? null;\n });\n}\n\n// ── the file picker ──────────────────────────────────────────────────────────\n\n/**\n * The default file-picker provider: the browser's file dialog (from\n * `@embedpdf/web`), honouring the tool's `accept` filter. The adapter fulfils\n * the plugin's DOM-free port; the dialog never lives in the plugin.\n */\nexport const filePickerProvider: FilePickerProvider = pickRequestedFile;\n\n/**\n * Install the file-picker provider for the document in scope while the\n * component lives: the one port behind every click-then-pick tool (a stamp\n * whose source is `'prompt'`, the file attachment tool). Call it once, at a\n * document-wide spot (not in a page layer). Without an argument it installs\n * {@link filePickerProvider}, so those tools work out of the box; pass your\n * own (an asset library, a cloud drive: switch on `toolId` or `subtype`), or\n * `null` to make them do nothing. A ref follows a provider that changes.\n */\nexport function useFilePickerProvider(\n provider: MaybeRef<FilePickerProvider | null> = filePickerProvider,\n): void {\n const annotation = useOptionalCapability(AnnotationToken);\n // Not a getter: the provider is itself a function.\n watch(\n [annotation, () => unref(provider)],\n ([capability, current], _previous, onCleanup) => {\n if (!capability) return;\n // One port per document: a second caller silently replaces the first.\n onCleanup(\n installFilePickerProvider(capability, current, () =>\n devWarn(\n 'file-picker-provider-twice',\n 'useFilePickerProvider() is called from two mounted components for the same ' +\n 'document — the later one wins. Call it once, at a document-scoped spot.',\n ),\n ),\n );\n },\n { immediate: true },\n );\n}\n"],"names":["_useSlots","AnnotationHostToken","ref","paint","_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","_unref","_normalizeStyle","_createElementVNode","_renderSlot","_createBlock","_resolveDynamicComponent","_createVNode","SvgShapes","AnnotationScene","NativeDrawing","AnnotationFrame","shown","AnnotationLook","FreeTextBox","StampGhost","AnnotationChrome","_createSlots","_withCtx","Anchored","AnnotationToken"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,MAAM,qBAAqB,gBAAgB,eAAe;AAO1D,M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;AAEF,QAAM,QAAQ;AAAA,IAAe,CAAC,WAC5B,WAAW,QAAQ,OAAO,UAAU,UAAU,WAAW,KAAK,IAAI;AAAA,EAAA;AAEpE,SAAO,SAAS,MAAM,qBAAqB,QAAQ,OAAO,MAAM,KAAK,CAAC;AACxE;AAMO,SAAS,iBACd1B,MACyC;AACzC,QAAM,QAAQ,kBAAA;AACd,QAAM,aAAa,sBAAsB0B,iBAAe;AACxD,SAAO,SAAS,MAAM;AACpB,UAAM,SAAS,QAAQ1B,IAAG;AAC1B,UAAM,MAAM,WAAW;AACvB,QAAI,UAAU,QAAQ,CAAC,IAAK,QAAO;AACnC,UAAM,SAAS,IAAI,SAAS,UAAU,MAAM;AAC5C,QAAI,CAAC,OAAQ,QAAO;AACpB,UAAM,OAAO,cAAc,OAAO,KAAK,GAAG;AAC1C,WAAO,MAAM,MAAM,KAAK,CAAC,SAAS,cAAc,KAAK,KAAK,GAAG,MAAM,IAAI,KAAK;AAAA,EAC9E,CAAC;AACH;AASO,MAAM,qBAAyC;AAW/C,SAAS,sBACd,WAAgD,oBAC1C;AACN,QAAM,aAAa,sBAAsB0B,iBAAe;AAExD;AAAA,IACE,CAAC,YAAY,MAAM,MAAM,QAAQ,CAAC;AAAA,IAClC,CAAC,CAAC,YAAY,OAAO,GAAG,WAAW,cAAc;AAC/C,UAAI,CAAC,WAAY;AAEjB;AAAA,QACE;AAAA,UAA0B;AAAA,UAAY;AAAA,UAAS,MAC7C;AAAA,YACE;AAAA,YACA;AAAA,UAAA;AAAA,QAEF;AAAA,MACF;AAAA,IAEJ;AAAA,IACA,EAAE,WAAW,KAAA;AAAA,EAAK;AAEtB;"}
@@ -0,0 +1,26 @@
1
+ import { computed } from "vue";
2
+ import { SignatureToken, signerRowsOf, SIGNATURES_LIBRARY_KIND, signatureState } from "@embedpdf/plugin-signature";
3
+ import { a as useCapability, b as useCapabilityEvent } from "./capabilities-C7YzgPCX.js";
4
+ import { useStampLibraries, useStampAssets } from "./stamp.js";
5
+ import { s as settingsComposable, a as stateComposable } from "./state-DZg8q3v6.js";
6
+ function useSignature() {
7
+ return useCapability(SignatureToken);
8
+ }
9
+ const useSignatureState = stateComposable(signatureState);
10
+ const useSignatureSettings = settingsComposable(SignatureToken);
11
+ function useSignatureEvent(select, handler) {
12
+ useCapabilityEvent(SignatureToken, select, handler);
13
+ }
14
+ function useSignerRows() {
15
+ const libraries = useStampLibraries({ kind: SIGNATURES_LIBRARY_KIND });
16
+ const assets = useStampAssets();
17
+ return computed(() => signerRowsOf(libraries.value, assets.value));
18
+ }
19
+ export {
20
+ useSignatureEvent as a,
21
+ useSignatureSettings as b,
22
+ useSignatureState as c,
23
+ useSignerRows as d,
24
+ useSignature as u
25
+ };
26
+ //# sourceMappingURL=composables-DwsZdg06.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composables-DwsZdg06.js","sources":["../src/signature/composables.ts"],"sourcesContent":["/**\n * The signature composables: `useSignature()` (the API), the state and the\n * settings as refs, `useSignatureEvent()`, and `useSignerRows()`, the people\n * whose marks this browser holds, for a signature picker.\n */\nimport { computed } from 'vue';\nimport type { Ref } from 'vue';\nimport type { EventHook } from '@embedpdf/core';\nimport {\n signatureState,\n signerRowsOf,\n SIGNATURES_LIBRARY_KIND,\n SignatureToken,\n} from '@embedpdf/plugin-signature';\nimport type { SignatureCapability, SignerRow } from '@embedpdf/plugin-signature';\nimport { useCapability, useCapabilityEvent } from '../runtime/capabilities';\nimport { useStampAssets, useStampLibraries } from '../stamp';\nimport { settingsComposable, stateComposable } from '../state';\nimport type { StateComposable } from '../state';\n\n/**\n * The signature API for the document in scope: sign, place a mark, fill or\n * clear a field, check the signatures. The object never changes, so it's\n * safe to keep in a closure; keep it whole (`signature.sign(…)`), since a\n * member taken out of it once stays the one of that moment.\n */\nexport function useSignature(): SignatureCapability {\n return useCapability(SignatureToken);\n}\n\n/**\n * The signatures' state as refs: the signed fields with their verdicts\n * (`signatures`), what they allow, the `target`, whether a signing runs\n * (`busy`), a two-step signing in progress, and whether they're read,\n * declared once in `signatureState`. With a selector, one ref that updates\n * only when the value it picks changes. Empty without a document.\n *\n * Typed through the declaration, so the published types name it from\n * `@embedpdf/plugin-signature`, a dependency of this package, and not from the\n * engine package `protection`'s type comes from, which isn't one.\n */\nexport const useSignatureState: StateComposable<ReturnType<typeof signatureState.read>> =\n stateComposable(signatureState);\n\n/**\n * The signature settings (`key`, `mode`, `trust`, `allowCertify`) as refs, or\n * one ref for the value `select` picks. They belong to the plugin, so they\n * read without a document.\n */\nexport const useSignatureSettings = settingsComposable(SignatureToken);\n\n/** Subscribe to one signature event while the component lives: `useSignatureEvent((signature) => signature.onSigned, handler)`. */\nexport function useSignatureEvent<Event>(\n select: (signature: SignatureCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(SignatureToken, select, handler);\n}\n\n/**\n * The people whose marks this browser holds, one row per library of kind\n * `signatures`, for a picker, as a ref: `const rows = useSignerRows()`.\n * Derived from the stamp plugin, so it needs `stampPlugin()`: rename, delete\n * and export are the library verbs, and nothing is stored beyond the file.\n */\nexport function useSignerRows(): Readonly<Ref<readonly SignerRow[]>> {\n const libraries = useStampLibraries({ kind: SIGNATURES_LIBRARY_KIND });\n const assets = useStampAssets();\n return computed(() => signerRowsOf(libraries.value, assets.value));\n}\n"],"names":[],"mappings":";;;;;AA0BO,SAAS,eAAoC;AAClD,SAAO,cAAc,cAAc;AACrC;AAaO,MAAM,oBACX,gBAAgB,cAAc;AAOzB,MAAM,uBAAuB,mBAAmB,cAAc;AAG9D,SAAS,kBACd,QACA,SACM;AACN,qBAAmB,gBAAgB,QAAQ,OAAO;AACpD;AAQO,SAAS,gBAAqD;AACnE,QAAM,YAAY,kBAAkB,EAAE,MAAM,yBAAyB;AACrE,QAAM,SAAS,eAAA;AACf,SAAO,SAAS,MAAM,aAAa,UAAU,OAAO,OAAO,KAAK,CAAC;AACnE;"}
@@ -0,0 +1,17 @@
1
+ const warned = /* @__PURE__ */ new Set();
2
+ function isDev() {
3
+ try {
4
+ return process.env.NODE_ENV !== "production";
5
+ } catch {
6
+ return true;
7
+ }
8
+ }
9
+ function devWarn(key, message) {
10
+ if (!isDev() || warned.has(key)) return;
11
+ warned.add(key);
12
+ console.warn(`[embedpdf] ${message}`);
13
+ }
14
+ export {
15
+ devWarn as d
16
+ };
17
+ //# sourceMappingURL=dev-CtMlvxjZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-CtMlvxjZ.js","sources":["../src/dev.ts"],"sourcesContent":["/**\n * Development-time guardrails. Every warning fires once per process (keyed),\n * says what is wrong and what to do instead, and compiles out of production\n * builds ({@link isDev}).\n */\nconst warned = new Set<string>();\n\n/**\n * Whether this is a development build, as the app's bundler says: every bundler replaces\n * `process.env.NODE_ENV`, with `\"production\"` in a production build, so there this is `false`\n * and the warnings behind it compile out. A page with no bundler has no `process` at all, and\n * counts as development: the warnings help most while you try the package out.\n */\nexport function isDev(): boolean {\n try {\n return process.env.NODE_ENV !== 'production';\n } catch {\n return true;\n }\n}\n\n/** Warn once per key. No-op in production. */\nexport function devWarn(key: string, message: string): void {\n if (!isDev() || warned.has(key)) return;\n warned.add(key);\n console.warn(`[embedpdf] ${message}`);\n}\n\n/** Test seam: forget every warning so a suite can assert one fires again. */\nexport function resetDevWarnings(): void {\n warned.clear();\n}\n"],"names":[],"mappings":"AAKA,MAAM,6BAAa,IAAA;AAQZ,SAAS,QAAiB;AAC/B,MAAI;AACF,WAAO,QAAQ,IAAI,aAAa;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,QAAQ,KAAa,SAAuB;AAC1D,MAAI,CAAC,MAAA,KAAW,OAAO,IAAI,GAAG,EAAG;AACjC,SAAO,IAAI,GAAG;AACd,UAAQ,KAAK,cAAc,OAAO,EAAE;AACtC;"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ const warned = /* @__PURE__ */ new Set();
3
+ function isDev() {
4
+ try {
5
+ return process.env.NODE_ENV !== "production";
6
+ } catch {
7
+ return true;
8
+ }
9
+ }
10
+ function devWarn(key, message) {
11
+ if (!isDev() || warned.has(key)) return;
12
+ warned.add(key);
13
+ console.warn(`[embedpdf] ${message}`);
14
+ }
15
+ exports.devWarn = devWarn;
16
+ //# sourceMappingURL=dev-eeIS2B4c.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev-eeIS2B4c.cjs","sources":["../src/dev.ts"],"sourcesContent":["/**\n * Development-time guardrails. Every warning fires once per process (keyed),\n * says what is wrong and what to do instead, and compiles out of production\n * builds ({@link isDev}).\n */\nconst warned = new Set<string>();\n\n/**\n * Whether this is a development build, as the app's bundler says: every bundler replaces\n * `process.env.NODE_ENV`, with `\"production\"` in a production build, so there this is `false`\n * and the warnings behind it compile out. A page with no bundler has no `process` at all, and\n * counts as development: the warnings help most while you try the package out.\n */\nexport function isDev(): boolean {\n try {\n return process.env.NODE_ENV !== 'production';\n } catch {\n return true;\n }\n}\n\n/** Warn once per key. No-op in production. */\nexport function devWarn(key: string, message: string): void {\n if (!isDev() || warned.has(key)) return;\n warned.add(key);\n console.warn(`[embedpdf] ${message}`);\n}\n\n/** Test seam: forget every warning so a suite can assert one fires again. */\nexport function resetDevWarnings(): void {\n warned.clear();\n}\n"],"names":[],"mappings":";AAKA,MAAM,6BAAa,IAAA;AAQZ,SAAS,QAAiB;AAC/B,MAAI;AACF,WAAO,QAAQ,IAAI,aAAa;AAAA,EAClC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,QAAQ,KAAa,SAAuB;AAC1D,MAAI,CAAC,MAAA,KAAW,OAAO,IAAI,GAAG,EAAG;AACjC,SAAO,IAAI,GAAG;AACd,UAAQ,KAAK,cAAc,OAAO,EAAE;AACtC;;"}
package/dist/dev.d.cts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Whether this is a development build, as the app's bundler says: every bundler replaces
3
+ * `process.env.NODE_ENV`, with `"production"` in a production build, so there this is `false`
4
+ * and the warnings behind it compile out. A page with no bundler has no `process` at all, and
5
+ * counts as development: the warnings help most while you try the package out.
6
+ */
7
+ export declare function isDev(): boolean;
8
+ /** Warn once per key. No-op in production. */
9
+ export declare function devWarn(key: string, message: string): void;
10
+ /** Test seam: forget every warning so a suite can assert one fires again. */
11
+ export declare function resetDevWarnings(): void;
package/dist/dev.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Whether this is a development build, as the app's bundler says: every bundler replaces
3
+ * `process.env.NODE_ENV`, with `"production"` in a production build, so there this is `false`
4
+ * and the warnings behind it compile out. A page with no bundler has no `process` at all, and
5
+ * counts as development: the warnings help most while you try the package out.
6
+ */
7
+ export declare function isDev(): boolean;
8
+ /** Warn once per key. No-op in production. */
9
+ export declare function devWarn(key: string, message: string): void;
10
+ /** Test seam: forget every warning so a suite can assert one fires again. */
11
+ export declare function resetDevWarnings(): void;
@@ -0,0 +1,34 @@
1
+ import { DocumentsToken, shallowEqual, documentState, documentsState } from "@embedpdf/core";
2
+ import { f as fieldRefs, a as stateComposable } from "./state-DZg8q3v6.js";
3
+ import { g as useKernelValue, a as useCapability, b as useCapabilityEvent, d as useDocumentId } from "./capabilities-C7YzgPCX.js";
4
+ function useDocuments() {
5
+ return useCapability(DocumentsToken);
6
+ }
7
+ const useDocument = stateComposable(documentState);
8
+ const useDocumentsState = stateComposable(documentsState);
9
+ function useDocumentsEvent(select, handler) {
10
+ useCapabilityEvent(DocumentsToken, select, handler);
11
+ }
12
+ const NO_PAGES = Object.freeze([]);
13
+ function usePageList() {
14
+ const documentId = useDocumentId();
15
+ return useKernelValue(
16
+ (kernel) => documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES
17
+ );
18
+ }
19
+ function useViewerSettings(select) {
20
+ const value = useKernelValue((kernel) => {
21
+ const settings = kernel.getSettings();
22
+ return select ? select(settings) : settings;
23
+ }, shallowEqual);
24
+ return select ? value : fieldRefs(value);
25
+ }
26
+ export {
27
+ useDocuments as a,
28
+ useDocumentsEvent as b,
29
+ useDocumentsState as c,
30
+ usePageList as d,
31
+ useViewerSettings as e,
32
+ useDocument as u
33
+ };
34
+ //# sourceMappingURL=documents-DUu5H4yH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents-DUu5H4yH.js","sources":["../src/runtime/documents.ts"],"sourcesContent":["/**\n * The documents in Vue: `useDocuments()` is the API (its calls use the\n * document in scope), `useDocument()` and `useDocumentsState()` what to show,\n * `usePageList()` the pages, and `useViewerSettings()` the `<Viewer>`'s own\n * settings.\n */\nimport { DocumentsToken, documentState, documentsState, shallowEqual } from '@embedpdf/core';\nimport type {\n DocumentsCapability,\n EventHook,\n PageInfo,\n ViewerSettings,\n} from '@embedpdf/core';\nimport type { Ref } from 'vue';\nimport { stateComposable } from '../state';\nimport { useCapability, useCapabilityEvent } from './capabilities';\nimport { useDocumentId, useKernelValue } from './kernel';\nimport { fieldRefs } from './refs';\nimport type { FieldRefs } from './refs';\n\n/**\n * The documents API: open, close, unlock, download, and the tabs. Inside a\n * `<DocumentScope>`, the calls that leave out the document use that one, so\n * `download()` without an id downloads the document in scope. The object never\n * changes, so it's safe to keep in a closure. What to show comes from\n * `useDocument()` and `useDocumentsState()`.\n */\nexport function useDocuments(): DocumentsCapability {\n return useCapability(DocumentsToken);\n}\n\n/**\n * The document this component talks to: the one its `<DocumentScope>` names,\n * or else the active one. Its `id`, `name`, `status`, `pageCount`,\n * `hasUnsavedChanges`, and why it's locked or failed, as refs. With no\n * document, an empty one that reads as still opening. With a selector, one ref\n * for the value it picks.\n */\nexport const useDocument = stateComposable(documentState);\n\n/**\n * Every open document, in tab order (loading, locked and failed ones too), and\n * the active one's id, as refs. With a selector, one ref for the value it picks.\n */\nexport const useDocumentsState = stateComposable(documentsState);\n\n/** Subscribe to one documents event while the component lives: `useDocumentsEvent((documents) => documents.onOpened, handler)`. */\nexport function useDocumentsEvent<Event>(\n select: (documents: DocumentsCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(DocumentsToken, select, handler);\n}\n\nconst NO_PAGES: readonly PageInfo[] = Object.freeze([]);\n\n/**\n * The pages of the document this component talks to, in order: each with its\n * `ref`, `index`, `label`, size and rotation. Needs no Stage, so a thumbnail\n * list or a page picker works anywhere. The same array until a page is added,\n * removed, moved or rotated; empty with no document.\n */\nexport function usePageList(): Readonly<Ref<readonly PageInfo[]>> {\n const documentId = useDocumentId();\n return useKernelValue((kernel) =>\n documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES,\n );\n}\n\n/**\n * The viewer's own settings (`<Viewer :identity :scope :accent :page>`), as\n * refs, or one ref for the value `select` picks: the accent every part without\n * a color of its own follows, and how pages look. What paints a page or an\n * accent reads it here, through `paint()` from `@embedpdf/web`, so a CSS\n * variable still wins.\n */\nexport function useViewerSettings(): FieldRefs<ViewerSettings>;\nexport function useViewerSettings<Selected>(\n select: (settings: ViewerSettings) => Selected,\n): Readonly<Ref<Selected>>;\nexport function useViewerSettings<Selected>(select?: (settings: ViewerSettings) => Selected) {\n const value = useKernelValue((kernel) => {\n const settings = kernel.getSettings();\n return select ? select(settings) : settings;\n }, shallowEqual);\n return select ? value : fieldRefs(value as Readonly<Ref<ViewerSettings>>);\n}\n"],"names":[],"mappings":";;;AA2BO,SAAS,eAAoC;AAClD,SAAO,cAAc,cAAc;AACrC;AASO,MAAM,cAAc,gBAAgB,aAAa;AAMjD,MAAM,oBAAoB,gBAAgB,cAAc;AAGxD,SAAS,kBACd,QACA,SACM;AACN,qBAAmB,gBAAgB,QAAQ,OAAO;AACpD;AAEA,MAAM,WAAgC,OAAO,OAAO,EAAE;AAQ/C,SAAS,cAAkD;AAChE,QAAM,aAAa,cAAA;AACnB,SAAO;AAAA,IAAe,CAAC,WACrB,WAAW,QAAQ,OAAO,UAAU,UAAU,WAAW,KAAK,IAAI;AAAA,EAAA;AAEtE;AAaO,SAAS,kBAA4B,QAAiD;AAC3F,QAAM,QAAQ,eAAe,CAAC,WAAW;AACvC,UAAM,WAAW,OAAO,YAAA;AACxB,WAAO,SAAS,OAAO,QAAQ,IAAI;AAAA,EACrC,GAAG,YAAY;AACf,SAAO,SAAS,QAAQ,UAAU,KAAsC;AAC1E;"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ const core = require("@embedpdf/core");
3
+ const state = require("./state-M22NDJQo.cjs");
4
+ const capabilities = require("./capabilities-DVNJmgy7.cjs");
5
+ function useDocuments() {
6
+ return capabilities.useCapability(core.DocumentsToken);
7
+ }
8
+ const useDocument = state.stateComposable(core.documentState);
9
+ const useDocumentsState = state.stateComposable(core.documentsState);
10
+ function useDocumentsEvent(select, handler) {
11
+ capabilities.useCapabilityEvent(core.DocumentsToken, select, handler);
12
+ }
13
+ const NO_PAGES = Object.freeze([]);
14
+ function usePageList() {
15
+ const documentId = capabilities.useDocumentId();
16
+ return capabilities.useKernelValue(
17
+ (kernel) => documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES
18
+ );
19
+ }
20
+ function useViewerSettings(select) {
21
+ const value = capabilities.useKernelValue((kernel) => {
22
+ const settings = kernel.getSettings();
23
+ return select ? select(settings) : settings;
24
+ }, core.shallowEqual);
25
+ return select ? value : state.fieldRefs(value);
26
+ }
27
+ exports.useDocument = useDocument;
28
+ exports.useDocuments = useDocuments;
29
+ exports.useDocumentsEvent = useDocumentsEvent;
30
+ exports.useDocumentsState = useDocumentsState;
31
+ exports.usePageList = usePageList;
32
+ exports.useViewerSettings = useViewerSettings;
33
+ //# sourceMappingURL=documents-TQ1fMdWI.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"documents-TQ1fMdWI.cjs","sources":["../src/runtime/documents.ts"],"sourcesContent":["/**\n * The documents in Vue: `useDocuments()` is the API (its calls use the\n * document in scope), `useDocument()` and `useDocumentsState()` what to show,\n * `usePageList()` the pages, and `useViewerSettings()` the `<Viewer>`'s own\n * settings.\n */\nimport { DocumentsToken, documentState, documentsState, shallowEqual } from '@embedpdf/core';\nimport type {\n DocumentsCapability,\n EventHook,\n PageInfo,\n ViewerSettings,\n} from '@embedpdf/core';\nimport type { Ref } from 'vue';\nimport { stateComposable } from '../state';\nimport { useCapability, useCapabilityEvent } from './capabilities';\nimport { useDocumentId, useKernelValue } from './kernel';\nimport { fieldRefs } from './refs';\nimport type { FieldRefs } from './refs';\n\n/**\n * The documents API: open, close, unlock, download, and the tabs. Inside a\n * `<DocumentScope>`, the calls that leave out the document use that one, so\n * `download()` without an id downloads the document in scope. The object never\n * changes, so it's safe to keep in a closure. What to show comes from\n * `useDocument()` and `useDocumentsState()`.\n */\nexport function useDocuments(): DocumentsCapability {\n return useCapability(DocumentsToken);\n}\n\n/**\n * The document this component talks to: the one its `<DocumentScope>` names,\n * or else the active one. Its `id`, `name`, `status`, `pageCount`,\n * `hasUnsavedChanges`, and why it's locked or failed, as refs. With no\n * document, an empty one that reads as still opening. With a selector, one ref\n * for the value it picks.\n */\nexport const useDocument = stateComposable(documentState);\n\n/**\n * Every open document, in tab order (loading, locked and failed ones too), and\n * the active one's id, as refs. With a selector, one ref for the value it picks.\n */\nexport const useDocumentsState = stateComposable(documentsState);\n\n/** Subscribe to one documents event while the component lives: `useDocumentsEvent((documents) => documents.onOpened, handler)`. */\nexport function useDocumentsEvent<Event>(\n select: (documents: DocumentsCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(DocumentsToken, select, handler);\n}\n\nconst NO_PAGES: readonly PageInfo[] = Object.freeze([]);\n\n/**\n * The pages of the document this component talks to, in order: each with its\n * `ref`, `index`, `label`, size and rotation. Needs no Stage, so a thumbnail\n * list or a page picker works anywhere. The same array until a page is added,\n * removed, moved or rotated; empty with no document.\n */\nexport function usePageList(): Readonly<Ref<readonly PageInfo[]>> {\n const documentId = useDocumentId();\n return useKernelValue((kernel) =>\n documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES,\n );\n}\n\n/**\n * The viewer's own settings (`<Viewer :identity :scope :accent :page>`), as\n * refs, or one ref for the value `select` picks: the accent every part without\n * a color of its own follows, and how pages look. What paints a page or an\n * accent reads it here, through `paint()` from `@embedpdf/web`, so a CSS\n * variable still wins.\n */\nexport function useViewerSettings(): FieldRefs<ViewerSettings>;\nexport function useViewerSettings<Selected>(\n select: (settings: ViewerSettings) => Selected,\n): Readonly<Ref<Selected>>;\nexport function useViewerSettings<Selected>(select?: (settings: ViewerSettings) => Selected) {\n const value = useKernelValue((kernel) => {\n const settings = kernel.getSettings();\n return select ? select(settings) : settings;\n }, shallowEqual);\n return select ? value : fieldRefs(value as Readonly<Ref<ViewerSettings>>);\n}\n"],"names":["useCapability","DocumentsToken","stateComposable","documentState","documentsState","useCapabilityEvent","useDocumentId","useKernelValue","shallowEqual","fieldRefs"],"mappings":";;;;AA2BO,SAAS,eAAoC;AAClD,SAAOA,aAAAA,cAAcC,KAAAA,cAAc;AACrC;AASO,MAAM,cAAcC,MAAAA,gBAAgBC,KAAAA,aAAa;AAMjD,MAAM,oBAAoBD,MAAAA,gBAAgBE,KAAAA,cAAc;AAGxD,SAAS,kBACd,QACA,SACM;AACNC,kCAAmBJ,KAAAA,gBAAgB,QAAQ,OAAO;AACpD;AAEA,MAAM,WAAgC,OAAO,OAAO,EAAE;AAQ/C,SAAS,cAAkD;AAChE,QAAM,aAAaK,aAAAA,cAAA;AACnB,SAAOC,aAAAA;AAAAA,IAAe,CAAC,WACrB,WAAW,QAAQ,OAAO,UAAU,UAAU,WAAW,KAAK,IAAI;AAAA,EAAA;AAEtE;AAaO,SAAS,kBAA4B,QAAiD;AAC3F,QAAM,QAAQA,4BAAe,CAAC,WAAW;AACvC,UAAM,WAAW,OAAO,YAAA;AACxB,WAAO,SAAS,OAAO,QAAQ,IAAI;AAAA,EACrC,GAAGC,KAAAA,YAAY;AACf,SAAO,SAAS,QAAQC,MAAAA,UAAU,KAAsC;AAC1E;;;;;;;"}
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'button';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'button';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'choice';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'choice';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ visible: boolean;
3
+ /** The ring's CSS color: the form's `focus.color` setting, behind its CSS variable. */
4
+ color: string;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ visible: boolean;
3
+ /** The ring's CSS color: the form's `focus.color` setting, behind its CSS variable. */
4
+ color: string;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'choice';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'choice';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,27 @@
1
+ export interface NativeListBoxOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ type __VLS_Props = {
6
+ /** The accessible name: the field's tooltip, else its full name. */
7
+ label: string;
8
+ disabled: boolean;
9
+ multi: boolean;
10
+ options: readonly NativeListBoxOption[];
11
+ /** The engine's selection. */
12
+ selected: readonly string[];
13
+ /**
14
+ * Writes a choice. A function rather than an event, because its promise
15
+ * matters: a write that fails puts the engine's selection back.
16
+ */
17
+ onSelect: (values: string[]) => void | Promise<unknown>;
18
+ };
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ focus: () => any;
21
+ blur: () => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onFocus?: (() => any) | undefined;
24
+ onBlur?: (() => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
@@ -0,0 +1,27 @@
1
+ export interface NativeListBoxOption {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ type __VLS_Props = {
6
+ /** The accessible name: the field's tooltip, else its full name. */
7
+ label: string;
8
+ disabled: boolean;
9
+ multi: boolean;
10
+ options: readonly NativeListBoxOption[];
11
+ /** The engine's selection. */
12
+ selected: readonly string[];
13
+ /**
14
+ * Writes a choice. A function rather than an event, because its promise
15
+ * matters: a write that fails puts the engine's selection back.
16
+ */
17
+ onSelect: (values: string[]) => void | Promise<unknown>;
18
+ };
19
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
20
+ focus: () => any;
21
+ blur: () => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
+ onFocus?: (() => any) | undefined;
24
+ onBlur?: (() => any) | undefined;
25
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'signature';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import type { FormWidgetItem } from '@embedpdf/plugin-form';
2
+ import type { FormColors } from '@embedpdf/web';
3
+ type __VLS_Props = {
4
+ item: Extract<FormWidgetItem, {
5
+ control: 'signature';
6
+ }>;
7
+ colors: FormColors;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;