@soomo/text-annotator 3.0.0-staging.21 → 3.0.0-staging.22
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.
|
@@ -1639,7 +1639,7 @@ const Cn = (t, e) => {
|
|
|
1639
1639
|
l && a();
|
|
1640
1640
|
const b = e.getBoundingClientRect(), S = d.map((C) => ({ target: C, rects: i(C, b) }));
|
|
1641
1641
|
S.forEach(({ target: C, rects: B }) => o.set(C.annotation, B));
|
|
1642
|
-
const L = S.
|
|
1642
|
+
const L = S.flatMap(({ rects: C }) => C);
|
|
1643
1643
|
n.load(L);
|
|
1644
1644
|
}, c = (d, l) => {
|
|
1645
1645
|
const b = n.search({
|
|
@@ -1671,7 +1671,7 @@ const Cn = (t, e) => {
|
|
|
1671
1671
|
getAnnotationBounds: p,
|
|
1672
1672
|
getAnnotationRects: g,
|
|
1673
1673
|
getIntersecting: (d, l, b, S) => {
|
|
1674
|
-
const L = n.search({ minX: d, minY: l, maxX: b, maxY: S }), C = new Set(L.
|
|
1674
|
+
const L = n.search({ minX: d, minY: l, maxX: b, maxY: S }), C = new Set(L.map((B) => B.annotation.id));
|
|
1675
1675
|
return Array.from(C).map((B) => ({
|
|
1676
1676
|
annotation: t.getAnnotation(B),
|
|
1677
1677
|
rects: g(B)
|
|
@@ -1717,8 +1717,8 @@ const Cn = (t, e) => {
|
|
|
1717
1717
|
}
|
|
1718
1718
|
}, w = () => o.recalculate();
|
|
1719
1719
|
return n.observe(({ changes: y }) => {
|
|
1720
|
-
const h = (y.
|
|
1721
|
-
h.length > 0 &&
|
|
1720
|
+
const h = (y.deleted || []).filter((b) => $(b.target.selector)), d = (y.created || []).filter((b) => $(b.target.selector)), l = (y.updated || []).filter((b) => $(b.newValue.target.selector));
|
|
1721
|
+
(h == null ? void 0 : h.length) > 0 && h.forEach((b) => o.remove(b.target)), d.length > 0 && o.set(d.map((b) => b.target), !1), (l == null ? void 0 : l.length) > 0 && l.forEach(({ newValue: b }) => o.update(b.target));
|
|
1722
1722
|
}), {
|
|
1723
1723
|
store: {
|
|
1724
1724
|
...n,
|