@recogito/text-annotator 3.0.0-rc.11 → 3.0.0-rc.12
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/src/SelectionHandler.d.ts +1 -2
- package/dist/src/TextAnnotatorOptions.d.ts +1 -0
- package/dist/src/api/scrollIntoView.d.ts +1 -1
- package/dist/src/highlight/HighlightPainter.d.ts +8 -19
- package/dist/src/highlight/HighlightStyle.d.ts +9 -0
- package/dist/src/highlight/canvas/highlightRenderer.d.ts +11 -0
- package/dist/src/highlight/canvas/index.d.ts +1 -0
- package/dist/src/highlight/css/highlightRenderer.d.ts +11 -0
- package/dist/src/highlight/css/highlights.d.ts +10 -0
- package/dist/src/highlight/css/index.d.ts +2 -0
- package/dist/src/highlight/index.d.ts +2 -2
- package/dist/src/highlight/viewport.d.ts +12 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/model/core/TextAnnotation.d.ts +1 -1
- package/dist/src/presence/index.d.ts +1 -1
- package/dist/src/presence/presencePainter.d.ts +4 -0
- package/dist/src/state/index.d.ts +0 -1
- package/dist/src/utils/debounce.d.ts +1 -0
- package/dist/src/utils/getAnnotatableFragment.d.ts +5 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/dist/src/utils/isRevived.d.ts +2 -0
- package/dist/src/utils/rangeToSelector.d.ts +2 -0
- package/dist/src/utils/reviveAnnotation.d.ts +2 -0
- package/dist/src/utils/reviveSelector.d.ts +2 -0
- package/dist/src/utils/reviveTarget.d.ts +2 -0
- package/dist/src/utils/splitAnnotatableRanges.d.ts +6 -0
- package/dist/text-annotator.css +1 -1
- package/dist/text-annotator.es.js +1203 -849
- package/dist/text-annotator.es.js.map +1 -1
- package/dist/text-annotator.umd.js +2 -1
- package/dist/text-annotator.umd.js.map +1 -1
- package/package.json +7 -6
- package/dist/src/highlight/highlightLayer.d.ts +0 -11
- package/dist/src/highlight/trackViewport.d.ts +0 -3
- package/dist/src/presence/PresencePainter.d.ts +0 -4
- package/dist/src/state/reviveTarget.d.ts +0 -9
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type User } from '@annotorious/core';
|
|
2
2
|
import type { TextAnnotatorState } from './state';
|
|
3
|
-
import type { TextSelector } from './model';
|
|
4
|
-
export declare const rangeToSelector: (range: Range, container: HTMLElement, offsetReferenceSelector?: string) => TextSelector;
|
|
5
3
|
export declare const SelectionHandler: (container: HTMLElement, state: TextAnnotatorState, offsetReferenceSelector?: string) => {
|
|
4
|
+
destroy: () => void;
|
|
6
5
|
setUser: (user: User) => User;
|
|
7
6
|
};
|
|
@@ -3,6 +3,7 @@ import type { PresencePainterOptions } from './presence';
|
|
|
3
3
|
import type { TextAnnotation } from './model';
|
|
4
4
|
export interface TextAnnotatorOptions<T extends unknown = TextAnnotation> {
|
|
5
5
|
adapter?: FormatAdapter<TextAnnotation, T> | null;
|
|
6
|
+
experimentalCSSRenderer?: boolean;
|
|
6
7
|
offsetReferenceSelector?: string;
|
|
7
8
|
pointerAction?: PointerSelectAction | ((annotation: TextAnnotation) => PointerSelectAction);
|
|
8
9
|
presence?: PresencePainterOptions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { TextAnnotationStore } from '../state';
|
|
2
2
|
import type { TextAnnotation } from '../model';
|
|
3
3
|
export declare const scrollIntoView: (container: HTMLElement, store: TextAnnotationStore) => (annotation: TextAnnotation) => boolean;
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The default painter.
|
|
12
|
-
*/
|
|
13
|
-
export declare const defaultPainter: HighlightPainter;
|
|
14
|
-
export interface HighlightStyle {
|
|
15
|
-
fill?: string;
|
|
16
|
-
fillOpacity?: number;
|
|
17
|
-
underline?: string;
|
|
18
|
-
underlineOpacity?: number;
|
|
19
|
-
underlineWidth?: number;
|
|
1
|
+
import type { AnnotationRects } from '../state';
|
|
2
|
+
import type { HighlightStyle } from './HighlightStyle';
|
|
3
|
+
import type { ViewportBounds } from './viewport';
|
|
4
|
+
export interface HighlightPainter {
|
|
5
|
+
clear(): void;
|
|
6
|
+
destroy(): void;
|
|
7
|
+
paint(annotation: AnnotationRects, viewportBounds: ViewportBounds, isSelected?: boolean): HighlightStyle;
|
|
8
|
+
reset(): void;
|
|
20
9
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DrawingStyle } from '@annotorious/core';
|
|
2
|
+
export declare const DEFAULT_STYLE: DrawingStyle;
|
|
3
|
+
export declare const DEFAULT_SELECTED_STYLE: DrawingStyle;
|
|
4
|
+
export interface HighlightStyle extends Pick<DrawingStyle, 'fill' | 'fillOpacity'> {
|
|
5
|
+
underlineStyle?: string;
|
|
6
|
+
underlineColor?: number;
|
|
7
|
+
underlineOffset?: number;
|
|
8
|
+
underlineThickness?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core';
|
|
2
|
+
import type { TextAnnotation } from '../../model';
|
|
3
|
+
import type { TextAnnotatorState } from '../../state';
|
|
4
|
+
import type { HighlightPainter } from '../HighlightPainter';
|
|
5
|
+
export declare const createCanvasHighlightRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => {
|
|
6
|
+
destroy: () => void;
|
|
7
|
+
refresh: () => number;
|
|
8
|
+
setDrawingStyle: (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => void;
|
|
9
|
+
setFilter: (filter?: Filter) => void;
|
|
10
|
+
setPainter: (painter: HighlightPainter) => HighlightPainter;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './highlightRenderer';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core';
|
|
2
|
+
import type { TextAnnotatorState } from '../../state';
|
|
3
|
+
import type { TextAnnotation } from '../../model';
|
|
4
|
+
import type { HighlightPainter } from '../HighlightPainter';
|
|
5
|
+
export declare const createCSSHighlightRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => {
|
|
6
|
+
destroy: () => void;
|
|
7
|
+
refresh: () => void;
|
|
8
|
+
setDrawingStyle: (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => void;
|
|
9
|
+
setFilter: (filter?: Filter) => void;
|
|
10
|
+
setPainter: (painter: HighlightPainter) => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DrawingStyle } from '@annotorious/core';
|
|
2
|
+
import type { TextAnnotation } from '../../model';
|
|
3
|
+
import type { HighlightPainter } from '../HighlightPainter';
|
|
4
|
+
import type { AnnotationRects } from 'src/state';
|
|
5
|
+
import type { ViewportBounds } from '../viewport';
|
|
6
|
+
export declare const createHighlights: () => {
|
|
7
|
+
destroy: () => void;
|
|
8
|
+
refresh: (highlights: AnnotationRects[], viewportBounds: ViewportBounds, selected: string[], currentStyle: DrawingStyle | ((annotation: TextAnnotation, selected: boolean) => DrawingStyle)) => void;
|
|
9
|
+
setPainter: (painter: HighlightPainter) => HighlightPainter;
|
|
10
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './canvas';
|
|
2
|
+
export * from './css';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ViewportState } from '@annotorious/core';
|
|
2
|
+
import type { TextAnnotation } from '../model';
|
|
3
|
+
export interface ViewportBounds {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
minX: number;
|
|
7
|
+
minY: number;
|
|
8
|
+
maxX: number;
|
|
9
|
+
maxY: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const getViewportBounds: (container: HTMLElement) => ViewportBounds;
|
|
12
|
+
export declare const trackViewport: (viewport: ViewportState) => (annotations: TextAnnotation[]) => void;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './presencePainter';
|
|
2
2
|
export * from './PresencePainterOptions';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PresenceProvider } from '@annotorious/core';
|
|
2
|
+
import type { HighlightPainter } from '../highlight/HighlightPainter';
|
|
3
|
+
import type { PresencePainterOptions } from 'src/presence';
|
|
4
|
+
export declare const createPresencePainter: (container: HTMLElement, provider: PresenceProvider, opts?: PresencePainterOptions) => HighlightPainter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const debounce: <T extends (...args: any[]) => void>(func: T, delay?: number) => T;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
export * from './debounce';
|
|
2
|
+
export * from './getAnnotatableFragment';
|
|
1
3
|
export * from './getClientRectsPonyfill';
|
|
2
4
|
export * from './getQuoteContext';
|
|
5
|
+
export * from './isRevived';
|
|
3
6
|
export * from './mergeClientRects';
|
|
7
|
+
export * from './rangeToSelector';
|
|
8
|
+
export * from './reviveAnnotation';
|
|
9
|
+
export * from './reviveSelector';
|
|
10
|
+
export * from './reviveTarget';
|
|
11
|
+
export * from './splitAnnotatableRanges';
|
|
4
12
|
export * from './trimRange';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const NOT_ANNTOTATABLE_SELECTOR = ".not-annotatable";
|
|
2
|
+
/**
|
|
3
|
+
* Splits a DOM Range into one or more ranges that span annotatable content only.
|
|
4
|
+
*/
|
|
5
|
+
export declare const splitAnnotatableRanges: (range: Range) => Range[];
|
|
6
|
+
export declare const getRangeAnnotatableContents: (range: Range) => DocumentFragment;
|
package/dist/text-annotator.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
html,body{overscroll-behavior-y:none}.r6o-annotatable{-webkit-tap-highlight-color:transparent}.r6o-annotatable,.r6o-annotatable *{position:relative}.
|
|
1
|
+
html,body{overscroll-behavior-y:none}.r6o-annotatable{-webkit-tap-highlight-color:transparent}.r6o-annotatable,.r6o-annotatable *{position:relative}.hovered *{cursor:pointer}.r6o-highlight-layer{left:0;position:fixed;top:0;bottom:0;width:100vw;pointer-events:none}*::selection,::selection{background:#0080ff2e}::-moz-selection{background:#0080ff2e}
|