@recogito/react-text-annotator 4.0.0-beta → 4.0.2-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.
@@ -1,18 +1,18 @@
1
1
  import { jsx as g, Fragment as y, jsxs as P } from "react/jsx-runtime";
2
- import { useRef as C, useEffect as s, useContext as T, useCallback as R, Children as B, cloneElement as F, useState as x } from "react";
2
+ import { useRef as w, useEffect as s, useContext as x, useCallback as R, Children as B, cloneElement as F, useState as E } from "react";
3
3
  import L from "CETEIcean";
4
- import { AnnotoriousContext as E, useAnnotationStore as I, Origin as M, useAnnotator as N, useSelection as k } from "@annotorious/react";
4
+ import { AnnotoriousContext as S, useAnnotationStore as I, Origin as M, useAnnotator as N, useSelection as U } from "@annotorious/react";
5
5
  import { AnnotoriousPlugin as wt } from "@annotorious/react";
6
- import { createTEIAnnotator as Q } from "@recogito/text-annotator-tei";
6
+ import { createTEIAnnotator as k } from "@recogito/text-annotator-tei";
7
7
  import { serializeW3CTEIAnnotation as Tt } from "@recogito/text-annotator-tei";
8
8
  import "@recogito/text-annotator/text-annotator.css";
9
- import { Ignore as U } from "@annotorious/core";
9
+ import { Ignore as Q } from "@annotorious/core";
10
10
  import { Origin as Et, UserSelectAction as St, createBody as Ot } from "@annotorious/core";
11
- import { createTextAnnotator as W, toViewportBounds as S, toDomRectList as _, NOT_ANNOTATABLE_CLASS as j } from "@recogito/text-annotator";
11
+ import { createTextAnnotator as W, toViewportBounds as O, toDomRectList as _, NOT_ANNOTATABLE_CLASS as j } from "@recogito/text-annotator";
12
12
  import { W3CTextFormat as Pt, parseW3CTextAnnotation as Rt, serializeW3CTextAnnotation as Bt } from "@recogito/text-annotator";
13
13
  import H from "debounce";
14
14
  import { useFloating as D, autoUpdate as V, inline as z, offset as Y, flip as $, shift as q, arrow as J, FloatingPortal as G, FloatingFocusManager as K, FloatingArrow as X } from "@floating-ui/react";
15
- const v = {
15
+ const T = {
16
16
  tei: {
17
17
  ref: (t) => {
18
18
  const e = document.createElement("a");
@@ -33,19 +33,19 @@ const v = {
33
33
  }
34
34
  }
35
35
  }, mt = (t) => {
36
- const e = C(null);
36
+ const e = w(null);
37
37
  return s(() => {
38
38
  if (t.tei) {
39
39
  const n = new L(t.initArgs);
40
40
  n.addBehaviors({
41
- ...v,
41
+ ...T,
42
42
  ...t.behaviors || {},
43
43
  tei: {
44
- ...v.tei,
44
+ ...T.tei,
45
45
  ...t.behaviors?.tei || {}
46
46
  }
47
47
  }), n.makeHTML5(t.tei, (r) => {
48
- e.current.appendChild(r), t.onLoad(e.current);
48
+ e.current?.appendChild(r), t.onLoad?.(e.current);
49
49
  });
50
50
  }
51
51
  return () => {
@@ -58,30 +58,30 @@ const v = {
58
58
  className: "tei-container"
59
59
  }
60
60
  );
61
- }, ht = (t) => {
62
- const { children: e, ...n } = t, { anno: r, setAnno: o } = T(E), l = R((i) => {
63
- const u = Q(i, n);
64
- o(u);
61
+ }, At = (t) => {
62
+ const { children: e, ...n } = t, { anno: r, setAnno: o } = x(S), l = R((i) => {
63
+ const c = k(i, n);
64
+ o(c);
65
65
  }, []);
66
66
  return s(() => r?.setStyle(t.style), [r, t.style]), s(() => r?.setFilter(t.filter), [r, t.filter]), s(() => r?.setUser(n.user), [r, n.user]), s(() => r?.setAnnotatingEnabled(n.annotatingEnabled), [r, n.annotatingEnabled]), s(() => r?.setAnnotatingMode(n.annotatingMode), [r, n.annotatingMode]), t.children ? /* @__PURE__ */ g(y, { children: B.toArray(t.children).map((i) => F(i, { onLoad: l })) }) : null;
67
67
  }, Z = (t, e = { timeout: 250 }) => {
68
- const n = I(), [r, o] = x(!0);
68
+ const n = I(), [r, o] = E(!0);
69
69
  return s(() => {
70
70
  if (!n || !t) return;
71
71
  let l;
72
- const i = (u) => {
73
- const { changes: { updated: c } } = u;
74
- c?.some((a) => {
75
- const { targetUpdated: d } = a;
76
- if (d) {
77
- const { oldTarget: f, newTarget: m } = d;
78
- return tt(f, m);
72
+ const i = (c) => {
73
+ const { changes: { updated: d } } = c;
74
+ d?.some((f) => {
75
+ const { targetUpdated: a } = f;
76
+ if (a) {
77
+ const { oldTarget: u, newTarget: h } = a;
78
+ return tt(u, h);
79
79
  }
80
80
  }) && (o(!1), clearTimeout(l), l = setTimeout(() => o(!0), e.timeout));
81
81
  };
82
82
  return n.observe(i, {
83
83
  annotations: t,
84
- ignore: U.BODY_ONLY,
84
+ ignore: Q.BODY_ONLY,
85
85
  origin: M.LOCAL
86
86
  }), () => {
87
87
  clearTimeout(l), n.unobserve(i);
@@ -90,31 +90,31 @@ const v = {
90
90
  }, tt = (t, e) => {
91
91
  const { selector: n } = t, r = n.map(({ quote: i }) => i), { selector: o } = e, l = o.map(({ quote: i }) => i);
92
92
  return r.join() !== l.join();
93
- }, At = (t) => {
94
- const e = C(null), { className: n, children: r, ...o } = t, { style: l, filter: i, user: u, annotatingEnabled: c, annotatingMode: A } = o, { anno: a, setAnno: d } = T(E);
93
+ }, ht = (t) => {
94
+ const e = w(null), { className: n, children: r, ...o } = t, { style: l, filter: i, user: c, annotatingEnabled: d, userSelectAction: A, annotatingMode: f } = o, { anno: a, setAnno: u } = x(S);
95
95
  return s(() => {
96
- if (!d) return;
97
- const f = typeof o.adapter == "function" ? o.adapter(e.current) : o.adapter, m = W(e.current, { ...o, adapter: f });
98
- return d(m), () => m.destroy();
99
- }, [d]), s(() => a?.setStyle(l), [a, l]), s(() => a?.setFilter(i), [a, i]), s(() => a?.setUser(u), [a, u]), s(() => a?.setAnnotatingEnabled(c), [a, c]), s(() => a?.setAnnotatingMode(A), [a, A]), /* @__PURE__ */ g("div", { ref: e, className: `r6o-annotatable no-focus-outline ${n}`, children: r });
96
+ if (!u || !e.current) return;
97
+ const h = typeof o.adapter == "function" ? o.adapter(e.current) : o.adapter, p = W(e.current, { ...o, adapter: h });
98
+ return u(p), () => p.destroy();
99
+ }, [u]), s(() => a?.setStyle(l), [a, l]), s(() => a?.setFilter(i), [a, i]), s(() => a?.setUser(c), [a, c]), s(() => a?.setUserSelectAction(A), [a, A]), s(() => a?.setAnnotatingEnabled(d), [a, d]), s(() => a?.setAnnotatingMode(f), [a, f]), /* @__PURE__ */ g("div", { ref: e, className: `r6o-annotatable no-focus-outline ${n}`, children: r });
100
100
  }, et = () => {
101
101
  if (typeof navigator > "u") return !1;
102
102
  var t = navigator.userAgent || navigator.vendor || window?.opera;
103
103
  return !!(/android/i.test(t) || /iPad|iPhone/.test(t) && !window.MSStream);
104
104
  };
105
- let w = null;
105
+ let v = null;
106
106
  const nt = H((t, e, n) => {
107
107
  requestAnimationFrame(() => {
108
108
  const r = e.getAnnotationBounds(t);
109
- r && (w = S(r, n.getBoundingClientRect()));
109
+ r && (v = O(r, n.getBoundingClientRect()));
110
110
  });
111
111
  }, 250), ot = (t) => {
112
- const e = N(), { selected: n, event: r } = k(), o = n[0]?.annotation, l = Z(o?.id), [i, u] = x(n?.length > 0), c = C(!1), A = C(null), { refs: a, floatingStyles: d, update: f, context: m } = D({
112
+ const e = N(), { selected: n, event: r } = U(), o = n[0]?.annotation, l = Z(o?.id), [i, c] = E(n?.length > 0), d = w(!1), A = w(null), { refs: f, floatingStyles: a, update: u, context: h } = D({
113
113
  placement: et() ? "bottom" : t.placement || "top",
114
114
  strategy: "absolute",
115
115
  open: i,
116
- onOpenChange: (h, b, p) => {
117
- !h && (p === "escape-key" || p === "focus-out") && (u(h), e?.cancelSelected());
116
+ onOpenChange: (m, b, C) => {
117
+ !m && (C === "escape-key" || C === "focus-out") && (c(m), e?.cancelSelected());
118
118
  },
119
119
  middleware: [
120
120
  z(),
@@ -127,30 +127,30 @@ const nt = H((t, e, n) => {
127
127
  });
128
128
  s(() => {
129
129
  if (o?.id && l) {
130
- const h = e?.state.store.getAnnotationBounds(o.id);
131
- u(!!h);
130
+ const m = e?.state.store.getAnnotationBounds(o.id);
131
+ c(!!m);
132
132
  } else
133
- u(!1);
133
+ c(!1);
134
134
  }, [o?.id, o?.target.selector, l, e?.state.store]), s(() => {
135
- t.onClose && (i ? c.current = !0 : c.current && (c.current = !1, t.onClose()));
135
+ t.onClose && (i ? d.current = !0 : d.current && (d.current = !1, t.onClose()));
136
136
  }, [t.onClose, i]), s(() => {
137
- e && (i && o?.id ? a.setPositionReference({
138
- getBoundingClientRect: () => (nt(o.id, e.state.store, e.element), w || new DOMRect()),
137
+ e && (i && o?.id ? f.setPositionReference({
138
+ getBoundingClientRect: () => (nt(o.id, e.state.store, e.element), v || new DOMRect()),
139
139
  getClientRects: () => {
140
140
  const b = e.state.store.getAnnotationRects(o.id).map(
141
- (p) => S(p, e.element.getBoundingClientRect())
141
+ (C) => O(C, e.element.getBoundingClientRect())
142
142
  );
143
143
  return _(b);
144
144
  }
145
- }) : a.setPositionReference(null));
145
+ }) : f.setPositionReference(null));
146
146
  }, [i, o?.id, o?.target, e]), s(() => {
147
147
  if (!t.asPortal) return;
148
- const h = { attributes: !0, childList: !0, subtree: !0 }, b = new MutationObserver(() => f());
149
- return b.observe(document.body, h), window.document.addEventListener("scroll", f, !0), () => {
150
- b.disconnect(), window.document.removeEventListener("scroll", f, !0);
148
+ const m = { attributes: !0, childList: !0, subtree: !0 }, b = new MutationObserver(() => u());
149
+ return b.observe(document.body, m), window.document.addEventListener("scroll", u, !0), () => {
150
+ b.disconnect(), window.document.removeEventListener("scroll", u, !0);
151
151
  };
152
- }, [f, t.asPortal]);
153
- const O = () => e?.cancelSelected();
152
+ }, [u, t.asPortal]);
153
+ const p = () => e?.cancelSelected();
154
154
  return i && o ? /* @__PURE__ */ g(
155
155
  G,
156
156
  {
@@ -158,7 +158,7 @@ const nt = H((t, e, n) => {
158
158
  children: /* @__PURE__ */ g(
159
159
  K,
160
160
  {
161
- context: m,
161
+ context: h,
162
162
  modal: !1,
163
163
  closeOnFocusOut: !0,
164
164
  returnFocus: !1,
@@ -167,8 +167,8 @@ const nt = H((t, e, n) => {
167
167
  "div",
168
168
  {
169
169
  className: `a9s-popup r6o-popup annotation-popup r6o-text-popup ${j}`,
170
- ref: a.setFloating,
171
- style: d,
170
+ ref: f.setFloating,
171
+ style: a,
172
172
  children: [
173
173
  t.popup({
174
174
  annotation: n[0].annotation,
@@ -181,11 +181,11 @@ const nt = H((t, e, n) => {
181
181
  X,
182
182
  {
183
183
  ref: A,
184
- context: m,
184
+ context: h,
185
185
  ...t.arrowProps || {}
186
186
  }
187
187
  ),
188
- /* @__PURE__ */ g("button", { className: "r6o-popup-sr-only", "aria-live": "assertive", onClick: O, children: t.ariaCloseWarning || "Click or leave this dialog to close it." })
188
+ /* @__PURE__ */ g("button", { className: "r6o-popup-sr-only", "aria-live": "assertive", onClick: p, children: t.ariaCloseWarning || "Click or leave this dialog to close it." })
189
189
  ]
190
190
  }
191
191
  )
@@ -200,9 +200,9 @@ export {
200
200
  wt as AnnotoriousPlugin,
201
201
  mt as CETEIcean,
202
202
  Et as Origin,
203
- ht as TEIAnnotator,
203
+ At as TEIAnnotator,
204
204
  ot as TextAnnotationPopup,
205
- At as TextAnnotator,
205
+ ht as TextAnnotator,
206
206
  bt as TextAnnotatorPopup,
207
207
  St as UserSelectAction,
208
208
  Pt as W3CTextFormat,
@@ -1 +1 @@
1
- {"version":3,"file":"react-text-annotator.es.js","sources":["../src/tei/ceteicean.tsx","../src/tei/tei-annotator.tsx","../src/hooks/use-annotation-quote-idle.ts","../src/text-annotator.tsx","../src/text-annotation-popup/is-mobile.ts","../src/text-annotation-popup/text-annotation-popup.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport CETEI from 'CETEIcean';\n\ninterface CETEIceanProps {\n\n initArgs?: any;\n\n tei?: string;\n\n onLoad?(element: Element): void;\n\n behaviors?: any;\n\n}\n\n// Override default list, note, table, and ref behaviors \n// so they don't introduce text into the DOM that interferes\n// with annotation. Apply a patch to graphics for robustness.\nconst PRESET_BEHAVIORS = {\n tei: {\n ref: (elem: Element) => {\n const a = document.createElement('a');\n\n while(elem.firstChild) {\n a.appendChild(elem.removeChild(elem.firstChild));\n }\n\n a.setAttribute('href', elem.getAttribute('target'));\n\n elem.appendChild(a);\n },\n // Cf. https://github.com/TEIC/CETEIcean/issues/67\n graphic: (elem: Element) => {\n const content = new Image();\n content.src = elem.getAttribute('url')?.trim();\n\n if (elem.hasAttribute('width'))\n content.setAttribute('width', elem.getAttribute('width'));\n\n if (elem.hasAttribute('height'))\n content.setAttribute('height', elem.getAttribute('height'));\n\n elem.appendChild(content);\n },\n list: null,\n note: null,\n table: null,\n teiHeader: (elem: HTMLElement) => {\n elem.hidden = true;\n }\n }\n}\n\nexport const CETEIcean = (props: CETEIceanProps) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (props.tei) {\n const ceteicean = new CETEI(props.initArgs);\n\n ceteicean.addBehaviors({\n ...PRESET_BEHAVIORS,\n ...(props.behaviors || {}),\n tei: {\n ...PRESET_BEHAVIORS.tei,\n ...(props.behaviors?.tei || {})\n }\n });\n\n ceteicean.makeHTML5(props.tei, (data: Element) => {\n el.current.appendChild(data);\n props.onLoad(el.current);\n });\n }\n\n return () => {\n if (el.current)\n el.current.innerHTML = '';\n }\n }, [props.tei, JSON.stringify(props.initArgs), props.onLoad]);\n\n return (\n <div \n ref={el}\n className=\"tei-container\" />\n )\n\n}","import { Children, JSX, ReactElement, ReactNode, cloneElement, useCallback, useContext, useEffect } from 'react';\nimport { AnnotoriousContext, Filter } from '@annotorious/react';\nimport { createTEIAnnotator } from '@recogito/text-annotator-tei';\nimport type { AnnotatingMode, TextAnnotatorOptions } from '@recogito/text-annotator';\n\nimport '@recogito/text-annotator/text-annotator.css';\n\nexport type TEIAnnotatorProps = TextAnnotatorOptions & {\n\n children?: ReactNode | JSX.Element;\n\n annotatingMode?: AnnotatingMode;\n\n filter?: Filter;\n\n}\n\nexport const TEIAnnotator = (props: TEIAnnotatorProps) => {\n\n const { children, ...opts } = props;\n\n const { anno, setAnno } = useContext(AnnotoriousContext);\n\n const onLoad = useCallback((element: HTMLElement) => {\n // @ts-ignore\n const anno = createTEIAnnotator(element, opts);\n setAnno(anno);\n }, []);\n\n useEffect(() => anno?.setStyle(props.style), [anno, props.style]);\n\n useEffect(() => anno?.setFilter(props.filter), [anno, props.filter]);\n\n useEffect(() => anno?.setUser(opts.user), [anno, opts.user]);\n\n useEffect(() => anno?.setAnnotatingEnabled(opts.annotatingEnabled), [anno, opts.annotatingEnabled]);\n\n useEffect(() => anno?.setAnnotatingMode(opts.annotatingMode), [anno, opts.annotatingMode]);\n\n return props.children ? (\n <>\n {Children.toArray(props.children).map(child => \n cloneElement(child as ReactElement, { onLoad } as any))}\n </>\n ) : null;\n\n}\n","import { useEffect, useState } from 'react';\nimport { Origin, useAnnotationStore } from '@annotorious/react';\nimport { Ignore, type StoreChangeEvent } from '@annotorious/core';\nimport type { TextAnnotation, TextAnnotationStore, TextAnnotationTarget } from '@recogito/text-annotator';\n\nexport const useAnnotationQuoteIdle = (\n annotationId: string | undefined,\n options: { timeout: number } = { timeout: 250 }\n) => {\n const store = useAnnotationStore<TextAnnotationStore>();\n\n const [isIdle, setIsIdle] = useState(true);\n\n useEffect(() => {\n if (!store || !annotationId) return;\n\n let idleTimeout: ReturnType<typeof setTimeout>;\n\n const scheduleSetIsIdle = (event: StoreChangeEvent<TextAnnotation>) => {\n const { changes: { updated } } = event;\n\n const hasChanged = updated?.some(update => {\n const { targetUpdated } = update;\n if (targetUpdated) {\n const { oldTarget, newTarget } = targetUpdated;\n return hasQuoteChanged(oldTarget, newTarget);\n }\n });\n\n if (hasChanged) {\n setIsIdle(false);\n clearTimeout(idleTimeout);\n idleTimeout = setTimeout(() => setIsIdle(true), options.timeout);\n }\n };\n\n store.observe(scheduleSetIsIdle, {\n annotations: annotationId,\n ignore: Ignore.BODY_ONLY,\n origin: Origin.LOCAL\n });\n\n return () => {\n clearTimeout(idleTimeout);\n store.unobserve(scheduleSetIsIdle);\n };\n }, [store, annotationId, options.timeout]);\n\n return isIdle;\n};\n\nconst hasQuoteChanged = (oldValue: TextAnnotationTarget, newValue: TextAnnotationTarget) => {\n const { selector: oldSelector } = oldValue;\n const oldQuotes = oldSelector.map(({ quote }) => quote);\n\n const { selector: newSelector } = newValue;\n const newQuotes = newSelector.map(({ quote }) => quote);\n\n return oldQuotes.join() !== newQuotes.join();\n};\n","import { JSX, ReactNode, useContext, useEffect, useRef } from 'react';\nimport { AnnotoriousContext, Filter } from '@annotorious/react';\nimport type { FormatAdapter } from '@annotorious/core';\nimport { createTextAnnotator } from '@recogito/text-annotator';\nimport type { AnnotatingMode, TextAnnotation, TextAnnotatorOptions } from '@recogito/text-annotator';\n\nimport '@recogito/text-annotator/text-annotator.css';\n\nexport interface TextAnnotatorProps<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Omit<TextAnnotatorOptions<I, E>, 'adapter'> {\n\n children?: ReactNode | JSX.Element;\n\n adapter?: FormatAdapter<I, E> | ((container: HTMLElement) => FormatAdapter<I, E>) | null;\n\n annotatingMode?: AnnotatingMode;\n\n filter?: Filter<I>;\n\n className?: string;\n\n}\n\nexport const TextAnnotator = <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(\n props: TextAnnotatorProps<I, E>\n) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n const { className, children, ...opts } = props;\n\n const { style, filter, user, annotatingEnabled, annotatingMode } = opts;\n\n const { anno, setAnno } = useContext(AnnotoriousContext);\n\n useEffect(() => {\n if (!setAnno) return;\n\n const adapter = typeof opts.adapter === 'function' ? opts.adapter(el.current) : opts.adapter;\n\n const anno = createTextAnnotator(el.current, { ...opts, adapter });\n setAnno(anno);\n\n return () => anno.destroy();\n }, [setAnno]);\n\n useEffect(() => anno?.setStyle(style), [anno, style]);\n\n useEffect(() => anno?.setFilter(filter), [anno, filter]);\n\n useEffect(() => anno?.setUser(user), [anno, user]);\n\n useEffect(() => anno?.setAnnotatingEnabled(annotatingEnabled), [anno, annotatingEnabled]);\n\n useEffect(() => anno?.setAnnotatingMode(annotatingMode), [anno, annotatingMode]);\n\n return (\n <div ref={el} className={`r6o-annotatable no-focus-outline ${className}`}>\n {children}\n </div>\n );\n\n}\n","// https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system\nexport const isMobile = () => {\n if (typeof navigator === 'undefined') return false;\n\n // @ts-ignore\n var userAgent: string = navigator.userAgent || navigator.vendor || window?.opera;\n\n if (/android/i.test(userAgent)) \n return true;\n\n // @ts-ignore\n // Note: as of recently, this NO LONGER DETECTS FIREFOX ON iOS!\n // This means FF/iOS will behave like on the desktop, and loose\n // selection handlebars after the popup opens.\n if (/iPad|iPhone/.test(userAgent) && !window.MSStream)\n return true;\n\n return false;\n}","import { ReactNode, useEffect, useRef, useState } from 'react';\nimport debounce from 'debounce';\nimport { useAnnotator, useSelection } from '@annotorious/react';\nimport {\n NOT_ANNOTATABLE_CLASS,\n TextAnnotationStore,\n toViewportBounds,\n toDomRectList,\n type TextAnnotation,\n type TextAnnotator,\n} from '@recogito/text-annotator';\nimport {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingArrowProps,\n FloatingFocusManager,\n FloatingPortal,\n inline,\n offset,\n Placement,\n shift,\n useFloating\n} from '@floating-ui/react';\nimport { isMobile } from './is-mobile';\nimport { useAnnotationQuoteIdle } from '../hooks';\n\nimport './text-annotation-popup.css';\n\ninterface TextAnnotationPopupProps {\n\n ariaCloseWarning?: string;\n\n arrow?: boolean;\n\n arrowProps?: Omit<FloatingArrowProps, 'context' | 'ref'>;\n\n asPortal?: boolean;\n\n autoFocus?: boolean;\n\n placement?: Placement;\n\n popup(props: TextAnnotationPopupContentProps): ReactNode;\n\n onClose?(): void;\n\n}\n\nexport interface TextAnnotationPopupContentProps<T extends TextAnnotation = TextAnnotation> {\n\n annotation: T;\n\n selected: { annotation: T; editable?: boolean; }[];\n\n editable?: boolean;\n\n event?: PointerEvent | KeyboardEvent;\n\n}\n\nlet cachedBounds = null;\n\nconst updateViewportBounds = debounce((annotationId: string, store: TextAnnotationStore, container: HTMLElement) => {\n requestAnimationFrame(() => {\n const bounds = store.getAnnotationBounds(annotationId);\n if (!bounds) return;\n cachedBounds = toViewportBounds(bounds, container.getBoundingClientRect());\n });\n}, 250);\n\nexport const TextAnnotationPopup = (props: TextAnnotationPopupProps) => {\n\n const r = useAnnotator<TextAnnotator>();\n\n const { selected, event } = useSelection<TextAnnotation>();\n\n const annotation = selected[0]?.annotation;\n\n const isAnnotationQuoteIdle = useAnnotationQuoteIdle(annotation?.id);\n\n const [isOpen, setOpen] = useState(selected?.length > 0);\n\n // So we can reliably trigger the onClose callback\n const wasOpenRef = useRef(false);\n\n const arrowRef = useRef(null);\n\n const { refs, floatingStyles, update, context } = useFloating({\n placement: isMobile() ? 'bottom' : props.placement || 'top',\n strategy: 'absolute',\n open: isOpen,\n onOpenChange: (open, _event, reason) => {\n if (!open && (reason === 'escape-key' || reason === 'focus-out')) {\n setOpen(open);\n r?.cancelSelected();\n }\n },\n middleware: [\n inline(),\n offset(10),\n flip({ crossAxis: true }),\n shift({ crossAxis: true, padding: 10, }),\n arrow({ element: arrowRef })\n ],\n whileElementsMounted: autoUpdate\n });\n\n useEffect(() => {\n if (annotation?.id && isAnnotationQuoteIdle) {\n const bounds = r?.state.store.getAnnotationBounds(annotation.id);\n setOpen(Boolean(bounds));\n } else {\n setOpen(false);\n }\n }, [annotation?.id, annotation?.target.selector, isAnnotationQuoteIdle, r?.state.store]);\n\n useEffect(() => {\n if (!props.onClose) return;\n\n if (isOpen) {\n wasOpenRef.current = true;\n } else if (wasOpenRef.current) {\n wasOpenRef.current = false;\n props.onClose();\n }\n }, [props.onClose, isOpen]);\n\n useEffect(() => {\n if (!r) return;\n\n if (isOpen && annotation?.id) {\n refs.setPositionReference({\n getBoundingClientRect: () => {\n updateViewportBounds(annotation.id, r.state.store, r.element);\n return cachedBounds ? cachedBounds : new DOMRect();\n },\n getClientRects: () => {\n const rects = r.state.store.getAnnotationRects(annotation.id);\n const viewportRects = rects.map((rect) =>\n toViewportBounds(rect, r.element.getBoundingClientRect())\n );\n return toDomRectList(viewportRects);\n }\n });\n } else {\n refs.setPositionReference(null);\n }\n }, [isOpen, annotation?.id, annotation?.target, r]);\n\n useEffect(() => {\n if (!props.asPortal) return;\n\n const config: MutationObserverInit = { attributes: true, childList: true, subtree: true };\n\n const mutationObserver = new MutationObserver(() => update());\n mutationObserver.observe(document.body, config);\n\n window.document.addEventListener('scroll', update, true);\n\n return () => {\n mutationObserver.disconnect();\n window.document.removeEventListener('scroll', update, true);\n };\n }, [update, props.asPortal]);\n\n const onClose = () => r?.cancelSelected();\n\n return isOpen && annotation ? (\n <FloatingPortal\n root={props.asPortal ? undefined : r.element}>\n <FloatingFocusManager\n context={context}\n modal={false}\n closeOnFocusOut={true}\n returnFocus={false}\n initialFocus={-1}>\n <div\n className={`a9s-popup r6o-popup annotation-popup r6o-text-popup ${NOT_ANNOTATABLE_CLASS}`}\n ref={refs.setFloating}\n style={floatingStyles}>\n {props.popup({\n annotation: selected[0].annotation, // for backwards compatibility\n editable: selected[0].editable,\n selected,\n event\n })}\n\n {props.arrow && (\n <FloatingArrow\n ref={arrowRef}\n context={context}\n {...(props.arrowProps || {})} />\n )}\n\n <button className=\"r6o-popup-sr-only\" aria-live=\"assertive\" onClick={onClose}>\n {props.ariaCloseWarning || 'Click or leave this dialog to close it.'}\n </button>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n ) : null;\n\n};\n\n/** For backwards compatibility **/\n/** @deprecated Use TextAnnotationPopup instead */\nexport const TextAnnotatorPopup = (props: TextAnnotationPopupProps) => {\n\n useEffect(() => {\n console.warn('TextAnnotatorPopup is deprecated and will be removed in a future version. Please use TextAnnotationPopup instead.');\n }, []);\n\n return <TextAnnotationPopup {...props} />;\n};\n"],"names":["PRESET_BEHAVIORS","elem","a","content","CETEIcean","props","el","useRef","useEffect","ceteicean","CETEI","data","jsx","TEIAnnotator","children","opts","anno","setAnno","useContext","AnnotoriousContext","onLoad","useCallback","element","createTEIAnnotator","Fragment","Children","child","cloneElement","useAnnotationQuoteIdle","annotationId","options","store","useAnnotationStore","isIdle","setIsIdle","useState","idleTimeout","scheduleSetIsIdle","event","updated","update","targetUpdated","oldTarget","newTarget","hasQuoteChanged","Ignore","Origin","oldValue","newValue","oldSelector","oldQuotes","quote","newSelector","newQuotes","TextAnnotator","className","style","filter","user","annotatingEnabled","annotatingMode","adapter","createTextAnnotator","isMobile","userAgent","cachedBounds","updateViewportBounds","debounce","container","bounds","toViewportBounds","TextAnnotationPopup","r","useAnnotator","selected","useSelection","annotation","isAnnotationQuoteIdle","isOpen","setOpen","wasOpenRef","arrowRef","refs","floatingStyles","context","useFloating","open","_event","reason","inline","offset","flip","shift","arrow","autoUpdate","viewportRects","rect","toDomRectList","config","mutationObserver","onClose","FloatingPortal","FloatingFocusManager","jsxs","NOT_ANNOTATABLE_CLASS","FloatingArrow","TextAnnotatorPopup"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAmB;AAAA,EACvB,KAAK;AAAA,IACH,KAAK,CAACC,MAAkB;AACtB,YAAMC,IAAI,SAAS,cAAc,GAAG;AAEpC,aAAMD,EAAK;AACT,QAAAC,EAAE,YAAYD,EAAK,YAAYA,EAAK,UAAU,CAAC;AAGjD,MAAAC,EAAE,aAAa,QAAQD,EAAK,aAAa,QAAQ,CAAC,GAElDA,EAAK,YAAYC,CAAC;AAAA,IACpB;AAAA;AAAA,IAEA,SAAS,CAACD,MAAkB;AAC1B,YAAME,IAAU,IAAI,MAAA;AACpB,MAAAA,EAAQ,MAAMF,EAAK,aAAa,KAAK,GAAG,KAAA,GAEpCA,EAAK,aAAa,OAAO,KAC3BE,EAAQ,aAAa,SAASF,EAAK,aAAa,OAAO,CAAC,GAEtDA,EAAK,aAAa,QAAQ,KAC5BE,EAAQ,aAAa,UAAUF,EAAK,aAAa,QAAQ,CAAC,GAE5DA,EAAK,YAAYE,CAAO;AAAA,IAC1B;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW,CAACF,MAAsB;AAChC,MAAAA,EAAK,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,EAAO,WAAU,qBAAoB,aAAU,aAAY,SAASwF,GAClE,UAAA/F,EAAM,oBAAoB,0CAAA,CAC7B;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA,IAEA;AAEN,GAIaqG,KAAqB,CAACrG,OAEjCG,EAAU,MAAM;AACd,UAAQ,KAAK,mHAAmH;AAClI,GAAG,CAAA,CAAE,GAEE,gBAAAI,EAAC2D,IAAA,EAAqB,GAAGlE,EAAA,CAAO;"}
1
+ {"version":3,"file":"react-text-annotator.es.js","sources":["../src/tei/ceteicean.tsx","../src/tei/tei-annotator.tsx","../src/hooks/use-annotation-quote-idle.ts","../src/text-annotator.tsx","../src/text-annotation-popup/is-mobile.ts","../src/text-annotation-popup/text-annotation-popup.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport CETEI from 'CETEIcean';\n\ninterface CETEIceanProps {\n\n initArgs?: any;\n\n tei?: string;\n\n onLoad?(element: Element): void;\n\n behaviors?: any;\n\n}\n\n// Override default list, note, table, and ref behaviors \n// so they don't introduce text into the DOM that interferes\n// with annotation. Apply a patch to graphics for robustness.\nconst PRESET_BEHAVIORS = {\n tei: {\n ref: (elem: Element) => {\n const a = document.createElement('a');\n\n while(elem.firstChild) {\n a.appendChild(elem.removeChild(elem.firstChild));\n }\n\n a.setAttribute('href', elem.getAttribute('target')!);\n\n elem.appendChild(a);\n },\n // Cf. https://github.com/TEIC/CETEIcean/issues/67\n graphic: (elem: Element) => {\n const content = new Image();\n content.src = elem.getAttribute('url')?.trim()!;\n\n if (elem.hasAttribute('width'))\n content.setAttribute('width', elem.getAttribute('width')!);\n\n if (elem.hasAttribute('height'))\n content.setAttribute('height', elem.getAttribute('height')!);\n\n elem.appendChild(content);\n },\n list: null,\n note: null,\n table: null,\n teiHeader: (elem: HTMLElement) => {\n elem.hidden = true;\n }\n }\n}\n\nexport const CETEIcean = (props: CETEIceanProps) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (props.tei) {\n const ceteicean = new CETEI(props.initArgs);\n\n ceteicean.addBehaviors({\n ...PRESET_BEHAVIORS,\n ...(props.behaviors || {}),\n tei: {\n ...PRESET_BEHAVIORS.tei,\n ...(props.behaviors?.tei || {})\n }\n });\n\n ceteicean.makeHTML5(props.tei, (data: Element) => {\n el.current?.appendChild(data);\n props.onLoad?.(el.current!);\n });\n }\n\n return () => {\n if (el.current)\n el.current.innerHTML = '';\n }\n }, [props.tei, JSON.stringify(props.initArgs), props.onLoad]);\n\n return (\n <div \n ref={el}\n className=\"tei-container\" />\n )\n\n}","import { Children, JSX, ReactElement, ReactNode, cloneElement, useCallback, useContext, useEffect } from 'react';\nimport { AnnotoriousContext, Filter } from '@annotorious/react';\nimport { createTEIAnnotator } from '@recogito/text-annotator-tei';\nimport type { AnnotatingMode, TextAnnotatorOptions } from '@recogito/text-annotator';\n\nimport '@recogito/text-annotator/text-annotator.css';\n\nexport type TEIAnnotatorProps = TextAnnotatorOptions & {\n\n children?: ReactNode | JSX.Element;\n\n annotatingMode?: AnnotatingMode;\n\n filter?: Filter;\n\n}\n\nexport const TEIAnnotator = (props: TEIAnnotatorProps) => {\n\n const { children, ...opts } = props;\n\n const { anno, setAnno } = useContext(AnnotoriousContext);\n\n const onLoad = useCallback((element: HTMLElement) => {\n // @ts-ignore\n const anno = createTEIAnnotator(element, opts);\n setAnno(anno);\n }, []);\n\n useEffect(() => anno?.setStyle(props.style), [anno, props.style]);\n\n useEffect(() => anno?.setFilter(props.filter), [anno, props.filter]);\n\n useEffect(() => anno?.setUser(opts.user), [anno, opts.user]);\n\n useEffect(() => anno?.setAnnotatingEnabled(opts.annotatingEnabled), [anno, opts.annotatingEnabled]);\n\n useEffect(() => anno?.setAnnotatingMode(opts.annotatingMode), [anno, opts.annotatingMode]);\n\n return props.children ? (\n <>\n {Children.toArray(props.children).map(child => \n cloneElement(child as ReactElement, { onLoad } as any))}\n </>\n ) : null;\n\n}\n","import { useEffect, useState } from 'react';\nimport { Origin, useAnnotationStore } from '@annotorious/react';\nimport { Ignore, type StoreChangeEvent } from '@annotorious/core';\nimport type { TextAnnotation, TextAnnotationStore, TextAnnotationTarget } from '@recogito/text-annotator';\n\nexport const useAnnotationQuoteIdle = (\n annotationId: string | undefined,\n options: { timeout: number } = { timeout: 250 }\n) => {\n const store = useAnnotationStore<TextAnnotationStore>();\n\n const [isIdle, setIsIdle] = useState(true);\n\n useEffect(() => {\n if (!store || !annotationId) return;\n\n let idleTimeout: ReturnType<typeof setTimeout>;\n\n const scheduleSetIsIdle = (event: StoreChangeEvent<TextAnnotation>) => {\n const { changes: { updated } } = event;\n\n const hasChanged = updated?.some(update => {\n const { targetUpdated } = update;\n if (targetUpdated) {\n const { oldTarget, newTarget } = targetUpdated;\n return hasQuoteChanged(oldTarget, newTarget);\n }\n });\n\n if (hasChanged) {\n setIsIdle(false);\n clearTimeout(idleTimeout);\n idleTimeout = setTimeout(() => setIsIdle(true), options.timeout);\n }\n };\n\n store.observe(scheduleSetIsIdle, {\n annotations: annotationId,\n ignore: Ignore.BODY_ONLY,\n origin: Origin.LOCAL\n });\n\n return () => {\n clearTimeout(idleTimeout);\n store.unobserve(scheduleSetIsIdle);\n };\n }, [store, annotationId, options.timeout]);\n\n return isIdle;\n};\n\nconst hasQuoteChanged = (oldValue: TextAnnotationTarget, newValue: TextAnnotationTarget) => {\n const { selector: oldSelector } = oldValue;\n const oldQuotes = oldSelector.map(({ quote }) => quote);\n\n const { selector: newSelector } = newValue;\n const newQuotes = newSelector.map(({ quote }) => quote);\n\n return oldQuotes.join() !== newQuotes.join();\n};\n","import { JSX, ReactNode, useContext, useEffect, useRef } from 'react';\nimport { AnnotoriousContext, Filter } from '@annotorious/react';\nimport type { FormatAdapter } from '@annotorious/core';\nimport { createTextAnnotator } from '@recogito/text-annotator';\nimport type { AnnotatingMode, TextAnnotation, TextAnnotatorOptions } from '@recogito/text-annotator';\n\nimport '@recogito/text-annotator/text-annotator.css';\n\nexport interface TextAnnotatorProps<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Omit<TextAnnotatorOptions<I, E>, 'adapter'> {\n\n children?: ReactNode | JSX.Element;\n\n adapter?: FormatAdapter<I, E> | ((container: HTMLElement) => FormatAdapter<I, E>);\n\n annotatingMode?: AnnotatingMode;\n\n filter?: Filter<I>;\n\n className?: string;\n\n}\n\nexport const TextAnnotator = <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(\n props: TextAnnotatorProps<I, E>\n) => {\n\n const el = useRef<HTMLDivElement>(null);\n\n const { className, children, ...opts } = props;\n\n const { style, filter, user, annotatingEnabled, userSelectAction, annotatingMode } = opts;\n\n const { anno, setAnno } = useContext(AnnotoriousContext);\n\n useEffect(() => {\n if (!setAnno || !el.current) return;\n\n const adapter = typeof opts.adapter === 'function' ? opts.adapter(el.current) : opts.adapter;\n\n const anno = createTextAnnotator(el.current!, { ...opts, adapter });\n setAnno(anno);\n\n return () => anno.destroy();\n }, [setAnno]);\n\n useEffect(() => anno?.setStyle(style), [anno, style]);\n\n useEffect(() => anno?.setFilter(filter), [anno, filter]);\n\n useEffect(() => anno?.setUser(user), [anno, user]);\n\n useEffect(() => anno?.setUserSelectAction(userSelectAction), [anno, userSelectAction]);\n\n useEffect(() => anno?.setAnnotatingEnabled(annotatingEnabled), [anno, annotatingEnabled]);\n\n useEffect(() => anno?.setAnnotatingMode(annotatingMode), [anno, annotatingMode]);\n\n return (\n <div ref={el} className={`r6o-annotatable no-focus-outline ${className}`}>\n {children}\n </div>\n );\n\n}\n","// https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system\nexport const isMobile = () => {\n if (typeof navigator === 'undefined') return false;\n\n // @ts-ignore\n var userAgent: string = navigator.userAgent || navigator.vendor || window?.opera;\n\n if (/android/i.test(userAgent)) \n return true;\n\n // @ts-ignore\n // Note: as of recently, this NO LONGER DETECTS FIREFOX ON iOS!\n // This means FF/iOS will behave like on the desktop, and loose\n // selection handlebars after the popup opens.\n if (/iPad|iPhone/.test(userAgent) && !window.MSStream)\n return true;\n\n return false;\n}","import { ReactNode, useEffect, useRef, useState } from 'react';\nimport debounce from 'debounce';\nimport { useAnnotator, useSelection } from '@annotorious/react';\nimport {\n NOT_ANNOTATABLE_CLASS,\n TextAnnotationStore,\n toViewportBounds,\n toDomRectList,\n type TextAnnotation,\n type TextAnnotator,\n} from '@recogito/text-annotator';\nimport {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n FloatingArrowProps,\n FloatingFocusManager,\n FloatingPortal,\n inline,\n offset,\n Placement,\n shift,\n useFloating\n} from '@floating-ui/react';\nimport { isMobile } from './is-mobile';\nimport { useAnnotationQuoteIdle } from '../hooks';\n\nimport './text-annotation-popup.css';\n\ninterface TextAnnotationPopupProps {\n\n ariaCloseWarning?: string;\n\n arrow?: boolean;\n\n arrowProps?: Omit<FloatingArrowProps, 'context' | 'ref'>;\n\n asPortal?: boolean;\n\n autoFocus?: boolean;\n\n placement?: Placement;\n\n popup(props: TextAnnotationPopupContentProps): ReactNode;\n\n onClose?(): void;\n\n}\n\nexport interface TextAnnotationPopupContentProps<T extends TextAnnotation = TextAnnotation> {\n\n annotation: T;\n\n selected: { annotation: T; editable?: boolean; }[];\n\n editable?: boolean;\n\n event?: PointerEvent | KeyboardEvent;\n\n}\n\nlet cachedBounds: DOMRect | null = null;\n\nconst updateViewportBounds = debounce((annotationId: string, store: TextAnnotationStore, container: HTMLElement) => {\n requestAnimationFrame(() => {\n const bounds = store.getAnnotationBounds(annotationId);\n if (!bounds) return;\n cachedBounds = toViewportBounds(bounds, container.getBoundingClientRect());\n });\n}, 250);\n\nexport const TextAnnotationPopup = (props: TextAnnotationPopupProps) => {\n\n const r = useAnnotator<TextAnnotator>();\n\n const { selected, event } = useSelection<TextAnnotation>();\n\n const annotation = selected[0]?.annotation;\n\n const isAnnotationQuoteIdle = useAnnotationQuoteIdle(annotation?.id);\n\n const [isOpen, setOpen] = useState(selected?.length > 0);\n\n // So we can reliably trigger the onClose callback\n const wasOpenRef = useRef(false);\n\n const arrowRef = useRef(null);\n\n const { refs, floatingStyles, update, context } = useFloating({\n placement: isMobile() ? 'bottom' : props.placement || 'top',\n strategy: 'absolute',\n open: isOpen,\n onOpenChange: (open, _event, reason) => {\n if (!open && (reason === 'escape-key' || reason === 'focus-out')) {\n setOpen(open);\n r?.cancelSelected();\n }\n },\n middleware: [\n inline(),\n offset(10),\n flip({ crossAxis: true }),\n shift({ crossAxis: true, padding: 10, }),\n arrow({ element: arrowRef })\n ],\n whileElementsMounted: autoUpdate\n });\n\n useEffect(() => {\n if (annotation?.id && isAnnotationQuoteIdle) {\n const bounds = r?.state.store.getAnnotationBounds(annotation.id);\n setOpen(Boolean(bounds));\n } else {\n setOpen(false);\n }\n }, [annotation?.id, annotation?.target.selector, isAnnotationQuoteIdle, r?.state.store]);\n\n useEffect(() => {\n if (!props.onClose) return;\n\n if (isOpen) {\n wasOpenRef.current = true;\n } else if (wasOpenRef.current) {\n wasOpenRef.current = false;\n props.onClose();\n }\n }, [props.onClose, isOpen]);\n\n useEffect(() => {\n if (!r) return;\n\n if (isOpen && annotation?.id) {\n refs.setPositionReference({\n getBoundingClientRect: () => {\n updateViewportBounds(annotation.id, r.state.store, r.element);\n return cachedBounds ? cachedBounds : new DOMRect();\n },\n getClientRects: () => {\n const rects = r.state.store.getAnnotationRects(annotation.id);\n const viewportRects = rects.map((rect) =>\n toViewportBounds(rect, r.element.getBoundingClientRect())\n );\n return toDomRectList(viewportRects);\n }\n });\n } else {\n refs.setPositionReference(null);\n }\n }, [isOpen, annotation?.id, annotation?.target, r]);\n\n useEffect(() => {\n if (!props.asPortal) return;\n\n const config: MutationObserverInit = { attributes: true, childList: true, subtree: true };\n\n const mutationObserver = new MutationObserver(() => update());\n mutationObserver.observe(document.body, config);\n\n window.document.addEventListener('scroll', update, true);\n\n return () => {\n mutationObserver.disconnect();\n window.document.removeEventListener('scroll', update, true);\n };\n }, [update, props.asPortal]);\n\n const onClose = () => r?.cancelSelected();\n\n return isOpen && annotation ? (\n <FloatingPortal\n root={props.asPortal ? undefined : r.element}>\n <FloatingFocusManager\n context={context}\n modal={false}\n closeOnFocusOut={true}\n returnFocus={false}\n initialFocus={-1}>\n <div\n className={`a9s-popup r6o-popup annotation-popup r6o-text-popup ${NOT_ANNOTATABLE_CLASS}`}\n ref={refs.setFloating}\n style={floatingStyles}>\n {props.popup({\n annotation: selected[0].annotation, // for backwards compatibility\n editable: selected[0].editable,\n selected,\n event\n })}\n\n {props.arrow && (\n <FloatingArrow\n ref={arrowRef}\n context={context}\n {...(props.arrowProps || {})} />\n )}\n\n <button className=\"r6o-popup-sr-only\" aria-live=\"assertive\" onClick={onClose}>\n {props.ariaCloseWarning || 'Click or leave this dialog to close it.'}\n </button>\n </div>\n </FloatingFocusManager>\n </FloatingPortal>\n ) : null;\n\n};\n\n/** For backwards compatibility **/\n/** @deprecated Use TextAnnotationPopup instead */\nexport const TextAnnotatorPopup = (props: TextAnnotationPopupProps) => {\n\n useEffect(() => {\n console.warn('TextAnnotatorPopup is deprecated and will be removed in a future version. Please use TextAnnotationPopup instead.');\n }, []);\n\n return <TextAnnotationPopup {...props} />;\n};\n"],"names":["PRESET_BEHAVIORS","elem","a","content","CETEIcean","props","el","useRef","useEffect","ceteicean","CETEI","data","jsx","TEIAnnotator","children","opts","anno","setAnno","useContext","AnnotoriousContext","onLoad","useCallback","element","createTEIAnnotator","Fragment","Children","child","cloneElement","useAnnotationQuoteIdle","annotationId","options","store","useAnnotationStore","isIdle","setIsIdle","useState","idleTimeout","scheduleSetIsIdle","event","updated","update","targetUpdated","oldTarget","newTarget","hasQuoteChanged","Ignore","Origin","oldValue","newValue","oldSelector","oldQuotes","quote","newSelector","newQuotes","TextAnnotator","className","style","filter","user","annotatingEnabled","userSelectAction","annotatingMode","adapter","createTextAnnotator","isMobile","userAgent","cachedBounds","updateViewportBounds","debounce","container","bounds","toViewportBounds","TextAnnotationPopup","r","useAnnotator","selected","useSelection","annotation","isAnnotationQuoteIdle","isOpen","setOpen","wasOpenRef","arrowRef","refs","floatingStyles","context","useFloating","open","_event","reason","inline","offset","flip","shift","arrow","autoUpdate","viewportRects","rect","toDomRectList","config","mutationObserver","onClose","FloatingPortal","FloatingFocusManager","jsxs","NOT_ANNOTATABLE_CLASS","FloatingArrow","TextAnnotatorPopup"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAMA,IAAmB;AAAA,EACvB,KAAK;AAAA,IACH,KAAK,CAACC,MAAkB;AACtB,YAAMC,IAAI,SAAS,cAAc,GAAG;AAEpC,aAAMD,EAAK;AACT,QAAAC,EAAE,YAAYD,EAAK,YAAYA,EAAK,UAAU,CAAC;AAGjD,MAAAC,EAAE,aAAa,QAAQD,EAAK,aAAa,QAAQ,CAAE,GAEnDA,EAAK,YAAYC,CAAC;AAAA,IACpB;AAAA;AAAA,IAEA,SAAS,CAACD,MAAkB;AAC1B,YAAME,IAAU,IAAI,MAAA;AACpB,MAAAA,EAAQ,MAAMF,EAAK,aAAa,KAAK,GAAG,KAAA,GAEpCA,EAAK,aAAa,OAAO,KAC3BE,EAAQ,aAAa,SAASF,EAAK,aAAa,OAAO,CAAE,GAEvDA,EAAK,aAAa,QAAQ,KAC5BE,EAAQ,aAAa,UAAUF,EAAK,aAAa,QAAQ,CAAE,GAE7DA,EAAK,YAAYE,CAAO;AAAA,IAC1B;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,WAAW,CAACF,MAAsB;AAChC,MAAAA,EAAK,SAAS;AAAA,IAChB;AAAA,EAAA;AAEJ,GAEaG,KAAY,CAACC,MAA0B;AAElD,QAAMC,IAAKC,EAAuB,IAAI;AAEtC,SAAAC,EAAU,MAAM;AACd,QAAIH,EAAM,KAAK;AACb,YAAMI,IAAY,IAAIC,EAAML,EAAM,QAAQ;AAE1C,MAAAI,EAAU,aAAa;AAAA,QACrB,GAAGT;AAAA,QACH,GAAIK,EAAM,aAAa,CAAA;AAA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AA,EAAA,IAEA;AAEN,GAIasG,KAAqB,CAACtG,OAEjCG,EAAU,MAAM;AACd,UAAQ,KAAK,mHAAmH;AAClI,GAAG,CAAA,CAAE,GAEE,gBAAAI,EAAC4D,IAAA,EAAqB,GAAGnE,EAAA,CAAO;"}
@@ -5,7 +5,7 @@ import type { AnnotatingMode, TextAnnotation, TextAnnotatorOptions } from '@reco
5
5
  import '@recogito/text-annotator/text-annotator.css';
6
6
  export interface TextAnnotatorProps<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Omit<TextAnnotatorOptions<I, E>, 'adapter'> {
7
7
  children?: ReactNode | JSX.Element;
8
- adapter?: FormatAdapter<I, E> | ((container: HTMLElement) => FormatAdapter<I, E>) | null;
8
+ adapter?: FormatAdapter<I, E> | ((container: HTMLElement) => FormatAdapter<I, E>);
9
9
  annotatingMode?: AnnotatingMode;
10
10
  filter?: Filter<I>;
11
11
  className?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recogito/react-text-annotator",
3
- "version": "4.0.0-beta",
3
+ "version": "v4.0.2-beta",
4
4
  "description": "Recogito Text Annotator React bindings",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -24,18 +24,18 @@
24
24
  "module": "./dist/react-text-annotator.es.js",
25
25
  "types": "./dist/index.d.ts",
26
26
  "devDependencies": {
27
- "@types/react": "^19.2.5",
27
+ "@types/react": "^19.2.14",
28
28
  "@types/react-dom": "^19.2.3",
29
- "@vitejs/plugin-react": "^5.1.1",
30
- "react": "^19.2.0",
31
- "react-dom": "^19.2.0",
32
- "typescript": "5.9.3",
33
- "vite": "^7.2.2",
29
+ "@vitejs/plugin-react": "^5.2.0",
30
+ "react": "^19.2.5",
31
+ "react-dom": "^19.2.5",
32
+ "typescript": "^5.9.3",
33
+ "vite": "^7.3.2",
34
34
  "vite-plugin-externalize-deps": "^0.10.0",
35
35
  "vite-tsconfig-paths": "^5.1.4"
36
36
  },
37
37
  "peerDependencies": {
38
- "openseadragon": ">= ^4.0 || >= ^5.0",
38
+ "openseadragon": ">= ^4.0 || >= ^5.0 || >= ^6.0",
39
39
  "react": ">= ^18.x || >= ^19.x",
40
40
  "react-dom": ">= ^18.x || >= ^19.x"
41
41
  },
@@ -45,11 +45,11 @@
45
45
  }
46
46
  },
47
47
  "dependencies": {
48
- "@annotorious/core": "^3.7.13",
49
- "@annotorious/react": "^3.7.13",
50
- "@floating-ui/react": "^0.27.16",
51
- "@recogito/text-annotator": "4.0.0-beta",
52
- "@recogito/text-annotator-tei": "4.0.0-beta",
48
+ "@annotorious/core": "^3.8.2",
49
+ "@annotorious/react": "^3.8.2",
50
+ "@floating-ui/react": "^0.27.19",
51
+ "@recogito/text-annotator": "v4.0.2-beta",
52
+ "@recogito/text-annotator-tei": "v4.0.2-beta",
53
53
  "CETEIcean": "^1.9.5",
54
54
  "debounce": "^3.0.0"
55
55
  }
@@ -1,28 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { type TextAnnotation } from '@recogito/text-annotator';
3
- import { FloatingArrowProps, Placement } from '@floating-ui/react';
4
- import './TextAnnotationPopup.css';
5
- interface TextAnnotationPopupProps {
6
- ariaCloseWarning?: string;
7
- arrow?: boolean;
8
- arrowProps?: Omit<FloatingArrowProps, 'context' | 'ref'>;
9
- asPortal?: boolean;
10
- autoFocus?: boolean;
11
- placement?: Placement;
12
- popup(props: TextAnnotationPopupContentProps): ReactNode;
13
- onClose?(): void;
14
- }
15
- export interface TextAnnotationPopupContentProps<T extends TextAnnotation = TextAnnotation> {
16
- annotation: T;
17
- selected: {
18
- annotation: T;
19
- editable?: boolean;
20
- }[];
21
- editable?: boolean;
22
- event?: PointerEvent | KeyboardEvent;
23
- }
24
- export declare const TextAnnotationPopup: (props: TextAnnotationPopupProps) => import("react/jsx-runtime").JSX.Element;
25
- /** For backwards compatibility **/
26
- /** @deprecated Use TextAnnotationPopup instead */
27
- export declare const TextAnnotatorPopup: (props: TextAnnotationPopupProps) => import("react/jsx-runtime").JSX.Element;
28
- export {};
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextAnnotationPopup.d.ts","sourceRoot":"","sources":["../../src/TextAnnotationPopup/TextAnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAwC,MAAM,OAAO,CAAC;AAExE,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAKL,kBAAkB,EAKlB,SAAS,EAGV,MAAM,oBAAoB,CAAC;AAI5B,OAAO,2BAA2B,CAAC;AAEnC,UAAU,wBAAwB;IAEhC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,UAAU,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,SAAS,GAAG,KAAK,CAAC,CAAC;IAEzD,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,KAAK,CAAC,KAAK,EAAE,+BAA+B,GAAG,SAAS,CAAC;IAEzD,OAAO,CAAC,IAAI,IAAI,CAAC;CAElB;AAED,MAAM,WAAW,+BAA+B,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc;IAExF,UAAU,EAAE,CAAC,CAAC;IAEd,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;CAEtC;AAkBD,eAAO,MAAM,mBAAmB,GAAI,OAAO,wBAAwB,4CA4IlE,CAAC;AAEF,mCAAmC;AACnC,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,GAAI,OAAO,wBAAwB,4CAOjE,CAAC"}
@@ -1 +0,0 @@
1
- export * from './TextAnnotationPopup';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TextAnnotationPopup/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -1 +0,0 @@
1
- export declare const isMobile: () => boolean;
@@ -1 +0,0 @@
1
- {"version":3,"file":"isMobile.d.ts","sourceRoot":"","sources":["../../src/TextAnnotationPopup/isMobile.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,eAiBpB,CAAA"}
@@ -1,13 +0,0 @@
1
- import { JSX, ReactNode } from 'react';
2
- import { Filter } from '@annotorious/react';
3
- import type { FormatAdapter } from '@annotorious/core';
4
- import type { AnnotatingMode, TextAnnotation, TextAnnotatorOptions } from '@recogito/text-annotator';
5
- import '@recogito/text-annotator/text-annotator.css';
6
- export interface TextAnnotatorProps<I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation> extends Omit<TextAnnotatorOptions<I, E>, 'adapter'> {
7
- children?: ReactNode | JSX.Element;
8
- adapter?: FormatAdapter<I, E> | ((container: HTMLElement) => FormatAdapter<I, E>) | null;
9
- annotatingMode?: AnnotatingMode;
10
- filter?: Filter<I>;
11
- className?: string;
12
- }
13
- export declare const TextAnnotator: <I extends TextAnnotation = TextAnnotation, E extends unknown = TextAnnotation>(props: TextAnnotatorProps<I, E>) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextAnnotator.d.ts","sourceRoot":"","sources":["../src/TextAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAiC,MAAM,OAAO,CAAC;AACtE,OAAO,EAAsB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG/G,OAAO,kDAAkD,CAAC;AAE1D,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,CAAC,SAAS,OAAO,GAAG,cAAc,CAAE,SAAQ,IAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC;IAEpK,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC;IAEnC,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,KAAK,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAEzF,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAEnB,KAAK,CAAC,EAAE,wBAAwB,CAAC;IAEjC,SAAS,CAAC,EAAE,MAAM,CAAC;CAEpB;AAED,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,cAAc,GAAG,cAAc,EAAE,CAAC,SAAS,OAAO,GAAG,cAAc,EACzG,OAAO,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,4CAkChC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { AnnotatorPlugin } from '@annotorious/react';
2
- import type { TextAnnotator } from '@recogito/text-annotator';
3
- export type TextAnnotatorPlugin<T extends unknown = TextAnnotator> = AnnotatorPlugin<T>;
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextAnnotatorPlugin.d.ts","sourceRoot":"","sources":["../src/TextAnnotatorPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,OAAO,GAAG,aAAa,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const useAnnotationQuoteIdle: (annotationId: string | undefined, options?: {
2
- timeout: number;
3
- }) => boolean;
@@ -1 +0,0 @@
1
- {"version":3,"file":"useAnnotationQuoteIdle.d.ts","sourceRoot":"","sources":["../../src/hooks/useAnnotationQuoteIdle.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB,GACjC,cAAc,MAAM,GAAG,SAAS,EAChC,UAAS;IAAE,OAAO,EAAE,MAAM,CAAA;CAAqB,YA0ChD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AAGtC,YAAY,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,KAAK,EACL,MAAM,EACN,aAAa,EACb,UAAU,EACV,SAAS,EACT,cAAc,EACd,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,WAAW,EACX,IAAI,EACJ,0BAA0B,EAC1B,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,MAAM,EACN,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACN,iBAAiB,EACjB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,uBAAuB,EACvB,aAAa,IAAI,qBAAqB,EACtC,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,yBAAyB,EAC1B,MAAM,8BAA8B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"CETEIcean.d.ts","sourceRoot":"","sources":["../../src/tei/CETEIcean.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IAEtB,QAAQ,CAAC,EAAE,GAAG,CAAC;IAEf,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAEhC,SAAS,CAAC,EAAE,GAAG,CAAC;CAEjB;AAwCD,eAAO,MAAM,SAAS,GAAI,OAAO,cAAc,4CAmC9C,CAAA"}
@@ -1,10 +0,0 @@
1
- import { JSX, ReactNode } from 'react';
2
- import { Filter } from '@annotorious/react';
3
- import type { AnnotatingMode, TextAnnotatorOptions } from '@recogito/text-annotator';
4
- import '@recogito/text-annotator/text-annotator.css';
5
- export type TEIAnnotatorProps = TextAnnotatorOptions & {
6
- children?: ReactNode | JSX.Element;
7
- annotatingMode?: AnnotatingMode;
8
- filter?: Filter;
9
- };
10
- export declare const TEIAnnotator: (props: TEIAnnotatorProps) => import("react/jsx-runtime").JSX.Element;
@@ -1 +0,0 @@
1
- {"version":3,"file":"TEIAnnotator.d.ts","sourceRoot":"","sources":["../../src/tei/TEIAnnotator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,GAAG,EAAgB,SAAS,EAAoD,MAAM,OAAO,CAAC;AACjH,OAAO,EAAsB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAuB,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,kDAAkD,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GAAG,oBAAoB,GAAG;IAErD,QAAQ,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,OAAO,CAAC;IAEnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,wBAAwB,CAAA;CAEjC,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CAgCpD,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tei/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
File without changes