@soomo/text-annotator 3.0.0-staging.22 → 3.0.0-staging.24

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.
@@ -1053,7 +1053,10 @@ const Qe = 250, Je = (t) => {
1053
1053
  u.has(y) ? u.get(y).push(h) : u.set(y, [h]);
1054
1054
  }, p = (y, h) => {
1055
1055
  const d = u.get(y);
1056
- d && d.indexOf(h) > 0 && d.splice(d.indexOf(h), 1);
1056
+ if (d) {
1057
+ const l = d.indexOf(h);
1058
+ l !== -1 && d.splice(l, 1);
1059
+ }
1057
1060
  }, g = (y, h, d) => {
1058
1061
  u.has(y) && setTimeout(() => {
1059
1062
  u.get(y).forEach((l) => {
@@ -1836,7 +1839,7 @@ const Cn = (t, e) => {
1836
1839
  ...s,
1837
1840
  selector: S.map((T) => le(T, t, o)),
1838
1841
  updated: /* @__PURE__ */ new Date()
1839
- }, i.getAnnotation(s.annotation) ? i.updateTarget(s, N.LOCAL) : (i.addAnnotation({
1842
+ }, i.getAnnotation(s.annotation) ? i.updateTarget(s, N.LOCAL) : (r.clear(), i.addAnnotation({
1840
1843
  id: s.annotation,
1841
1844
  bodies: [],
1842
1845
  target: s