@soomo/text-annotator 3.0.0-staging.14 → 3.0.0-staging.15

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,4 +1,4 @@
1
- import { FormatAdapter, PointerSelectAction } from '@annotorious/core';
1
+ import { FormatAdapter, PointerSelectAction, User } from '@annotorious/core';
2
2
  import { PresencePainterOptions } from './presence';
3
3
  import { TextAnnotation } from './model';
4
4
  import { HighlightStyleExpression } from './highlight';
@@ -11,6 +11,7 @@ export interface TextAnnotatorOptions<T extends unknown = TextAnnotation> {
11
11
  pointerAction?: PointerSelectAction | ((annotation: TextAnnotation) => PointerSelectAction);
12
12
  presence?: PresencePainterOptions;
13
13
  style?: HighlightStyleExpression;
14
+ user?: User;
14
15
  }
15
16
  export type RendererType = 'SPANS' | 'CANVAS' | 'CSS_HIGHLIGHTS';
16
17
  export declare const fillDefaults: <T extends unknown = TextAnnotation>(opts: TextAnnotatorOptions<T>, defaults: TextAnnotatorOptions<T>) => TextAnnotatorOptions<T>;
@@ -1792,7 +1792,8 @@ const En = (t, e) => {
1792
1792
  return !1;
1793
1793
  }, Tn = (t, e) => ({
1794
1794
  ...t,
1795
- annotationEnabled: t.annotationEnabled === void 0 ? e.annotationEnabled : t.annotationEnabled
1795
+ annotationEnabled: t.annotationEnabled ?? e.annotationEnabled,
1796
+ user: t.user || e.user
1796
1797
  }), Rn = (t, e, n, o) => {
1797
1798
  const { store: i, selection: r } = e;
1798
1799
  let a, s;
@@ -1864,9 +1865,10 @@ const En = (t, e) => {
1864
1865
  }, Mt = "SPANS", Vn = (t, e = {}) => {
1865
1866
  Qt(t);
1866
1867
  const n = Tn(e, {
1867
- annotationEnabled: !0
1868
+ annotationEnabled: !0,
1869
+ user: an()
1868
1870
  }), o = Sn(t, n.pointerAction), { selection: i, viewport: r } = o, a = o.store, s = Ke(a), u = Je(o, s, n.adapter);
1869
- let f = an();
1871
+ let f = n.user;
1870
1872
  const m = n.renderer === "CSS_HIGHLIGHTS" ? CSS.highlights ? "CSS_HIGHLIGHTS" : Mt : n.renderer || Mt, c = m === "SPANS" ? Ce(t, o, r) : m === "CSS_HIGHLIGHTS" ? Ae(t, o, r) : m === "CANVAS" ? he(t, o, r) : void 0;
1871
1873
  if (!c)
1872
1874
  throw `Unknown renderer implementation: ${m}`;