@pdf-viewer/react 1.16.0-rc.0 → 1.16.0-rc.1
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.
- package/dist/{ToolbarLayout.module-d91e2284.js → ToolbarLayout.module-d84f99c6.js} +976 -974
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/RPProvider.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +1 -1
- package/dist/components/layout/sidebar/Thumbnail.js +1 -1
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/OtherTool.js +1 -1
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/RPMoreOptions.js +1 -1
- package/dist/components/layout/toolbar/RPToolbar.js +1 -1
- package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +1 -1
- package/dist/components/layout/toolbar/ToolbarDefault.js +1 -1
- package/dist/components/layout/toolbar/ToolbarLayout.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/InputPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/NextPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +1 -1
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +1 -1
- package/dist/components/page/AnnotationLayer.js +1 -1
- package/dist/components/page/CanvasLayer.js +1 -1
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +1 -1
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +1 -1
- package/dist/components/page/TextLayer.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/main.js +1 -1
- package/dist/types/utils/annotations.d.ts +1 -2
- package/dist/types/utils/link_service.d.ts +3 -1
- package/dist/utils/annotations.js +45 -56
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +1 -1
- package/dist/utils/hooks/usePrint.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +1 -1
- package/dist/utils/hooks/useSearch.js +1 -1
- package/dist/utils/hooks/useThumbnail.js +1 -1
- package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
- package/dist/utils/link_service.js +40 -10
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { sanitizeExternalUrl as
|
|
2
|
-
import {
|
|
3
|
-
import { dateFormatter as
|
|
1
|
+
import { sanitizeExternalUrl as _ } from "./sanitizeExternalUrl.js";
|
|
2
|
+
import { AnnotationType as l } from "./types.js";
|
|
3
|
+
import { dateFormatter as L } from "./dateFormatter.js";
|
|
4
4
|
import "../th_TH-d627cd51.js";
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const n =
|
|
8
|
-
return
|
|
5
|
+
const T = ["click", "dblclick", "input", "change"], m = /* @__PURE__ */ new Map(), v = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
6
|
+
function I(e, t) {
|
|
7
|
+
const n = v(e, t);
|
|
8
|
+
return m.has(n) ? m.get(n) ?? null : null;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
10
|
+
const x = (e, t, n) => {
|
|
11
|
+
m.set(v(e, t), n);
|
|
12
|
+
}, A = (e, t) => {
|
|
13
13
|
switch (t[1].name) {
|
|
14
14
|
case "XYZ":
|
|
15
15
|
return {
|
|
@@ -43,17 +43,17 @@ const B = (e, t, n) => {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
async function
|
|
46
|
+
async function E(e, t) {
|
|
47
47
|
let n;
|
|
48
48
|
if (typeof t == "string" ? n = await e.getDestination(t) : n = t, n && typeof n[0] == "object" && n[0] !== null) {
|
|
49
|
-
const a = n[0], s =
|
|
49
|
+
const a = n[0], s = I(e, a);
|
|
50
50
|
if (s === null) {
|
|
51
51
|
const r = await e.getPageIndex(a);
|
|
52
|
-
return
|
|
52
|
+
return x(e, a, r), await E(e, n);
|
|
53
53
|
} else
|
|
54
|
-
return
|
|
54
|
+
return A(s, n);
|
|
55
55
|
} else
|
|
56
|
-
return
|
|
56
|
+
return A(n[0], n);
|
|
57
57
|
}
|
|
58
58
|
const M = (e) => {
|
|
59
59
|
const n = e.target.parentNode;
|
|
@@ -68,7 +68,7 @@ const M = (e) => {
|
|
|
68
68
|
if (c) {
|
|
69
69
|
try {
|
|
70
70
|
const { dateObj: i } = JSON.parse(c);
|
|
71
|
-
i && (o.textContent =
|
|
71
|
+
i && (o.textContent = L(i));
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
74
|
a.disconnect();
|
|
@@ -84,43 +84,33 @@ const M = (e) => {
|
|
|
84
84
|
attributes: !0
|
|
85
85
|
// Watch for changes to attributes
|
|
86
86
|
}), () => a.disconnect();
|
|
87
|
-
}, P = (e, t, n, a) => {
|
|
88
|
-
if (e.type !== "click")
|
|
89
|
-
return;
|
|
90
|
-
const s = e.target, r = s.getAttribute("data-element-id"), o = s.getAttribute("href");
|
|
91
|
-
if (o && o !== "#")
|
|
92
|
-
return;
|
|
93
|
-
const c = t.find((i) => i.id === r);
|
|
94
|
-
!c || c.annotationType !== _.Link || c.dest && b(n, c.dest).then((i) => {
|
|
95
|
-
a(i);
|
|
96
|
-
});
|
|
97
87
|
};
|
|
98
|
-
function
|
|
99
|
-
for (const n of
|
|
88
|
+
function H(e, t) {
|
|
89
|
+
for (const n of T)
|
|
100
90
|
e.addEventListener(n, t);
|
|
101
91
|
}
|
|
102
|
-
function
|
|
103
|
-
for (const n of
|
|
92
|
+
function P(e, t) {
|
|
93
|
+
for (const n of T)
|
|
104
94
|
e.removeEventListener(n, t);
|
|
105
95
|
}
|
|
106
|
-
function
|
|
96
|
+
function U(e) {
|
|
107
97
|
const { id: t, url: n, unsafeUrl: a } = e;
|
|
108
98
|
new MutationObserver((r, o) => {
|
|
109
99
|
const c = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
110
100
|
if (c) {
|
|
111
|
-
const i = c.querySelector("a"), p =
|
|
101
|
+
const i = c.querySelector("a"), p = _((n || a) ?? "", "");
|
|
112
102
|
i && (i == null || i.setAttribute("target", "_blank"), i == null || i.setAttribute("href", p), i == null || i.setAttribute("rel", "noopener noreferrer")), o.disconnect();
|
|
113
103
|
}
|
|
114
104
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
115
105
|
}
|
|
116
|
-
function
|
|
106
|
+
function V(e, t, n) {
|
|
117
107
|
const { rotation: a, scale: s } = t, r = a % 180 === 0;
|
|
118
108
|
if (e.fieldType === "Btn" && e.pushButton) {
|
|
119
109
|
const o = e.rect[2] - e.rect[0], c = e.rect[3] - e.rect[1], i = document.createElement("canvas");
|
|
120
110
|
i.setAttribute("width", ((r ? o : c) * s).toString()), i.setAttribute("height", ((r ? c : o) * s).toString()), n.set(e.id, i);
|
|
121
111
|
}
|
|
122
112
|
}
|
|
123
|
-
function
|
|
113
|
+
function B(e) {
|
|
124
114
|
var r;
|
|
125
115
|
let t = e;
|
|
126
116
|
for (; t.tagName !== "SECTION"; )
|
|
@@ -132,14 +122,14 @@ function k(e) {
|
|
|
132
122
|
if (s || (s = (r = t.firstChild) == null ? void 0 : r.id), s && t.parentElement) {
|
|
133
123
|
const o = t.parentElement.querySelector(`[aria-controls="${s}"]`);
|
|
134
124
|
o && new MutationObserver((i, p) => {
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
if (
|
|
125
|
+
const b = document.querySelectorAll(".popupDate");
|
|
126
|
+
b.length > 0 && (b.forEach((g) => {
|
|
127
|
+
if (g.innerHTML)
|
|
138
128
|
return !1;
|
|
139
|
-
const N =
|
|
129
|
+
const N = g.getAttribute("data-l10n-args");
|
|
140
130
|
if (N) {
|
|
141
|
-
const { date:
|
|
142
|
-
|
|
131
|
+
const { date: h, time: y } = JSON.parse(N);
|
|
132
|
+
h && y && (g.textContent = `${h}, ${y}`);
|
|
143
133
|
}
|
|
144
134
|
}), p.disconnect());
|
|
145
135
|
}).observe(o, { childList: !0, subtree: !0 });
|
|
@@ -155,10 +145,10 @@ function d(e, t, n) {
|
|
|
155
145
|
function u(e, t) {
|
|
156
146
|
return { type: e, data: t };
|
|
157
147
|
}
|
|
158
|
-
async function
|
|
148
|
+
async function w(e, t) {
|
|
159
149
|
if (e.dest)
|
|
160
150
|
if (typeof e.dest == "string") {
|
|
161
|
-
const n = await
|
|
151
|
+
const n = await E(t, e.dest);
|
|
162
152
|
return u(l.INTERNAL_LINK, {
|
|
163
153
|
referencedPage: n.pageIndex,
|
|
164
154
|
offset: null
|
|
@@ -179,7 +169,7 @@ async function S(e, t) {
|
|
|
179
169
|
unsafeUrl: e.unsafeUrl
|
|
180
170
|
});
|
|
181
171
|
}
|
|
182
|
-
function
|
|
172
|
+
function O(e) {
|
|
183
173
|
for (const t of e.getElementsByTagName("span")) {
|
|
184
174
|
let n = t.textContent;
|
|
185
175
|
const a = JSON.parse(t.dataset.l10nArgs ?? "{}");
|
|
@@ -189,7 +179,7 @@ function T(e) {
|
|
|
189
179
|
t.textContent = n;
|
|
190
180
|
}
|
|
191
181
|
}
|
|
192
|
-
function
|
|
182
|
+
function S(e) {
|
|
193
183
|
return u(l.FILE_ATTACHMENT, e.file);
|
|
194
184
|
}
|
|
195
185
|
function f(e, t) {
|
|
@@ -236,27 +226,27 @@ function f(e, t) {
|
|
|
236
226
|
});
|
|
237
227
|
}
|
|
238
228
|
}
|
|
239
|
-
async function
|
|
229
|
+
async function $(e, t, n) {
|
|
240
230
|
var s;
|
|
241
231
|
let a = e.target.parentNode;
|
|
242
|
-
if (a.tagName === "DIV" && (a = a.firstChild),
|
|
232
|
+
if (a.tagName === "DIV" && (a = a.firstChild), B(a), typeof a.className != "object")
|
|
243
233
|
if (a.className === "linkAnnotation" && e.type === "click") {
|
|
244
234
|
const r = (s = a.dataset) == null ? void 0 : s.annotationId;
|
|
245
235
|
if (r) {
|
|
246
236
|
const o = d("id", r, n);
|
|
247
237
|
if (o.length)
|
|
248
|
-
return await
|
|
238
|
+
return await w(o[0], t);
|
|
249
239
|
}
|
|
250
240
|
} else if (
|
|
251
241
|
/* annotation.className.includes('popupAnnotation') || */
|
|
252
242
|
a.className.includes("textAnnotation")
|
|
253
243
|
)
|
|
254
|
-
|
|
244
|
+
O(a);
|
|
255
245
|
else if (a.className.includes("fileAttachmentAnnotation")) {
|
|
256
|
-
|
|
246
|
+
O(a);
|
|
257
247
|
const r = a.dataset.annotationId;
|
|
258
248
|
if (r && e.type === "dblclick")
|
|
259
|
-
return
|
|
249
|
+
return S(d("id", r, n)[0]);
|
|
260
250
|
} else if (a.className.includes("textWidgetAnnotation") && e.type === "input") {
|
|
261
251
|
let r = a.getElementsByTagName("input")[0];
|
|
262
252
|
return r || (r = a.getElementsByTagName("textarea")[0]), f(r);
|
|
@@ -297,11 +287,10 @@ async function W(e, t, n) {
|
|
|
297
287
|
}
|
|
298
288
|
}
|
|
299
289
|
export {
|
|
300
|
-
|
|
290
|
+
$ as annotationEventsHandler,
|
|
301
291
|
M as annotationsEvents,
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
P as
|
|
306
|
-
V as unbindLayerEvents
|
|
292
|
+
H as bindLayerEvents,
|
|
293
|
+
U as handleAnnotationLink,
|
|
294
|
+
V as handleAnnotationWidget,
|
|
295
|
+
P as unbindLayerEvents
|
|
307
296
|
};
|
|
@@ -2,7 +2,7 @@ import "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import { b as Cr } from "../../ToolbarLayout.module-
|
|
5
|
+
import { b as Cr } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as E, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as l } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2026-01-05T07:37:29.706Z"), d = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${d}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${d}`,
|
|
6
6
|
expired: `Your license key has expired. ${d}`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import "../types.js";
|
|
3
|
-
import { v as Dr } from "../../ToolbarLayout.module-
|
|
3
|
+
import { v as Dr } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
6
6
|
import "../../contexts/DocumentPasswordContext.js";
|
|
@@ -5,7 +5,7 @@ import "../calculatePage.js";
|
|
|
5
5
|
import "react/jsx-runtime";
|
|
6
6
|
import "../../contexts/RPDocumentContext.js";
|
|
7
7
|
import "../../contexts/DocumentPasswordContext.js";
|
|
8
|
-
import { Q as Co } from "../../ToolbarLayout.module-
|
|
8
|
+
import { Q as Co } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
9
9
|
import "../../contexts/DarkModeContext.js";
|
|
10
10
|
import "../../contexts/RotationContext.js";
|
|
11
11
|
import "../../contexts/LayerContext.js";
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import { x as Do } from "../../ToolbarLayout.module-
|
|
5
|
+
import { x as Do } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -3,7 +3,7 @@ import "../../contexts/ScrollModeContext.js";
|
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "../../contexts/RPDocumentContext.js";
|
|
5
5
|
import "../../contexts/DocumentPasswordContext.js";
|
|
6
|
-
import { t as Br } from "../../ToolbarLayout.module-
|
|
6
|
+
import { t as Br } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
7
7
|
import "../../contexts/DarkModeContext.js";
|
|
8
8
|
import "../types.js";
|
|
9
9
|
import "../../contexts/RotationContext.js";
|
|
@@ -7,7 +7,7 @@ import "../../contexts/RPDocumentContext.js";
|
|
|
7
7
|
import "../../contexts/ZoomContext.js";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import "../../contexts/DocumentPasswordContext.js";
|
|
10
|
-
import { B as Do } from "../../ToolbarLayout.module-
|
|
10
|
+
import { B as Do } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
11
11
|
import "../../contexts/DarkModeContext.js";
|
|
12
12
|
import "../../contexts/RotationContext.js";
|
|
13
13
|
import "../../contexts/LayerContext.js";
|
|
@@ -2,7 +2,7 @@ import "react";
|
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "../../contexts/RPDocumentContext.js";
|
|
4
4
|
import "../../contexts/DocumentPasswordContext.js";
|
|
5
|
-
import { z as Do } from "../../ToolbarLayout.module-
|
|
5
|
+
import { z as Do } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
6
6
|
import "../../contexts/DarkModeContext.js";
|
|
7
7
|
import "../../contexts/RotationContext.js";
|
|
8
8
|
import "../../contexts/LayerContext.js";
|
|
@@ -4,7 +4,7 @@ import "../../contexts/ScrollModeContext.js";
|
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
5
|
import "../../contexts/RPDocumentContext.js";
|
|
6
6
|
import "../../contexts/DocumentPasswordContext.js";
|
|
7
|
-
import { M as Ar } from "../../ToolbarLayout.module-
|
|
7
|
+
import { M as Ar } from "../../ToolbarLayout.module-d84f99c6.js";
|
|
8
8
|
import "../../contexts/DarkModeContext.js";
|
|
9
9
|
import "../../contexts/RotationContext.js";
|
|
10
10
|
import "../../contexts/LayerContext.js";
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
5
|
-
constructor() {
|
|
6
|
-
|
|
7
|
-
this
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var i = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class f {
|
|
5
|
+
constructor(e, t) {
|
|
6
|
+
i(this, "externalLinkEnabled");
|
|
7
|
+
i(this, "pdfDocument");
|
|
8
|
+
this.externalLinkEnabled = !0, this.pdfDocument = e, this.goToPage = t;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* @type {number}
|
|
11
12
|
*/
|
|
12
13
|
get pagesCount() {
|
|
13
|
-
|
|
14
|
+
var e;
|
|
15
|
+
return ((e = this.pdfDocument) == null ? void 0 : e.numPages) ?? 0;
|
|
14
16
|
}
|
|
15
17
|
/**
|
|
16
18
|
* @type {number}
|
|
@@ -44,6 +46,34 @@ class u {
|
|
|
44
46
|
* @param {string|Array} _dest - The named, or explicit, PDF destination.
|
|
45
47
|
*/
|
|
46
48
|
async goToDestination(e) {
|
|
49
|
+
var r, s, g;
|
|
50
|
+
let t, n;
|
|
51
|
+
if (typeof e == "string" ? t = await ((r = this.pdfDocument) == null ? void 0 : r.getDestination(e)) : t = await e, !Array.isArray(t)) {
|
|
52
|
+
console.error(
|
|
53
|
+
`goToDestination: "${t}" is not a valid destination array, for dest="${e}".`
|
|
54
|
+
);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const [a] = t;
|
|
58
|
+
if (a && typeof a == "object") {
|
|
59
|
+
if (n = (s = this.pdfDocument) == null ? void 0 : s.cachedPageNumber(a), !n)
|
|
60
|
+
try {
|
|
61
|
+
n = (await ((g = this.pdfDocument) == null ? void 0 : g.getPageIndex(a)) || 0) + 1;
|
|
62
|
+
} catch {
|
|
63
|
+
console.error(
|
|
64
|
+
`goToDestination: "${a}" is not a valid page reference, for dest="${e}".`
|
|
65
|
+
);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
} else
|
|
69
|
+
Number.isInteger(a) && (n = a + 1);
|
|
70
|
+
if (!n || n < 1 || n > this.pagesCount) {
|
|
71
|
+
console.error(
|
|
72
|
+
`goToDestination: "${n}" is not a valid page number, for dest="${e}".`
|
|
73
|
+
);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
this.goToPage(n);
|
|
47
77
|
}
|
|
48
78
|
/**
|
|
49
79
|
* @param {number|string} _val - The page number, or page label.
|
|
@@ -55,7 +85,7 @@ class u {
|
|
|
55
85
|
* @param {string} url
|
|
56
86
|
* @param {boolean} [_newWindow]
|
|
57
87
|
*/
|
|
58
|
-
addLinkAttributes(e, t,
|
|
88
|
+
addLinkAttributes(e, t, n = !1) {
|
|
59
89
|
}
|
|
60
90
|
/**
|
|
61
91
|
* @param _dest - The PDF destination object.
|
|
@@ -94,5 +124,5 @@ class u {
|
|
|
94
124
|
}
|
|
95
125
|
}
|
|
96
126
|
export {
|
|
97
|
-
|
|
127
|
+
f as SimpleLinkService
|
|
98
128
|
};
|
package/package.json
CHANGED