@embedpdf/plugin-annotation 1.4.1 → 2.0.0-next.0

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 (106) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1760 -1444
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/actions.d.ts +58 -19
  6. package/dist/lib/annotation-plugin.d.ts +14 -5
  7. package/dist/lib/index.d.ts +1 -1
  8. package/dist/lib/reducer.d.ts +2 -1
  9. package/dist/lib/selectors.d.ts +10 -8
  10. package/dist/lib/types.d.ts +53 -10
  11. package/dist/preact/index.cjs +1 -1
  12. package/dist/preact/index.cjs.map +1 -1
  13. package/dist/preact/index.js +96 -48
  14. package/dist/preact/index.js.map +1 -1
  15. package/dist/react/index.cjs +1 -1
  16. package/dist/react/index.cjs.map +1 -1
  17. package/dist/react/index.js +96 -48
  18. package/dist/react/index.js.map +1 -1
  19. package/dist/shared/components/annotation-container.d.ts +4 -3
  20. package/dist/shared/components/annotation-layer.d.ts +7 -7
  21. package/dist/shared/components/annotation-paint-layer.d.ts +2 -1
  22. package/dist/shared/components/annotations/stamp.d.ts +2 -1
  23. package/dist/shared/components/annotations.d.ts +3 -2
  24. package/dist/shared/components/render-annotation.d.ts +2 -1
  25. package/dist/shared/components/text-markup.d.ts +2 -1
  26. package/dist/shared/components/types.d.ts +7 -7
  27. package/dist/shared/hooks/use-annotation.d.ts +8 -4
  28. package/dist/shared/index.d.ts +1 -0
  29. package/dist/shared-preact/components/annotation-container.d.ts +4 -3
  30. package/dist/shared-preact/components/annotation-layer.d.ts +7 -7
  31. package/dist/shared-preact/components/annotation-paint-layer.d.ts +2 -1
  32. package/dist/shared-preact/components/annotations/stamp.d.ts +2 -1
  33. package/dist/shared-preact/components/annotations.d.ts +3 -2
  34. package/dist/shared-preact/components/render-annotation.d.ts +2 -1
  35. package/dist/shared-preact/components/text-markup.d.ts +2 -1
  36. package/dist/shared-preact/components/types.d.ts +7 -7
  37. package/dist/shared-preact/hooks/use-annotation.d.ts +8 -4
  38. package/dist/shared-preact/index.d.ts +1 -0
  39. package/dist/shared-react/components/annotation-container.d.ts +4 -3
  40. package/dist/shared-react/components/annotation-layer.d.ts +7 -7
  41. package/dist/shared-react/components/annotation-paint-layer.d.ts +2 -1
  42. package/dist/shared-react/components/annotations/stamp.d.ts +2 -1
  43. package/dist/shared-react/components/annotations.d.ts +3 -2
  44. package/dist/shared-react/components/render-annotation.d.ts +2 -1
  45. package/dist/shared-react/components/text-markup.d.ts +2 -1
  46. package/dist/shared-react/components/types.d.ts +7 -7
  47. package/dist/shared-react/hooks/use-annotation.d.ts +8 -4
  48. package/dist/shared-react/index.d.ts +1 -0
  49. package/dist/svelte/components/AnnotationContainer.svelte.d.ts +26 -0
  50. package/dist/svelte/components/AnnotationLayer.svelte.d.ts +27 -0
  51. package/dist/svelte/components/AnnotationPaintLayer.svelte.d.ts +8 -0
  52. package/dist/svelte/components/Annotations.svelte.d.ts +22 -0
  53. package/dist/svelte/components/PreviewRenderer.svelte.d.ts +8 -0
  54. package/dist/svelte/components/RenderAnnotation.svelte.d.ts +13 -0
  55. package/dist/svelte/components/TextMarkup.svelte.d.ts +8 -0
  56. package/dist/svelte/components/annotations/Circle.svelte.d.ts +26 -0
  57. package/dist/svelte/components/annotations/FreeText.svelte.d.ts +15 -0
  58. package/dist/svelte/components/annotations/Ink.svelte.d.ts +14 -0
  59. package/dist/svelte/components/annotations/Line.svelte.d.ts +18 -0
  60. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +19 -0
  61. package/dist/svelte/components/annotations/Polyline.svelte.d.ts +17 -0
  62. package/dist/svelte/components/annotations/Square.svelte.d.ts +16 -0
  63. package/dist/svelte/components/annotations/Stamp.svelte.d.ts +13 -0
  64. package/dist/svelte/components/annotations/index.d.ts +8 -0
  65. package/dist/svelte/components/index.d.ts +9 -0
  66. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +13 -0
  67. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +13 -0
  68. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +13 -0
  69. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +13 -0
  70. package/dist/svelte/components/text-markup/index.d.ts +4 -0
  71. package/dist/svelte/components/types.d.ts +32 -0
  72. package/dist/svelte/hooks/index.d.ts +1 -0
  73. package/dist/svelte/hooks/use-annotation.svelte.d.ts +21 -0
  74. package/dist/svelte/index.cjs +2 -0
  75. package/dist/svelte/index.cjs.map +1 -0
  76. package/dist/svelte/index.d.ts +4 -0
  77. package/dist/svelte/index.js +3083 -0
  78. package/dist/svelte/index.js.map +1 -0
  79. package/dist/svelte/types.d.ts +54 -0
  80. package/dist/vue/components/annotation-container.vue.d.ts +10 -5
  81. package/dist/vue/components/annotation-layer.vue.d.ts +13 -7
  82. package/dist/vue/components/annotation-paint-layer.vue.d.ts +3 -1
  83. package/dist/vue/components/annotations/circle.vue.d.ts +2 -1
  84. package/dist/vue/components/annotations/free-text.vue.d.ts +2 -1
  85. package/dist/vue/components/annotations/ink.vue.d.ts +2 -1
  86. package/dist/vue/components/annotations/line.vue.d.ts +2 -1
  87. package/dist/vue/components/annotations/polygon.vue.d.ts +2 -1
  88. package/dist/vue/components/annotations/polyline.vue.d.ts +2 -1
  89. package/dist/vue/components/annotations/square.vue.d.ts +2 -1
  90. package/dist/vue/components/annotations/stamp.vue.d.ts +3 -1
  91. package/dist/vue/components/annotations.vue.d.ts +7 -3
  92. package/dist/vue/components/preview-renderer.vue.d.ts +2 -1
  93. package/dist/vue/components/render-annotation.vue.d.ts +3 -1
  94. package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -1
  95. package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -1
  96. package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -1
  97. package/dist/vue/components/text-markup/underline.vue.d.ts +2 -1
  98. package/dist/vue/components/text-markup.vue.d.ts +3 -1
  99. package/dist/vue/hooks/use-annotation.d.ts +21 -2682
  100. package/dist/vue/index.cjs +1 -1
  101. package/dist/vue/index.cjs.map +1 -1
  102. package/dist/vue/index.d.ts +1 -0
  103. package/dist/vue/index.js +354 -250
  104. package/dist/vue/index.js.map +1 -1
  105. package/dist/vue/types.d.ts +23 -0
  106. package/package.json +20 -12
@@ -1,31 +1,38 @@
1
- import { usePlugin, useCapability } from "@embedpdf/core/preact";
2
- import { AnnotationPlugin, initialState, patching, getAnnotationsByPageIndex, getSelectedAnnotationByPageIndex, isInk, isSquare, isCircle, isUnderline, isStrikeout, isSquiggly, isHighlight, isLine, isPolyline, isPolygon, isFreeText, isStamp } from "@embedpdf/plugin-annotation";
1
+ import { usePlugin, useCapability, useDocumentState } from "@embedpdf/core/preact";
2
+ import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationByPageIndex, isInk, isSquare, isCircle, isUnderline, isStrikeout, isSquiggly, isHighlight, isLine, isPolyline, isPolygon, isFreeText, isStamp } from "@embedpdf/plugin-annotation";
3
3
  export * from "@embedpdf/plugin-annotation";
4
4
  import { Fragment as Fragment$1 } from "preact";
5
5
  import { useState, useEffect, useRef, useMemo, useLayoutEffect, useCallback } from "preact/hooks";
6
6
  import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
7
- import { PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype } from "@embedpdf/models";
7
+ import { PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype, Rotation } from "@embedpdf/models";
8
8
  import { usePointerHandlers } from "@embedpdf/plugin-interaction-manager/preact";
9
9
  import { useSelectionCapability } from "@embedpdf/plugin-selection/preact";
10
10
  import { useInteractionHandles, useDoublePressProps, CounterRotate } from "@embedpdf/utils/preact";
11
11
  const suppressContentEditableWarningProps = {};
12
12
  const useAnnotationPlugin = () => usePlugin(AnnotationPlugin.id);
13
13
  const useAnnotationCapability = () => useCapability(AnnotationPlugin.id);
14
- const useAnnotation = () => {
14
+ const useAnnotation = (documentId) => {
15
+ var _a;
15
16
  const { provides } = useAnnotationCapability();
16
- const [state, setState] = useState(initialState({ enabled: true }));
17
+ const [state, setState] = useState(
18
+ ((_a = provides == null ? void 0 : provides.forDocument(documentId)) == null ? void 0 : _a.getState()) ?? initialDocumentState()
19
+ );
17
20
  useEffect(() => {
18
- return provides == null ? void 0 : provides.onStateChange((action) => {
19
- setState(action);
21
+ if (!provides) return;
22
+ const scope = provides.forDocument(documentId);
23
+ setState(scope.getState());
24
+ return scope.onStateChange((newState) => {
25
+ setState(newState);
20
26
  });
21
- }, [provides]);
27
+ }, [provides, documentId]);
22
28
  return {
23
29
  state,
24
- provides
30
+ provides: (provides == null ? void 0 : provides.forDocument(documentId)) ?? null
25
31
  };
26
32
  };
27
33
  function AnnotationContainer({
28
34
  scale,
35
+ documentId,
29
36
  pageIndex,
30
37
  rotation,
31
38
  pageWidth,
@@ -50,8 +57,12 @@ function AnnotationContainer({
50
57
  ...props
51
58
  }) {
52
59
  const [preview, setPreview] = useState(trackedAnnotation.object);
53
- const { provides: annotationProvides } = useAnnotationCapability();
60
+ const { provides: annotationCapability } = useAnnotationCapability();
54
61
  const gestureBaseRef = useRef(null);
62
+ const annotationProvides = useMemo(
63
+ () => annotationCapability ? annotationCapability.forDocument(documentId) : null,
64
+ [annotationCapability, documentId]
65
+ );
55
66
  const currentObject = preview ? { ...trackedAnnotation.object, ...preview } : trackedAnnotation.object;
56
67
  const HANDLE_COLOR = (resizeUI == null ? void 0 : resizeUI.color) ?? "#007ACC";
57
68
  const VERTEX_COLOR = (vertexUI == null ? void 0 : vertexUI.color) ?? "#007ACC";
@@ -64,7 +75,7 @@ function AnnotationContainer({
64
75
  constraints: {
65
76
  minWidth: 10,
66
77
  minHeight: 10,
67
- boundingBox: { width: pageWidth / scale, height: pageHeight / scale }
78
+ boundingBox: { width: pageWidth, height: pageHeight }
68
79
  },
69
80
  maintainAspectRatio: lockAspectRatio,
70
81
  pageRotation: rotation,
@@ -79,7 +90,7 @@ function AnnotationContainer({
79
90
  const transformType = event.transformData.type;
80
91
  const base = gestureBaseRef.current ?? currentObject;
81
92
  const changes = event.transformData.changes.vertices ? vertexConfig == null ? void 0 : vertexConfig.transformAnnotation(base, event.transformData.changes.vertices) : { rect: event.transformData.changes.rect };
82
- const patched = annotationProvides == null ? void 0 : annotationProvides.transformAnnotation(base, {
93
+ const patched = annotationCapability == null ? void 0 : annotationCapability.transformAnnotation(base, {
83
94
  type: transformType,
84
95
  changes,
85
96
  metadata: event.transformData.metadata
@@ -184,7 +195,7 @@ function AnnotationContainer({
184
195
  ]
185
196
  }
186
197
  ),
187
- /* @__PURE__ */ jsx(
198
+ selectionMenu && /* @__PURE__ */ jsx(
188
199
  CounterRotate,
189
200
  {
190
201
  rect: {
@@ -198,11 +209,17 @@ function AnnotationContainer({
198
209
  }
199
210
  },
200
211
  rotation,
201
- children: ({ rect, menuWrapperProps }) => selectionMenu && selectionMenu({
202
- annotation: trackedAnnotation,
212
+ children: (props2) => selectionMenu({
213
+ ...props2,
214
+ context: {
215
+ type: "annotation",
216
+ annotation: trackedAnnotation,
217
+ pageIndex
218
+ },
203
219
  selected: isSelected,
204
- rect,
205
- menuWrapperProps
220
+ placement: {
221
+ suggestTop: false
222
+ }
206
223
  })
207
224
  }
208
225
  )
@@ -992,6 +1009,7 @@ function FreeText({
992
1009
  );
993
1010
  }
994
1011
  function RenderAnnotation({
1012
+ documentId,
995
1013
  pageIndex,
996
1014
  annotation,
997
1015
  scaleFactor = 1,
@@ -1004,7 +1022,7 @@ function RenderAnnotation({
1004
1022
  const { width, height } = annotation.rect.size;
1005
1023
  useEffect(() => {
1006
1024
  if (annotationProvides) {
1007
- const task = annotationProvides.renderAnnotation({
1025
+ const task = annotationProvides.forDocument(documentId).renderAnnotation({
1008
1026
  pageIndex,
1009
1027
  annotation,
1010
1028
  options: {
@@ -1029,7 +1047,7 @@ function RenderAnnotation({
1029
1047
  }
1030
1048
  };
1031
1049
  }
1032
- }, [pageIndex, scaleFactor, annotationProvides, annotation.id, width, height]);
1050
+ }, [pageIndex, scaleFactor, annotationProvides, documentId, annotation.id, width, height]);
1033
1051
  const handleImageLoad = () => {
1034
1052
  if (urlRef.current) {
1035
1053
  URL.revokeObjectURL(urlRef.current);
@@ -1051,7 +1069,14 @@ function RenderAnnotation({
1051
1069
  }
1052
1070
  ) });
1053
1071
  }
1054
- function Stamp({ isSelected, annotation, pageIndex, scale, onClick }) {
1072
+ function Stamp({
1073
+ isSelected,
1074
+ annotation,
1075
+ documentId,
1076
+ pageIndex,
1077
+ scale,
1078
+ onClick
1079
+ }) {
1055
1080
  return /* @__PURE__ */ jsx(
1056
1081
  "div",
1057
1082
  {
@@ -1068,6 +1093,7 @@ function Stamp({ isSelected, annotation, pageIndex, scale, onClick }) {
1068
1093
  children: /* @__PURE__ */ jsx(
1069
1094
  RenderAnnotation,
1070
1095
  {
1096
+ documentId,
1071
1097
  pageIndex,
1072
1098
  annotation: { ...annotation.object, id: annotation.object.id },
1073
1099
  scaleFactor: scale
@@ -1077,21 +1103,28 @@ function Stamp({ isSelected, annotation, pageIndex, scale, onClick }) {
1077
1103
  );
1078
1104
  }
1079
1105
  function Annotations(annotationsProps) {
1080
- const { pageIndex, scale, selectionMenu } = annotationsProps;
1081
- const { provides: annotationProvides } = useAnnotationCapability();
1106
+ const { documentId, pageIndex, scale, selectionMenu } = annotationsProps;
1107
+ const { provides: annotationCapability } = useAnnotationCapability();
1082
1108
  const { provides: selectionProvides } = useSelectionCapability();
1083
1109
  const [annotations, setAnnotations] = useState([]);
1084
- const { register } = usePointerHandlers({ pageIndex });
1110
+ const { register } = usePointerHandlers({ documentId, pageIndex });
1085
1111
  const [selectionState, setSelectionState] = useState(null);
1086
1112
  const [editingId, setEditingId] = useState(null);
1113
+ const annotationProvides = useMemo(
1114
+ () => annotationCapability ? annotationCapability.forDocument(documentId) : null,
1115
+ [annotationCapability, documentId]
1116
+ );
1087
1117
  useEffect(() => {
1088
1118
  if (annotationProvides) {
1089
- annotationProvides.onStateChange((state) => {
1119
+ const currentState = annotationProvides.getState();
1120
+ setAnnotations(getAnnotationsByPageIndex(currentState, pageIndex));
1121
+ setSelectionState(getSelectedAnnotationByPageIndex(currentState, pageIndex));
1122
+ return annotationProvides.onStateChange((state) => {
1090
1123
  setAnnotations(getAnnotationsByPageIndex(state, pageIndex));
1091
1124
  setSelectionState(getSelectedAnnotationByPageIndex(state, pageIndex));
1092
1125
  });
1093
1126
  }
1094
- }, [annotationProvides]);
1127
+ }, [annotationProvides, pageIndex]);
1095
1128
  const handlers = useMemo(
1096
1129
  () => ({
1097
1130
  onPointerDown: (_, pe) => {
@@ -1117,7 +1150,9 @@ function Annotations(annotationsProps) {
1117
1150
  [annotationProvides, selectionProvides, editingId, pageIndex]
1118
1151
  );
1119
1152
  useEffect(() => {
1120
- return register(handlers);
1153
+ return register(handlers, {
1154
+ documentId
1155
+ });
1121
1156
  }, [register, handlers]);
1122
1157
  return /* @__PURE__ */ jsx(Fragment, { children: annotations.map((annotation) => {
1123
1158
  const isSelected = (selectionState == null ? void 0 : selectionState.object.id) === annotation.object.id;
@@ -1465,6 +1500,7 @@ function Annotations(annotationsProps) {
1465
1500
  {
1466
1501
  isSelected,
1467
1502
  annotation,
1503
+ documentId,
1468
1504
  pageIndex,
1469
1505
  scale,
1470
1506
  onClick: (e) => handleClick(e, annotation)
@@ -1477,7 +1513,7 @@ function Annotations(annotationsProps) {
1477
1513
  return null;
1478
1514
  }) });
1479
1515
  }
1480
- function TextMarkup({ pageIndex, scale }) {
1516
+ function TextMarkup({ documentId, pageIndex, scale }) {
1481
1517
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1482
1518
  const { provides: selectionProvides } = useSelectionCapability();
1483
1519
  const { provides: annotationProvides } = useAnnotationCapability();
@@ -1486,17 +1522,16 @@ function TextMarkup({ pageIndex, scale }) {
1486
1522
  const [activeTool, setActiveTool] = useState(null);
1487
1523
  useEffect(() => {
1488
1524
  if (!selectionProvides) return;
1489
- const off = selectionProvides.onSelectionChange(() => {
1490
- setRects(selectionProvides.getHighlightRectsForPage(pageIndex));
1491
- setBoundingRect(selectionProvides.getBoundingRectForPage(pageIndex));
1525
+ return selectionProvides.forDocument(documentId).onSelectionChange(() => {
1526
+ setRects(selectionProvides.forDocument(documentId).getHighlightRectsForPage(pageIndex));
1527
+ setBoundingRect(selectionProvides.forDocument(documentId).getBoundingRectForPage(pageIndex));
1492
1528
  });
1493
- return off;
1494
- }, [selectionProvides, pageIndex]);
1529
+ }, [selectionProvides, documentId, pageIndex]);
1495
1530
  useEffect(() => {
1496
1531
  if (!annotationProvides) return;
1497
- const off = annotationProvides.onActiveToolChange(setActiveTool);
1498
- return off;
1499
- }, [annotationProvides]);
1532
+ setActiveTool(annotationProvides.forDocument(documentId).getActiveTool());
1533
+ return annotationProvides.forDocument(documentId).onActiveToolChange((event) => setActiveTool(event));
1534
+ }, [annotationProvides, documentId]);
1500
1535
  if (!boundingRect) return null;
1501
1536
  if (!activeTool || !activeTool.defaults) return null;
1502
1537
  switch (activeTool.defaults.type) {
@@ -1632,7 +1667,7 @@ function PreviewRenderer({ preview, scale }) {
1632
1667
  }
1633
1668
  return null;
1634
1669
  }
1635
- function AnnotationPaintLayer({ pageIndex, scale }) {
1670
+ function AnnotationPaintLayer({ documentId, pageIndex, scale }) {
1636
1671
  const { plugin: annotationPlugin } = useAnnotationPlugin();
1637
1672
  const [previews, setPreviews] = useState(/* @__PURE__ */ new Map());
1638
1673
  const fileInputRef = useRef(null);
@@ -1681,7 +1716,7 @@ function AnnotationPaintLayer({ pageIndex, scale }) {
1681
1716
  );
1682
1717
  useEffect(() => {
1683
1718
  if (!annotationPlugin) return;
1684
- return annotationPlugin.registerPageHandlers(pageIndex, scale, {
1719
+ return annotationPlugin.registerPageHandlers(documentId, pageIndex, scale, {
1685
1720
  services,
1686
1721
  onPreview: (toolId, state) => {
1687
1722
  setPreviews((prev) => {
@@ -1695,7 +1730,7 @@ function AnnotationPaintLayer({ pageIndex, scale }) {
1695
1730
  });
1696
1731
  }
1697
1732
  });
1698
- }, [pageIndex, scale, annotationPlugin, services]);
1733
+ }, [documentId, pageIndex, scale, annotationPlugin, services]);
1699
1734
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1700
1735
  /* @__PURE__ */ jsx("input", { ref: fileInputRef, type: "file", style: { display: "none" } }),
1701
1736
  /* @__PURE__ */ jsx("canvas", { ref: canvasRef, style: { display: "none" } }),
@@ -1704,18 +1739,30 @@ function AnnotationPaintLayer({ pageIndex, scale }) {
1704
1739
  }
1705
1740
  function AnnotationLayer({
1706
1741
  style,
1742
+ documentId,
1707
1743
  pageIndex,
1708
- scale,
1744
+ scale: overrideScale,
1745
+ rotation: overrideRotation,
1709
1746
  selectionMenu,
1710
1747
  resizeUI,
1711
1748
  vertexUI,
1712
- pageWidth,
1713
- pageHeight,
1714
- rotation,
1715
1749
  selectionOutlineColor,
1716
1750
  customAnnotationRenderer,
1717
1751
  ...props
1718
1752
  }) {
1753
+ var _a, _b, _c, _d;
1754
+ const documentState = useDocumentState(documentId);
1755
+ const page = (_b = (_a = documentState == null ? void 0 : documentState.document) == null ? void 0 : _a.pages) == null ? void 0 : _b[pageIndex];
1756
+ const width = ((_c = page == null ? void 0 : page.size) == null ? void 0 : _c.width) ?? 0;
1757
+ const height = ((_d = page == null ? void 0 : page.size) == null ? void 0 : _d.height) ?? 0;
1758
+ const actualScale = useMemo(() => {
1759
+ if (overrideScale !== void 0) return overrideScale;
1760
+ return (documentState == null ? void 0 : documentState.scale) ?? 1;
1761
+ }, [overrideScale, documentState == null ? void 0 : documentState.scale]);
1762
+ const actualRotation = useMemo(() => {
1763
+ if (overrideRotation !== void 0) return overrideRotation;
1764
+ return (documentState == null ? void 0 : documentState.rotation) ?? Rotation.Degree0;
1765
+ }, [overrideRotation, documentState == null ? void 0 : documentState.rotation]);
1719
1766
  return /* @__PURE__ */ jsxs(
1720
1767
  "div",
1721
1768
  {
@@ -1727,20 +1774,21 @@ function AnnotationLayer({
1727
1774
  /* @__PURE__ */ jsx(
1728
1775
  Annotations,
1729
1776
  {
1777
+ documentId,
1730
1778
  selectionMenu,
1731
1779
  pageIndex,
1732
- scale,
1733
- rotation,
1734
- pageWidth,
1735
- pageHeight,
1780
+ scale: actualScale,
1781
+ rotation: actualRotation,
1782
+ pageWidth: width,
1783
+ pageHeight: height,
1736
1784
  resizeUI,
1737
1785
  vertexUI,
1738
1786
  selectionOutlineColor,
1739
1787
  customAnnotationRenderer
1740
1788
  }
1741
1789
  ),
1742
- /* @__PURE__ */ jsx(TextMarkup, { pageIndex, scale }),
1743
- /* @__PURE__ */ jsx(AnnotationPaintLayer, { pageIndex, scale })
1790
+ /* @__PURE__ */ jsx(TextMarkup, { documentId, pageIndex, scale: actualScale }),
1791
+ /* @__PURE__ */ jsx(AnnotationPaintLayer, { documentId, pageIndex, scale: actualScale })
1744
1792
  ]
1745
1793
  }
1746
1794
  );