@recogito/text-annotator 3.0.0-rc.8 → 3.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.
Files changed (59) hide show
  1. package/dist/src/SelectionHandler.d.ts +8 -6
  2. package/dist/src/TextAnnotator.d.ts +10 -6
  3. package/dist/src/TextAnnotatorOptions.d.ts +14 -7
  4. package/dist/src/api/scrollIntoView.d.ts +3 -3
  5. package/dist/src/highlight/Highlight.d.ts +5 -0
  6. package/dist/src/highlight/HighlightPainter.d.ts +10 -19
  7. package/dist/src/highlight/HighlightStyle.d.ts +11 -0
  8. package/dist/src/highlight/baseRenderer.d.ts +20 -0
  9. package/dist/src/highlight/canvas/canvasRenderer.d.ts +4 -0
  10. package/dist/src/highlight/canvas/index.d.ts +1 -0
  11. package/dist/src/highlight/highlights/highlightsRenderer.d.ts +6 -0
  12. package/dist/src/highlight/highlights/index.d.ts +1 -0
  13. package/dist/src/highlight/index.d.ts +5 -1
  14. package/dist/src/highlight/span/index.d.ts +1 -0
  15. package/dist/src/highlight/span/spansRenderer.d.ts +4 -0
  16. package/dist/src/highlight/viewport.d.ts +12 -0
  17. package/dist/src/index.d.ts +6 -3
  18. package/dist/src/model/{TextAnnotation.d.ts → core/TextAnnotation.d.ts} +3 -2
  19. package/dist/src/model/core/index.d.ts +1 -0
  20. package/dist/src/model/index.d.ts +2 -1
  21. package/dist/src/model/w3c/W3CTextAnnotation.d.ts +34 -0
  22. package/dist/src/model/w3c/W3CTextFormatAdapter.d.ts +12 -0
  23. package/dist/src/model/w3c/index.d.ts +2 -0
  24. package/dist/src/presence/PresencePainter.d.ts +4 -4
  25. package/dist/src/state/TextAnnotationStore.d.ts +15 -11
  26. package/dist/src/state/TextAnnotatorState.d.ts +9 -10
  27. package/dist/src/state/index.d.ts +0 -1
  28. package/dist/src/state/spatialTree.d.ts +10 -8
  29. package/dist/src/utils/cancelSingleClickEvents.d.ts +6 -0
  30. package/dist/src/utils/cloneEvents.d.ts +11 -0
  31. package/dist/src/utils/debounce.d.ts +1 -0
  32. package/dist/src/utils/device.d.ts +1 -0
  33. package/dist/src/utils/getQuoteContext.d.ts +4 -0
  34. package/dist/src/utils/index.d.ts +15 -2
  35. package/dist/src/utils/isNotAnnotatable.d.ts +4 -0
  36. package/dist/src/utils/isRevived.d.ts +2 -0
  37. package/dist/src/utils/isWhitespaceOrEmpty.d.ts +2 -0
  38. package/dist/src/utils/mergeClientRects.d.ts +1 -0
  39. package/dist/src/utils/programmaticallyFocusable.d.ts +6 -0
  40. package/dist/src/utils/rangeToSelector.d.ts +2 -0
  41. package/dist/src/utils/reviveAnnotation.d.ts +2 -0
  42. package/dist/src/utils/reviveSelector.d.ts +11 -0
  43. package/dist/src/utils/reviveTarget.d.ts +2 -0
  44. package/dist/src/utils/splitAnnotatableRanges.d.ts +5 -0
  45. package/dist/src/utils/trimRangeToContainer.d.ts +1 -0
  46. package/dist/test/model/w3c/W3CTextFormatAdapter.test.d.ts +1 -0
  47. package/dist/test/model/w3c/fixtures.d.ts +3 -0
  48. package/dist/text-annotator.css +1 -1
  49. package/dist/text-annotator.es.js +2003 -938
  50. package/dist/text-annotator.es.js.map +1 -1
  51. package/dist/text-annotator.umd.js +2 -1
  52. package/dist/text-annotator.umd.js.map +1 -1
  53. package/package.json +18 -13
  54. package/dist/src/highlight/highlightLayer.d.ts +0 -10
  55. package/dist/src/highlight/trackViewport.d.ts +0 -3
  56. package/dist/src/state/reviveTarget.d.ts +0 -9
  57. package/dist/src/utils/getClientRectsPonyfill.d.ts +0 -1
  58. package/dist/src/utils/getContext.d.ts +0 -4
  59. package/dist/src/utils/trimRange.d.ts +0 -1
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@recogito/text-annotator",
3
- "version": "3.0.0-rc.8",
3
+ "version": "3.0.0",
4
4
  "description": "A JavaScript text annotation library",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "start": "vite",
9
+ "start": "vite --host",
10
10
  "build": "vite build",
11
11
  "preview": "vite preview",
12
- "test": "echo 'Skipping tests in @recogito/text-annotator package'"
12
+ "test": "vitest"
13
13
  },
14
14
  "main": "./dist/text-annotator.umd.js",
15
15
  "module": "./dist/text-annotator.es.js",
@@ -19,22 +19,27 @@
19
19
  ],
20
20
  "exports": {
21
21
  ".": {
22
+ "types": "./dist/src/index.d.ts",
22
23
  "import": "./dist/text-annotator.es.js",
23
24
  "require": "./dist/text-annotator.umd.js"
24
25
  },
25
26
  "./dist/text-annotator.css": "./dist/text-annotator.css"
26
27
  },
27
28
  "devDependencies": {
28
- "@types/rbush": "^3.0.3",
29
- "@types/uuid": "^9.0.7",
30
- "svelte": "^4.2.8",
31
- "typescript": "^5.3.3",
32
- "vite": "^5.0.11",
33
- "vite-plugin-dts": "^3.7.0"
29
+ "@types/jsdom": "^21.1.7",
30
+ "@types/rbush": "^4.0.0",
31
+ "jsdom": "^26.0.0",
32
+ "typescript": "5.8.2",
33
+ "vite": "^6.2.5",
34
+ "vite-plugin-dts": "^4.5.3",
35
+ "vitest": "^3.1.1"
34
36
  },
35
37
  "dependencies": {
36
- "@annotorious/core": "^3.0.0-rc.17",
37
- "rbush": "^3.0.1",
38
- "uuid": "^9.0.1"
38
+ "@annotorious/core": "^3.3.3",
39
+ "colord": "^2.9.3",
40
+ "dequal": "^2.0.3",
41
+ "hotkeys-js": "^3.13.9",
42
+ "rbush": "^4.0.1",
43
+ "uuid": "^11.1.0"
39
44
  }
40
- }
45
+ }
@@ -1,10 +0,0 @@
1
- import type { DrawingStyle, Filter, ViewportState } from '@annotorious/core';
2
- import type { TextAnnotation } from '../model';
3
- import type { TextAnnotatorState } from '../state';
4
- import { type HighlightPainter } from './HighlightPainter';
5
- export declare const createHighlightLayer: (container: HTMLElement, state: TextAnnotatorState, viewport: ViewportState) => {
6
- redraw: () => number;
7
- setDrawingStyle: (style: DrawingStyle | ((a: TextAnnotation, selected?: boolean) => DrawingStyle)) => void;
8
- setFilter: (filter?: Filter) => void;
9
- setPainter: (painter: HighlightPainter) => HighlightPainter;
10
- };
@@ -1,3 +0,0 @@
1
- import type { ViewportState } from '@annotorious/core';
2
- import type { TextAnnotation } from '../model';
3
- export declare const trackViewport: (viewport: ViewportState) => (annotations: TextAnnotation[]) => void;
@@ -1,9 +0,0 @@
1
- import type { TextAnnotationTarget } from '../model';
2
- /**
3
- * Recalculates the DOM range from the given text annotation target.
4
- *
5
- * @param annotation the text annotation
6
- * @param container the HTML container of the annotated content
7
- * @returns the DOM range
8
- */
9
- export declare const reviveTarget: (target: TextAnnotationTarget, container: HTMLElement) => TextAnnotationTarget;
@@ -1 +0,0 @@
1
- export declare const getClientRectsPonyfill: (range: Range) => DOMRect[];
@@ -1,4 +0,0 @@
1
- export declare const getContext: (range: Range, container: HTMLElement, length?: number, offsetReferenceSelector?: string) => {
2
- prefix: string;
3
- suffix: string;
4
- };
@@ -1 +0,0 @@
1
- export declare const trimRange: (range: Range) => Range;