@kopjra/pdf-sentinel 1.9.0 → 1.10.0

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.
@@ -4495,13 +4495,20 @@ function e_(d, h, u, E, w, R, x, p, b = !0) {
4495
4495
  },
4496
4496
  updateAnnotation: (A) => {
4497
4497
  if (h.current) {
4498
- A = { ...A, originalId: A.id, id: d.current[A.id] || A.id };
4498
+ A = {
4499
+ ...A,
4500
+ originalId: A.id,
4501
+ id: d.current[A.id] || A.id
4502
+ };
4499
4503
  const T = uu(A);
4500
4504
  h.current.updateAnnotation(T.pageIndex, T.id, { custom: T.custom });
4501
4505
  }
4502
4506
  },
4503
4507
  removeAnnotations: (A) => {
4504
- h.current && h.current.deleteAnnotations(A.map((T) => ({ pageIndex: T.page - 1, id: d.current[T.id] || T.id })));
4508
+ h.current && h.current.deleteAnnotations(A.map((T) => ({
4509
+ pageIndex: T.page - 1,
4510
+ id: d.current[T.id] || T.id
4511
+ })));
4505
4512
  },
4506
4513
  getAnnotationsByPage: async (A) => h.current ? (await h.current.getPageAnnotations({ pageIndex: A - 1 }).toPromise()).map((T) => Ze(T, h.current)) : [],
4507
4514
  subscribe: (A) => (u.current.add(A), () => {
@@ -4548,11 +4555,14 @@ const t_ = ns(({
4548
4555
  bn(() => (E && E(F), () => {
4549
4556
  E && E(null);
4550
4557
  }), [F, E]), bn(() => {
4551
- if (S && h.length > 0) {
4552
- const M = h.map((K) => (K.originalId = K.id, K.id = ls(), Q.current[K.originalId] = K.id, {
4553
- annotation: uu(K)
4554
- }));
4555
- S.importAnnotations(M), S.setActiveTool(cs), V(!0);
4558
+ if (S) {
4559
+ if (h.length > 0) {
4560
+ const M = h.map((K) => (K.originalId = K.id, K.id = ls(), Q.current[K.originalId] = K.id, {
4561
+ annotation: uu(K)
4562
+ }));
4563
+ S.importAnnotations(M), S.setActiveTool(cs);
4564
+ }
4565
+ V(!0);
4556
4566
  }
4557
4567
  }, []), bn(() => {
4558
4568
  if (!(!S || !F || !H || !nn))