@embedpdf/react 3.0.0-next.14 → 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 (244) hide show
  1. package/dist/AnnotationList-DcyhF2kU-CiBFOq1z.d.cts +878 -0
  2. package/dist/AnnotationList-DcyhF2kU-CiBFOq1z.d.ts +878 -0
  3. package/dist/actions.cjs +25 -5
  4. package/dist/actions.cjs.map +1 -1
  5. package/dist/actions.d.cts +18 -5
  6. package/dist/actions.d.ts +18 -5
  7. package/dist/actions.js +22 -6
  8. package/dist/actions.js.map +1 -1
  9. package/dist/anchored-DeX95xSd.d.ts +85 -0
  10. package/dist/anchored-DzN3JywS.d.cts +85 -0
  11. package/dist/anchored.cjs +71 -28
  12. package/dist/anchored.cjs.map +1 -1
  13. package/dist/anchored.d.cts +2 -45
  14. package/dist/anchored.d.ts +2 -45
  15. package/dist/anchored.js +56 -19
  16. package/dist/anchored.js.map +1 -1
  17. package/dist/annotation-3UvABfJm.d.cts +305 -0
  18. package/dist/annotation-BNHQpMKv.cjs +806 -0
  19. package/dist/annotation-BNHQpMKv.cjs.map +1 -0
  20. package/dist/annotation-CDI8CFb3.js +684 -0
  21. package/dist/annotation-CDI8CFb3.js.map +1 -0
  22. package/dist/annotation-DhEfs0pH.d.ts +305 -0
  23. package/dist/annotation.cjs +20 -784
  24. package/dist/annotation.d.cts +2 -2
  25. package/dist/annotation.d.ts +2 -2
  26. package/dist/annotation.js +2 -769
  27. package/dist/attachment.cjs +39 -0
  28. package/dist/attachment.cjs.map +1 -0
  29. package/dist/attachment.d.cts +29 -0
  30. package/dist/attachment.d.ts +29 -0
  31. package/dist/attachment.js +28 -0
  32. package/dist/attachment.js.map +1 -0
  33. package/dist/commands.cjs +68 -28
  34. package/dist/commands.cjs.map +1 -1
  35. package/dist/commands.d.cts +37 -10
  36. package/dist/commands.d.ts +37 -10
  37. package/dist/commands.js +68 -31
  38. package/dist/commands.js.map +1 -1
  39. package/dist/form-BSGvjA5D.js +511 -0
  40. package/dist/form-BSGvjA5D.js.map +1 -0
  41. package/dist/form-BgztZyOK.cjs +548 -0
  42. package/dist/form-BgztZyOK.cjs.map +1 -0
  43. package/dist/form.cjs +5 -5
  44. package/dist/form.d.cts +41 -2
  45. package/dist/form.d.ts +41 -2
  46. package/dist/form.js +2 -3
  47. package/dist/history.cjs +38 -0
  48. package/dist/history.cjs.map +1 -0
  49. package/dist/history.d.cts +27 -0
  50. package/dist/history.d.ts +27 -0
  51. package/dist/history.js +27 -0
  52. package/dist/history.js.map +1 -0
  53. package/dist/i18n.cjs +26 -30
  54. package/dist/i18n.cjs.map +1 -1
  55. package/dist/i18n.d.cts +24 -21
  56. package/dist/i18n.d.ts +24 -21
  57. package/dist/i18n.js +24 -31
  58. package/dist/i18n.js.map +1 -1
  59. package/dist/index.cjs +227 -57
  60. package/dist/index.d.cts +35 -32
  61. package/dist/index.d.ts +35 -32
  62. package/dist/index.js +36 -30
  63. package/dist/inert-CmBEbKCn.cjs +19 -0
  64. package/dist/inert-CmBEbKCn.cjs.map +1 -0
  65. package/dist/inert-D8fkennb.js +14 -0
  66. package/dist/inert-D8fkennb.js.map +1 -0
  67. package/dist/interaction.cjs +48 -102
  68. package/dist/interaction.cjs.map +1 -1
  69. package/dist/interaction.d.cts +23 -32
  70. package/dist/interaction.d.ts +23 -32
  71. package/dist/interaction.js +33 -102
  72. package/dist/interaction.js.map +1 -1
  73. package/dist/link.cjs +65 -104
  74. package/dist/link.cjs.map +1 -1
  75. package/dist/link.d.cts +21 -16
  76. package/dist/link.d.ts +22 -17
  77. package/dist/link.js +67 -107
  78. package/dist/link.js.map +1 -1
  79. package/dist/measurement.cjs +36 -11
  80. package/dist/measurement.cjs.map +1 -1
  81. package/dist/measurement.d.cts +33 -7
  82. package/dist/measurement.d.ts +33 -7
  83. package/dist/measurement.js +35 -14
  84. package/dist/measurement.js.map +1 -1
  85. package/dist/metadata.cjs +20 -7
  86. package/dist/metadata.cjs.map +1 -1
  87. package/dist/metadata.d.cts +22 -7
  88. package/dist/metadata.d.ts +22 -7
  89. package/dist/metadata.js +20 -10
  90. package/dist/metadata.js.map +1 -1
  91. package/dist/outline.cjs +39 -0
  92. package/dist/outline.cjs.map +1 -0
  93. package/dist/outline.d.cts +31 -0
  94. package/dist/outline.d.ts +31 -0
  95. package/dist/outline.js +28 -0
  96. package/dist/outline.js.map +1 -0
  97. package/dist/page-edit.cjs +15 -3
  98. package/dist/page-edit.cjs.map +1 -1
  99. package/dist/page-edit.d.cts +17 -2
  100. package/dist/page-edit.d.ts +17 -2
  101. package/dist/page-edit.js +15 -5
  102. package/dist/page-edit.js.map +1 -1
  103. package/dist/page-layers-Bkaaz8Zf.js +26 -0
  104. package/dist/page-layers-Bkaaz8Zf.js.map +1 -0
  105. package/dist/page-layers-BloZDoOV.cjs +37 -0
  106. package/dist/page-layers-BloZDoOV.cjs.map +1 -0
  107. package/dist/page-view.cjs +89 -82
  108. package/dist/page-view.cjs.map +1 -1
  109. package/dist/page-view.d.cts +14 -7
  110. package/dist/page-view.d.ts +18 -11
  111. package/dist/page-view.js +86 -81
  112. package/dist/page-view.js.map +1 -1
  113. package/dist/redaction.cjs +30 -15
  114. package/dist/redaction.cjs.map +1 -1
  115. package/dist/redaction.d.cts +27 -9
  116. package/dist/redaction.d.ts +27 -9
  117. package/dist/redaction.js +29 -18
  118. package/dist/redaction.js.map +1 -1
  119. package/dist/render.cjs +71 -46
  120. package/dist/render.cjs.map +1 -1
  121. package/dist/render.d.cts +17 -5
  122. package/dist/render.d.ts +17 -5
  123. package/dist/render.js +70 -49
  124. package/dist/render.js.map +1 -1
  125. package/dist/runtime-BfnpyfY0.cjs +556 -0
  126. package/dist/runtime-BfnpyfY0.cjs.map +1 -0
  127. package/dist/runtime-DBEBlpQV.d.cts +237 -0
  128. package/dist/runtime-V3MVMb91.d.ts +237 -0
  129. package/dist/runtime-tD5iJU83.js +399 -0
  130. package/dist/runtime-tD5iJU83.js.map +1 -0
  131. package/dist/runtime.cjs +45 -324
  132. package/dist/runtime.d.cts +2 -2
  133. package/dist/runtime.d.ts +2 -2
  134. package/dist/runtime.js +2 -306
  135. package/dist/search.cjs +81 -50
  136. package/dist/search.cjs.map +1 -1
  137. package/dist/search.d.cts +37 -24
  138. package/dist/search.d.ts +37 -24
  139. package/dist/search.js +81 -53
  140. package/dist/search.js.map +1 -1
  141. package/dist/selection.cjs +105 -108
  142. package/dist/selection.cjs.map +1 -1
  143. package/dist/selection.d.cts +54 -26
  144. package/dist/selection.d.ts +56 -28
  145. package/dist/selection.js +103 -110
  146. package/dist/selection.js.map +1 -1
  147. package/dist/shell.cjs +36 -21
  148. package/dist/shell.cjs.map +1 -1
  149. package/dist/shell.d.cts +32 -17
  150. package/dist/shell.d.ts +32 -17
  151. package/dist/shell.js +36 -24
  152. package/dist/shell.js.map +1 -1
  153. package/dist/signature.cjs +29 -48
  154. package/dist/signature.cjs.map +1 -1
  155. package/dist/signature.d.cts +26 -26
  156. package/dist/signature.d.ts +26 -26
  157. package/dist/signature.js +30 -48
  158. package/dist/signature.js.map +1 -1
  159. package/dist/stage-B7BG2e8Q.cjs +369 -0
  160. package/dist/stage-B7BG2e8Q.cjs.map +1 -0
  161. package/dist/stage-BqfBjDu6.js +302 -0
  162. package/dist/stage-BqfBjDu6.js.map +1 -0
  163. package/dist/stage-ByFPD-Fv.d.cts +117 -0
  164. package/dist/stage-DaboaheR.d.ts +117 -0
  165. package/dist/stage-scope-CQgCuf1w.cjs +46 -0
  166. package/dist/stage-scope-CQgCuf1w.cjs.map +1 -0
  167. package/dist/stage-scope-D7ZeNduT.js +23 -0
  168. package/dist/stage-scope-D7ZeNduT.js.map +1 -0
  169. package/dist/stage.cjs +12 -235
  170. package/dist/stage.d.cts +2 -116
  171. package/dist/stage.d.ts +2 -116
  172. package/dist/stage.js +3 -228
  173. package/dist/stamp.cjs +41 -35
  174. package/dist/stamp.cjs.map +1 -1
  175. package/dist/stamp.d.cts +25 -18
  176. package/dist/stamp.d.ts +25 -18
  177. package/dist/stamp.js +40 -37
  178. package/dist/stamp.js.map +1 -1
  179. package/dist/state-0K1I5cM4.d.cts +29 -0
  180. package/dist/state-0K1I5cM4.d.ts +29 -0
  181. package/dist/state-CzI2KlZb.js +62 -0
  182. package/dist/state-CzI2KlZb.js.map +1 -0
  183. package/dist/state-Dtf8HAue.cjs +73 -0
  184. package/dist/state-Dtf8HAue.cjs.map +1 -0
  185. package/dist/svg-shapes-Dm1yTR1b.js +40 -0
  186. package/dist/svg-shapes-Dm1yTR1b.js.map +1 -0
  187. package/dist/svg-shapes-zo0GNkc9.cjs +53 -0
  188. package/dist/svg-shapes-zo0GNkc9.cjs.map +1 -0
  189. package/dist/toolbar.cjs +297 -295
  190. package/dist/toolbar.cjs.map +1 -1
  191. package/dist/toolbar.d.cts +58 -68
  192. package/dist/toolbar.d.ts +67 -77
  193. package/dist/toolbar.js +271 -293
  194. package/dist/toolbar.js.map +1 -1
  195. package/dist/view-manager.cjs +34 -0
  196. package/dist/view-manager.cjs.map +1 -0
  197. package/dist/view-manager.d.cts +21 -0
  198. package/dist/view-manager.d.ts +21 -0
  199. package/dist/view-manager.js +23 -0
  200. package/dist/view-manager.js.map +1 -0
  201. package/package.json +47 -39
  202. package/dist/annotation-BCED_p9H.d.cts +0 -160
  203. package/dist/annotation-anchors-CetwM1g7.js +0 -15
  204. package/dist/annotation-anchors-CetwM1g7.js.map +0 -1
  205. package/dist/annotation-anchors-DuYRBJLl.cjs +0 -26
  206. package/dist/annotation-anchors-DuYRBJLl.cjs.map +0 -1
  207. package/dist/annotation-hooks-BB5ZhPpf.cjs +0 -16
  208. package/dist/annotation-hooks-BB5ZhPpf.cjs.map +0 -1
  209. package/dist/annotation-hooks-Df8EmzDO.js +0 -11
  210. package/dist/annotation-hooks-Df8EmzDO.js.map +0 -1
  211. package/dist/annotation-k38KDlIZ.d.ts +0 -160
  212. package/dist/annotation-menu.cjs +0 -64
  213. package/dist/annotation-menu.cjs.map +0 -1
  214. package/dist/annotation-menu.d.cts +0 -33
  215. package/dist/annotation-menu.d.ts +0 -33
  216. package/dist/annotation-menu.js +0 -48
  217. package/dist/annotation-menu.js.map +0 -1
  218. package/dist/annotation.cjs.map +0 -1
  219. package/dist/annotation.js.map +0 -1
  220. package/dist/form-BVumS7up.cjs +0 -926
  221. package/dist/form-BVumS7up.cjs.map +0 -1
  222. package/dist/form-Bdjk0Z3T.d.cts +0 -537
  223. package/dist/form-CK3mp99m.js +0 -895
  224. package/dist/form-CK3mp99m.js.map +0 -1
  225. package/dist/form-CYRYgthn.d.ts +0 -537
  226. package/dist/rolldown-runtime-BBjsoOtd.js +0 -27
  227. package/dist/runtime-DE76hlnl.d.ts +0 -216
  228. package/dist/runtime-umHA_xHt.d.cts +0 -216
  229. package/dist/runtime.cjs.map +0 -1
  230. package/dist/runtime.js.map +0 -1
  231. package/dist/scrollbar.cjs +0 -241
  232. package/dist/scrollbar.cjs.map +0 -1
  233. package/dist/scrollbar.d.cts +0 -42
  234. package/dist/scrollbar.d.ts +0 -42
  235. package/dist/scrollbar.js +0 -213
  236. package/dist/scrollbar.js.map +0 -1
  237. package/dist/stage.cjs.map +0 -1
  238. package/dist/stage.js.map +0 -1
  239. package/dist/views.cjs +0 -35
  240. package/dist/views.cjs.map +0 -1
  241. package/dist/views.d.cts +0 -21
  242. package/dist/views.d.ts +0 -21
  243. package/dist/views.js +0 -27
  244. package/dist/views.js.map +0 -1
@@ -1,15 +0,0 @@
1
- //#region src/annotation-anchors.ts
2
- function sameAnchor(a, b) {
3
- if (a === b) return true;
4
- if (!a || !b) return false;
5
- return a.pon === b.pon && a.bounds.x === b.bounds.x && a.bounds.y === b.bounds.y && a.bounds.width === b.bounds.width && a.bounds.height === b.bounds.height && a.knob?.x === b.knob?.x && a.knob?.y === b.knob?.y;
6
- }
7
- function sameCreationDraftAnchor(a, b) {
8
- if (a === b) return true;
9
- if (!a || !b) return false;
10
- return a.kind === b.kind && a.subtype === b.subtype && a.pon === b.pon && a.pointCount === b.pointCount && a.minPoints === b.minPoints && a.canFinish === b.canFinish && a.bounds.x === b.bounds.x && a.bounds.y === b.bounds.y && a.bounds.width === b.bounds.width && a.bounds.height === b.bounds.height;
11
- }
12
- //#endregion
13
- export { sameCreationDraftAnchor as n, sameAnchor as t };
14
-
15
- //# sourceMappingURL=annotation-anchors-CetwM1g7.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-anchors-CetwM1g7.js","names":[],"sources":["../src/annotation-anchors.ts"],"sourcesContent":["import type { CreationDraftAnchor, Rect, Vec } from '@embedpdf/core-annotation';\n\n/** The selection's menu anchor on its primary page, in content space. */\nexport type SelectionAnchor = { pon: number; bounds: Rect; knob?: Vec };\n\nexport function sameAnchor(a: SelectionAnchor | null, b: SelectionAnchor | null): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return (\n a.pon === b.pon &&\n a.bounds.x === b.bounds.x &&\n a.bounds.y === b.bounds.y &&\n a.bounds.width === b.bounds.width &&\n a.bounds.height === b.bounds.height &&\n a.knob?.x === b.knob?.x &&\n a.knob?.y === b.knob?.y\n );\n}\n\nexport function sameCreationDraftAnchor(\n a: CreationDraftAnchor | null,\n b: CreationDraftAnchor | null,\n): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return (\n a.kind === b.kind &&\n a.subtype === b.subtype &&\n a.pon === b.pon &&\n a.pointCount === b.pointCount &&\n a.minPoints === b.minPoints &&\n a.canFinish === b.canFinish &&\n a.bounds.x === b.bounds.x &&\n a.bounds.y === b.bounds.y &&\n a.bounds.width === b.bounds.width &&\n a.bounds.height === b.bounds.height\n );\n}\n"],"mappings":";AAKA,SAAgB,WAAW,GAA2B,GAAoC;CACxF,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,OACE,EAAE,QAAQ,EAAE,OACZ,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,UAAU,EAAE,OAAO,SAC5B,EAAE,OAAO,WAAW,EAAE,OAAO,UAC7B,EAAE,MAAM,MAAM,EAAE,MAAM,KACtB,EAAE,MAAM,MAAM,EAAE,MAAM;AAE1B;AAEA,SAAgB,wBACd,GACA,GACS;CACT,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,OACE,EAAE,SAAS,EAAE,QACb,EAAE,YAAY,EAAE,WAChB,EAAE,QAAQ,EAAE,OACZ,EAAE,eAAe,EAAE,cACnB,EAAE,cAAc,EAAE,aAClB,EAAE,cAAc,EAAE,aAClB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,UAAU,EAAE,OAAO,SAC5B,EAAE,OAAO,WAAW,EAAE,OAAO;AAEjC"}
@@ -1,26 +0,0 @@
1
- //#region src/annotation-anchors.ts
2
- function sameAnchor(a, b) {
3
- if (a === b) return true;
4
- if (!a || !b) return false;
5
- return a.pon === b.pon && a.bounds.x === b.bounds.x && a.bounds.y === b.bounds.y && a.bounds.width === b.bounds.width && a.bounds.height === b.bounds.height && a.knob?.x === b.knob?.x && a.knob?.y === b.knob?.y;
6
- }
7
- function sameCreationDraftAnchor(a, b) {
8
- if (a === b) return true;
9
- if (!a || !b) return false;
10
- return a.kind === b.kind && a.subtype === b.subtype && a.pon === b.pon && a.pointCount === b.pointCount && a.minPoints === b.minPoints && a.canFinish === b.canFinish && a.bounds.x === b.bounds.x && a.bounds.y === b.bounds.y && a.bounds.width === b.bounds.width && a.bounds.height === b.bounds.height;
11
- }
12
- //#endregion
13
- Object.defineProperty(exports, "sameAnchor", {
14
- enumerable: true,
15
- get: function() {
16
- return sameAnchor;
17
- }
18
- });
19
- Object.defineProperty(exports, "sameCreationDraftAnchor", {
20
- enumerable: true,
21
- get: function() {
22
- return sameCreationDraftAnchor;
23
- }
24
- });
25
-
26
- //# sourceMappingURL=annotation-anchors-DuYRBJLl.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-anchors-DuYRBJLl.cjs","names":[],"sources":["../src/annotation-anchors.ts"],"sourcesContent":["import type { CreationDraftAnchor, Rect, Vec } from '@embedpdf/core-annotation';\n\n/** The selection's menu anchor on its primary page, in content space. */\nexport type SelectionAnchor = { pon: number; bounds: Rect; knob?: Vec };\n\nexport function sameAnchor(a: SelectionAnchor | null, b: SelectionAnchor | null): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return (\n a.pon === b.pon &&\n a.bounds.x === b.bounds.x &&\n a.bounds.y === b.bounds.y &&\n a.bounds.width === b.bounds.width &&\n a.bounds.height === b.bounds.height &&\n a.knob?.x === b.knob?.x &&\n a.knob?.y === b.knob?.y\n );\n}\n\nexport function sameCreationDraftAnchor(\n a: CreationDraftAnchor | null,\n b: CreationDraftAnchor | null,\n): boolean {\n if (a === b) return true;\n if (!a || !b) return false;\n return (\n a.kind === b.kind &&\n a.subtype === b.subtype &&\n a.pon === b.pon &&\n a.pointCount === b.pointCount &&\n a.minPoints === b.minPoints &&\n a.canFinish === b.canFinish &&\n a.bounds.x === b.bounds.x &&\n a.bounds.y === b.bounds.y &&\n a.bounds.width === b.bounds.width &&\n a.bounds.height === b.bounds.height\n );\n}\n"],"mappings":";AAKA,SAAgB,WAAW,GAA2B,GAAoC;CACxF,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,OACE,EAAE,QAAQ,EAAE,OACZ,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,UAAU,EAAE,OAAO,SAC5B,EAAE,OAAO,WAAW,EAAE,OAAO,UAC7B,EAAE,MAAM,MAAM,EAAE,MAAM,KACtB,EAAE,MAAM,MAAM,EAAE,MAAM;AAE1B;AAEA,SAAgB,wBACd,GACA,GACS;CACT,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO;CACrB,OACE,EAAE,SAAS,EAAE,QACb,EAAE,YAAY,EAAE,WAChB,EAAE,QAAQ,EAAE,OACZ,EAAE,eAAe,EAAE,cACnB,EAAE,cAAc,EAAE,aAClB,EAAE,cAAc,EAAE,aAClB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,MAAM,EAAE,OAAO,KACxB,EAAE,OAAO,UAAU,EAAE,OAAO,SAC5B,EAAE,OAAO,WAAW,EAAE,OAAO;AAEjC"}
@@ -1,16 +0,0 @@
1
- const require_runtime = require("./runtime.cjs");
2
- let _embedpdf_plugin_annotation_contract = require("@embedpdf/plugin-annotation/contract");
3
- //#region src/annotation-hooks.ts
4
- /** The selected annotations as engine DTOs — for selection-aware toolbars/sidebars. */
5
- function useAnnotationSelected() {
6
- return require_runtime.useSelector(_embedpdf_plugin_annotation_contract.AnnotationToken, (c) => c.getSelected(), require_runtime.shallowArray);
7
- }
8
- //#endregion
9
- Object.defineProperty(exports, "useAnnotationSelected", {
10
- enumerable: true,
11
- get: function() {
12
- return useAnnotationSelected;
13
- }
14
- });
15
-
16
- //# sourceMappingURL=annotation-hooks-BB5ZhPpf.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-hooks-BB5ZhPpf.cjs","names":["useSelector","AnnotationToken","shallowArray"],"sources":["../src/annotation-hooks.ts"],"sourcesContent":["import { AnnotationToken } from '@embedpdf/plugin-annotation/contract';\n\nimport { shallowArray, useSelector } from './runtime';\n\n/** The selected annotations as engine DTOs — for selection-aware toolbars/sidebars. */\nexport function useAnnotationSelected() {\n return useSelector(AnnotationToken, (c) => c.getSelected(), shallowArray);\n}\n"],"mappings":";;;;AAKA,SAAgB,wBAAwB;CACtC,OAAOA,gBAAAA,YAAYC,qCAAAA,kBAAkB,MAAM,EAAE,YAAY,GAAGC,gBAAAA,YAAY;AAC1E"}
@@ -1,11 +0,0 @@
1
- import { shallowArray, useSelector } from "./runtime.js";
2
- import { AnnotationToken } from "@embedpdf/plugin-annotation/contract";
3
- //#region src/annotation-hooks.ts
4
- /** The selected annotations as engine DTOs — for selection-aware toolbars/sidebars. */
5
- function useAnnotationSelected() {
6
- return useSelector(AnnotationToken, (c) => c.getSelected(), shallowArray);
7
- }
8
- //#endregion
9
- export { useAnnotationSelected as t };
10
-
11
- //# sourceMappingURL=annotation-hooks-Df8EmzDO.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-hooks-Df8EmzDO.js","names":[],"sources":["../src/annotation-hooks.ts"],"sourcesContent":["import { AnnotationToken } from '@embedpdf/plugin-annotation/contract';\n\nimport { shallowArray, useSelector } from './runtime';\n\n/** The selected annotations as engine DTOs — for selection-aware toolbars/sidebars. */\nexport function useAnnotationSelected() {\n return useSelector(AnnotationToken, (c) => c.getSelected(), shallowArray);\n}\n"],"mappings":";;;;AAKA,SAAgB,wBAAwB;CACtC,OAAO,YAAY,kBAAkB,MAAM,EAAE,YAAY,GAAG,YAAY;AAC1E"}
@@ -1,160 +0,0 @@
1
- import { d as runtime_d_exports, o as PageContextValue } from "./runtime-DE76hlnl.js";
2
- import * as React from "react";
3
- import { AnnotationHydration, AnnotationRef, Behavior, CommentThread, CommentsApi, FilePickerProvider, SelectionFlags, SelectionFlags as SelectionFlags$1, SelectionProps, SelectionProps as SelectionProps$1 } from "@embedpdf/plugin-annotation";
4
- import { AnnotationFlags, AnnotationProps, AnnotationProps as AnnotationProps$1, AnnotationPropsPatch, Border, CreationDraftAnchor, CreationDraftAnchor as CreationDraftAnchor$1, Geom, LineEnding, LineEndings, PropKey, PropSpec, Rect, RenderItem, RenderItem as RenderItem$1, Style, TextAlign, TextStyle, Vec } from "@embedpdf/core-annotation";
5
- //#region src/annotation-anchors.d.ts
6
- /** The selection's menu anchor on its primary page, in content space. */
7
- type SelectionAnchor = {
8
- pon: number;
9
- bounds: Rect;
10
- knob?: Vec;
11
- };
12
- declare function sameAnchor(a: SelectionAnchor | null, b: SelectionAnchor | null): boolean;
13
- declare function sameCreationDraftAnchor(a: CreationDraftAnchor | null, b: CreationDraftAnchor | null): boolean;
14
- //#endregion
15
- //#region src/annotation-hooks.d.ts
16
- /** The selected annotations as engine DTOs — for selection-aware toolbars/sidebars. */
17
- declare function useAnnotationSelected(): import("@embedpdf/plugin-annotation").AnnotationDTO[];
18
- //#endregion
19
- //#region src/annotation.d.ts
20
- /**
21
- * What an annotation renderer receives: the projected item (its `box` is LIVE —
22
- * it follows drags), the page context, the engine's baked /AP raster (the
23
- * "picture"), the default visual (`native` — wrap it or ignore it), and
24
- * whether this entry currently OWNS the pointer (`interactive`). While not
25
- * interactive the layer renders your component pointer-locked: the annotation
26
- * stays a first-class citizen of the annotation plane (select/move/resize).
27
- */
28
- interface AnnotationRendererProps {
29
- item: RenderItem;
30
- page: PageContextValue;
31
- appearance: {
32
- url: string;
33
- box: Rect;
34
- } | null;
35
- native: React.ReactNode;
36
- interactive: boolean;
37
- }
38
- /**
39
- * ONE rule: "for THESE annotations, render THIS component, and it owns the
40
- * pointer WHEN …". The two shapes:
41
- *
42
- * - `{ for, component, interactive? }` — your own rule. Without
43
- * `interactive` it is a pure SKIN: pixels only, mechanically
44
- * pointer-locked, the annotation plane keeps selection/move/resize. With
45
- * `interactive` (boolean or live predicate) the layer registers a plugin
46
- * Behavior for you: while it holds, the annotation plane stands down
47
- * (hit-test-inert) and your component owns the input.
48
- * - `{ behavior, component }` — the renderer for a PLUGIN-registered
49
- * behavior (the form plugin's fill controls via `formWidgetRenderer`);
50
- * the plugin decides engagement, never the app.
51
- *
52
- * Resolution: ownership beats skin — an ENGAGED behavior's component is
53
- * authoritative; `for` rules apply only to plane-owned annotations, first
54
- * match wins. Define entries OUTSIDE render (module scope or useMemo): entry
55
- * identity keys the behavior registration.
56
- */
57
- type AnnotationRenderer = {
58
- behavior: string;
59
- component: React.ComponentType<AnnotationRendererProps>;
60
- } | {
61
- /** Stable id for the auto-registered behavior (optional; generated). */
62
- id?: string;
63
- for: Behavior['matches'];
64
- component: React.ComponentType<AnnotationRendererProps>;
65
- interactive?: boolean | (() => boolean);
66
- };
67
- interface AnnotationLayerProps {
68
- /** Annotation renderers — skins and interactive takeovers ({@link AnnotationRenderer}). */
69
- renderers?: AnnotationRenderer[];
70
- }
71
- declare function AnnotationLayer({ renderers }?: AnnotationLayerProps): import("react/jsx-runtime").JSX.Element;
72
- /**
73
- * The default file-picker provider: the built-in file dialog (from
74
- * `@embedpdf/web`), honouring the tool's `accept` filter. This is the ADAPTER
75
- * fulfilling the plugin's DOM-free port — the dialog lives here, in the
76
- * framework layer, never in the plugin. A picked `File` carries its own name
77
- * and mime, so it goes straight through as the engine's file source.
78
- */
79
- declare const filePickerProvider: FilePickerProvider;
80
- /**
81
- * Install the file-picker provider for the active document — the ONE port
82
- * behind every click-then-pick tool (a stamp `'prompt'` source, the file-
83
- * attachment tool). Call ONCE at a document-scoped spot (not inside
84
- * `<AnnotationLayer>`, which is per page). Defaults to
85
- * {@link filePickerProvider}, so a bare `useFilePickerProvider()` makes all of
86
- * them work out of the box; pass a custom provider (asset library, cloud
87
- * drive — switch on `req.subtype` / `req.toolId`) or `null` to make
88
- * click-then-pick tools inert. Cleared on unmount.
89
- */
90
- declare function useFilePickerProvider(provider?: FilePickerProvider | null): void;
91
- declare function useAnnotation(): import("@embedpdf/plugin-annotation").AnnotationCapability;
92
- declare function useAnnotationSelection(): string[];
93
- /**
94
- * A tool's RESOLVED defaults (base + per-tool override) as a full flat props
95
- * bag, subscribed so a `setDefaults` re-renders the consumer. Use this — not the
96
- * imperative `useAnnotation().currentDefaults(id)` — to drive default-editing
97
- * controls, so they reflect changes live. Pair with `propsForTool(id)` for the
98
- * specs to render.
99
- */
100
- declare function useAnnotationDefaults(toolId: string): AnnotationProps;
101
- /**
102
- * The selection's editable properties — ordered specs shared by every selected
103
- * kind, current values, and which keys are mixed. THE hook a property sidebar
104
- * renders from; write back with `useAnnotation().updateSelection({ [key]: v })`.
105
- * Reference-stable between model changes (the capability memoizes by model
106
- * identity), so the default equality is enough.
107
- */
108
- declare function useSelectionProps(): SelectionProps;
109
- /**
110
- * The selection's `/F` annotation flags — per-flag `true`/`false`, `null` where
111
- * the selected annotations disagree (render an indeterminate control), `null`
112
- * overall when nothing is selected. Write back with
113
- * `useAnnotation().updateSelectionFlags({ locked: true })`. Reference-stable
114
- * between model changes, like {@link useSelectionProps}.
115
- */
116
- declare function useSelectionFlags(): SelectionFlags | null;
117
- /**
118
- * A {@link CommentThread} enriched with its page's live display position —
119
- * the framework-layer join. Identity stays `pageObjectNumber` (like every
120
- * annotation surface); these two fields are PRESENTATION, tracking page
121
- * moves and deletes.
122
- */
123
- interface CommentThreadView extends CommentThread {
124
- /** Current 0-based display index of the thread's page; `-1` when the page
125
- * is no longer in the document (one-frame teardown race on delete). */
126
- pageIndex: number;
127
- /** The page's `/PageLabels` label when the PDF declares one ("iv", "A-2"),
128
- * else the 1-based position as a string — print it verbatim. */
129
- pageLabel: string;
130
- /**
131
- * The root annotation's rect in CONTENT space (y-down, crop-relative,
132
- * unscaled points) — the space `StageCapability.reveal` takes, so a
133
- * "jump to this comment" is `stage.reveal(pageIndex, { rect: contentRect })`.
134
- * Null when the page is gone. Identity still travels as `pageObjectNumber`;
135
- * this, like `pageIndex`, is presentation.
136
- */
137
- contentRect: Rect | null;
138
- }
139
- /** Pure join behind {@link useCommentThreads} — exported for tests. */
140
- declare function enrichCommentThreads(threads: readonly CommentThread[], pages: readonly runtime_d_exports.PageLayout[]): CommentThreadView[];
141
- /** The comments surface (verbs + `permissionsFor`) — imperative; pair with
142
- * {@link useCommentThreads} for the subscribed view. */
143
- declare function useComments(): CommentsApi;
144
- /**
145
- * Every comment thread in the document, display-ordered (page position →
146
- * top of page → creation date) and enriched with `pageIndex`/`pageLabel`.
147
- * Subscribed to BOTH stores: annotation writes (own, remote, hydration)
148
- * recompute the threads; page moves/deletes re-run the join. Reference-
149
- * stable between changes — safe to memo child renders on the array.
150
- */
151
- declare function useCommentThreads(): CommentThreadView[];
152
- /** The enriched thread containing ANY member ref (root, reply, grouped part,
153
- * state annotation), or null. */
154
- declare function useCommentThread(ref: AnnotationRef | null): CommentThreadView | null;
155
- /** Whole-document hydration status — the comments sidebar's honest loading
156
- * state (`loading` until `listRawAll` lands, then `complete`/`error`). */
157
- declare function useCommentsHydration(): AnnotationHydration;
158
- //#endregion
159
- export { useCommentsHydration as A, filePickerProvider as C, useCommentThread as D, useAnnotationSelection as E, SelectionAnchor as F, sameAnchor as I, sameCreationDraftAnchor as L, useSelectionFlags as M, useSelectionProps as N, useCommentThreads as O, useAnnotationSelected as P, enrichCommentThreads as S, useAnnotationDefaults as T, SelectionFlags$1 as _, AnnotationPropsPatch as a, TextAlign as b, Border as c, Geom as d, LineEnding as f, RenderItem$1 as g, PropSpec as h, AnnotationProps$1 as i, useFilePickerProvider as j, useComments as k, CommentThreadView as l, PropKey as m, AnnotationLayer as n, AnnotationRenderer as o, LineEndings as p, AnnotationLayerProps as r, AnnotationRendererProps as s, AnnotationFlags as t, CreationDraftAnchor$1 as u, SelectionProps$1 as v, useAnnotation as w, TextStyle as x, Style as y };
160
- //# sourceMappingURL=annotation-k38KDlIZ.d.ts.map
@@ -1,64 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./rolldown-runtime-DDXJien1.cjs");
3
- const require_runtime = require("./runtime.cjs");
4
- const require_anchored = require("./anchored.cjs");
5
- const require_annotation_anchors = require("./annotation-anchors-DuYRBJLl.cjs");
6
- let react_jsx_runtime = require("react/jsx-runtime");
7
- let react = require("react");
8
- react = require_rolldown_runtime.__toESM(react, 1);
9
- let _embedpdf_plugin_annotation_contract_host = require("@embedpdf/plugin-annotation/contract/host");
10
- //#region src/annotation-menu.tsx
11
- /**
12
- * Annotation menus — thin anchor plumbing over the ONE `<Anchored>` primitive.
13
- *
14
- * These work identically under `<Stage>` (mount in the overlay slot; the
15
- * camera projects, no DOM reads) and `<PageView>` (measured + portalled) —
16
- * the SURFACE provides the projector, the menu doesn't care.
17
- *
18
- * No action bags: actions come from the capability hooks (`useAnnotation()`,
19
- * `useAnnotationSelected()`, …), which subscribe properly and compose across
20
- * plugins. Render props carry only the ANCHOR'S DATA (the draft menu's
21
- * progress facts); the annotation-selection menu takes plain children.
22
- */
23
- /**
24
- * Floats over the current annotation selection (one anchor regardless of
25
- * cross-page selection), dodging the rotate knob. Compose the contents from
26
- * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /
27
- * `useSelectionProps()` for the data.
28
- */
29
- function AnnotationMenu({ children, gap = 15, placement = "top" }) {
30
- const { projector } = require_anchored.useProjectorBinding();
31
- const anchor = require_runtime.useSelector(_embedpdf_plugin_annotation_contract_host.AnnotationToken, (c) => {
32
- const a = c.selectionAnchor();
33
- if (!a) return null;
34
- const env = projector.viewEnv(a.pon);
35
- return env ? c.selectionAnchor(env.scale, env.rotation, env.zoom) : a;
36
- }, require_annotation_anchors.sameAnchor);
37
- if (!anchor) return null;
38
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_anchored.Anchored, {
39
- anchor: {
40
- pon: anchor.pon,
41
- bounds: anchor.bounds,
42
- ...anchor.knob ? { avoid: [anchor.knob] } : {}
43
- },
44
- placement,
45
- gap,
46
- children
47
- });
48
- }
49
- /** Floats over a live multi-click creation draft (polygon, polyline, …). */
50
- function AnnotationDraftMenu({ children, gap = 8, placement = "top" }) {
51
- const anchor = require_runtime.useSelector(_embedpdf_plugin_annotation_contract_host.AnnotationToken, (c) => c.creationDraftAnchor(), require_annotation_anchors.sameCreationDraftAnchor);
52
- if (!anchor) return null;
53
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_anchored.Anchored, {
54
- anchor,
55
- placement,
56
- gap,
57
- children: children(anchor)
58
- });
59
- }
60
- //#endregion
61
- exports.AnnotationDraftMenu = AnnotationDraftMenu;
62
- exports.AnnotationMenu = AnnotationMenu;
63
-
64
- //# sourceMappingURL=annotation-menu.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-menu.cjs","names":["useProjectorBinding","useSelector","AnnotationHostToken","sameAnchor","Anchored","sameCreationDraftAnchor"],"sources":["../src/annotation-menu.tsx"],"sourcesContent":["/**\n * Annotation menus — thin anchor plumbing over the ONE `<Anchored>` primitive.\n *\n * These work identically under `<Stage>` (mount in the overlay slot; the\n * camera projects, no DOM reads) and `<PageView>` (measured + portalled) —\n * the SURFACE provides the projector, the menu doesn't care.\n *\n * No action bags: actions come from the capability hooks (`useAnnotation()`,\n * `useAnnotationSelected()`, …), which subscribe properly and compose across\n * plugins. Render props carry only the ANCHOR'S DATA (the draft menu's\n * progress facts); the annotation-selection menu takes plain children.\n */\nimport * as React from 'react';\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport type { CreationDraftAnchor } from '@embedpdf/core-annotation';\nimport { Anchored, useProjectorBinding, type AnchoredPlacement } from './anchored';\nimport { useSelector } from './runtime';\nimport { sameAnchor, sameCreationDraftAnchor } from './annotation-anchors';\n\nexport interface AnnotationMenuProps {\n children: React.ReactNode;\n /** Gap in screen px between the selection box and the menu (default 15). */\n gap?: number;\n /** Where to place the menu relative to the selection box. Default 'top'. */\n placement?: AnchoredPlacement;\n}\n\n/**\n * Floats over the current annotation selection (one anchor regardless of\n * cross-page selection), dodging the rotate knob. Compose the contents from\n * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /\n * `useSelectionProps()` for the data.\n */\nexport function AnnotationMenu({ children, gap = 15, placement = 'top' }: AnnotationMenuProps) {\n // Reading the binding subscribes this component to projection changes\n // (its identity IS the revision), so the anchor read below re-runs with\n // fresh view facts in the SAME commit as the surface — the knob offset is\n // screen-constant, so its content-space position depends on the page's\n // live view scale.\n const { projector } = useProjectorBinding();\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => {\n const a = c.selectionAnchor();\n if (!a) return null;\n const env = projector.viewEnv(a.pon);\n return env ? c.selectionAnchor(env.scale, env.rotation, env.zoom) : a;\n },\n sameAnchor,\n );\n if (!anchor) return null;\n return (\n <Anchored\n anchor={{\n pon: anchor.pon,\n bounds: anchor.bounds,\n ...(anchor.knob ? { avoid: [anchor.knob] } : {}),\n }}\n placement={placement}\n gap={gap}\n >\n {children}\n </Anchored>\n );\n}\n\nexport interface AnnotationDraftMenuProps {\n /** Render prop receiving the DRAFT ANCHOR'S DATA (subtype, pointCount,\n * minPoints, canFinish, …). The verbs are capability calls:\n * `useAnnotation().finishCreationDraft()` / `.cancelCreationDraft()`. */\n children: (anchor: CreationDraftAnchor) => React.ReactNode;\n /** Gap in screen px between the draft anchor and the menu (default 8). */\n gap?: number;\n /** Where to place the menu relative to the draft anchor. Default 'top'. */\n placement?: AnchoredPlacement;\n}\n\n/** Floats over a live multi-click creation draft (polygon, polyline, …). */\nexport function AnnotationDraftMenu({\n children,\n gap = 8,\n placement = 'top',\n}: AnnotationDraftMenuProps) {\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => c.creationDraftAnchor(),\n sameCreationDraftAnchor,\n );\n if (!anchor) return null;\n return (\n <Anchored anchor={anchor} placement={placement} gap={gap}>\n {children(anchor)}\n </Anchored>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,SAAgB,eAAe,EAAE,UAAU,MAAM,IAAI,YAAY,SAA8B;CAM7F,MAAM,EAAE,cAAcA,iBAAAA,oBAAoB;CAC1C,MAAM,SAASC,gBAAAA,YACbC,0CAAAA,kBACC,MAAM;EACL,MAAM,IAAI,EAAE,gBAAgB;EAC5B,IAAI,CAAC,GAAG,OAAO;EACf,MAAM,MAAM,UAAU,QAAQ,EAAE,GAAG;EACnC,OAAO,MAAM,EAAE,gBAAgB,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,IAAI;CACtE,GACAC,2BAAAA,UACF;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,iBAAAA,UAAD;EACE,QAAQ;GACN,KAAK,OAAO;GACZ,QAAQ,OAAO;GACf,GAAI,OAAO,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,IAAI,CAAC;EAChD;EACW;EACN;EAEJ;CACO,CAAA;AAEd;;AAcA,SAAgB,oBAAoB,EAClC,UACA,MAAM,GACN,YAAY,SACe;CAC3B,MAAM,SAASH,gBAAAA,YACbC,0CAAAA,kBACC,MAAM,EAAE,oBAAoB,GAC7BG,2BAAAA,uBACF;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,iBAAAA,UAAD;EAAkB;EAAmB;EAAgB;EAClD,UAAA,SAAS,MAAM;CACR,CAAA;AAEd"}
@@ -1,33 +0,0 @@
1
- import { AnchoredPlacement } from "./anchored.cjs";
2
- import * as React from "react";
3
- import { CreationDraftAnchor } from "@embedpdf/core-annotation";
4
- //#region src/annotation-menu.d.ts
5
- interface AnnotationMenuProps {
6
- children: React.ReactNode;
7
- /** Gap in screen px between the selection box and the menu (default 15). */
8
- gap?: number;
9
- /** Where to place the menu relative to the selection box. Default 'top'. */
10
- placement?: AnchoredPlacement;
11
- }
12
- /**
13
- * Floats over the current annotation selection (one anchor regardless of
14
- * cross-page selection), dodging the rotate knob. Compose the contents from
15
- * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /
16
- * `useSelectionProps()` for the data.
17
- */
18
- declare function AnnotationMenu({ children, gap, placement }: AnnotationMenuProps): import("react/jsx-runtime").JSX.Element | null;
19
- interface AnnotationDraftMenuProps {
20
- /** Render prop receiving the DRAFT ANCHOR'S DATA (subtype, pointCount,
21
- * minPoints, canFinish, …). The verbs are capability calls:
22
- * `useAnnotation().finishCreationDraft()` / `.cancelCreationDraft()`. */
23
- children: (anchor: CreationDraftAnchor) => React.ReactNode;
24
- /** Gap in screen px between the draft anchor and the menu (default 8). */
25
- gap?: number;
26
- /** Where to place the menu relative to the draft anchor. Default 'top'. */
27
- placement?: AnchoredPlacement;
28
- }
29
- /** Floats over a live multi-click creation draft (polygon, polyline, …). */
30
- declare function AnnotationDraftMenu({ children, gap, placement }: AnnotationDraftMenuProps): import("react/jsx-runtime").JSX.Element | null;
31
- //#endregion
32
- export { AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationMenu, AnnotationMenuProps };
33
- //# sourceMappingURL=annotation-menu.d.cts.map
@@ -1,33 +0,0 @@
1
- import { AnchoredPlacement } from "./anchored.js";
2
- import * as React from "react";
3
- import { CreationDraftAnchor } from "@embedpdf/core-annotation";
4
- //#region src/annotation-menu.d.ts
5
- interface AnnotationMenuProps {
6
- children: React.ReactNode;
7
- /** Gap in screen px between the selection box and the menu (default 15). */
8
- gap?: number;
9
- /** Where to place the menu relative to the selection box. Default 'top'. */
10
- placement?: AnchoredPlacement;
11
- }
12
- /**
13
- * Floats over the current annotation selection (one anchor regardless of
14
- * cross-page selection), dodging the rotate knob. Compose the contents from
15
- * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /
16
- * `useSelectionProps()` for the data.
17
- */
18
- declare function AnnotationMenu({ children, gap, placement }: AnnotationMenuProps): import("react/jsx-runtime").JSX.Element | null;
19
- interface AnnotationDraftMenuProps {
20
- /** Render prop receiving the DRAFT ANCHOR'S DATA (subtype, pointCount,
21
- * minPoints, canFinish, …). The verbs are capability calls:
22
- * `useAnnotation().finishCreationDraft()` / `.cancelCreationDraft()`. */
23
- children: (anchor: CreationDraftAnchor) => React.ReactNode;
24
- /** Gap in screen px between the draft anchor and the menu (default 8). */
25
- gap?: number;
26
- /** Where to place the menu relative to the draft anchor. Default 'top'. */
27
- placement?: AnchoredPlacement;
28
- }
29
- /** Floats over a live multi-click creation draft (polygon, polyline, …). */
30
- declare function AnnotationDraftMenu({ children, gap, placement }: AnnotationDraftMenuProps): import("react/jsx-runtime").JSX.Element | null;
31
- //#endregion
32
- export { AnnotationDraftMenu, AnnotationDraftMenuProps, AnnotationMenu, AnnotationMenuProps };
33
- //# sourceMappingURL=annotation-menu.d.ts.map
@@ -1,48 +0,0 @@
1
- import { useSelector } from "./runtime.js";
2
- import { Anchored, useProjectorBinding } from "./anchored.js";
3
- import { n as sameCreationDraftAnchor, t as sameAnchor } from "./annotation-anchors-CetwM1g7.js";
4
- import { jsx } from "react/jsx-runtime";
5
- import "react";
6
- import { AnnotationToken } from "@embedpdf/plugin-annotation/contract/host";
7
- //#region src/annotation-menu.tsx
8
- /**
9
- * Floats over the current annotation selection (one anchor regardless of
10
- * cross-page selection), dodging the rotate knob. Compose the contents from
11
- * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /
12
- * `useSelectionProps()` for the data.
13
- */
14
- function AnnotationMenu({ children, gap = 15, placement = "top" }) {
15
- const { projector } = useProjectorBinding();
16
- const anchor = useSelector(AnnotationToken, (c) => {
17
- const a = c.selectionAnchor();
18
- if (!a) return null;
19
- const env = projector.viewEnv(a.pon);
20
- return env ? c.selectionAnchor(env.scale, env.rotation, env.zoom) : a;
21
- }, sameAnchor);
22
- if (!anchor) return null;
23
- return /* @__PURE__ */ jsx(Anchored, {
24
- anchor: {
25
- pon: anchor.pon,
26
- bounds: anchor.bounds,
27
- ...anchor.knob ? { avoid: [anchor.knob] } : {}
28
- },
29
- placement,
30
- gap,
31
- children
32
- });
33
- }
34
- /** Floats over a live multi-click creation draft (polygon, polyline, …). */
35
- function AnnotationDraftMenu({ children, gap = 8, placement = "top" }) {
36
- const anchor = useSelector(AnnotationToken, (c) => c.creationDraftAnchor(), sameCreationDraftAnchor);
37
- if (!anchor) return null;
38
- return /* @__PURE__ */ jsx(Anchored, {
39
- anchor,
40
- placement,
41
- gap,
42
- children: children(anchor)
43
- });
44
- }
45
- //#endregion
46
- export { AnnotationDraftMenu, AnnotationMenu };
47
-
48
- //# sourceMappingURL=annotation-menu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation-menu.js","names":["AnnotationHostToken"],"sources":["../src/annotation-menu.tsx"],"sourcesContent":["/**\n * Annotation menus — thin anchor plumbing over the ONE `<Anchored>` primitive.\n *\n * These work identically under `<Stage>` (mount in the overlay slot; the\n * camera projects, no DOM reads) and `<PageView>` (measured + portalled) —\n * the SURFACE provides the projector, the menu doesn't care.\n *\n * No action bags: actions come from the capability hooks (`useAnnotation()`,\n * `useAnnotationSelected()`, …), which subscribe properly and compose across\n * plugins. Render props carry only the ANCHOR'S DATA (the draft menu's\n * progress facts); the annotation-selection menu takes plain children.\n */\nimport * as React from 'react';\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/contract/host';\nimport type { CreationDraftAnchor } from '@embedpdf/core-annotation';\nimport { Anchored, useProjectorBinding, type AnchoredPlacement } from './anchored';\nimport { useSelector } from './runtime';\nimport { sameAnchor, sameCreationDraftAnchor } from './annotation-anchors';\n\nexport interface AnnotationMenuProps {\n children: React.ReactNode;\n /** Gap in screen px between the selection box and the menu (default 15). */\n gap?: number;\n /** Where to place the menu relative to the selection box. Default 'top'. */\n placement?: AnchoredPlacement;\n}\n\n/**\n * Floats over the current annotation selection (one anchor regardless of\n * cross-page selection), dodging the rotate knob. Compose the contents from\n * hooks: `useAnnotation()` for the verbs, `useAnnotationSelected()` /\n * `useSelectionProps()` for the data.\n */\nexport function AnnotationMenu({ children, gap = 15, placement = 'top' }: AnnotationMenuProps) {\n // Reading the binding subscribes this component to projection changes\n // (its identity IS the revision), so the anchor read below re-runs with\n // fresh view facts in the SAME commit as the surface — the knob offset is\n // screen-constant, so its content-space position depends on the page's\n // live view scale.\n const { projector } = useProjectorBinding();\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => {\n const a = c.selectionAnchor();\n if (!a) return null;\n const env = projector.viewEnv(a.pon);\n return env ? c.selectionAnchor(env.scale, env.rotation, env.zoom) : a;\n },\n sameAnchor,\n );\n if (!anchor) return null;\n return (\n <Anchored\n anchor={{\n pon: anchor.pon,\n bounds: anchor.bounds,\n ...(anchor.knob ? { avoid: [anchor.knob] } : {}),\n }}\n placement={placement}\n gap={gap}\n >\n {children}\n </Anchored>\n );\n}\n\nexport interface AnnotationDraftMenuProps {\n /** Render prop receiving the DRAFT ANCHOR'S DATA (subtype, pointCount,\n * minPoints, canFinish, …). The verbs are capability calls:\n * `useAnnotation().finishCreationDraft()` / `.cancelCreationDraft()`. */\n children: (anchor: CreationDraftAnchor) => React.ReactNode;\n /** Gap in screen px between the draft anchor and the menu (default 8). */\n gap?: number;\n /** Where to place the menu relative to the draft anchor. Default 'top'. */\n placement?: AnchoredPlacement;\n}\n\n/** Floats over a live multi-click creation draft (polygon, polyline, …). */\nexport function AnnotationDraftMenu({\n children,\n gap = 8,\n placement = 'top',\n}: AnnotationDraftMenuProps) {\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => c.creationDraftAnchor(),\n sameCreationDraftAnchor,\n );\n if (!anchor) return null;\n return (\n <Anchored anchor={anchor} placement={placement} gap={gap}>\n {children(anchor)}\n </Anchored>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAiCA,SAAgB,eAAe,EAAE,UAAU,MAAM,IAAI,YAAY,SAA8B;CAM7F,MAAM,EAAE,cAAc,oBAAoB;CAC1C,MAAM,SAAS,YACbA,kBACC,MAAM;EACL,MAAM,IAAI,EAAE,gBAAgB;EAC5B,IAAI,CAAC,GAAG,OAAO;EACf,MAAM,MAAM,UAAU,QAAQ,EAAE,GAAG;EACnC,OAAO,MAAM,EAAE,gBAAgB,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,IAAI;CACtE,GACA,UACF;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OACE,oBAAC,UAAD;EACE,QAAQ;GACN,KAAK,OAAO;GACZ,QAAQ,OAAO;GACf,GAAI,OAAO,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,EAAE,IAAI,CAAC;EAChD;EACW;EACN;EAEJ;CACO,CAAA;AAEd;;AAcA,SAAgB,oBAAoB,EAClC,UACA,MAAM,GACN,YAAY,SACe;CAC3B,MAAM,SAAS,YACbA,kBACC,MAAM,EAAE,oBAAoB,GAC7B,uBACF;CACA,IAAI,CAAC,QAAQ,OAAO;CACpB,OACE,oBAAC,UAAD;EAAkB;EAAmB;EAAgB;EAClD,UAAA,SAAS,MAAM;CACR,CAAA;AAEd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"annotation.cjs","names":["MITER_LIMIT","useCapability","AnnotationHostToken","useSelector","shallowArray","React","usePage","useOptionalCapability","AnnotationToken","useDocumentId","useKernelValue"],"sources":["../src/annotation.tsx"],"sourcesContent":["/**\n * The React view of @embedpdf/plugin-annotation.\n *\n * Pure paint: it reads the per-page render items + chrome and draws them. Pointer\n * events arrive through the interaction hub (the Stage's forwarding), and the\n * CURSOR is driven by the hub too (the edit handler claims move/pointer/resize on\n * hover). Each annotation resolves to ONE native node — a vector SceneSvg, the\n * engine's baked /AP <img>, or a registered behavior — and the host\n * `customRenderer` may wrap or replace it.\n */\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-annotation';\nimport * as React from 'react';\nimport { useEffect, useState } from 'react';\nimport {\n AnnotationToken,\n refKey,\n type AnnotationHydration,\n type AnnotationRef,\n type Behavior,\n type CommentsApi,\n type CommentThread,\n type SelectionFlags,\n type SelectionProps,\n type FilePickerProvider,\n type TextItem,\n previewBucket,\n} from '@embedpdf/plugin-annotation';\nimport {\n attachRichTextEditor,\n pickFile,\n type RichTextEditorBinding,\n type RichTextEditorHost,\n} from '@embedpdf/web';\n// The render layer is framework code, so it resolves the FULL host lens\n// (pageItems/chrome/appearances/…). Same runtime token as the public one — only\n// the type differs. App code never imports this.\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/internal';\nimport {\n scene,\n MITER_LIMIT,\n pdfToContentRect,\n type AnnotationProps,\n type Paint,\n type Rect,\n type RenderItem,\n} from '@embedpdf/core-annotation';\n\nexport type {\n CreationDraftAnchor,\n RenderItem,\n Geom,\n LineEnding,\n LineEndings,\n Border,\n Style,\n AnnotationFlags,\n AnnotationProps,\n AnnotationPropsPatch,\n PropKey,\n PropSpec,\n TextAlign,\n TextStyle,\n} from '@embedpdf/core-annotation';\nexport type { SelectionFlags, SelectionProps } from '@embedpdf/plugin-annotation';\nimport {\n shallowArray,\n useCapability,\n useDocumentId,\n useKernelValue,\n useOptionalCapability,\n usePage,\n useSelector,\n} from './runtime';\nimport type { PageContextValue, PageLayout } from './runtime';\n\nexport { sameAnchor, sameCreationDraftAnchor, type SelectionAnchor } from './annotation-anchors';\nexport { useAnnotationSelected } from './annotation-hooks';\n\n/** `#rrggbb` → `rgba(...)` — the marquee's translucent fill derives from the\n * accent, so one `setChrome({ accent })` restyles every piece of chrome. */\nconst rgba = (hex: string, alpha: number): string => {\n const m = /^#?([0-9a-f]{6})$/i.exec(hex);\n if (!m) return hex;\n const n = parseInt(m[1], 16);\n return `rgba(${(n >> 16) & 255},${(n >> 8) & 255},${n & 255},${alpha})`;\n};\n\n/**\n * What an annotation renderer receives: the projected item (its `box` is LIVE —\n * it follows drags), the page context, the engine's baked /AP raster (the\n * \"picture\"), the default visual (`native` — wrap it or ignore it), and\n * whether this entry currently OWNS the pointer (`interactive`). While not\n * interactive the layer renders your component pointer-locked: the annotation\n * stays a first-class citizen of the annotation plane (select/move/resize).\n */\nexport interface AnnotationRendererProps {\n item: RenderItem;\n page: PageContextValue;\n appearance: { url: string; box: Rect } | null;\n native: React.ReactNode;\n interactive: boolean;\n}\n\n/**\n * ONE rule: \"for THESE annotations, render THIS component, and it owns the\n * pointer WHEN …\". The two shapes:\n *\n * - `{ for, component, interactive? }` — your own rule. Without\n * `interactive` it is a pure SKIN: pixels only, mechanically\n * pointer-locked, the annotation plane keeps selection/move/resize. With\n * `interactive` (boolean or live predicate) the layer registers a plugin\n * Behavior for you: while it holds, the annotation plane stands down\n * (hit-test-inert) and your component owns the input.\n * - `{ behavior, component }` — the renderer for a PLUGIN-registered\n * behavior (the form plugin's fill controls via `formWidgetRenderer`);\n * the plugin decides engagement, never the app.\n *\n * Resolution: ownership beats skin — an ENGAGED behavior's component is\n * authoritative; `for` rules apply only to plane-owned annotations, first\n * match wins. Define entries OUTSIDE render (module scope or useMemo): entry\n * identity keys the behavior registration.\n */\nexport type AnnotationRenderer =\n | { behavior: string; component: React.ComponentType<AnnotationRendererProps> }\n | {\n /** Stable id for the auto-registered behavior (optional; generated). */\n id?: string;\n for: Behavior['matches'];\n component: React.ComponentType<AnnotationRendererProps>;\n interactive?: boolean | (() => boolean);\n };\n\nexport interface AnnotationLayerProps {\n /** Annotation renderers — skins and interactive takeovers ({@link AnnotationRenderer}). */\n renderers?: AnnotationRenderer[];\n}\n\n/** Content rect → a view-px box (the page wrapper's own coordinate space). */\nfunction boxOf(r: Rect, page: PageContextValue) {\n const tl = page.transform.toPixels({ x: r.x, y: r.y });\n const br = page.transform.toPixels({ x: r.x + r.width, y: r.y + r.height });\n return { left: tl.x, top: tl.y, width: br.x - tl.x, height: br.y - tl.y };\n}\n\n/** Map a core `Paint` to SVG presentation attributes — the whole framework-facing\n * surface. Everything else about appearance is decided in the core's `scene`. */\nfunction paintAttrs(p: Paint) {\n return {\n fill: p.fill ?? 'none',\n stroke: p.stroke ?? 'none',\n strokeWidth: p.width,\n opacity: p.opacity,\n strokeLinejoin: p.join ?? ('miter' as const), // undefined → sharp miter; 'round' only for ink\n strokeMiterlimit: MITER_LIMIT, // must match the bounds math so spike vs bevel agree\n strokeLinecap: p.cap, // undefined → SVG default (butt); 'round' only for ink\n strokeDasharray: p.dash ? p.dash.join(' ') : undefined,\n ...(p.blend ? { style: { mixBlendMode: p.blend } } : {}),\n };\n}\n\n/**\n * The dumb painter. The pure core computed `item.box` and the painted `scene`; we\n * size the <svg> to the box with a content-space `viewBox` and map each SceneNode\n * to one element, applying its `paint`. No per-kind logic, no bounds math — so\n * shapes, cloudy borders and every text-markup type all render here, and a Vue /\n * Svelte painter is the same ~10-line loop.\n */\nfunction Shape({ item, page }: { item: RenderItem; page: PageContextValue }) {\n // Nothing to draw until the annotation has area (the 0×0 draft at mouse-down).\n if (item.box.width <= 0 || item.box.height <= 0) return null;\n const { left, top, width, height } = boxOf(item.box, page);\n // The viewBox (content units) and the <svg> on-screen size MUST stay proportional\n // (scale == zoom). Clamping either — e.g. a `max(1px)` floor on the element while\n // the viewBox keeps shrinking — decouples them, so a sub-pixel box scales content\n // up by ~1/size and a cloudy border's scallops flood the stage. No clamps here.\n const vb = `${item.box.x} ${item.box.y} ${item.box.width} ${item.box.height}`;\n // BOX-family kinds (square/circle, caret) carry an UNROTATED `box` + a `rot`\n // angle; rotate the whole <svg> about its centre. VERTEX kinds (line/poly/ink)\n // are already rotated in their geometry, so `rot` is advisory there — never\n // re-applied.\n const rot = item.geom.t === 'rect' || item.geom.t === 'caret' ? (item.rot ?? 0) : 0;\n return (\n <svg\n viewBox={vb}\n style={{\n position: 'absolute',\n left,\n top,\n width,\n height,\n overflow: 'visible',\n pointerEvents: 'none',\n ...(rot ? { transform: `rotate(${rot}deg)`, transformOrigin: 'center' } : {}),\n }}\n >\n {sceneNodes(item)}\n </svg>\n );\n}\n\n/** Map a core scene to SVG children. */\nfunction sceneNodes(item: RenderItem): React.ReactNode[] {\n return scene(item).map((n, i) => {\n const a = paintAttrs(n.paint);\n if (n.kind === 'rect')\n return (\n <rect\n key={i}\n x={n.rect.x}\n y={n.rect.y}\n width={n.rect.width}\n height={n.rect.height}\n {...a}\n />\n );\n if (n.kind === 'ellipse')\n return (\n <ellipse\n key={i}\n cx={n.rect.x + n.rect.width / 2}\n cy={n.rect.y + n.rect.height / 2}\n rx={n.rect.width / 2}\n ry={n.rect.height / 2}\n {...a}\n />\n );\n if (n.kind === 'line')\n return <line key={i} x1={n.a.x} y1={n.a.y} x2={n.b.x} y2={n.b.y} {...a} />;\n if (n.kind === 'path') return <path key={i} d={n.d} {...a} />;\n if (n.kind === 'text')\n return (\n <text\n key={i}\n x={n.at.x}\n y={n.at.y}\n transform={n.rotation ? `rotate(${n.rotation} ${n.at.x} ${n.at.y})` : undefined}\n fontSize={n.fontSize}\n {...(n.fontFamily ? { fontFamily: n.fontFamily } : {})}\n {...a}\n >\n {n.text}\n </text>\n );\n const pts = n.points.map((p) => `${p.x},${p.y}`).join(' ');\n return n.closed ? (\n <polygon key={i} points={pts} {...a} />\n ) : (\n <polyline key={i} points={pts} {...a} />\n );\n });\n}\n\nfunction BakedImage({\n box,\n url,\n page,\n blend,\n rot,\n}: {\n box: Rect;\n url: string;\n page: PageContextValue;\n blend?: Paint['blend'];\n /** The rotation (deg, CW) the engine STRIPPED from this raster\n * (`RenderItem.apRot`) — re-applied here as a view transform, so a live\n * rotate gesture spins the bitmap with zero engine re-renders. Unset for\n * rasters that already contain their rotation (vertex kinds). */\n rot?: number;\n}) {\n const b = boxOf(box, page);\n return (\n <img\n src={url}\n alt=\"\"\n draggable={false}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n // The AP box is sized in content units; a global `img { max-width: 100% }`\n // reset would otherwise clamp it to the containing block and distort the\n // aspect. This bites specifically when the box is WIDER than that block —\n // a landscape stamp whose unrotated box overhangs a view-rotated (portrait)\n // page — so honour the explicit size and let `rot` place it.\n maxWidth: 'none',\n maxHeight: 'none',\n pointerEvents: 'none',\n mixBlendMode: blend,\n // Same CW convention as the free-text element: rotate about the centre.\n ...(rot ? { transform: `rotate(${rot}deg)`, transformOrigin: 'center' } : {}),\n }}\n />\n );\n}\n\n/**\n * The armed stamp's IMAGE footprint ghost: a translucent render of the payload\n * drawn in the EXACT box a click would place it (the plugin computes it with\n * the same fit + clamp as placement). Vector footprint ghosts never reach this\n * component — they ride `pageItems` like every draft preview. The preview\n * bytes live in the capability closure; this layer owns only the object-URL\n * lifetime, keyed on the arm epoch — a new arm swaps the image, a disarm (or\n * tool change) drops it.\n */\nfunction ToolGhostImage({ page }: { page: PageContextValue }) {\n const anno = useCapability(AnnotationHostToken);\n const ghost = useSelector(AnnotationHostToken, (c) => c.toolGhost(page.pon));\n const epoch = useSelector(AnnotationHostToken, (c) => c.stampArmEpoch());\n const [url, setUrl] = useState<string | null>(null);\n // The ghost is a bitmap of vector artwork, right at ONE size: ask for the\n // bucket that covers the box's DEVICE width (points × device px per point),\n // so it stays sharp at every zoom and density. The plugin caches per bucket.\n const bucket =\n ghost?.kind === 'image' ? previewBucket(ghost.box.width * page.transform.renderScale) : 0;\n\n useEffect(() => {\n if (!bucket) {\n setUrl(null);\n return;\n }\n let cancelled = false;\n let obj: string | null = null;\n void anno.armedStampPreview(bucket).then((preview) => {\n if (cancelled || !preview) return;\n // Copy into an EXACT ArrayBuffer (the engine idiom): a Uint8Array view\n // may sit on a larger or shared buffer, which Blob won't accept.\n const body = new ArrayBuffer(preview.bytes.byteLength);\n new Uint8Array(body).set(preview.bytes);\n const blob = new Blob([body], preview.mimeType ? { type: preview.mimeType } : {});\n obj = URL.createObjectURL(blob);\n // The previous bucket's image stays up until this one resolves — no\n // flicker while a zoom crosses a bucket boundary.\n setUrl(obj);\n });\n return () => {\n cancelled = true;\n if (obj) URL.revokeObjectURL(obj);\n };\n }, [anno, epoch, bucket]);\n\n if (!ghost || ghost.kind !== 'image' || !url) return null;\n const b = boxOf(ghost.box, page);\n return (\n <img\n src={url}\n alt=\"\"\n draggable={false}\n style={{\n position: 'absolute',\n left: b.left,\n top: b.top,\n width: b.width,\n height: b.height,\n // Same explicit-size rule as BakedImage: never let a global img reset\n // clamp the box and distort the aspect.\n maxWidth: 'none',\n maxHeight: 'none',\n pointerEvents: 'none',\n opacity: 0.5,\n ...(ghost.rot ? { transform: `rotate(${ghost.rot}deg)`, transformOrigin: 'center' } : {}),\n }}\n />\n );\n}\n\nfunction Chrome({ page }: { page: PageContextValue }) {\n // The page's view scale converts the CSS-px chrome settings into content\n // units inside the core (knob stalk, grab zones) — screen-constant at every\n // zoom. The painter's own px values (handle glyphs, dot radius) are drawn in\n // screen space and need no conversion.\n const scale = page.transform.viewScale;\n const rotation = page.transform.rotation;\n const zoom = page.transform.zoom;\n const nodes = useSelector(\n AnnotationHostToken,\n (c) => c.chrome(page.pon, scale, rotation, zoom),\n shallowArray,\n );\n const cs = useSelector(AnnotationHostToken, (c) => c.chromeSettings());\n // The accent cascade: each piece's color falls back to the one accent.\n const outlineStroke = cs.outline.color ?? cs.accent;\n const handleStroke = cs.handles.stroke ?? cs.accent;\n const knobStroke = cs.knob.stroke ?? cs.accent;\n // ONE outline style for the resting rect AND the rotated obb — the selection\n // box must never flip dashed↔solid when a rotation starts.\n const outlineDash = cs.outline.style === 'dashed' ? '4 3' : undefined;\n // The live rotation readout — an HTML chip (rounded box + padded text beats\n // hand-rolling it in SVG), riding the pointer like v2's.\n const chip = nodes.find((n) => n.kind === 'angle-chip');\n const chipAt = chip ? page.transform.toPixels(chip.at) : null;\n return (\n <>\n <svg style={{ position: 'absolute', inset: 0, overflow: 'visible', pointerEvents: 'none' }}>\n {nodes.map((n, i) => {\n if (n.kind === 'angle-chip') return null; // rendered as HTML below\n if (n.kind === 'handle') {\n const p = page.transform.toPixels(n.at);\n const hs = cs.handles.size;\n return (\n <rect\n key={i}\n x={p.x - hs / 2}\n y={p.y - hs / 2}\n width={hs}\n height={hs}\n fill={cs.handles.fill}\n stroke={handleStroke}\n strokeWidth={1.5}\n // The square rides a rotated box's orientation (spin about itself).\n {...(n.rot ? { transform: `rotate(${n.rot} ${p.x} ${p.y})` } : {})}\n />\n );\n }\n // A live alignment guide of a snapped move: a through-line at the snapped\n // edge/center, spanning both shapes.\n if (n.kind === 'guide') {\n const a = page.transform.toPixels(\n n.axis === 'x' ? { x: n.at, y: n.lo } : { x: n.lo, y: n.at },\n );\n const b = page.transform.toPixels(\n n.axis === 'x' ? { x: n.at, y: n.hi } : { x: n.hi, y: n.at },\n );\n return (\n <line\n key={i}\n x1={a.x}\n y1={a.y}\n x2={b.x}\n y2={b.y}\n stroke=\"#e91e63\"\n strokeWidth={1.5}\n shapeRendering=\"crispEdges\"\n />\n );\n }\n // An oriented selection box (a tilted shape/group): a closed quad through\n // the four content-space corners — replaces the axis-aligned outline.\n if (n.kind === 'obb') {\n const pts = n.corners\n .map((c) => {\n const p = page.transform.toPixels(c);\n return `${p.x},${p.y}`;\n })\n .join(' ');\n return (\n <polygon\n key={i}\n points={pts}\n fill=\"none\"\n stroke={outlineStroke}\n strokeWidth={cs.outline.width}\n strokeDasharray={outlineDash}\n />\n );\n }\n // Rotation guides (live rotate only): the faint 0°/90° reference cross\n // + the prominent indicator riding the angle — pre-cut page chords, so\n // this is a dumb line loop.\n if (n.kind === 'rotate-guides') {\n const guideDash = cs.guides.style === 'dashed' ? '4 3' : undefined;\n return (\n <g key={i}>\n {n.lines.map((l, j) => {\n const a = page.transform.toPixels(l.a);\n const b = page.transform.toPixels(l.b);\n const axis = l.role === 'axis';\n return (\n <line\n key={j}\n x1={a.x}\n y1={a.y}\n x2={b.x}\n y2={b.y}\n stroke={\n axis\n ? (cs.guides.axisColor ?? cs.accent)\n : (cs.guides.indicatorColor ?? cs.accent)\n }\n opacity={axis ? cs.guides.axisOpacity : cs.guides.indicatorOpacity}\n strokeWidth={cs.guides.width}\n strokeDasharray={guideDash}\n />\n );\n })}\n </g>\n );\n }\n // The rotate knob: a stalk from the top-edge midpoint out to a grab dot.\n if (n.kind === 'rotate-knob') {\n const at = page.transform.toPixels(n.at);\n const from = page.transform.toPixels(n.from);\n return (\n <g key={i}>\n {cs.knob.stalk && (\n <line\n x1={from.x}\n y1={from.y}\n x2={at.x}\n y2={at.y}\n stroke={knobStroke}\n strokeWidth={1}\n />\n )}\n <circle\n cx={at.x}\n cy={at.y}\n r={cs.knob.size / 2}\n fill={cs.knob.fill}\n stroke={knobStroke}\n strokeWidth={1.5}\n />\n </g>\n );\n }\n const b = boxOf(n.rect, page);\n // The marquee rubber band keeps its own look (translucent accent fill,\n // always dashed); the selection outline follows the settings.\n if (n.kind === 'marquee') {\n return (\n <rect\n key={i}\n x={b.left}\n y={b.top}\n width={b.width}\n height={b.height}\n fill={rgba(cs.accent, 0.08)}\n stroke={cs.accent}\n strokeWidth={1}\n strokeDasharray=\"4 3\"\n />\n );\n }\n return (\n <rect\n key={i}\n x={b.left}\n y={b.top}\n width={b.width}\n height={b.height}\n fill=\"none\"\n stroke={outlineStroke}\n strokeWidth={cs.outline.width}\n strokeDasharray={outlineDash}\n />\n );\n })}\n </svg>\n {chip && chipAt && (\n <div\n style={{\n position: 'absolute',\n left: chipAt.x + 16,\n top: chipAt.y - 28,\n background: 'rgba(0,0,0,0.8)',\n color: '#fff',\n padding: '2px 6px',\n borderRadius: 4,\n fontSize: 12,\n fontFamily: 'monospace',\n pointerEvents: 'none',\n whiteSpace: 'nowrap',\n zIndex: 1,\n }}\n >\n {chip.angle}°\n </div>\n )}\n </>\n );\n}\n\n/**\n * A free-text annotation: the SAME styled element for viewing and editing —\n * `contentEditable` just toggles, so the text never jumps. The plugin handed us\n * a ready-to-spread body style (`item.css`) and the rich paragraphs\n * (`item.richText`); the shared `attachRichTextEditor` binding renders them\n * as inline-styled spans, serialises typing back, maps the selection to flat\n * offsets and keeps the caret through a restyle; the browser owns layout,\n * caret, IME and clipboard; the plugin owns the text truth, the range\n * routing and the debounced engine write. This component is the ENTIRE\n * per-framework surface for text editing — React's part is the glue below.\n */\nfunction FreeText({ item, page }: { item: TextItem; page: PageContextValue }) {\n const anno = useCapability(AnnotationHostToken);\n const ref = React.useRef<HTMLDivElement>(null);\n const box = boxOf(item.box, page);\n const scale = item.box.width > 0 ? box.width / item.box.width : 1; // content units → screen px\n // The binding outlives renders; the host closes over the LATEST item.\n const binding = React.useRef<RichTextEditorBinding | null>(null);\n const latest = React.useRef({ item, scale });\n latest.current = { item, scale };\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const host: RichTextEditorHost = {\n onInput: (doc) => {\n const it = latest.current.item;\n if (it.ref) anno.setRichText(it.ref, doc);\n },\n onSelectionChange: (range) => {\n const it = latest.current.item;\n if (it.ref) anno.setTextSelection(it.ref, range);\n },\n onCommand: (command) => anno.toggleTextFormat(command),\n cssFontFamily: (family) => anno.cssFontFamily(family),\n };\n const b = attachRichTextEditor(el, host, {\n document: latest.current.item.richText,\n scale: latest.current.scale,\n });\n binding.current = b;\n return () => {\n b.detach();\n binding.current = null;\n };\n }, [anno]);\n // Model → DOM: the binding skips its own echo (so the caret never jumps\n // while typing) and re-renders — caret restored — for a restyle, a remote\n // edit, or a zoom.\n // Runs on every item change: the binding re-renders only when the document\n // differs, and otherwise just re-states the line model for the element's\n // (possibly restyled) font.\n useEffect(() => {\n binding.current?.update({ document: item.richText, scale });\n }, [item, scale]);\n // The element IS the engine's text PLATE (`SetPlateRect` + its `re W n`\n // clip): positioned at the padding inset with ZERO CSS padding, so the\n // scrollport's edge is the plate edge. CSS padding does NOT clip overflow —\n // scrolled lines slide straight through it and paint over the border band —\n // so the border band must sit OUTSIDE the scrollport, never inside it.\n const pad = item.css.padding * scale;\n const plate = {\n left: box.left + pad,\n top: box.top + pad,\n width: Math.max(0, box.width - 2 * pad),\n height: Math.max(0, box.height - 2 * pad),\n };\n\n // Keep DOM focus in sync with the model's `editing` state. Focus follows the\n // model — it never drives it (exit is hub-driven, see the edit handler), so a\n // transient focus-steal by the page surface can't end the edit.\n useEffect(() => {\n if (item.editing) {\n const el = ref.current;\n if (!el) return;\n el.focus();\n // Enter at the TOP — the same anchoring the baked appearance uses\n // (/Q vertical-align top), so baked → edit → baked never jumps. The\n // browser still follows the caret once the user clicks or types.\n el.scrollTop = 0;\n }\n }, [item.editing]);\n\n // Isolate the editor from the interaction hub: a pointerdown inside it must NOT\n // bubble up to the Stage's native listener (which the edit handler reads as a\n // click-outside → exit). Stopping it here lets the browser own caret placement\n // and drag-selection inside the box, while clicks OUTSIDE still reach the hub and\n // commit the edit. Native listener (not React's) so it runs during real DOM\n // bubbling, before the Stage's own native listener on an ancestor.\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n const stop = (e: Event) => e.stopPropagation();\n el.addEventListener('pointerdown', stop);\n return () => el.removeEventListener('pointerdown', stop);\n }, []);\n\n return (\n <div\n ref={ref}\n contentEditable={item.editing}\n suppressContentEditableWarning\n onBlur={(e) => {\n // The gesture that opens the editor fires a native `mousedown` on the\n // non-focusable page surface, which blurs us to <body> (relatedTarget null)\n // right after we focus. If the MODEL still has this box in edit, that blur\n // is a spurious steal — re-assert focus. A real click-away routes through\n // the hub, which clears `editing` BEFORE this fires, so we let it go (and a\n // focus move to a real element, relatedTarget != null, is always honoured).\n if (\n e.relatedTarget == null &&\n ref.current?.isConnected &&\n anno.currentEditing() === item.id\n ) {\n ref.current.focus();\n }\n }}\n style={{\n position: 'absolute',\n left: plate.left,\n top: plate.top,\n width: plate.width,\n // Fixed to the annotation rect's plate — the box never grows with\n // content; it scrolls while editing and clips otherwise, at the SAME\n // boundary the baked /AP clips at (`re W n` on the text body).\n height: plate.height,\n fontFamily: item.css.fontFamily,\n fontSize: item.css.fontSize * scale,\n // No line-height here: the binding states the engine's line model on\n // the element per face (ascent + descent + Acrobat's leading).\n color: item.css.color,\n fontWeight: item.css.fontWeight,\n fontStyle: item.css.fontStyle,\n textDecoration: item.css.textDecoration,\n textAlign: item.css.align,\n boxSizing: 'border-box',\n // The box's fill and border are the vector scene's (below this\n // layer), so a translucent box is painted once.\n background: 'transparent',\n whiteSpace: 'pre-wrap',\n overflowWrap: 'break-word',\n overflowY: item.editing ? 'auto' : 'hidden',\n overflowX: 'hidden',\n outline: item.editing ? '1px solid #3858e9' : 'none',\n cursor: item.editing ? 'text' : 'default',\n // A plain text box rotates about its centre (the box model — same as the\n // baked /AP). `box` is the unrotated box; CSS rotate matches our CW `rot`.\n ...(item.rot ? { transform: `rotate(${item.rot}deg)`, transformOrigin: 'center' } : {}),\n // not editing → clicks fall through to the shape layer (select / move / resize)\n pointerEvents: item.editing ? 'auto' : 'none',\n }}\n />\n );\n}\n\n/**\n * Auto-registered behaviors for `interactive` renderer entries — refcounted\n * per (capability, entry) because the layer mounts once PER PAGE: the first\n * page registers, the last unregisters. Entry identity is the key, hence the\n * \"define entries outside render\" rule on {@link AnnotationRenderer}.\n */\nconst autoBehaviors = new WeakMap<\n object,\n Map<object, { id: string; count: number; unregister: () => void }>\n>();\nlet autoBehaviorSeq = 0;\n\nfunction useAutoBehaviors(\n anno: { registerBehavior(b: Behavior): () => void },\n renderers?: AnnotationRenderer[],\n): void {\n useEffect(() => {\n if (!renderers) return;\n const released: Array<() => void> = [];\n for (const r of renderers) {\n if (!('for' in r) || !r.interactive) continue;\n let perCap = autoBehaviors.get(anno);\n if (!perCap) autoBehaviors.set(anno, (perCap = new Map()));\n let rec = perCap.get(r);\n if (!rec) {\n const id = r.id ?? `renderer:${++autoBehaviorSeq}`;\n const engaged = typeof r.interactive === 'function' ? r.interactive : () => true;\n rec = { id, count: 0, unregister: anno.registerBehavior({ id, matches: r.for, engaged }) };\n perCap.set(r, rec);\n }\n rec.count++;\n const owned = rec;\n released.push(() => {\n owned.count--;\n if (owned.count === 0) {\n owned.unregister();\n autoBehaviors.get(anno)?.delete(r);\n }\n });\n }\n return () => released.forEach((f) => f());\n }, [anno, renderers]);\n}\n\n/** The behavior id a renderer entry answers for (plugin-owned or auto-registered). */\nfunction rendererBehaviorId(anno: object, r: AnnotationRenderer): string | null {\n if ('behavior' in r) return r.behavior;\n return autoBehaviors.get(anno)?.get(r)?.id ?? null;\n}\n\n/** React 18 spells the `inert` attribute as a string spread; it hard-disables\n * pointer AND focus for the whole subtree — the mechanical guarantee that a\n * non-interactive renderer entry (a skin) can never steal input. */\nconst INERT = { inert: '' } as Record<string, string>;\n\nexport function AnnotationLayer({ renderers }: AnnotationLayerProps = {}) {\n const page = usePage();\n const anno = useCapability(AnnotationHostToken);\n // The page's view env (RELATIVE zoom + total display rotation) projects\n // screen-anchored (`noZoom`/`noRotate`) annotations to their effective\n // footprint INSIDE the plugin — no flag logic lives in the framework.\n // `transform.zoom` (not `viewScale`): 1 = the page's physical 100%.\n const viewZoom = page.transform.zoom;\n const viewRotation = page.transform.rotation;\n const items = useSelector(\n AnnotationHostToken,\n (c) => c.pageItems(page.pon, { zoom: viewZoom, rotation: viewRotation }),\n shallowArray,\n );\n const texts = useSelector(\n AnnotationHostToken,\n (c) => c.textItems(page.pon, { zoom: viewZoom, rotation: viewRotation }),\n shallowArray,\n );\n const [urls, setUrls] = useState<Record<string, { url: string; box: Rect }>>({});\n useAutoBehaviors(anno, renderers);\n\n useEffect(() => {\n anno.ensurePage(page.pon);\n }, [anno, page.pon]);\n\n // Baked annotations render from engine rasters — refetch when the page's\n // baked set or an /AP content version changes (a freshly placed stamp, a\n // resize whose re-bake RESOLVED), plus at APPEARANCE-SCALE crossings. A move\n // or a rotate leaves the epoch untouched (the blit repositions the same\n // pixels), and live gesture previews don't touch it either — so no mid-drag\n // spam.\n const bakedKey = useSelector(AnnotationHostToken, (c) => c.appearanceEpoch(page.pon));\n // The bake scale conforms to the document's render policy — the plugin's\n // OWN capability over the kernel-materialized fact (no foreign tokens):\n // zoom ticks inside an appearance-lattice rung re-bake NOTHING; crossing\n // 1→2 re-bakes once; continuous is the identity.\n const bakeScale = useSelector(AnnotationHostToken, (c) =>\n c.bakeScale(page.transform.renderScale),\n );\n\n useEffect(() => {\n const controller = new AbortController();\n const revokers: Array<() => void> = [];\n (async () => {\n try {\n const imgs = await anno.appearances(page.pon, bakeScale, controller.signal);\n const map: Record<string, { url: string; box: Rect }> = {};\n for (const ap of imgs) {\n // Place the baked bitmap by its OWN /Rect (the box it was rendered into),\n // converted to content space by the plugin — never a recomputed bound.\n const box = anno.toContentBox(page.pon, ap.rect);\n if (!box) continue;\n const obj = await ap.image.objectUrl(controller.signal);\n if (controller.signal.aborted) {\n obj.revoke();\n return;\n }\n revokers.push(obj.revoke);\n map[refKey(ap.ref)] = { url: obj.url, box };\n }\n if (!controller.signal.aborted) setUrls(map);\n } catch {\n /* aborted / no appearances */\n }\n })();\n return () => {\n controller.abort();\n revokers.forEach((r) => r());\n };\n }, [anno, page.pon, bakeScale, bakedKey]);\n\n return (\n <div style={{ position: 'absolute', inset: 0, pointerEvents: 'none' }}>\n {items.map((item) => {\n // The default visual: the engine's baked raster (blitted into the LIVE\n // AP box — `apBox` follows a move) or the vector scene.\n const baked = urls[item.id];\n const native: React.ReactNode =\n item.source === 'baked' ? (\n baked ? (\n <BakedImage\n box={item.apBox ?? baked.box}\n url={baked.url}\n page={page}\n blend={item.blend}\n rot={item.apRot}\n />\n ) : null\n ) : (\n <Shape item={item} page={page} /> // shapes, cloudy, markup — all painted via scene()\n );\n\n // Ownership beats skin: an ENGAGED behavior's renderer is authoritative\n // (form fill controls own their DOM); `for` rules apply only to\n // plane-owned annotations and render pointer-locked — a skin can change\n // pixels, never steal input.\n const behavior = anno.behaviorFor({ subtype: item.subtype, ref: item.ref });\n let out: React.ReactNode;\n if (behavior) {\n const entry = renderers?.find((r) => rendererBehaviorId(anno, r) === behavior.id);\n if (entry) {\n const Owner = entry.component;\n out = (\n <Owner\n item={item}\n page={page}\n appearance={baked ?? null}\n native={native}\n interactive\n />\n );\n } else {\n out = null; // engaged but no renderer wired — the owner shows nothing\n }\n } else {\n const entry = renderers?.find(\n (r) => 'for' in r && r.for({ subtype: item.subtype, ref: item.ref }),\n );\n if (entry) {\n const Skin = entry.component;\n out = (\n <div {...INERT} style={{ pointerEvents: 'none' }}>\n <Skin\n item={item}\n page={page}\n appearance={baked ?? null}\n native={native}\n interactive={false}\n />\n </div>\n );\n } else {\n out = native;\n }\n }\n return <React.Fragment key={item.id}>{out}</React.Fragment>;\n })}\n {texts.map((t) => (\n <FreeText key={t.id} item={t} page={page} />\n ))}\n <ToolGhostImage page={page} />\n <Chrome page={page} />\n </div>\n );\n}\n\n/**\n * The default file-picker provider: the built-in file dialog (from\n * `@embedpdf/web`), honouring the tool's `accept` filter. This is the ADAPTER\n * fulfilling the plugin's DOM-free port — the dialog lives here, in the\n * framework layer, never in the plugin. A picked `File` carries its own name\n * and mime, so it goes straight through as the engine's file source.\n */\nexport const filePickerProvider: FilePickerProvider = async (req) => {\n const file = await pickFile({ accept: req.accept ?? '*/*' });\n return file ? { data: file } : null;\n};\n\n/**\n * Install the file-picker provider for the active document — the ONE port\n * behind every click-then-pick tool (a stamp `'prompt'` source, the file-\n * attachment tool). Call ONCE at a document-scoped spot (not inside\n * `<AnnotationLayer>`, which is per page). Defaults to\n * {@link filePickerProvider}, so a bare `useFilePickerProvider()` makes all of\n * them work out of the box; pass a custom provider (asset library, cloud\n * drive — switch on `req.subtype` / `req.toolId`) or `null` to make\n * click-then-pick tools inert. Cleared on unmount.\n */\nexport function useFilePickerProvider(\n provider: FilePickerProvider | null = filePickerProvider,\n): void {\n const anno = useOptionalCapability(AnnotationToken);\n useEffect(() => {\n if (!anno) return;\n anno.setFilePickerProvider(provider);\n return () => anno.setFilePickerProvider(null);\n }, [anno, provider]);\n}\n\nexport function useAnnotation() {\n return useCapability(AnnotationToken);\n}\n\nexport function useAnnotationSelection() {\n return useSelector(AnnotationToken, (c) => c.selection(), shallowArray);\n}\n\n/** Structural equality for a resolved props bag — keeps the subscription from\n * re-rendering on unrelated dispatches, since `currentDefaults` returns a fresh\n * object each call. Small flat objects; JSON compare is exact and cheap here. */\nconst sameProps = (a: AnnotationProps, b: AnnotationProps): boolean =>\n a === b || JSON.stringify(a) === JSON.stringify(b);\n\n/**\n * A tool's RESOLVED defaults (base + per-tool override) as a full flat props\n * bag, subscribed so a `setDefaults` re-renders the consumer. Use this — not the\n * imperative `useAnnotation().currentDefaults(id)` — to drive default-editing\n * controls, so they reflect changes live. Pair with `propsForTool(id)` for the\n * specs to render.\n */\nexport function useAnnotationDefaults(toolId: string): AnnotationProps {\n return useSelector(AnnotationToken, (c) => c.currentDefaults(toolId), sameProps);\n}\n\n/**\n * The selection's editable properties — ordered specs shared by every selected\n * kind, current values, and which keys are mixed. THE hook a property sidebar\n * renders from; write back with `useAnnotation().updateSelection({ [key]: v })`.\n * Reference-stable between model changes (the capability memoizes by model\n * identity), so the default equality is enough.\n */\nexport function useSelectionProps(): SelectionProps {\n return useSelector(AnnotationToken, (c) => c.getSelectionProps());\n}\n\n/**\n * The selection's `/F` annotation flags — per-flag `true`/`false`, `null` where\n * the selected annotations disagree (render an indeterminate control), `null`\n * overall when nothing is selected. Write back with\n * `useAnnotation().updateSelectionFlags({ locked: true })`. Reference-stable\n * between model changes, like {@link useSelectionProps}.\n */\nexport function useSelectionFlags(): SelectionFlags | null {\n return useSelector(AnnotationToken, (c) => c.getSelectionFlags());\n}\n\n// ── Comments (the conversation plane) ────────────────────────────────────────\n\n/**\n * A {@link CommentThread} enriched with its page's live display position —\n * the framework-layer join. Identity stays `pageObjectNumber` (like every\n * annotation surface); these two fields are PRESENTATION, tracking page\n * moves and deletes.\n */\nexport interface CommentThreadView extends CommentThread {\n /** Current 0-based display index of the thread's page; `-1` when the page\n * is no longer in the document (one-frame teardown race on delete). */\n pageIndex: number;\n /** The page's `/PageLabels` label when the PDF declares one (\"iv\", \"A-2\"),\n * else the 1-based position as a string — print it verbatim. */\n pageLabel: string;\n /**\n * The root annotation's rect in CONTENT space (y-down, crop-relative,\n * unscaled points) — the space `StageCapability.reveal` takes, so a\n * \"jump to this comment\" is `stage.reveal(pageIndex, { rect: contentRect })`.\n * Null when the page is gone. Identity still travels as `pageObjectNumber`;\n * this, like `pageIndex`, is presentation.\n */\n contentRect: Rect | null;\n}\n\n/** Pure join behind {@link useCommentThreads} — exported for tests. */\nexport function enrichCommentThreads(\n threads: readonly CommentThread[],\n pages: readonly PageLayout[],\n): CommentThreadView[] {\n const byPon = new Map(pages.map((p) => [p.pageObjectNumber, p] as const));\n return threads.map((t) => {\n const page = byPon.get(t.pageObjectNumber);\n return {\n ...t,\n pageIndex: page ? page.index : -1,\n pageLabel: page ? (page.label ?? String(page.index + 1)) : '?',\n contentRect: page ? pdfToContentRect(t.root.rect, page.boxes.crop) : null,\n };\n });\n}\n\n/** The comments surface (verbs + `permissionsFor`) — imperative; pair with\n * {@link useCommentThreads} for the subscribed view. */\nexport function useComments(): CommentsApi {\n return useCapability(AnnotationToken).comments;\n}\n\nconst EMPTY_PAGES: readonly PageLayout[] = [];\n\n/**\n * Every comment thread in the document, display-ordered (page position →\n * top of page → creation date) and enriched with `pageIndex`/`pageLabel`.\n * Subscribed to BOTH stores: annotation writes (own, remote, hydration)\n * recompute the threads; page moves/deletes re-run the join. Reference-\n * stable between changes — safe to memo child renders on the array.\n */\nexport function useCommentThreads(): CommentThreadView[] {\n const docId = useDocumentId();\n const threads = useSelector(AnnotationToken, (c) => c.comments.threads());\n const pages = useKernelValue((k) =>\n docId ? (k.getState().core.documents[docId]?.pages ?? EMPTY_PAGES) : EMPTY_PAGES,\n );\n return React.useMemo(() => enrichCommentThreads(threads, pages), [threads, pages]);\n}\n\n/** The enriched thread containing ANY member ref (root, reply, grouped part,\n * state annotation), or null. */\nexport function useCommentThread(ref: AnnotationRef | null): CommentThreadView | null {\n const views = useCommentThreads();\n const api = useComments();\n if (ref == null) return null;\n const t = api.thread(ref);\n if (!t) return null;\n return views.find((v) => refKey(v.root.ref) === refKey(t.root.ref)) ?? null;\n}\n\n/** Whole-document hydration status — the comments sidebar's honest loading\n * state (`loading` until `listRawAll` lands, then `complete`/`error`). */\nexport function useCommentsHydration(): AnnotationHydration {\n return useSelector(AnnotationToken, (c) => c.comments.hydration());\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkFA,MAAM,QAAQ,KAAa,UAA0B;CACnD,MAAM,IAAI,qBAAqB,KAAK,GAAG;CACvC,IAAI,CAAC,GAAG,OAAO;CACf,MAAM,IAAI,SAAS,EAAE,IAAI,EAAE;CAC3B,OAAO,QAAS,KAAK,KAAM,IAAI,GAAI,KAAK,IAAK,IAAI,GAAG,IAAI,IAAI,GAAG,MAAM;AACvE;;AAqDA,SAAS,MAAM,GAAS,MAAwB;CAC9C,MAAM,KAAK,KAAK,UAAU,SAAS;EAAE,GAAG,EAAE;EAAG,GAAG,EAAE;CAAE,CAAC;CACrD,MAAM,KAAK,KAAK,UAAU,SAAS;EAAE,GAAG,EAAE,IAAI,EAAE;EAAO,GAAG,EAAE,IAAI,EAAE;CAAO,CAAC;CAC1E,OAAO;EAAE,MAAM,GAAG;EAAG,KA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