@recogito/text-annotator 3.0.0-rc.39 → 3.0.0-rc.40

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.
Files changed (31) hide show
  1. package/dist/src/SelectionHandler.d.ts +0 -1
  2. package/dist/src/TextAnnotator.d.ts +0 -1
  3. package/dist/src/TextAnnotatorOptions.d.ts +3 -3
  4. package/dist/src/api/scrollIntoView.d.ts +0 -1
  5. package/dist/src/highlight/Highlight.d.ts +0 -1
  6. package/dist/src/highlight/HighlightPainter.d.ts +0 -1
  7. package/dist/src/highlight/HighlightStyle.d.ts +0 -1
  8. package/dist/src/highlight/baseRenderer.d.ts +0 -1
  9. package/dist/src/highlight/canvas/canvasRenderer.d.ts +0 -1
  10. package/dist/src/highlight/highlights/highlightsRenderer.d.ts +0 -1
  11. package/dist/src/highlight/span/spansRenderer.d.ts +0 -1
  12. package/dist/src/highlight/viewport.d.ts +0 -1
  13. package/dist/src/model/core/TextAnnotation.d.ts +0 -1
  14. package/dist/src/model/w3c/W3CTextAnnotation.d.ts +0 -1
  15. package/dist/src/model/w3c/W3CTextFormatAdapter.d.ts +0 -1
  16. package/dist/src/presence/PresencePainter.d.ts +0 -1
  17. package/dist/src/state/TextAnnotationStore.d.ts +0 -1
  18. package/dist/src/state/TextAnnotatorState.d.ts +1 -2
  19. package/dist/src/state/spatialTree.d.ts +0 -1
  20. package/dist/src/utils/isRevived.d.ts +0 -1
  21. package/dist/src/utils/rangeToSelector.d.ts +0 -1
  22. package/dist/src/utils/reviveAnnotation.d.ts +0 -1
  23. package/dist/src/utils/reviveSelector.d.ts +0 -1
  24. package/dist/src/utils/reviveTarget.d.ts +0 -1
  25. package/dist/test/model/w3c/fixtures.d.ts +0 -1
  26. package/dist/text-annotator.css +1 -1
  27. package/dist/text-annotator.es.js +916 -891
  28. package/dist/text-annotator.es.js.map +1 -1
  29. package/dist/text-annotator.umd.js +2 -2
  30. package/dist/text-annotator.umd.js.map +1 -1
  31. 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 SelectionHandler: (container: HTMLElement, state: TextAnnotatorState, annotatingEnabled: boolean, 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;
@@ -1,16 +1,16 @@
1
- import { FormatAdapter, UserSelectActionExpression } from '@annotorious/core';
1
+ import { FormatAdapter, UserSelectActionExpression, User } from '@annotorious/core';
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;
9
8
  renderer?: RendererType;
10
9
  offsetReferenceSelector?: string;
11
- userAction?: UserSelectActionExpression<TextAnnotation>;
10
+ userSelectAction?: UserSelectActionExpression<TextAnnotation>;
12
11
  presence?: PresencePainterOptions;
13
12
  style?: HighlightStyleExpression;
13
+ user?: User;
14
14
  }
15
15
  export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS';
16
16
  export declare const fillDefaults: <T extends unknown = TextAnnotation>(opts: TextAnnotatorOptions<T>, defaults: TextAnnotatorOptions<T>) => TextAnnotatorOptions<T>;
@@ -1,4 +1,3 @@
1
1
  import { TextAnnotationStore } from '../state';
2
2
  import { TextAnnotation } from '../model';
3
-
4
3
  export declare const scrollIntoView: (container: HTMLElement, store: TextAnnotationStore) => (annotationOrId: string | TextAnnotation) => boolean;
@@ -1,6 +1,5 @@
1
1
  import { AnnotationState } from '@annotorious/core';
2
2
  import { AnnotationRects } from '../state';
3
-
4
3
  export interface Highlight extends AnnotationRects {
5
4
  state: AnnotationState;
6
5
  }
@@ -1,7 +1,6 @@
1
1
  import { Highlight } from './Highlight';
2
2
  import { HighlightStyle, HighlightStyleExpression } from './HighlightStyle';
3
3
  import { ViewportBounds } from './viewport';
4
-
5
4
  export interface HighlightPainter {
6
5
  clear(): void;
7
6
  destroy(): void;
@@ -1,6 +1,5 @@
1
1
  import { AnnotationState, Color, DrawingStyle } from '@annotorious/core';
2
2
  import { TextAnnotation } from 'src/model';
3
-
4
3
  export interface HighlightStyle extends Pick<DrawingStyle, 'fill' | 'fillOpacity'> {
5
4
  underlineStyle?: string;
6
5
  underlineColor?: Color;
@@ -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,4 +1,3 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from '../../state';
3
-
4
3
  export declare const createCanvasRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => import('../baseRenderer').Renderer;
@@ -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,4 +1,3 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotatorState } from '../../state';
3
-
4
3
  export declare const createSpansRenderer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => import('../baseRenderer').Renderer;
@@ -1,6 +1,5 @@
1
1
  import { ViewportState } from '@annotorious/core';
2
2
  import { TextAnnotation } from '../model';
3
-
4
3
  export interface ViewportBounds {
5
4
  top: number;
6
5
  left: number;
@@ -1,5 +1,4 @@
1
1
  import { Annotation, AnnotationTarget } from '@annotorious/core';
2
-
3
2
  export interface TextAnnotation extends Annotation {
4
3
  target: TextAnnotationTarget;
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { W3CAnnotation, W3CAnnotationTarget } from '@annotorious/core';
2
-
3
2
  export interface W3CTextAnnotation extends W3CAnnotation {
4
3
  target: W3CTextAnnotationTarget | W3CTextAnnotationTarget[];
5
4
  stylesheet?: W3CAnnotationStylesheet;
@@ -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;
@@ -1,6 +1,5 @@
1
1
  import { Filter, Origin, Store } from '@annotorious/core';
2
2
  import { TextAnnotation } from '../model';
3
-
4
3
  export interface TextAnnotationStore extends Omit<Store<TextAnnotation>, 'addAnnotation' | 'bulkAddAnnotation'> {
5
4
  addAnnotation(annotation: TextAnnotation, origin?: Origin): boolean;
6
5
  bulkAddAnnotation(annotations: TextAnnotation[], replace: boolean, origin?: Origin): TextAnnotation[];
@@ -1,11 +1,10 @@
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>;
8
7
  hover: HoverState<TextAnnotation>;
9
8
  viewport: ViewportState;
10
9
  }
11
- export declare const createTextAnnotatorState: (container: HTMLElement, defaultUserAction?: UserSelectActionExpression<TextAnnotation>) => TextAnnotatorState;
10
+ export declare const createTextAnnotatorState: (container: HTMLElement, defaultUserSelectAction?: UserSelectActionExpression<TextAnnotation>) => TextAnnotatorState;
@@ -1,7 +1,6 @@
1
1
  import { Store } from '@annotorious/core';
2
2
  import { TextAnnotation, TextAnnotationTarget } from '../model';
3
3
  import { AnnotationRects } from './TextAnnotationStore';
4
-
5
4
  interface IndexedHighlightRect {
6
5
  minX: number;
7
6
  minY: number;
@@ -1,3 +1,2 @@
1
1
  import { TextSelector } from '../model';
2
-
3
2
  export declare const isRevived: (selector: TextSelector[]) => boolean;
@@ -1,3 +1,2 @@
1
1
  import { TextSelector } from '../model';
2
-
3
2
  export declare const rangeToSelector: (range: Range, container: HTMLElement, offsetReferenceSelector?: string) => TextSelector;
@@ -1,3 +1,2 @@
1
1
  import { TextAnnotation } from '../model';
2
-
3
2
  export declare const reviveAnnotation: (annotation: TextAnnotation, container: HTMLElement) => TextAnnotation;
@@ -1,5 +1,4 @@
1
1
  import { TextSelector } from '../model';
2
-
3
2
  /**
4
3
  * Creates a new selector object with the revived DOM range from the given text annotation position
5
4
  * Only the annotatable elements are processed and counted towards the range
@@ -1,3 +1,2 @@
1
1
  import { TextAnnotationTarget } from '../model';
2
-
3
2
  export declare const reviveTarget: (target: TextAnnotationTarget, container: HTMLElement) => TextAnnotationTarget;
@@ -1,4 +1,3 @@
1
1
  import { W3CTextAnnotation } from '../../../src';
2
-
3
2
  export declare const textAnnotation: W3CTextAnnotation;
4
3
  export declare const incompleteTextAnnotation: W3CTextAnnotation;
@@ -1 +1 @@
1
- .r6o-canvas-highlight-layer{position:fixed;top:0;bottom:0;left:0;width:100vw;height:100vh;pointer-events:none}.r6o-canvas-highlight-layer.bg{mix-blend-mode:multiply;z-index:1}.r6o-annotatable .r6o-span-highlight-layer{height:100%;left:0;mix-blend-mode:multiply;pointer-events:none;position:absolute;top:0;width:100%}.r6o-annotatable .r6o-span-highlight-layer.hidden{display:none}.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation{border-style:solid;border-width:0;box-sizing:content-box;display:block;position:absolute}.r6o-presence-layer{left:0;position:fixed;top:0;bottom:0;width:100vw;pointer-events:none}html,body{overscroll-behavior-y:none}.r6o-annotatable{position:relative;-webkit-tap-highlight-color:transparent}.hovered *{cursor:pointer}*::selection,::selection{background:#0080ff2e}::-moz-selection{background:#0080ff2e}
1
+ .r6o-canvas-highlight-layer{position:fixed;top:0;bottom:0;left:0;width:100vw;height:100vh;pointer-events:none}.r6o-canvas-highlight-layer.bg{mix-blend-mode:multiply;z-index:1}.r6o-annotatable .r6o-span-highlight-layer{position:absolute;top:0;left:0;width:100%;height:100%;mix-blend-mode:multiply;pointer-events:none;z-index:1}.r6o-annotatable .r6o-span-highlight-layer.hidden{display:none}.r6o-annotatable .r6o-span-highlight-layer .r6o-annotation{border-style:solid;border-width:0;box-sizing:content-box;display:block;position:absolute}.r6o-presence-layer{left:0;position:fixed;top:0;bottom:0;width:100vw;pointer-events:none}html,body{overscroll-behavior-y:none}.r6o-annotatable{position:relative;-webkit-tap-highlight-color:transparent}.hovered *{cursor:pointer}*::selection,::selection{background:#0080ff2e}::-moz-selection{background:#0080ff2e}