@recogito/text-annotator 4.1.0 → 4.1.1
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.
- package/dist/rendering/base-renderer.d.ts +4 -4
- package/dist/rendering/highlight-style.d.ts +2 -2
- package/dist/rendering/highlight.d.ts +2 -2
- package/dist/rendering/renderer-spans/spans-renderer.d.ts +2 -2
- package/dist/rendering/viewport.d.ts +2 -2
- package/dist/text-annotator.d.ts +1 -1
- package/dist/text-annotator.es.js +292 -292
- package/dist/text-annotator.es.js.map +1 -1
- package/dist/text-annotator.umd.js +2 -2
- package/dist/text-annotator.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Unsubscribe } from 'nanoevents';
|
|
2
|
-
import { type
|
|
3
|
-
import type {
|
|
2
|
+
import { type Filter, type ViewportState } from '@annotorious/core';
|
|
3
|
+
import type { TextAnnotationLike } from '../model';
|
|
4
4
|
import type { TextAnnotatorState } from '../state';
|
|
5
5
|
import { type Highlight, type HighlightStyleExpression, type ViewportBounds } from './';
|
|
6
6
|
/**
|
|
@@ -17,7 +17,7 @@ export interface Renderer {
|
|
|
17
17
|
export interface RendererEvents {
|
|
18
18
|
onRedraw(): void;
|
|
19
19
|
}
|
|
20
|
-
export type RendererFactory<T extends
|
|
20
|
+
export type RendererFactory<T extends TextAnnotationLike> = (container: HTMLElement, state: TextAnnotatorState<T, any>, viewport: ViewportState) => Renderer;
|
|
21
21
|
/**
|
|
22
22
|
* A utility interface. Instead of implementing a Renderer from scratch,
|
|
23
23
|
* implementers can simply implement a painter, and wrap it in the
|
|
@@ -28,4 +28,4 @@ export interface Painter {
|
|
|
28
28
|
redraw(highlights: Highlight[], bounds: ViewportBounds, style?: HighlightStyleExpression, styleOverrides?: Map<string, HighlightStyleExpression>, force?: boolean): void;
|
|
29
29
|
setVisible(visible: boolean): void;
|
|
30
30
|
}
|
|
31
|
-
export declare const createRenderer: <T extends TextAnnotatorState
|
|
31
|
+
export declare const createRenderer: <T extends TextAnnotatorState<TextAnnotationLike, any>>(painter: Painter, container: HTMLElement, state: T, viewport: ViewportState) => Renderer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AnnotationState, Color, DrawingStyle } from '@annotorious/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextAnnotationLike } from '../model';
|
|
3
3
|
import type { Highlight } from './';
|
|
4
4
|
export interface HighlightStyle extends Pick<DrawingStyle, 'fill' | 'fillOpacity'> {
|
|
5
5
|
underlineStyle?: string;
|
|
@@ -7,7 +7,7 @@ export interface HighlightStyle extends Pick<DrawingStyle, 'fill' | 'fillOpacity
|
|
|
7
7
|
underlineOffset?: number;
|
|
8
8
|
underlineThickness?: number;
|
|
9
9
|
}
|
|
10
|
-
export type HighlightStyleExpression = HighlightStyle | (<I extends
|
|
10
|
+
export type HighlightStyleExpression = HighlightStyle | (<I extends TextAnnotationLike = TextAnnotationLike>(annotation: I, state: AnnotationState, zIndex?: number) => HighlightStyle | undefined);
|
|
11
11
|
export declare const DEFAULT_STYLE: HighlightStyle;
|
|
12
12
|
export declare const DEFAULT_SELECTED_STYLE: HighlightStyle;
|
|
13
13
|
export declare const getBackgroundColor: (style?: HighlightStyle) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AnnotationState } from '@annotorious/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextAnnotationLike } from '../model';
|
|
3
3
|
import type { AnnotationRects } from '../state';
|
|
4
|
-
export interface Highlight extends AnnotationRects<
|
|
4
|
+
export interface Highlight extends AnnotationRects<TextAnnotationLike> {
|
|
5
5
|
state: AnnotationState;
|
|
6
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextAnnotationLike } from '../../model';
|
|
2
2
|
import { type RendererFactory } from '../';
|
|
3
3
|
import './spans-renderer.css';
|
|
4
|
-
export declare const createSpansRenderer: RendererFactory<
|
|
4
|
+
export declare const createSpansRenderer: RendererFactory<TextAnnotationLike>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewportState } from '@annotorious/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextAnnotationLike } from '../model';
|
|
3
3
|
export interface ViewportBounds {
|
|
4
4
|
top: number;
|
|
5
5
|
left: number;
|
|
@@ -9,4 +9,4 @@ export interface ViewportBounds {
|
|
|
9
9
|
maxY: number;
|
|
10
10
|
}
|
|
11
11
|
export declare const getViewportBounds: (container: HTMLElement) => ViewportBounds;
|
|
12
|
-
export declare const trackViewport: (viewport: ViewportState) => (annotations:
|
|
12
|
+
export declare const trackViewport: (viewport: ViewportState) => (annotations: TextAnnotationLike[]) => void;
|
package/dist/text-annotator.d.ts
CHANGED
|
@@ -14,4 +14,4 @@ export interface TextAnnotator<I extends TextAnnotationLike = TextAnnotation, E
|
|
|
14
14
|
state: TextAnnotatorState<I, E>;
|
|
15
15
|
}
|
|
16
16
|
export type AnnotatingMode = 'CREATE_NEW' | 'ADD_TO_CURRENT' | 'REPLACE_CURRENT';
|
|
17
|
-
export declare const createTextAnnotator: <I extends TextAnnotationLike =
|
|
17
|
+
export declare const createTextAnnotator: <I extends TextAnnotationLike = TextAnnotationLike, E extends unknown = TextAnnotationLike>(container: HTMLElement, options?: TextAnnotatorOptions<I, E>) => TextAnnotator<I, E>;
|