@recogito/text-annotator 3.0.0-rc.10 → 3.0.0-rc.11
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/api/scrollIntoView.d.ts +1 -1
- package/dist/src/highlight/highlightLayer.d.ts +1 -0
- package/dist/src/model/core/index.d.ts +1 -0
- package/dist/src/model/index.d.ts +2 -1
- package/dist/src/model/w3c/W3CTextAnnotation.d.ts +33 -0
- package/dist/src/model/w3c/W3CTextFormatAdapter.d.ts +12 -0
- package/dist/src/model/w3c/index.d.ts +2 -0
- package/dist/src/utils/getQuoteContext.d.ts +4 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/test/model/w3c/W3CTextFormatAdapter.test.d.ts +1 -0
- package/dist/test/model/w3c/fixtures.d.ts +3 -0
- package/dist/text-annotator.es.js +1006 -881
- package/dist/text-annotator.es.js.map +1 -1
- package/dist/text-annotator.umd.js +1 -1
- package/dist/text-annotator.umd.js.map +1 -1
- package/package.json +7 -3
- package/dist/src/utils/getContext.d.ts +0 -4
- /package/dist/src/model/{TextAnnotation.d.ts → core/TextAnnotation.d.ts} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type TextAnnotationStore } from '../state';
|
|
2
|
-
import type { TextAnnotation } from '../model
|
|
2
|
+
import type { TextAnnotation } from '../model';
|
|
3
3
|
export declare const scrollIntoView: (container: HTMLElement, store: TextAnnotationStore) => (annotation: TextAnnotation) => boolean;
|
|
@@ -3,6 +3,7 @@ import type { TextAnnotation } from '../model';
|
|
|
3
3
|
import type { TextAnnotatorState } from '../state';
|
|
4
4
|
import { type HighlightPainter } from './HighlightPainter';
|
|
5
5
|
export declare const createHighlightLayer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => {
|
|
6
|
+
destroy: () => void;
|
|
6
7
|
redraw: () => number;
|
|
7
8
|
setDrawingStyle: (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => void;
|
|
8
9
|
setFilter: (filter?: Filter) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TextAnnotation';
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './core';
|
|
2
|
+
export * from './w3c';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { W3CAnnotation, W3CAnnotationTarget } from '@annotorious/core';
|
|
2
|
+
export interface W3CTextAnnotation extends W3CAnnotation {
|
|
3
|
+
target: W3CTextAnnotationTarget | W3CTextAnnotationTarget[];
|
|
4
|
+
stylesheet?: W3CAnnotationStylesheet;
|
|
5
|
+
}
|
|
6
|
+
export interface W3CTextAnnotationTarget extends W3CAnnotationTarget {
|
|
7
|
+
selector: W3CTextSelector | W3CTextSelector[];
|
|
8
|
+
styleClass?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Matches the `Text Quote Selector` spec
|
|
12
|
+
* @see https://www.w3.org/TR/annotation-model/#text-quote-selector
|
|
13
|
+
*/
|
|
14
|
+
export interface W3CTextQuoteSelector {
|
|
15
|
+
type: 'TextQuoteSelector';
|
|
16
|
+
exact: string;
|
|
17
|
+
prefix?: string;
|
|
18
|
+
suffix?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Matches the `Text Position Selector` spec
|
|
22
|
+
* @see https://www.w3.org/TR/annotation-model/#text-position-selector
|
|
23
|
+
*/
|
|
24
|
+
export interface W3CTextPositionSelector {
|
|
25
|
+
type: 'TextPositionSelector';
|
|
26
|
+
start: number;
|
|
27
|
+
end: number;
|
|
28
|
+
}
|
|
29
|
+
export type W3CTextSelector = W3CTextQuoteSelector | W3CTextPositionSelector;
|
|
30
|
+
export type W3CAnnotationStylesheet = string | {
|
|
31
|
+
type: 'CssStylesheet';
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FormatAdapter, ParseResult } from '@annotorious/core';
|
|
2
|
+
import type { TextAnnotation } from '../core';
|
|
3
|
+
import type { W3CTextAnnotation } from '../w3c';
|
|
4
|
+
export type W3CTextFormatAdapter = FormatAdapter<TextAnnotation, W3CTextAnnotation>;
|
|
5
|
+
/**
|
|
6
|
+
* @param source - the IRI of the annotated content
|
|
7
|
+
* @param container - the HTML container of the annotated content,
|
|
8
|
+
* Required to locate the content's `range` within the DOM
|
|
9
|
+
*/
|
|
10
|
+
export declare const W3CTextFormat: (source: string, container: HTMLElement) => W3CTextFormatAdapter;
|
|
11
|
+
export declare const parseW3CTextAnnotation: (annotation: W3CTextAnnotation, container: HTMLElement) => ParseResult<TextAnnotation>;
|
|
12
|
+
export declare const serializeW3CTextAnnotation: (annotation: TextAnnotation, source: string, container: HTMLElement) => W3CTextAnnotation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|