@soomo/text-annotator 3.0.0-staging.50 → 3.0.0-staging.52
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 +0 -1
- package/dist/src/TextAnnotator.d.ts +0 -1
- package/dist/src/TextAnnotatorOptions.d.ts +0 -1
- package/dist/src/api/scrollIntoView.d.ts +0 -1
- package/dist/src/highlight/Highlight.d.ts +0 -1
- package/dist/src/highlight/HighlightPainter.d.ts +0 -1
- package/dist/src/highlight/HighlightStyle.d.ts +0 -1
- package/dist/src/highlight/baseRenderer.d.ts +0 -1
- package/dist/src/highlight/canvas/canvasRenderer.d.ts +0 -1
- package/dist/src/highlight/highlights/highlightsRenderer.d.ts +0 -1
- package/dist/src/highlight/span/spansRenderer.d.ts +0 -1
- package/dist/src/highlight/viewport.d.ts +0 -1
- package/dist/src/model/core/TextAnnotation.d.ts +0 -1
- package/dist/src/model/w3c/W3CTextAnnotation.d.ts +0 -1
- package/dist/src/model/w3c/W3CTextFormatAdapter.d.ts +0 -1
- package/dist/src/presence/PresencePainter.d.ts +0 -1
- package/dist/src/state/TextAnnotationStore.d.ts +0 -1
- package/dist/src/state/TextAnnotatorState.d.ts +0 -1
- package/dist/src/state/spatialTree.d.ts +0 -1
- package/dist/src/utils/debounce.d.ts +9 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/isRevived.d.ts +0 -1
- package/dist/src/utils/rangeToSelector.d.ts +0 -1
- package/dist/src/utils/reviveAnnotation.d.ts +0 -1
- package/dist/src/utils/reviveSelector.d.ts +0 -1
- package/dist/src/utils/reviveTarget.d.ts +0 -1
- package/dist/test/model/w3c/fixtures.d.ts +0 -1
- package/dist/text-annotator.es.js +1218 -1185
- 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 +10 -10
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Filter, User } from '@annotorious/core';
|
|
2
2
|
import { TextAnnotatorState } from './state';
|
|
3
|
-
|
|
4
3
|
export declare const createSelectionHandler: (container: HTMLElement, state: TextAnnotatorState, offsetReferenceSelector?: string) => {
|
|
5
4
|
destroy: () => void;
|
|
6
5
|
setFilter: (filter?: Filter) => Filter;
|
|
@@ -3,7 +3,6 @@ import { HighlightStyleExpression } from './highlight';
|
|
|
3
3
|
import { TextAnnotatorState } from './state';
|
|
4
4
|
import { TextAnnotation } from './model';
|
|
5
5
|
import { TextAnnotatorOptions } from './TextAnnotatorOptions';
|
|
6
|
-
|
|
7
6
|
export interface TextAnnotator<E extends unknown = TextAnnotation> extends Annotator<TextAnnotation, E> {
|
|
8
7
|
element: HTMLElement;
|
|
9
8
|
setStyle(style: HighlightStyleExpression | undefined): void;
|
|
@@ -2,7 +2,6 @@ import { FormatAdapter, UserSelectActionExpression, User } from '@annotorious/co
|
|
|
2
2
|
import { PresencePainterOptions } from './presence';
|
|
3
3
|
import { TextAnnotation } from './model';
|
|
4
4
|
import { HighlightStyleExpression } from './highlight';
|
|
5
|
-
|
|
6
5
|
export interface TextAnnotatorOptions<T extends unknown = TextAnnotation> {
|
|
7
6
|
adapter?: FormatAdapter<TextAnnotation, T> | null;
|
|
8
7
|
annotatingEnabled?: boolean;
|
|
@@ -4,7 +4,6 @@ import { ViewportBounds } from './viewport';
|
|
|
4
4
|
import { HighlightPainter } from './HighlightPainter';
|
|
5
5
|
import { Highlight } from './Highlight';
|
|
6
6
|
import { HighlightStyleExpression } from './HighlightStyle';
|
|
7
|
-
|
|
8
7
|
export interface RendererImplementation {
|
|
9
8
|
destroy(): void;
|
|
10
9
|
redraw(highlights: Highlight[], bounds: ViewportBounds, style?: HighlightStyleExpression, painter?: HighlightPainter, lazy?: boolean): void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ViewportState } from '@annotorious/core';
|
|
2
2
|
import { TextAnnotatorState } from 'src/state';
|
|
3
3
|
import { RendererImplementation } from '../baseRenderer';
|
|
4
|
-
|
|
5
4
|
export declare const createRenderer: () => RendererImplementation;
|
|
6
5
|
export declare const createHighlightsRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => import('../baseRenderer').Renderer;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { FormatAdapter, ParseResult } from '@annotorious/core';
|
|
2
2
|
import { TextAnnotation } from '../core';
|
|
3
3
|
import { W3CTextAnnotation } from '../w3c';
|
|
4
|
-
|
|
5
4
|
export type W3CTextFormatAdapter = FormatAdapter<TextAnnotation, W3CTextAnnotation>;
|
|
6
5
|
/**
|
|
7
6
|
* @param source - the IRI of the annotated content
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PresenceProvider } from '@annotorious/core';
|
|
2
2
|
import { HighlightPainter } from '../highlight';
|
|
3
3
|
import { PresencePainterOptions } from '../presence';
|
|
4
|
-
|
|
5
4
|
export declare const createPresencePainter: (container: HTMLElement, provider: PresenceProvider, opts?: PresencePainterOptions) => HighlightPainter;
|
|
@@ -2,7 +2,6 @@ import { Unsubscribe } from 'nanoevents';
|
|
|
2
2
|
import { Filter, Origin, Store } from '@annotorious/core';
|
|
3
3
|
import { TextAnnotation } from '../model';
|
|
4
4
|
import { SpatialTreeEvents } from './spatialTree';
|
|
5
|
-
|
|
6
5
|
export interface TextAnnotationStore extends Omit<Store<TextAnnotation>, 'addAnnotation' | 'bulkAddAnnotation'> {
|
|
7
6
|
addAnnotation(annotation: TextAnnotation, origin?: Origin): boolean;
|
|
8
7
|
bulkAddAnnotation(annotations: TextAnnotation[], replace: boolean, origin?: Origin): TextAnnotation[];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ViewportState, UserSelectActionExpression, AnnotatorState, SelectionState, HoverState } from '@annotorious/core';
|
|
2
2
|
import { TextAnnotation } from '../model';
|
|
3
3
|
import { TextAnnotationStore } from './TextAnnotationStore';
|
|
4
|
-
|
|
5
4
|
export interface TextAnnotatorState extends AnnotatorState<TextAnnotation> {
|
|
6
5
|
store: TextAnnotationStore;
|
|
7
6
|
selection: SelectionState<TextAnnotation>;
|
|
@@ -2,7 +2,6 @@ import { Store } from '@annotorious/core';
|
|
|
2
2
|
import { Unsubscribe } from 'nanoevents';
|
|
3
3
|
import { TextAnnotation, TextAnnotationTarget } from '../model';
|
|
4
4
|
import { AnnotationRects } from './TextAnnotationStore';
|
|
5
|
-
|
|
6
5
|
interface IndexedHighlightRect {
|
|
7
6
|
minX: number;
|
|
8
7
|
minY: number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as libDebounce } from 'debounce';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the `debounce` function from the `debounce` package
|
|
4
|
+
* to make it context-agnostic.
|
|
5
|
+
* Otherwise, we won't be able to use it in multiple event listeners simultaneously,
|
|
6
|
+
* like `window.onresize` and `ResizeObserver`.
|
|
7
|
+
* @see https://github.com/sindresorhus/debounce/issues/8#issuecomment-2321341074
|
|
8
|
+
*/
|
|
9
|
+
export declare const debounce: typeof libDebounce;
|