@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
@@ -0,0 +1,1004 @@
1
+ import { defineComponent, useSlots, computed, openBlock, createElementBlock, Fragment, renderList, unref, normalizeStyle, createCommentVNode, createElementVNode, renderSlot, provide, shallowRef, watch, toValue, onScopeDispose, inject, createBlock, resolveDynamicComponent, createVNode, ref, onUnmounted, withCtx, createSlots, normalizeProps, guardReactiveProps, markRaw, h, toRaw, toDisplayString } from "vue";
2
+ import { shallowEqual, annotationKey } from "@embedpdf/core";
3
+ import { AnnotationToken as AnnotationToken$1, previewBucket } from "@embedpdf/plugin-annotation/contract/host";
4
+ import { InteractionToken } from "@embedpdf/plugin-interaction/contract";
5
+ import { RenderToken } from "@embedpdf/plugin-render/contract/host";
6
+ import { annotationChromePaint, chromeInPixels, frameInPixels, createTextBoxEditorFollower, textBoxEditorScaleOf, textBoxStyleOf, lookFrameOf, textPlateInPixels, sceneViewBox, svgShapesOf, ghostOpacity, pictureOrPainting, shownAppearance, rasterInFrame, loadObjectUrl, rectInPixels, registerRendererBehaviors, createShownUrls, loadAppearanceUrls, editingTextKeyOf, annotationDrawingOf, layerTextBoxesOf, bakedAppearanceOf, sameSelectionAnchor, sameCreationDraftAnchor, paint, paintDefault, sameRotationAnchor, pickRequestedFile, sameAnnotationAnchor, enrichCommentThreads, installFilePickerProvider } from "@embedpdf/web";
7
+ import { d as devWarn } from "./dev-CtMlvxjZ.js";
8
+ import { a as usePaintsPagePart } from "./page-layers-rlh4-1qr.js";
9
+ import { i as useOptionalSelector, h as useOptionalCapability, a as useCapability, b as useCapabilityEvent, d as useDocumentId, g as useKernelValue } from "./capabilities-C7YzgPCX.js";
10
+ import { u as usePage } from "./page-D9XIuLSj.js";
11
+ import { e as useViewerSettings } from "./documents-DUu5H4yH.js";
12
+ import { scene, MITER_LIMIT, hasLiveDrawing } from "@embedpdf/core-annotation";
13
+ import { _ as _sfc_main$b } from "./SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js";
14
+ import { _ as _sfc_main$c } from "./Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js";
15
+ import { b as useProjectorBinding } from "./projector-CDZn1kh1.js";
16
+ import { AnnotationToken as AnnotationToken$2 } from "@embedpdf/plugin-annotation";
17
+ import { annotationState, AnnotationToken } from "@embedpdf/plugin-annotation/contract";
18
+ import { s as settingsComposable, a as stateComposable } from "./state-DZg8q3v6.js";
19
+ const useAnnotationState = stateComposable(annotationState);
20
+ const useAnnotationSettings = settingsComposable(AnnotationToken);
21
+ const _hoisted_1$5 = { style: { position: "absolute", inset: 0, overflow: "visible", pointerEvents: "none" } };
22
+ const _hoisted_2 = ["cx", "cy", "r"];
23
+ const _hoisted_3 = ["x", "y", "width", "height", "transform"];
24
+ const _hoisted_4 = ["x1", "y1", "x2", "y2"];
25
+ const _hoisted_5 = ["points"];
26
+ const _hoisted_6 = { key: 3 };
27
+ const _hoisted_7 = ["x1", "y1", "x2", "y2", "opacity"];
28
+ const _hoisted_8 = { key: 0 };
29
+ const _hoisted_9 = ["x1", "y1", "x2", "y2"];
30
+ const _hoisted_10 = ["cx", "cy", "r"];
31
+ const _hoisted_11 = ["x", "y", "width", "height"];
32
+ const _hoisted_12 = ["x", "y", "width", "height"];
33
+ const _hoisted_13 = {
34
+ key: 0,
35
+ style: { position: "absolute", inset: 0, pointerEvents: "none" }
36
+ };
37
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
38
+ __name: "AnnotationChrome",
39
+ props: {
40
+ page: {}
41
+ },
42
+ setup(__props) {
43
+ const props = __props;
44
+ const slots = useSlots();
45
+ const NO_NODES = Object.freeze([]);
46
+ const nodes = useOptionalSelector(
47
+ AnnotationToken$1,
48
+ (host) => {
49
+ const { transform, ref: ref2 } = props.page;
50
+ return host.listChromeNodes(ref2, transform.viewScale, transform.rotation, transform.zoom);
51
+ },
52
+ NO_NODES,
53
+ shallowEqual
54
+ );
55
+ const chrome = useAnnotationSettings((settings) => settings.chrome);
56
+ const accent = useViewerSettings((settings) => settings.accent);
57
+ const painted = computed(() => {
58
+ const paint2 = annotationChromePaint(chrome.value, accent.value);
59
+ const style = (part) => ({ ...part });
60
+ return {
61
+ outline: style(paint2.outline),
62
+ handle: style(paint2.handle),
63
+ rotationHandle: style(paint2.rotationHandle),
64
+ rotationStalk: style({ stroke: paint2.rotationHandle.stroke }),
65
+ guide: style(paint2.guide),
66
+ rotationGuide: style(paint2.rotationGuide),
67
+ marquee: style(paint2.marquee)
68
+ };
69
+ });
70
+ const pixels = computed(() => chromeInPixels(nodes.value, props.page.transform));
71
+ const hasHandles = computed(
72
+ () => pixels.value.some((node) => node.kind === "handle" || node.kind === "rotation-handle")
73
+ );
74
+ return (_ctx, _cache) => {
75
+ return openBlock(), createElementBlock(Fragment, null, [
76
+ (openBlock(), createElementBlock("svg", _hoisted_1$5, [
77
+ (openBlock(true), createElementBlock(Fragment, null, renderList(pixels.value, (node, index) => {
78
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
79
+ node.kind === "handle" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
80
+ !slots.handle ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
81
+ unref(chrome).handles.shape === "circle" ? (openBlock(), createElementBlock("circle", {
82
+ key: 0,
83
+ cx: node.at.x,
84
+ cy: node.at.y,
85
+ r: unref(chrome).handles.size / 2,
86
+ "stroke-width": "1.5",
87
+ style: normalizeStyle(painted.value.handle)
88
+ }, null, 12, _hoisted_2)) : (openBlock(), createElementBlock("rect", {
89
+ key: 1,
90
+ x: node.at.x - unref(chrome).handles.size / 2,
91
+ y: node.at.y - unref(chrome).handles.size / 2,
92
+ width: unref(chrome).handles.size,
93
+ height: unref(chrome).handles.size,
94
+ "stroke-width": "1.5",
95
+ style: normalizeStyle(painted.value.handle),
96
+ transform: node.rotation ? `rotate(${node.rotation} ${node.at.x} ${node.at.y})` : void 0
97
+ }, null, 12, _hoisted_3))
98
+ ], 64)) : createCommentVNode("", true)
99
+ ], 64)) : node.kind === "guide" ? (openBlock(), createElementBlock("line", {
100
+ key: 1,
101
+ x1: node.from.x,
102
+ y1: node.from.y,
103
+ x2: node.to.x,
104
+ y2: node.to.y,
105
+ "shape-rendering": "crispEdges",
106
+ style: normalizeStyle(painted.value.guide)
107
+ }, null, 12, _hoisted_4)) : node.kind === "turned-outline" ? (openBlock(), createElementBlock("polygon", {
108
+ key: 2,
109
+ points: node.points,
110
+ fill: "none",
111
+ style: normalizeStyle(painted.value.outline)
112
+ }, null, 12, _hoisted_5)) : node.kind === "rotation-guides" ? (openBlock(), createElementBlock("g", _hoisted_6, [
113
+ (openBlock(true), createElementBlock(Fragment, null, renderList(node.lines, (line, lineIndex) => {
114
+ return openBlock(), createElementBlock("line", {
115
+ key: lineIndex,
116
+ x1: line.from.x,
117
+ y1: line.from.y,
118
+ x2: line.to.x,
119
+ y2: line.to.y,
120
+ opacity: line.opacity,
121
+ style: normalizeStyle(painted.value.rotationGuide)
122
+ }, null, 12, _hoisted_7);
123
+ }), 128))
124
+ ])) : node.kind === "rotation-handle" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
125
+ !slots["rotation-handle"] ? (openBlock(), createElementBlock("g", _hoisted_8, [
126
+ unref(chrome).rotationHandle.stalk ? (openBlock(), createElementBlock("line", {
127
+ key: 0,
128
+ x1: node.from.x,
129
+ y1: node.from.y,
130
+ x2: node.at.x,
131
+ y2: node.at.y,
132
+ "stroke-width": "1",
133
+ style: normalizeStyle(painted.value.rotationStalk)
134
+ }, null, 12, _hoisted_9)) : createCommentVNode("", true),
135
+ createElementVNode("circle", {
136
+ cx: node.at.x,
137
+ cy: node.at.y,
138
+ r: unref(chrome).rotationHandle.size / 2,
139
+ "stroke-width": "1.5",
140
+ style: normalizeStyle(painted.value.rotationHandle)
141
+ }, null, 12, _hoisted_10)
142
+ ])) : createCommentVNode("", true)
143
+ ], 64)) : node.kind === "marquee" ? (openBlock(), createElementBlock("rect", {
144
+ key: 5,
145
+ x: node.box.left,
146
+ y: node.box.top,
147
+ width: node.box.width,
148
+ height: node.box.height,
149
+ "stroke-width": "1",
150
+ "stroke-dasharray": "4 3",
151
+ style: normalizeStyle(painted.value.marquee)
152
+ }, null, 12, _hoisted_11)) : node.kind === "outline" ? (openBlock(), createElementBlock("rect", {
153
+ key: 6,
154
+ x: node.box.left,
155
+ y: node.box.top,
156
+ width: node.box.width,
157
+ height: node.box.height,
158
+ fill: "none",
159
+ style: normalizeStyle(painted.value.outline)
160
+ }, null, 12, _hoisted_12)) : createCommentVNode("", true)
161
+ ], 64);
162
+ }), 128))
163
+ ])),
164
+ hasHandles.value && (slots.handle || slots["rotation-handle"]) ? (openBlock(), createElementBlock("div", _hoisted_13, [
165
+ (openBlock(true), createElementBlock(Fragment, null, renderList(pixels.value, (node, index) => {
166
+ return openBlock(), createElementBlock(Fragment, { key: index }, [
167
+ node.kind === "handle" && slots.handle ? renderSlot(_ctx.$slots, "handle", {
168
+ at: node.at,
169
+ size: unref(chrome).handles.size,
170
+ rotation: node.rotation,
171
+ kind: node.role,
172
+ active: node.active
173
+ }, void 0, void 0, 0) : node.kind === "rotation-handle" && slots["rotation-handle"] ? renderSlot(_ctx.$slots, "rotation-handle", {
174
+ at: node.at,
175
+ from: node.from,
176
+ size: unref(chrome).rotationHandle.size,
177
+ rotation: 0,
178
+ active: false
179
+ }, void 0, void 0, 1) : createCommentVNode("", true)
180
+ ], 64);
181
+ }), 128))
182
+ ])) : createCommentVNode("", true)
183
+ ], 64);
184
+ };
185
+ }
186
+ });
187
+ const _hoisted_1$4 = ["inert"];
188
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
189
+ __name: "AnnotationFrame",
190
+ props: {
191
+ item: {},
192
+ page: {},
193
+ interactive: { type: Boolean, default: false },
194
+ inert: { type: Boolean, default: false }
195
+ },
196
+ setup(__props) {
197
+ const props = __props;
198
+ const style = computed(() => {
199
+ const box = frameInPixels(props.item.frame, props.page.transform);
200
+ return {
201
+ position: "absolute",
202
+ left: `${box.left}px`,
203
+ top: `${box.top}px`,
204
+ width: `${box.width}px`,
205
+ height: `${box.height}px`,
206
+ transform: box.transform,
207
+ transformOrigin: "center",
208
+ // On the frame: a turned frame groups what is inside it, so blending on
209
+ // an inner element would stop blending with the page.
210
+ mixBlendMode: props.item.blend,
211
+ pointerEvents: props.interactive ? "auto" : "none"
212
+ };
213
+ });
214
+ return (_ctx, _cache) => {
215
+ return openBlock(), createElementBlock("div", {
216
+ inert: __props.inert || void 0,
217
+ style: normalizeStyle(style.value)
218
+ }, [
219
+ renderSlot(_ctx.$slots, "default")
220
+ ], 12, _hoisted_1$4);
221
+ };
222
+ }
223
+ });
224
+ function useTextBoxEditor(item, scale) {
225
+ const element = shallowRef(null);
226
+ const annotation = useOptionalCapability(AnnotationToken$1);
227
+ const follower = createTextBoxEditorFollower();
228
+ watch(
229
+ [annotation, element, () => toValue(item), () => toValue(scale)],
230
+ ([capability, target, current, pixelsPerPoint]) => follower.follow(target, capability, current, pixelsPerPoint),
231
+ { immediate: true, flush: "post" }
232
+ );
233
+ onScopeDispose(() => follower.detach());
234
+ return element;
235
+ }
236
+ const LookScaleKey = Symbol("embedpdf annotation look scale");
237
+ const UNSCALED = computed(() => 1);
238
+ function provideLookScale(scale) {
239
+ provide(LookScaleKey, scale);
240
+ }
241
+ const NO_STYLE = Object.freeze({});
242
+ function useRichTextEditor(annotation) {
243
+ const page = usePage();
244
+ const item = useOptionalSelector(
245
+ AnnotationToken$1,
246
+ (host) => {
247
+ const key = annotationKey(toValue(annotation).ref);
248
+ const { transform } = page.value;
249
+ return host.listTextItems(page.value.ref, { zoom: transform.zoom, rotation: transform.rotation }).find((text) => text.ref !== null && annotationKey(text.ref) === key) ?? null;
250
+ },
251
+ null
252
+ );
253
+ const lookScale = inject(LookScaleKey, UNSCALED);
254
+ const scale = computed(
255
+ () => textBoxEditorScaleOf(item.value, page.value.transform, lookScale.value)
256
+ );
257
+ const element = useTextBoxEditor(item, scale);
258
+ const style = computed(() => {
259
+ const text = item.value;
260
+ if (!text) return NO_STYLE;
261
+ return {
262
+ ...textBoxStyleOf(text.css, scale.value),
263
+ ...text.editing ? { pointerEvents: "auto" } : {}
264
+ };
265
+ });
266
+ return {
267
+ ref: (target) => {
268
+ element.value = target instanceof HTMLElement ? target : null;
269
+ },
270
+ style,
271
+ editing: computed(() => {
272
+ var _a;
273
+ return ((_a = item.value) == null ? void 0 : _a.editing) ?? false;
274
+ })
275
+ };
276
+ }
277
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
278
+ __name: "AnnotationLook",
279
+ props: {
280
+ component: {},
281
+ scaled: { type: Boolean },
282
+ annotation: {},
283
+ item: {},
284
+ page: {},
285
+ native: {},
286
+ appearance: {},
287
+ interactive: { type: Boolean }
288
+ },
289
+ setup(__props) {
290
+ const props = __props;
291
+ const pixels = computed(() => frameInPixels(props.item.frame, props.page.transform));
292
+ const frame = computed(() => lookFrameOf(pixels.value, props.scaled));
293
+ provideLookScale(computed(() => props.scaled ? pixels.value.scale : 1));
294
+ const scaledBox = computed(
295
+ () => ({
296
+ position: "absolute",
297
+ left: 0,
298
+ top: 0,
299
+ width: `${pixels.value.design.width}px`,
300
+ height: `${pixels.value.design.height}px`,
301
+ transform: `scale(${pixels.value.scale})`,
302
+ transformOrigin: "0 0"
303
+ })
304
+ );
305
+ return (_ctx, _cache) => {
306
+ return __props.scaled ? (openBlock(), createElementBlock("div", {
307
+ key: 0,
308
+ style: normalizeStyle(scaledBox.value)
309
+ }, [
310
+ (openBlock(), createBlock(resolveDynamicComponent(__props.component), {
311
+ annotation: __props.annotation,
312
+ frame: frame.value,
313
+ native: __props.native,
314
+ appearance: __props.appearance,
315
+ hovered: __props.item.hovered ?? false,
316
+ selected: __props.item.selected,
317
+ interactive: __props.interactive
318
+ }, null, 8, ["annotation", "frame", "native", "appearance", "hovered", "selected", "interactive"]))
319
+ ], 4)) : (openBlock(), createBlock(resolveDynamicComponent(__props.component), {
320
+ key: 1,
321
+ annotation: __props.annotation,
322
+ frame: frame.value,
323
+ native: __props.native,
324
+ appearance: __props.appearance,
325
+ hovered: __props.item.hovered ?? false,
326
+ selected: __props.item.selected,
327
+ interactive: __props.interactive
328
+ }, null, 8, ["annotation", "frame", "native", "appearance", "hovered", "selected", "interactive"]));
329
+ };
330
+ }
331
+ });
332
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
333
+ __name: "FreeTextBox",
334
+ props: {
335
+ item: {},
336
+ page: {}
337
+ },
338
+ setup(__props) {
339
+ const props = __props;
340
+ const plate = computed(() => textPlateInPixels(props.item, props.page.transform));
341
+ const element = useTextBoxEditor(
342
+ () => props.item,
343
+ () => plate.value.scale
344
+ );
345
+ const chrome = useAnnotationSettings((settings) => settings.chrome);
346
+ const accent = useViewerSettings((settings) => settings.accent);
347
+ const outline = computed(() => annotationChromePaint(chrome.value, accent.value).textOutline);
348
+ const style = computed(() => {
349
+ const { item } = props;
350
+ const { left, top, width, height, scale } = plate.value;
351
+ return {
352
+ position: "absolute",
353
+ left: `${left}px`,
354
+ top: `${top}px`,
355
+ width: `${width}px`,
356
+ // Fixed to the plate: the box never grows with its text; it scrolls while
357
+ // typing and clips otherwise, where the baked appearance clips.
358
+ height: `${height}px`,
359
+ ...textBoxStyleOf(item.css, scale),
360
+ boxSizing: "border-box",
361
+ // The box's fill and border are the vector scene's, under this layer.
362
+ background: "transparent",
363
+ whiteSpace: "pre-wrap",
364
+ overflowWrap: "break-word",
365
+ overflowY: item.editing ? "auto" : "hidden",
366
+ overflowX: "hidden",
367
+ outline: item.editing ? `1px solid ${outline.value}` : "none",
368
+ cursor: item.editing ? "text" : "default",
369
+ // A plain text box turns about its centre, as the baked appearance does.
370
+ ...item.rot ? { transform: `rotate(${item.rot}deg)`, transformOrigin: "center" } : {},
371
+ // Not typing: clicks fall through to the shapes (select, move, resize).
372
+ pointerEvents: item.editing ? "auto" : "none"
373
+ };
374
+ });
375
+ return (_ctx, _cache) => {
376
+ return openBlock(), createElementBlock("div", {
377
+ ref_key: "element",
378
+ ref: element,
379
+ style: normalizeStyle(style.value)
380
+ }, null, 4);
381
+ };
382
+ }
383
+ });
384
+ const _hoisted_1$3 = ["viewBox"];
385
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
386
+ __name: "AnnotationScene",
387
+ props: {
388
+ item: {}
389
+ },
390
+ setup(__props) {
391
+ const props = __props;
392
+ const viewBox = computed(() => sceneViewBox(props.item.box));
393
+ const shapes = computed(() => svgShapesOf(scene(props.item), { miterLimit: MITER_LIMIT }));
394
+ const style = computed(
395
+ () => ({
396
+ position: "absolute",
397
+ left: 0,
398
+ top: 0,
399
+ width: "100%",
400
+ height: "100%",
401
+ overflow: "visible",
402
+ pointerEvents: "none",
403
+ // A ghost is see-through as a whole, so its fill and stroke don't stack.
404
+ ...props.item.source === "ghost" ? { opacity: ghostOpacity(props.item.ghostOpacity ?? 0.5) } : {}
405
+ })
406
+ );
407
+ return (_ctx, _cache) => {
408
+ return viewBox.value ? (openBlock(), createElementBlock("svg", {
409
+ key: 0,
410
+ viewBox: viewBox.value,
411
+ style: normalizeStyle(style.value)
412
+ }, [
413
+ createVNode(_sfc_main$b, { shapes: shapes.value }, null, 8, ["shapes"])
414
+ ], 12, _hoisted_1$3)) : createCommentVNode("", true);
415
+ };
416
+ }
417
+ });
418
+ const _hoisted_1$2 = ["src"];
419
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
420
+ __name: "NativeDrawing",
421
+ props: {
422
+ item: {},
423
+ urls: {}
424
+ },
425
+ setup(__props) {
426
+ const props = __props;
427
+ const shows = computed(() => {
428
+ var _a;
429
+ const { item, urls } = props;
430
+ return pictureOrPainting({
431
+ pending: item.source !== "baked",
432
+ picture: urls && shownAppearance(urls, item.id, ((_a = item.annotation) == null ? void 0 : _a.appearanceState) ?? null),
433
+ version: item.pictureVersion ?? 0,
434
+ loaded: urls !== null,
435
+ paint: () => hasLiveDrawing(item) ? item : null
436
+ });
437
+ });
438
+ const baked = computed(() => {
439
+ const { item } = props;
440
+ const look = shows.value;
441
+ if ((look == null ? void 0 : look.kind) !== "picture" || !item.raster) return null;
442
+ const box = rasterInFrame(item.raster, item.frame);
443
+ return {
444
+ url: look.picture.url,
445
+ style: {
446
+ position: "absolute",
447
+ left: box.left,
448
+ top: box.top,
449
+ width: box.width,
450
+ height: box.height,
451
+ // The appearance box is sized in content units; a global
452
+ // `img { max-width: 100% }` reset would otherwise clamp it to the
453
+ // containing block and distort the aspect (a landscape stamp on a turned,
454
+ // portrait page), so honour the explicit size.
455
+ maxWidth: "none",
456
+ maxHeight: "none",
457
+ pointerEvents: "none",
458
+ // The turn the engine took out of the raster, put back about its middle.
459
+ transform: box.transform,
460
+ transformOrigin: "center"
461
+ }
462
+ };
463
+ });
464
+ return (_ctx, _cache) => {
465
+ var _a;
466
+ return baked.value ? (openBlock(), createElementBlock("img", {
467
+ key: 0,
468
+ src: baked.value.url,
469
+ alt: "",
470
+ draggable: "false",
471
+ style: normalizeStyle(baked.value.style)
472
+ }, null, 12, _hoisted_1$2)) : ((_a = shows.value) == null ? void 0 : _a.kind) === "painting" ? (openBlock(), createBlock(_sfc_main$6, {
473
+ key: 1,
474
+ item: __props.item
475
+ }, null, 8, ["item"])) : createCommentVNode("", true);
476
+ };
477
+ }
478
+ });
479
+ const _hoisted_1$1 = ["src"];
480
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
481
+ __name: "StampGhost",
482
+ props: {
483
+ page: {}
484
+ },
485
+ setup(__props) {
486
+ const props = __props;
487
+ const annotation = useOptionalCapability(AnnotationToken$1);
488
+ const ghost = useOptionalSelector(
489
+ AnnotationToken$1,
490
+ (host) => host.getImageGhost(props.page.ref),
491
+ null
492
+ );
493
+ const armed = useOptionalSelector(AnnotationToken$1, (host) => host.getArmedStamp(), null);
494
+ const bucket = computed(
495
+ () => ghost.value ? previewBucket(ghost.value.box.width * props.page.transform.renderScale) : 0
496
+ );
497
+ const url = ref(null);
498
+ watch(
499
+ [annotation, armed, bucket],
500
+ ([host, _armed, size], _previous, onCleanup) => {
501
+ if (!host || !size) {
502
+ url.value = null;
503
+ return;
504
+ }
505
+ onCleanup(
506
+ loadObjectUrl(
507
+ () => host.renderArmedStampPreview(size),
508
+ (next) => url.value = next
509
+ )
510
+ );
511
+ },
512
+ { immediate: true }
513
+ );
514
+ const style = computed(() => {
515
+ const current = ghost.value;
516
+ if (!current) return null;
517
+ const frame = rectInPixels(current.box, props.page.transform);
518
+ return {
519
+ position: "absolute",
520
+ left: `${frame.left}px`,
521
+ top: `${frame.top}px`,
522
+ width: `${frame.width}px`,
523
+ height: `${frame.height}px`,
524
+ // Never let a global `img` reset clamp the box and distort the aspect.
525
+ maxWidth: "none",
526
+ maxHeight: "none",
527
+ pointerEvents: "none",
528
+ opacity: ghostOpacity(current.opacity),
529
+ ...current.rot ? { transform: `rotate(${current.rot}deg)`, transformOrigin: "center" } : {}
530
+ };
531
+ });
532
+ return (_ctx, _cache) => {
533
+ return style.value && url.value ? (openBlock(), createElementBlock("img", {
534
+ key: 0,
535
+ src: url.value,
536
+ alt: "",
537
+ draggable: "false",
538
+ style: normalizeStyle(style.value)
539
+ }, null, 12, _hoisted_1$1)) : createCommentVNode("", true);
540
+ };
541
+ }
542
+ });
543
+ const _hoisted_1 = { style: { position: "absolute", inset: 0, pointerEvents: "none" } };
544
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
545
+ __name: "AnnotationLayer",
546
+ props: {
547
+ renderers: {}
548
+ },
549
+ setup(__props) {
550
+ const props = __props;
551
+ const slots = useSlots();
552
+ const NO_ITEMS = Object.freeze([]);
553
+ const NO_TEXTS = Object.freeze([]);
554
+ const page = usePage();
555
+ usePaintsPagePart(
556
+ computed(() => page.value.ref),
557
+ "annotations"
558
+ );
559
+ const annotation = useOptionalCapability(AnnotationToken$1);
560
+ const interaction = useOptionalCapability(InteractionToken);
561
+ const activeToolId = useOptionalSelector(
562
+ InteractionToken,
563
+ (hub) => hub.getActiveToolId(),
564
+ ""
565
+ );
566
+ const items = useOptionalSelector(
567
+ AnnotationToken$1,
568
+ (host) => {
569
+ const { transform, ref: ref2 } = page.value;
570
+ return host.listPageItems(ref2, { zoom: transform.zoom, rotation: transform.rotation });
571
+ },
572
+ NO_ITEMS,
573
+ shallowEqual
574
+ );
575
+ const texts = useOptionalSelector(
576
+ AnnotationToken$1,
577
+ (host) => {
578
+ const { transform, ref: ref2 } = page.value;
579
+ return host.listTextItems(ref2, { zoom: transform.zoom, rotation: transform.rotation });
580
+ },
581
+ NO_TEXTS,
582
+ shallowEqual
583
+ );
584
+ const registrations = shallowRef(0);
585
+ watch(
586
+ [annotation, () => props.renderers],
587
+ ([host, renderers], previous, onCleanup) => {
588
+ const before = previous == null ? void 0 : previous[1];
589
+ if (renderers && before && renderers !== before && shallowEqual(renderers, before)) {
590
+ devWarn(
591
+ "annotation-renderers-inline",
592
+ "<AnnotationLayer :renderers> was given a new array with the same entries — define it once in <script setup>, because entry identity keys the behavior registration."
593
+ );
594
+ }
595
+ if (host && renderers) {
596
+ onCleanup(
597
+ registerRendererBehaviors(
598
+ host,
599
+ renderers,
600
+ () => {
601
+ var _a;
602
+ return String(((_a = interaction.value) == null ? void 0 : _a.getActiveToolId()) ?? "");
603
+ }
604
+ )
605
+ );
606
+ }
607
+ registrations.value += 1;
608
+ },
609
+ { immediate: true }
610
+ );
611
+ const urls = shallowRef(null);
612
+ const shown = createShownUrls();
613
+ onUnmounted(() => shown.release());
614
+ const bakedKey = useOptionalSelector(
615
+ AnnotationToken$1,
616
+ (host) => host.getAppearanceEpoch(page.value.ref),
617
+ ""
618
+ );
619
+ const bakeScale = useOptionalSelector(
620
+ RenderToken,
621
+ (render) => render.getAppearanceScale(page.value.transform.renderScale),
622
+ page.value.transform.renderScale
623
+ );
624
+ watch(
625
+ [annotation, () => page.value.ref, bakeScale, bakedKey],
626
+ ([host, pageRef, scale], _previous, onCleanup) => {
627
+ if (!host || !scale) return;
628
+ onCleanup(
629
+ loadAppearanceUrls(
630
+ shown,
631
+ (signal) => host.renderAppearances(pageRef, scale, signal),
632
+ annotationKey,
633
+ (loaded) => urls.value = loaded
634
+ )
635
+ );
636
+ },
637
+ { immediate: true }
638
+ );
639
+ const editingKey = computed(() => editingTextKeyOf(texts.value, annotationKey));
640
+ const NATIVE = { kind: "native", inert: false };
641
+ const drawn = computed(() => {
642
+ void activeToolId.value;
643
+ void registrations.value;
644
+ const host = annotation.value;
645
+ const renderers = props.renderers;
646
+ return items.value.map((item) => {
647
+ const record = item.annotation ?? null;
648
+ if (!record || !host) return { item, annotation: null, drawing: NATIVE };
649
+ const typing = editingKey.value !== null && annotationKey(record.ref) === editingKey.value;
650
+ return { item, annotation: record, drawing: annotationDrawingOf(record, host, renderers, typing) };
651
+ });
652
+ });
653
+ const ownTexts = computed(
654
+ () => layerTextBoxesOf(texts.value, items.value, props.renderers, annotationKey)
655
+ );
656
+ const itemsById = computed(() => new Map(items.value.map((item) => [item.id, item])));
657
+ const natives = /* @__PURE__ */ new Map();
658
+ const framedNatives = /* @__PURE__ */ new Map();
659
+ function nativeOf(id) {
660
+ let native = natives.get(id);
661
+ if (!native) {
662
+ native = markRaw(() => {
663
+ const item = itemsById.value.get(id);
664
+ return item ? h(_sfc_main$5, { item, urls: urls.value }) : null;
665
+ });
666
+ natives.set(id, native);
667
+ }
668
+ return native;
669
+ }
670
+ function framedNativeOf(id) {
671
+ let native = framedNatives.get(id);
672
+ if (!native) {
673
+ native = markRaw(() => {
674
+ const item = itemsById.value.get(id);
675
+ return item ? h(_sfc_main$9, { item, page: page.value }, () => h(nativeOf(id))) : null;
676
+ });
677
+ framedNatives.set(id, native);
678
+ }
679
+ return native;
680
+ }
681
+ watch(itemsById, (shown2) => {
682
+ for (const id of natives.keys()) if (!shown2.has(id)) natives.delete(id);
683
+ for (const id of framedNatives.keys()) if (!shown2.has(id)) framedNatives.delete(id);
684
+ });
685
+ const componentOf = (component) => toRaw(component);
686
+ return (_ctx, _cache) => {
687
+ return openBlock(), createElementBlock("div", _hoisted_1, [
688
+ (openBlock(true), createElementBlock(Fragment, null, renderList(drawn.value, ({ item, annotation: record, drawing }) => {
689
+ return openBlock(), createElementBlock(Fragment, {
690
+ key: item.id
691
+ }, [
692
+ drawing.kind === "owned" && record ? (openBlock(), createBlock(resolveDynamicComponent(componentOf(drawing.entry.component)), {
693
+ key: 0,
694
+ annotation: record,
695
+ item,
696
+ page: unref(page),
697
+ native: framedNativeOf(item.id),
698
+ hovered: item.hovered ?? false,
699
+ selected: item.selected,
700
+ interactive: true
701
+ }, null, 8, ["annotation", "item", "page", "native", "hovered", "selected"])) : drawing.kind === "look" && record ? (openBlock(), createBlock(_sfc_main$9, {
702
+ key: 1,
703
+ item,
704
+ page: unref(page),
705
+ interactive: drawing.interactive,
706
+ inert: drawing.inert
707
+ }, {
708
+ default: withCtx(() => {
709
+ var _a;
710
+ return [
711
+ createVNode(_sfc_main$8, {
712
+ component: componentOf(drawing.entry.component),
713
+ scaled: drawing.entry.scale !== false,
714
+ annotation: record,
715
+ item,
716
+ page: unref(page),
717
+ native: nativeOf(item.id),
718
+ appearance: urls.value && unref(bakedAppearanceOf)(urls.value, item.id, ((_a = item.annotation) == null ? void 0 : _a.appearanceState) ?? null),
719
+ interactive: drawing.interactive
720
+ }, null, 8, ["component", "scaled", "annotation", "item", "page", "native", "appearance", "interactive"])
721
+ ];
722
+ }),
723
+ _: 2
724
+ }, 1032, ["item", "page", "interactive", "inert"])) : (openBlock(), createBlock(_sfc_main$9, {
725
+ key: 2,
726
+ item,
727
+ page: unref(page),
728
+ inert: drawing.kind === "native" && drawing.inert
729
+ }, {
730
+ default: withCtx(() => [
731
+ createVNode(_sfc_main$5, {
732
+ item,
733
+ urls: urls.value
734
+ }, null, 8, ["item", "urls"])
735
+ ]),
736
+ _: 2
737
+ }, 1032, ["item", "page", "inert"]))
738
+ ], 64);
739
+ }), 128)),
740
+ (openBlock(true), createElementBlock(Fragment, null, renderList(ownTexts.value, (text) => {
741
+ return openBlock(), createBlock(_sfc_main$7, {
742
+ key: text.id,
743
+ item: text,
744
+ page: unref(page)
745
+ }, null, 8, ["item", "page"]);
746
+ }), 128)),
747
+ createVNode(_sfc_main$4, { page: unref(page) }, null, 8, ["page"]),
748
+ createVNode(_sfc_main$a, { page: unref(page) }, createSlots({ _: 2 }, [
749
+ slots.handle ? {
750
+ name: "handle",
751
+ fn: withCtx((handle) => [
752
+ renderSlot(_ctx.$slots, "handle", normalizeProps(guardReactiveProps(handle)))
753
+ ]),
754
+ key: "0"
755
+ } : void 0,
756
+ slots["rotation-handle"] ? {
757
+ name: "rotation-handle",
758
+ fn: withCtx((handle) => [
759
+ renderSlot(_ctx.$slots, "rotation-handle", normalizeProps(guardReactiveProps(handle)))
760
+ ]),
761
+ key: "1"
762
+ } : void 0
763
+ ]), 1032, ["page"])
764
+ ]);
765
+ };
766
+ }
767
+ });
768
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
769
+ __name: "AnnotationMenu",
770
+ props: {
771
+ gap: { default: 15 },
772
+ placement: { default: "top" }
773
+ },
774
+ setup(__props) {
775
+ const binding = useProjectorBinding();
776
+ const anchor = useOptionalSelector(
777
+ AnnotationToken$1,
778
+ (host) => {
779
+ const selection = host.selection.getAnchor();
780
+ if (!selection) return null;
781
+ const view = binding.value.projector.viewEnv(selection.page);
782
+ return view ? host.getSelectionAnchorIn(view) : selection;
783
+ },
784
+ null,
785
+ sameSelectionAnchor
786
+ );
787
+ return (_ctx, _cache) => {
788
+ return unref(anchor) ? (openBlock(), createBlock(_sfc_main$c, {
789
+ key: 0,
790
+ anchor: {
791
+ page: unref(anchor).page,
792
+ bounds: unref(anchor).bounds,
793
+ ...unref(anchor).rotationHandle ? { avoid: [unref(anchor).rotationHandle] } : {}
794
+ },
795
+ placement: __props.placement,
796
+ gap: __props.gap
797
+ }, {
798
+ default: withCtx(() => [
799
+ renderSlot(_ctx.$slots, "default")
800
+ ]),
801
+ _: 3
802
+ }, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
803
+ };
804
+ }
805
+ });
806
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
807
+ __name: "AnnotationDraftMenu",
808
+ props: {
809
+ gap: { default: 8 },
810
+ placement: { default: "top" }
811
+ },
812
+ setup(__props) {
813
+ const draft = useOptionalSelector(
814
+ AnnotationToken$2,
815
+ (annotation) => annotation.draft.get(),
816
+ null,
817
+ sameCreationDraftAnchor
818
+ );
819
+ return (_ctx, _cache) => {
820
+ return unref(draft) ? (openBlock(), createBlock(_sfc_main$c, {
821
+ key: 0,
822
+ anchor: unref(draft),
823
+ placement: __props.placement,
824
+ gap: __props.gap
825
+ }, {
826
+ default: withCtx(() => [
827
+ renderSlot(_ctx.$slots, "default", { draft: unref(draft) })
828
+ ]),
829
+ _: 3
830
+ }, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
831
+ };
832
+ }
833
+ });
834
+ const _sfc_main = /* @__PURE__ */ defineComponent({
835
+ __name: "AnnotationRotationBadge",
836
+ props: {
837
+ gap: { default: 16 },
838
+ placement: { default: "right" }
839
+ },
840
+ setup(__props) {
841
+ const slots = useSlots();
842
+ const rotation = useOptionalSelector(
843
+ AnnotationToken$2,
844
+ (annotation) => annotation.selection.getRotationAnchor(),
845
+ null,
846
+ sameRotationAnchor
847
+ );
848
+ const readout = useAnnotationSettings((settings) => settings.chrome.readout);
849
+ const badge = computed(
850
+ () => ({
851
+ pointerEvents: "none",
852
+ whiteSpace: "nowrap",
853
+ borderRadius: "4px",
854
+ padding: "2px 6px",
855
+ fontFamily: paintDefault("font-mono"),
856
+ fontSize: "12px",
857
+ background: paint("readout-background", readout.value.background),
858
+ color: paint("readout-color", readout.value.color)
859
+ })
860
+ );
861
+ return (_ctx, _cache) => {
862
+ return unref(rotation) && (slots.default || unref(readout).enabled) ? (openBlock(), createBlock(_sfc_main$c, {
863
+ key: 0,
864
+ anchor: { page: unref(rotation).page, bounds: { ...unref(rotation).at, width: 0, height: 0 } },
865
+ placement: __props.placement,
866
+ gap: __props.gap
867
+ }, {
868
+ default: withCtx(() => [
869
+ slots.default ? renderSlot(_ctx.$slots, "default", { rotation: unref(rotation) }, void 0, void 0, 0) : (openBlock(), createElementBlock("div", {
870
+ key: 1,
871
+ style: normalizeStyle(badge.value)
872
+ }, toDisplayString(unref(rotation).angle) + "°", 5))
873
+ ]),
874
+ _: 3
875
+ }, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
876
+ };
877
+ }
878
+ });
879
+ function useAnnotation() {
880
+ return useCapability(AnnotationToken$2);
881
+ }
882
+ function useAnnotationEvent(select, handler) {
883
+ useCapabilityEvent(AnnotationToken$2, select, handler);
884
+ }
885
+ const NO_ANNOTATIONS = Object.freeze([]);
886
+ function useAnnotationList(filter) {
887
+ return useOptionalSelector(
888
+ AnnotationToken$2,
889
+ (annotation) => annotation.list(toValue(filter)),
890
+ NO_ANNOTATIONS,
891
+ shallowEqual
892
+ );
893
+ }
894
+ const NO_DEFAULTS = Object.freeze({});
895
+ function useAnnotationDefaults(toolId) {
896
+ return useOptionalSelector(
897
+ AnnotationToken$2,
898
+ (annotation) => annotation.tools.getDefaults(toValue(toolId)),
899
+ NO_DEFAULTS
900
+ );
901
+ }
902
+ const NO_PROPERTIES = Object.freeze({
903
+ properties: [],
904
+ values: {},
905
+ mixed: []
906
+ });
907
+ function useAnnotationProperties(toolId) {
908
+ return useOptionalSelector(
909
+ AnnotationToken$2,
910
+ (annotation) => {
911
+ const tool = toValue(toolId);
912
+ return tool === void 0 ? annotation.selection.getProperties() : annotation.tools.getProperties(tool);
913
+ },
914
+ NO_PROPERTIES
915
+ );
916
+ }
917
+ function useAnnotationAnchor(ref2) {
918
+ return useOptionalSelector(
919
+ AnnotationToken$1,
920
+ (annotation) => {
921
+ const wanted = toValue(ref2);
922
+ return wanted ? annotation.getAnnotationAnchor(wanted) : null;
923
+ },
924
+ null,
925
+ sameAnnotationAnchor
926
+ );
927
+ }
928
+ function useComments() {
929
+ const annotation = useAnnotation();
930
+ const target = markRaw({});
931
+ return new Proxy(target, {
932
+ get: (_target, key) => typeof key === "string" && key.startsWith("__v_") ? Reflect.get(target, key) : Reflect.get(annotation.comments, key),
933
+ has: (_target, key) => Reflect.has(annotation.comments, key)
934
+ });
935
+ }
936
+ const NO_PAGES = Object.freeze([]);
937
+ const NO_THREADS = Object.freeze([]);
938
+ function useCommentThreads() {
939
+ const documentId = useDocumentId();
940
+ const threads = useOptionalSelector(
941
+ AnnotationToken$2,
942
+ (annotation) => annotation.comments.listThreads(),
943
+ NO_THREADS
944
+ );
945
+ const pages = useKernelValue(
946
+ (kernel) => documentId.value ? kernel.documents.listPages(documentId.value) : NO_PAGES
947
+ );
948
+ return computed(() => enrichCommentThreads(threads.value, pages.value));
949
+ }
950
+ function useCommentThread(ref2) {
951
+ const views = useCommentThreads();
952
+ const annotation = useOptionalCapability(AnnotationToken$2);
953
+ return computed(() => {
954
+ const wanted = toValue(ref2);
955
+ const api = annotation.value;
956
+ if (wanted == null || !api) return null;
957
+ const thread = api.comments.getThread(wanted);
958
+ if (!thread) return null;
959
+ const root = annotationKey(thread.root.ref);
960
+ return views.value.find((view) => annotationKey(view.root.ref) === root) ?? null;
961
+ });
962
+ }
963
+ const filePickerProvider = pickRequestedFile;
964
+ function useFilePickerProvider(provider = filePickerProvider) {
965
+ const annotation = useOptionalCapability(AnnotationToken$2);
966
+ watch(
967
+ [annotation, () => unref(provider)],
968
+ ([capability, current], _previous, onCleanup) => {
969
+ if (!capability) return;
970
+ onCleanup(
971
+ installFilePickerProvider(
972
+ capability,
973
+ current,
974
+ () => devWarn(
975
+ "file-picker-provider-twice",
976
+ "useFilePickerProvider() is called from two mounted components for the same document — the later one wins. Call it once, at a document-scoped spot."
977
+ )
978
+ )
979
+ );
980
+ },
981
+ { immediate: true }
982
+ );
983
+ }
984
+ export {
985
+ _sfc_main$1 as _,
986
+ _sfc_main$3 as a,
987
+ _sfc_main$2 as b,
988
+ _sfc_main as c,
989
+ useAnnotationAnchor as d,
990
+ useAnnotationDefaults as e,
991
+ filePickerProvider as f,
992
+ useAnnotationEvent as g,
993
+ useAnnotationList as h,
994
+ useAnnotationProperties as i,
995
+ useAnnotationSettings as j,
996
+ useAnnotationState as k,
997
+ useCommentThread as l,
998
+ useCommentThreads as m,
999
+ useComments as n,
1000
+ useFilePickerProvider as o,
1001
+ useRichTextEditor as p,
1002
+ useAnnotation as u
1003
+ };
1004
+ //# sourceMappingURL=composables-CIkhKwAg.js.map