@recogito/text-annotator 3.4.10 → 4.0.0
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/index.d.ts +8 -7
- package/dist/model/core/index.d.ts +1 -1
- package/dist/model/w3c/index.d.ts +2 -2
- package/dist/model/w3c/{W3CTextFormatAdapter.d.ts → w3c-text-format-adapter.d.ts} +2 -2
- package/dist/rendering/base-renderer.d.ts +31 -0
- package/dist/{highlight/HighlightStyle.d.ts → rendering/highlight-style.d.ts} +4 -1
- package/dist/{highlight/Highlight.d.ts → rendering/highlight.d.ts} +2 -1
- package/dist/rendering/index.d.ts +5 -0
- package/dist/rendering/renderer-css-highlight/css-highlight-renderer.d.ts +7 -0
- package/dist/rendering/renderer-css-highlight/index.d.ts +1 -0
- package/dist/rendering/renderer-inline-markup/index.d.ts +0 -0
- package/dist/rendering/renderer-spans/index.d.ts +1 -0
- package/dist/rendering/renderer-spans/spans-renderer.d.ts +4 -0
- package/dist/selection-handler.d.ts +12 -0
- package/dist/state/index.d.ts +2 -2
- package/dist/state/{spatialTree.d.ts → spatial-tree.d.ts} +2 -2
- package/dist/state/{TextAnnotationStore.d.ts → text-annotation-store.d.ts} +2 -2
- package/dist/state/{TextAnnotatorState.d.ts → text-annotator-state.d.ts} +3 -3
- package/dist/{TextAnnotatorOptions.d.ts → text-annotator-options.d.ts} +4 -6
- package/dist/text-annotator.css +1 -1
- package/dist/{TextAnnotator.d.ts → text-annotator.d.ts} +7 -7
- package/dist/text-annotator.es.js +778 -841
- 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/dist/utils/annotation/index.d.ts +4 -0
- package/dist/utils/{rangeToSelector.d.ts → annotation/range-to-selector.d.ts} +1 -1
- package/dist/utils/{reviveSelector.d.ts → annotation/revive-annotation.d.ts} +4 -1
- package/dist/{api/scrollIntoView.d.ts → utils/annotation/scroll-into-view.d.ts} +2 -2
- package/dist/utils/dom/index.d.ts +7 -0
- package/dist/utils/events/index.d.ts +3 -0
- package/dist/utils/highlight/compute-z-index.d.ts +3 -0
- package/dist/utils/highlight/index.d.ts +4 -0
- package/package.json +3 -3
- package/dist/SelectionHandler.d.ts +0 -12
- package/dist/api/index.d.ts +0 -1
- package/dist/highlight/HighlightPainter.d.ts +0 -11
- package/dist/highlight/Renderer.d.ts +0 -22
- package/dist/highlight/canvas/canvasRenderer.d.ts +0 -5
- package/dist/highlight/canvas/index.d.ts +0 -1
- package/dist/highlight/highlights/highlightsRenderer.d.ts +0 -6
- package/dist/highlight/highlights/index.d.ts +0 -1
- package/dist/highlight/index.d.ts +0 -8
- package/dist/highlight/span/color.d.ts +0 -2
- package/dist/highlight/span/index.d.ts +0 -2
- package/dist/highlight/span/spansRenderer.d.ts +0 -3
- package/dist/presence/PresencePainter.d.ts +0 -5
- package/dist/presence/PresencePainterOptions.d.ts +0 -3
- package/dist/presence/index.d.ts +0 -2
- package/dist/utils/index.d.ts +0 -19
- package/dist/utils/isRevived.d.ts +0 -2
- package/dist/utils/reviveAnnotation.d.ts +0 -2
- package/dist/utils/reviveTarget.d.ts +0 -2
- /package/dist/model/core/{TextAnnotation.d.ts → text-annotation.d.ts} +0 -0
- /package/dist/model/w3c/{W3CTextAnnotation.d.ts → w3c-text-annotation.d.ts} +0 -0
- /package/dist/{highlight → rendering}/viewport.d.ts +0 -0
- /package/dist/utils/{getQuoteContext.d.ts → annotation/get-quote-context.d.ts} +0 -0
- /package/dist/utils/{device.d.ts → dom/device.d.ts} +0 -0
- /package/dist/utils/{isNotAnnotatable.d.ts → dom/is-not-annotatable.d.ts} +0 -0
- /package/dist/utils/{isWhitespaceOrEmpty.d.ts → dom/is-whitespace-or-empty.d.ts} +0 -0
- /package/dist/utils/{mergeRanges.d.ts → dom/merge-ranges.d.ts} +0 -0
- /package/dist/utils/{programmaticallyFocusable.d.ts → dom/programmatically-focusable.d.ts} +0 -0
- /package/dist/utils/{splitAnnotatableRanges.d.ts → dom/split-annotatable-ranges.d.ts} +0 -0
- /package/dist/utils/{trimRangeToContainer.d.ts → dom/trim-range-to-container.d.ts} +0 -0
- /package/dist/utils/{cancelSingleClickEvents.d.ts → events/cancel-single-click-events.d.ts} +0 -0
- /package/dist/utils/{cloneEvents.d.ts → events/clone-events.d.ts} +0 -0
- /package/dist/utils/{debounce.d.ts → events/debounce.d.ts} +0 -0
- /package/dist/utils/{getHighlightClientRects.d.ts → highlight/get-highlight-client-rects.d.ts} +0 -0
- /package/dist/utils/{mergeClientRects.d.ts → highlight/merge-client-rects.d.ts} +0 -0
- /package/dist/utils/{rectsToBounds.d.ts → highlight/rects-to-bounds.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { TextSelector } from '
|
|
1
|
+
import type { TextSelector } from '../../model';
|
|
2
2
|
export declare const rangeToSelector: (range: Range, container: HTMLElement, offsetReferenceSelector?: string) => TextSelector;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { TextSelector } from '
|
|
1
|
+
import type { TextAnnotation, TextAnnotationTarget, TextSelector } from '../../model';
|
|
2
|
+
export declare const isRevived: (selector: TextSelector[]) => boolean;
|
|
2
3
|
/**
|
|
3
4
|
* Creates a new selector object with the revived DOM range from the given text annotation position
|
|
4
5
|
* Only the annotatable elements are processed and counted towards the range
|
|
@@ -9,3 +10,5 @@ import type { TextSelector } from '../model';
|
|
|
9
10
|
* @returns the revived selector
|
|
10
11
|
*/
|
|
11
12
|
export declare const reviveSelector: <T extends TextSelector>(selector: T, container: HTMLElement) => T;
|
|
13
|
+
export declare const reviveTarget: <T extends TextAnnotationTarget = TextAnnotationTarget>(target: T, container: HTMLElement) => T;
|
|
14
|
+
export declare const reviveAnnotation: <T extends TextAnnotation>(annotation: T, container: HTMLElement) => T;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { TextAnnotationStore } from '
|
|
2
|
-
import type { TextAnnotation } from '
|
|
1
|
+
import type { TextAnnotationStore } from '../../state';
|
|
2
|
+
import type { TextAnnotation } from '../../model';
|
|
3
3
|
export declare const scrollIntoView: <I extends TextAnnotation = TextAnnotation>(container: HTMLElement, store: TextAnnotationStore<I>) => <E extends Element = Element>(annotationOrId: string | I, scrollParentOrId?: string | E) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './device';
|
|
2
|
+
export * from './is-not-annotatable';
|
|
3
|
+
export * from './is-whitespace-or-empty';
|
|
4
|
+
export * from './merge-ranges';
|
|
5
|
+
export * from './programmatically-focusable';
|
|
6
|
+
export * from './split-annotatable-ranges';
|
|
7
|
+
export * from './trim-range-to-container';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@recogito/text-annotator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "A JavaScript text annotation library",
|
|
5
5
|
"author": "Rainer Simon",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"vitest": "^4.1.5"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@annotorious/core": "^3.8.
|
|
38
|
+
"@annotorious/core": "^3.8.2",
|
|
39
39
|
"colord": "^2.9.3",
|
|
40
40
|
"debounce": "^3.0.0",
|
|
41
41
|
"dequal": "^2.0.3",
|
|
42
|
-
"hotkeys-js": "^
|
|
42
|
+
"hotkeys-js": "^4.0.4",
|
|
43
43
|
"poll": "^3.2.2",
|
|
44
44
|
"nanoevents": "^9.1.0",
|
|
45
45
|
"rbush": "^4.0.1",
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Filter, Lifecycle, User } from '@annotorious/core';
|
|
2
|
-
import type { TextAnnotatorState } from './state';
|
|
3
|
-
import type { TextAnnotation } from './model';
|
|
4
|
-
import type { AnnotatingMode } from './TextAnnotator';
|
|
5
|
-
import type { TextAnnotatorOptions } from './TextAnnotatorOptions';
|
|
6
|
-
export declare const createSelectionHandler: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, lifecycle: Lifecycle<TextAnnotation, unknown>, options: TextAnnotatorOptions<TextAnnotation, unknown>) => {
|
|
7
|
-
destroy: () => void;
|
|
8
|
-
setFilter: (filter?: Filter) => Filter;
|
|
9
|
-
setUser: (user?: User) => User;
|
|
10
|
-
setAnnotatingEnabled: (enabled: boolean) => void;
|
|
11
|
-
setAnnotatingMode: (mode?: AnnotatingMode) => AnnotatingMode;
|
|
12
|
-
};
|
package/dist/api/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './scrollIntoView';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Highlight } from './Highlight';
|
|
2
|
-
import type { HighlightStyle, HighlightStyleExpression } from './HighlightStyle';
|
|
3
|
-
import type { ViewportBounds } from './viewport';
|
|
4
|
-
export interface HighlightPainter {
|
|
5
|
-
clear(): void;
|
|
6
|
-
destroy(): void;
|
|
7
|
-
paint(highlight: Highlight, viewportBounds: ViewportBounds): HighlightStyle;
|
|
8
|
-
reset(): void;
|
|
9
|
-
}
|
|
10
|
-
/** Helper **/
|
|
11
|
-
export declare const paint: (highlight: Highlight, viewportBounds: ViewportBounds, style?: HighlightStyleExpression, painter?: HighlightPainter, zIndex?: number) => HighlightStyle;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type Filter, type ViewportState } from '@annotorious/core';
|
|
2
|
-
import type { TextAnnotation } from '../model';
|
|
3
|
-
import type { TextAnnotatorState } from '../state';
|
|
4
|
-
import { type ViewportBounds } from './viewport';
|
|
5
|
-
import type { HighlightPainter } from './HighlightPainter';
|
|
6
|
-
import type { Highlight } from './Highlight';
|
|
7
|
-
import type { HighlightStyleExpression } from './HighlightStyle';
|
|
8
|
-
export type RendererFactory = (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => Renderer;
|
|
9
|
-
export interface RendererImplementation {
|
|
10
|
-
destroy(): void;
|
|
11
|
-
redraw(highlights: Highlight[], bounds: ViewportBounds, style?: HighlightStyleExpression, painter?: HighlightPainter, lazy?: boolean): void;
|
|
12
|
-
setVisible(visible: boolean): void;
|
|
13
|
-
}
|
|
14
|
-
export interface Renderer {
|
|
15
|
-
destroy(): void;
|
|
16
|
-
redraw(force?: boolean): void;
|
|
17
|
-
setStyle(style?: HighlightStyleExpression): void;
|
|
18
|
-
setFilter(filter?: Filter): void;
|
|
19
|
-
setPainter(painter?: HighlightPainter): void;
|
|
20
|
-
setVisible(visible: boolean): void;
|
|
21
|
-
}
|
|
22
|
-
export declare const createBaseRenderer: <T extends TextAnnotatorState = TextAnnotatorState>(container: HTMLElement, state: T, viewport: ViewportState, renderer: RendererImplementation) => Renderer;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ViewportState } from '@annotorious/core';
|
|
2
|
-
import type { TextAnnotatorState } from '../../state';
|
|
3
|
-
import type { TextAnnotation } from 'src/model';
|
|
4
|
-
import './canvasRenderer.css';
|
|
5
|
-
export declare const createCanvasRenderer: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => import("..").Renderer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './canvasRenderer';
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ViewportState } from '@annotorious/core';
|
|
2
|
-
import type { TextAnnotatorState } from 'src/state';
|
|
3
|
-
import { type RendererImplementation } from '../Renderer';
|
|
4
|
-
import type { TextAnnotation } from 'src/model';
|
|
5
|
-
export declare const createRenderer: () => RendererImplementation;
|
|
6
|
-
export declare const createHighlightsRenderer: (container: HTMLElement, state: TextAnnotatorState<TextAnnotation, unknown>, viewport: ViewportState) => import("..").Renderer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './highlightsRenderer';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { PresenceProvider } from '@annotorious/core';
|
|
2
|
-
import type { HighlightPainter } from '../highlight';
|
|
3
|
-
import type { PresencePainterOptions } from '../presence';
|
|
4
|
-
import './PresencePainter.css';
|
|
5
|
-
export declare const createPresencePainter: (provider: PresenceProvider, opts?: PresencePainterOptions) => HighlightPainter;
|
package/dist/presence/index.d.ts
DELETED
package/dist/utils/index.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export * from './cancelSingleClickEvents';
|
|
2
|
-
export * from './cloneEvents';
|
|
3
|
-
export * from './debounce';
|
|
4
|
-
export * from './device';
|
|
5
|
-
export * from './programmaticallyFocusable';
|
|
6
|
-
export * from './getHighlightClientRects';
|
|
7
|
-
export * from './getQuoteContext';
|
|
8
|
-
export * from './isNotAnnotatable';
|
|
9
|
-
export * from './isRevived';
|
|
10
|
-
export * from './isWhitespaceOrEmpty';
|
|
11
|
-
export * from './mergeClientRects';
|
|
12
|
-
export * from './mergeRanges';
|
|
13
|
-
export * from './rangeToSelector';
|
|
14
|
-
export * from './rectsToBounds';
|
|
15
|
-
export * from './reviveAnnotation';
|
|
16
|
-
export * from './reviveSelector';
|
|
17
|
-
export * from './reviveTarget';
|
|
18
|
-
export * from './splitAnnotatableRanges';
|
|
19
|
-
export * from './trimRangeToContainer';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/utils/{getHighlightClientRects.d.ts → highlight/get-highlight-client-rects.d.ts}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|