@soomo/text-annotator 3.1.0-staging.16 → 3.1.0-staging.18

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,12 +1,12 @@
1
1
  import { FormatAdapter, ParseResult } from '@annotorious/core';
2
2
  import { TextAnnotation } from '../core';
3
3
  import { W3CTextAnnotation } from '../w3c';
4
- export type W3CTextFormatAdapter = FormatAdapter<TextAnnotation, W3CTextAnnotation>;
4
+ export type W3CTextFormatAdapter<I extends TextAnnotation = TextAnnotation, E extends W3CTextAnnotation = W3CTextAnnotation> = FormatAdapter<I, E>;
5
5
  /**
6
6
  * @param source - the IRI of the annotated content
7
7
  * @param container - the HTML container of the annotated content,
8
8
  * Required to locate the content's `range` within the DOM
9
9
  */
10
- export declare const W3CTextFormat: (source: string, container: HTMLElement) => W3CTextFormatAdapter;
10
+ export declare const W3CTextFormat: <E extends W3CTextAnnotation = W3CTextAnnotation>(source: string, container: HTMLElement) => W3CTextFormatAdapter<TextAnnotation, E>;
11
11
  export declare const parseW3CTextAnnotation: (annotation: W3CTextAnnotation) => ParseResult<TextAnnotation>;
12
- export declare const serializeW3CTextAnnotation: (annotation: TextAnnotation, source: string, container: HTMLElement) => W3CTextAnnotation;
12
+ export declare const serializeW3CTextAnnotation: <E extends W3CTextAnnotation = W3CTextAnnotation>(annotation: TextAnnotation, source: string, container: HTMLElement) => E;
@@ -2314,7 +2314,7 @@ const ce = 300, Oe = ["up", "down", "left", "right"], Re = ke ? "⌘+a" : "ctrl+
2314
2314
  return;
2315
2315
  }
2316
2316
  }
2317
- h && h.selector.length > 0 && (i.clear(), w(), i.userSelect(h.annotation, St(u)));
2317
+ h && h.selector.length > 0 && (w(), i.userSelect(h.annotation, St(u)));
2318
2318
  }, x = async () => {
2319
2319
  const u = document.getSelection();
2320
2320
  let E = !1, B = u == null ? void 0 : u.isCollapsed;
@@ -2324,7 +2324,7 @@ const ce = 300, Oe = ["up", "down", "left", "right"], Re = ke ? "⌘+a" : "ctrl+
2324
2324
  const E = document.getSelection();
2325
2325
  E != null && E.isCollapsed || ((!h || h.selector.length === 0) && c(u), w(), i.userSelect(h.annotation, St(u)));
2326
2326
  }, O = (u) => {
2327
- A && u.key === "Shift" && h && (document.getSelection().isCollapsed || (i.clear(), w(), i.userSelect(h.annotation, pt(u))));
2327
+ A && u.key === "Shift" && h && (document.getSelection().isCollapsed || (w(), i.userSelect(h.annotation, pt(u))));
2328
2328
  }, T = (u) => {
2329
2329
  const E = () => setTimeout(() => {
2330
2330
  (h == null ? void 0 : h.selector.length) > 0 && (i.clear(), o.addAnnotation({