@soomo/text-annotator 3.4.0-staging.2 → 3.4.1-staging.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);
@@ -0,0 +1,2 @@
1
+ import { HighlightStyle } from '../HighlightStyle';
2
+ export declare const getBackgroundColor: (style?: HighlightStyle) => string;
@@ -15,7 +15,7 @@ interface IndexedHighlightRect {
15
15
  export interface SpatialTreeEvents {
16
16
  recalculate(): void;
17
17
  }
18
- export declare const createSpatialTree: <T extends TextAnnotation>(store: Store<T>, container: HTMLElement) => {
18
+ export declare const createSpatialTree: <T extends TextAnnotation>(store: Store<T>, container: HTMLElement, hMergeTolerance?: number, vMergeTolerance?: number) => {
19
19
  all: () => IndexedHighlightRect[][];
20
20
  clear: () => void;
21
21
  getAt: (x: number, y: number, all?: boolean) => string[];
@@ -0,0 +1 @@
1
+ export declare const getHighlightClientRects: (range: Range) => DOMRect[];
@@ -1,6 +1,7 @@
1
1
  export * from './cancelSingleClickEvents';
2
2
  export * from './device';
3
3
  export * from './programmaticallyFocusable';
4
+ export * from './getHighlightClientRects';
4
5
  export * from './getQuoteContext';
5
6
  export * from './isNotAnnotatable';
6
7
  export * from './isRevived';
@@ -13,5 +14,4 @@ export * from './reviveTarget';
13
14
  export * from './splitAnnotatableRanges';
14
15
  export * from './trimRangeToContainer';
15
16
  export * from './cloneEvents';
16
- export * from './rangeContains';
17
17
  export * from './rectsToBounds';
@@ -1,2 +1,3 @@
1
1
  export declare const whitespaceOrEmptyRegex: RegExp;
2
- export declare const isWhitespaceOrEmpty: (range: Range) => boolean;
2
+ export declare const isRangeWhitespaceOrEmpty: (range: Range) => boolean;
3
+ export declare const isNodeWhitespaceOrEmpty: (node: Node) => boolean;
@@ -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;