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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +258 -2
  3. package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs +124 -0
  4. package/dist/Anchored.vue_vue_type_script_setup_true_lang-BEImlFso.cjs.map +1 -0
  5. package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js +125 -0
  6. package/dist/Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js.map +1 -0
  7. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs +20 -0
  8. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-BwtHXw73.cjs.map +1 -0
  9. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js +21 -0
  10. package/dist/AnchoredScope.vue_vue_type_script_setup_true_lang-Ulkr3a6R.js.map +1 -0
  11. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js +192 -0
  12. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-C-7yeEGh.js.map +1 -0
  13. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs +191 -0
  14. package/dist/DocumentScope.vue_vue_type_script_setup_true_lang-czzeUzPl.cjs.map +1 -0
  15. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs +682 -0
  16. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-BA0_VwFc.cjs.map +1 -0
  17. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js +683 -0
  18. package/dist/FormLayer.vue_vue_type_script_setup_true_lang-DUqft-xs.js.map +1 -0
  19. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs +174 -0
  20. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-C5-eQD34.cjs.map +1 -0
  21. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js +175 -0
  22. package/dist/LinkLayer.vue_vue_type_script_setup_true_lang-EzLaOP3g.js.map +1 -0
  23. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js +33 -0
  24. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-CJt3vdBW.js.map +1 -0
  25. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs +32 -0
  26. package/dist/PagePointerSource.vue_vue_type_script_setup_true_lang-Cw29c8Oa.cjs.map +1 -0
  27. package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs +151 -0
  28. package/dist/PageView.vue_vue_type_script_setup_true_lang-CjrpumX2.cjs.map +1 -0
  29. package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js +152 -0
  30. package/dist/PageView.vue_vue_type_script_setup_true_lang-O4AFc0_R.js.map +1 -0
  31. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs +480 -0
  32. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-DrOORC1H.cjs.map +1 -0
  33. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js +481 -0
  34. package/dist/Scrollbar.vue_vue_type_script_setup_true_lang-HbCryx1B.js.map +1 -0
  35. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js +118 -0
  36. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js.map +1 -0
  37. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs +117 -0
  38. package/dist/SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs.map +1 -0
  39. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js +302 -0
  40. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js.map +1 -0
  41. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs +301 -0
  42. package/dist/SelectionClipboard.vue_vue_type_script_setup_true_lang-C8T9q6Kb.cjs.map +1 -0
  43. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs +38 -0
  44. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-D_c-wINF.cjs.map +1 -0
  45. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js +39 -0
  46. package/dist/SvgShapes.vue_vue_type_script_setup_true_lang-fOTs4aqv.js.map +1 -0
  47. package/dist/actions.cjs +42 -0
  48. package/dist/actions.cjs.map +1 -0
  49. package/dist/actions.d.cts +41 -0
  50. package/dist/actions.d.ts +41 -0
  51. package/dist/actions.js +37 -0
  52. package/dist/actions.js.map +1 -0
  53. package/dist/anchored/Anchored.vue.d.cts +40 -0
  54. package/dist/anchored/Anchored.vue.d.ts +40 -0
  55. package/dist/anchored/AnchoredScope.vue.d.cts +17 -0
  56. package/dist/anchored/AnchoredScope.vue.d.ts +17 -0
  57. package/dist/anchored/PlacedAnchored.vue.d.cts +19 -0
  58. package/dist/anchored/PlacedAnchored.vue.d.ts +19 -0
  59. package/dist/anchored/projector.d.cts +32 -0
  60. package/dist/anchored/projector.d.ts +32 -0
  61. package/dist/anchored.cjs +13 -0
  62. package/dist/anchored.cjs.map +1 -0
  63. package/dist/anchored.d.cts +15 -0
  64. package/dist/anchored.d.ts +15 -0
  65. package/dist/anchored.js +13 -0
  66. package/dist/anchored.js.map +1 -0
  67. package/dist/annotation/AnnotationChrome.vue.d.cts +20 -0
  68. package/dist/annotation/AnnotationChrome.vue.d.ts +20 -0
  69. package/dist/annotation/AnnotationDraftMenu.vue.d.cts +26 -0
  70. package/dist/annotation/AnnotationDraftMenu.vue.d.ts +26 -0
  71. package/dist/annotation/AnnotationFrame.vue.d.cts +25 -0
  72. package/dist/annotation/AnnotationFrame.vue.d.ts +25 -0
  73. package/dist/annotation/AnnotationLayer.vue.d.cts +23 -0
  74. package/dist/annotation/AnnotationLayer.vue.d.ts +23 -0
  75. package/dist/annotation/AnnotationLook.vue.d.cts +21 -0
  76. package/dist/annotation/AnnotationLook.vue.d.ts +21 -0
  77. package/dist/annotation/AnnotationMenu.vue.d.cts +23 -0
  78. package/dist/annotation/AnnotationMenu.vue.d.ts +23 -0
  79. package/dist/annotation/AnnotationRotationBadge.vue.d.cts +26 -0
  80. package/dist/annotation/AnnotationRotationBadge.vue.d.ts +26 -0
  81. package/dist/annotation/AnnotationScene.vue.d.cts +7 -0
  82. package/dist/annotation/AnnotationScene.vue.d.ts +7 -0
  83. package/dist/annotation/FreeTextBox.vue.d.cts +9 -0
  84. package/dist/annotation/FreeTextBox.vue.d.ts +9 -0
  85. package/dist/annotation/NativeDrawing.vue.d.cts +10 -0
  86. package/dist/annotation/NativeDrawing.vue.d.ts +10 -0
  87. package/dist/annotation/StampGhost.vue.d.cts +7 -0
  88. package/dist/annotation/StampGhost.vue.d.ts +7 -0
  89. package/dist/annotation/composables.d.cts +76 -0
  90. package/dist/annotation/composables.d.ts +76 -0
  91. package/dist/annotation/state.d.cts +19 -0
  92. package/dist/annotation/state.d.ts +19 -0
  93. package/dist/annotation/text-box.d.cts +28 -0
  94. package/dist/annotation/text-box.d.ts +28 -0
  95. package/dist/annotation/types.d.cts +154 -0
  96. package/dist/annotation/types.d.ts +154 -0
  97. package/dist/annotation.cjs +29 -0
  98. package/dist/annotation.cjs.map +1 -0
  99. package/dist/annotation.d.cts +35 -0
  100. package/dist/annotation.d.ts +35 -0
  101. package/dist/annotation.js +23 -0
  102. package/dist/annotation.js.map +1 -0
  103. package/dist/attachment.cjs +22 -0
  104. package/dist/attachment.cjs.map +1 -0
  105. package/dist/attachment.d.cts +34 -0
  106. package/dist/attachment.d.ts +34 -0
  107. package/dist/attachment.js +17 -0
  108. package/dist/attachment.js.map +1 -0
  109. package/dist/capabilities-C7YzgPCX.js +164 -0
  110. package/dist/capabilities-C7YzgPCX.js.map +1 -0
  111. package/dist/capabilities-DVNJmgy7.cjs +163 -0
  112. package/dist/capabilities-DVNJmgy7.cjs.map +1 -0
  113. package/dist/commands.cjs +81 -0
  114. package/dist/commands.cjs.map +1 -0
  115. package/dist/commands.d.cts +61 -0
  116. package/dist/commands.d.ts +61 -0
  117. package/dist/commands.js +76 -0
  118. package/dist/commands.js.map +1 -0
  119. package/dist/composables-BGBsNDf9.cjs +25 -0
  120. package/dist/composables-BGBsNDf9.cjs.map +1 -0
  121. package/dist/composables-Bi6QvJpj.cjs +978 -0
  122. package/dist/composables-Bi6QvJpj.cjs.map +1 -0
  123. package/dist/composables-DK3lwh38.js +979 -0
  124. package/dist/composables-DK3lwh38.js.map +1 -0
  125. package/dist/composables-DwsZdg06.js +26 -0
  126. package/dist/composables-DwsZdg06.js.map +1 -0
  127. package/dist/dev-CtMlvxjZ.js +17 -0
  128. package/dist/dev-CtMlvxjZ.js.map +1 -0
  129. package/dist/dev-eeIS2B4c.cjs +16 -0
  130. package/dist/dev-eeIS2B4c.cjs.map +1 -0
  131. package/dist/dev.d.cts +11 -0
  132. package/dist/dev.d.ts +11 -0
  133. package/dist/documents-DUu5H4yH.js +34 -0
  134. package/dist/documents-DUu5H4yH.js.map +1 -0
  135. package/dist/documents-TQ1fMdWI.cjs +33 -0
  136. package/dist/documents-TQ1fMdWI.cjs.map +1 -0
  137. package/dist/form/ButtonControl.vue.d.cts +11 -0
  138. package/dist/form/ButtonControl.vue.d.ts +11 -0
  139. package/dist/form/ComboControl.vue.d.cts +11 -0
  140. package/dist/form/ComboControl.vue.d.ts +11 -0
  141. package/dist/form/FieldPictures.vue.d.cts +3 -0
  142. package/dist/form/FieldPictures.vue.d.ts +3 -0
  143. package/dist/form/FormFocusRing.vue.d.cts +8 -0
  144. package/dist/form/FormFocusRing.vue.d.ts +8 -0
  145. package/dist/form/FormLayer.vue.d.cts +3 -0
  146. package/dist/form/FormLayer.vue.d.ts +3 -0
  147. package/dist/form/ListControl.vue.d.cts +11 -0
  148. package/dist/form/ListControl.vue.d.ts +11 -0
  149. package/dist/form/NativeListBox.vue.d.cts +27 -0
  150. package/dist/form/NativeListBox.vue.d.ts +27 -0
  151. package/dist/form/SignatureControl.vue.d.cts +11 -0
  152. package/dist/form/SignatureControl.vue.d.ts +11 -0
  153. package/dist/form/TextControl.vue.d.cts +11 -0
  154. package/dist/form/TextControl.vue.d.ts +11 -0
  155. package/dist/form/ToggleControl.vue.d.cts +11 -0
  156. package/dist/form/ToggleControl.vue.d.ts +11 -0
  157. package/dist/form/composables.d.cts +52 -0
  158. package/dist/form/composables.d.ts +52 -0
  159. package/dist/form/widget-box.d.cts +34 -0
  160. package/dist/form/widget-box.d.ts +34 -0
  161. package/dist/form.cjs +17 -0
  162. package/dist/form.cjs.map +1 -0
  163. package/dist/form.d.cts +12 -0
  164. package/dist/form.d.ts +12 -0
  165. package/dist/form.js +11 -0
  166. package/dist/form.js.map +1 -0
  167. package/dist/history.cjs +22 -0
  168. package/dist/history.cjs.map +1 -0
  169. package/dist/history.d.cts +31 -0
  170. package/dist/history.d.ts +31 -0
  171. package/dist/history.js +17 -0
  172. package/dist/history.js.map +1 -0
  173. package/dist/i18n.cjs +29 -0
  174. package/dist/i18n.cjs.map +1 -0
  175. package/dist/i18n.d.cts +36 -0
  176. package/dist/i18n.d.ts +36 -0
  177. package/dist/i18n.js +24 -0
  178. package/dist/i18n.js.map +1 -0
  179. package/dist/index.cjs +414 -0
  180. package/dist/index.cjs.map +1 -0
  181. package/dist/index.d.cts +32 -0
  182. package/dist/index.d.ts +32 -0
  183. package/dist/index.js +234 -0
  184. package/dist/index.js.map +1 -0
  185. package/dist/interaction/PagePointerSource.vue.d.cts +3 -0
  186. package/dist/interaction/PagePointerSource.vue.d.ts +3 -0
  187. package/dist/interaction.cjs +63 -0
  188. package/dist/interaction.cjs.map +1 -0
  189. package/dist/interaction.d.cts +40 -0
  190. package/dist/interaction.d.ts +40 -0
  191. package/dist/interaction.js +47 -0
  192. package/dist/interaction.js.map +1 -0
  193. package/dist/link/LinkAnchor.vue.d.cts +9 -0
  194. package/dist/link/LinkAnchor.vue.d.ts +9 -0
  195. package/dist/link/LinkLayer.vue.d.cts +22 -0
  196. package/dist/link/LinkLayer.vue.d.ts +22 -0
  197. package/dist/link/composables.d.cts +29 -0
  198. package/dist/link/composables.d.ts +29 -0
  199. package/dist/link.cjs +14 -0
  200. package/dist/link.cjs.map +1 -0
  201. package/dist/link.d.cts +11 -0
  202. package/dist/link.d.ts +11 -0
  203. package/dist/link.js +8 -0
  204. package/dist/link.js.map +1 -0
  205. package/dist/measurement.cjs +43 -0
  206. package/dist/measurement.cjs.map +1 -0
  207. package/dist/measurement.d.cts +51 -0
  208. package/dist/measurement.d.ts +51 -0
  209. package/dist/measurement.js +38 -0
  210. package/dist/measurement.js.map +1 -0
  211. package/dist/metadata.cjs +22 -0
  212. package/dist/metadata.cjs.map +1 -0
  213. package/dist/metadata.d.cts +31 -0
  214. package/dist/metadata.d.ts +31 -0
  215. package/dist/metadata.js +17 -0
  216. package/dist/metadata.js.map +1 -0
  217. package/dist/outline.cjs +22 -0
  218. package/dist/outline.cjs.map +1 -0
  219. package/dist/outline.d.cts +36 -0
  220. package/dist/outline.d.ts +36 -0
  221. package/dist/outline.js +17 -0
  222. package/dist/outline.js.map +1 -0
  223. package/dist/page-D9XIuLSj.js +16 -0
  224. package/dist/page-D9XIuLSj.js.map +1 -0
  225. package/dist/page-Doy4_Sdz.cjs +15 -0
  226. package/dist/page-Doy4_Sdz.cjs.map +1 -0
  227. package/dist/page-edit.cjs +18 -0
  228. package/dist/page-edit.cjs.map +1 -0
  229. package/dist/page-edit.d.cts +28 -0
  230. package/dist/page-edit.d.ts +28 -0
  231. package/dist/page-edit.js +13 -0
  232. package/dist/page-edit.js.map +1 -0
  233. package/dist/page-layers-c-CJYAUO.cjs +30 -0
  234. package/dist/page-layers-c-CJYAUO.cjs.map +1 -0
  235. package/dist/page-layers-rlh4-1qr.js +31 -0
  236. package/dist/page-layers-rlh4-1qr.js.map +1 -0
  237. package/dist/page-layers.d.cts +21 -0
  238. package/dist/page-layers.d.ts +21 -0
  239. package/dist/page-view/PageView.vue.d.cts +42 -0
  240. package/dist/page-view/PageView.vue.d.ts +42 -0
  241. package/dist/page-view.cjs +5 -0
  242. package/dist/page-view.cjs.map +1 -0
  243. package/dist/page-view.d.cts +10 -0
  244. package/dist/page-view.d.ts +10 -0
  245. package/dist/page-view.js +5 -0
  246. package/dist/page-view.js.map +1 -0
  247. package/dist/projector-CDZn1kh1.js +32 -0
  248. package/dist/projector-CDZn1kh1.js.map +1 -0
  249. package/dist/projector-Cf7879sx.cjs +31 -0
  250. package/dist/projector-Cf7879sx.cjs.map +1 -0
  251. package/dist/redaction.cjs +34 -0
  252. package/dist/redaction.cjs.map +1 -0
  253. package/dist/redaction.d.cts +44 -0
  254. package/dist/redaction.d.ts +44 -0
  255. package/dist/redaction.js +29 -0
  256. package/dist/redaction.js.map +1 -0
  257. package/dist/render/RenderLayer.vue.d.cts +23 -0
  258. package/dist/render/RenderLayer.vue.d.ts +23 -0
  259. package/dist/render/TileImage.vue.d.cts +13 -0
  260. package/dist/render/TileImage.vue.d.ts +13 -0
  261. package/dist/render/TilePlane.vue.d.cts +7 -0
  262. package/dist/render/TilePlane.vue.d.ts +7 -0
  263. package/dist/render.cjs +262 -0
  264. package/dist/render.cjs.map +1 -0
  265. package/dist/render.d.cts +16 -0
  266. package/dist/render.d.ts +16 -0
  267. package/dist/render.js +257 -0
  268. package/dist/render.js.map +1 -0
  269. package/dist/runtime/DocumentGate.vue.d.cts +24 -0
  270. package/dist/runtime/DocumentGate.vue.d.ts +24 -0
  271. package/dist/runtime/DocumentScope.vue.d.cts +16 -0
  272. package/dist/runtime/DocumentScope.vue.d.ts +16 -0
  273. package/dist/runtime/KernelProvider.vue.d.cts +17 -0
  274. package/dist/runtime/KernelProvider.vue.d.ts +17 -0
  275. package/dist/runtime/SvgShapes.vue.d.cts +7 -0
  276. package/dist/runtime/SvgShapes.vue.d.ts +7 -0
  277. package/dist/runtime/Viewer.vue.d.cts +57 -0
  278. package/dist/runtime/Viewer.vue.d.ts +57 -0
  279. package/dist/runtime/capabilities.d.cts +52 -0
  280. package/dist/runtime/capabilities.d.ts +52 -0
  281. package/dist/runtime/documents.d.cts +42 -0
  282. package/dist/runtime/documents.d.ts +42 -0
  283. package/dist/runtime/kernel.d.cts +36 -0
  284. package/dist/runtime/kernel.d.ts +36 -0
  285. package/dist/runtime/page.d.cts +15 -0
  286. package/dist/runtime/page.d.ts +15 -0
  287. package/dist/runtime/refs.d.cts +12 -0
  288. package/dist/runtime/refs.d.ts +12 -0
  289. package/dist/runtime/surface-box.d.cts +12 -0
  290. package/dist/runtime/surface-box.d.ts +12 -0
  291. package/dist/runtime.cjs +53 -0
  292. package/dist/runtime.cjs.map +1 -0
  293. package/dist/runtime.d.cts +24 -0
  294. package/dist/runtime.d.ts +24 -0
  295. package/dist/runtime.js +38 -0
  296. package/dist/runtime.js.map +1 -0
  297. package/dist/scope-BQA4toWB.cjs +17 -0
  298. package/dist/scope-BQA4toWB.cjs.map +1 -0
  299. package/dist/scope-BgdCqnYb.js +18 -0
  300. package/dist/scope-BgdCqnYb.js.map +1 -0
  301. package/dist/search/SearchLayer.vue.d.cts +17 -0
  302. package/dist/search/SearchLayer.vue.d.ts +17 -0
  303. package/dist/search/composables.d.cts +31 -0
  304. package/dist/search/composables.d.ts +31 -0
  305. package/dist/search.cjs +17 -0
  306. package/dist/search.cjs.map +1 -0
  307. package/dist/search.d.cts +10 -0
  308. package/dist/search.d.ts +10 -0
  309. package/dist/search.js +11 -0
  310. package/dist/search.js.map +1 -0
  311. package/dist/selection/SelectionClipboard.vue.d.cts +24 -0
  312. package/dist/selection/SelectionClipboard.vue.d.ts +24 -0
  313. package/dist/selection/SelectionHandles.vue.d.cts +8 -0
  314. package/dist/selection/SelectionHandles.vue.d.ts +8 -0
  315. package/dist/selection/SelectionLayer.vue.d.cts +3 -0
  316. package/dist/selection/SelectionLayer.vue.d.ts +3 -0
  317. package/dist/selection/SelectionMenu.vue.d.cts +23 -0
  318. package/dist/selection/SelectionMenu.vue.d.ts +23 -0
  319. package/dist/selection/composables.d.cts +24 -0
  320. package/dist/selection/composables.d.ts +24 -0
  321. package/dist/selection.cjs +24 -0
  322. package/dist/selection.cjs.map +1 -0
  323. package/dist/selection.d.cts +16 -0
  324. package/dist/selection.d.ts +16 -0
  325. package/dist/selection.js +15 -0
  326. package/dist/selection.js.map +1 -0
  327. package/dist/shell.cjs +72 -0
  328. package/dist/shell.cjs.map +1 -0
  329. package/dist/shell.d.cts +56 -0
  330. package/dist/shell.d.ts +56 -0
  331. package/dist/shell.js +67 -0
  332. package/dist/shell.js.map +1 -0
  333. package/dist/signature/composables.d.cts +39 -0
  334. package/dist/signature/composables.d.ts +39 -0
  335. package/dist/signature.cjs +16 -0
  336. package/dist/signature.cjs.map +1 -0
  337. package/dist/signature.d.cts +15 -0
  338. package/dist/signature.d.ts +15 -0
  339. package/dist/signature.js +10 -0
  340. package/dist/signature.js.map +1 -0
  341. package/dist/stage/PageSurface.vue.d.cts +29 -0
  342. package/dist/stage/PageSurface.vue.d.ts +29 -0
  343. package/dist/stage/Scrollbar.vue.d.cts +32 -0
  344. package/dist/stage/Scrollbar.vue.d.ts +32 -0
  345. package/dist/stage/Stage.vue.d.cts +44 -0
  346. package/dist/stage/Stage.vue.d.ts +44 -0
  347. package/dist/stage/StageScope.vue.d.cts +17 -0
  348. package/dist/stage/StageScope.vue.d.ts +17 -0
  349. package/dist/stage/composables.d.cts +41 -0
  350. package/dist/stage/composables.d.ts +41 -0
  351. package/dist/stage/scope.d.cts +12 -0
  352. package/dist/stage/scope.d.ts +12 -0
  353. package/dist/stage.cjs +21 -0
  354. package/dist/stage.cjs.map +1 -0
  355. package/dist/stage.d.cts +17 -0
  356. package/dist/stage.d.ts +17 -0
  357. package/dist/stage.js +15 -0
  358. package/dist/stage.js.map +1 -0
  359. package/dist/stamp.cjs +68 -0
  360. package/dist/stamp.cjs.map +1 -0
  361. package/dist/stamp.d.cts +61 -0
  362. package/dist/stamp.d.ts +61 -0
  363. package/dist/stamp.js +61 -0
  364. package/dist/stamp.js.map +1 -0
  365. package/dist/state-DZg8q3v6.js +52 -0
  366. package/dist/state-DZg8q3v6.js.map +1 -0
  367. package/dist/state-M22NDJQo.cjs +51 -0
  368. package/dist/state-M22NDJQo.cjs.map +1 -0
  369. package/dist/state.d.cts +32 -0
  370. package/dist/state.d.ts +32 -0
  371. package/dist/strip-BSDB39Xh.cjs +743 -0
  372. package/dist/strip-BSDB39Xh.cjs.map +1 -0
  373. package/dist/strip-C3wLonKB.js +744 -0
  374. package/dist/strip-C3wLonKB.js.map +1 -0
  375. package/dist/surface-box-B9oa4YoG.js +12 -0
  376. package/dist/surface-box-B9oa4YoG.js.map +1 -0
  377. package/dist/surface-box-C7EvUOXp.cjs +11 -0
  378. package/dist/surface-box-C7EvUOXp.cjs.map +1 -0
  379. package/dist/theme.d.cts +13 -0
  380. package/dist/theme.d.ts +13 -0
  381. package/dist/toolbar/DefaultCollapsed.vue.d.cts +9 -0
  382. package/dist/toolbar/DefaultCollapsed.vue.d.ts +9 -0
  383. package/dist/toolbar/DefaultCommand.vue.d.cts +8 -0
  384. package/dist/toolbar/DefaultCommand.vue.d.ts +8 -0
  385. package/dist/toolbar/DefaultGroupTrigger.vue.d.cts +9 -0
  386. package/dist/toolbar/DefaultGroupTrigger.vue.d.ts +9 -0
  387. package/dist/toolbar/DefaultOverflowMenu.vue.d.cts +9 -0
  388. package/dist/toolbar/DefaultOverflowMenu.vue.d.ts +9 -0
  389. package/dist/toolbar/DefaultOverflowTrigger.vue.d.cts +10 -0
  390. package/dist/toolbar/DefaultOverflowTrigger.vue.d.ts +10 -0
  391. package/dist/toolbar/Measured.vue.d.cts +21 -0
  392. package/dist/toolbar/Measured.vue.d.ts +21 -0
  393. package/dist/toolbar/NativeSlotSocket.vue.d.cts +22 -0
  394. package/dist/toolbar/NativeSlotSocket.vue.d.ts +22 -0
  395. package/dist/toolbar/Toolbar.vue.d.cts +82 -0
  396. package/dist/toolbar/Toolbar.vue.d.ts +82 -0
  397. package/dist/toolbar/ToolbarPart.vue.d.cts +42 -0
  398. package/dist/toolbar/ToolbarPart.vue.d.ts +42 -0
  399. package/dist/toolbar/paint.d.cts +3 -0
  400. package/dist/toolbar/paint.d.ts +3 -0
  401. package/dist/toolbar/strip.d.cts +14 -0
  402. package/dist/toolbar/strip.d.ts +14 -0
  403. package/dist/toolbar/views.d.cts +15 -0
  404. package/dist/toolbar/views.d.ts +15 -0
  405. package/dist/toolbar.cjs +27 -0
  406. package/dist/toolbar.cjs.map +1 -0
  407. package/dist/toolbar.d.cts +14 -0
  408. package/dist/toolbar.d.ts +14 -0
  409. package/dist/toolbar.js +12 -0
  410. package/dist/toolbar.js.map +1 -0
  411. package/dist/view-manager.cjs +22 -0
  412. package/dist/view-manager.cjs.map +1 -0
  413. package/dist/view-manager.d.cts +24 -0
  414. package/dist/view-manager.d.ts +24 -0
  415. package/dist/view-manager.js +17 -0
  416. package/dist/view-manager.js.map +1 -0
  417. package/package.json +179 -3
@@ -0,0 +1,118 @@
1
+ import { toValue, defineComponent, computed, unref, openBlock, createElementBlock, Fragment, renderList, normalizeStyle, createElementVNode, createCommentVNode } from "vue";
2
+ import { createClickDetector, searchHighlightsOf, paint } from "@embedpdf/web";
3
+ import { u as usePage } from "./page-D9XIuLSj.js";
4
+ import { SearchToken, searchState } from "@embedpdf/plugin-search";
5
+ import { i as useOptionalSelector, a as useCapability, b as useCapabilityEvent } from "./capabilities-C7YzgPCX.js";
6
+ import { a as stateComposable, s as settingsComposable } from "./state-DZg8q3v6.js";
7
+ function useSearch() {
8
+ return useCapability(SearchToken);
9
+ }
10
+ function useSearchEvent(select, handler) {
11
+ useCapabilityEvent(SearchToken, select, handler);
12
+ }
13
+ const useSearchState = stateComposable(searchState);
14
+ const useSearchSettings = settingsComposable(SearchToken);
15
+ const NO_HITS = Object.freeze([]);
16
+ function useSearchHits(page) {
17
+ return useOptionalSelector(
18
+ SearchToken,
19
+ (search) => {
20
+ const wanted = toValue(page);
21
+ return search.listHits(wanted === void 0 ? void 0 : { page: wanted });
22
+ },
23
+ NO_HITS
24
+ );
25
+ }
26
+ const _hoisted_1 = {
27
+ key: 0,
28
+ style: { position: "absolute", inset: 0, pointerEvents: "none" }
29
+ };
30
+ const _hoisted_2 = ["onClick"];
31
+ const _hoisted_3 = ["points", "onClick"];
32
+ const _sfc_main = /* @__PURE__ */ defineComponent({
33
+ __name: "SearchLayer",
34
+ props: {
35
+ onHitClick: { type: Function }
36
+ },
37
+ setup(__props) {
38
+ const props = __props;
39
+ const page = usePage();
40
+ const hits = useSearchHits(() => page.value.ref);
41
+ const active = useSearchState((state) => state.activeHit);
42
+ const highlight = useSearchSettings((settings) => settings.highlight);
43
+ const clicks = createClickDetector();
44
+ const pieces = computed(
45
+ () => searchHighlightsOf(hits.value, {
46
+ active: active.value,
47
+ page: page.value.transform,
48
+ // Each color is its CSS variable first, then the setting: CSS wins.
49
+ color: paint("search-highlight", highlight.value.color),
50
+ activeColor: paint("search-highlight-active", highlight.value.activeColor)
51
+ })
52
+ );
53
+ const blendMode = computed(
54
+ () => paint("search-blend-mode", highlight.value.blendMode)
55
+ );
56
+ const clickable = computed(
57
+ () => props.onHitClick ? { pointerEvents: "auto", cursor: "pointer" } : {}
58
+ );
59
+ function onPress(event) {
60
+ if (props.onHitClick) clicks.press(event);
61
+ }
62
+ function onClick(hit, event) {
63
+ if (props.onHitClick && clicks.isClick(event)) props.onHitClick(hit);
64
+ }
65
+ return (_ctx, _cache) => {
66
+ return unref(hits).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_1, [
67
+ (openBlock(true), createElementBlock(Fragment, null, renderList(pieces.value, (piece) => {
68
+ return openBlock(), createElementBlock(Fragment, {
69
+ key: piece.key
70
+ }, [
71
+ piece.box ? (openBlock(), createElementBlock("div", {
72
+ key: 0,
73
+ style: normalizeStyle({
74
+ position: "absolute",
75
+ left: `${piece.box.left}px`,
76
+ top: `${piece.box.top}px`,
77
+ width: `${piece.box.width}px`,
78
+ height: `${piece.box.height}px`,
79
+ backgroundColor: piece.fill,
80
+ mixBlendMode: blendMode.value,
81
+ borderRadius: "2px",
82
+ ...clickable.value
83
+ }),
84
+ onPointerdown: onPress,
85
+ onClick: ($event) => onClick(piece.hit, $event)
86
+ }, null, 44, _hoisted_2)) : (openBlock(), createElementBlock("svg", {
87
+ key: 1,
88
+ style: normalizeStyle({
89
+ position: "absolute",
90
+ inset: 0,
91
+ width: "100%",
92
+ height: "100%",
93
+ overflow: "visible",
94
+ mixBlendMode: blendMode.value
95
+ })
96
+ }, [
97
+ createElementVNode("polygon", {
98
+ points: piece.points ?? "",
99
+ style: normalizeStyle({ fill: piece.fill, ...clickable.value }),
100
+ onPointerdown: onPress,
101
+ onClick: ($event) => onClick(piece.hit, $event)
102
+ }, null, 44, _hoisted_3)
103
+ ], 4))
104
+ ], 64);
105
+ }), 128))
106
+ ])) : createCommentVNode("", true);
107
+ };
108
+ }
109
+ });
110
+ export {
111
+ _sfc_main as _,
112
+ useSearchEvent as a,
113
+ useSearchHits as b,
114
+ useSearchSettings as c,
115
+ useSearchState as d,
116
+ useSearch as u
117
+ };
118
+ //# sourceMappingURL=SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchLayer.vue_vue_type_script_setup_true_lang-BlLIPH1B.js","sources":["../src/search/composables.ts","../src/search/SearchLayer.vue"],"sourcesContent":["/**\n * The search composables: `useSearch()` (the API), `useSearchState()`,\n * `useSearchSettings()`, `useSearchEvent()`, and `useSearchHits()` for a\n * results list or a count per page.\n */\nimport { toValue } from 'vue';\nimport type { MaybeRefOrGetter, Ref } from 'vue';\nimport { SearchToken, searchState } from '@embedpdf/plugin-search';\nimport type { SearchCapability, SearchHit } from '@embedpdf/plugin-search';\nimport type { EventHook, PageRef } from '@embedpdf/core';\nimport { useCapability, useCapabilityEvent, useOptionalSelector } from '../runtime/capabilities';\nimport { settingsComposable, stateComposable } from '../state';\n\n/** The search API (`search`, `clear`, `nextHit`, `goToHit`, …) for your chrome. The object never changes. */\nexport function useSearch(): SearchCapability {\n return useCapability(SearchToken);\n}\n\n/** Subscribe to one search event while the component lives: `useSearchEvent((search) => search.onCompleted, handler)`. */\nexport function useSearchEvent<Event>(\n select: (search: SearchCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(SearchToken, select, handler);\n}\n\n/**\n * The search's state as refs: the query, status, count, active match, progress\n * and error (the page's State table, declared once in `searchState`). With a\n * selector, one ref that updates only when the value it picks changes.\n */\nexport const useSearchState = stateComposable(searchState);\n\n/** The search settings (`reveal`, `highlight`), with or without a document, as refs. Takes a selector. */\nexport const useSearchSettings = settingsComposable(SearchToken);\n\nconst NO_HITS: readonly SearchHit[] = Object.freeze([]);\n\n/**\n * Every match found so far, or one page's (its ref or index; a getter to\n * follow a prop), as a ref: for a results list or a count per thumbnail. The\n * plugin hands out the same array until matches land on what it covers, so\n * the ref updates only then. Empty without a document, and for a page that\n * isn't in the document.\n */\nexport function useSearchHits(\n page?: MaybeRefOrGetter<PageRef | number | undefined>,\n): Readonly<Ref<readonly SearchHit[]>> {\n return useOptionalSelector(\n SearchToken,\n (search) => {\n const wanted = toValue(page);\n return search.listHits(wanted === undefined ? undefined : { page: wanted });\n },\n NO_HITS,\n );\n}\n","<!--\n <SearchLayer>: the matches on one page, painted from the plugin's page-space\n hits through the page's transform, in the plugin's `highlight` colors, which\n the `--epdf-search-*` CSS variables override. It never calls the engine:\n search is driven from your chrome with `useSearch()`. With `@hit-click`, a\n click on a match tells you which one.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport type { SearchHit } from '@embedpdf/plugin-search';\nimport { createClickDetector, paint, searchHighlightsOf } from '@embedpdf/web';\nimport { usePage } from '../runtime/page';\nimport { useSearchHits, useSearchSettings, useSearchState } from './composables';\n\nconst props = defineProps<{\n /**\n * `@hit-click`: makes the matches clickable, and is called with the match\n * someone clicks, for example to make it the active one with\n * `search.goToHit(hit)`. The press still reaches the page, so a drag that\n * starts on a match selects text, and only a click calls it. Without it,\n * matches are only paint and the pointer goes straight through.\n *\n * A prop rather than an emitted event, so the layer knows whether you\n * listen: only then do the matches take the pointer.\n */\n onHitClick?: (hit: SearchHit) => void;\n}>();\n\nconst page = usePage();\n// The plugin hands out the same array per page until matches land on it, so\n// this changes only then.\nconst hits = useSearchHits(() => page.value.ref);\nconst active = useSearchState((state) => state.activeHit);\nconst highlight = useSearchSettings((settings) => settings.highlight);\n// Tells a click on a match from a drag that starts there (and selects text).\nconst clicks = createClickDetector();\n\n/** One painted piece per segment of each match: a rounded box when upright, its true quad when turned. */\nconst pieces = computed(() =>\n searchHighlightsOf(hits.value, {\n active: active.value,\n page: page.value.transform,\n // Each color is its CSS variable first, then the setting: CSS wins.\n color: paint('search-highlight', highlight.value.color),\n activeColor: paint('search-highlight-active', highlight.value.activeColor),\n }),\n);\n\nconst blendMode = computed(\n () => paint('search-blend-mode', highlight.value.blendMode) as CSSProperties['mixBlendMode'],\n);\n\n// Only a clickable match takes the pointer; a plain highlight stays inert.\nconst clickable = computed(\n (): CSSProperties => (props.onHitClick ? { pointerEvents: 'auto', cursor: 'pointer' } : {}),\n);\n\n// Nothing here stops the press, so it reaches the page as well.\nfunction onPress(event: PointerEvent): void {\n if (props.onHitClick) clicks.press(event);\n}\nfunction onClick(hit: SearchHit, event: MouseEvent): void {\n if (props.onHitClick && clicks.isClick(event)) props.onHitClick(hit);\n}\n</script>\n\n<template>\n <div v-if=\"hits.length > 0\" :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"piece in pieces\" :key=\"piece.key\">\n <div\n v-if=\"piece.box\"\n :style=\"{\n position: 'absolute',\n left: `${piece.box.left}px`,\n top: `${piece.box.top}px`,\n width: `${piece.box.width}px`,\n height: `${piece.box.height}px`,\n backgroundColor: piece.fill,\n mixBlendMode: blendMode,\n borderRadius: '2px',\n ...clickable,\n }\"\n @pointerdown=\"onPress\"\n @click=\"onClick(piece.hit, $event)\"\n />\n <svg\n v-else\n :style=\"{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n overflow: 'visible',\n mixBlendMode: blendMode,\n }\"\n >\n <!-- The fill goes in `style`: an SVG attribute doesn't read var(). -->\n <polygon\n :points=\"piece.points ?? ''\"\n :style=\"{ fill: piece.fill, ...clickable }\"\n @pointerdown=\"onPress\"\n @click=\"onClick(piece.hit, $event)\"\n />\n </svg>\n </template>\n </div>\n</template>\n"],"names":["_unref","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeStyle","_createElementVNode"],"mappings":";;;;;;AAcO,SAAS,YAA8B;AAC5C,SAAO,cAAc,WAAW;AAClC;AAGO,SAAS,eACd,QACA,SACM;AACN,qBAAmB,aAAa,QAAQ,OAAO;AACjD;AAOO,MAAM,iBAAiB,gBAAgB,WAAW;AAGlD,MAAM,oBAAoB,mBAAmB,WAAW;AAE/D,MAAM,UAAgC,OAAO,OAAO,EAAE;AAS/C,SAAS,cACd,MACqC;AACrC,SAAO;AAAA,IACL;AAAA,IACA,CAAC,WAAW;AACV,YAAM,SAAS,QAAQ,IAAI;AAC3B,aAAO,OAAO,SAAS,WAAW,SAAY,SAAY,EAAE,MAAM,QAAQ;AAAA,IAC5E;AAAA,IACA;AAAA,EAAA;AAEJ;;;;;;;;;;;;;ACzCA,UAAM,QAAQ;AAcd,UAAM,OAAO,QAAA;AAGb,UAAM,OAAO,cAAc,MAAM,KAAK,MAAM,GAAG;AAC/C,UAAM,SAAS,eAAe,CAAC,UAAU,MAAM,SAAS;AACxD,UAAM,YAAY,kBAAkB,CAAC,aAAa,SAAS,SAAS;AAEpE,UAAM,SAAS,oBAAA;AAGf,UAAM,SAAS;AAAA,MAAS,MACtB,mBAAmB,KAAK,OAAO;AAAA,QAC7B,QAAQ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,eAAA,EAAA,MAAU,MAAM,SAAS,UAAA,OAAS;AAAA,gBACvC,eAAa;AAAA,gBACb,qBAAO,QAAQ,MAAM,KAAK,MAAM;AAAA,cAAA;;;;;;;;"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const web = require("@embedpdf/web");
4
+ const page = require("./page-Doy4_Sdz.cjs");
5
+ const pluginSearch = require("@embedpdf/plugin-search");
6
+ const capabilities = require("./capabilities-DVNJmgy7.cjs");
7
+ const state = require("./state-M22NDJQo.cjs");
8
+ function useSearch() {
9
+ return capabilities.useCapability(pluginSearch.SearchToken);
10
+ }
11
+ function useSearchEvent(select, handler) {
12
+ capabilities.useCapabilityEvent(pluginSearch.SearchToken, select, handler);
13
+ }
14
+ const useSearchState = state.stateComposable(pluginSearch.searchState);
15
+ const useSearchSettings = state.settingsComposable(pluginSearch.SearchToken);
16
+ const NO_HITS = Object.freeze([]);
17
+ function useSearchHits(page2) {
18
+ return capabilities.useOptionalSelector(
19
+ pluginSearch.SearchToken,
20
+ (search) => {
21
+ const wanted = vue.toValue(page2);
22
+ return search.listHits(wanted === void 0 ? void 0 : { page: wanted });
23
+ },
24
+ NO_HITS
25
+ );
26
+ }
27
+ const _hoisted_1 = {
28
+ key: 0,
29
+ style: { position: "absolute", inset: 0, pointerEvents: "none" }
30
+ };
31
+ const _hoisted_2 = ["onClick"];
32
+ const _hoisted_3 = ["points", "onClick"];
33
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
34
+ __name: "SearchLayer",
35
+ props: {
36
+ onHitClick: { type: Function }
37
+ },
38
+ setup(__props) {
39
+ const props = __props;
40
+ const page$1 = page.usePage();
41
+ const hits = useSearchHits(() => page$1.value.ref);
42
+ const active = useSearchState((state2) => state2.activeHit);
43
+ const highlight = useSearchSettings((settings) => settings.highlight);
44
+ const clicks = web.createClickDetector();
45
+ const pieces = vue.computed(
46
+ () => web.searchHighlightsOf(hits.value, {
47
+ active: active.value,
48
+ page: page$1.value.transform,
49
+ // Each color is its CSS variable first, then the setting: CSS wins.
50
+ color: web.paint("search-highlight", highlight.value.color),
51
+ activeColor: web.paint("search-highlight-active", highlight.value.activeColor)
52
+ })
53
+ );
54
+ const blendMode = vue.computed(
55
+ () => web.paint("search-blend-mode", highlight.value.blendMode)
56
+ );
57
+ const clickable = vue.computed(
58
+ () => props.onHitClick ? { pointerEvents: "auto", cursor: "pointer" } : {}
59
+ );
60
+ function onPress(event) {
61
+ if (props.onHitClick) clicks.press(event);
62
+ }
63
+ function onClick(hit, event) {
64
+ if (props.onHitClick && clicks.isClick(event)) props.onHitClick(hit);
65
+ }
66
+ return (_ctx, _cache) => {
67
+ return vue.unref(hits).length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
68
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pieces.value, (piece) => {
69
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
70
+ key: piece.key
71
+ }, [
72
+ piece.box ? (vue.openBlock(), vue.createElementBlock("div", {
73
+ key: 0,
74
+ style: vue.normalizeStyle({
75
+ position: "absolute",
76
+ left: `${piece.box.left}px`,
77
+ top: `${piece.box.top}px`,
78
+ width: `${piece.box.width}px`,
79
+ height: `${piece.box.height}px`,
80
+ backgroundColor: piece.fill,
81
+ mixBlendMode: blendMode.value,
82
+ borderRadius: "2px",
83
+ ...clickable.value
84
+ }),
85
+ onPointerdown: onPress,
86
+ onClick: ($event) => onClick(piece.hit, $event)
87
+ }, null, 44, _hoisted_2)) : (vue.openBlock(), vue.createElementBlock("svg", {
88
+ key: 1,
89
+ style: vue.normalizeStyle({
90
+ position: "absolute",
91
+ inset: 0,
92
+ width: "100%",
93
+ height: "100%",
94
+ overflow: "visible",
95
+ mixBlendMode: blendMode.value
96
+ })
97
+ }, [
98
+ vue.createElementVNode("polygon", {
99
+ points: piece.points ?? "",
100
+ style: vue.normalizeStyle({ fill: piece.fill, ...clickable.value }),
101
+ onPointerdown: onPress,
102
+ onClick: ($event) => onClick(piece.hit, $event)
103
+ }, null, 44, _hoisted_3)
104
+ ], 4))
105
+ ], 64);
106
+ }), 128))
107
+ ])) : vue.createCommentVNode("", true);
108
+ };
109
+ }
110
+ });
111
+ exports._sfc_main = _sfc_main;
112
+ exports.useSearch = useSearch;
113
+ exports.useSearchEvent = useSearchEvent;
114
+ exports.useSearchHits = useSearchHits;
115
+ exports.useSearchSettings = useSearchSettings;
116
+ exports.useSearchState = useSearchState;
117
+ //# sourceMappingURL=SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchLayer.vue_vue_type_script_setup_true_lang-CQozZCvB.cjs","sources":["../src/search/composables.ts","../src/search/SearchLayer.vue"],"sourcesContent":["/**\n * The search composables: `useSearch()` (the API), `useSearchState()`,\n * `useSearchSettings()`, `useSearchEvent()`, and `useSearchHits()` for a\n * results list or a count per page.\n */\nimport { toValue } from 'vue';\nimport type { MaybeRefOrGetter, Ref } from 'vue';\nimport { SearchToken, searchState } from '@embedpdf/plugin-search';\nimport type { SearchCapability, SearchHit } from '@embedpdf/plugin-search';\nimport type { EventHook, PageRef } from '@embedpdf/core';\nimport { useCapability, useCapabilityEvent, useOptionalSelector } from '../runtime/capabilities';\nimport { settingsComposable, stateComposable } from '../state';\n\n/** The search API (`search`, `clear`, `nextHit`, `goToHit`, …) for your chrome. The object never changes. */\nexport function useSearch(): SearchCapability {\n return useCapability(SearchToken);\n}\n\n/** Subscribe to one search event while the component lives: `useSearchEvent((search) => search.onCompleted, handler)`. */\nexport function useSearchEvent<Event>(\n select: (search: SearchCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(SearchToken, select, handler);\n}\n\n/**\n * The search's state as refs: the query, status, count, active match, progress\n * and error (the page's State table, declared once in `searchState`). With a\n * selector, one ref that updates only when the value it picks changes.\n */\nexport const useSearchState = stateComposable(searchState);\n\n/** The search settings (`reveal`, `highlight`), with or without a document, as refs. Takes a selector. */\nexport const useSearchSettings = settingsComposable(SearchToken);\n\nconst NO_HITS: readonly SearchHit[] = Object.freeze([]);\n\n/**\n * Every match found so far, or one page's (its ref or index; a getter to\n * follow a prop), as a ref: for a results list or a count per thumbnail. The\n * plugin hands out the same array until matches land on what it covers, so\n * the ref updates only then. Empty without a document, and for a page that\n * isn't in the document.\n */\nexport function useSearchHits(\n page?: MaybeRefOrGetter<PageRef | number | undefined>,\n): Readonly<Ref<readonly SearchHit[]>> {\n return useOptionalSelector(\n SearchToken,\n (search) => {\n const wanted = toValue(page);\n return search.listHits(wanted === undefined ? undefined : { page: wanted });\n },\n NO_HITS,\n );\n}\n","<!--\n <SearchLayer>: the matches on one page, painted from the plugin's page-space\n hits through the page's transform, in the plugin's `highlight` colors, which\n the `--epdf-search-*` CSS variables override. It never calls the engine:\n search is driven from your chrome with `useSearch()`. With `@hit-click`, a\n click on a match tells you which one.\n-->\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport type { SearchHit } from '@embedpdf/plugin-search';\nimport { createClickDetector, paint, searchHighlightsOf } from '@embedpdf/web';\nimport { usePage } from '../runtime/page';\nimport { useSearchHits, useSearchSettings, useSearchState } from './composables';\n\nconst props = defineProps<{\n /**\n * `@hit-click`: makes the matches clickable, and is called with the match\n * someone clicks, for example to make it the active one with\n * `search.goToHit(hit)`. The press still reaches the page, so a drag that\n * starts on a match selects text, and only a click calls it. Without it,\n * matches are only paint and the pointer goes straight through.\n *\n * A prop rather than an emitted event, so the layer knows whether you\n * listen: only then do the matches take the pointer.\n */\n onHitClick?: (hit: SearchHit) => void;\n}>();\n\nconst page = usePage();\n// The plugin hands out the same array per page until matches land on it, so\n// this changes only then.\nconst hits = useSearchHits(() => page.value.ref);\nconst active = useSearchState((state) => state.activeHit);\nconst highlight = useSearchSettings((settings) => settings.highlight);\n// Tells a click on a match from a drag that starts there (and selects text).\nconst clicks = createClickDetector();\n\n/** One painted piece per segment of each match: a rounded box when upright, its true quad when turned. */\nconst pieces = computed(() =>\n searchHighlightsOf(hits.value, {\n active: active.value,\n page: page.value.transform,\n // Each color is its CSS variable first, then the setting: CSS wins.\n color: paint('search-highlight', highlight.value.color),\n activeColor: paint('search-highlight-active', highlight.value.activeColor),\n }),\n);\n\nconst blendMode = computed(\n () => paint('search-blend-mode', highlight.value.blendMode) as CSSProperties['mixBlendMode'],\n);\n\n// Only a clickable match takes the pointer; a plain highlight stays inert.\nconst clickable = computed(\n (): CSSProperties => (props.onHitClick ? { pointerEvents: 'auto', cursor: 'pointer' } : {}),\n);\n\n// Nothing here stops the press, so it reaches the page as well.\nfunction onPress(event: PointerEvent): void {\n if (props.onHitClick) clicks.press(event);\n}\nfunction onClick(hit: SearchHit, event: MouseEvent): void {\n if (props.onHitClick && clicks.isClick(event)) props.onHitClick(hit);\n}\n</script>\n\n<template>\n <div v-if=\"hits.length > 0\" :style=\"{ position: 'absolute', inset: 0, pointerEvents: 'none' }\">\n <template v-for=\"piece in pieces\" :key=\"piece.key\">\n <div\n v-if=\"piece.box\"\n :style=\"{\n position: 'absolute',\n left: `${piece.box.left}px`,\n top: `${piece.box.top}px`,\n width: `${piece.box.width}px`,\n height: `${piece.box.height}px`,\n backgroundColor: piece.fill,\n mixBlendMode: blendMode,\n borderRadius: '2px',\n ...clickable,\n }\"\n @pointerdown=\"onPress\"\n @click=\"onClick(piece.hit, $event)\"\n />\n <svg\n v-else\n :style=\"{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n overflow: 'visible',\n mixBlendMode: blendMode,\n }\"\n >\n <!-- The fill goes in `style`: an SVG attribute doesn't read var(). -->\n <polygon\n :points=\"piece.points ?? ''\"\n :style=\"{ fill: piece.fill, ...clickable }\"\n @pointerdown=\"onPress\"\n @click=\"onClick(piece.hit, $event)\"\n />\n </svg>\n </template>\n </div>\n</template>\n"],"names":["useCapability","SearchToken","useCapabilityEvent","stateComposable","searchState","settingsComposable","page","useOptionalSelector","toValue","usePage","state","createClickDetector","computed","searchHighlightsOf","paint","_unref","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeStyle","_createElementVNode"],"mappings":";;;;;;;AAcO,SAAS,YAA8B;AAC5C,SAAOA,aAAAA,cAAcC,aAAAA,WAAW;AAClC;AAGO,SAAS,eACd,QACA,SACM;AACNC,kCAAmBD,aAAAA,aAAa,QAAQ,OAAO;AACjD;AAOO,MAAM,iBAAiBE,MAAAA,gBAAgBC,aAAAA,WAAW;AAGlD,MAAM,oBAAoBC,MAAAA,mBAAmBJ,aAAAA,WAAW;AAE/D,MAAM,UAAgC,OAAO,OAAO,EAAE;AAS/C,SAAS,cACdK,OACqC;AACrC,SAAOC,aAAAA;AAAAA,IACLN,aAAAA;AAAAA,IACA,CAAC,WAAW;AACV,YAAM,SAASO,IAAAA,QAAQF,KAAI;AAC3B,aAAO,OAAO,SAAS,WAAW,SAAY,SAAY,EAAE,MAAM,QAAQ;AAAA,IAC5E;AAAA,IACA;AAAA,EAAA;AAEJ;;;;;;;;;;;;;ACzCA,UAAM,QAAQ;AAcd,UAAMA,SAAOG,KAAAA,QAAA;AAGb,UAAM,OAAO,cAAc,MAAMH,OAAK,MAAM,GAAG;AAC/C,UAAM,SAAS,eAAe,CAACI,WAAUA,OAAM,SAAS;AACxD,UAAM,YAAY,kBAAkB,CAAC,aAAa,SAAS,SAAS;AAEpE,UAAM,SAASC,IAAAA,oBAAA;AAGf,UAAM,SAASC,IAAAA;AAAAA,MAAS,MACtBC,IAAAA,mBAAmB,KAAK,OAAO;AAAA,QAC7B,QAAQ,OAAO;AAAA,QACf,MAAMP,OAAK,MAAM;AAAA;AAAA,QAEjB,OAAOQ,IAAAA,MAAM,oBAAoB,UAAU,MAAM,KAAK;AAAA,QACtD,aAAaA,IAAAA,MAAM,2BAA2B,UAAU,MAAM,WAAW;AAAA,MAAA,CAC1E;AAAA,IAAA;AAGH,UAAM,YAAYF,IAAAA;AAAAA,MAChB,MAAME,UAAM,qBAAqB,UAAU,M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@@ -0,0 +1,302 @@
1
+ import { defineComponent, watch, computed, unref, openBlock, createElementBlock, Fragment, renderList, normalizeStyle, createCommentVNode, createBlock, withCtx, renderSlot, ref, createElementVNode, toValue } from "vue";
2
+ import { shallowEqual } from "@embedpdf/core";
3
+ import { SelectionToken as SelectionToken$1 } from "@embedpdf/plugin-selection/contract/host";
4
+ import { paint, mixAccent, svgPoints, quadInPixels, samePageBounds, attachSelectionHandle, sameSelectionEndpoints, wireSelectionClipboard } from "@embedpdf/web";
5
+ import { a as useCapability, b as useCapabilityEvent, h as useOptionalCapability, i as useOptionalSelector, g as useKernelValue } from "./capabilities-C7YzgPCX.js";
6
+ import { e as useViewerSettings } from "./documents-DUu5H4yH.js";
7
+ import { u as usePage } from "./page-D9XIuLSj.js";
8
+ import { SelectionToken, selectionState, selectionHandleViewOf, selectionHandleGeom, selectionHandleEndpointsOf, HANDLE_HEAD, HANDLE_PAD, HANDLE_BAR, armSelectionHandle } from "@embedpdf/plugin-selection";
9
+ import { _ as _sfc_main$4 } from "./Anchored.vue_vue_type_script_setup_true_lang-Brhh5jyF.js";
10
+ import { u as useOptionalProjectorBinding } from "./projector-CDZn1kh1.js";
11
+ import { d as devWarn } from "./dev-CtMlvxjZ.js";
12
+ import { u as useStageToken } from "./scope-BgdCqnYb.js";
13
+ import { a as stateComposable, s as settingsComposable } from "./state-DZg8q3v6.js";
14
+ function useSelection() {
15
+ return useCapability(SelectionToken);
16
+ }
17
+ function useSelectionEvent(select, handler) {
18
+ useCapabilityEvent(SelectionToken, select, handler);
19
+ }
20
+ const useSelectionState = stateComposable(selectionState);
21
+ const useSelectionSettings = settingsComposable(SelectionToken);
22
+ const _hoisted_1 = {
23
+ key: 0,
24
+ style: {
25
+ position: "absolute",
26
+ inset: 0,
27
+ width: "100%",
28
+ height: "100%",
29
+ overflow: "visible",
30
+ pointerEvents: "none"
31
+ }
32
+ };
33
+ const _hoisted_2 = ["points"];
34
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
35
+ __name: "SelectionLayer",
36
+ setup(__props) {
37
+ const NO_SEGMENTS = Object.freeze([]);
38
+ const page = usePage();
39
+ const selection = useOptionalCapability(SelectionToken$1);
40
+ const segments = useOptionalSelector(
41
+ SelectionToken$1,
42
+ (lens) => lens.listSegments(page.value.ref),
43
+ NO_SEGMENTS,
44
+ shallowEqual
45
+ );
46
+ const visible = useOptionalSelector(SelectionToken$1, (lens) => lens.isHighlightVisible(), false);
47
+ const color = useSelectionSettings((settings) => settings.color);
48
+ const accent = useViewerSettings((settings) => settings.accent);
49
+ watch(
50
+ [selection, () => page.value.ref],
51
+ ([lens, pageRef]) => {
52
+ if (lens) void lens.ensureLoaded(pageRef);
53
+ },
54
+ { immediate: true }
55
+ );
56
+ const fill = computed(
57
+ () => paint("text-selection", color.value ?? mixAccent("text-selection", accent.value))
58
+ );
59
+ const polygons = computed(
60
+ () => segments.value.map((segment) => svgPoints(quadInPixels(segment.quad, page.value.transform)))
61
+ );
62
+ return (_ctx, _cache) => {
63
+ return unref(visible) ? (openBlock(), createElementBlock("svg", _hoisted_1, [
64
+ (openBlock(true), createElementBlock(Fragment, null, renderList(polygons.value, (points, index) => {
65
+ return openBlock(), createElementBlock("polygon", {
66
+ key: index,
67
+ points,
68
+ style: normalizeStyle({ fill: fill.value })
69
+ }, null, 12, _hoisted_2);
70
+ }), 128))
71
+ ])) : createCommentVNode("", true);
72
+ };
73
+ }
74
+ });
75
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
76
+ __name: "SelectionMenu",
77
+ props: {
78
+ gap: { default: 8 },
79
+ placement: { default: "top" }
80
+ },
81
+ setup(__props) {
82
+ const selecting = useSelectionState((state) => state.isSelecting);
83
+ const anchor = useOptionalSelector(
84
+ SelectionToken,
85
+ (selection) => selection.getAnchor(),
86
+ null,
87
+ samePageBounds
88
+ );
89
+ return (_ctx, _cache) => {
90
+ return !unref(selecting) && unref(anchor) ? (openBlock(), createBlock(_sfc_main$4, {
91
+ key: 0,
92
+ anchor: unref(anchor),
93
+ placement: __props.placement,
94
+ gap: __props.gap
95
+ }, {
96
+ default: withCtx(() => [
97
+ renderSlot(_ctx.$slots, "default")
98
+ ]),
99
+ _: 3
100
+ }, 8, ["anchor", "placement", "gap"])) : createCommentVNode("", true);
101
+ };
102
+ }
103
+ });
104
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
105
+ __name: "SelectionHandles",
106
+ props: {
107
+ token: {}
108
+ },
109
+ setup(__props) {
110
+ const props = __props;
111
+ const token = useStageToken(() => props.token);
112
+ const host = useCapability(SelectionToken$1);
113
+ const stage = useOptionalCapability(token);
114
+ const surface = useOptionalProjectorBinding();
115
+ if (!surface || surface.value.projector.space !== "overlay") {
116
+ devWarn(
117
+ "selection-handles-outside-stage",
118
+ "<SelectionHandles> renders nothing here: mount it in the <Stage> #overlay slot (a <PageView> has no camera to project the handles through)."
119
+ );
120
+ }
121
+ const selecting = useSelectionState((state) => state.isSelecting);
122
+ const visible = useOptionalSelector(SelectionToken$1, (lens) => lens.isHighlightVisible(), false);
123
+ const handles = useSelectionSettings((settings) => settings.handles);
124
+ const accent = useViewerSettings((settings) => settings.accent);
125
+ const endpoints = useOptionalSelector(
126
+ SelectionToken$1,
127
+ (lens) => selectionHandleEndpointsOf(lens.getSnapshot()),
128
+ null,
129
+ sameSelectionEndpoints
130
+ );
131
+ const camera = useKernelValue(() => {
132
+ var _a;
133
+ return ((_a = stage.value) == null ? void 0 : _a.listVisiblePages()) ?? null;
134
+ });
135
+ const dragging = ref(null);
136
+ const geometry = computed(() => {
137
+ void camera.value;
138
+ const lens = stage.value;
139
+ const ends = endpoints.value;
140
+ if (!lens || !ends) return null;
141
+ const view = selectionHandleViewOf(lens);
142
+ return {
143
+ start: selectionHandleGeom(view, ends.start, "start"),
144
+ end: selectionHandleGeom(view, ends.end, "end")
145
+ };
146
+ });
147
+ const shown = computed(
148
+ () => geometry.value !== null && visible.value && (!selecting.value || dragging.value !== null)
149
+ );
150
+ const color = computed(() => paint("text-selection-handle", handles.value.color ?? accent.value));
151
+ const shadow = computed(() => paint("text-selection-handle-shadow", handles.value.shadow));
152
+ function gripStyles(role) {
153
+ var _a;
154
+ const grip = (_a = geometry.value) == null ? void 0 : _a[role];
155
+ if (!grip) return null;
156
+ const barTop = HANDLE_PAD + (role === "start" ? HANDLE_HEAD : 0);
157
+ const pivotX = HANDLE_PAD + HANDLE_BAR / 2;
158
+ return {
159
+ grip: {
160
+ position: "absolute",
161
+ left: `${grip.bar.from.x - pivotX}px`,
162
+ top: `${grip.bar.from.y - barTop}px`,
163
+ width: `${HANDLE_BAR + 2 * HANDLE_PAD}px`,
164
+ height: `${grip.length + HANDLE_HEAD + 2 * HANDLE_PAD}px`,
165
+ // Upright text carries no transform: pixel-identical to an axis-aligned box.
166
+ ...grip.upright ? {} : { transform: `rotate(${grip.rotation}deg)`, transformOrigin: `${pivotX}px ${barTop}px` },
167
+ touchAction: "none",
168
+ cursor: "grab",
169
+ pointerEvents: "auto"
170
+ },
171
+ // The caret bar: the selection's own edge, the glyph's ink height at any tilt.
172
+ bar: {
173
+ position: "absolute",
174
+ left: `${HANDLE_PAD}px`,
175
+ top: `${barTop}px`,
176
+ width: `${HANDLE_BAR}px`,
177
+ height: `${grip.length}px`,
178
+ background: color.value,
179
+ borderRadius: `${HANDLE_BAR / 2}px`
180
+ },
181
+ // The head, flush against the bar: past the ascent at the start, past the
182
+ // baseline at the end, in the text's frame.
183
+ head: {
184
+ position: "absolute",
185
+ left: `${pivotX - HANDLE_HEAD / 2}px`,
186
+ top: `${role === "start" ? HANDLE_PAD : HANDLE_PAD + grip.length}px`,
187
+ width: `${HANDLE_HEAD}px`,
188
+ height: `${HANDLE_HEAD}px`,
189
+ borderRadius: "50%",
190
+ background: color.value,
191
+ boxShadow: shadow.value
192
+ }
193
+ };
194
+ }
195
+ const startStyles = computed(() => gripStyles("start"));
196
+ const endStyles = computed(() => gripStyles("end"));
197
+ function arm(role) {
198
+ const lens = stage.value;
199
+ const ends = endpoints.value;
200
+ if (!lens || !ends) return null;
201
+ const armed = armSelectionHandle(host, selectionHandleViewOf(lens), ends, role);
202
+ if (!armed) return null;
203
+ dragging.value = role;
204
+ return {
205
+ // The point the user grabbed: the bar's midpoint.
206
+ base: armed.base,
207
+ session: {
208
+ move: armed.drag.move,
209
+ end: () => {
210
+ armed.drag.end();
211
+ dragging.value = null;
212
+ }
213
+ }
214
+ };
215
+ }
216
+ const startGrip = ref(null);
217
+ const endGrip = ref(null);
218
+ for (const [role, element] of [
219
+ ["start", startGrip],
220
+ ["end", endGrip]
221
+ ]) {
222
+ watch(
223
+ element,
224
+ (grip, _previous, onCleanup) => {
225
+ if (grip) onCleanup(attachSelectionHandle(grip, { arm: () => arm(role) }));
226
+ },
227
+ { flush: "post" }
228
+ );
229
+ }
230
+ return (_ctx, _cache) => {
231
+ return shown.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
232
+ startStyles.value ? (openBlock(), createElementBlock("div", {
233
+ key: 0,
234
+ ref_key: "startGrip",
235
+ ref: startGrip,
236
+ style: normalizeStyle(startStyles.value.grip)
237
+ }, [
238
+ createElementVNode("div", {
239
+ style: normalizeStyle(startStyles.value.bar)
240
+ }, null, 4),
241
+ createElementVNode("div", {
242
+ style: normalizeStyle(startStyles.value.head)
243
+ }, null, 4)
244
+ ], 4)) : createCommentVNode("", true),
245
+ endStyles.value ? (openBlock(), createElementBlock("div", {
246
+ key: 1,
247
+ ref_key: "endGrip",
248
+ ref: endGrip,
249
+ style: normalizeStyle(endStyles.value.grip)
250
+ }, [
251
+ createElementVNode("div", {
252
+ style: normalizeStyle(endStyles.value.bar)
253
+ }, null, 4),
254
+ createElementVNode("div", {
255
+ style: normalizeStyle(endStyles.value.head)
256
+ }, null, 4)
257
+ ], 4)) : createCommentVNode("", true)
258
+ ], 64)) : createCommentVNode("", true);
259
+ };
260
+ }
261
+ });
262
+ const _sfc_main = /* @__PURE__ */ defineComponent({
263
+ __name: "SelectionClipboard",
264
+ props: {
265
+ prefetch: { type: Boolean, default: true },
266
+ target: {}
267
+ },
268
+ emits: ["refused"],
269
+ setup(__props, { emit: __emit }) {
270
+ const props = __props;
271
+ const emit = __emit;
272
+ const selection = useOptionalCapability(SelectionToken);
273
+ watch(
274
+ [selection, () => props.prefetch, () => toValue(props.target)],
275
+ ([lens, prefetch, target], _previous, onCleanup) => {
276
+ if (!lens || props.target !== void 0 && !target) return;
277
+ onCleanup(
278
+ wireSelectionClipboard(lens, {
279
+ prefetch,
280
+ target: target ?? void 0,
281
+ onRefused: () => emit("refused")
282
+ })
283
+ );
284
+ },
285
+ { immediate: true, flush: "post" }
286
+ );
287
+ return (_ctx, _cache) => {
288
+ return null;
289
+ };
290
+ }
291
+ });
292
+ export {
293
+ _sfc_main as _,
294
+ _sfc_main$1 as a,
295
+ _sfc_main$3 as b,
296
+ _sfc_main$2 as c,
297
+ useSelectionEvent as d,
298
+ useSelectionSettings as e,
299
+ useSelectionState as f,
300
+ useSelection as u
301
+ };
302
+ //# sourceMappingURL=SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectionClipboard.vue_vue_type_script_setup_true_lang-C4TUDuyu.js","sources":["../src/selection/composables.ts","../src/selection/SelectionLayer.vue","../src/selection/SelectionMenu.vue","../src/selection/SelectionHandles.vue","../src/selection/SelectionClipboard.vue"],"sourcesContent":["/**\n * The selection composables: `useSelection()` (the API), `useSelectionState()`,\n * `useSelectionSettings()` and `useSelectionEvent()`. App code gets the public\n * lens only; the layers in this folder resolve the host lens themselves.\n */\nimport { SelectionToken, selectionState } from '@embedpdf/plugin-selection';\nimport type { SelectionCapability } from '@embedpdf/plugin-selection';\nimport type { EventHook } from '@embedpdf/core';\nimport { useCapability, useCapabilityEvent } from '../runtime/capabilities';\nimport { settingsComposable, stateComposable } from '../state';\n\n/**\n * The selection API (`select()`, `readText()`, `canCopy()`, …) for your\n * chrome: toolbars, context menus, automation. The object never changes.\n */\nexport function useSelection(): SelectionCapability {\n return useCapability(SelectionToken);\n}\n\n/** Subscribe to one selection event while the component lives: `useSelectionEvent((selection) => selection.onCommitted, handler)`. */\nexport function useSelectionEvent<Event>(\n select: (selection: SelectionCapability) => EventHook<Event>,\n handler: (event: Event) => void,\n): void {\n useCapabilityEvent(SelectionToken, select, handler);\n}\n\n/**\n * The selection's state as refs: whether anything is selected, whether the\n * user is still selecting, the range and the pages it's on (the page's State\n * table, declared once in `selectionState`). With a selector, one ref that\n * updates only when the value it picks changes. The empty state without a\n * document.\n */\nexport const useSelectionState = stateComposable(selectionState);\n\n/** The selection settings (`dragThreshold`, `color`, `handles`), with or without a document, as refs. Takes a selector. */\nexport const useSelectionSettings = settingsComposable(SelectionToken);\n","<!--\n <SelectionLayer>: the highlight of the selected text on one page. It warms\n the page's text geometry when it mounts, reads the selected lines in page\n space and maps each one's four corners to the page's pixels, in the plugin's\n `color` setting, which the `--epdf-text-selection` CSS variable overrides.\n It handles no pointer input: <PagePointerSource> and the interaction hub do.\n-->\n<script setup lang=\"ts\">\nimport { computed, watch } from 'vue';\nimport { shallowEqual } from '@embedpdf/core';\n// The layer is a host of the plugin (geometry warming, the highlight\n// handshake); app code gets the public lens through `useSelection()`.\nimport { SelectionToken as SelectionHostToken } from '@embedpdf/plugin-selection/contract/host';\nimport type { SelectionSegment } from '@embedpdf/plugin-selection';\nimport { mixAccent, paint, quadInPixels, svgPoints } from '@embedpdf/web';\nimport { useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { useViewerSettings } from '../runtime/documents';\nimport { usePage } from '../runtime/page';\nimport { useSelectionSettings } from './composables';\n\nconst NO_SEGMENTS: readonly SelectionSegment[] = Object.freeze([]);\n\nconst page = usePage();\nconst selection = useOptionalCapability(SelectionHostToken);\n// The same list until a line on this page changes.\nconst segments = useOptionalSelector(\n SelectionHostToken,\n (lens) => lens.listSegments(page.value.ref),\n NO_SEGMENTS,\n shallowEqual,\n);\n// Something drawing its own preview of the selection (a markup tool) can take\n// the visual over; then this layer draws nothing, so the two never overlap.\nconst visible = useOptionalSelector(SelectionHostToken, (lens) => lens.isHighlightVisible(), false);\nconst color = useSelectionSettings((settings) => settings.color);\n// An unset color follows the viewer's accent, behind the `--epdf-accent` variable.\nconst accent = useViewerSettings((settings) => settings.accent);\n\n// Warm this page's text geometry as soon as it's on screen, so the first press\n// can hit-test without waiting for the engine. Without permission to select\n// text nothing loads, and nothing is drawn.\nwatch(\n [selection, () => page.value.ref],\n ([lens, pageRef]) => {\n if (lens) void lens.ensureLoaded(pageRef);\n },\n { immediate: true },\n);\n\n// Unset, the color is the accent at 35%, the accent's CSS variables included.\nconst fill = computed(() =>\n paint('text-selection', color.value ?? mixAccent('text-selection', accent.value)),\n);\n\n// Page space to the page layer's pixels, which turn with the page: mapping the\n// four corners is exact, for turned text too.\nconst polygons = computed(() =>\n segments.value.map((segment) => svgPoints(quadInPixels(segment.quad, page.value.transform))),\n);\n</script>\n\n<template>\n <svg\n v-if=\"visible\"\n :style=\"{\n position: 'absolute',\n inset: 0,\n width: '100%',\n height: '100%',\n overflow: 'visible',\n pointerEvents: 'none',\n }\"\n >\n <!-- The fill goes in `style`: an SVG attribute doesn't read var(). -->\n <polygon v-for=\"(points, index) in polygons\" :key=\"index\" :points=\"points\" :style=\"{ fill }\" />\n </svg>\n</template>\n","<!--\n <SelectionMenu>: your content, floating over the selected text. One anchor\n however many pages the selection spans: it sits on the page where the\n selection ends. It shows once the selection settles: hidden while someone\n drags, it appears when the pointer lifts, and a selection made from code\n shows at once. It works in a <Stage>'s #overlay slot and inside a\n <PageView>: the surface provides the projection. For UI that follows the\n drag live, put `<Anchored :anchor>` with `getAnchor()` together yourself.\n-->\n<script setup lang=\"ts\">\nimport { SelectionToken } from '@embedpdf/plugin-selection';\nimport { samePageBounds } from '@embedpdf/web';\nimport type { AnchoredPlacement } from '@embedpdf/web';\nimport Anchored from '../anchored/Anchored.vue';\nimport { useOptionalSelector } from '../runtime/capabilities';\nimport { useSelectionState } from './composables';\n\nwithDefaults(\n defineProps<{\n /** Gap in screen px between the selection and the menu. Default 8. */\n gap?: number;\n /** Where the menu sits around the selection. Default `'top'`. */\n placement?: AnchoredPlacement;\n }>(),\n { gap: 8, placement: 'top' },\n);\n\ndefineSlots<{\n /** The menu: compose it from `useSelection()`, `copySelection`, an annotation call. */\n default?(): unknown;\n}>();\n\nconst selecting = useSelectionState((state) => state.isSelecting);\n// The plugin reads a new anchor object every time: compared by value, so the\n// menu moves only when the selection did.\nconst anchor = useOptionalSelector(\n SelectionToken,\n (selection) => selection.getAnchor(),\n null,\n samePageBounds,\n);\n</script>\n\n<template>\n <Anchored v-if=\"!selecting && anchor\" :anchor=\"anchor\" :placement=\"placement\" :gap=\"gap\">\n <slot />\n </Anchored>\n</template>\n","<!--\n <SelectionHandles>: the grips at the two ends of the selected text, drawn the\n way phones draw them: a thin caret bar that is the selection's own start or\n end edge (so turned text and turned pages carry the grip with them), capped\n by a circle that keeps its size on screen, above the first line at the start\n and below the last line at the end.\n\n On touch, where nobody drags a caret, the grips are how a selection grows or\n shrinks: a long press selects a word, then each grip extends from the other\n end, snapping to glyphs and crossing pages exactly like a pointer drag, so\n highlights, menus and the commit event all behave the same. Mount it in the\n <Stage>'s #overlay slot next to <SelectionMenu>; elsewhere it draws nothing\n (a <PageView> has no camera to project through). Grabbing a grip never pans\n the Stage. Painted in the plugin's `handles` setting, which the\n `--epdf-text-selection-handle` and `--epdf-text-selection-handle-shadow` CSS\n variables override.\n\n What it draws is the plugin's (the view over the Stage, the endpoints,\n `selectionHandleGeom`, the armed drag) and how a grip follows the pointer is\n `@embedpdf/web`'s (`attachSelectionHandle`);\n this component keeps what only Vue does: the subscriptions and the markup.\n-->\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport type { CSSProperties } from 'vue';\nimport {\n HANDLE_BAR,\n HANDLE_HEAD,\n HANDLE_PAD,\n armSelectionHandle,\n selectionHandleEndpointsOf,\n selectionHandleGeom,\n selectionHandleViewOf,\n} from '@embedpdf/plugin-selection';\nimport { SelectionToken as SelectionHostToken } from '@embedpdf/plugin-selection/contract/host';\nimport { attachSelectionHandle, paint, sameSelectionEndpoints } from '@embedpdf/web';\nimport { useOptionalProjectorBinding } from '../anchored/projector';\nimport { devWarn } from '../dev';\nimport { useCapability, useOptionalCapability, useOptionalSelector } from '../runtime/capabilities';\nimport { useViewerSettings } from '../runtime/documents';\nimport { useKernelValue } from '../runtime/kernel';\nimport { useStageToken } from '../stage/scope';\nimport type { StageTokenProp } from '../stage/scope';\nimport { useSelectionSettings, useSelectionState } from './composables';\n\ntype Role = 'start' | 'end';\n\nconst props = defineProps<{\n /** The stage view this overlay belongs to. Default: the enclosing `<Stage>`'s. */\n token?: StageTokenProp;\n}>();\n\nconst token = useStageToken(() => props.token);\nconst host = useCapability(SelectionHostToken);\nconst stage = useOptionalCapability(token);\n\n// Outside a Stage there is no camera to project through: say so, rather than\n// drawing nothing without a word.\nconst surface = useOptionalProjectorBinding();\nif (!surface || surface.value.projector.space !== 'overlay') {\n devWarn(\n 'selection-handles-outside-stage',\n '<SelectionHandles> renders nothing here: mount it in the <Stage> #overlay slot ' +\n '(a <PageView> has no camera to project the handles through).',\n );\n}\n\nconst selecting = useSelectionState((state) => state.isSelecting);\nconst visible = useOptionalSelector(SelectionHostToken, (lens) => lens.isHighlightVisible(), false);\nconst handles = useSelectionSettings((settings) => settings.handles);\nconst accent = useViewerSettings((settings) => settings.accent);\nconst endpoints = useOptionalSelector(\n SelectionHostToken,\n (lens) => selectionHandleEndpointsOf(lens.getSnapshot()),\n null,\n sameSelectionEndpoints,\n);\n// The grips are placed by projecting the endpoints through the camera, so they\n// follow every camera move. The visible pages are the stage's one value for\n// that (the pages move on it too, so grip and highlight move in one frame).\nconst camera = useKernelValue(() => stage.value?.listVisiblePages() ?? null);\nconst dragging = ref<Role | null>(null);\n\n/** Where each grip goes, in the overlay's pixels; null for one whose page isn't laid out. */\nconst geometry = computed(() => {\n void camera.value;\n const lens = stage.value;\n const ends = endpoints.value;\n if (!lens || !ends) return null;\n const view = selectionHandleViewOf(lens);\n return {\n start: selectionHandleGeom(view, ends.start, 'start'),\n end: selectionHandleGeom(view, ends.end, 'end'),\n };\n});\n\n// Hidden while a pointer drag selects (like the menu), but a grip drag is a\n// selection gesture too, and keeps its grips.\nconst shown = computed(\n () => geometry.value !== null && visible.value && (!selecting.value || dragging.value !== null),\n);\n\n// Each is its CSS variable first, then the setting; an unset color is the accent.\nconst color = computed(() => paint('text-selection-handle', handles.value.color ?? accent.value));\nconst shadow = computed(() => paint('text-selection-handle-shadow', handles.value.shadow));\n\n/**\n * One grip's three boxes. The grip is laid out upright in its own frame (a bar\n * the edge's length, the head above it at the start, below it at the end),\n * then turned onto the projected edge about the bar's ascent tip, the one\n * point that must land exactly on the glyph's corner.\n */\nfunction gripStyles(role: Role): Record<'grip' | 'bar' | 'head', CSSProperties> | null {\n const grip = geometry.value?.[role];\n if (!grip) return null;\n const barTop = HANDLE_PAD + (role === 'start' ? HANDLE_HEAD : 0);\n const pivotX = HANDLE_PAD + HANDLE_BAR / 2;\n return {\n grip: {\n position: 'absolute',\n left: `${grip.bar.from.x - pivotX}px`,\n top: `${grip.bar.from.y - barTop}px`,\n width: `${HANDLE_BAR + 2 * HANDLE_PAD}px`,\n height: `${grip.length + HANDLE_HEAD + 2 * HANDLE_PAD}px`,\n // Upright text carries no transform: pixel-identical to an axis-aligned box.\n ...(grip.upright\n ? {}\n : { transform: `rotate(${grip.rotation}deg)`, transformOrigin: `${pivotX}px ${barTop}px` }),\n touchAction: 'none',\n cursor: 'grab',\n pointerEvents: 'auto',\n },\n // The caret bar: the selection's own edge, the glyph's ink height at any tilt.\n bar: {\n position: 'absolute',\n left: `${HANDLE_PAD}px`,\n top: `${barTop}px`,\n width: `${HANDLE_BAR}px`,\n height: `${grip.length}px`,\n background: color.value,\n borderRadius: `${HANDLE_BAR / 2}px`,\n },\n // The head, flush against the bar: past the ascent at the start, past the\n // baseline at the end, in the text's frame.\n head: {\n position: 'absolute',\n left: `${pivotX - HANDLE_HEAD / 2}px`,\n top: `${role === 'start' ? HANDLE_PAD : HANDLE_PAD + grip.length}px`,\n width: `${HANDLE_HEAD}px`,\n height: `${HANDLE_HEAD}px`,\n borderRadius: '50%',\n background: color.value,\n boxShadow: shadow.value,\n },\n };\n}\n\nconst startStyles = computed(() => gripStyles('start'));\nconst endStyles = computed(() => gripStyles('end'));\n\n/**\n * Arm a grip drag at the press. It reads the stage and the endpoints as they\n * are now, never as they were when the listener was attached.\n */\nfunction arm(role: Role) {\n const lens = stage.value;\n const ends = endpoints.value;\n if (!lens || !ends) return null;\n const armed = armSelectionHandle(host, selectionHandleViewOf(lens), ends, role);\n if (!armed) return null;\n dragging.value = role;\n return {\n // The point the user grabbed: the bar's midpoint.\n base: armed.base,\n session: {\n move: armed.drag.move,\n end: () => {\n armed.drag.end(); // the selection settles: the menu comes back, the commit event fires\n dragging.value = null;\n },\n },\n };\n}\n\nconst startGrip = ref<HTMLDivElement | null>(null);\nconst endGrip = ref<HTMLDivElement | null>(null);\n// The press is taken with a native listener on the grip itself, so the Stage\n// never sees it; a grip that remounts is bound again.\nfor (const [role, element] of [\n ['start', startGrip],\n ['end', endGrip],\n] as const) {\n watch(\n element,\n (grip, _previous, onCleanup) => {\n if (grip) onCleanup(attachSelectionHandle(grip, { arm: () => arm(role) }));\n },\n { flush: 'post' },\n );\n}\n</script>\n\n<template>\n <template v-if=\"shown\">\n <div v-if=\"startStyles\" ref=\"startGrip\" :style=\"startStyles.grip\">\n <div :style=\"startStyles.bar\" />\n <div :style=\"startStyles.head\" />\n </div>\n <div v-if=\"endStyles\" ref=\"endGrip\" :style=\"endStyles.grip\">\n <div :style=\"endStyles.bar\" />\n <div :style=\"endStyles.head\" />\n </div>\n </template>\n</template>\n","<!--\n <SelectionClipboard>: mount once per viewer to wire copying the selected\n text. It fetches the text when the selection settles, answers the browser's\n `copy` event at once, and falls back to the Clipboard API for Ctrl+C / Cmd+C\n when the page has no selection of its own. A selection the user may not\n copy isn't copied, and it emits `refused`. It draws nothing, and wires\n nothing until a document is ready. For a Copy button, call\n `copySelection(useSelection())` from its click handler instead.\n-->\n<script setup lang=\"ts\">\nimport { toValue, watch, type MaybeRefOrGetter } from 'vue';\nimport { SelectionToken } from '@embedpdf/plugin-selection';\nimport { wireSelectionClipboard } from '@embedpdf/web';\nimport { useOptionalCapability } from '../runtime/capabilities';\n\n// A boolean prop left out is `false` in Vue: the default says `true` itself.\nconst props = withDefaults(\n defineProps<{\n /**\n * Fetch the selected text as soon as the selection settles (default true).\n * The browser's `copy` event must be answered at once, so without it only\n * Ctrl+C / Cmd+C copies, a moment later.\n */\n prefetch?: boolean;\n /**\n * Copy only while focus is inside this element (a template ref), for a\n * page with more than one viewer. Copying works once it has mounted.\n * Default: anywhere on the page.\n */\n target?: MaybeRefOrGetter<HTMLElement | null | undefined>;\n }>(),\n { prefetch: true },\n);\nconst emit = defineEmits<{\n /** Ctrl+C or the Copy menu met a selection the user may not copy: say so. */\n refused: [];\n}>();\n\nconst selection = useOptionalCapability(SelectionToken);\n// Wired again for another document, or when `prefetch` or `target` changes.\nwatch(\n [selection, () => props.prefetch, () => toValue(props.target)],\n ([lens, prefetch, target], _previous, onCleanup) => {\n // A target that hasn't mounted yet wires nothing; its ref being set runs this again.\n if (!lens || (props.target !== undefined && !target)) return;\n onCleanup(\n wireSelectionClipboard(lens, {\n prefetch,\n target: target ?? undefined,\n onRefused: () => emit('refused'),\n }),\n );\n },\n { immediate: true, flush: 'post' },\n);\n</script>\n\n<template></template>\n"],"names":["SelectionHostToken","_unref","_openBlock","_createElementBlock","_Fragment","_renderList","_createBlock","Anchored","_renderSlot","_normalizeStyle","_createElementVNode"],"mappings":";;;;;;;;;;;;;AAeO,SAAS,eAAoC;AAClD,SAAO,cAAc,cAAc;AACrC;AAGO,SAAS,kBACd,QACA,SACM;AACN,qBAAmB,gBAAgB,QAAQ,OAAO;AACpD;AASO,MAAM,oBAAoB,gBAAgB,cAAc;AAGxD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