@recogito/text-annotator 3.4.10 → 4.0.1-beta

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 (69) hide show
  1. package/dist/index.d.ts +8 -7
  2. package/dist/model/core/index.d.ts +1 -1
  3. package/dist/model/w3c/index.d.ts +2 -2
  4. package/dist/model/w3c/{W3CTextFormatAdapter.d.ts → w3c-text-format-adapter.d.ts} +2 -2
  5. package/dist/rendering/base-renderer.d.ts +31 -0
  6. package/dist/{highlight/HighlightStyle.d.ts → rendering/highlight-style.d.ts} +4 -1
  7. package/dist/{highlight/Highlight.d.ts → rendering/highlight.d.ts} +2 -1
  8. package/dist/rendering/index.d.ts +5 -0
  9. package/dist/rendering/renderer-css-highlight/css-highlight-renderer.d.ts +6 -0
  10. package/dist/rendering/renderer-css-highlight/index.d.ts +1 -0
  11. package/dist/rendering/renderer-inline-markup/index.d.ts +0 -0
  12. package/dist/rendering/renderer-spans/index.d.ts +1 -0
  13. package/dist/rendering/renderer-spans/spans-renderer.d.ts +3 -0
  14. package/dist/{SelectionHandler.d.ts → selection-handler.d.ts} +2 -2
  15. package/dist/state/index.d.ts +2 -2
  16. package/dist/state/{spatialTree.d.ts → spatial-tree.d.ts} +1 -1
  17. package/dist/state/{TextAnnotationStore.d.ts → text-annotation-store.d.ts} +1 -1
  18. package/dist/state/{TextAnnotatorState.d.ts → text-annotator-state.d.ts} +2 -2
  19. package/dist/{TextAnnotatorOptions.d.ts → text-annotator-options.d.ts} +2 -4
  20. package/dist/text-annotator.css +1 -1
  21. package/dist/{TextAnnotator.d.ts → text-annotator.d.ts} +6 -6
  22. package/dist/text-annotator.es.js +757 -841
  23. package/dist/text-annotator.es.js.map +1 -1
  24. package/dist/text-annotator.umd.js +2 -2
  25. package/dist/text-annotator.umd.js.map +1 -1
  26. package/dist/utils/annotation/index.d.ts +4 -0
  27. package/dist/utils/{rangeToSelector.d.ts → annotation/range-to-selector.d.ts} +1 -1
  28. package/dist/utils/{reviveSelector.d.ts → annotation/revive-annotation.d.ts} +4 -1
  29. package/dist/{api/scrollIntoView.d.ts → utils/annotation/scroll-into-view.d.ts} +2 -2
  30. package/dist/utils/dom/index.d.ts +7 -0
  31. package/dist/utils/events/index.d.ts +3 -0
  32. package/dist/utils/highlight/compute-z-index.d.ts +3 -0
  33. package/dist/utils/highlight/index.d.ts +4 -0
  34. package/package.json +1 -1
  35. package/dist/api/index.d.ts +0 -1
  36. package/dist/highlight/HighlightPainter.d.ts +0 -11
  37. package/dist/highlight/Renderer.d.ts +0 -22
  38. package/dist/highlight/canvas/canvasRenderer.d.ts +0 -5
  39. package/dist/highlight/canvas/index.d.ts +0 -1
  40. package/dist/highlight/highlights/highlightsRenderer.d.ts +0 -6
  41. package/dist/highlight/highlights/index.d.ts +0 -1
  42. package/dist/highlight/index.d.ts +0 -8
  43. package/dist/highlight/span/color.d.ts +0 -2
  44. package/dist/highlight/span/index.d.ts +0 -2
  45. package/dist/highlight/span/spansRenderer.d.ts +0 -3
  46. package/dist/presence/PresencePainter.d.ts +0 -5
  47. package/dist/presence/PresencePainterOptions.d.ts +0 -3
  48. package/dist/presence/index.d.ts +0 -2
  49. package/dist/utils/index.d.ts +0 -19
  50. package/dist/utils/isRevived.d.ts +0 -2
  51. package/dist/utils/reviveAnnotation.d.ts +0 -2
  52. package/dist/utils/reviveTarget.d.ts +0 -2
  53. /package/dist/model/core/{TextAnnotation.d.ts → text-annotation.d.ts} +0 -0
  54. /package/dist/model/w3c/{W3CTextAnnotation.d.ts → w3c-text-annotation.d.ts} +0 -0
  55. /package/dist/{highlight → rendering}/viewport.d.ts +0 -0
  56. /package/dist/utils/{getQuoteContext.d.ts → annotation/get-quote-context.d.ts} +0 -0
  57. /package/dist/utils/{device.d.ts → dom/device.d.ts} +0 -0
  58. /package/dist/utils/{isNotAnnotatable.d.ts → dom/is-not-annotatable.d.ts} +0 -0
  59. /package/dist/utils/{isWhitespaceOrEmpty.d.ts → dom/is-whitespace-or-empty.d.ts} +0 -0
  60. /package/dist/utils/{mergeRanges.d.ts → dom/merge-ranges.d.ts} +0 -0
  61. /package/dist/utils/{programmaticallyFocusable.d.ts → dom/programmatically-focusable.d.ts} +0 -0
  62. /package/dist/utils/{splitAnnotatableRanges.d.ts → dom/split-annotatable-ranges.d.ts} +0 -0
  63. /package/dist/utils/{trimRangeToContainer.d.ts → dom/trim-range-to-container.d.ts} +0 -0
  64. /package/dist/utils/{cancelSingleClickEvents.d.ts → events/cancel-single-click-events.d.ts} +0 -0
  65. /package/dist/utils/{cloneEvents.d.ts → events/clone-events.d.ts} +0 -0
  66. /package/dist/utils/{debounce.d.ts → events/debounce.d.ts} +0 -0
  67. /package/dist/utils/{getHighlightClientRects.d.ts → highlight/get-highlight-client-rects.d.ts} +0 -0
  68. /package/dist/utils/{mergeClientRects.d.ts → highlight/merge-client-rects.d.ts} +0 -0
  69. /package/dist/utils/{rectsToBounds.d.ts → highlight/rects-to-bounds.d.ts} +0 -0
@@ -0,0 +1,4 @@
1
+ export * from './get-quote-context';
2
+ export * from './range-to-selector';
3
+ export * from './revive-annotation';
4
+ export * from './scroll-into-view';
@@ -1,2 +1,2 @@
1
- import type { TextSelector } from '../model';
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 '../model';
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 '../state';
2
- import type { TextAnnotation } from '../model';
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';
@@ -0,0 +1,3 @@
1
+ export * from './cancel-single-click-events';
2
+ export * from './clone-events';
3
+ export * from './debounce';
@@ -0,0 +1,3 @@
1
+ import type { Highlight } from '../../rendering';
2
+ import type { Rect } from '../../state';
3
+ export declare const computeZIndex: (rect: Rect, all: Highlight[]) => number;
@@ -0,0 +1,4 @@
1
+ export * from './compute-z-index';
2
+ export * from './get-highlight-client-rects';
3
+ export * from './merge-client-rects';
4
+ export * from './rects-to-bounds';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recogito/text-annotator",
3
- "version": "3.4.10",
3
+ "version": "4.0.1-beta",
4
4
  "description": "A JavaScript text annotation library",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -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,8 +0,0 @@
1
- export * from './canvas';
2
- export * from './highlights';
3
- export * from './span';
4
- export * from './Highlight';
5
- export * from './HighlightPainter';
6
- export * from './HighlightStyle';
7
- export * from './Renderer';
8
- export * from './viewport';
@@ -1,2 +0,0 @@
1
- import { type HighlightStyle } from '../HighlightStyle';
2
- export declare const getBackgroundColor: (style?: HighlightStyle) => string;
@@ -1,2 +0,0 @@
1
- export * from './color';
2
- export * from './spansRenderer';
@@ -1,3 +0,0 @@
1
- import { type RendererFactory } from '../Renderer';
2
- import './spansRenderer.css';
3
- export declare const createSpansRenderer: RendererFactory;
@@ -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;
@@ -1,3 +0,0 @@
1
- export interface PresencePainterOptions {
2
- font?: string;
3
- }
@@ -1,2 +0,0 @@
1
- export * from './PresencePainter';
2
- export * from './PresencePainterOptions';
@@ -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';
@@ -1,2 +0,0 @@
1
- import type { TextSelector } from '../model';
2
- export declare const isRevived: (selector: TextSelector[]) => boolean;
@@ -1,2 +0,0 @@
1
- import type { TextAnnotation } from '../model';
2
- export declare const reviveAnnotation: <T extends TextAnnotation>(annotation: T, container: HTMLElement) => T;
@@ -1,2 +0,0 @@
1
- import type { TextAnnotationTarget } from '../model';
2
- export declare const reviveTarget: <T extends TextAnnotationTarget = TextAnnotationTarget>(target: T, container: HTMLElement) => T;
File without changes
File without changes