@soomo/text-annotator 3.0.0-staging.60 → 3.0.0-staging.62

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.
@@ -147,8 +147,8 @@ const se = "not-annotatable", P = `.${se}`, Se = (t) => {
147
147
  ...t,
148
148
  selector: t.selector.map((n) => n.range instanceof Range && !n.range.collapsed ? n : re(n, e))
149
149
  }, wt = (t, e) => W(t.target.selector) ? t : { ...t, target: yt(t.target, e) }, Ue = (t, e) => {
150
- const n = t.cloneRange();
151
- return e.contains(n.startContainer) || n.setStart(e, 0), e.contains(n.endContainer) || n.setEnd(e, e.childNodes.length), n;
150
+ const n = t.cloneRange(), o = e.contains(n.startContainer), i = e.contains(n.endContainer);
151
+ return !o && !i ? (n.collapse(), n) : (o || n.setStart(e, 0), i || n.setEnd(e, e.childNodes.length), n);
152
152
  }, Ve = (t, e) => {
153
153
  const { left: n, top: o, right: i, bottom: s } = t;
154
154
  return new DOMRect(n - e.left, o - e.top, i - n, s - o);