@embedpdf/plugin-annotation 2.8.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 (52) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +814 -139
  4. package/dist/index.js.map +1 -1
  5. package/dist/lib/geometry/cloudy-border.d.ts +90 -0
  6. package/dist/lib/geometry/index.d.ts +1 -0
  7. package/dist/lib/handlers/types.d.ts +2 -1
  8. package/dist/lib/tools/default-tools.d.ts +38 -87
  9. package/dist/lib/tools/types.d.ts +32 -1
  10. package/dist/preact/index.cjs +1 -1
  11. package/dist/preact/index.cjs.map +1 -1
  12. package/dist/preact/index.js +352 -239
  13. package/dist/preact/index.js.map +1 -1
  14. package/dist/react/index.cjs +1 -1
  15. package/dist/react/index.cjs.map +1 -1
  16. package/dist/react/index.js +352 -239
  17. package/dist/react/index.js.map +1 -1
  18. package/dist/shared/components/annotation-container.d.ts +4 -2
  19. package/dist/shared/components/annotations/circle.d.ts +6 -2
  20. package/dist/shared/components/annotations/polygon.d.ts +3 -1
  21. package/dist/shared/components/annotations/square.d.ts +6 -2
  22. package/dist/shared/components/types.d.ts +6 -2
  23. package/dist/shared-preact/components/annotation-container.d.ts +4 -2
  24. package/dist/shared-preact/components/annotations/circle.d.ts +6 -2
  25. package/dist/shared-preact/components/annotations/polygon.d.ts +3 -1
  26. package/dist/shared-preact/components/annotations/square.d.ts +6 -2
  27. package/dist/shared-preact/components/types.d.ts +6 -2
  28. package/dist/shared-react/components/annotation-container.d.ts +4 -2
  29. package/dist/shared-react/components/annotations/circle.d.ts +6 -2
  30. package/dist/shared-react/components/annotations/polygon.d.ts +3 -1
  31. package/dist/shared-react/components/annotations/square.d.ts +6 -2
  32. package/dist/shared-react/components/types.d.ts +6 -2
  33. package/dist/svelte/components/annotations/Circle.svelte.d.ts +3 -1
  34. package/dist/svelte/components/annotations/Polygon.svelte.d.ts +1 -0
  35. package/dist/svelte/components/annotations/Square.svelte.d.ts +3 -1
  36. package/dist/svelte/components/types.d.ts +2 -1
  37. package/dist/svelte/context/types.d.ts +6 -2
  38. package/dist/svelte/index.cjs +1 -1
  39. package/dist/svelte/index.cjs.map +1 -1
  40. package/dist/svelte/index.js +505 -293
  41. package/dist/svelte/index.js.map +1 -1
  42. package/dist/vue/components/annotation-container.vue.d.ts +7 -6
  43. package/dist/vue/components/annotations/circle.vue.d.ts +5 -1
  44. package/dist/vue/components/annotations/polygon.vue.d.ts +2 -0
  45. package/dist/vue/components/annotations/square.vue.d.ts +5 -1
  46. package/dist/vue/components/annotations.vue.d.ts +8 -9
  47. package/dist/vue/context/types.d.ts +6 -2
  48. package/dist/vue/index.cjs +1 -1
  49. package/dist/vue/index.cjs.map +1 -1
  50. package/dist/vue/index.js +259 -121
  51. package/dist/vue/index.js.map +1 -1
  52. package/package.json +10 -10
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject, AnnotationAppearances } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, AnnotationAppearances, CssBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../index.ts';
3
3
  import { JSX, CSSProperties } from '../../react/adapter.ts';
4
4
  import { CustomAnnotationRenderer, ResizeHandleUI, AnnotationSelectionMenuRenderFn, AnnotationInteractionEvent, VertexHandleUI, RotationHandleUI, GroupSelectionMenuRenderFn, BoxedAnnotationRenderer, SelectionOutline } from './types';
@@ -32,6 +32,8 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
32
32
  onSelect: (event: AnnotationInteractionEvent) => void;
33
33
  /** Pre-rendered appearance stream images for AP mode rendering */
34
34
  appearance?: AnnotationAppearances<Blob> | null;
35
+ /** Blend mode applied only to the visual content (children + AP image), not to interaction handles */
36
+ blendMode?: CssBlendMode;
35
37
  zIndex?: number;
36
38
  resizeUI?: ResizeHandleUI;
37
39
  vertexUI?: VertexHandleUI;
@@ -53,5 +55,5 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
53
55
  * When isMultiSelected is true, the container becomes passive - drag/resize
54
56
  * is handled by the GroupSelectionBox instead.
55
57
  */
56
- export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
58
+ export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, blendMode, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
57
59
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../react/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface CircleProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface CircleProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Circle annotation (ellipse) as SVG.
29
33
  */
30
- export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, }: CircleProps): JSX.Element;
34
+ export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: CircleProps): JSX.Element;
31
35
  export {};
@@ -16,6 +16,8 @@ interface PolygonProps {
16
16
  handleSize?: number;
17
17
  /** When true, AP canvas provides the visual; only render hit area */
18
18
  appearanceActive?: boolean;
19
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
20
+ cloudyBorderIntensity?: number;
19
21
  }
20
- export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, }: PolygonProps): JSX.Element;
22
+ export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, cloudyBorderIntensity, }: PolygonProps): JSX.Element;
21
23
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../react/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface SquareProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface SquareProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Square annotation (rectangle) as SVG.
29
33
  */
30
- export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, }: SquareProps): JSX.Element;
34
+ export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: SquareProps): JSX.Element;
31
35
  export {};
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../index.ts';
3
3
  import { HandleElementProps, SelectionMenuPropsBase, SelectionMenuRenderFn } from '../../react/utils.ts';
4
4
  import { JSX, CSSProperties, MouseEvent } from '../../react/adapter.ts';
@@ -152,7 +152,9 @@ export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnno
152
152
  vertexConfig?: VertexConfig<T>;
153
153
  /** z-index for the annotation container (default: 1, text markup uses 0) */
154
154
  zIndex?: number;
155
- /** Style applied to the annotation container (overrides default blendMode style) */
155
+ /** Default blend mode for this annotation type (used when annotation.blendMode is not set) */
156
+ defaultBlendMode?: PdfBlendMode;
157
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
156
158
  containerStyle?: (annotation: T) => CSSProperties;
157
159
  /** Type-specific interaction fallbacks used when the tool doesn't define a property */
158
160
  interactionDefaults?: {
@@ -184,6 +186,8 @@ export interface BoxedAnnotationRenderer {
184
186
  render: (props: AnnotationRendererProps) => JSX.Element;
185
187
  vertexConfig?: VertexConfig<PdfAnnotationObject>;
186
188
  zIndex?: number;
189
+ defaultBlendMode?: PdfBlendMode;
190
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
187
191
  containerStyle?: (annotation: PdfAnnotationObject) => CSSProperties;
188
192
  interactionDefaults?: {
189
193
  isDraggable?: boolean;
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject, AnnotationAppearances } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, AnnotationAppearances, CssBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../lib/index.ts';
3
3
  import { JSX, CSSProperties } from '../../preact/adapter.ts';
4
4
  import { CustomAnnotationRenderer, ResizeHandleUI, AnnotationSelectionMenuRenderFn, AnnotationInteractionEvent, VertexHandleUI, RotationHandleUI, GroupSelectionMenuRenderFn, BoxedAnnotationRenderer, SelectionOutline } from './types';
@@ -32,6 +32,8 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
32
32
  onSelect: (event: AnnotationInteractionEvent) => void;
33
33
  /** Pre-rendered appearance stream images for AP mode rendering */
34
34
  appearance?: AnnotationAppearances<Blob> | null;
35
+ /** Blend mode applied only to the visual content (children + AP image), not to interaction handles */
36
+ blendMode?: CssBlendMode;
35
37
  zIndex?: number;
36
38
  resizeUI?: ResizeHandleUI;
37
39
  vertexUI?: VertexHandleUI;
@@ -53,5 +55,5 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
53
55
  * When isMultiSelected is true, the container becomes passive - drag/resize
54
56
  * is handled by the GroupSelectionBox instead.
55
57
  */
56
- export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
58
+ export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, blendMode, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
57
59
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../preact/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface CircleProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface CircleProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Circle annotation (ellipse) as SVG.
29
33
  */
30
- export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, }: CircleProps): JSX.Element;
34
+ export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: CircleProps): JSX.Element;
31
35
  export {};
@@ -16,6 +16,8 @@ interface PolygonProps {
16
16
  handleSize?: number;
17
17
  /** When true, AP canvas provides the visual; only render hit area */
18
18
  appearanceActive?: boolean;
19
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
20
+ cloudyBorderIntensity?: number;
19
21
  }
20
- export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, }: PolygonProps): JSX.Element;
22
+ export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, cloudyBorderIntensity, }: PolygonProps): JSX.Element;
21
23
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../preact/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface SquareProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface SquareProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Square annotation (rectangle) as SVG.
29
33
  */
30
- export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, }: SquareProps): JSX.Element;
34
+ export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: SquareProps): JSX.Element;
31
35
  export {};
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../lib/index.ts';
3
3
  import { HandleElementProps, SelectionMenuPropsBase, SelectionMenuRenderFn } from '../../preact/utils.ts';
4
4
  import { JSX, CSSProperties, MouseEvent } from '../../preact/adapter.ts';
@@ -152,7 +152,9 @@ export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnno
152
152
  vertexConfig?: VertexConfig<T>;
153
153
  /** z-index for the annotation container (default: 1, text markup uses 0) */
154
154
  zIndex?: number;
155
- /** Style applied to the annotation container (overrides default blendMode style) */
155
+ /** Default blend mode for this annotation type (used when annotation.blendMode is not set) */
156
+ defaultBlendMode?: PdfBlendMode;
157
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
156
158
  containerStyle?: (annotation: T) => CSSProperties;
157
159
  /** Type-specific interaction fallbacks used when the tool doesn't define a property */
158
160
  interactionDefaults?: {
@@ -184,6 +186,8 @@ export interface BoxedAnnotationRenderer {
184
186
  render: (props: AnnotationRendererProps) => JSX.Element;
185
187
  vertexConfig?: VertexConfig<PdfAnnotationObject>;
186
188
  zIndex?: number;
189
+ defaultBlendMode?: PdfBlendMode;
190
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
187
191
  containerStyle?: (annotation: PdfAnnotationObject) => CSSProperties;
188
192
  interactionDefaults?: {
189
193
  isDraggable?: boolean;
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject, AnnotationAppearances } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, AnnotationAppearances, CssBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../lib/index.ts';
3
3
  import { JSX, CSSProperties } from '../../react/adapter.ts';
4
4
  import { CustomAnnotationRenderer, ResizeHandleUI, AnnotationSelectionMenuRenderFn, AnnotationInteractionEvent, VertexHandleUI, RotationHandleUI, GroupSelectionMenuRenderFn, BoxedAnnotationRenderer, SelectionOutline } from './types';
@@ -32,6 +32,8 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
32
32
  onSelect: (event: AnnotationInteractionEvent) => void;
33
33
  /** Pre-rendered appearance stream images for AP mode rendering */
34
34
  appearance?: AnnotationAppearances<Blob> | null;
35
+ /** Blend mode applied only to the visual content (children + AP image), not to interaction handles */
36
+ blendMode?: CssBlendMode;
35
37
  zIndex?: number;
36
38
  resizeUI?: ResizeHandleUI;
37
39
  vertexUI?: VertexHandleUI;
@@ -53,5 +55,5 @@ interface AnnotationContainerProps<T extends PdfAnnotationObject> {
53
55
  * When isMultiSelected is true, the container becomes passive - drag/resize
54
56
  * is handled by the GroupSelectionBox instead.
55
57
  */
56
- export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
58
+ export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, documentId, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, isSelected, isEditing, isMultiSelected, isDraggable, isResizable, isRotatable, lockAspectRatio, style, blendMode, vertexConfig, selectionMenu, outlineOffset, onDoubleClick, onSelect, appearance, zIndex, resizeUI, vertexUI, rotationUI, selectionOutlineColor, selectionOutline, customAnnotationRenderer, groupSelectionMenu: _groupSelectionMenu, groupSelectionOutline: _groupSelectionOutline, annotationRenderers: _annotationRenderers, ...props }: AnnotationContainerProps<T>): JSX.Element;
57
59
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../react/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface CircleProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface CircleProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Circle annotation (ellipse) as SVG.
29
33
  */
30
- export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, }: CircleProps): JSX.Element;
34
+ export declare function Circle({ color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, isSelected, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: CircleProps): JSX.Element;
31
35
  export {};
@@ -16,6 +16,8 @@ interface PolygonProps {
16
16
  handleSize?: number;
17
17
  /** When true, AP canvas provides the visual; only render hit area */
18
18
  appearanceActive?: boolean;
19
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
20
+ cloudyBorderIntensity?: number;
19
21
  }
20
- export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, }: PolygonProps): JSX.Element;
22
+ export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, cloudyBorderIntensity, }: PolygonProps): JSX.Element;
21
23
  export {};
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent } from '../../../react/adapter.ts';
2
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
2
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
3
3
  interface SquareProps {
4
4
  /** Whether the annotation is selected */
5
5
  isSelected: boolean;
@@ -23,9 +23,13 @@ interface SquareProps {
23
23
  onClick?: (e: MouseEvent<SVGElement>) => void;
24
24
  /** When true, AP canvas provides the visual; only render hit area */
25
25
  appearanceActive?: boolean;
26
+ /** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
27
+ cloudyBorderIntensity?: number;
28
+ /** Rectangle differences – inset from Rect to drawn area */
29
+ rectangleDifferences?: PdfRectDifferences;
26
30
  }
27
31
  /**
28
32
  * Renders a PDF Square annotation (rectangle) as SVG.
29
33
  */
30
- export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, }: SquareProps): JSX.Element;
34
+ export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: SquareProps): JSX.Element;
31
35
  export {};
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationObject } from '@embedpdf/models';
1
+ import { PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';
2
2
  import { TrackedAnnotation } from '../../lib/index.ts';
3
3
  import { HandleElementProps, SelectionMenuPropsBase, SelectionMenuRenderFn } from '../../react/utils.ts';
4
4
  import { JSX, CSSProperties, MouseEvent } from '../../react/adapter.ts';
@@ -152,7 +152,9 @@ export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnno
152
152
  vertexConfig?: VertexConfig<T>;
153
153
  /** z-index for the annotation container (default: 1, text markup uses 0) */
154
154
  zIndex?: number;
155
- /** Style applied to the annotation container (overrides default blendMode style) */
155
+ /** Default blend mode for this annotation type (used when annotation.blendMode is not set) */
156
+ defaultBlendMode?: PdfBlendMode;
157
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
156
158
  containerStyle?: (annotation: T) => CSSProperties;
157
159
  /** Type-specific interaction fallbacks used when the tool doesn't define a property */
158
160
  interactionDefaults?: {
@@ -184,6 +186,8 @@ export interface BoxedAnnotationRenderer {
184
186
  render: (props: AnnotationRendererProps) => JSX.Element;
185
187
  vertexConfig?: VertexConfig<PdfAnnotationObject>;
186
188
  zIndex?: number;
189
+ defaultBlendMode?: PdfBlendMode;
190
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
187
191
  containerStyle?: (annotation: PdfAnnotationObject) => CSSProperties;
188
192
  interactionDefaults?: {
189
193
  isDraggable?: boolean;
@@ -1,4 +1,4 @@
1
- import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
1
+ import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
2
2
  interface CircleProps {
3
3
  isSelected: boolean;
4
4
  color?: string;
@@ -11,6 +11,8 @@ interface CircleProps {
11
11
  scale: number;
12
12
  onClick?: (e: PointerEvent) => void;
13
13
  appearanceActive?: boolean;
14
+ cloudyBorderIntensity?: number;
15
+ rectangleDifferences?: PdfRectDifferences;
14
16
  }
15
17
  declare const Circle: import('svelte', { with: { "resolution-mode": "import" } }).Component<CircleProps, {}, "">;
16
18
  type Circle = ReturnType<typeof Circle>;
@@ -14,6 +14,7 @@ interface PolygonProps {
14
14
  currentVertex?: Position;
15
15
  handleSize?: number;
16
16
  appearanceActive?: boolean;
17
+ cloudyBorderIntensity?: number;
17
18
  }
18
19
  declare const Polygon: import('svelte', { with: { "resolution-mode": "import" } }).Component<PolygonProps, {}, "">;
19
20
  type Polygon = ReturnType<typeof Polygon>;
@@ -1,4 +1,4 @@
1
- import { Rect, PdfAnnotationBorderStyle } from '@embedpdf/models';
1
+ import { Rect, PdfRectDifferences, PdfAnnotationBorderStyle } from '@embedpdf/models';
2
2
  interface SquareProps {
3
3
  isSelected: boolean;
4
4
  color?: string;
@@ -11,6 +11,8 @@ interface SquareProps {
11
11
  scale: number;
12
12
  onClick?: (e: MouseEvent) => void;
13
13
  appearanceActive?: boolean;
14
+ cloudyBorderIntensity?: number;
15
+ rectangleDifferences?: PdfRectDifferences;
14
16
  }
15
17
  declare const Square: import('svelte', { with: { "resolution-mode": "import" } }).Component<SquareProps, {}, "">;
16
18
  type Square = ReturnType<typeof Square>;
@@ -1,7 +1,7 @@
1
1
  import { Snippet } from 'svelte';
2
2
  import { CustomAnnotationRenderer, ResizeHandleUI, VertexHandleUI, RotationHandleUI, SelectionOutline, AnnotationSelectionMenuRenderFn, AnnotationSelectionMenuProps, GroupSelectionMenuRenderFn } from '../types';
3
3
  import { VertexConfig } from '../../shared-svelte/types';
4
- import { PdfAnnotationObject, AnnotationAppearances } from '@embedpdf/models';
4
+ import { PdfAnnotationObject, AnnotationAppearances, CssBlendMode } from '@embedpdf/models';
5
5
  import { TrackedAnnotation } from '../../lib/index.ts';
6
6
  import { BoxedAnnotationRenderer } from '../context';
7
7
  export interface AnnotationContainerProps<T extends PdfAnnotationObject> {
@@ -26,6 +26,7 @@ export interface AnnotationContainerProps<T extends PdfAnnotationObject> {
26
26
  lockAspectRatio?: boolean;
27
27
  class?: string;
28
28
  style?: string;
29
+ blendMode?: CssBlendMode;
29
30
  vertexConfig?: VertexConfig<T>;
30
31
  selectionMenu?: AnnotationSelectionMenuRenderFn;
31
32
  selectionMenuSnippet?: Snippet<[AnnotationSelectionMenuProps]>;
@@ -1,5 +1,5 @@
1
1
  import { Component } from 'svelte';
2
- import { PdfAnnotationObject } from '@embedpdf/models';
2
+ import { PdfAnnotationObject, PdfBlendMode } from '@embedpdf/models';
3
3
  import { TrackedAnnotation } from '../../lib/index.ts';
4
4
  import { VertexConfig } from '../../shared-svelte/types';
5
5
  /**
@@ -46,7 +46,9 @@ export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnno
46
46
  vertexConfig?: VertexConfig<T>;
47
47
  /** z-index for the annotation container (default: 1, text markup uses 0) */
48
48
  zIndex?: number;
49
- /** Style applied to the annotation container (overrides default blendMode style) */
49
+ /** Default blend mode for this annotation type (used when the annotation object has no blendMode set) */
50
+ defaultBlendMode?: PdfBlendMode;
51
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
50
52
  containerStyle?: (annotation: T) => string;
51
53
  /** Type-specific interaction fallbacks used when the tool doesn't define a property */
52
54
  interactionDefaults?: {
@@ -77,6 +79,8 @@ export interface BoxedAnnotationRenderer {
77
79
  component: Component<AnnotationRendererProps>;
78
80
  vertexConfig?: VertexConfig<PdfAnnotationObject>;
79
81
  zIndex?: number;
82
+ defaultBlendMode?: PdfBlendMode;
83
+ /** Style applied to the annotation container — overrides the default blend-mode style. */
80
84
  containerStyle?: (annotation: PdfAnnotationObject) => string;
81
85
  interactionDefaults?: {
82
86
  isDraggable?: boolean;