@recogito/text-annotator 3.1.6 → 3.2.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.
@@ -17,13 +17,17 @@ export interface TextAnnotatorOptions<I extends TextAnnotation = TextAnnotation,
17
17
  * @defaut NEVER
18
18
  */
19
19
  dismissOnNotAnnotatable?: DismissOnNotAnnotatableExpression;
20
- renderer?: RendererType;
20
+ mergeHighlights?: {
21
+ horizontalTolerance?: number;
22
+ verticalTolerance?: number;
23
+ };
21
24
  offsetReferenceSelector?: string;
22
- userSelectAction?: UserSelectActionExpression<E>;
23
25
  presence?: PresencePainterOptions;
26
+ renderer?: RendererType;
24
27
  selectionMode?: 'shortest' | 'all';
25
28
  style?: HighlightStyleExpression;
26
29
  user?: User;
30
+ userSelectAction?: UserSelectActionExpression<E>;
27
31
  }
28
32
  export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS';
29
33
  export type DismissOnNotAnnotatableExpression = 'NEVER' | 'ALWAYS' | ((event: Event, container: HTMLElement) => boolean);
@@ -11,7 +11,7 @@ interface IndexedHighlightRect {
11
11
  rects: DOMRect[];
12
12
  };
13
13
  }
14
- export declare const createSpatialTree: <T extends TextAnnotation>(store: Store<T>, container: HTMLElement) => {
14
+ export declare const createSpatialTree: <T extends TextAnnotation>(store: Store<T>, container: HTMLElement, hMergeTolerance?: number, vMergeTolerance?: number) => {
15
15
  all: () => IndexedHighlightRect[][];
16
16
  clear: () => void;
17
17
  getAt: (x: number, y: number, all?: boolean) => string[];
@@ -0,0 +1 @@
1
+ export declare const getHighlightClientRects: (range: Range) => DOMRect[];
@@ -3,6 +3,7 @@ export * from './cloneEvents';
3
3
  export * from './device';
4
4
  export * from './programmaticallyFocusable';
5
5
  export * from './debounce';
6
+ export * from './getHighlightClientRects';
6
7
  export * from './getQuoteContext';
7
8
  export * from './isNotAnnotatable';
8
9
  export * from './isRevived';
@@ -1,2 +1,2 @@
1
- export declare const mergeClientRects: (rects: DOMRect[]) => DOMRect[];
1
+ export declare const mergeClientRects: (rects: DOMRect[], hTolerance?: number, vTolerance?: number) => DOMRect[];
2
2
  export declare const toDomRectList: (rects: DOMRect[]) => DOMRectList;