@recogito/text-annotator 4.1.1 → 4.2.1

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.
@@ -1,2 +1,2 @@
1
- import type { TextSelector } from '../../model';
2
- export declare const rangeToSelector: (range: Range, container: HTMLElement, offsetReferenceSelector?: string) => TextSelector;
1
+ import type { RevivedTextSelector } from '../../model';
2
+ export declare const rangeToSelector: (range: Range, container: HTMLElement, offsetReferenceSelector?: string) => RevivedTextSelector;
@@ -1,5 +1,4 @@
1
- import type { TextAnnotation, TextAnnotationTarget, TextSelector, TextSelectorLike } from '../../model';
2
- export declare const isRevived: (selector: TextSelectorLike[]) => boolean;
1
+ import type { RevivedTextAnnotationLike, RevivedTextAnnotationTargetLike, RevivedTextSelector, RevivedTextSelectorLike, TextAnnotationLike, TextAnnotationTargetLike, TextSelector } from '../../model';
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
@@ -9,6 +8,6 @@ export declare const isRevived: (selector: TextSelectorLike[]) => boolean;
9
8
  *
10
9
  * @returns the revived selector
11
10
  */
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;
11
+ export declare const reviveTextSelector: <T extends TextSelector>(selector: T, container: HTMLElement) => RevivedTextSelector;
12
+ export declare const reviveTarget: <T extends TextAnnotationTargetLike>(target: T, container: HTMLElement, reviveFn?: (arg: T["selector"][number], container: HTMLElement) => RevivedTextSelectorLike) => RevivedTextAnnotationTargetLike<T>;
13
+ export declare const reviveAnnotation: <T extends TextAnnotationLike>(annotation: T, container: HTMLElement, reviveFn?: (arg: T["target"]["selector"][number], container: HTMLElement) => RevivedTextSelectorLike) => RevivedTextAnnotationLike<T>;
@@ -1,3 +1,3 @@
1
1
  import type { TextAnnotationStore } from '../../state';
2
- import type { TextAnnotation } from '../../model';
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;
2
+ import type { TextAnnotationLike } from '../../model';
3
+ export declare const scrollIntoView: <I extends TextAnnotationLike = TextAnnotationLike>(container: HTMLElement, store: TextAnnotationStore<I>) => <E extends Element = Element>(annotationOrId: string | I, scrollParentOrId?: string | E) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recogito/text-annotator",
3
- "version": "4.1.1",
3
+ "version": "4.2.1",
4
4
  "description": "A JavaScript text annotation library",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -30,9 +30,9 @@
30
30
  "@types/rbush": "^4.0.0",
31
31
  "jsdom": "^29.1.1",
32
32
  "typescript": "^5.9.3",
33
- "vite": "^7.3.3",
33
+ "vite": "^7.3.5",
34
34
  "vite-plugin-externalize-deps": "^0.10.0",
35
- "vitest": "^4.1.7"
35
+ "vitest": "^4.1.8"
36
36
  },
37
37
  "dependencies": {
38
38
  "@annotorious/core": "^3.8.2",