@embedpdf/plugin-annotation 2.2.0 → 2.3.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 (97) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1196 -92
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/actions.d.ts +31 -2
  6. package/dist/lib/annotation-plugin.d.ts +177 -2
  7. package/dist/lib/handlers/types.d.ts +1 -1
  8. package/dist/lib/helpers.d.ts +6 -1
  9. package/dist/lib/selectors.d.ts +97 -8
  10. package/dist/lib/tools/default-tools.d.ts +39 -11
  11. package/dist/lib/tools/types.d.ts +7 -1
  12. package/dist/lib/types.d.ts +265 -1
  13. package/dist/preact/adapter.d.ts +3 -3
  14. package/dist/preact/index.cjs +1 -1
  15. package/dist/preact/index.cjs.map +1 -1
  16. package/dist/preact/index.js +857 -403
  17. package/dist/preact/index.js.map +1 -1
  18. package/dist/react/adapter.d.ts +1 -1
  19. package/dist/react/index.cjs +1 -1
  20. package/dist/react/index.cjs.map +1 -1
  21. package/dist/react/index.js +857 -403
  22. package/dist/react/index.js.map +1 -1
  23. package/dist/shared/components/annotation-container.d.ts +8 -1
  24. package/dist/shared/components/annotation-layer.d.ts +4 -2
  25. package/dist/shared/components/annotations/ink.d.ts +3 -3
  26. package/dist/shared/components/annotations/link.d.ts +28 -0
  27. package/dist/shared/components/annotations.d.ts +2 -1
  28. package/dist/shared/components/group-selection-box.d.ts +32 -0
  29. package/dist/shared/components/index.d.ts +1 -0
  30. package/dist/shared/components/text-markup/highlight.d.ts +3 -2
  31. package/dist/shared/components/text-markup/squiggly.d.ts +3 -2
  32. package/dist/shared/components/text-markup/strikeout.d.ts +3 -2
  33. package/dist/shared/components/text-markup/underline.d.ts +3 -2
  34. package/dist/shared/components/types.d.ts +7 -0
  35. package/dist/shared-preact/components/annotation-container.d.ts +8 -1
  36. package/dist/shared-preact/components/annotation-layer.d.ts +4 -2
  37. package/dist/shared-preact/components/annotations/ink.d.ts +3 -3
  38. package/dist/shared-preact/components/annotations/link.d.ts +28 -0
  39. package/dist/shared-preact/components/annotations.d.ts +2 -1
  40. package/dist/shared-preact/components/group-selection-box.d.ts +32 -0
  41. package/dist/shared-preact/components/index.d.ts +1 -0
  42. package/dist/shared-preact/components/text-markup/highlight.d.ts +3 -2
  43. package/dist/shared-preact/components/text-markup/squiggly.d.ts +3 -2
  44. package/dist/shared-preact/components/text-markup/strikeout.d.ts +3 -2
  45. package/dist/shared-preact/components/text-markup/underline.d.ts +3 -2
  46. package/dist/shared-preact/components/types.d.ts +7 -0
  47. package/dist/shared-react/components/annotation-container.d.ts +8 -1
  48. package/dist/shared-react/components/annotation-layer.d.ts +4 -2
  49. package/dist/shared-react/components/annotations/ink.d.ts +3 -3
  50. package/dist/shared-react/components/annotations/link.d.ts +28 -0
  51. package/dist/shared-react/components/annotations.d.ts +2 -1
  52. package/dist/shared-react/components/group-selection-box.d.ts +32 -0
  53. package/dist/shared-react/components/index.d.ts +1 -0
  54. package/dist/shared-react/components/text-markup/highlight.d.ts +3 -2
  55. package/dist/shared-react/components/text-markup/squiggly.d.ts +3 -2
  56. package/dist/shared-react/components/text-markup/strikeout.d.ts +3 -2
  57. package/dist/shared-react/components/text-markup/underline.d.ts +3 -2
  58. package/dist/shared-react/components/types.d.ts +7 -0
  59. package/dist/svelte/components/AnnotationLayer.svelte.d.ts +5 -1
  60. package/dist/svelte/components/Annotations.svelte.d.ts +5 -1
  61. package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +32 -0
  62. package/dist/svelte/components/annotations/Ink.svelte.d.ts +2 -1
  63. package/dist/svelte/components/annotations/Link.svelte.d.ts +24 -0
  64. package/dist/svelte/components/annotations/index.d.ts +1 -0
  65. package/dist/svelte/components/index.d.ts +1 -0
  66. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +2 -1
  67. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +2 -1
  68. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +2 -1
  69. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +2 -1
  70. package/dist/svelte/components/types.d.ts +2 -0
  71. package/dist/svelte/index.cjs +1 -1
  72. package/dist/svelte/index.cjs.map +1 -1
  73. package/dist/svelte/index.js +905 -255
  74. package/dist/svelte/index.js.map +1 -1
  75. package/dist/svelte/types.d.ts +7 -0
  76. package/dist/vue/components/annotation-container.vue.d.ts +2 -0
  77. package/dist/vue/components/annotation-layer.vue.d.ts +28 -5
  78. package/dist/vue/components/annotations/index.d.ts +1 -0
  79. package/dist/vue/components/annotations/ink.vue.d.ts +2 -2
  80. package/dist/vue/components/annotations/line.vue.d.ts +1 -1
  81. package/dist/vue/components/annotations/link.vue.d.ts +29 -0
  82. package/dist/vue/components/annotations/polygon.vue.d.ts +1 -1
  83. package/dist/vue/components/annotations/polyline.vue.d.ts +1 -1
  84. package/dist/vue/components/annotations.vue.d.ts +65 -1
  85. package/dist/vue/components/group-selection-box.vue.d.ts +73 -0
  86. package/dist/vue/components/index.d.ts +1 -0
  87. package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -2
  88. package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -2
  89. package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -2
  90. package/dist/vue/components/text-markup/underline.vue.d.ts +2 -2
  91. package/dist/vue/hooks/use-annotation.d.ts +2 -0
  92. package/dist/vue/index.cjs +1 -1
  93. package/dist/vue/index.cjs.map +1 -1
  94. package/dist/vue/index.js +946 -406
  95. package/dist/vue/index.js.map +1 -1
  96. package/dist/vue/types.d.ts +7 -0
  97. package/package.json +10 -10
@@ -1,10 +1,10 @@
1
1
  import { usePlugin, useCapability, useDocumentPermissions, 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";
2
+ import { AnnotationPlugin, initialDocumentState, patching, getAnnotationsByPageIndex, getSelectedAnnotationIds, isInk, isSquare, isCircle, isUnderline, isStrikeout, isSquiggly, isHighlight, isLine, isPolyline, isPolygon, isFreeText, isStamp, isLink } from "@embedpdf/plugin-annotation";
3
3
  export * from "@embedpdf/plugin-annotation";
4
4
  import { Fragment as Fragment$1 } from "preact";
5
- import { useState, useEffect, useRef, useMemo, useLayoutEffect, useCallback } from "preact/hooks";
5
+ import { useState, useEffect, useRef, useMemo, useCallback, useLayoutEffect } from "preact/hooks";
6
6
  import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
7
- import { PdfAnnotationBorderStyle, textAlignmentToCss, standardFontCss, PdfVerticalAlignment, ignore, PdfErrorCode, blendModeToCss, PdfBlendMode, PdfAnnotationSubtype, Rotation } from "@embedpdf/models";
7
+ import { boundingRectOrEmpty, 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";
@@ -40,6 +40,7 @@ function AnnotationContainer({
40
40
  trackedAnnotation,
41
41
  children,
42
42
  isSelected,
43
+ isMultiSelected = false,
43
44
  isDraggable,
44
45
  isResizable,
45
46
  lockAspectRatio = false,
@@ -58,10 +59,11 @@ function AnnotationContainer({
58
59
  }) {
59
60
  const [preview, setPreview] = useState(trackedAnnotation.object);
60
61
  const { provides: annotationCapability } = useAnnotationCapability();
62
+ const { plugin } = useAnnotationPlugin();
61
63
  const { canModifyAnnotations } = useDocumentPermissions(documentId);
62
64
  const gestureBaseRef = useRef(null);
63
- const effectiveIsDraggable = canModifyAnnotations && isDraggable;
64
- const effectiveIsResizable = canModifyAnnotations && isResizable;
65
+ const effectiveIsDraggable = canModifyAnnotations && isDraggable && !isMultiSelected;
66
+ const effectiveIsResizable = canModifyAnnotations && isResizable && !isMultiSelected;
65
67
  const annotationProvides = useMemo(
66
68
  () => annotationCapability ? annotationCapability.forDocument(documentId) : null,
67
69
  [annotationCapability, documentId]
@@ -71,6 +73,73 @@ function AnnotationContainer({
71
73
  const VERTEX_COLOR = (vertexUI == null ? void 0 : vertexUI.color) ?? "#007ACC";
72
74
  const HANDLE_SIZE = (resizeUI == null ? void 0 : resizeUI.size) ?? 12;
73
75
  const VERTEX_SIZE = (vertexUI == null ? void 0 : vertexUI.size) ?? 12;
76
+ const gestureBaseRectRef = useRef(null);
77
+ const handleUpdate = useCallback(
78
+ (event) => {
79
+ var _a;
80
+ if (!((_a = event.transformData) == null ? void 0 : _a.type) || isMultiSelected || !plugin) return;
81
+ const { type, changes, metadata } = event.transformData;
82
+ const id = trackedAnnotation.object.id;
83
+ const pageSize = { width: pageWidth, height: pageHeight };
84
+ if (event.state === "start") {
85
+ gestureBaseRectRef.current = trackedAnnotation.object.rect;
86
+ gestureBaseRef.current = trackedAnnotation.object;
87
+ if (type === "move") {
88
+ plugin.startDrag(documentId, { annotationIds: [id], pageSize });
89
+ } else if (type === "resize") {
90
+ plugin.startResize(documentId, {
91
+ annotationIds: [id],
92
+ pageSize,
93
+ resizeHandle: (metadata == null ? void 0 : metadata.handle) ?? "se"
94
+ });
95
+ }
96
+ }
97
+ if (changes.rect && gestureBaseRectRef.current) {
98
+ if (type === "move") {
99
+ const delta = {
100
+ x: changes.rect.origin.x - gestureBaseRectRef.current.origin.x,
101
+ y: changes.rect.origin.y - gestureBaseRectRef.current.origin.y
102
+ };
103
+ plugin.updateDrag(documentId, delta);
104
+ } else if (type === "resize") {
105
+ plugin.updateResize(documentId, changes.rect);
106
+ }
107
+ }
108
+ if (type === "vertex-edit" && changes.vertices && vertexConfig) {
109
+ const base = gestureBaseRef.current ?? trackedAnnotation.object;
110
+ const vertexChanges = vertexConfig.transformAnnotation(base, changes.vertices);
111
+ const patched = annotationCapability == null ? void 0 : annotationCapability.transformAnnotation(base, {
112
+ type,
113
+ changes: vertexChanges,
114
+ metadata
115
+ });
116
+ if (patched) {
117
+ setPreview((prev) => ({ ...prev, ...patched }));
118
+ if (event.state === "end") {
119
+ annotationProvides == null ? void 0 : annotationProvides.updateAnnotation(pageIndex, id, patched);
120
+ }
121
+ }
122
+ }
123
+ if (event.state === "end") {
124
+ gestureBaseRectRef.current = null;
125
+ gestureBaseRef.current = null;
126
+ if (type === "move") plugin.commitDrag(documentId);
127
+ else if (type === "resize") plugin.commitResize(documentId);
128
+ }
129
+ },
130
+ [
131
+ plugin,
132
+ documentId,
133
+ trackedAnnotation.object,
134
+ pageWidth,
135
+ pageHeight,
136
+ pageIndex,
137
+ isMultiSelected,
138
+ vertexConfig,
139
+ annotationCapability,
140
+ annotationProvides
141
+ ]
142
+ );
74
143
  const { dragProps, vertices, resize } = useInteractionHandles({
75
144
  controller: {
76
145
  element: currentObject.rect,
@@ -83,32 +152,9 @@ function AnnotationContainer({
83
152
  maintainAspectRatio: lockAspectRatio,
84
153
  pageRotation: rotation,
85
154
  scale,
86
- enabled: isSelected,
87
- onUpdate: (event) => {
88
- var _a;
89
- if (!((_a = event.transformData) == null ? void 0 : _a.type)) return;
90
- if (event.state === "start") {
91
- gestureBaseRef.current = currentObject;
92
- }
93
- const transformType = event.transformData.type;
94
- const base = gestureBaseRef.current ?? currentObject;
95
- const changes = event.transformData.changes.vertices ? vertexConfig == null ? void 0 : vertexConfig.transformAnnotation(base, event.transformData.changes.vertices) : { rect: event.transformData.changes.rect };
96
- const patched = annotationCapability == null ? void 0 : annotationCapability.transformAnnotation(base, {
97
- type: transformType,
98
- changes,
99
- metadata: event.transformData.metadata
100
- });
101
- if (patched) {
102
- setPreview((prev) => ({
103
- ...prev,
104
- ...patched
105
- }));
106
- }
107
- if (event.state === "end" && patched) {
108
- gestureBaseRef.current = null;
109
- annotationProvides == null ? void 0 : annotationProvides.updateAnnotation(pageIndex, trackedAnnotation.object.id, patched);
110
- }
111
- }
155
+ // Disable interaction handles when multi-selected
156
+ enabled: isSelected && !isMultiSelected,
157
+ onUpdate: handleUpdate
112
158
  },
113
159
  resizeUI: {
114
160
  handleSize: HANDLE_SIZE,
@@ -131,6 +177,20 @@ function AnnotationContainer({
131
177
  useEffect(() => {
132
178
  setPreview(trackedAnnotation.object);
133
179
  }, [trackedAnnotation.object]);
180
+ useEffect(() => {
181
+ if (!plugin) return;
182
+ const id = trackedAnnotation.object.id;
183
+ const handleEvent = (event) => {
184
+ var _a;
185
+ if (event.documentId !== documentId) return;
186
+ const patch = (_a = event.previewPatches) == null ? void 0 : _a[id];
187
+ if (event.type === "update" && patch) setPreview((prev) => ({ ...prev, ...patch }));
188
+ else if (event.type === "cancel") setPreview(trackedAnnotation.object);
189
+ };
190
+ const unsubs = [plugin.onDragChange(handleEvent), plugin.onResizeChange(handleEvent)];
191
+ return () => unsubs.forEach((u) => u());
192
+ }, [plugin, documentId, trackedAnnotation.object]);
193
+ const showOutline = isSelected && !isMultiSelected;
134
194
  return /* @__PURE__ */ jsxs("div", { "data-no-interaction": true, children: [
135
195
  /* @__PURE__ */ jsxs(
136
196
  "div",
@@ -143,9 +203,9 @@ function AnnotationContainer({
143
203
  top: currentObject.rect.origin.y * scale,
144
204
  width: currentObject.rect.size.width * scale,
145
205
  height: currentObject.rect.size.height * scale,
146
- outline: isSelected ? `1px solid ${selectionOutlineColor}` : "none",
147
- outlineOffset: isSelected ? `${outlineOffset}px` : "0px",
148
- pointerEvents: isSelected ? "auto" : "none",
206
+ outline: showOutline ? `1px solid ${selectionOutlineColor}` : "none",
207
+ outlineOffset: showOutline ? `${outlineOffset}px` : "0px",
208
+ pointerEvents: isSelected && !isMultiSelected ? "auto" : "none",
149
209
  touchAction: "none",
150
210
  cursor: isSelected && effectiveIsDraggable ? "move" : "default",
151
211
  zIndex,
@@ -185,7 +245,7 @@ function AnnotationContainer({
185
245
  key
186
246
  )
187
247
  ),
188
- isSelected && canModifyAnnotations && vertices.map(
248
+ isSelected && canModifyAnnotations && !isMultiSelected && vertices.map(
189
249
  ({ key, ...vProps }) => (vertexUI == null ? void 0 : vertexUI.component) ? vertexUI.component({
190
250
  key,
191
251
  ...vProps,
@@ -202,7 +262,7 @@ function AnnotationContainer({
202
262
  ]
203
263
  }
204
264
  ),
205
- selectionMenu && /* @__PURE__ */ jsx(
265
+ selectionMenu && !isMultiSelected && /* @__PURE__ */ jsx(
206
266
  CounterRotate,
207
267
  {
208
268
  rect: {
@@ -216,8 +276,8 @@ function AnnotationContainer({
216
276
  }
217
277
  },
218
278
  rotation,
219
- children: (props2) => selectionMenu({
220
- ...props2,
279
+ children: (counterRotateProps) => selectionMenu({
280
+ ...counterRotateProps,
221
281
  context: {
222
282
  type: "annotation",
223
283
  annotation: trackedAnnotation,
@@ -232,8 +292,194 @@ function AnnotationContainer({
232
292
  )
233
293
  ] });
234
294
  }
295
+ function GroupSelectionBox({
296
+ documentId,
297
+ pageIndex,
298
+ scale,
299
+ rotation,
300
+ pageWidth,
301
+ pageHeight,
302
+ selectedAnnotations,
303
+ isDraggable,
304
+ isResizable,
305
+ resizeUI,
306
+ selectionOutlineColor = "#007ACC",
307
+ outlineOffset = 2,
308
+ zIndex = 100,
309
+ groupSelectionMenu
310
+ }) {
311
+ const { plugin } = useAnnotationPlugin();
312
+ const gestureBaseRef = useRef(null);
313
+ const isDraggingRef = useRef(false);
314
+ const isResizingRef = useRef(false);
315
+ const groupBox = useMemo(() => {
316
+ const rects = selectedAnnotations.map((ta) => ta.object.rect);
317
+ return boundingRectOrEmpty(rects);
318
+ }, [selectedAnnotations]);
319
+ const [previewGroupBox, setPreviewGroupBox] = useState(groupBox);
320
+ useEffect(() => {
321
+ if (!isDraggingRef.current && !isResizingRef.current) {
322
+ setPreviewGroupBox(groupBox);
323
+ }
324
+ }, [groupBox]);
325
+ const handleUpdate = useCallback(
326
+ (event) => {
327
+ var _a, _b;
328
+ if (!((_a = event.transformData) == null ? void 0 : _a.type)) return;
329
+ if (!plugin) return;
330
+ const transformType = event.transformData.type;
331
+ const isMove = transformType === "move";
332
+ const isResize = transformType === "resize";
333
+ if (isMove && !isDraggable) return;
334
+ if (event.state === "start") {
335
+ gestureBaseRef.current = groupBox;
336
+ if (isMove) {
337
+ isDraggingRef.current = true;
338
+ plugin.startDrag(documentId, {
339
+ annotationIds: selectedAnnotations.map((ta) => ta.object.id),
340
+ pageSize: { width: pageWidth, height: pageHeight }
341
+ });
342
+ } else if (isResize) {
343
+ isResizingRef.current = true;
344
+ plugin.startResize(documentId, {
345
+ annotationIds: selectedAnnotations.map((ta) => ta.object.id),
346
+ pageSize: { width: pageWidth, height: pageHeight },
347
+ resizeHandle: ((_b = event.transformData.metadata) == null ? void 0 : _b.handle) ?? "se"
348
+ });
349
+ }
350
+ }
351
+ const base = gestureBaseRef.current ?? groupBox;
352
+ if (isMove && event.transformData.changes.rect) {
353
+ const newRect = event.transformData.changes.rect;
354
+ const rawDelta = {
355
+ x: newRect.origin.x - base.origin.x,
356
+ y: newRect.origin.y - base.origin.y
357
+ };
358
+ const clampedDelta = plugin.updateDrag(documentId, rawDelta);
359
+ setPreviewGroupBox({
360
+ ...base,
361
+ origin: {
362
+ x: base.origin.x + clampedDelta.x,
363
+ y: base.origin.y + clampedDelta.y
364
+ }
365
+ });
366
+ } else if (isResize && event.transformData.changes.rect) {
367
+ const newGroupBox = event.transformData.changes.rect;
368
+ plugin.updateResize(documentId, newGroupBox);
369
+ setPreviewGroupBox(newGroupBox);
370
+ }
371
+ if (event.state === "end") {
372
+ gestureBaseRef.current = null;
373
+ if (isMove && isDraggingRef.current) {
374
+ isDraggingRef.current = false;
375
+ plugin.commitDrag(documentId);
376
+ } else if (isResize && isResizingRef.current) {
377
+ isResizingRef.current = false;
378
+ plugin.commitResize(documentId);
379
+ }
380
+ }
381
+ },
382
+ [plugin, documentId, pageWidth, pageHeight, groupBox, isDraggable, selectedAnnotations]
383
+ );
384
+ const HANDLE_COLOR = (resizeUI == null ? void 0 : resizeUI.color) ?? "#007ACC";
385
+ const HANDLE_SIZE = (resizeUI == null ? void 0 : resizeUI.size) ?? 12;
386
+ const { dragProps, resize } = useInteractionHandles({
387
+ controller: {
388
+ element: previewGroupBox,
389
+ constraints: {
390
+ minWidth: 20,
391
+ minHeight: 20,
392
+ boundingBox: { width: pageWidth, height: pageHeight }
393
+ },
394
+ maintainAspectRatio: false,
395
+ pageRotation: rotation,
396
+ scale,
397
+ enabled: true,
398
+ onUpdate: handleUpdate
399
+ },
400
+ resizeUI: {
401
+ handleSize: HANDLE_SIZE,
402
+ spacing: outlineOffset,
403
+ offsetMode: "outside",
404
+ includeSides: true,
405
+ zIndex: zIndex + 1
406
+ },
407
+ vertexUI: {
408
+ vertexSize: 0,
409
+ zIndex
410
+ },
411
+ includeVertices: false
412
+ });
413
+ if (selectedAnnotations.length < 2) {
414
+ return null;
415
+ }
416
+ return /* @__PURE__ */ jsxs("div", { "data-group-selection-box": true, "data-no-interaction": true, children: [
417
+ /* @__PURE__ */ jsx(
418
+ "div",
419
+ {
420
+ ...isDraggable ? dragProps : {
421
+ onPointerDown: (e) => e.stopPropagation()
422
+ },
423
+ style: {
424
+ position: "absolute",
425
+ left: previewGroupBox.origin.x * scale,
426
+ top: previewGroupBox.origin.y * scale,
427
+ width: previewGroupBox.size.width * scale,
428
+ height: previewGroupBox.size.height * scale,
429
+ outline: `2px dashed ${selectionOutlineColor}`,
430
+ outlineOffset: outlineOffset - 1,
431
+ cursor: isDraggable ? "move" : "default",
432
+ touchAction: "none",
433
+ zIndex
434
+ },
435
+ children: isResizable && resize.map(
436
+ ({ key, ...hProps }) => (resizeUI == null ? void 0 : resizeUI.component) ? resizeUI.component({
437
+ key,
438
+ ...hProps,
439
+ backgroundColor: HANDLE_COLOR
440
+ }) : /* @__PURE__ */ jsx(
441
+ "div",
442
+ {
443
+ ...hProps,
444
+ style: { ...hProps.style, backgroundColor: HANDLE_COLOR }
445
+ },
446
+ key
447
+ )
448
+ )
449
+ }
450
+ ),
451
+ groupSelectionMenu && /* @__PURE__ */ jsx(
452
+ CounterRotate,
453
+ {
454
+ rect: {
455
+ origin: {
456
+ x: previewGroupBox.origin.x * scale,
457
+ y: previewGroupBox.origin.y * scale
458
+ },
459
+ size: {
460
+ width: previewGroupBox.size.width * scale,
461
+ height: previewGroupBox.size.height * scale
462
+ }
463
+ },
464
+ rotation,
465
+ children: (counterRotateProps) => groupSelectionMenu({
466
+ ...counterRotateProps,
467
+ context: {
468
+ type: "group",
469
+ annotations: selectedAnnotations,
470
+ pageIndex
471
+ },
472
+ selected: true,
473
+ placement: {
474
+ suggestTop: false
475
+ }
476
+ })
477
+ }
478
+ )
479
+ ] });
480
+ }
235
481
  function Highlight({
236
- color = "#FFFF00",
482
+ strokeColor,
237
483
  opacity = 0.5,
238
484
  segmentRects,
239
485
  rect,
@@ -241,6 +487,7 @@ function Highlight({
241
487
  onClick,
242
488
  style
243
489
  }) {
490
+ const resolvedColor = strokeColor ?? "#FFFF00";
244
491
  return /* @__PURE__ */ jsx(Fragment, { children: segmentRects.map((b, i) => /* @__PURE__ */ jsx(
245
492
  "div",
246
493
  {
@@ -252,7 +499,7 @@ function Highlight({
252
499
  top: (rect ? b.origin.y - rect.origin.y : b.origin.y) * scale,
253
500
  width: b.size.width * scale,
254
501
  height: b.size.height * scale,
255
- background: color,
502
+ background: resolvedColor,
256
503
  opacity,
257
504
  pointerEvents: onClick ? "auto" : "none",
258
505
  cursor: onClick ? "pointer" : "default",
@@ -264,7 +511,7 @@ function Highlight({
264
511
  )) });
265
512
  }
266
513
  function Underline({
267
- color = "#FFFF00",
514
+ strokeColor,
268
515
  opacity = 0.5,
269
516
  segmentRects,
270
517
  rect,
@@ -272,6 +519,7 @@ function Underline({
272
519
  onClick,
273
520
  style
274
521
  }) {
522
+ const resolvedColor = strokeColor ?? "#FFFF00";
275
523
  const thickness = 2 * scale;
276
524
  return /* @__PURE__ */ jsx(Fragment, { children: segmentRects.map((r, i) => /* @__PURE__ */ jsx(
277
525
  "div",
@@ -299,7 +547,7 @@ function Underline({
299
547
  bottom: 0,
300
548
  width: "100%",
301
549
  height: thickness,
302
- background: color,
550
+ background: resolvedColor,
303
551
  opacity,
304
552
  pointerEvents: "none"
305
553
  }
@@ -310,7 +558,7 @@ function Underline({
310
558
  )) });
311
559
  }
312
560
  function Strikeout({
313
- color = "#FFFF00",
561
+ strokeColor,
314
562
  opacity = 0.5,
315
563
  segmentRects,
316
564
  rect,
@@ -318,6 +566,7 @@ function Strikeout({
318
566
  onClick,
319
567
  style
320
568
  }) {
569
+ const resolvedColor = strokeColor ?? "#FFFF00";
321
570
  const thickness = 2 * scale;
322
571
  return /* @__PURE__ */ jsx(Fragment, { children: segmentRects.map((r, i) => /* @__PURE__ */ jsx(
323
572
  "div",
@@ -345,7 +594,7 @@ function Strikeout({
345
594
  top: "50%",
346
595
  width: "100%",
347
596
  height: thickness,
348
- background: color,
597
+ background: resolvedColor,
349
598
  opacity,
350
599
  transform: "translateY(-50%)",
351
600
  pointerEvents: "none"
@@ -357,7 +606,7 @@ function Strikeout({
357
606
  )) });
358
607
  }
359
608
  function Squiggly({
360
- color = "#FFFF00",
609
+ strokeColor,
361
610
  opacity = 0.5,
362
611
  segmentRects,
363
612
  rect,
@@ -365,11 +614,12 @@ function Squiggly({
365
614
  onClick,
366
615
  style
367
616
  }) {
617
+ const resolvedColor = strokeColor ?? "#FFFF00";
368
618
  const amplitude = 2 * scale;
369
619
  const period = 6 * scale;
370
620
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${period}" height="${amplitude * 2}" viewBox="0 0 ${period} ${amplitude * 2}">
371
621
  <path d="M0 ${amplitude} Q ${period / 4} 0 ${period / 2} ${amplitude} T ${period} ${amplitude}"
372
- fill="none" stroke="${color}" stroke-width="${amplitude}" stroke-linecap="round"/>
622
+ fill="none" stroke="${resolvedColor}" stroke-width="${amplitude}" stroke-linecap="round"/>
373
623
  </svg>`;
374
624
  const svgDataUri = `url("data:image/svg+xml;utf8,${encodeURIComponent(svg)}")`;
375
625
  return /* @__PURE__ */ jsx(Fragment, { children: segmentRects.map((r, i) => /* @__PURE__ */ jsx(
@@ -412,7 +662,7 @@ function Squiggly({
412
662
  }
413
663
  function Ink({
414
664
  isSelected,
415
- color = "#000000",
665
+ strokeColor,
416
666
  opacity = 1,
417
667
  strokeWidth,
418
668
  inkList,
@@ -420,6 +670,7 @@ function Ink({
420
670
  scale,
421
671
  onClick
422
672
  }) {
673
+ const resolvedColor = strokeColor ?? "#000000";
423
674
  const paths = useMemo(() => {
424
675
  return inkList.map(({ points }) => {
425
676
  let d = "";
@@ -458,7 +709,7 @@ function Ink({
458
709
  style: {
459
710
  cursor: isSelected ? "move" : "pointer",
460
711
  pointerEvents: isSelected ? "none" : "visibleStroke",
461
- stroke: color,
712
+ stroke: resolvedColor,
462
713
  strokeWidth,
463
714
  strokeLinecap: "round",
464
715
  strokeLinejoin: "round"
@@ -996,7 +1247,7 @@ function FreeText({
996
1247
  flexDirection: "column",
997
1248
  justifyContent: annotation.object.verticalAlign === PdfVerticalAlignment.Top ? "flex-start" : annotation.object.verticalAlign === PdfVerticalAlignment.Middle ? "center" : "flex-end",
998
1249
  display: "flex",
999
- backgroundColor: annotation.object.backgroundColor,
1250
+ backgroundColor: annotation.object.color ?? annotation.object.backgroundColor,
1000
1251
  opacity: annotation.object.opacity,
1001
1252
  width: needsComp ? `${invScalePercent}%` : "100%",
1002
1253
  height: needsComp ? `${invScalePercent}%` : "100%",
@@ -1109,26 +1360,123 @@ function Stamp({
1109
1360
  }
1110
1361
  );
1111
1362
  }
1363
+ function Link({
1364
+ isSelected,
1365
+ strokeColor = "#0000FF",
1366
+ strokeWidth = 2,
1367
+ strokeStyle = PdfAnnotationBorderStyle.UNDERLINE,
1368
+ strokeDashArray,
1369
+ rect,
1370
+ scale,
1371
+ onClick,
1372
+ hasIRT = false
1373
+ }) {
1374
+ const { width, height } = useMemo(() => {
1375
+ return {
1376
+ width: rect.size.width,
1377
+ height: rect.size.height
1378
+ };
1379
+ }, [rect]);
1380
+ const svgWidth = width * scale;
1381
+ const svgHeight = height * scale;
1382
+ const dashArray = useMemo(() => {
1383
+ if (strokeStyle === PdfAnnotationBorderStyle.DASHED) {
1384
+ return (strokeDashArray == null ? void 0 : strokeDashArray.join(",")) ?? `${strokeWidth * 3},${strokeWidth}`;
1385
+ }
1386
+ return void 0;
1387
+ }, [strokeStyle, strokeDashArray, strokeWidth]);
1388
+ const isUnderline2 = strokeStyle === PdfAnnotationBorderStyle.UNDERLINE;
1389
+ return /* @__PURE__ */ jsxs(
1390
+ "svg",
1391
+ {
1392
+ style: {
1393
+ position: "absolute",
1394
+ width: svgWidth,
1395
+ height: svgHeight,
1396
+ pointerEvents: "none",
1397
+ zIndex: 2
1398
+ },
1399
+ width: svgWidth,
1400
+ height: svgHeight,
1401
+ viewBox: `0 0 ${width} ${height}`,
1402
+ children: [
1403
+ /* @__PURE__ */ jsx(
1404
+ "rect",
1405
+ {
1406
+ x: 0,
1407
+ y: 0,
1408
+ width,
1409
+ height,
1410
+ fill: "transparent",
1411
+ onPointerDown: hasIRT ? void 0 : onClick,
1412
+ onTouchStart: hasIRT ? void 0 : onClick,
1413
+ style: {
1414
+ cursor: hasIRT ? "default" : isSelected ? "move" : "pointer",
1415
+ pointerEvents: hasIRT ? "none" : isSelected ? "none" : "visible"
1416
+ }
1417
+ }
1418
+ ),
1419
+ isUnderline2 ? (
1420
+ // Underline style: line at bottom of rect
1421
+ /* @__PURE__ */ jsx(
1422
+ "line",
1423
+ {
1424
+ x1: 1,
1425
+ y1: height - 1,
1426
+ x2: width - 1,
1427
+ y2: height - 1,
1428
+ stroke: strokeColor,
1429
+ strokeWidth,
1430
+ strokeDasharray: dashArray,
1431
+ style: {
1432
+ pointerEvents: "none"
1433
+ }
1434
+ }
1435
+ )
1436
+ ) : (
1437
+ // Solid/Dashed style: rectangle border
1438
+ /* @__PURE__ */ jsx(
1439
+ "rect",
1440
+ {
1441
+ x: strokeWidth / 2,
1442
+ y: strokeWidth / 2,
1443
+ width: Math.max(width - strokeWidth, 0),
1444
+ height: Math.max(height - strokeWidth, 0),
1445
+ fill: "transparent",
1446
+ stroke: strokeColor,
1447
+ strokeWidth,
1448
+ strokeDasharray: dashArray,
1449
+ style: {
1450
+ pointerEvents: "none"
1451
+ }
1452
+ }
1453
+ )
1454
+ )
1455
+ ]
1456
+ }
1457
+ );
1458
+ }
1112
1459
  function Annotations(annotationsProps) {
1113
- const { documentId, pageIndex, scale, selectionMenu } = annotationsProps;
1460
+ const { documentId, pageIndex, scale, pageWidth, pageHeight, selectionMenu } = annotationsProps;
1114
1461
  const { provides: annotationCapability } = useAnnotationCapability();
1115
1462
  const { provides: selectionProvides } = useSelectionCapability();
1116
1463
  const [annotations, setAnnotations] = useState([]);
1117
1464
  const { register } = usePointerHandlers({ documentId, pageIndex });
1118
- const [selectionState, setSelectionState] = useState(null);
1465
+ const [allSelectedIds, setAllSelectedIds] = useState([]);
1119
1466
  const [editingId, setEditingId] = useState(null);
1120
1467
  const annotationProvides = useMemo(
1121
1468
  () => annotationCapability ? annotationCapability.forDocument(documentId) : null,
1122
1469
  [annotationCapability, documentId]
1123
1470
  );
1471
+ const isMultiSelected = allSelectedIds.length > 1;
1124
1472
  useEffect(() => {
1125
1473
  if (annotationProvides) {
1126
1474
  const currentState = annotationProvides.getState();
1127
1475
  setAnnotations(getAnnotationsByPageIndex(currentState, pageIndex));
1128
- setSelectionState(getSelectedAnnotationByPageIndex(currentState, pageIndex));
1476
+ setAllSelectedIds(getSelectedAnnotationIds(currentState));
1129
1477
  return annotationProvides.onStateChange((state) => {
1130
1478
  setAnnotations(getAnnotationsByPageIndex(state, pageIndex));
1131
- setSelectionState(getSelectedAnnotationByPageIndex(state, pageIndex));
1479
+ setAllSelectedIds(getSelectedAnnotationIds(state));
1132
1480
  });
1133
1481
  }
1134
1482
  }, [annotationProvides, pageIndex]);
@@ -1147,8 +1495,13 @@ function Annotations(annotationsProps) {
1147
1495
  (e, annotation) => {
1148
1496
  e.stopPropagation();
1149
1497
  if (annotationProvides && selectionProvides) {
1150
- annotationProvides.selectAnnotation(pageIndex, annotation.object.id);
1151
1498
  selectionProvides.clear();
1499
+ const isModifierPressed = "metaKey" in e ? e.metaKey || e.ctrlKey : false;
1500
+ if (isModifierPressed) {
1501
+ annotationProvides.toggleSelection(pageIndex, annotation.object.id);
1502
+ } else {
1503
+ annotationProvides.selectAnnotation(pageIndex, annotation.object.id);
1504
+ }
1152
1505
  if (annotation.object.id !== editingId) {
1153
1506
  setEditingId(null);
1154
1507
  }
@@ -1156,369 +1509,467 @@ function Annotations(annotationsProps) {
1156
1509
  },
1157
1510
  [annotationProvides, selectionProvides, editingId, pageIndex]
1158
1511
  );
1512
+ const handleLinkClick = useCallback(
1513
+ (e, annotation) => {
1514
+ e.stopPropagation();
1515
+ if (!annotationProvides || !selectionProvides) return;
1516
+ selectionProvides.clear();
1517
+ if (annotation.object.inReplyToId) {
1518
+ const parentId = annotation.object.inReplyToId;
1519
+ const parent = annotations.find((a) => a.object.id === parentId);
1520
+ if (parent) {
1521
+ annotationProvides.selectAnnotation(parent.object.pageIndex, parentId);
1522
+ return;
1523
+ }
1524
+ }
1525
+ annotationProvides.selectAnnotation(pageIndex, annotation.object.id);
1526
+ },
1527
+ [annotationProvides, selectionProvides, annotations, pageIndex]
1528
+ );
1159
1529
  useEffect(() => {
1160
1530
  return register(handlers, {
1161
1531
  documentId
1162
1532
  });
1163
1533
  }, [register, handlers]);
1164
- return /* @__PURE__ */ jsx(Fragment, { children: annotations.map((annotation) => {
1165
- const isSelected = (selectionState == null ? void 0 : selectionState.object.id) === annotation.object.id;
1166
- const isEditing = editingId === annotation.object.id;
1167
- const tool = annotationProvides == null ? void 0 : annotationProvides.findToolForAnnotation(annotation.object);
1168
- if (isInk(annotation)) {
1169
- return /* @__PURE__ */ jsx(
1170
- AnnotationContainer,
1171
- {
1172
- trackedAnnotation: annotation,
1173
- isSelected,
1174
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1175
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1176
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1177
- selectionMenu,
1178
- onSelect: (e) => handleClick(e, annotation),
1179
- style: {
1180
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1181
- },
1182
- ...annotationsProps,
1183
- children: (obj) => /* @__PURE__ */ jsx(
1184
- Ink,
1185
- {
1186
- ...obj,
1187
- isSelected,
1188
- scale,
1189
- onClick: (e) => handleClick(e, annotation)
1190
- }
1191
- )
1192
- },
1193
- annotation.object.id
1194
- );
1195
- }
1196
- if (isSquare(annotation)) {
1197
- return /* @__PURE__ */ jsx(
1198
- AnnotationContainer,
1199
- {
1200
- trackedAnnotation: annotation,
1201
- isSelected,
1202
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1203
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1204
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1205
- selectionMenu,
1206
- onSelect: (e) => handleClick(e, annotation),
1207
- style: {
1208
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1209
- },
1210
- ...annotationsProps,
1211
- children: (obj) => /* @__PURE__ */ jsx(
1212
- Square,
1213
- {
1214
- ...obj,
1215
- isSelected,
1216
- scale,
1217
- onClick: (e) => handleClick(e, annotation)
1218
- }
1219
- )
1220
- },
1221
- annotation.object.id
1222
- );
1223
- }
1224
- if (isCircle(annotation)) {
1225
- return /* @__PURE__ */ jsx(
1226
- AnnotationContainer,
1227
- {
1228
- trackedAnnotation: annotation,
1229
- isSelected,
1230
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1231
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1232
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1233
- selectionMenu,
1234
- onSelect: (e) => handleClick(e, annotation),
1235
- style: {
1236
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1237
- },
1238
- ...annotationsProps,
1239
- children: (obj) => /* @__PURE__ */ jsx(
1240
- Circle,
1241
- {
1242
- ...obj,
1243
- isSelected,
1244
- scale,
1245
- onClick: (e) => handleClick(e, annotation)
1246
- }
1247
- )
1248
- },
1249
- annotation.object.id
1250
- );
1251
- }
1252
- if (isUnderline(annotation)) {
1253
- return /* @__PURE__ */ jsx(
1254
- AnnotationContainer,
1255
- {
1256
- trackedAnnotation: annotation,
1257
- isSelected,
1258
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1259
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1260
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1261
- selectionMenu,
1262
- onSelect: (e) => handleClick(e, annotation),
1263
- zIndex: 0,
1264
- style: {
1265
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1534
+ const selectedAnnotationsOnPage = useMemo(() => {
1535
+ return annotations.filter((anno) => allSelectedIds.includes(anno.object.id));
1536
+ }, [annotations, allSelectedIds]);
1537
+ const areAllSelectedDraggable = useMemo(() => {
1538
+ if (selectedAnnotationsOnPage.length < 2) return false;
1539
+ return selectedAnnotationsOnPage.every((ta) => {
1540
+ const tool = annotationProvides == null ? void 0 : annotationProvides.findToolForAnnotation(ta.object);
1541
+ return (tool == null ? void 0 : tool.interaction.isGroupDraggable) ?? (tool == null ? void 0 : tool.interaction.isDraggable) ?? true;
1542
+ });
1543
+ }, [selectedAnnotationsOnPage, annotationProvides]);
1544
+ const areAllSelectedResizable = useMemo(() => {
1545
+ if (selectedAnnotationsOnPage.length < 2) return false;
1546
+ return selectedAnnotationsOnPage.every((ta) => {
1547
+ const tool = annotationProvides == null ? void 0 : annotationProvides.findToolForAnnotation(ta.object);
1548
+ return (tool == null ? void 0 : tool.interaction.isGroupResizable) ?? (tool == null ? void 0 : tool.interaction.isResizable) ?? true;
1549
+ });
1550
+ }, [selectedAnnotationsOnPage, annotationProvides]);
1551
+ const allSelectedOnSamePage = useMemo(() => {
1552
+ if (!annotationProvides) return false;
1553
+ const allSelected = annotationProvides.getSelectedAnnotations();
1554
+ return allSelected.length > 1 && allSelected.every((ta) => ta.object.pageIndex === pageIndex);
1555
+ }, [annotationProvides, pageIndex, allSelectedIds]);
1556
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1557
+ annotations.map((annotation) => {
1558
+ const isSelected = allSelectedIds.includes(annotation.object.id);
1559
+ const isEditing = editingId === annotation.object.id;
1560
+ const tool = annotationProvides == null ? void 0 : annotationProvides.findToolForAnnotation(annotation.object);
1561
+ if (isInk(annotation)) {
1562
+ return /* @__PURE__ */ jsx(
1563
+ AnnotationContainer,
1564
+ {
1565
+ trackedAnnotation: annotation,
1566
+ isSelected,
1567
+ isMultiSelected,
1568
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1569
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1570
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1571
+ selectionMenu,
1572
+ onSelect: (e) => handleClick(e, annotation),
1573
+ style: {
1574
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1575
+ },
1576
+ ...annotationsProps,
1577
+ children: (obj) => /* @__PURE__ */ jsx(
1578
+ Ink,
1579
+ {
1580
+ ...obj,
1581
+ isSelected,
1582
+ scale,
1583
+ onClick: (e) => handleClick(e, annotation)
1584
+ }
1585
+ )
1266
1586
  },
1267
- ...annotationsProps,
1268
- children: (obj) => /* @__PURE__ */ jsx(Underline, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1269
- },
1270
- annotation.object.id
1271
- );
1272
- }
1273
- if (isStrikeout(annotation)) {
1274
- return /* @__PURE__ */ jsx(
1275
- AnnotationContainer,
1276
- {
1277
- trackedAnnotation: annotation,
1278
- isSelected,
1279
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1280
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1281
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1282
- selectionMenu,
1283
- onSelect: (e) => handleClick(e, annotation),
1284
- zIndex: 0,
1285
- style: {
1286
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1587
+ annotation.object.id
1588
+ );
1589
+ }
1590
+ if (isSquare(annotation)) {
1591
+ return /* @__PURE__ */ jsx(
1592
+ AnnotationContainer,
1593
+ {
1594
+ trackedAnnotation: annotation,
1595
+ isSelected,
1596
+ isMultiSelected,
1597
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1598
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1599
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1600
+ selectionMenu,
1601
+ onSelect: (e) => handleClick(e, annotation),
1602
+ style: {
1603
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1604
+ },
1605
+ ...annotationsProps,
1606
+ children: (obj) => /* @__PURE__ */ jsx(
1607
+ Square,
1608
+ {
1609
+ ...obj,
1610
+ isSelected,
1611
+ scale,
1612
+ onClick: (e) => handleClick(e, annotation)
1613
+ }
1614
+ )
1287
1615
  },
1288
- ...annotationsProps,
1289
- children: (obj) => /* @__PURE__ */ jsx(Strikeout, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1290
- },
1291
- annotation.object.id
1292
- );
1293
- }
1294
- if (isSquiggly(annotation)) {
1295
- return /* @__PURE__ */ jsx(
1296
- AnnotationContainer,
1297
- {
1298
- trackedAnnotation: annotation,
1299
- isSelected,
1300
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1301
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1302
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1303
- selectionMenu,
1304
- onSelect: (e) => handleClick(e, annotation),
1305
- zIndex: 0,
1306
- style: {
1307
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1616
+ annotation.object.id
1617
+ );
1618
+ }
1619
+ if (isCircle(annotation)) {
1620
+ return /* @__PURE__ */ jsx(
1621
+ AnnotationContainer,
1622
+ {
1623
+ trackedAnnotation: annotation,
1624
+ isSelected,
1625
+ isMultiSelected,
1626
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1627
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1628
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1629
+ selectionMenu,
1630
+ onSelect: (e) => handleClick(e, annotation),
1631
+ style: {
1632
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1633
+ },
1634
+ ...annotationsProps,
1635
+ children: (obj) => /* @__PURE__ */ jsx(
1636
+ Circle,
1637
+ {
1638
+ ...obj,
1639
+ isSelected,
1640
+ scale,
1641
+ onClick: (e) => handleClick(e, annotation)
1642
+ }
1643
+ )
1308
1644
  },
1309
- ...annotationsProps,
1310
- children: (obj) => /* @__PURE__ */ jsx(Squiggly, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1311
- },
1312
- annotation.object.id
1313
- );
1314
- }
1315
- if (isHighlight(annotation)) {
1316
- return /* @__PURE__ */ jsx(
1317
- AnnotationContainer,
1318
- {
1319
- trackedAnnotation: annotation,
1320
- isSelected,
1321
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1322
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1323
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1324
- selectionMenu,
1325
- onSelect: (e) => handleClick(e, annotation),
1326
- zIndex: 0,
1327
- style: {
1328
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Multiply)
1645
+ annotation.object.id
1646
+ );
1647
+ }
1648
+ if (isUnderline(annotation)) {
1649
+ return /* @__PURE__ */ jsx(
1650
+ AnnotationContainer,
1651
+ {
1652
+ trackedAnnotation: annotation,
1653
+ isSelected,
1654
+ isMultiSelected,
1655
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1656
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1657
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1658
+ selectionMenu,
1659
+ onSelect: (e) => handleClick(e, annotation),
1660
+ zIndex: 0,
1661
+ style: {
1662
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1663
+ },
1664
+ ...annotationsProps,
1665
+ children: (obj) => /* @__PURE__ */ jsx(Underline, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1329
1666
  },
1330
- ...annotationsProps,
1331
- children: (obj) => /* @__PURE__ */ jsx(Highlight, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1332
- },
1333
- annotation.object.id
1334
- );
1335
- }
1336
- if (isLine(annotation)) {
1337
- return /* @__PURE__ */ jsx(
1338
- AnnotationContainer,
1339
- {
1340
- trackedAnnotation: annotation,
1341
- isSelected,
1342
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1343
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1344
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1345
- selectionMenu,
1346
- onSelect: (e) => handleClick(e, annotation),
1347
- vertexConfig: {
1348
- extractVertices: (annotation2) => [
1349
- annotation2.linePoints.start,
1350
- annotation2.linePoints.end
1351
- ],
1352
- transformAnnotation: (annotation2, vertices) => {
1353
- return {
1354
- ...annotation2,
1355
- linePoints: {
1356
- start: vertices[0],
1357
- end: vertices[1]
1358
- }
1359
- };
1360
- }
1667
+ annotation.object.id
1668
+ );
1669
+ }
1670
+ if (isStrikeout(annotation)) {
1671
+ return /* @__PURE__ */ jsx(
1672
+ AnnotationContainer,
1673
+ {
1674
+ trackedAnnotation: annotation,
1675
+ isSelected,
1676
+ isMultiSelected,
1677
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1678
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1679
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1680
+ selectionMenu,
1681
+ onSelect: (e) => handleClick(e, annotation),
1682
+ zIndex: 0,
1683
+ style: {
1684
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1685
+ },
1686
+ ...annotationsProps,
1687
+ children: (obj) => /* @__PURE__ */ jsx(Strikeout, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1361
1688
  },
1362
- style: {
1363
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1689
+ annotation.object.id
1690
+ );
1691
+ }
1692
+ if (isSquiggly(annotation)) {
1693
+ return /* @__PURE__ */ jsx(
1694
+ AnnotationContainer,
1695
+ {
1696
+ trackedAnnotation: annotation,
1697
+ isSelected,
1698
+ isMultiSelected,
1699
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1700
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1701
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1702
+ selectionMenu,
1703
+ onSelect: (e) => handleClick(e, annotation),
1704
+ zIndex: 0,
1705
+ style: {
1706
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1707
+ },
1708
+ ...annotationsProps,
1709
+ children: (obj) => /* @__PURE__ */ jsx(Squiggly, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1364
1710
  },
1365
- ...annotationsProps,
1366
- children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1367
- Line,
1368
- {
1369
- ...obj,
1370
- isSelected,
1371
- scale,
1372
- onClick: (e) => handleClick(e, annotation)
1373
- }
1374
- ) })
1375
- },
1376
- annotation.object.id
1377
- );
1378
- }
1379
- if (isPolyline(annotation)) {
1380
- return /* @__PURE__ */ jsx(
1381
- AnnotationContainer,
1382
- {
1383
- trackedAnnotation: annotation,
1384
- isSelected,
1385
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1386
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1387
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1388
- selectionMenu,
1389
- onSelect: (e) => handleClick(e, annotation),
1390
- vertexConfig: {
1391
- extractVertices: (annotation2) => annotation2.vertices,
1392
- transformAnnotation: (annotation2, vertices) => {
1393
- return {
1394
- ...annotation2,
1395
- vertices
1396
- };
1397
- }
1711
+ annotation.object.id
1712
+ );
1713
+ }
1714
+ if (isHighlight(annotation)) {
1715
+ return /* @__PURE__ */ jsx(
1716
+ AnnotationContainer,
1717
+ {
1718
+ trackedAnnotation: annotation,
1719
+ isSelected,
1720
+ isMultiSelected,
1721
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? false,
1722
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1723
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1724
+ selectionMenu,
1725
+ onSelect: (e) => handleClick(e, annotation),
1726
+ zIndex: 0,
1727
+ style: {
1728
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Multiply)
1729
+ },
1730
+ ...annotationsProps,
1731
+ children: (obj) => /* @__PURE__ */ jsx(Highlight, { ...obj, scale, onClick: (e) => handleClick(e, annotation) })
1398
1732
  },
1399
- style: {
1400
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1733
+ annotation.object.id
1734
+ );
1735
+ }
1736
+ if (isLine(annotation)) {
1737
+ return /* @__PURE__ */ jsx(
1738
+ AnnotationContainer,
1739
+ {
1740
+ trackedAnnotation: annotation,
1741
+ isSelected,
1742
+ isMultiSelected,
1743
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1744
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1745
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1746
+ selectionMenu,
1747
+ onSelect: (e) => handleClick(e, annotation),
1748
+ vertexConfig: {
1749
+ extractVertices: (annotation2) => [
1750
+ annotation2.linePoints.start,
1751
+ annotation2.linePoints.end
1752
+ ],
1753
+ transformAnnotation: (annotation2, vertices) => {
1754
+ return {
1755
+ ...annotation2,
1756
+ linePoints: {
1757
+ start: vertices[0],
1758
+ end: vertices[1]
1759
+ }
1760
+ };
1761
+ }
1762
+ },
1763
+ style: {
1764
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1765
+ },
1766
+ ...annotationsProps,
1767
+ children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1768
+ Line,
1769
+ {
1770
+ ...obj,
1771
+ isSelected,
1772
+ scale,
1773
+ onClick: (e) => handleClick(e, annotation)
1774
+ }
1775
+ ) })
1401
1776
  },
1402
- ...annotationsProps,
1403
- children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1404
- Polyline,
1405
- {
1406
- ...obj,
1407
- isSelected,
1408
- scale,
1409
- onClick: (e) => handleClick(e, annotation)
1410
- }
1411
- ) })
1412
- },
1413
- annotation.object.id
1414
- );
1415
- }
1416
- if (isPolygon(annotation)) {
1417
- return /* @__PURE__ */ jsx(
1418
- AnnotationContainer,
1419
- {
1420
- trackedAnnotation: annotation,
1421
- isSelected,
1422
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1423
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1424
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1425
- selectionMenu,
1426
- onSelect: (e) => handleClick(e, annotation),
1427
- vertexConfig: {
1428
- extractVertices: (annotation2) => annotation2.vertices,
1429
- transformAnnotation: (annotation2, vertices) => {
1430
- return {
1431
- ...annotation2,
1432
- vertices
1433
- };
1434
- }
1777
+ annotation.object.id
1778
+ );
1779
+ }
1780
+ if (isPolyline(annotation)) {
1781
+ return /* @__PURE__ */ jsx(
1782
+ AnnotationContainer,
1783
+ {
1784
+ trackedAnnotation: annotation,
1785
+ isSelected,
1786
+ isMultiSelected,
1787
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1788
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1789
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1790
+ selectionMenu,
1791
+ onSelect: (e) => handleClick(e, annotation),
1792
+ vertexConfig: {
1793
+ extractVertices: (annotation2) => annotation2.vertices,
1794
+ transformAnnotation: (annotation2, vertices) => {
1795
+ return {
1796
+ ...annotation2,
1797
+ vertices
1798
+ };
1799
+ }
1800
+ },
1801
+ style: {
1802
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1803
+ },
1804
+ ...annotationsProps,
1805
+ children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1806
+ Polyline,
1807
+ {
1808
+ ...obj,
1809
+ isSelected,
1810
+ scale,
1811
+ onClick: (e) => handleClick(e, annotation)
1812
+ }
1813
+ ) })
1435
1814
  },
1436
- style: {
1437
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1815
+ annotation.object.id
1816
+ );
1817
+ }
1818
+ if (isPolygon(annotation)) {
1819
+ return /* @__PURE__ */ jsx(
1820
+ AnnotationContainer,
1821
+ {
1822
+ trackedAnnotation: annotation,
1823
+ isSelected,
1824
+ isMultiSelected,
1825
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1826
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? false,
1827
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1828
+ selectionMenu,
1829
+ onSelect: (e) => handleClick(e, annotation),
1830
+ vertexConfig: {
1831
+ extractVertices: (annotation2) => annotation2.vertices,
1832
+ transformAnnotation: (annotation2, vertices) => {
1833
+ return {
1834
+ ...annotation2,
1835
+ vertices
1836
+ };
1837
+ }
1838
+ },
1839
+ style: {
1840
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1841
+ },
1842
+ ...annotationsProps,
1843
+ children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1844
+ Polygon,
1845
+ {
1846
+ ...obj,
1847
+ isSelected,
1848
+ scale,
1849
+ onClick: (e) => handleClick(e, annotation)
1850
+ }
1851
+ ) })
1438
1852
  },
1439
- ...annotationsProps,
1440
- children: (obj) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(
1441
- Polygon,
1442
- {
1443
- ...obj,
1444
- isSelected,
1445
- scale,
1446
- onClick: (e) => handleClick(e, annotation)
1447
- }
1448
- ) })
1449
- },
1450
- annotation.object.id
1451
- );
1452
- }
1453
- if (isFreeText(annotation)) {
1454
- return /* @__PURE__ */ jsx(
1455
- AnnotationContainer,
1456
- {
1457
- trackedAnnotation: annotation,
1458
- isSelected,
1459
- isDraggable: ((tool == null ? void 0 : tool.interaction.isDraggable) ?? true) && !isEditing,
1460
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1461
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1462
- selectionMenu,
1463
- onSelect: (e) => handleClick(e, annotation),
1464
- style: {
1465
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1853
+ annotation.object.id
1854
+ );
1855
+ }
1856
+ if (isFreeText(annotation)) {
1857
+ return /* @__PURE__ */ jsx(
1858
+ AnnotationContainer,
1859
+ {
1860
+ trackedAnnotation: annotation,
1861
+ isSelected,
1862
+ isMultiSelected,
1863
+ isDraggable: ((tool == null ? void 0 : tool.interaction.isDraggable) ?? true) && !isEditing,
1864
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1865
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1866
+ selectionMenu,
1867
+ onSelect: (e) => handleClick(e, annotation),
1868
+ style: {
1869
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1870
+ },
1871
+ onDoubleClick: (e) => {
1872
+ e.stopPropagation();
1873
+ setEditingId(annotation.object.id);
1874
+ },
1875
+ ...annotationsProps,
1876
+ children: (object) => /* @__PURE__ */ jsx(
1877
+ FreeText,
1878
+ {
1879
+ isSelected,
1880
+ isEditing,
1881
+ annotation: {
1882
+ ...annotation,
1883
+ object
1884
+ },
1885
+ pageIndex,
1886
+ scale,
1887
+ onClick: (e) => handleClick(e, annotation)
1888
+ }
1889
+ )
1466
1890
  },
1467
- onDoubleClick: (e) => {
1468
- e.stopPropagation();
1469
- setEditingId(annotation.object.id);
1891
+ annotation.object.id
1892
+ );
1893
+ }
1894
+ if (isStamp(annotation)) {
1895
+ return /* @__PURE__ */ jsx(
1896
+ AnnotationContainer,
1897
+ {
1898
+ trackedAnnotation: annotation,
1899
+ isSelected,
1900
+ isMultiSelected,
1901
+ isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1902
+ isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1903
+ lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1904
+ selectionMenu,
1905
+ onSelect: (e) => handleClick(e, annotation),
1906
+ style: {
1907
+ mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1908
+ },
1909
+ ...annotationsProps,
1910
+ children: (_object) => /* @__PURE__ */ jsx(
1911
+ Stamp,
1912
+ {
1913
+ isSelected,
1914
+ annotation,
1915
+ documentId,
1916
+ pageIndex,
1917
+ scale,
1918
+ onClick: (e) => handleClick(e, annotation)
1919
+ }
1920
+ )
1470
1921
  },
1471
- ...annotationsProps,
1472
- children: (object) => /* @__PURE__ */ jsx(
1473
- FreeText,
1474
- {
1475
- isSelected,
1476
- isEditing,
1477
- annotation: {
1478
- ...annotation,
1479
- object
1480
- },
1481
- pageIndex,
1482
- scale,
1483
- onClick: (e) => handleClick(e, annotation)
1484
- }
1485
- )
1486
- },
1487
- annotation.object.id
1488
- );
1489
- }
1490
- if (isStamp(annotation)) {
1491
- return /* @__PURE__ */ jsx(
1492
- AnnotationContainer,
1493
- {
1494
- trackedAnnotation: annotation,
1495
- isSelected,
1496
- isDraggable: (tool == null ? void 0 : tool.interaction.isDraggable) ?? true,
1497
- isResizable: (tool == null ? void 0 : tool.interaction.isResizable) ?? true,
1498
- lockAspectRatio: (tool == null ? void 0 : tool.interaction.lockAspectRatio) ?? false,
1499
- selectionMenu,
1500
- onSelect: (e) => handleClick(e, annotation),
1501
- style: {
1502
- mixBlendMode: blendModeToCss(annotation.object.blendMode ?? PdfBlendMode.Normal)
1922
+ annotation.object.id
1923
+ );
1924
+ }
1925
+ if (isLink(annotation)) {
1926
+ const hasIRT = !!annotation.object.inReplyToId;
1927
+ return /* @__PURE__ */ jsx(
1928
+ AnnotationContainer,
1929
+ {
1930
+ trackedAnnotation: annotation,
1931
+ isSelected,
1932
+ isMultiSelected,
1933
+ isDraggable: false,
1934
+ isResizable: false,
1935
+ lockAspectRatio: false,
1936
+ selectionMenu: hasIRT ? void 0 : selectionMenu,
1937
+ onSelect: (e) => handleLinkClick(e, annotation),
1938
+ ...annotationsProps,
1939
+ children: (obj) => /* @__PURE__ */ jsx(
1940
+ Link,
1941
+ {
1942
+ ...obj,
1943
+ isSelected,
1944
+ scale,
1945
+ onClick: (e) => handleLinkClick(e, annotation),
1946
+ hasIRT
1947
+ }
1948
+ )
1503
1949
  },
1504
- ...annotationsProps,
1505
- children: (_object) => /* @__PURE__ */ jsx(
1506
- Stamp,
1507
- {
1508
- isSelected,
1509
- annotation,
1510
- documentId,
1511
- pageIndex,
1512
- scale,
1513
- onClick: (e) => handleClick(e, annotation)
1514
- }
1515
- )
1516
- },
1517
- annotation.object.id
1518
- );
1519
- }
1520
- return null;
1521
- }) });
1950
+ annotation.object.id
1951
+ );
1952
+ }
1953
+ return null;
1954
+ }),
1955
+ allSelectedOnSamePage && selectedAnnotationsOnPage.length >= 2 && /* @__PURE__ */ jsx(
1956
+ GroupSelectionBox,
1957
+ {
1958
+ documentId,
1959
+ pageIndex,
1960
+ scale,
1961
+ rotation: annotationsProps.rotation,
1962
+ pageWidth,
1963
+ pageHeight,
1964
+ selectedAnnotations: selectedAnnotationsOnPage,
1965
+ isDraggable: areAllSelectedDraggable,
1966
+ isResizable: areAllSelectedResizable,
1967
+ resizeUI: annotationsProps.resizeUI,
1968
+ selectionOutlineColor: annotationsProps.selectionOutlineColor,
1969
+ groupSelectionMenu: annotationsProps.groupSelectionMenu
1970
+ }
1971
+ )
1972
+ ] });
1522
1973
  }
1523
1974
  function TextMarkup({ documentId, pageIndex, scale }) {
1524
1975
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
@@ -1555,7 +2006,7 @@ function TextMarkup({ documentId, pageIndex, scale }) {
1555
2006
  children: /* @__PURE__ */ jsx(
1556
2007
  Underline,
1557
2008
  {
1558
- color: (_b = activeTool.defaults) == null ? void 0 : _b.color,
2009
+ strokeColor: (_b = activeTool.defaults) == null ? void 0 : _b.strokeColor,
1559
2010
  opacity: (_c = activeTool.defaults) == null ? void 0 : _c.opacity,
1560
2011
  segmentRects: rects,
1561
2012
  scale
@@ -1576,7 +2027,7 @@ function TextMarkup({ documentId, pageIndex, scale }) {
1576
2027
  children: /* @__PURE__ */ jsx(
1577
2028
  Highlight,
1578
2029
  {
1579
- color: (_e = activeTool.defaults) == null ? void 0 : _e.color,
2030
+ strokeColor: (_e = activeTool.defaults) == null ? void 0 : _e.strokeColor,
1580
2031
  opacity: (_f = activeTool.defaults) == null ? void 0 : _f.opacity,
1581
2032
  segmentRects: rects,
1582
2033
  scale
@@ -1597,7 +2048,7 @@ function TextMarkup({ documentId, pageIndex, scale }) {
1597
2048
  children: /* @__PURE__ */ jsx(
1598
2049
  Strikeout,
1599
2050
  {
1600
- color: (_h = activeTool.defaults) == null ? void 0 : _h.color,
2051
+ strokeColor: (_h = activeTool.defaults) == null ? void 0 : _h.strokeColor,
1601
2052
  opacity: (_i = activeTool.defaults) == null ? void 0 : _i.opacity,
1602
2053
  segmentRects: rects,
1603
2054
  scale
@@ -1618,7 +2069,7 @@ function TextMarkup({ documentId, pageIndex, scale }) {
1618
2069
  children: /* @__PURE__ */ jsx(
1619
2070
  Squiggly,
1620
2071
  {
1621
- color: (_k = activeTool.defaults) == null ? void 0 : _k.color,
2072
+ strokeColor: (_k = activeTool.defaults) == null ? void 0 : _k.strokeColor,
1622
2073
  opacity: (_l = activeTool.defaults) == null ? void 0 : _l.opacity,
1623
2074
  segmentRects: rects,
1624
2075
  scale
@@ -1751,6 +2202,7 @@ function AnnotationLayer({
1751
2202
  scale: overrideScale,
1752
2203
  rotation: overrideRotation,
1753
2204
  selectionMenu,
2205
+ groupSelectionMenu,
1754
2206
  resizeUI,
1755
2207
  vertexUI,
1756
2208
  selectionOutlineColor,
@@ -1783,6 +2235,7 @@ function AnnotationLayer({
1783
2235
  {
1784
2236
  documentId,
1785
2237
  selectionMenu,
2238
+ groupSelectionMenu,
1786
2239
  pageIndex,
1787
2240
  scale: actualScale,
1788
2241
  rotation: actualRotation,
@@ -1802,6 +2255,7 @@ function AnnotationLayer({
1802
2255
  }
1803
2256
  export {
1804
2257
  AnnotationLayer,
2258
+ GroupSelectionBox,
1805
2259
  useAnnotation,
1806
2260
  useAnnotationCapability,
1807
2261
  useAnnotationPlugin