@embedpdf/plugin-annotation 2.7.0 → 2.9.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 (134) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +1131 -203
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/annotation-plugin.d.ts +2 -0
  6. package/dist/lib/geometry/cloudy-border.d.ts +90 -0
  7. package/dist/lib/geometry/index.d.ts +1 -0
  8. package/dist/lib/handlers/index.d.ts +4 -0
  9. package/dist/lib/handlers/insert-text.handler.d.ts +8 -0
  10. package/dist/lib/handlers/replace-text.handler.d.ts +9 -0
  11. package/dist/lib/handlers/selection-utils.d.ts +7 -0
  12. package/dist/lib/handlers/text-markup.handler.d.ts +7 -0
  13. package/dist/lib/handlers/text.handler.d.ts +3 -0
  14. package/dist/lib/handlers/types.d.ts +14 -1
  15. package/dist/lib/helpers.d.ts +2 -1
  16. package/dist/lib/selectors.d.ts +6 -1
  17. package/dist/lib/tools/default-tools.d.ts +141 -45
  18. package/dist/lib/tools/tools-utils.d.ts +2 -0
  19. package/dist/lib/tools/types.d.ts +34 -1
  20. package/dist/lib/types.d.ts +1 -0
  21. package/dist/preact/index.cjs +1 -1
  22. package/dist/preact/index.cjs.map +1 -1
  23. package/dist/preact/index.js +621 -274
  24. package/dist/preact/index.js.map +1 -1
  25. package/dist/react/index.cjs +1 -1
  26. package/dist/react/index.cjs.map +1 -1
  27. package/dist/react/index.js +621 -274
  28. package/dist/react/index.js.map +1 -1
  29. package/dist/shared/annotation-bounds.d.ts +14 -0
  30. package/dist/shared/components/annotation-container.d.ts +4 -2
  31. package/dist/shared/components/annotations/caret.d.ts +24 -0
  32. package/dist/shared/components/annotations/circle.d.ts +8 -4
  33. package/dist/shared/components/annotations/free-text.d.ts +2 -2
  34. package/dist/shared/components/annotations/ink.d.ts +2 -2
  35. package/dist/shared/components/annotations/line.d.ts +2 -2
  36. package/dist/shared/components/annotations/link.d.ts +2 -2
  37. package/dist/shared/components/annotations/polygon.d.ts +5 -3
  38. package/dist/shared/components/annotations/polyline.d.ts +8 -4
  39. package/dist/shared/components/annotations/square.d.ts +8 -4
  40. package/dist/shared/components/annotations/stamp.d.ts +2 -2
  41. package/dist/shared/components/annotations/text.d.ts +14 -0
  42. package/dist/shared/components/text-markup/highlight.d.ts +2 -2
  43. package/dist/shared/components/text-markup/squiggly.d.ts +2 -2
  44. package/dist/shared/components/text-markup/strikeout.d.ts +2 -2
  45. package/dist/shared/components/text-markup/underline.d.ts +2 -2
  46. package/dist/shared/components/types.d.ts +8 -4
  47. package/dist/shared-preact/annotation-bounds.d.ts +14 -0
  48. package/dist/shared-preact/components/annotation-container.d.ts +4 -2
  49. package/dist/shared-preact/components/annotations/caret.d.ts +24 -0
  50. package/dist/shared-preact/components/annotations/circle.d.ts +8 -4
  51. package/dist/shared-preact/components/annotations/free-text.d.ts +2 -2
  52. package/dist/shared-preact/components/annotations/ink.d.ts +2 -2
  53. package/dist/shared-preact/components/annotations/line.d.ts +2 -2
  54. package/dist/shared-preact/components/annotations/link.d.ts +2 -2
  55. package/dist/shared-preact/components/annotations/polygon.d.ts +5 -3
  56. package/dist/shared-preact/components/annotations/polyline.d.ts +8 -4
  57. package/dist/shared-preact/components/annotations/square.d.ts +8 -4
  58. package/dist/shared-preact/components/annotations/stamp.d.ts +2 -2
  59. package/dist/shared-preact/components/annotations/text.d.ts +14 -0
  60. package/dist/shared-preact/components/text-markup/highlight.d.ts +2 -2
  61. package/dist/shared-preact/components/text-markup/squiggly.d.ts +2 -2
  62. package/dist/shared-preact/components/text-markup/strikeout.d.ts +2 -2
  63. package/dist/shared-preact/components/text-markup/underline.d.ts +2 -2
  64. package/dist/shared-preact/components/types.d.ts +8 -4
  65. package/dist/shared-react/annotation-bounds.d.ts +14 -0
  66. package/dist/shared-react/components/annotation-container.d.ts +4 -2
  67. package/dist/shared-react/components/annotations/caret.d.ts +24 -0
  68. package/dist/shared-react/components/annotations/circle.d.ts +8 -4
  69. package/dist/shared-react/components/annotations/free-text.d.ts +2 -2
  70. package/dist/shared-react/components/annotations/ink.d.ts +2 -2
  71. package/dist/shared-react/components/annotations/line.d.ts +2 -2
  72. package/dist/shared-react/components/annotations/link.d.ts +2 -2
  73. package/dist/shared-react/components/annotations/polygon.d.ts +5 -3
  74. package/dist/shared-react/components/annotations/polyline.d.ts +8 -4
  75. package/dist/shared-react/components/annotations/square.d.ts +8 -4
  76. package/dist/shared-react/components/annotations/stamp.d.ts +2 -2
  77. package/dist/shared-react/components/annotations/text.d.ts +14 -0
  78. package/dist/shared-react/components/text-markup/highlight.d.ts +2 -2
  79. package/dist/shared-react/components/text-markup/squiggly.d.ts +2 -2
  80. package/dist/shared-react/components/text-markup/strikeout.d.ts +2 -2
  81. package/dist/shared-react/components/text-markup/underline.d.ts +2 -2
  82. package/dist/shared-react/components/types.d.ts +8 -4
  83. package/dist/shared-vue/annotation-bounds.d.ts +14 -0
  84. package/dist/svelte/components/annotations/Caret.svelte.d.ts +13 -0
  85. package/dist/svelte/components/annotations/Circle.svelte.d.ts +4 -2
  86. package/dist/svelte/components/annotations/FreeText.svelte.d.ts +1 -1
  87. package/dist/svelte/components/annotations/Ink.svelte.d.ts +1 -1
  88. package/dist/svelte/components/annotations/Line.svelte.d.ts +1 -1
  89. package/dist/svelte/components/annotations/Link.svelte.d.ts +1 -1
  90. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +2 -1
  91. package/dist/svelte/components/annotations/Polyline.svelte.d.ts +4 -2
  92. package/dist/svelte/components/annotations/Square.svelte.d.ts +4 -2
  93. package/dist/svelte/components/annotations/Stamp.svelte.d.ts +1 -1
  94. package/dist/svelte/components/annotations/Text.svelte.d.ts +10 -0
  95. package/dist/svelte/components/annotations/index.d.ts +1 -0
  96. package/dist/svelte/components/renderers/CaretRenderer.svelte.d.ts +5 -0
  97. package/dist/svelte/components/renderers/TextRenderer.svelte.d.ts +5 -0
  98. package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +1 -1
  99. package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +1 -1
  100. package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +1 -1
  101. package/dist/svelte/components/text-markup/Underline.svelte.d.ts +1 -1
  102. package/dist/svelte/components/types.d.ts +2 -1
  103. package/dist/svelte/context/types.d.ts +7 -3
  104. package/dist/svelte/index.cjs +1 -1
  105. package/dist/svelte/index.cjs.map +1 -1
  106. package/dist/svelte/index.js +831 -416
  107. package/dist/svelte/index.js.map +1 -1
  108. package/dist/vue/components/annotation-container.vue.d.ts +9 -8
  109. package/dist/vue/components/annotation-layer.vue.d.ts +1 -1
  110. package/dist/vue/components/annotations/caret.vue.d.ts +24 -0
  111. package/dist/vue/components/annotations/circle.vue.d.ts +7 -3
  112. package/dist/vue/components/annotations/free-text.vue.d.ts +2 -2
  113. package/dist/vue/components/annotations/index.d.ts +1 -0
  114. package/dist/vue/components/annotations/ink.vue.d.ts +2 -2
  115. package/dist/vue/components/annotations/line.vue.d.ts +2 -2
  116. package/dist/vue/components/annotations/link.vue.d.ts +2 -2
  117. package/dist/vue/components/annotations/polygon.vue.d.ts +4 -2
  118. package/dist/vue/components/annotations/polyline.vue.d.ts +8 -3
  119. package/dist/vue/components/annotations/square.vue.d.ts +7 -3
  120. package/dist/vue/components/annotations/stamp.vue.d.ts +2 -2
  121. package/dist/vue/components/annotations/text.vue.d.ts +14 -0
  122. package/dist/vue/components/annotations.vue.d.ts +9 -10
  123. package/dist/vue/components/renderers/caret-renderer.vue.d.ts +6 -0
  124. package/dist/vue/components/renderers/text-renderer.vue.d.ts +6 -0
  125. package/dist/vue/components/text-markup/highlight.vue.d.ts +2 -2
  126. package/dist/vue/components/text-markup/squiggly.vue.d.ts +2 -2
  127. package/dist/vue/components/text-markup/strikeout.vue.d.ts +2 -2
  128. package/dist/vue/components/text-markup/underline.vue.d.ts +2 -2
  129. package/dist/vue/context/types.d.ts +7 -3
  130. package/dist/vue/index.cjs +1 -1
  131. package/dist/vue/index.cjs.map +1 -1
  132. package/dist/vue/index.js +778 -354
  133. package/dist/vue/index.js.map +1 -1
  134. package/package.json +10 -10
@@ -17,6 +17,7 @@ export declare class AnnotationPlugin extends BasePlugin<AnnotationPluginConfig,
17
17
  private importQueue;
18
18
  private commitInProgress;
19
19
  private handlerFactories;
20
+ private selectionHandlerFactories;
20
21
  private readonly activeTool$;
21
22
  private readonly events$;
22
23
  private readonly toolsChange$;
@@ -33,6 +34,7 @@ export declare class AnnotationPlugin extends BasePlugin<AnnotationPluginConfig,
33
34
  protected onDocumentLoaded(documentId: string): void;
34
35
  protected onDocumentClosed(documentId: string): void;
35
36
  private registerHandlerFactories;
37
+ private registerSelectionHandlerFactories;
36
38
  private registerBuiltInPatches;
37
39
  initialize(): Promise<void>;
38
40
  private registerInteractionForTool;
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Cloudy border path generator for PDF annotations.
3
+ *
4
+ * Framework-agnostic utility that generates SVG path `d` strings for cloudy
5
+ * (scalloped) borders on Rectangle, Ellipse, and Polygon shapes.
6
+ *
7
+ * Derived from Apache PDFBox's CloudyBorder.java:
8
+ * https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/CloudyBorder.java
9
+ *
10
+ * Original code licensed under the Apache License, Version 2.0:
11
+ * https://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Substantially modified: ported from Java to TypeScript, adapted for SVG
14
+ * path output, and reworked curl distribution and merging logic.
15
+ *
16
+ * Copyright (c) 2026 CloudPDF / EmbedPDF
17
+ *
18
+ * @module
19
+ */
20
+ interface BBox {
21
+ minX: number;
22
+ minY: number;
23
+ maxX: number;
24
+ maxY: number;
25
+ }
26
+ /** Rect differences (inset from annotation Rect to drawn shape). */
27
+ export interface RectDifferences {
28
+ left: number;
29
+ top: number;
30
+ right: number;
31
+ bottom: number;
32
+ }
33
+ export interface CloudyPathResult {
34
+ /** SVG path `d` attribute string */
35
+ path: string;
36
+ /** Bounding box of the generated cloudy border (in annotation-local coords) */
37
+ bbox: BBox;
38
+ }
39
+ /**
40
+ * Returns the per-side outward extent of a cloudy border (how far the
41
+ * scallop peaks + stroke extend beyond the inner shape boundary).
42
+ *
43
+ * Use this to compute `rectangleDifferences` for Square/Circle or the
44
+ * padding for Polygon Rect computation.
45
+ */
46
+ export declare function getCloudyBorderExtent(intensity: number, lineWidth: number, isEllipse: boolean): number;
47
+ /**
48
+ * Generates a cloudy border SVG path for a rectangle (Square annotation).
49
+ *
50
+ * @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
51
+ * @param rd - Rectangle differences (inset), or undefined
52
+ * @param intensity - Cloudy border intensity (typically 1 or 2)
53
+ * @param lineWidth - Stroke width of the annotation border
54
+ */
55
+ export declare function generateCloudyRectanglePath(rect: {
56
+ x: number;
57
+ y: number;
58
+ width: number;
59
+ height: number;
60
+ }, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
61
+ /**
62
+ * Generates a cloudy border SVG path for an ellipse (Circle annotation).
63
+ *
64
+ * @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
65
+ * @param rd - Rectangle differences (inset), or undefined
66
+ * @param intensity - Cloudy border intensity (typically 1 or 2)
67
+ * @param lineWidth - Stroke width of the annotation border
68
+ */
69
+ export declare function generateCloudyEllipsePath(rect: {
70
+ x: number;
71
+ y: number;
72
+ width: number;
73
+ height: number;
74
+ }, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
75
+ /**
76
+ * Generates a cloudy border SVG path for a polygon.
77
+ *
78
+ * @param vertices - The polygon vertices in annotation-local coordinates
79
+ * @param rectOrigin - The annotation rect origin `{ x, y }` for coordinate translation
80
+ * @param intensity - Cloudy border intensity (typically 1 or 2)
81
+ * @param lineWidth - Stroke width of the annotation border
82
+ */
83
+ export declare function generateCloudyPolygonPath(vertices: ReadonlyArray<{
84
+ x: number;
85
+ y: number;
86
+ }>, rectOrigin: {
87
+ x: number;
88
+ y: number;
89
+ }, intensity: number, lineWidth: number): CloudyPathResult;
90
+ export {};
@@ -1 +1,2 @@
1
1
  export * from './rotation';
2
+ export * from './cloudy-border';
@@ -1,4 +1,5 @@
1
1
  export * from './ink.handler';
2
+ export * from './text.handler';
2
3
  export * from './free-text.handler';
3
4
  export * from './line.handler';
4
5
  export * from './polyline.handler';
@@ -6,3 +7,6 @@ export * from './polygon.handler';
6
7
  export * from './square.handler';
7
8
  export * from './stamp.handler';
8
9
  export * from './circle.handler';
10
+ export * from './text-markup.handler';
11
+ export * from './insert-text.handler';
12
+ export * from './replace-text.handler';
@@ -0,0 +1,8 @@
1
+ import { PdfCaretAnnoObject } from '@embedpdf/models';
2
+ import { SelectionHandlerFactory } from './types';
3
+ /**
4
+ * Selection handler for the "Insert Text" tool.
5
+ * Creates a single Caret annotation at the end of the text selection
6
+ * with intent "Insert".
7
+ */
8
+ export declare const insertTextSelectionHandler: SelectionHandlerFactory<PdfCaretAnnoObject>;
@@ -0,0 +1,9 @@
1
+ import { PdfStrikeOutAnnoObject } from '@embedpdf/models';
2
+ import { SelectionHandlerFactory } from './types';
3
+ /**
4
+ * Selection handler for the "Replace Text" tool.
5
+ * Creates a Caret annotation (group leader, intent "Replace") at the end
6
+ * of the selection, plus a StrikeOut annotation (intent "StrikeOutTextEdit")
7
+ * over the full selection, linked to the Caret via IRT/RT=Group.
8
+ */
9
+ export declare const replaceTextSelectionHandler: SelectionHandlerFactory<PdfStrikeOutAnnoObject>;
@@ -0,0 +1,7 @@
1
+ import { Rect } from '@embedpdf/models';
2
+ /**
3
+ * Compute a caret annotation rect at the end of a text selection.
4
+ * The caret is half the line height, bottom-aligned with the line,
5
+ * and horizontally centered on the line's end edge.
6
+ */
7
+ export declare function computeCaretRect(lastSegRect: Rect): Rect;
@@ -0,0 +1,7 @@
1
+ import { SelectionHandlerFactory } from './types';
2
+ /**
3
+ * Default selection handler for text-markup tools (highlight, underline,
4
+ * strikeout, squiggly). Used as a fallback when no tool-specific
5
+ * SelectionHandlerFactory is registered.
6
+ */
7
+ export declare const textMarkupSelectionHandler: SelectionHandlerFactory;
@@ -0,0 +1,3 @@
1
+ import { PdfTextAnnoObject } from '@embedpdf/models';
2
+ import { HandlerFactory } from './types';
3
+ export declare const textHandlerFactory: HandlerFactory<PdfTextAnnoObject>;
@@ -1,5 +1,6 @@
1
1
  import { PointerEventHandlersWithLifecycle } from '@embedpdf/plugin-interaction-manager';
2
- import { PdfAnnotationObject, PdfAnnotationSubtype, Rect, Rotation, Size, AnnotationCreateContext, PdfAnnotationBorderStyle, Position, LineEndings, PdfInkListObject, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment } from '@embedpdf/models';
2
+ import { PdfAnnotationObject, PdfAnnotationSubtype, Rect, Rotation, Size, AnnotationCreateContext, PdfAnnotationBorderStyle, Position, LineEndings, PdfInkListObject, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment, PdfBlendMode } from '@embedpdf/models';
3
+ import { FormattedSelection } from '@embedpdf/plugin-selection';
3
4
  import { AnnotationTool } from '../tools/types';
4
5
  export interface CirclePreviewData {
5
6
  rect: Rect;
@@ -53,6 +54,7 @@ export interface InkPreviewData {
53
54
  strokeWidth: number;
54
55
  strokeColor: string;
55
56
  opacity: number;
57
+ blendMode?: PdfBlendMode;
56
58
  }
57
59
  export interface FreeTextPreviewData {
58
60
  rect: Rect;
@@ -138,4 +140,15 @@ export interface HandlerContext<A extends PdfAnnotationObject> {
138
140
  onPreview: (state: AnyPreviewState | null) => void;
139
141
  onCommit: (annotation: A, context?: AnnotationCreateContext<A>) => void;
140
142
  }
143
+ export interface SelectionHandlerContext<A extends PdfAnnotationObject = PdfAnnotationObject> {
144
+ toolId: string;
145
+ documentId: string;
146
+ getTool: () => AnnotationTool<A> | null;
147
+ createAnnotation: (pageIndex: number, annotation: PdfAnnotationObject) => void;
148
+ selectAnnotation: (pageIndex: number, id: string) => void;
149
+ }
150
+ export interface SelectionHandlerFactory<A extends PdfAnnotationObject = PdfAnnotationObject> {
151
+ toolId: string;
152
+ handle(context: SelectionHandlerContext<A>, selections: FormattedSelection[], getText: () => Promise<string | undefined>): void;
153
+ }
141
154
  export {};
@@ -8,7 +8,7 @@ export type AnnoOf<S extends PdfAnnotationSubtype> = Extract<PdfAnnotationObject
8
8
  type: S;
9
9
  }>;
10
10
  export type TextMarkupSubtype = PdfAnnotationSubtype.HIGHLIGHT | PdfAnnotationSubtype.UNDERLINE | PdfAnnotationSubtype.STRIKEOUT | PdfAnnotationSubtype.SQUIGGLY;
11
- export type SidebarSubtype = TextMarkupSubtype | PdfAnnotationSubtype.INK | PdfAnnotationSubtype.SQUARE | PdfAnnotationSubtype.CIRCLE | PdfAnnotationSubtype.POLYGON | PdfAnnotationSubtype.LINE | PdfAnnotationSubtype.POLYLINE | PdfAnnotationSubtype.FREETEXT | PdfAnnotationSubtype.STAMP | PdfAnnotationSubtype.REDACT;
11
+ export type SidebarSubtype = TextMarkupSubtype | PdfAnnotationSubtype.TEXT | PdfAnnotationSubtype.INK | PdfAnnotationSubtype.SQUARE | PdfAnnotationSubtype.CIRCLE | PdfAnnotationSubtype.POLYGON | PdfAnnotationSubtype.LINE | PdfAnnotationSubtype.POLYLINE | PdfAnnotationSubtype.FREETEXT | PdfAnnotationSubtype.STAMP | PdfAnnotationSubtype.REDACT | PdfAnnotationSubtype.CARET;
12
12
  /** True when `a.object.type === INK` – and narrows the generic. */
13
13
  export declare function isInk(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.INK>>;
14
14
  /** Example for Circle – create similar ones for Square, Line, etc. */
@@ -27,4 +27,5 @@ export declare function isStamp(a: TrackedAnnotation): a is TrackedAnnotation<An
27
27
  export declare function isText(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.TEXT>>;
28
28
  export declare function isLink(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.LINK>>;
29
29
  export declare function isRedact(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.REDACT>>;
30
+ export declare function isCaret(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.CARET>>;
30
31
  export declare function isSidebarAnnotation(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<SidebarSubtype>>;
@@ -40,9 +40,14 @@ export declare function getToolDefaultsById<K extends keyof ToolMap>(state: Anno
40
40
  * Collect every sidebar-eligible annotation and attach its TEXT replies,
41
41
  * grouped by page for efficient rendering.
42
42
  *
43
+ * Annotations linked via IRT / RT=Group are collapsed: the group leader
44
+ * becomes the sidebar entry and its non-LINK group members are attached
45
+ * as `groupMembers`. This keeps the sidebar compact for tools like
46
+ * Replace Text (Caret + StrikeOut pair).
47
+ *
43
48
  * Result shape:
44
49
  * {
45
- * 0: [{ page: 0, annotation: <TrackedAnnotation>, replies: [ … ] }, ...],
50
+ * 0: [{ page: 0, annotation: <TrackedAnnotation>, replies: [ … ], groupMembers: [ … ] }, ...],
46
51
  * 1: [{ page: 1, annotation: <TrackedAnnotation>, replies: [ … ] }, ...],
47
52
  * …
48
53
  * }
@@ -1,15 +1,42 @@
1
1
  import { PdfAnnotationBorderStyle, PdfAnnotationLineEnding, PdfAnnotationSubtype, PdfBlendMode, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment } from '@embedpdf/models';
2
2
  export declare const defaultTools: ({
3
+ id: string;
4
+ name: string;
5
+ matchScore: (annotation: import('@embedpdf/models').PdfAnnotationObject) => number;
6
+ defaults: Partial<import('@embedpdf/models').PdfInkAnnoObject>;
7
+ interaction: {
8
+ mode?: string;
9
+ exclusive: boolean;
10
+ cursor?: string;
11
+ textSelection?: boolean;
12
+ showSelectionRects?: boolean;
13
+ isDraggable?: import('./types').DynamicBooleanProp;
14
+ isResizable?: import('./types').DynamicBooleanProp;
15
+ isRotatable?: import('./types').DynamicBooleanProp;
16
+ lockAspectRatio?: import('./types').DynamicBooleanProp;
17
+ lockGroupAspectRatio?: import('./types').DynamicBooleanProp;
18
+ isGroupDraggable?: import('./types').DynamicBooleanProp;
19
+ isGroupResizable?: import('./types').DynamicBooleanProp;
20
+ isGroupRotatable?: import('./types').DynamicBooleanProp;
21
+ };
22
+ behavior?: ({
23
+ deactivateToolAfterCreate?: boolean;
24
+ selectAfterCreate?: boolean;
25
+ useAppearanceStream?: boolean;
26
+ } & import('./types').InkBehavior) | undefined;
27
+ } | {
3
28
  id: "highlight";
4
29
  name: string;
5
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
30
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
6
31
  interaction: {
7
32
  exclusive: false;
8
33
  textSelection: true;
9
34
  isDraggable: false;
10
35
  isResizable: false;
36
+ isRotatable: false;
11
37
  isGroupDraggable: false;
12
38
  isGroupResizable: false;
39
+ showSelectionRects?: undefined;
13
40
  cursor?: undefined;
14
41
  lockAspectRatio?: undefined;
15
42
  lockGroupAspectRatio?: undefined;
@@ -20,8 +47,8 @@ export declare const defaultTools: ({
20
47
  color: string;
21
48
  opacity: number;
22
49
  blendMode: PdfBlendMode.Multiply;
23
- strokeWidth?: undefined;
24
50
  intent?: undefined;
51
+ strokeWidth?: undefined;
25
52
  strokeStyle?: undefined;
26
53
  lineEndings?: undefined;
27
54
  contents?: undefined;
@@ -37,14 +64,16 @@ export declare const defaultTools: ({
37
64
  } | {
38
65
  id: "underline";
39
66
  name: string;
40
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
67
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
41
68
  interaction: {
42
69
  exclusive: false;
43
70
  textSelection: true;
44
71
  isDraggable: false;
45
72
  isResizable: false;
73
+ isRotatable: false;
46
74
  isGroupDraggable: false;
47
75
  isGroupResizable: false;
76
+ showSelectionRects?: undefined;
48
77
  cursor?: undefined;
49
78
  lockAspectRatio?: undefined;
50
79
  lockGroupAspectRatio?: undefined;
@@ -55,8 +84,8 @@ export declare const defaultTools: ({
55
84
  color: string;
56
85
  opacity: number;
57
86
  blendMode?: undefined;
58
- strokeWidth?: undefined;
59
87
  intent?: undefined;
88
+ strokeWidth?: undefined;
60
89
  strokeStyle?: undefined;
61
90
  lineEndings?: undefined;
62
91
  contents?: undefined;
@@ -72,14 +101,16 @@ export declare const defaultTools: ({
72
101
  } | {
73
102
  id: "strikeout";
74
103
  name: string;
75
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
104
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
76
105
  interaction: {
77
106
  exclusive: false;
78
107
  textSelection: true;
79
108
  isDraggable: false;
80
109
  isResizable: false;
110
+ isRotatable: false;
81
111
  isGroupDraggable: false;
82
112
  isGroupResizable: false;
113
+ showSelectionRects?: undefined;
83
114
  cursor?: undefined;
84
115
  lockAspectRatio?: undefined;
85
116
  lockGroupAspectRatio?: undefined;
@@ -90,8 +121,8 @@ export declare const defaultTools: ({
90
121
  color: string;
91
122
  opacity: number;
92
123
  blendMode?: undefined;
93
- strokeWidth?: undefined;
94
124
  intent?: undefined;
125
+ strokeWidth?: undefined;
95
126
  strokeStyle?: undefined;
96
127
  lineEndings?: undefined;
97
128
  contents?: undefined;
@@ -107,14 +138,16 @@ export declare const defaultTools: ({
107
138
  } | {
108
139
  id: "squiggly";
109
140
  name: string;
110
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
141
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
111
142
  interaction: {
112
143
  exclusive: false;
113
144
  textSelection: true;
114
145
  isDraggable: false;
115
146
  isResizable: false;
147
+ isRotatable: false;
116
148
  isGroupDraggable: false;
117
149
  isGroupResizable: false;
150
+ showSelectionRects?: undefined;
118
151
  cursor?: undefined;
119
152
  lockAspectRatio?: undefined;
120
153
  lockGroupAspectRatio?: undefined;
@@ -125,8 +158,8 @@ export declare const defaultTools: ({
125
158
  color: string;
126
159
  opacity: number;
127
160
  blendMode?: undefined;
128
- strokeWidth?: undefined;
129
161
  intent?: undefined;
162
+ strokeWidth?: undefined;
130
163
  strokeStyle?: undefined;
131
164
  lineEndings?: undefined;
132
165
  contents?: undefined;
@@ -140,28 +173,30 @@ export declare const defaultTools: ({
140
173
  clickBehavior?: undefined;
141
174
  behavior?: undefined;
142
175
  } | {
143
- id: "ink";
176
+ id: "insertText";
144
177
  name: string;
145
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 5;
178
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1 | 2;
146
179
  interaction: {
147
180
  exclusive: false;
148
- cursor: string;
149
- isDraggable: true;
150
- isResizable: true;
151
- lockAspectRatio: false;
152
- textSelection?: undefined;
153
- isGroupDraggable?: undefined;
154
- isGroupResizable?: undefined;
181
+ textSelection: true;
182
+ showSelectionRects: true;
183
+ isDraggable: false;
184
+ isResizable: false;
185
+ isRotatable: false;
186
+ isGroupDraggable: false;
187
+ isGroupResizable: false;
188
+ cursor?: undefined;
189
+ lockAspectRatio?: undefined;
155
190
  lockGroupAspectRatio?: undefined;
156
191
  };
157
192
  defaults: {
158
- type: PdfAnnotationSubtype.INK;
193
+ type: PdfAnnotationSubtype.CARET;
159
194
  strokeColor: string;
160
- color: string;
161
195
  opacity: number;
162
- strokeWidth: number;
196
+ intent: string;
197
+ color?: undefined;
163
198
  blendMode?: undefined;
164
- intent?: undefined;
199
+ strokeWidth?: undefined;
165
200
  strokeStyle?: undefined;
166
201
  lineEndings?: undefined;
167
202
  contents?: undefined;
@@ -175,28 +210,30 @@ export declare const defaultTools: ({
175
210
  clickBehavior?: undefined;
176
211
  behavior?: undefined;
177
212
  } | {
178
- id: "inkHighlighter";
213
+ id: "replaceText";
179
214
  name: string;
180
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 10;
215
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 2;
181
216
  interaction: {
182
217
  exclusive: false;
183
- cursor: string;
184
- isDraggable: true;
185
- isResizable: true;
186
- lockAspectRatio: false;
187
- lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
188
- textSelection?: undefined;
189
- isGroupDraggable?: undefined;
190
- isGroupResizable?: undefined;
218
+ textSelection: true;
219
+ isDraggable: false;
220
+ isResizable: false;
221
+ isRotatable: false;
222
+ isGroupDraggable: false;
223
+ isGroupResizable: false;
224
+ showSelectionRects?: undefined;
225
+ cursor?: undefined;
226
+ lockAspectRatio?: undefined;
227
+ lockGroupAspectRatio?: undefined;
191
228
  };
192
229
  defaults: {
193
- type: PdfAnnotationSubtype.INK;
194
- intent: string;
230
+ type: PdfAnnotationSubtype.STRIKEOUT;
195
231
  strokeColor: string;
196
- color: string;
197
232
  opacity: number;
198
- strokeWidth: number;
199
- blendMode: PdfBlendMode.Multiply;
233
+ intent: string;
234
+ color?: undefined;
235
+ blendMode?: undefined;
236
+ strokeWidth?: undefined;
200
237
  strokeStyle?: undefined;
201
238
  lineEndings?: undefined;
202
239
  contents?: undefined;
@@ -212,7 +249,7 @@ export declare const defaultTools: ({
212
249
  } | {
213
250
  id: "circle";
214
251
  name: string;
215
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
252
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
216
253
  interaction: {
217
254
  exclusive: false;
218
255
  cursor: string;
@@ -221,8 +258,10 @@ export declare const defaultTools: ({
221
258
  lockAspectRatio: false;
222
259
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
223
260
  textSelection?: undefined;
261
+ isRotatable?: undefined;
224
262
  isGroupDraggable?: undefined;
225
263
  isGroupResizable?: undefined;
264
+ showSelectionRects?: undefined;
226
265
  };
227
266
  defaults: {
228
267
  type: PdfAnnotationSubtype.CIRCLE;
@@ -256,7 +295,7 @@ export declare const defaultTools: ({
256
295
  } | {
257
296
  id: "square";
258
297
  name: string;
259
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
298
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
260
299
  interaction: {
261
300
  exclusive: false;
262
301
  cursor: string;
@@ -265,8 +304,10 @@ export declare const defaultTools: ({
265
304
  lockAspectRatio: false;
266
305
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
267
306
  textSelection?: undefined;
307
+ isRotatable?: undefined;
268
308
  isGroupDraggable?: undefined;
269
309
  isGroupResizable?: undefined;
310
+ showSelectionRects?: undefined;
270
311
  };
271
312
  defaults: {
272
313
  type: PdfAnnotationSubtype.SQUARE;
@@ -300,7 +341,7 @@ export declare const defaultTools: ({
300
341
  } | {
301
342
  id: "line";
302
343
  name: string;
303
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 5;
344
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 5 | 0;
304
345
  interaction: {
305
346
  exclusive: false;
306
347
  cursor: string;
@@ -310,7 +351,9 @@ export declare const defaultTools: ({
310
351
  isGroupResizable: true;
311
352
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
312
353
  textSelection?: undefined;
354
+ isRotatable?: undefined;
313
355
  isGroupDraggable?: undefined;
356
+ showSelectionRects?: undefined;
314
357
  };
315
358
  defaults: {
316
359
  type: PdfAnnotationSubtype.LINE;
@@ -351,7 +394,9 @@ export declare const defaultTools: ({
351
394
  isGroupResizable: true;
352
395
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
353
396
  textSelection?: undefined;
397
+ isRotatable?: undefined;
354
398
  isGroupDraggable?: undefined;
399
+ showSelectionRects?: undefined;
355
400
  };
356
401
  defaults: {
357
402
  type: PdfAnnotationSubtype.LINE;
@@ -385,7 +430,7 @@ export declare const defaultTools: ({
385
430
  } | {
386
431
  id: "polyline";
387
432
  name: string;
388
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
433
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
389
434
  interaction: {
390
435
  exclusive: false;
391
436
  cursor: string;
@@ -395,7 +440,9 @@ export declare const defaultTools: ({
395
440
  isGroupResizable: true;
396
441
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
397
442
  textSelection?: undefined;
443
+ isRotatable?: undefined;
398
444
  isGroupDraggable?: undefined;
445
+ showSelectionRects?: undefined;
399
446
  };
400
447
  defaults: {
401
448
  type: PdfAnnotationSubtype.POLYLINE;
@@ -420,7 +467,7 @@ export declare const defaultTools: ({
420
467
  } | {
421
468
  id: "polygon";
422
469
  name: string;
423
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
470
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
424
471
  interaction: {
425
472
  exclusive: false;
426
473
  cursor: string;
@@ -430,7 +477,9 @@ export declare const defaultTools: ({
430
477
  isGroupResizable: true;
431
478
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
432
479
  textSelection?: undefined;
480
+ isRotatable?: undefined;
433
481
  isGroupDraggable?: undefined;
482
+ showSelectionRects?: undefined;
434
483
  };
435
484
  defaults: {
436
485
  type: PdfAnnotationSubtype.POLYGON;
@@ -452,10 +501,51 @@ export declare const defaultTools: ({
452
501
  };
453
502
  clickBehavior?: undefined;
454
503
  behavior?: undefined;
504
+ } | {
505
+ id: "textComment";
506
+ name: string;
507
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
508
+ interaction: {
509
+ exclusive: false;
510
+ cursor: string;
511
+ isDraggable: true;
512
+ isResizable: false;
513
+ isRotatable: false;
514
+ textSelection?: undefined;
515
+ isGroupDraggable?: undefined;
516
+ isGroupResizable?: undefined;
517
+ showSelectionRects?: undefined;
518
+ lockAspectRatio?: undefined;
519
+ lockGroupAspectRatio?: undefined;
520
+ };
521
+ defaults: {
522
+ type: PdfAnnotationSubtype.TEXT;
523
+ strokeColor: string;
524
+ opacity: number;
525
+ color?: undefined;
526
+ blendMode?: undefined;
527
+ intent?: undefined;
528
+ strokeWidth?: undefined;
529
+ strokeStyle?: undefined;
530
+ lineEndings?: undefined;
531
+ contents?: undefined;
532
+ fontSize?: undefined;
533
+ fontColor?: undefined;
534
+ fontFamily?: undefined;
535
+ textAlign?: undefined;
536
+ verticalAlign?: undefined;
537
+ backgroundColor?: undefined;
538
+ };
539
+ behavior: {
540
+ selectAfterCreate: true;
541
+ insertUpright?: undefined;
542
+ useAppearanceStream?: undefined;
543
+ };
544
+ clickBehavior?: undefined;
455
545
  } | {
456
546
  id: "freeText";
457
547
  name: string;
458
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
548
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
459
549
  interaction: {
460
550
  exclusive: false;
461
551
  cursor: string;
@@ -464,8 +554,10 @@ export declare const defaultTools: ({
464
554
  lockAspectRatio: false;
465
555
  lockGroupAspectRatio: (a: import('@embedpdf/models').PdfAnnotationObject) => boolean;
466
556
  textSelection?: undefined;
557
+ isRotatable?: undefined;
467
558
  isGroupDraggable?: undefined;
468
559
  isGroupResizable?: undefined;
560
+ showSelectionRects?: undefined;
469
561
  };
470
562
  defaults: {
471
563
  type: PdfAnnotationSubtype.FREETEXT;
@@ -480,8 +572,8 @@ export declare const defaultTools: ({
480
572
  opacity: number;
481
573
  strokeColor?: undefined;
482
574
  blendMode?: undefined;
483
- strokeWidth?: undefined;
484
575
  intent?: undefined;
576
+ strokeWidth?: undefined;
485
577
  strokeStyle?: undefined;
486
578
  lineEndings?: undefined;
487
579
  };
@@ -497,12 +589,13 @@ export declare const defaultTools: ({
497
589
  };
498
590
  behavior: {
499
591
  insertUpright: true;
592
+ selectAfterCreate?: undefined;
500
593
  useAppearanceStream?: undefined;
501
594
  };
502
595
  } | {
503
596
  id: "stamp";
504
597
  name: string;
505
- matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 1 | 0;
598
+ matchScore: (a: import('@embedpdf/models').PdfAnnotationObject) => 0 | 1;
506
599
  interaction: {
507
600
  exclusive: false;
508
601
  cursor: string;
@@ -511,8 +604,10 @@ export declare const defaultTools: ({
511
604
  lockAspectRatio: true;
512
605
  lockGroupAspectRatio: true;
513
606
  textSelection?: undefined;
607
+ isRotatable?: undefined;
514
608
  isGroupDraggable?: undefined;
515
609
  isGroupResizable?: undefined;
610
+ showSelectionRects?: undefined;
516
611
  };
517
612
  defaults: {
518
613
  type: PdfAnnotationSubtype.STAMP;
@@ -520,8 +615,8 @@ export declare const defaultTools: ({
520
615
  color?: undefined;
521
616
  opacity?: undefined;
522
617
  blendMode?: undefined;
523
- strokeWidth?: undefined;
524
618
  intent?: undefined;
619
+ strokeWidth?: undefined;
525
620
  strokeStyle?: undefined;
526
621
  lineEndings?: undefined;
527
622
  contents?: undefined;
@@ -535,6 +630,7 @@ export declare const defaultTools: ({
535
630
  behavior: {
536
631
  insertUpright: true;
537
632
  useAppearanceStream: false;
633
+ selectAfterCreate?: undefined;
538
634
  };
539
635
  clickBehavior?: undefined;
540
636
  })[];