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

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 (405) 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-CtTu1FGX.js +191 -0
  12. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-CtTu1FGX.js.map +1 -0
  13. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-loLSm4lV.cjs +190 -0
  14. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-loLSm4lV.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 +27 -0
  94. package/dist/annotation/text-box.d.ts +27 -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/capabilities-C7YzgPCX.js +164 -0
  104. package/dist/capabilities-C7YzgPCX.js.map +1 -0
  105. package/dist/capabilities-DVNJmgy7.cjs +163 -0
  106. package/dist/capabilities-DVNJmgy7.cjs.map +1 -0
  107. package/dist/commands.cjs +81 -0
  108. package/dist/commands.cjs.map +1 -0
  109. package/dist/commands.d.cts +61 -0
  110. package/dist/commands.d.ts +61 -0
  111. package/dist/commands.js +76 -0
  112. package/dist/commands.js.map +1 -0
  113. package/dist/composables-BGBsNDf9.cjs +25 -0
  114. package/dist/composables-BGBsNDf9.cjs.map +1 -0
  115. package/dist/composables-BuHvnUlo.cjs +1003 -0
  116. package/dist/composables-BuHvnUlo.cjs.map +1 -0
  117. package/dist/composables-CIkhKwAg.js +1004 -0
  118. package/dist/composables-CIkhKwAg.js.map +1 -0
  119. package/dist/composables-DwsZdg06.js +26 -0
  120. package/dist/composables-DwsZdg06.js.map +1 -0
  121. package/dist/dev-CtMlvxjZ.js +17 -0
  122. package/dist/dev-CtMlvxjZ.js.map +1 -0
  123. package/dist/dev-eeIS2B4c.cjs +16 -0
  124. package/dist/dev-eeIS2B4c.cjs.map +1 -0
  125. package/dist/dev.d.cts +11 -0
  126. package/dist/dev.d.ts +11 -0
  127. package/dist/documents-DUu5H4yH.js +34 -0
  128. package/dist/documents-DUu5H4yH.js.map +1 -0
  129. package/dist/documents-TQ1fMdWI.cjs +33 -0
  130. package/dist/documents-TQ1fMdWI.cjs.map +1 -0
  131. package/dist/form/ButtonControl.vue.d.cts +11 -0
  132. package/dist/form/ButtonControl.vue.d.ts +11 -0
  133. package/dist/form/ComboControl.vue.d.cts +11 -0
  134. package/dist/form/ComboControl.vue.d.ts +11 -0
  135. package/dist/form/FieldPictures.vue.d.cts +3 -0
  136. package/dist/form/FieldPictures.vue.d.ts +3 -0
  137. package/dist/form/FormFocusRing.vue.d.cts +8 -0
  138. package/dist/form/FormFocusRing.vue.d.ts +8 -0
  139. package/dist/form/FormLayer.vue.d.cts +3 -0
  140. package/dist/form/FormLayer.vue.d.ts +3 -0
  141. package/dist/form/ListControl.vue.d.cts +11 -0
  142. package/dist/form/ListControl.vue.d.ts +11 -0
  143. package/dist/form/NativeListBox.vue.d.cts +27 -0
  144. package/dist/form/NativeListBox.vue.d.ts +27 -0
  145. package/dist/form/SignatureControl.vue.d.cts +11 -0
  146. package/dist/form/SignatureControl.vue.d.ts +11 -0
  147. package/dist/form/TextControl.vue.d.cts +11 -0
  148. package/dist/form/TextControl.vue.d.ts +11 -0
  149. package/dist/form/ToggleControl.vue.d.cts +11 -0
  150. package/dist/form/ToggleControl.vue.d.ts +11 -0
  151. package/dist/form/composables.d.cts +52 -0
  152. package/dist/form/composables.d.ts +52 -0
  153. package/dist/form/widget-box.d.cts +34 -0
  154. package/dist/form/widget-box.d.ts +34 -0
  155. package/dist/form.cjs +17 -0
  156. package/dist/form.cjs.map +1 -0
  157. package/dist/form.d.cts +12 -0
  158. package/dist/form.d.ts +12 -0
  159. package/dist/form.js +11 -0
  160. package/dist/form.js.map +1 -0
  161. package/dist/history.cjs +22 -0
  162. package/dist/history.cjs.map +1 -0
  163. package/dist/history.d.cts +31 -0
  164. package/dist/history.d.ts +31 -0
  165. package/dist/history.js +17 -0
  166. package/dist/history.js.map +1 -0
  167. package/dist/i18n.cjs +29 -0
  168. package/dist/i18n.cjs.map +1 -0
  169. package/dist/i18n.d.cts +36 -0
  170. package/dist/i18n.d.ts +36 -0
  171. package/dist/i18n.js +24 -0
  172. package/dist/i18n.js.map +1 -0
  173. package/dist/index.cjs +391 -0
  174. package/dist/index.cjs.map +1 -0
  175. package/dist/index.d.cts +30 -0
  176. package/dist/index.d.ts +30 -0
  177. package/dist/index.js +223 -0
  178. package/dist/index.js.map +1 -0
  179. package/dist/interaction/PagePointerSource.vue.d.cts +3 -0
  180. package/dist/interaction/PagePointerSource.vue.d.ts +3 -0
  181. package/dist/interaction.cjs +63 -0
  182. package/dist/interaction.cjs.map +1 -0
  183. package/dist/interaction.d.cts +40 -0
  184. package/dist/interaction.d.ts +40 -0
  185. package/dist/interaction.js +47 -0
  186. package/dist/interaction.js.map +1 -0
  187. package/dist/link/LinkAnchor.vue.d.cts +9 -0
  188. package/dist/link/LinkAnchor.vue.d.ts +9 -0
  189. package/dist/link/LinkLayer.vue.d.cts +22 -0
  190. package/dist/link/LinkLayer.vue.d.ts +22 -0
  191. package/dist/link/composables.d.cts +29 -0
  192. package/dist/link/composables.d.ts +29 -0
  193. package/dist/link.cjs +14 -0
  194. package/dist/link.cjs.map +1 -0
  195. package/dist/link.d.cts +11 -0
  196. package/dist/link.d.ts +11 -0
  197. package/dist/link.js +8 -0
  198. package/dist/link.js.map +1 -0
  199. package/dist/measurement.cjs +43 -0
  200. package/dist/measurement.cjs.map +1 -0
  201. package/dist/measurement.d.cts +51 -0
  202. package/dist/measurement.d.ts +51 -0
  203. package/dist/measurement.js +38 -0
  204. package/dist/measurement.js.map +1 -0
  205. package/dist/metadata.cjs +22 -0
  206. package/dist/metadata.cjs.map +1 -0
  207. package/dist/metadata.d.cts +31 -0
  208. package/dist/metadata.d.ts +31 -0
  209. package/dist/metadata.js +17 -0
  210. package/dist/metadata.js.map +1 -0
  211. package/dist/page-D9XIuLSj.js +16 -0
  212. package/dist/page-D9XIuLSj.js.map +1 -0
  213. package/dist/page-Doy4_Sdz.cjs +15 -0
  214. package/dist/page-Doy4_Sdz.cjs.map +1 -0
  215. package/dist/page-edit.cjs +15 -0
  216. package/dist/page-edit.cjs.map +1 -0
  217. package/dist/page-edit.d.cts +16 -0
  218. package/dist/page-edit.d.ts +16 -0
  219. package/dist/page-edit.js +10 -0
  220. package/dist/page-edit.js.map +1 -0
  221. package/dist/page-layers-c-CJYAUO.cjs +30 -0
  222. package/dist/page-layers-c-CJYAUO.cjs.map +1 -0
  223. package/dist/page-layers-rlh4-1qr.js +31 -0
  224. package/dist/page-layers-rlh4-1qr.js.map +1 -0
  225. package/dist/page-layers.d.cts +21 -0
  226. package/dist/page-layers.d.ts +21 -0
  227. package/dist/page-view/PageView.vue.d.cts +42 -0
  228. package/dist/page-view/PageView.vue.d.ts +42 -0
  229. package/dist/page-view.cjs +5 -0
  230. package/dist/page-view.cjs.map +1 -0
  231. package/dist/page-view.d.cts +10 -0
  232. package/dist/page-view.d.ts +10 -0
  233. package/dist/page-view.js +5 -0
  234. package/dist/page-view.js.map +1 -0
  235. package/dist/projector-CDZn1kh1.js +32 -0
  236. package/dist/projector-CDZn1kh1.js.map +1 -0
  237. package/dist/projector-Cf7879sx.cjs +31 -0
  238. package/dist/projector-Cf7879sx.cjs.map +1 -0
  239. package/dist/redaction.cjs +34 -0
  240. package/dist/redaction.cjs.map +1 -0
  241. package/dist/redaction.d.cts +44 -0
  242. package/dist/redaction.d.ts +44 -0
  243. package/dist/redaction.js +29 -0
  244. package/dist/redaction.js.map +1 -0
  245. package/dist/render/RenderLayer.vue.d.cts +23 -0
  246. package/dist/render/RenderLayer.vue.d.ts +23 -0
  247. package/dist/render/TileImage.vue.d.cts +13 -0
  248. package/dist/render/TileImage.vue.d.ts +13 -0
  249. package/dist/render/TilePlane.vue.d.cts +7 -0
  250. package/dist/render/TilePlane.vue.d.ts +7 -0
  251. package/dist/render.cjs +262 -0
  252. package/dist/render.cjs.map +1 -0
  253. package/dist/render.d.cts +16 -0
  254. package/dist/render.d.ts +16 -0
  255. package/dist/render.js +257 -0
  256. package/dist/render.js.map +1 -0
  257. package/dist/runtime/DocumentGate.vue.d.cts +24 -0
  258. package/dist/runtime/DocumentGate.vue.d.ts +24 -0
  259. package/dist/runtime/DocumentScope.vue.d.cts +16 -0
  260. package/dist/runtime/DocumentScope.vue.d.ts +16 -0
  261. package/dist/runtime/KernelProvider.vue.d.cts +17 -0
  262. package/dist/runtime/KernelProvider.vue.d.ts +17 -0
  263. package/dist/runtime/SvgShapes.vue.d.cts +7 -0
  264. package/dist/runtime/SvgShapes.vue.d.ts +7 -0
  265. package/dist/runtime/Viewer.vue.d.cts +57 -0
  266. package/dist/runtime/Viewer.vue.d.ts +57 -0
  267. package/dist/runtime/capabilities.d.cts +52 -0
  268. package/dist/runtime/capabilities.d.ts +52 -0
  269. package/dist/runtime/documents.d.cts +42 -0
  270. package/dist/runtime/documents.d.ts +42 -0
  271. package/dist/runtime/kernel.d.cts +36 -0
  272. package/dist/runtime/kernel.d.ts +36 -0
  273. package/dist/runtime/page.d.cts +15 -0
  274. package/dist/runtime/page.d.ts +15 -0
  275. package/dist/runtime/refs.d.cts +12 -0
  276. package/dist/runtime/refs.d.ts +12 -0
  277. package/dist/runtime/surface-box.d.cts +12 -0
  278. package/dist/runtime/surface-box.d.ts +12 -0
  279. package/dist/runtime.cjs +53 -0
  280. package/dist/runtime.cjs.map +1 -0
  281. package/dist/runtime.d.cts +24 -0
  282. package/dist/runtime.d.ts +24 -0
  283. package/dist/runtime.js +38 -0
  284. package/dist/runtime.js.map +1 -0
  285. package/dist/scope-BQA4toWB.cjs +17 -0
  286. package/dist/scope-BQA4toWB.cjs.map +1 -0
  287. package/dist/scope-BgdCqnYb.js +18 -0
  288. package/dist/scope-BgdCqnYb.js.map +1 -0
  289. package/dist/search/SearchLayer.vue.d.cts +17 -0
  290. package/dist/search/SearchLayer.vue.d.ts +17 -0
  291. package/dist/search/composables.d.cts +31 -0
  292. package/dist/search/composables.d.ts +31 -0
  293. package/dist/search.cjs +17 -0
  294. package/dist/search.cjs.map +1 -0
  295. package/dist/search.d.cts +10 -0
  296. package/dist/search.d.ts +10 -0
  297. package/dist/search.js +11 -0
  298. package/dist/search.js.map +1 -0
  299. package/dist/selection/SelectionClipboard.vue.d.cts +24 -0
  300. package/dist/selection/SelectionClipboard.vue.d.ts +24 -0
  301. package/dist/selection/SelectionHandles.vue.d.cts +8 -0
  302. package/dist/selection/SelectionHandles.vue.d.ts +8 -0
  303. package/dist/selection/SelectionLayer.vue.d.cts +3 -0
  304. package/dist/selection/SelectionLayer.vue.d.ts +3 -0
  305. package/dist/selection/SelectionMenu.vue.d.cts +23 -0
  306. package/dist/selection/SelectionMenu.vue.d.ts +23 -0
  307. package/dist/selection/composables.d.cts +24 -0
  308. package/dist/selection/composables.d.ts +24 -0
  309. package/dist/selection.cjs +24 -0
  310. package/dist/selection.cjs.map +1 -0
  311. package/dist/selection.d.cts +16 -0
  312. package/dist/selection.d.ts +16 -0
  313. package/dist/selection.js +15 -0
  314. package/dist/selection.js.map +1 -0
  315. package/dist/shell.cjs +72 -0
  316. package/dist/shell.cjs.map +1 -0
  317. package/dist/shell.d.cts +56 -0
  318. package/dist/shell.d.ts +56 -0
  319. package/dist/shell.js +67 -0
  320. package/dist/shell.js.map +1 -0
  321. package/dist/signature/composables.d.cts +39 -0
  322. package/dist/signature/composables.d.ts +39 -0
  323. package/dist/signature.cjs +16 -0
  324. package/dist/signature.cjs.map +1 -0
  325. package/dist/signature.d.cts +15 -0
  326. package/dist/signature.d.ts +15 -0
  327. package/dist/signature.js +10 -0
  328. package/dist/signature.js.map +1 -0
  329. package/dist/stage/PageSurface.vue.d.cts +29 -0
  330. package/dist/stage/PageSurface.vue.d.ts +29 -0
  331. package/dist/stage/Scrollbar.vue.d.cts +32 -0
  332. package/dist/stage/Scrollbar.vue.d.ts +32 -0
  333. package/dist/stage/Stage.vue.d.cts +44 -0
  334. package/dist/stage/Stage.vue.d.ts +44 -0
  335. package/dist/stage/StageScope.vue.d.cts +17 -0
  336. package/dist/stage/StageScope.vue.d.ts +17 -0
  337. package/dist/stage/composables.d.cts +41 -0
  338. package/dist/stage/composables.d.ts +41 -0
  339. package/dist/stage/scope.d.cts +12 -0
  340. package/dist/stage/scope.d.ts +12 -0
  341. package/dist/stage.cjs +21 -0
  342. package/dist/stage.cjs.map +1 -0
  343. package/dist/stage.d.cts +17 -0
  344. package/dist/stage.d.ts +17 -0
  345. package/dist/stage.js +15 -0
  346. package/dist/stage.js.map +1 -0
  347. package/dist/stamp.cjs +68 -0
  348. package/dist/stamp.cjs.map +1 -0
  349. package/dist/stamp.d.cts +61 -0
  350. package/dist/stamp.d.ts +61 -0
  351. package/dist/stamp.js +61 -0
  352. package/dist/stamp.js.map +1 -0
  353. package/dist/state-DZg8q3v6.js +52 -0
  354. package/dist/state-DZg8q3v6.js.map +1 -0
  355. package/dist/state-M22NDJQo.cjs +51 -0
  356. package/dist/state-M22NDJQo.cjs.map +1 -0
  357. package/dist/state.d.cts +32 -0
  358. package/dist/state.d.ts +32 -0
  359. package/dist/strip-BSDB39Xh.cjs +743 -0
  360. package/dist/strip-BSDB39Xh.cjs.map +1 -0
  361. package/dist/strip-C3wLonKB.js +744 -0
  362. package/dist/strip-C3wLonKB.js.map +1 -0
  363. package/dist/surface-box-B9oa4YoG.js +12 -0
  364. package/dist/surface-box-B9oa4YoG.js.map +1 -0
  365. package/dist/surface-box-C7EvUOXp.cjs +11 -0
  366. package/dist/surface-box-C7EvUOXp.cjs.map +1 -0
  367. package/dist/theme.d.cts +13 -0
  368. package/dist/theme.d.ts +13 -0
  369. package/dist/toolbar/DefaultCollapsed.vue.d.cts +9 -0
  370. package/dist/toolbar/DefaultCollapsed.vue.d.ts +9 -0
  371. package/dist/toolbar/DefaultCommand.vue.d.cts +8 -0
  372. package/dist/toolbar/DefaultCommand.vue.d.ts +8 -0
  373. package/dist/toolbar/DefaultGroupTrigger.vue.d.cts +9 -0
  374. package/dist/toolbar/DefaultGroupTrigger.vue.d.ts +9 -0
  375. package/dist/toolbar/DefaultOverflowMenu.vue.d.cts +9 -0
  376. package/dist/toolbar/DefaultOverflowMenu.vue.d.ts +9 -0
  377. package/dist/toolbar/DefaultOverflowTrigger.vue.d.cts +10 -0
  378. package/dist/toolbar/DefaultOverflowTrigger.vue.d.ts +10 -0
  379. package/dist/toolbar/Measured.vue.d.cts +21 -0
  380. package/dist/toolbar/Measured.vue.d.ts +21 -0
  381. package/dist/toolbar/NativeSlotSocket.vue.d.cts +22 -0
  382. package/dist/toolbar/NativeSlotSocket.vue.d.ts +22 -0
  383. package/dist/toolbar/Toolbar.vue.d.cts +82 -0
  384. package/dist/toolbar/Toolbar.vue.d.ts +82 -0
  385. package/dist/toolbar/ToolbarPart.vue.d.cts +42 -0
  386. package/dist/toolbar/ToolbarPart.vue.d.ts +42 -0
  387. package/dist/toolbar/paint.d.cts +3 -0
  388. package/dist/toolbar/paint.d.ts +3 -0
  389. package/dist/toolbar/strip.d.cts +14 -0
  390. package/dist/toolbar/strip.d.ts +14 -0
  391. package/dist/toolbar/views.d.cts +15 -0
  392. package/dist/toolbar/views.d.ts +15 -0
  393. package/dist/toolbar.cjs +27 -0
  394. package/dist/toolbar.cjs.map +1 -0
  395. package/dist/toolbar.d.cts +14 -0
  396. package/dist/toolbar.d.ts +14 -0
  397. package/dist/toolbar.js +12 -0
  398. package/dist/toolbar.js.map +1 -0
  399. package/dist/view-manager.cjs +22 -0
  400. package/dist/view-manager.cjs.map +1 -0
  401. package/dist/view-manager.d.cts +24 -0
  402. package/dist/view-manager.d.ts +24 -0
  403. package/dist/view-manager.js +17 -0
  404. package/dist/view-manager.js.map +1 -0
  405. package/package.json +169 -3
package/LICENSE ADDED
@@ -0,0 +1,192 @@
1
+ Copyright 2026 CloudPDF LTD
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use files in this distribution except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ https://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ -----------------------------------------------------------------------
16
+
17
+ Apache License
18
+ Version 2.0, January 2004
19
+ http://www.apache.org/licenses/
20
+
21
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
22
+
23
+ 1. Definitions.
24
+
25
+ "License" shall mean the terms and conditions for use, reproduction,
26
+ and distribution as defined by Sections 1 through 9 of this document.
27
+
28
+ "Licensor" shall mean the copyright owner or entity authorized by
29
+ the copyright owner that is granting the License.
30
+
31
+ "Legal Entity" shall mean the union of the acting entity and all
32
+ other entities that control, are controlled by, or are under common
33
+ control with that entity. For the purposes of this definition,
34
+ "control" means (i) the power, direct or indirect, to cause the
35
+ direction or management of such entity, whether by contract or
36
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
37
+ outstanding shares, or (iii) beneficial ownership of such entity.
38
+
39
+ "You" (or "Your") shall mean an individual or Legal Entity
40
+ exercising permissions granted by this License.
41
+
42
+ "Source" form shall mean the preferred form for making modifications,
43
+ including but not limited to software source code, documentation
44
+ source, and configuration files.
45
+
46
+ "Object" form shall mean any form resulting from mechanical
47
+ transformation or translation of a Source form, including but
48
+ not limited to compiled object code, generated documentation,
49
+ and conversions to other media types.
50
+
51
+ "Work" shall mean the work of authorship, whether in Source or
52
+ Object form, made available under the License, as indicated by a
53
+ copyright notice that is included in or attached to the work
54
+ (an example is provided in the Appendix below).
55
+
56
+ "Derivative Works" shall mean any work, whether in Source or Object
57
+ form, that is based on (or derived from) the Work and for which the
58
+ editorial revisions, annotations, elaborations, or other modifications
59
+ represent, as a whole, an original work of authorship. For the purposes
60
+ of this License, Derivative Works shall not include works that remain
61
+ separable from, or merely link (or bind by name) to the interfaces of,
62
+ the Work and Derivative Works thereof.
63
+
64
+ "Contribution" shall mean any work of authorship, including
65
+ the original version of the Work and any modifications or additions
66
+ to that Work or Derivative Works thereof, that is intentionally
67
+ submitted to Licensor for inclusion in the Work by the copyright owner
68
+ or by an individual or Legal Entity authorized to submit on behalf of
69
+ the copyright owner. For the purposes of this definition, "submitted"
70
+ means any form of electronic, verbal, or written communication sent
71
+ to the Licensor or its representatives, including but not limited to
72
+ communication on electronic mailing lists, source code control systems,
73
+ and issue tracking systems that are managed by, or on behalf of, the
74
+ Licensor for the purpose of discussing and improving the Work, but
75
+ excluding communication that is conspicuously marked or otherwise
76
+ designated in writing by the copyright owner as "Not a Contribution."
77
+
78
+ "Contributor" shall mean Licensor and any individual or Legal Entity
79
+ on behalf of whom a Contribution has been received by Licensor and
80
+ subsequently incorporated within the Work.
81
+
82
+ 2. Grant of Copyright License. Subject to the terms and conditions of
83
+ this License, each Contributor hereby grants to You a perpetual,
84
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
85
+ copyright license to reproduce, prepare Derivative Works of,
86
+ publicly display, publicly perform, sublicense, and distribute the
87
+ Work and such Derivative Works in Source or Object form.
88
+
89
+ 3. Grant of Patent License. Subject to the terms and conditions of
90
+ this License, each Contributor hereby grants to You a perpetual,
91
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
92
+ (except as stated in this section) patent license to make, have made,
93
+ use, offer to sell, sell, import, and otherwise transfer the Work,
94
+ where such license applies only to those patent claims licensable
95
+ by such Contributor that are necessarily infringed by their
96
+ Contribution(s) alone or by combination of their Contribution(s)
97
+ with the Work to which such Contribution(s) was submitted. If You
98
+ institute patent litigation against any entity (including a
99
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
100
+ or a Contribution incorporated within the Work constitutes direct
101
+ or contributory patent infringement, then any patent licenses
102
+ granted to You under this License for that Work shall terminate
103
+ as of the date such litigation is filed.
104
+
105
+ 4. Redistribution. You may reproduce and distribute copies of the
106
+ Work or Derivative Works thereof in any medium, with or without
107
+ modifications, and in Source or Object form, provided that You
108
+ meet the following conditions:
109
+
110
+ (a) You must give any other recipients of the Work or
111
+ Derivative Works a copy of this License; and
112
+
113
+ (b) You must cause any modified files to carry prominent notices
114
+ stating that You changed the files; and
115
+
116
+ (c) You must retain, in the Source form of any Derivative Works
117
+ that You distribute, all copyright, patent, trademark, and
118
+ attribution notices from the Source form of the Work,
119
+ excluding those notices that do not pertain to any part of
120
+ the Derivative Works; and
121
+
122
+ (d) If the Work includes a "NOTICE" text file as part of its
123
+ distribution, then any Derivative Works that You distribute must
124
+ include a readable copy of the attribution notices contained
125
+ within such NOTICE file, excluding those notices that do not
126
+ pertain to any part of the Derivative Works, in at least one
127
+ of the following places: within a NOTICE text file distributed
128
+ as part of the Derivative Works; within the Source form or
129
+ documentation, if provided along with the Derivative Works; or,
130
+ within a display generated by the Derivative Works, if and
131
+ wherever such third-party notices normally appear. The contents
132
+ of the NOTICE file are for informational purposes only and
133
+ do not modify the License. You may add Your own attribution
134
+ notices within Derivative Works that You distribute, alongside
135
+ or as an addendum to the NOTICE text from the Work, provided
136
+ that such additional attribution notices cannot be construed
137
+ as modifying the License.
138
+
139
+ You may add Your own copyright statement to Your modifications and
140
+ may provide additional or different license terms and conditions
141
+ for use, reproduction, or distribution of Your modifications, or
142
+ for any such Derivative Works as a whole, provided Your use,
143
+ reproduction, and distribution of the Work otherwise complies with
144
+ the conditions stated in this License.
145
+
146
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
147
+ any Contribution intentionally submitted for inclusion in the Work
148
+ by You to the Licensor shall be under the terms and conditions of
149
+ this License, without any additional terms or conditions.
150
+ Notwithstanding the above, nothing herein shall supersede or modify
151
+ the terms of any separate license agreement you may have executed
152
+ with Licensor regarding such Contributions.
153
+
154
+ 6. Trademarks. This License does not grant permission to use the trade
155
+ names, trademarks, service marks, or product names of the Licensor,
156
+ except as required for reasonable and customary use in describing the
157
+ origin of the Work and reproducing the content of the NOTICE file.
158
+
159
+ 7. Disclaimer of Warranty. Unless required by applicable law or
160
+ agreed to in writing, Licensor provides the Work (and each
161
+ Contributor provides its Contributions) on an "AS IS" BASIS,
162
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
163
+ implied, including, without limitation, any warranties or conditions
164
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
165
+ PARTICULAR PURPOSE. You are solely responsible for determining the
166
+ appropriateness of using or redistributing the Work and assume any
167
+ risks associated with Your exercise of permissions under this License.
168
+
169
+ 8. Limitation of Liability. In no event and under no legal theory,
170
+ whether in tort (including negligence), contract, or otherwise,
171
+ unless required by applicable law (such as deliberate and grossly
172
+ negligent acts) or agreed to in writing, shall any Contributor be
173
+ liable to You for damages, including any direct, indirect, special,
174
+ incidental, or consequential damages of any character arising as a
175
+ result of this License or out of the use or inability to use the
176
+ Work (including but not limited to damages for loss of goodwill,
177
+ work stoppage, computer failure or malfunction, or any and all
178
+ other commercial damages or losses), even if such Contributor
179
+ has been advised of the possibility of such damages.
180
+
181
+ 9. Accepting Warranty or Additional Liability. While redistributing
182
+ the Work or Derivative Works thereof, You may choose to offer,
183
+ and charge a fee for, acceptance of support, warranty, indemnity,
184
+ or other liability obligations and/or rights consistent with this
185
+ License. However, in accepting such obligations, You may act only
186
+ on Your own behalf and on Your sole responsibility, not on behalf
187
+ of any other Contributor, and only if You agree to indemnify,
188
+ defend, and hold each Contributor harmless for any liability
189
+ incurred by, or claims asserted against, such Contributor by reason
190
+ of your accepting any such warranty or additional liability.
191
+
192
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -1,3 +1,259 @@
1
- # Temporary Holding Version
1
+ # @embedpdf/vue
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Vue 3 adapter for EmbedPDF: components for your templates and composables for
4
+ `<script setup>`. One import path per feature (`@embedpdf/vue/stage`, `@embedpdf/vue/render`), so
5
+ a feature you don't use never reaches your bundle.
6
+
7
+ ```vue
8
+ <script setup lang="ts">
9
+ import { DocumentGate, Viewer } from '@embedpdf/vue/runtime';
10
+ import { Stage, stagePlugin } from '@embedpdf/vue/stage';
11
+ import { RenderLayer, renderPlugin } from '@embedpdf/vue/render';
12
+ import { localEngine } from '@embedpdf/engine';
13
+
14
+ const engine = localEngine();
15
+ const plugins = [stagePlugin(), renderPlugin()];
16
+ </script>
17
+
18
+ <template>
19
+ <Viewer :engine="engine" :plugins="plugins" :initial-documents="[{ source: { kind: 'url', url: '/file.pdf' } }]">
20
+ <DocumentGate>
21
+ <template #fallback><p>Opening…</p></template>
22
+ <Stage style="height: 600px">
23
+ <template #page><RenderLayer /></template>
24
+ </Stage>
25
+ </DocumentGate>
26
+ </Viewer>
27
+ </template>
28
+ ```
29
+
30
+ The documentation is at [embedpdf.com/docs/headless/vue](https://www.embedpdf.com/docs/headless/vue).
31
+
32
+ ## How the package is written
33
+
34
+ **Components are single-file components (`.vue`), composables are plain TypeScript.** A component
35
+ here is mostly a template with slots and `v-model`, which is what a Vue developer reads and writes
36
+ every day; `defineProps`, `defineEmits`, `defineSlots` and `defineModel` give typed props, events
37
+ and scoped slots to the app's templates through `vue-tsc`. Render functions in `defineComponent`
38
+ would hide that template behind `h()` calls. The cost is a build step that understands `.vue`
39
+ (Vite with `@vitejs/plugin-vue`, and `vue-tsc` for the declarations), which every Vue app has.
40
+
41
+ Each feature is an entry file and a folder: `src/stage.ts` is `@embedpdf/vue/stage`, and its
42
+ components and composables live in `src/stage/`. The entry re-exports the plugin
43
+ (`export * from '@embedpdf/plugin-stage'`), so `stagePlugin()` comes from the same import as
44
+ `<Stage>`.
45
+
46
+ | Script | What it does |
47
+ | :-------------------------------------- | :----------------------------------------------------------------------------------------------------------------------- |
48
+ | `pnpm --filter @embedpdf/vue test` | Vitest in happy-dom, with `@vue/test-utils` |
49
+ | `pnpm --filter @embedpdf/vue typecheck` | `vue-tsc` over `src` and `test`, with `strictTemplates` |
50
+ | `pnpm --filter @embedpdf/vue build` | Vite library build (ESM and CJS, one file per entry) into `dist`, `vue-tsc` declarations, then the publish check (below) |
51
+
52
+ In the workspace, `exports` points at the source, so tests, the docs' checks and the demos read
53
+ it directly. `publishConfig.exports` points the published package at `dist` (`import` and
54
+ `require`, each with its declarations next to it, as in the React package). The build reads its
55
+ entries from `exports`, and `test/package-exports.test.ts` checks the two lists agree.
56
+
57
+ Nothing in the workspace reads `dist`, so the build ends by proving it.
58
+ `tooling/build/src/fully-specify-imports.mjs` gives every relative import in `dist` its file
59
+ (`./stage/scope.js`, which Node, webpack and TypeScript's `node16` need), and writes the `.d.cts`
60
+ declarations a `require` reads. `tooling/build/src/check-framework-package.mjs` then packs the
61
+ package, runs publint and attw on the tarball, and type-checks the app in `consumer/` against it
62
+ with `vue-tsc`: the lines in `consumer/Canary.vue` marked `error expected` must fail, and nothing
63
+ else may. A failure there is what a user would get from npm.
64
+
65
+ ## How the binding works
66
+
67
+ - **`<Viewer>` owns the kernel.** It creates and starts it when it mounts (never on the server),
68
+ destroys it when it unmounts, and provides one binding: the kernel, and `track()`, which makes a
69
+ computed depend on the kernel's one change stream.
70
+ - **Every reader is a computed.** `useKernelValue(select, isEqual)` runs `select` on every kernel
71
+ change and on a change to any ref it reads, and keeps its value while `isEqual` says nothing
72
+ changed, so a template updates only when what it shows did. Everything below is built on it.
73
+ - **A plugin's API is a live object.** A component's setup runs once, so `useCapability(token)`
74
+ returns an object whose members are read from the capability the subtree resolves to now: the
75
+ document in scope, or a stand-in while there is none (`standInFor` from `@embedpdf/core`:
76
+ reading never throws, calling refuses with `not-ready`, the settings calls work). A method that
77
+ returns a promise (`form.setValue`, `redaction.markPage`) then rejects, so `.catch()` sees it;
78
+ the others throw. It never changes, so it is safe in closures and handlers.
79
+ - **The read rule, the same in every adapter.** A method named `get*`, `list*`, `is*`, `has*` or
80
+ `can*` (the capability vocabulary's reads, `docs/conventions/naming.md`) is a read: called in a
81
+ template, a `computed` or a `watchEffect`, it updates when its answer changes
82
+ (`v-if="annotation.canCreate()"`). Every other method tracks nothing, so a `watchEffect` that
83
+ calls `stage.reveal(index)` runs again only when `index` changes. Never destructure the API
84
+ object (`const { update } = useMetadata()`): keep it, and call through it.
85
+ - **State is refs.** Without a selector, a state composable returns one ref per field
86
+ (`const { zoomLevel } = useStageState()`), so destructuring keeps them reactive and a template
87
+ reads them unwrapped. With a selector, it returns one ref. A composable that returns one value
88
+ returns a ref (`usePageList()`, `usePage()`).
89
+ - **An argument that can change is a `MaybeRefOrGetter`**: `useStage(() => props.token)`,
90
+ `useToolCursor(() => ({ … }))`.
91
+ - **Events end with the component.** `useCapabilityEvent(token, select, handler)` subscribes to
92
+ the document in scope, again when that document changes, and stops on unmount.
93
+ - **The page context is the seam.** A page surface provides it (`providePage`), and a layer reads
94
+ it with `usePage()`, a ref whose value changes when the page's geometry does (a zoom, a turn),
95
+ never on a pan.
96
+ - **Scopes are provide/inject.** `<DocumentScope :id>` picks the document, `<StageScope :token>`
97
+ (and `<Stage>` for its own pages and overlay) the stage lens.
98
+ - **Anything that touches the DOM generically** (the stage's gestures, painted images, the
99
+ anchored placement math, cursors, the theme variables) comes from `@embedpdf/web`, shared with
100
+ the other adapters. So does what every page surface computes: the page context
101
+ (`makePageContext`), the surface's boxes (`pageSurfaceLayout`), the Stage's and a page view's
102
+ projectors, the page's pointer listener (`attachPagePointer`) and the scrollbar
103
+ (`scrollbarLayout`, `createScrollbarPresses`).
104
+
105
+ ## Adding a plugin binding
106
+
107
+ The steps for a new feature, `search` as the example. React's binding
108
+ (`packages/framework/react/src/search.tsx`) is the reference for behavior; the plugin's contract
109
+ is the API.
110
+
111
+ 1. **The entry.** Create `src/search.ts`, and add both lines to `package.json`:
112
+ `"./search": "./src/search.ts"` in `exports`, and the `dist` pair in `publishConfig.exports`
113
+ (copy one; `test/package-exports.test.ts` fails until both exist). Start the entry with what it
114
+ is for, then re-export the plugin:
115
+
116
+ ```ts
117
+ /** @embedpdf/vue/search: … */
118
+ export * from '@embedpdf/plugin-search';
119
+ ```
120
+
121
+ 2. **The API**, a live object:
122
+
123
+ ```ts
124
+ export function useSearch(): SearchCapability {
125
+ return useCapability(SearchToken);
126
+ }
127
+ ```
128
+
129
+ 3. **The state and the settings**, one line each, from the plugin's `defineState` declaration and
130
+ its token. They return refs per field, or one ref with a selector:
131
+
132
+ ```ts
133
+ export const useSearchState = stateComposable(searchState);
134
+ export const useSearchSettings = settingsComposable(SearchToken);
135
+ ```
136
+
137
+ 4. **The events**, cleaned up on unmount:
138
+
139
+ ```ts
140
+ export function useSearchEvent<Event>(
141
+ select: (search: SearchCapability) => EventHook<Event>,
142
+ handler: (event: Event) => void,
143
+ ): void {
144
+ useCapabilityEvent(SearchToken, select, handler);
145
+ }
146
+ ```
147
+
148
+ 5. **A one-value reader is a ref**, built on `useOptionalSelector` (null-safe: `fallback` without
149
+ a document) or `useKernelValue`. **A reader with an argument takes a `MaybeRefOrGetter`** and
150
+ reads it with `toValue()` inside the select, so it follows the argument:
151
+
152
+ ```ts
153
+ export function useSearchHits(): Readonly<Ref<readonly SearchHit[]>> {
154
+ return useOptionalSelector(SearchToken, (search) => search.getHits(), NO_HITS);
155
+ }
156
+ export function useAnnotationAnchor(annotation: MaybeRefOrGetter<AnnotationRef | null>) {
157
+ return useOptionalSelector(AnnotationToken, (api) => anchorOf(api, toValue(annotation)), null);
158
+ }
159
+ ```
160
+
161
+ 6. **A component** is an SFC in `src/search/`, exported from the entry
162
+ (`export { default as SearchLayer } from './search/SearchLayer.vue'`). React's props map as the
163
+ docs' rules say (`docs/kit/mdx/frameworks.mjs`): a value prop is a prop (`color` →
164
+ `:color`), `onHitClick` is an event (`defineEmits<{ hitClick: [hit: SearchHit] }>()`, used as
165
+ `@hit-click`; when the component must know whether anyone listens, as `<SearchLayer>` does to
166
+ let matches take the pointer only then, declare it as an optional function prop `onHitClick`
167
+ instead: `@hit-click` still works and is typed), a controlled value is a model (`defineModel('page')`, used as `v-model:page`, or
168
+ a `page` prop with an `update:page` event when the component must tell its own changes from
169
+ yours, as `<Stage>` does), and a render prop is a scoped slot (`renderLink` →
170
+ `<template #link="{ link }">`, declared with `defineSlots`). Something the app hands you to
171
+ draw (a `native` renderer) is drawn with `<component :is>`. Write the TSDoc on each prop, event
172
+ and slot: it is what the app sees in its editor. `class` and `style` fall through to your root
173
+ element; a component with several roots has none.
174
+
175
+ 7. **A layer drawn on each page** reads the page with `usePage()` and its document through the
176
+ usual composables (inside a page there is always one). Read `page.value` inside a computed or a
177
+ selector, never once at setup, so it follows the page's geometry; place things in view space
178
+ with `page.value.transform` (`pageToViewRect`, `viewScale`), and remember Vue doesn't add
179
+ `px` to numbers in `:style`. Work with the DOM in a `watch` with `flush: 'post'` and clean up
180
+ with `onCleanup`. A layer that paints a part of the page itself (the annotations, the form
181
+ fields) says so with `usePaintsPagePart` (`src/page-layers.ts`), and `<RenderLayer>` leaves that
182
+ part out of the page's picture. `RenderLayer.vue` is the example to copy.
183
+
184
+ 8. **UI that floats over a page** goes in the Stage's `#overlay` slot and positions with
185
+ `<Anchored :anchor>`; a component of yours that needs the projection reads
186
+ `useProjectorBinding()`. A page surface of your own (a standalone page view) provides its page
187
+ with `providePage(computed(() => makePageContext(…)))`, its document with
188
+ `provideDocumentScope` (`src/runtime/kernel.ts`), and its projection by wrapping what floats in
189
+ `<AnchoredScope :binding :shown>`; `src/stage/PageSurface.vue` and `src/stage/Stage.vue` show
190
+ all three.
191
+
192
+ 9. **Missing shared logic.** Anything DOM-level comes from `@embedpdf/web`. If logic every adapter
193
+ needs is missing there, write the small piece you need next to your feature and list it as a
194
+ candidate for `@embedpdf/web`, rather than editing a shared package.
195
+
196
+ 10. **A test** in `test/search.test.ts`, the way React's binding test does it: mount through
197
+ `viewerWith(plugins, () => h(Probe))` from `test/counter-plugin.ts`, where `probe(setup)`
198
+ makes a component of a setup function; drive the kernel (`kernel.documents.open(…)`,
199
+ `kernel.capability(Token)`), `await settle()`, and assert on what rendered or what a ref holds.
200
+ Test the binding (refs update only when their value changes, events stop on unmount, the
201
+ component's slots and models), not the plugin.
202
+
203
+ 11. **Check**: `pnpm --filter @embedpdf/vue test`, `typecheck` and `build`; then the docs'
204
+ `pnpm --filter @embedpdf/docs-content snippets` (your pages compile for Vue) and
205
+ `samples <area>` (your examples compile).
206
+
207
+ ## What the foundation provides
208
+
209
+ | Entry | Names |
210
+ | :-- | :-- |
211
+ | `runtime` | `Viewer` (`:engine`, `:plugins`, `:initial-documents`, `:identity`, `:scope`, `:accent`, `:page`, `@ready`, `#fallback`, `#error`), `DocumentGate` (`#fallback`, `#locked`, `#error`), `DocumentScope` (`:id`); `useDocuments`, `useDocument`, `useDocumentsState`, `useDocumentsEvent`, `usePageList`, `useViewerSettings`; `useKernel`, `useKernelValue`, `useCapability`, `useCapabilityRef`, `useOptionalCapability`, `useSelector`, `useOptionalSelector`, `useCapabilityEvent`, `useDocumentScope`, `useDocumentId`, `useActiveDocumentId`; `usePage`, `providePage`, `makePageContext`, `PageContextValue`; `fieldRefs`, `FieldRefs`; `saveFile`, `mountWebFont`, `epdfTheme`; everything from `@embedpdf/core` |
212
+ | `stage` | `Stage` (`#page`, `#page-chrome`, `#overlay`, `v-model:page`, `v-model:zoom`, `v-model:tool`, `:token`), `StageScope`, `Scrollbar`; `useStage`, `useStageState`, `useStageSettings`, `useStageEvent`, `useScrollMetrics`, `useStageToken`; the stage plugin |
213
+ | `render` | `RenderLayer` (`:annotations`, `:tiles`); `useRender`, `useRenderSettings`, `useRenderEvent`; the render plugin |
214
+ | `interaction` | `PagePointerSource`; `useInteraction`, `useInteractionState`, `useInteractionSettings`, `useInteractionEvent`, `useToolCursor`, `createClickCounter`; `svgCursor`, `vibrationFeedback`, `wkFeedback`; the interaction plugin |
215
+ | `anchored` | `Anchored` (`:anchor`, `placement`, `:gap`, `pinned`), `AnchoredScope`; `useProjectorBinding`, `useOptionalProjectorBinding`, `useShownPages`, `provideProjector`, `provideShownPages` |
216
+ | `.` (`src/state.ts`) | `stateComposable`, `settingsComposable`, and every entry above |
217
+
218
+ Added since by the feature agents (see each entry's source): `view-manager`, `page-edit`,
219
+ `metadata`, `actions` (`useActionsUiAdapter(handlers)`, a `MaybeRefOrGetter`); `page-view`
220
+ (`PageView` with `#fallback` and `#page-chrome`), `selection` (`SelectionLayer`,
221
+ `SelectionMenu` and `SelectionHandles` in the Stage's `#overlay`, `SelectionClipboard`), `search`
222
+ (`SearchLayer` with `@hit-click`, `useSearchHits(page?)`), `link` (`LinkLayer` with
223
+ `#link="{ link, native }"`). Never destructure a plugin's API handle (`const { update } =
224
+ useMetadata()`): setup runs once, so keep the handle and call through it.
225
+
226
+ Your app's own UI: `commands` (`useCommand(id)` is a ref, `useCommandShortcuts({ target })`
227
+ takes a template ref), `toolbar` (`Toolbar` with `#command`, `#custom="{ name, variant }"`,
228
+ `#collapsed`, `#group-trigger`, `#separator`, `#overflow-trigger`, `#overflow-menu`; a slot that
229
+ draws nothing for a part falls back to the default: `#custom` draws every custom item, and one it
230
+ draws nothing for shows its command's button; without `#custom`, each custom item is a native
231
+ `<slot>` socket), `shell` (`useSurface(id)` gives `isOpen` and
232
+ `props` as refs, so destructure it), `i18n` (`useT()` reads the language reactively). A slot
233
+ outlet can't pass a prop named `name` with `:name` (that names the outlet): bind an object,
234
+ `v-bind="{ name, variant }"`.
235
+
236
+ Annotations: `annotation` (`AnnotationLayer` with `:renderers` and the `#handle` /
237
+ `#rotation-handle` slots; a renderer's component gets `AnnotationRendererProps` and draws
238
+ `native` with `<component :is="native" />`; `AnnotationMenu`, `AnnotationDraftMenu`
239
+ (`v-slot="{ draft }"`) and `AnnotationRotationBadge` (`v-slot="{ rotation }"`) go in the Stage's
240
+ `#overlay`). `useAnnotationList(filter?)`, `useAnnotationDefaults(toolId)`,
241
+ `useAnnotationProperties(toolId?)`, `useAnnotationAnchor(ref)`, `useCommentThreads()` and
242
+ `useCommentThread(ref)` are refs and take getters; `useRichTextEditor(annotation)` gives `ref` (a
243
+ function ref, for `:ref`), `style` and `editing` (refs); `useFilePickerProvider(provider?)` takes
244
+ a provider or a ref, never a getter, because the provider is itself a function. Another entry
245
+ that needs `useAnnotationState` or `useAnnotationSettings` without the layer imports
246
+ `src/annotation/state.ts`.
247
+
248
+ Marks: `stamp` (`useStampLibraries(filter?)`, `useStampAssets(filter?)` and
249
+ `useStampAssetPreviewUrl(assetId)` are refs and take getters; the preview's object URL is revoked
250
+ when it's no longer shown), `measurement` (`usePageScale(page)`, `useMeasurementReadout(ref)`),
251
+ `redaction` (`usePendingRedactions(filter?)`). They have no components: an armed stamp, a
252
+ measurement and a redaction mark are drawn by the annotation layer.
253
+
254
+ Forms: `form` (`FormLayer` in the Stage's `#page`, above `RenderLayer` and `AnnotationLayer`;
255
+ `useFormValue(ref)` is a ref and takes a getter), `signature` (`useSignerRows()` is a ref; the
256
+ signers come with the plugin). Each control of `FormLayer` builds its box with `useWidgetBox`
257
+ (`src/form/widget-box.ts`): a composable, so the toggle's box can be its control; the press is
258
+ kept from the Stage with `isolatePointerDown`, and the widget's PDF events come from
259
+ `bindWidgetEvents` on the same box.
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const web = require("@embedpdf/web");
4
+ const projector = require("./projector-Cf7879sx.cjs");
5
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
6
+ __name: "PlacedAnchored",
7
+ props: {
8
+ target: {},
9
+ placement: {},
10
+ gap: {},
11
+ pinned: { type: Boolean }
12
+ },
13
+ setup(__props) {
14
+ const props = __props;
15
+ const binding = projector.useProjectorBinding();
16
+ const element = vue.ref(null);
17
+ const fit = vue.shallowRef(null);
18
+ const browserMoves = vue.ref(0);
19
+ const space = vue.computed(() => binding.value.projector.space);
20
+ vue.watch(
21
+ () => binding.value.subscribe,
22
+ (subscribe, _previous, onCleanup) => {
23
+ if (subscribe) onCleanup(subscribe(() => browserMoves.value += 1));
24
+ },
25
+ { immediate: true }
26
+ );
27
+ vue.onMounted(() => {
28
+ if (space.value === "client") browserMoves.value += 1;
29
+ });
30
+ vue.watch(
31
+ [() => binding.value.projector, () => props.target],
32
+ () => {
33
+ if (space.value === "client") browserMoves.value += 1;
34
+ },
35
+ { flush: "post" }
36
+ );
37
+ vue.watch(
38
+ [element, space],
39
+ ([content, viewSpace], _previous, onCleanup) => {
40
+ if (!content) return;
41
+ onCleanup(
42
+ web.observeAnchoredFit(content, viewSpace, (next) => {
43
+ if (!web.sameAnchoredFit(fit.value, next)) fit.value = next;
44
+ })
45
+ );
46
+ },
47
+ { immediate: true, flush: "post" }
48
+ );
49
+ const position = vue.computed(() => {
50
+ void browserMoves.value;
51
+ return web.projectAnchoredTarget(
52
+ binding.value.projector,
53
+ props.target,
54
+ { placement: props.placement, gap: props.gap, pinned: props.pinned },
55
+ fit.value
56
+ );
57
+ });
58
+ const style = vue.computed(() => {
59
+ const placed = position.value;
60
+ if (!placed) return null;
61
+ return {
62
+ position: space.value === "client" ? "fixed" : "absolute",
63
+ left: `${placed.left}px`,
64
+ top: `${placed.top}px`,
65
+ // Its own width, wherever it sits: the size the placement measured.
66
+ width: "max-content",
67
+ transform: placed.transform,
68
+ pointerEvents: "auto"
69
+ };
70
+ });
71
+ return (_ctx, _cache) => {
72
+ return vue.openBlock(), vue.createBlock(vue.Teleport, {
73
+ to: "body",
74
+ disabled: space.value !== "client"
75
+ }, [
76
+ style.value ? (vue.openBlock(), vue.createElementBlock("div", {
77
+ key: 0,
78
+ ref_key: "element",
79
+ ref: element,
80
+ style: vue.normalizeStyle(style.value),
81
+ onPointerdown: _cache[0] || (_cache[0] = vue.withModifiers(() => {
82
+ }, ["stop"]))
83
+ }, [
84
+ vue.renderSlot(_ctx.$slots, "default")
85
+ ], 36)) : vue.createCommentVNode("", true)
86
+ ], 8, ["disabled"]);
87
+ };
88
+ }
89
+ });
90
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
91
+ __name: "Anchored",
92
+ props: {
93
+ anchor: {},
94
+ placement: { default: "top" },
95
+ gap: { default: 8 },
96
+ pinned: { type: Boolean, default: false }
97
+ },
98
+ setup(__props) {
99
+ const props = __props;
100
+ const shown = projector.useShownPages();
101
+ const target = vue.computed(() => {
102
+ const anchor = props.anchor;
103
+ if (!(anchor == null ? void 0 : anchor.bounds)) return null;
104
+ if (shown && !shown.value.has(anchor.page.objectNumber)) return null;
105
+ return { ...anchor, bounds: anchor.bounds };
106
+ });
107
+ return (_ctx, _cache) => {
108
+ return target.value ? (vue.openBlock(), vue.createBlock(_sfc_main$1, {
109
+ key: 0,
110
+ target: target.value,
111
+ placement: __props.placement,
112
+ gap: __props.gap,
113
+ pinned: __props.pinned
114
+ }, {
115
+ default: vue.withCtx(() => [
116
+ vue.renderSlot(_ctx.$slots, "default")
117
+ ]),
118
+ _: 3
119
+ }, 8, ["target", "placement", "gap", "pinned"])) : vue.createCommentVNode("", true);
120
+ };
121
+ }
122
+ });
123
+ exports._sfc_main = _sfc_main;
124
+ //# sourceMappingURL=Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs","sources":["../src/anchored/PlacedAnchored.vue","../src/anchored/Anchored.vue"],"sourcesContent":["<!--\n Anchored UI on a page that is shown: it follows the camera. The projection\n runs during render from the shared pure helper; the content's size and the\n view's are measured after mount and whenever either resizes (a camera move\n changes neither). In client space (a surface without a camera) it is\n teleported to the body and placed `fixed`, out of reach of any ancestor's\n overflow clipping.\n-->\n<script setup lang=\"ts\">\nimport { computed, onMounted, ref, shallowRef, watch } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport { observeAnchoredFit, projectAnchoredTarget, sameAnchoredFit } from '@embedpdf/web';\nimport type { AnchoredFit, AnchoredPlacement, AnchorTarget } from '@embedpdf/web';\nimport { useProjectorBinding } from './projector';\n\nconst props = defineProps<{\n target: AnchorTarget;\n placement: AnchoredPlacement;\n gap: number;\n pinned: boolean;\n}>();\n\ndefineSlots<{ default?(): unknown }>();\n\nconst binding = useProjectorBinding();\nconst element = ref<HTMLDivElement | null>(null);\nconst fit = shallowRef<AnchoredFit | null>(null);\n// Bumped by browser-driven invalidation, which no state change announces.\nconst browserMoves = ref(0);\n\nconst space = computed(() => binding.value.projector.space);\n\nwatch(\n () => binding.value.subscribe,\n (subscribe, _previous, onCleanup) => {\n if (subscribe) onCleanup(subscribe(() => (browserMoves.value += 1)));\n },\n { immediate: true },\n);\n\n// A client-space surface measures the DOM, which doesn't exist during its\n// first render: one more pass after mount shows the position as soon as it\n// can be measured.\nonMounted(() => {\n if (space.value === 'client') browserMoves.value += 1;\n});\nwatch(\n [() => binding.value.projector, () => props.target],\n () => {\n if (space.value === 'client') browserMoves.value += 1;\n },\n { flush: 'post' },\n);\n\nwatch(\n [element, space],\n ([content, viewSpace], _previous, onCleanup) => {\n if (!content) return;\n onCleanup(\n observeAnchoredFit(content, viewSpace, (next) => {\n if (!sameAnchoredFit(fit.value, next)) fit.value = next;\n }),\n );\n },\n { immediate: true, flush: 'post' },\n);\n\nconst position = computed(() => {\n void browserMoves.value;\n return projectAnchoredTarget(\n binding.value.projector,\n props.target,\n { placement: props.placement, gap: props.gap, pinned: props.pinned },\n fit.value,\n );\n});\n\nconst style = computed((): CSSProperties | null => {\n const placed = position.value;\n if (!placed) return null;\n return {\n position: space.value === 'client' ? 'fixed' : 'absolute',\n left: `${placed.left}px`,\n top: `${placed.top}px`,\n // Its own width, wherever it sits: the size the placement measured.\n width: 'max-content',\n transform: placed.transform,\n pointerEvents: 'auto',\n };\n});\n</script>\n\n<template>\n <Teleport to=\"body\" :disabled=\"space !== 'client'\">\n <div v-if=\"style\" ref=\"element\" :style=\"style\" @pointerdown.stop>\n <slot />\n </div>\n </Teleport>\n</template>\n","<!--\n <Anchored>: positions its content around a page-space box, on whichever page\n surface is in scope (a <Stage>'s #overlay slot). Once its size is measured it\n flips to the other side when the chosen one has no room, and stays inside the\n view, unless `pinned`. A click inside it never reaches the surface (which\n would read it as a click outside). On a page that isn't shown it renders\n nothing and reads only the pages on screen, so hundreds of badges cost only\n the ones in view while people scroll and zoom.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { AnchoredPlacement, AnchoredRect, AnchorTarget } from '@embedpdf/web';\nimport PlacedAnchored from './PlacedAnchored.vue';\nimport { useShownPages } from './projector';\n\nconst props = withDefaults(\n defineProps<{\n /**\n * The box on a page to sit next to, in page coordinates: `{ page, bounds }`,\n * with `avoid` points to keep clear of. `null`, or a target without\n * `bounds` (a search match with no geometry), hides it.\n */\n anchor: (Omit<AnchorTarget, 'bounds'> & { bounds?: AnchoredRect }) | null;\n /** Where to sit: a side of the box, centred, or lined up with the side's start or end (`'top-end'`). */\n placement?: AnchoredPlacement;\n /**\n * Gap in screen px between the box and the content, and between the content\n * and the view's edge. Negative overlaps the box.\n */\n gap?: number;\n /**\n * Stay where `placement` puts it: never flip to the other side, never move\n * to stay in view, and scroll away with the box. For badges and status;\n * menus leave it off.\n */\n pinned?: boolean;\n }>(),\n { placement: 'top', gap: 8, pinned: false },\n);\n\ndefineSlots<{ default?(): unknown }>();\n\nconst shown = useShownPages();\n\n/** The anchor with its box, while it has one on a shown page. */\nconst target = computed((): AnchorTarget | null => {\n const anchor = props.anchor;\n if (!anchor?.bounds) return null;\n if (shown && !shown.value.has(anchor.page.objectNumber)) return null;\n return { ...anchor, bounds: anchor.bounds };\n});\n</script>\n\n<template>\n <PlacedAnchored v-if=\"target\" :target=\"target\" :placement=\"placement\" :gap=\"gap\" :pinned=\"pinned\">\n <slot />\n </PlacedAnchored>\n</template>\n"],"names":["useProjectorBinding","ref","shallowRef","computed","watch","onMounted","observeAnchoredFit","sameAnchoredFit","projectAnchoredTarget","_createBlock","_Teleport","_createElementBlock","_renderSlot","useShownPages","PlacedAnchored"],"mappings":";;;;;;;;;;;;;AAeA,UAAM,QAAQ;AASd,UAAM,UAAUA,UAAAA,oBAAA;AAChB,UAAM,UAAUC,IAAAA,IAA2B,IAAI;AAC/C,UAAM,MAAMC,IAAAA,WAA+B,IAAI;AAE/C,UAAM,eAAeD,IAAAA,IAAI,CAAC;AAE1B,UAAM,QAAQE,IAAAA,SAAS,MAAM,QAAQ,MAAM,UAAU,KAAK;AAE1DC,QAAAA;AAAAA,MACE,MAAM,QAAQ,MAAM;AAAA,MACpB,CAAC,WAAW,WAAW,cAAc;AACnC,YAAI,UAAW,WAAU,UAAU,MAAO,aAAa,SAAS,CAAE,CAAC;AAAA,MACrE;AAAA,MACA,EAAE,WAAW,KAAA;AAAA,IAAK;AAMpBC,QAAAA,UAAU,MAAM;AACd,UAAI,MAAM,UAAU,SAAU,cAAa,SAAS;AAAA,IACtD,CAAC;AACDD,QAAAA;AAAAA,MACE,CAAC,MAAM,QAAQ,MAAM,WAAW,MAAM,MAAM,MAAM;AAAA,MAClD,MAAM;AACJ,YAAI,MAAM,UAAU,SAAU,cAAa,SAAS;AAAA,MACtD;AAAA,MACA,EAAE,OAAO,OAAA;AAAA,IAAO;AAGlBA,QAAAA;AAAAA,MACE,CAAC,SAAS,KAAK;AAAA,MACf,CAAC,CAAC,SAAS,SAAS,GAAG,WAAW,cAAc;AAC9C,YAAI,CAAC,QAAS;AACd;AAAA,UACEE,IAAAA,mBAAmB,SAAS,WAAW,CAAC,SAAS;AAC/C,gBAAI,CAACC,IAAAA,gBAAgB,IAAI,OAAO,IAAI,OAAO,QAAQ;AAAA,UACrD,CAAC;AAAA,QAAA;AAAA,MAEL;AAAA,MACA,EAAE,WAAW,MAAM,OAAO,OAAA;AAAA,IAAO;AAGnC,UAAM,WAAWJ,IAAAA,SAAS,MAAM;AAC9B,WAAK,aAAa;AAClB,aAAOK,IAAAA;AAAAA,QACL,QAAQ,MAAM;AAAA,QACd,MAAM;AAAA,QACN,EAAE,WAAW,MAAM,WAAW,KAAK,MAAM,KAAK,QAAQ,MAAM,OAAA;AAAA,QAC5D,IAAI;AAAA,MAAA;AAAA,IAER,CAAC;AAED,UAAM,QAAQL,IAAAA,SAAS,MAA4B;AACjD,YAAM,SAAS,SAAS;AACxB,UAAI,CAAC,OAAQ,QAAO;AACpB,aAAO;AAAA,QACL,UAAU,MAAM,UAAU,WAAW,UAAU;AAAA,QAC/C,MAAM,GAAG,OAAO,IAAI;AAAA,QACpB,KAAK,GAAG,OAAO,GAAG;AAAA;AAAA,QAElB,OAAO;AAAA,QACP,WAAW,OAAO;AAAA,QAClB,eAAe;AAAA,MAAA;AAAA,IAEnB,CAAC;;8BAICM,IAAAA,YAIWC,cAAA;AAAA,QAJD,IAAG;AAAA,QAAQ,UAAU,MAAA,UAAK;AAAA,MAAA;QACvB,MAAA,0BAAXC,IAAAA,mBAEM,OAAA;AAAA;mBAFgB;AAAA,UAAJ,KAAI;AAAA,UAAW,0BAAO,MAAA,KAAK;AAAA,UAAG,2DAAD,MAAA;AAAA,UAAA,GAAiB,CAAA,MAAA,CAAA;AAAA,QAAA;UAC9DC,eAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;;;;;;;;AChFd,UAAM,QAAQ;AA2Bd,UAAM,QAAQC,UAAAA,cAAA;AAGd,UAAM,SAASV,IAAAA,SAAS,MAA2B;AACjD,YAAM,SAAS,MAAM;AACrB,UAAI,EAAC,iCAAQ,QAAQ,QAAO;AAC5B,UAAI,SAAS,CAAC,MAAM,MAAM,IAAI,OAAO,KAAK,YAAY,EAAG,QAAO;AAChE,aAAO,EAAE,GAAG,QAAQ,QAAQ,OAAO,OAAA;AAAA,IACrC,CAAC;;aAIuB,OAAA,0BAAtBM,IAAAA,YAEiBK,aAAA;AAAA;QAFc,QAAQ,OAAA;AAAA,QAAS,WAAW,QAAA;AAAA,QAAY,KAAK,QAAA;AAAA,QAAM,QAAQ,QAAA;AAAA,MAAA;6BACxF,MAAQ;AAAA,UAARF,eAAQ,KAAA,QAAA,SAAA;AAAA,QAAA;;;;;;;"}