@soomo/text-annotator 3.0.0-staging.14 → 3.0.0-staging.16
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
|
|
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;
|
|
@@ -1828,7 +1829,8 @@ const En = (t, e) => {
|
|
|
1828
1829
|
return T.toString() !== ((b = s.selector[I]) == null ? void 0 : b.quote);
|
|
1829
1830
|
})) && (s = {
|
|
1830
1831
|
...s,
|
|
1831
|
-
selector: C.map((T) => se(T, t, o))
|
|
1832
|
+
selector: C.map((T) => se(T, t, o)),
|
|
1833
|
+
updated: /* @__PURE__ */ new Date()
|
|
1832
1834
|
}, i.getAnnotation(s.annotation) ? i.updateTarget(s, N.LOCAL) : (i.addAnnotation({
|
|
1833
1835
|
id: s.annotation,
|
|
1834
1836
|
bodies: [],
|
|
@@ -1864,9 +1866,10 @@ const En = (t, e) => {
|
|
|
1864
1866
|
}, Mt = "SPANS", Vn = (t, e = {}) => {
|
|
1865
1867
|
Qt(t);
|
|
1866
1868
|
const n = Tn(e, {
|
|
1867
|
-
annotationEnabled: !0
|
|
1869
|
+
annotationEnabled: !0,
|
|
1870
|
+
user: an()
|
|
1868
1871
|
}), 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 =
|
|
1872
|
+
let f = n.user;
|
|
1870
1873
|
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
1874
|
if (!c)
|
|
1872
1875
|
throw `Unknown renderer implementation: ${m}`;
|