@embedpdf/react 3.0.0-next.0 → 3.0.0-next.10

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 (104) hide show
  1. package/dist/AnnotationListSnapshot-DDxHpJQU-BG32YXxG.d.cts +347 -0
  2. package/dist/AnnotationListSnapshot-DDxHpJQU-BG32YXxG.d.ts +347 -0
  3. package/dist/anchored.cjs +89 -0
  4. package/dist/anchored.cjs.map +1 -0
  5. package/dist/anchored.d.cts +45 -0
  6. package/dist/anchored.d.ts +45 -0
  7. package/dist/anchored.js +60 -0
  8. package/dist/anchored.js.map +1 -0
  9. package/dist/annotation-menu.cjs +33 -84
  10. package/dist/annotation-menu.cjs.map +1 -1
  11. package/dist/annotation-menu.d.cts +28 -2
  12. package/dist/annotation-menu.d.ts +28 -2
  13. package/dist/annotation-menu.js +27 -78
  14. package/dist/annotation-menu.js.map +1 -1
  15. package/dist/annotation.cjs +752 -16
  16. package/dist/annotation.cjs.map +1 -0
  17. package/dist/annotation.d.cts +159 -2
  18. package/dist/annotation.d.ts +159 -2
  19. package/dist/annotation.js +737 -3
  20. package/dist/annotation.js.map +1 -0
  21. package/dist/commands.js +1 -0
  22. package/dist/commands.js.map +1 -1
  23. package/dist/form.cjs +3 -3
  24. package/dist/form.cjs.map +1 -1
  25. package/dist/form.d.cts +2 -2
  26. package/dist/form.d.ts +2 -2
  27. package/dist/form.js +3 -3
  28. package/dist/form.js.map +1 -1
  29. package/dist/index.cjs +34 -5
  30. package/dist/index.d.cts +14 -8
  31. package/dist/index.d.ts +14 -8
  32. package/dist/index.js +8 -6
  33. package/dist/interaction.cjs +17 -4
  34. package/dist/interaction.cjs.map +1 -1
  35. package/dist/interaction.d.cts +2 -2
  36. package/dist/interaction.d.ts +2 -2
  37. package/dist/interaction.js +7 -5
  38. package/dist/interaction.js.map +1 -1
  39. package/dist/link.cjs +29 -6
  40. package/dist/link.cjs.map +1 -1
  41. package/dist/link.d.cts +12 -3
  42. package/dist/link.d.ts +12 -3
  43. package/dist/link.js +31 -8
  44. package/dist/link.js.map +1 -1
  45. package/dist/metadata.js +1 -0
  46. package/dist/metadata.js.map +1 -1
  47. package/dist/page-edit.js +1 -0
  48. package/dist/page-edit.js.map +1 -1
  49. package/dist/page-view.cjs +62 -38
  50. package/dist/page-view.cjs.map +1 -1
  51. package/dist/page-view.js +59 -37
  52. package/dist/page-view.js.map +1 -1
  53. package/dist/redaction.js +1 -0
  54. package/dist/redaction.js.map +1 -1
  55. package/dist/render.cjs +67 -50
  56. package/dist/render.cjs.map +1 -1
  57. package/dist/render.d.cts +6 -19
  58. package/dist/render.d.ts +6 -19
  59. package/dist/render.js +71 -52
  60. package/dist/render.js.map +1 -1
  61. package/dist/rolldown-runtime-BBjsoOtd.js +27 -0
  62. package/dist/{runtime-DV98q7I0.d.ts → runtime-Cvi0wQ4d.d.cts} +23 -10
  63. package/dist/{runtime-CMxIuF2O.d.cts → runtime-DXxr8T4L.d.ts} +23 -10
  64. package/dist/runtime.cjs +6 -5
  65. package/dist/runtime.cjs.map +1 -1
  66. package/dist/runtime.d.cts +1 -1
  67. package/dist/runtime.d.ts +1 -1
  68. package/dist/runtime.js +7 -5
  69. package/dist/runtime.js.map +1 -1
  70. package/dist/search.cjs +36 -19
  71. package/dist/search.cjs.map +1 -1
  72. package/dist/search.d.cts +1 -1
  73. package/dist/search.d.ts +1 -1
  74. package/dist/search.js +36 -19
  75. package/dist/search.js.map +1 -1
  76. package/dist/selection.cjs +217 -22
  77. package/dist/selection.cjs.map +1 -1
  78. package/dist/selection.d.cts +60 -2
  79. package/dist/selection.d.ts +60 -2
  80. package/dist/selection.js +214 -27
  81. package/dist/selection.js.map +1 -1
  82. package/dist/shell.js +1 -0
  83. package/dist/shell.js.map +1 -1
  84. package/dist/stage.cjs +47 -146
  85. package/dist/stage.cjs.map +1 -1
  86. package/dist/stage.d.cts +18 -5
  87. package/dist/stage.d.ts +18 -5
  88. package/dist/stage.js +50 -148
  89. package/dist/stage.js.map +1 -1
  90. package/dist/stamp.js +1 -0
  91. package/dist/stamp.js.map +1 -1
  92. package/dist/toolbar.js +1 -0
  93. package/dist/toolbar.js.map +1 -1
  94. package/dist/views.js +1 -0
  95. package/dist/views.js.map +1 -1
  96. package/package.json +27 -26
  97. package/dist/AnnotationListSnapshot-W0RCsyDE-dWna4TTJ.d.cts +0 -2593
  98. package/dist/AnnotationListSnapshot-W0RCsyDE-dWna4TTJ.d.ts +0 -2593
  99. package/dist/annotation-B6jwfTCh.d.cts +0 -173
  100. package/dist/annotation-Ct6dFtzJ.cjs +0 -913
  101. package/dist/annotation-Ct6dFtzJ.cjs.map +0 -1
  102. package/dist/annotation-DjGWJljY.js +0 -829
  103. package/dist/annotation-DjGWJljY.js.map +0 -1
  104. package/dist/annotation-nUMefyjw.d.ts +0 -173
@@ -1,96 +1,45 @@
1
- import { useCapability, useSelector } from "./runtime.js";
2
- import { a as sameAnchor, l as useAnnotationSelected, m as positionMenuAroundRect, o as sameCreationDraftAnchor } from "./annotation-DjGWJljY.js";
1
+ import { useSelector } from "./runtime.js";
2
+ import { Anchored, useProjectorBinding } from "./anchored.js";
3
+ import { sameAnchor, sameCreationDraftAnchor } from "./annotation.js";
3
4
  import { jsx } from "react/jsx-runtime";
4
- import { useEffect, useRef } from "react";
5
- import { StageToken } from "@embedpdf/plugin-stage";
5
+ import "react";
6
6
  import { AnnotationToken } from "@embedpdf/plugin-annotation/internal";
7
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
+ */
8
14
  function AnnotationMenu({ children, gap = 15, placement = "top" }) {
9
- const stage = useCapability(StageToken);
10
- const anno = useCapability(AnnotationToken);
11
- useSelector(StageToken, (c) => c.visiblePages());
15
+ const { projector } = useProjectorBinding();
12
16
  const anchor = useSelector(AnnotationToken, (c) => {
13
17
  const a = c.selectionAnchor();
14
18
  if (!a) return null;
15
- const t = stage.pageRect(a.pon)?.transform;
16
- return t?.viewScale ? c.selectionAnchor(t.viewScale, t.rotation, t.zoom) : a;
19
+ const env = projector.viewEnv(a.pon);
20
+ return env ? c.selectionAnchor(env.scale, env.rotation, env.zoom) : a;
17
21
  }, sameAnchor);
18
- const selected = useAnnotationSelected();
19
- const ref = useRef(null);
20
- useEffect(() => {
21
- const el = ref.current;
22
- if (!el) return;
23
- const stop = (e) => e.stopPropagation();
24
- el.addEventListener("pointerdown", stop);
25
- return () => el.removeEventListener("pointerdown", stop);
26
- });
27
22
  if (!anchor) return null;
28
- const box = stage.pageRectToScreen(anchor.pon, anchor.bounds);
29
- if (!box) return null;
30
- const kr = anchor.knob ? stage.pageRectToScreen(anchor.pon, {
31
- x: anchor.knob.x,
32
- y: anchor.knob.y,
33
- width: 0,
34
- height: 0
35
- }) : null;
36
- const pos = positionMenuAroundRect(box, placement, gap, kr ? {
37
- x: kr.x,
38
- y: kr.y
39
- } : null);
40
- return /* @__PURE__ */ jsx("div", {
41
- ref,
42
- style: {
43
- position: "absolute",
44
- left: pos.left,
45
- top: pos.top,
46
- transform: pos.transform,
47
- pointerEvents: "auto"
23
+ return /* @__PURE__ */ jsx(Anchored, {
24
+ anchor: {
25
+ pon: anchor.pon,
26
+ bounds: anchor.bounds,
27
+ ...anchor.knob ? { avoid: [anchor.knob] } : {}
48
28
  },
49
- children: children({
50
- selected,
51
- deleteSelection: anno.deleteSelection,
52
- deselect: anno.deselect,
53
- updateSelection: anno.updateSelection,
54
- rotate90: anno.rotateSelection90,
55
- resetRotation: anno.resetSelectionRotation,
56
- group: anno.group,
57
- ungroup: anno.ungroup,
58
- canGroup: anno.canGroup(),
59
- canUngroup: anno.canUngroup()
60
- })
29
+ placement,
30
+ gap,
31
+ children
61
32
  });
62
33
  }
34
+ /** Floats over a live multi-click creation draft (polygon, polyline, …). */
63
35
  function AnnotationDraftMenu({ children, gap = 8, placement = "top" }) {
64
- const stage = useCapability(StageToken);
65
- const anno = useCapability(AnnotationToken);
66
- useSelector(StageToken, (c) => c.visiblePages());
67
36
  const anchor = useSelector(AnnotationToken, (c) => c.creationDraftAnchor(), sameCreationDraftAnchor);
68
- const ref = useRef(null);
69
- useEffect(() => {
70
- const el = ref.current;
71
- if (!el) return;
72
- const stop = (e) => e.stopPropagation();
73
- el.addEventListener("pointerdown", stop);
74
- return () => el.removeEventListener("pointerdown", stop);
75
- });
76
37
  if (!anchor) return null;
77
- const box = stage.pageRectToScreen(anchor.pon, anchor.bounds);
78
- if (!box) return null;
79
- const pos = positionMenuAroundRect(box, placement, gap);
80
- return /* @__PURE__ */ jsx("div", {
81
- ref,
82
- style: {
83
- position: "absolute",
84
- left: pos.left,
85
- top: pos.top,
86
- transform: pos.transform,
87
- pointerEvents: "auto"
88
- },
89
- children: children({
90
- ...anchor,
91
- finish: anno.finishCreationDraft,
92
- cancel: anno.cancelCreationDraft
93
- })
38
+ return /* @__PURE__ */ jsx(Anchored, {
39
+ anchor,
40
+ placement,
41
+ gap,
42
+ children: children(anchor)
94
43
  });
95
44
  }
96
45
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-menu.js","names":["AnnotationHostToken"],"sources":["../src/annotation-menu.tsx"],"sourcesContent":["/**\n * <AnnotationMenu> — the DEFAULT, Stage-bound selection menu.\n *\n * Marker-style: it transforms the selected content rect through the Stage camera\n * and renders an upright menu in viewport space. Mount it in the Stage `overlay`\n * slot. It re-renders on `visiblePages()`, so it tracks pan/zoom and page\n * rotation/layout changes with no DOM measurement, no portal, no scroll listeners.\n *\n * This module is the ONLY annotation menu that imports `@embedpdf/plugin-stage`.\n * For a Stage-free `<PageView>`, use `<PageAnnotationMenu>` from\n * `@embedpdf/react/annotation` instead.\n */\nimport * as React from 'react';\nimport { useEffect, useRef } from 'react';\nimport { StageToken } from '@embedpdf/plugin-stage';\nimport { AnnotationToken as AnnotationHostToken } from '@embedpdf/plugin-annotation/internal';\nimport { useCapability, useSelector } from './runtime';\nimport {\n sameAnchor,\n sameCreationDraftAnchor,\n useAnnotationSelected,\n type AnnotationDraftMenuProps,\n type AnnotationMenuProps,\n} from './annotation';\nimport { positionMenuAroundRect } from './internal/annotation-menu-position';\n\nexport function AnnotationMenu({ children, gap = 15, placement = 'top' }: AnnotationMenuProps) {\n const stage = useCapability(StageToken);\n const anno = useCapability(AnnotationHostToken);\n // Reposition on pan/zoom AND rotation/layout changes. `visiblePages()` folds in\n // the scene key, camera, viewport, and DPR, while staying referentially stable.\n useSelector(StageToken, (c) => c.visiblePages());\n // Two-step anchor resolve: the pon comes from the scale-less anchor, then the\n // knob is re-projected with THAT page's view scale so the menu dodges the knob\n // where it actually renders (screen-constant stalk).\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => {\n const a = c.selectionAnchor();\n if (!a) return null;\n const t = stage.pageRect(a.pon)?.transform;\n return t?.viewScale ? c.selectionAnchor(t.viewScale, t.rotation, t.zoom) : a;\n },\n sameAnchor,\n );\n const selected = useAnnotationSelected();\n\n // Isolate the menu from the Stage's pointer forwarding: a pointerdown inside it\n // must NOT bubble up to the Stage container's NATIVE listener, which would\n // forward to the interaction hub and read it as a click-outside → deselect (and\n // unmount this menu). Native listener (not React's) so it runs during real DOM\n // bubbling, before the Stage's own native listener on the ancestor. Inner button\n // `onClick` still fires — `click` is a separate event that reaches React's root.\n const ref = useRef<HTMLDivElement>(null);\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 if (!anchor) return null;\n const box = stage.pageRectToScreen(anchor.pon, anchor.bounds);\n if (!box) return null;\n // Transform the knob via a zero-size rect so page rotation is respected; the\n // menu then nudges only the edge it sits on (and only if the knob protrudes).\n const kr = anchor.knob\n ? stage.pageRectToScreen(anchor.pon, {\n x: anchor.knob.x,\n y: anchor.knob.y,\n width: 0,\n height: 0,\n })\n : null;\n const pos = positionMenuAroundRect(box, placement, gap, kr ? { x: kr.x, y: kr.y } : null);\n return (\n <div\n ref={ref}\n style={{\n position: 'absolute',\n left: pos.left,\n top: pos.top,\n transform: pos.transform,\n pointerEvents: 'auto',\n }}\n >\n {children({\n selected,\n deleteSelection: anno.deleteSelection,\n deselect: anno.deselect,\n updateSelection: anno.updateSelection,\n rotate90: anno.rotateSelection90,\n resetRotation: anno.resetSelectionRotation,\n group: anno.group,\n ungroup: anno.ungroup,\n canGroup: anno.canGroup(),\n canUngroup: anno.canUngroup(),\n })}\n </div>\n );\n}\n\nexport function AnnotationDraftMenu({\n children,\n gap = 8,\n placement = 'top',\n}: AnnotationDraftMenuProps) {\n const stage = useCapability(StageToken);\n const anno = useCapability(AnnotationHostToken);\n useSelector(StageToken, (c) => c.visiblePages());\n const anchor = useSelector(\n AnnotationHostToken,\n (c) => c.creationDraftAnchor(),\n sameCreationDraftAnchor,\n );\n\n const ref = useRef<HTMLDivElement>(null);\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 if (!anchor) return null;\n const box = stage.pageRectToScreen(anchor.pon, anchor.bounds);\n if (!box) return null;\n const pos = positionMenuAroundRect(box, placement, gap);\n return (\n <div\n ref={ref}\n style={{\n position: 'absolute',\n left: pos.left,\n top: pos.top,\n transform: pos.transform,\n pointerEvents: 'auto',\n }}\n >\n {children({\n ...anchor,\n finish: anno.finishCreationDraft,\n cancel: anno.cancelCreationDraft,\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;AA0BA,SAAgB,eAAe,EAAE,UAAU,MAAM,IAAI,YAAY,SAA8B;CAC7F,MAAM,QAAQ,cAAc,UAAU;CACtC,MAAM,OAAO,cAAcA,eAAmB;CAG9C,YAAY,aAAa,MAAM,EAAE,aAAa,CAAC;CAI/C,MAAM,SAAS,YACbA,kBACC,MAAM;EACL,MAAM,IAAI,EAAE,gBAAgB;EAC5B,IAAI,CAAC,GAAG,OAAO;EACf,MAAM,IAAI,MAAM,SAAS,EAAE,GAAG,CAAC,EAAE;EACjC,OAAO,GAAG,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,IAAI;CAC7E,GACA,UACF;CACA,MAAM,WAAW,sBAAsB;CAQvC,MAAM,MAAM,OAAuB,IAAI;CACvC,gBAAgB;EACd,MAAM,KAAK,IAAI;EACf,IAAI,CAAC,IAAI;EACT,MAAM,QAAQ,MAAa,EAAE,gBAAgB;EAC7C,GAAG,iBAAiB,eAAe,IAAI;EACvC,aAAa,GAAG,oBAAoB,eAAe,IAAI;CACzD,CAAC;CAED,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,MAAM,MAAM,iBAAiB,OAAO,KAAK,OAAO,MAAM;CAC5D,IAAI,CAAC,KAAK,OAAO;CAGjB,MAAM,KAAK,OAAO,OACd,MAAM,iBAAiB,OAAO,KAAK;EACjC,GAAG,OAAO,KAAK;EACf,GAAG,OAAO,KAAK;EACf,OAAO;EACP,QAAQ;CACV,CAAC,IACD;CACJ,MAAM,MAAM,uBAAuB,KAAK,WAAW,KAAK,KAAK;EAAE,GAAG,GAAG;EAAG,GAAG,GAAG;CAAE,IAAI,IAAI;CACxF,OACE,oBAAC,OAAD;EACO;EACL,OAAO;GACL,UAAU;GACV,MAAM,IAAI;GACV,KAAK,IAAI;GACT,WAAW,IAAI;GACf,eAAe;EACjB;EAEC,UAAA,SAAS;GACR;GACA,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,iBAAiB,KAAK;GACtB,UAAU,KAAK;GACf,eAAe,KAAK;GACpB,OAAO,KAAK;GACZ,SAAS,KAAK;GACd,UAAU,KAAK,SAAS;GACxB,YAAY,KAAK,WAAW;EAC9B,CAAC;CACE,CAAA;AAET;AAEA,SAAgB,oBAAoB,EAClC,UACA,MAAM,GACN,YAAY,SACe;CAC3B,MAAM,QAAQ,cAAc,UAAU;CACtC,MAAM,OAAO,cAAcA,eAAmB;CAC9C,YAAY,aAAa,MAAM,EAAE,aAAa,CAAC;CAC/C,MAAM,SAAS,YACbA,kBACC,MAAM,EAAE,oBAAoB,GAC7B,uBACF;CAEA,MAAM,MAAM,OAAuB,IAAI;CACvC,gBAAgB;EACd,MAAM,KAAK,IAAI;EACf,IAAI,CAAC,IAAI;EACT,MAAM,QAAQ,MAAa,EAAE,gBAAgB;EAC7C,GAAG,iBAAiB,eAAe,IAAI;EACvC,aAAa,GAAG,oBAAoB,eAAe,IAAI;CACzD,CAAC;CAED,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,MAAM,MAAM,iBAAiB,OAAO,KAAK,OAAO,MAAM;CAC5D,IAAI,CAAC,KAAK,OAAO;CACjB,MAAM,MAAM,uBAAuB,KAAK,WAAW,GAAG;CACtD,OACE,oBAAC,OAAD;EACO;EACL,OAAO;GACL,UAAU;GACV,MAAM,IAAI;GACV,KAAK,IAAI;GACT,WAAW,IAAI;GACf,eAAe;EACjB;EAEC,UAAA,SAAS;GACR,GAAG;GACH,QAAQ,KAAK;GACb,QAAQ,KAAK;EACf,CAAC;CACE,CAAA;AAET"}
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/internal';\nimport type { CreationDraftAnchor } from '@embedpdf/core-annotation';\nimport { Anchored, useProjectorBinding, type AnchoredPlacement } from './anchored';\nimport { useSelector } from './runtime';\nimport { sameAnchor, sameCreationDraftAnchor } from './annotation';\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"}