@react-pdf-kit/viewer 2.0.0-beta.9 → 2.0.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/Combination-136ff99c.js +698 -0
- package/dist/MostPageTool.module-13578ad6.js +6 -0
- package/dist/OtherTool.module-a4be5f1f.js +6 -0
- package/dist/Paginate.module-4eef00aa.js +8 -0
- package/dist/PaginationContext-9217cab4.js +201 -0
- package/dist/RPLayout.module-b4b23e29.js +14 -0
- package/dist/RPSplitter-f6acf13b.js +71 -0
- package/dist/RPToolbar.module-27d7fe77.js +10 -0
- package/dist/SearchTool.module-99f60dc7.js +16 -0
- package/dist/ToolbarLayout.module-6e339802.js +12 -0
- package/dist/ZoomTool.module-7082af8c.js +12 -0
- package/dist/assets/style.css +1 -1
- package/dist/assets/style.js +32 -30
- package/dist/components/RPController.js +81 -152
- package/dist/components/RPDropFileZone.js +1 -1
- package/dist/components/RPPages.js +1028 -122
- package/dist/components/RPProvider.js +57 -113
- package/dist/components/icons/DualPageWithCoverIcon.js +22 -0
- package/dist/components/layout/LayoutContainer.js +31 -136
- package/dist/components/layout/LayoutWrapper.js +8 -4
- package/dist/components/layout/RPDefaultLayout.js +184 -86
- package/dist/components/layout/RPLayout.js +123 -105
- package/dist/components/layout/SkipLink.js +29 -0
- package/dist/components/layout/WrapperLayout.js +1 -1
- package/dist/components/layout/sidebar/RPSidebar.js +79 -112
- package/dist/components/layout/sidebar/RPSplitter.js +6 -59
- package/dist/components/layout/sidebar/Thumbnail.js +130 -125
- package/dist/components/layout/sidebar/Thumbnails.js +56 -119
- package/dist/components/layout/toolbar/DarkModeTool.js +7 -5
- package/dist/components/layout/toolbar/DocumentDialog.js +305 -131
- package/dist/components/layout/toolbar/DocumentProperties.js +13 -10
- package/dist/components/layout/toolbar/FileDownloadTool.js +34 -124
- package/dist/components/layout/toolbar/FileUploadTool.js +9 -6
- package/dist/components/layout/toolbar/FullScreenTool.js +17 -14
- package/dist/components/layout/toolbar/MenuItem.js +11 -8
- package/dist/components/layout/toolbar/MenuSeparator.js +8 -5
- package/dist/components/layout/toolbar/MostPageTool.js +66 -125
- package/dist/components/layout/toolbar/OtherTool.js +171 -112
- package/dist/components/layout/toolbar/Paginate.js +121 -116
- package/dist/components/layout/toolbar/PrintTool.js +55 -123
- package/dist/components/layout/toolbar/RPMenuItem.js +14 -11
- package/dist/components/layout/toolbar/RPMoreOptions.js +102 -154
- package/dist/components/layout/toolbar/RPToolbar.js +90 -79
- package/dist/components/layout/toolbar/RPToolbarEnd.js +69 -88
- package/dist/components/layout/toolbar/RotateTool.js +13 -10
- package/dist/components/layout/toolbar/ScrollModeTool.js +42 -39
- package/dist/components/layout/toolbar/SearchCloseButton.js +24 -10
- package/dist/components/layout/toolbar/SearchResultNavigator.js +74 -105
- package/dist/components/layout/toolbar/SearchTool.js +245 -121
- package/dist/components/layout/toolbar/SelectionModeTool.js +9 -6
- package/dist/components/layout/toolbar/ThumbnailTool.js +15 -122
- package/dist/components/layout/toolbar/ToolbarCustom.js +75 -143
- package/dist/components/layout/toolbar/ToolbarDefault.js +135 -122
- package/dist/components/layout/toolbar/ToolbarLayout.js +86 -81
- package/dist/components/layout/toolbar/ViewModeTool.js +47 -35
- package/dist/components/layout/toolbar/ZoomTool.js +129 -119
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +18 -122
- package/dist/components/layout/toolbar/tools/DualPageTool.js +11 -129
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +202 -0
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +14 -123
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +10 -8
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +197 -0
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +21 -18
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/InputPageTool.js +52 -136
- package/dist/components/layout/toolbar/tools/LastPageTool.js +197 -0
- package/dist/components/layout/toolbar/tools/NextPageTool.js +39 -129
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +28 -118
- package/dist/components/layout/toolbar/tools/PrintTool.js +14 -123
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +18 -9
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +15 -13
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +24 -14
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +11 -129
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +16 -6
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +23 -131
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +37 -0
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +21 -18
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +23 -136
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +80 -141
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +18 -15
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +98 -105
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -123
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +17 -14
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +29 -127
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +31 -130
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +28 -17
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +63 -134
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +33 -131
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +41 -24
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +58 -37
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +44 -25
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +56 -30
- package/dist/components/page/AnnotationLayer.js +130 -125
- package/dist/components/page/CanvasLayer.js +57 -126
- package/dist/components/page/CustomElement.js +1 -1
- package/dist/components/page/DualPage.js +69 -110
- package/dist/components/page/DualPageWithCover.js +131 -0
- package/dist/components/page/RPPage.js +126 -123
- package/dist/components/page/SinglePage.js +59 -110
- package/dist/components/page/TextHighlightLayer.js +187 -129
- package/dist/components/page/TextLayer.js +186 -125
- package/dist/components/ui/Button.js +14 -12
- package/dist/components/ui/Checkbox.js +78 -70
- package/dist/components/ui/DropDown.js +11 -8
- package/dist/components/ui/Input.js +12 -11
- package/dist/components/ui/LoadingIndicator.js +34 -127
- package/dist/components/ui/PasswordModal.js +44 -30
- package/dist/components/ui/RPTooltip.js +121 -135
- package/dist/contexts/DimensionPagesContext.js +1 -1
- package/dist/contexts/DropFileZoneContext.js +1 -1
- package/dist/contexts/ElementPageContext.js +1 -1
- package/dist/contexts/EventCallbackContext.js +12 -8
- package/dist/contexts/FileInputContext.js +1 -1
- package/dist/contexts/HighlightContext.js +1 -1
- package/dist/contexts/LocalizationContext.js +1 -1
- package/dist/contexts/PagesRotateContext.js +1 -1
- package/dist/contexts/PaginationContext.js +15 -118
- package/dist/contexts/PrintContext.js +67 -131
- package/dist/contexts/RPDocumentContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +48 -118
- package/dist/contexts/RotationContext.js +1 -1
- package/dist/contexts/ScrollModeContext.js +1 -1
- package/dist/contexts/SearchContext.js +66 -112
- package/dist/contexts/SelectionModeContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +32 -131
- package/dist/contexts/ViewModeContext.js +19 -15
- package/dist/contexts/ZoomContext.js +1 -1
- package/dist/de_DE-a553b162.js +489 -0
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-61f59539.js +1198 -0
- package/dist/index-655864a7.js +27 -0
- package/dist/{index-c9a2990a.js → index-c0faa594.js} +64 -87
- package/dist/index-e3ee9457.js +150 -0
- package/dist/main.js +193 -130
- package/dist/types/components/icons/DualPageWithCoverIcon.d.ts +2 -0
- package/dist/types/components/layout/LayoutContainer.d.ts +1 -5
- package/dist/types/components/layout/LayoutWrapper.d.ts +1 -5
- package/dist/types/components/layout/SkipLink.d.ts +7 -0
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +1 -3
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -3
- package/dist/types/components/layout/toolbar/tools/DualPageWithCoverTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/FirstPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/HorizontalScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/LastPageTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/PageScrollingTool.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/VerticalScrollingTool.d.ts +3 -0
- package/dist/types/components/page/DualPageWithCover.d.ts +5 -0
- package/dist/types/components/page/RPPage.d.ts +1 -3
- package/dist/types/components/ui/Button.d.ts +1 -3
- package/dist/types/components/ui/Checkbox.d.ts +1 -0
- package/dist/types/components/ui/Input.d.ts +1 -3
- package/dist/types/components/ui/RPTooltip.d.ts +1 -3
- package/dist/types/locales/de_DE.json.d.ts +83 -0
- package/dist/types/locales/en_US.json.d.ts +2 -0
- package/dist/types/locales/it_IT.json.d.ts +2 -0
- package/dist/types/locales/pt_PT.json.d.ts +2 -0
- package/dist/types/locales/th_TH.json.d.ts +2 -0
- package/dist/types/locales/zh_CN.json.d.ts +2 -0
- package/dist/types/main.d.ts +8 -2
- package/dist/types/utils/annotations.d.ts +10 -1
- package/dist/types/utils/calculatePage.d.ts +3 -3
- package/dist/types/utils/hooks/usePresentPage.d.ts +2 -1
- package/dist/types/utils/hooks/useTextSelection.d.ts +7 -0
- package/dist/types/utils/types.d.ts +34 -3
- package/dist/types/utils/withRef.d.ts +5 -4
- package/dist/utils/annotations.js +145 -150
- package/dist/utils/calculatePage.js +17 -11
- package/dist/utils/getZoomLevel.js +9 -9
- package/dist/utils/highlight.js +139 -139
- package/dist/utils/hooks/useFileDownload.js +23 -130
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +1 -1
- package/dist/utils/hooks/useLocalization.js +12 -11
- package/dist/utils/hooks/usePageRotateContext.js +1 -1
- package/dist/utils/hooks/usePaginate.js +23 -126
- package/dist/utils/hooks/usePinch.js +1 -1
- package/dist/utils/hooks/usePresentPage.js +79 -129
- package/dist/utils/hooks/usePrint.js +175 -130
- package/dist/utils/hooks/useRotate.js +1 -1
- package/dist/utils/hooks/useScrollToPage.js +18 -121
- package/dist/utils/hooks/useSearch.js +149 -127
- package/dist/utils/hooks/useTextSelection.js +76 -0
- package/dist/utils/hooks/useThumbnail.js +50 -131
- package/dist/utils/hooks/useVirtualReactWindow.js +84 -128
- package/dist/utils/types.js +14 -13
- package/dist/utils/withRef.js +5 -5
- package/package.json +5 -4
- package/dist/LayoutWrapper-6224491f.js +0 -19
- package/dist/SearchCloseButton-08d57275.js +0 -33
- package/dist/ToolbarLayout.module-8d56d12b.js +0 -3560
- package/dist/floating-ui.react-dom-d22a10b4.js +0 -1474
- package/dist/index-3bf64864.js +0 -1886
- package/dist/th_TH-d627cd51.js +0 -398
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { sanitizeExternalUrl as
|
|
1
|
+
import { sanitizeExternalUrl as x } from "./sanitizeExternalUrl.js";
|
|
2
2
|
import { AnnotationType as l } from "./types.js";
|
|
3
|
-
import { dateFormatter as
|
|
4
|
-
import "../
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return
|
|
3
|
+
import { dateFormatter as T } from "./dateFormatter.js";
|
|
4
|
+
import "../de_DE-a553b162.js";
|
|
5
|
+
const p = ["click", "dblclick", "input", "change", "mouseover"], b = /* @__PURE__ */ new Map(), h = (e, s) => `${e.loadingTask.docId}___${s.num}R${s.gen === 0 ? "" : s.gen}`;
|
|
6
|
+
function y(e, s) {
|
|
7
|
+
const t = h(e, s);
|
|
8
|
+
return b.has(t) ? b.get(t) ?? null : null;
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
switch (
|
|
10
|
+
const O = (e, s, t) => {
|
|
11
|
+
b.set(h(e, s), t);
|
|
12
|
+
}, g = (e, s) => {
|
|
13
|
+
switch (s[1].name) {
|
|
14
14
|
case "XYZ":
|
|
15
15
|
return {
|
|
16
|
-
bottomOffset: (
|
|
17
|
-
leftOffset: (
|
|
16
|
+
bottomOffset: (t, n) => s[3] === null ? n : s[3],
|
|
17
|
+
leftOffset: (t, n) => s[2] === null ? 0 : s[2],
|
|
18
18
|
pageIndex: e,
|
|
19
|
-
scaleTo:
|
|
19
|
+
scaleTo: s[4]
|
|
20
20
|
};
|
|
21
21
|
case "Fit":
|
|
22
22
|
case "FitB":
|
|
@@ -29,7 +29,7 @@ const S = (e, t, n) => {
|
|
|
29
29
|
case "FitH":
|
|
30
30
|
case "FitBH":
|
|
31
31
|
return {
|
|
32
|
-
bottomOffset:
|
|
32
|
+
bottomOffset: s[2],
|
|
33
33
|
leftOffset: 0,
|
|
34
34
|
pageIndex: e,
|
|
35
35
|
scaleTo: 1
|
|
@@ -42,132 +42,126 @@ const S = (e, t, n) => {
|
|
|
42
42
|
scaleTo: 1
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, E = (e) => {
|
|
46
46
|
e && (() => {
|
|
47
|
-
const
|
|
47
|
+
const t = e == null ? void 0 : e.querySelectorAll(
|
|
48
48
|
'[data-l10n-id="pdfjs-annotation-date-time-string"]'
|
|
49
49
|
);
|
|
50
|
-
|
|
51
|
-
const { date:
|
|
52
|
-
|
|
50
|
+
t == null || t.forEach((n) => {
|
|
51
|
+
const { date: o, time: a, dateObj: i } = JSON.parse(n.dataset.l10nArgs ?? "{}");
|
|
52
|
+
o && a ? n.textContent = `${o}, ${a}` : i && (n.textContent = T(i));
|
|
53
53
|
});
|
|
54
54
|
})();
|
|
55
55
|
};
|
|
56
|
-
async function
|
|
57
|
-
let
|
|
58
|
-
if (typeof
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
return
|
|
56
|
+
async function N(e, s) {
|
|
57
|
+
let t;
|
|
58
|
+
if (typeof s == "string" ? t = await e.getDestination(s) : t = s, t && typeof t[0] == "object" && t[0] !== null) {
|
|
59
|
+
const n = t[0], o = y(e, n);
|
|
60
|
+
if (o === null) {
|
|
61
|
+
const a = await e.getPageIndex(n);
|
|
62
|
+
return O(e, n, a), await N(e, t);
|
|
63
63
|
} else
|
|
64
|
-
return
|
|
64
|
+
return g(o, t);
|
|
65
65
|
} else
|
|
66
|
-
return
|
|
66
|
+
return g(t[0], t);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
for (const
|
|
70
|
-
e.addEventListener(
|
|
68
|
+
function L(e, s) {
|
|
69
|
+
for (const t of p)
|
|
70
|
+
e.addEventListener(t, s);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
for (const
|
|
74
|
-
e.removeEventListener(
|
|
72
|
+
function C(e, s) {
|
|
73
|
+
for (const t of p)
|
|
74
|
+
e.removeEventListener(t, s);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const { id:
|
|
78
|
-
new MutationObserver((
|
|
79
|
-
const c = document.querySelector(`[data-annotation-id="${
|
|
76
|
+
function R(e) {
|
|
77
|
+
const { id: s, url: t, unsafeUrl: n } = e;
|
|
78
|
+
new MutationObserver((a, i) => {
|
|
79
|
+
const c = document.querySelector(`[data-annotation-id="${s}"]`);
|
|
80
80
|
if (c) {
|
|
81
|
-
const r = c.querySelector("a"),
|
|
82
|
-
r && (r == null || r.setAttribute("target", "_blank"), r == null || r.setAttribute("href",
|
|
81
|
+
const r = c.querySelector("a"), A = x((t || n) ?? "", "");
|
|
82
|
+
r && (r == null || r.setAttribute("target", "_blank"), r == null || r.setAttribute("href", A), r == null || r.setAttribute("rel", "noopener noreferrer")), i.disconnect();
|
|
83
83
|
}
|
|
84
84
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
const { rotation:
|
|
86
|
+
function F(e, s, t) {
|
|
87
|
+
const { rotation: n, scale: o } = s, a = n % 180 === 0;
|
|
88
88
|
if (e.fieldType === "Btn" && e.pushButton) {
|
|
89
89
|
const i = e.rect[2] - e.rect[0], c = e.rect[3] - e.rect[1], r = document.createElement("canvas");
|
|
90
|
-
r.setAttribute("width", ((
|
|
90
|
+
r.setAttribute("width", ((a ? i : c) * o).toString()), r.setAttribute("height", ((a ? c : i) * o).toString()), t.set(e.id, r);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (h && O)
|
|
113
|
-
m.textContent = `${h}, ${O}`;
|
|
114
|
-
else if (A) {
|
|
115
|
-
const _ = new Date(A);
|
|
116
|
-
m.textContent = _.toLocaleString();
|
|
117
|
-
}
|
|
93
|
+
function S(e) {
|
|
94
|
+
e.querySelectorAll("[tabindex]").forEach((t) => {
|
|
95
|
+
const n = t.getAttribute("tabindex");
|
|
96
|
+
n && parseInt(n, 10) > 0 && (t.tagName === "A" || t.tagName === "BUTTON" || t.getAttribute("role") === "button" || t.getAttribute("role") === "link" || t.classList.contains("linkAnnotation") ? t.setAttribute("tabindex", "0") : t.removeAttribute("tabindex"));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function U(e) {
|
|
100
|
+
e.querySelectorAll("a").forEach((t) => {
|
|
101
|
+
const n = t.textContent && t.textContent.trim().length > 0, o = t.getAttribute("aria-label");
|
|
102
|
+
if (!n && !o) {
|
|
103
|
+
const a = t.getAttribute("href") || "";
|
|
104
|
+
let i;
|
|
105
|
+
if (!a || a.startsWith("#") || a.startsWith("javascript:"))
|
|
106
|
+
i = "Link to page in document";
|
|
107
|
+
else
|
|
108
|
+
try {
|
|
109
|
+
i = `External link to ${new URL(a, window.location.href).hostname.replace("www.", "")}`;
|
|
110
|
+
} catch {
|
|
111
|
+
i = "External link";
|
|
118
112
|
}
|
|
119
|
-
|
|
120
|
-
}
|
|
121
|
-
}
|
|
113
|
+
t.setAttribute("aria-label", i);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
122
116
|
}
|
|
123
|
-
function d(e,
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
for (const
|
|
127
|
-
|
|
128
|
-
return
|
|
117
|
+
function d(e, s, t) {
|
|
118
|
+
const n = [];
|
|
119
|
+
if (t)
|
|
120
|
+
for (const o of t)
|
|
121
|
+
o[e] === s && n.push(o);
|
|
122
|
+
return n;
|
|
129
123
|
}
|
|
130
|
-
function u(e,
|
|
131
|
-
return { type: e, data:
|
|
124
|
+
function u(e, s) {
|
|
125
|
+
return { type: e, data: s };
|
|
132
126
|
}
|
|
133
|
-
async function
|
|
127
|
+
async function I(e, s) {
|
|
134
128
|
if (e.dest)
|
|
135
129
|
if (typeof e.dest == "string") {
|
|
136
|
-
const
|
|
130
|
+
const t = await N(s, e.dest);
|
|
137
131
|
return u(l.INTERNAL_LINK, {
|
|
138
|
-
referencedPage:
|
|
132
|
+
referencedPage: t.pageIndex,
|
|
139
133
|
offset: null
|
|
140
134
|
});
|
|
141
135
|
} else {
|
|
142
|
-
const
|
|
136
|
+
const t = await s.getPageIndex(e.dest[0]);
|
|
143
137
|
return u(l.INTERNAL_LINK, {
|
|
144
|
-
referencedPage:
|
|
138
|
+
referencedPage: t,
|
|
145
139
|
offset: {
|
|
146
140
|
left: e.dest[2],
|
|
147
141
|
bottom: e.dest[3]
|
|
148
142
|
}
|
|
149
143
|
});
|
|
150
144
|
}
|
|
151
|
-
else if (e.url)
|
|
145
|
+
else if (e.url || e.unsafeUrl)
|
|
152
146
|
return u(l.LINK, {
|
|
153
|
-
url: e.url,
|
|
147
|
+
url: e.url ?? e.unsafeUrl,
|
|
154
148
|
unsafeUrl: e.unsafeUrl
|
|
155
149
|
});
|
|
156
150
|
}
|
|
157
|
-
function
|
|
158
|
-
for (const
|
|
159
|
-
let
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
for (const
|
|
163
|
-
|
|
164
|
-
|
|
151
|
+
function m(e) {
|
|
152
|
+
for (const s of e.getElementsByTagName("span")) {
|
|
153
|
+
let t = s.textContent;
|
|
154
|
+
const n = JSON.parse(s.dataset.l10nArgs ?? "{}");
|
|
155
|
+
if (t)
|
|
156
|
+
for (const o in n)
|
|
157
|
+
t = t.replace(`{{${o}}}`, n[o]);
|
|
158
|
+
s.textContent = t;
|
|
165
159
|
}
|
|
166
160
|
}
|
|
167
|
-
function
|
|
161
|
+
function v(e) {
|
|
168
162
|
return u(l.FILE_ATTACHMENT, e.file);
|
|
169
163
|
}
|
|
170
|
-
function f(e,
|
|
164
|
+
function f(e, s) {
|
|
171
165
|
switch (e.type) {
|
|
172
166
|
case "textarea":
|
|
173
167
|
case "text":
|
|
@@ -177,22 +171,22 @@ function f(e, t) {
|
|
|
177
171
|
});
|
|
178
172
|
case "select-one":
|
|
179
173
|
case "select-multiple":
|
|
174
|
+
const t = [];
|
|
175
|
+
for (const o of e.options)
|
|
176
|
+
t.push({
|
|
177
|
+
value: o.value,
|
|
178
|
+
label: o.label
|
|
179
|
+
});
|
|
180
180
|
const n = [];
|
|
181
|
-
for (const
|
|
181
|
+
for (const o of e.selectedOptions)
|
|
182
182
|
n.push({
|
|
183
|
-
value:
|
|
184
|
-
label:
|
|
185
|
-
});
|
|
186
|
-
const s = [];
|
|
187
|
-
for (const a of e.selectedOptions)
|
|
188
|
-
s.push({
|
|
189
|
-
value: a.value,
|
|
190
|
-
label: a.label
|
|
183
|
+
value: o.value,
|
|
184
|
+
label: o.label
|
|
191
185
|
});
|
|
192
186
|
return u(l.FORM_SELECT, {
|
|
193
187
|
fieldName: e.name,
|
|
194
|
-
value:
|
|
195
|
-
options:
|
|
188
|
+
value: n,
|
|
189
|
+
options: t
|
|
196
190
|
});
|
|
197
191
|
case "checkbox":
|
|
198
192
|
return u(l.FORM_CHECKBOX, {
|
|
@@ -202,64 +196,64 @@ function f(e, t) {
|
|
|
202
196
|
case "radio":
|
|
203
197
|
return u(l.FORM_RADIO, {
|
|
204
198
|
fieldName: e.name,
|
|
205
|
-
...
|
|
199
|
+
...s
|
|
206
200
|
});
|
|
207
201
|
case "button":
|
|
208
202
|
return u(l.FORM_BUTTON, {
|
|
209
203
|
fieldName: e.name,
|
|
210
|
-
...
|
|
204
|
+
...s
|
|
211
205
|
});
|
|
212
206
|
}
|
|
213
207
|
}
|
|
214
|
-
async function
|
|
215
|
-
var
|
|
216
|
-
let
|
|
217
|
-
if (
|
|
218
|
-
if (
|
|
219
|
-
const
|
|
220
|
-
if (
|
|
221
|
-
const i = d("id",
|
|
208
|
+
async function W(e, s, t) {
|
|
209
|
+
var o;
|
|
210
|
+
let n = e.target.parentNode;
|
|
211
|
+
if (n.tagName === "DIV" && (n = n.firstChild), typeof n.className != "object")
|
|
212
|
+
if (n.className === "linkAnnotation" && e.type === "click") {
|
|
213
|
+
const a = (o = n.dataset) == null ? void 0 : o.annotationId;
|
|
214
|
+
if (a) {
|
|
215
|
+
const i = d("id", a, t);
|
|
222
216
|
if (i.length)
|
|
223
|
-
return await
|
|
217
|
+
return await I(i[0], s);
|
|
224
218
|
}
|
|
225
219
|
} else if (
|
|
226
220
|
/* annotation.className.includes('popupAnnotation') || */
|
|
227
|
-
|
|
221
|
+
n.className.includes("textAnnotation")
|
|
228
222
|
)
|
|
229
|
-
|
|
230
|
-
else if (
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
if (
|
|
234
|
-
return
|
|
235
|
-
} else if (
|
|
236
|
-
let
|
|
237
|
-
return
|
|
223
|
+
m(n);
|
|
224
|
+
else if (n.className.includes("fileAttachmentAnnotation")) {
|
|
225
|
+
m(n);
|
|
226
|
+
const a = n.dataset.annotationId;
|
|
227
|
+
if (a && e.type === "dblclick")
|
|
228
|
+
return v(d("id", a, t)[0]);
|
|
229
|
+
} else if (n.className.includes("textWidgetAnnotation") && e.type === "input") {
|
|
230
|
+
let a = n.getElementsByTagName("input")[0];
|
|
231
|
+
return a || (a = n.getElementsByTagName("textarea")[0]), f(a);
|
|
238
232
|
} else {
|
|
239
|
-
if (
|
|
240
|
-
return f(
|
|
241
|
-
if (
|
|
242
|
-
return f(
|
|
243
|
-
if (
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const i = d("id",
|
|
233
|
+
if (n.className.includes("choiceWidgetAnnotation") && e.type === "input")
|
|
234
|
+
return f(n.getElementsByTagName("select")[0]);
|
|
235
|
+
if (n.className.includes("buttonWidgetAnnotation checkBox") && e.type === "change")
|
|
236
|
+
return f(n.getElementsByTagName("input")[0]);
|
|
237
|
+
if (n.className.includes("buttonWidgetAnnotation radioButton") && e.type === "change") {
|
|
238
|
+
const a = n.dataset.annotationId;
|
|
239
|
+
if (a) {
|
|
240
|
+
const i = d("id", a, t)[0], c = [];
|
|
247
241
|
for (const r of d(
|
|
248
242
|
"fieldName",
|
|
249
243
|
i.fieldName,
|
|
250
|
-
|
|
244
|
+
t
|
|
251
245
|
))
|
|
252
246
|
r.buttonValue && c.push(r.buttonValue);
|
|
253
|
-
return f(
|
|
247
|
+
return f(n.getElementsByTagName("input")[0], {
|
|
254
248
|
value: i.buttonValue,
|
|
255
249
|
defaultValue: i.fieldValue,
|
|
256
250
|
options: c
|
|
257
251
|
});
|
|
258
252
|
}
|
|
259
|
-
} else if (
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
const i = d("id",
|
|
253
|
+
} else if (n.className.includes("buttonWidgetAnnotation pushButton") && e.type === "click") {
|
|
254
|
+
const a = n.dataset.annotationId;
|
|
255
|
+
if (a) {
|
|
256
|
+
const i = d("id", a, t)[0], { action: c } = i;
|
|
263
257
|
return c && ["Print", "SaveAs"].includes(c) ? { type: l.BUTTON, data: i } : i.resetForm ? f(
|
|
264
258
|
{ name: i.fieldName, type: "button" },
|
|
265
259
|
{ actions: i.actions, reset: !0 }
|
|
@@ -272,11 +266,12 @@ async function j(e, t, n) {
|
|
|
272
266
|
}
|
|
273
267
|
}
|
|
274
268
|
export {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
269
|
+
W as annotationEventsHandler,
|
|
270
|
+
L as bindLayerEvents,
|
|
271
|
+
U as enhanceLinkAccessibility,
|
|
272
|
+
S as fixTabIndexAccessibility,
|
|
273
|
+
R as handleAnnotationLink,
|
|
274
|
+
F as handleAnnotationWidget,
|
|
275
|
+
E as insertDateText,
|
|
276
|
+
C as unbindLayerEvents
|
|
282
277
|
};
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
const d = (e,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const d = (o, e, s, t = !1) => t ? o === 0 ? e === 0 ? 1 : -1 : 1 + (o - 1) * s + e + 1 : o * s + e + 1, g = (o, e, s = !1) => {
|
|
2
|
+
if (s) {
|
|
3
|
+
if (o === 1)
|
|
4
|
+
return { rowIndex: 0, columnIndex: 0 };
|
|
5
|
+
const n = o - 1 - 1, f = Math.floor(n / e) + 1, i = n % e;
|
|
6
|
+
return { rowIndex: f, columnIndex: i };
|
|
7
|
+
}
|
|
8
|
+
const t = o - 1, r = Math.floor(t / e), c = (t - r * e) % e;
|
|
9
|
+
return { rowIndex: r, columnIndex: c };
|
|
10
|
+
}, x = (o, e, s = !1) => {
|
|
11
|
+
const t = [], r = [];
|
|
12
|
+
return o.heights.forEach((c, a) => {
|
|
13
|
+
const n = g(a + 1, e, s), f = o.widths[a];
|
|
14
|
+
t[n.rowIndex] = Math.max(t[n.rowIndex] || 0, c), r[n.columnIndex] = Math.max(r[n.columnIndex] || 0, f);
|
|
15
|
+
}), { rowsHeight: t, columnsWidth: r };
|
|
10
16
|
};
|
|
11
17
|
export {
|
|
12
|
-
|
|
18
|
+
x as getGridDimension,
|
|
13
19
|
d as getPageFromPosition,
|
|
14
|
-
|
|
20
|
+
g as getPositionFromPage
|
|
15
21
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { SCROLL_BAR_WIDTH as
|
|
2
|
-
import { ViewMode as
|
|
3
|
-
import "../
|
|
4
|
-
const
|
|
1
|
+
import { SCROLL_BAR_WIDTH as a, PAGE_PADDING as f } from "./constants.js";
|
|
2
|
+
import { ViewMode as A, ZoomLevel as r } from "./types.js";
|
|
3
|
+
import "../de_DE-a553b162.js";
|
|
4
|
+
const E = (o, t, _, e, c, m) => {
|
|
5
5
|
if (typeof o == "number")
|
|
6
6
|
return o;
|
|
7
|
-
const
|
|
7
|
+
const n = m === A.DUAL_PAGE || m === A.DUAL_PAGE_WITH_COVER ? 2 * e : e;
|
|
8
8
|
switch (o) {
|
|
9
9
|
case r.PAGE_FIT:
|
|
10
10
|
const s = Math.min(
|
|
11
|
-
(t -
|
|
12
|
-
(
|
|
11
|
+
(t - a) / n,
|
|
12
|
+
(_ - f) / c
|
|
13
13
|
);
|
|
14
14
|
return Math.floor(s * 100);
|
|
15
15
|
case r.PAGE_WIDTH:
|
|
16
|
-
return Math.floor((t -
|
|
16
|
+
return Math.floor((t - a) / n * 100);
|
|
17
17
|
case r.ACTUAL:
|
|
18
18
|
default:
|
|
19
19
|
return 100;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
23
|
-
|
|
23
|
+
E as getZoomLevel
|
|
24
24
|
};
|