@recogito/text-annotator 3.1.4 → 3.1.6

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.
@@ -5,7 +5,18 @@ import { HighlightStyleExpression } from './highlight';
5
5
  export interface TextAnnotatorOptions<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> {
6
6
  adapter?: FormatAdapter<I, E> | null;
7
7
  annotatingEnabled?: boolean;
8
- dismissOnClickOutside?: boolean;
8
+ /**
9
+ * Determines whether an active selection should be dismissed
10
+ * when a user ends their interaction (click, selection)
11
+ * on a non-annotatable element.
12
+ * - NEVER - don't dismiss the selection, ignore the action.
13
+ * - ALWAYS - dismiss the selection.
14
+ * - function - a custom matcher that takes an event and container as arguments.
15
+ * Returns `true` if the selection should be dismissed.
16
+ *
17
+ * @defaut NEVER
18
+ */
19
+ dismissOnNotAnnotatable?: DismissOnNotAnnotatableExpression;
9
20
  renderer?: RendererType;
10
21
  offsetReferenceSelector?: string;
11
22
  userSelectAction?: UserSelectActionExpression<E>;
@@ -15,4 +26,5 @@ export interface TextAnnotatorOptions<I extends TextAnnotation = TextAnnotation,
15
26
  user?: User;
16
27
  }
17
28
  export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS';
29
+ export type DismissOnNotAnnotatableExpression = 'NEVER' | 'ALWAYS' | ((event: Event, container: HTMLElement) => boolean);
18
30
  export declare const fillDefaults: <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(opts: TextAnnotatorOptions<I, E>, defaults: TextAnnotatorOptions<I, E>) => TextAnnotatorOptions<I, E>;