@pdf-viewer/react 1.15.0-beta.4 → 1.15.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-533a6d5a.js → ToolbarLayout.module-e3f86395.js} +990 -1034
- package/dist/components/RPController.js +7 -6
- package/dist/components/RPPages.js +6 -5
- package/dist/components/RPProvider.js +7 -6
- package/dist/components/layout/LayoutContainer.js +6 -5
- package/dist/components/layout/RPDefaultLayout.js +6 -5
- package/dist/components/layout/RPLayout.js +7 -6
- package/dist/components/layout/sidebar/RPSidebar.js +6 -5
- package/dist/components/layout/sidebar/Thumbnail.js +6 -5
- package/dist/components/layout/sidebar/Thumbnails.js +6 -5
- package/dist/components/layout/toolbar/DarkModeTool.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +6 -5
- package/dist/components/layout/toolbar/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/FileDownloadTool.js +6 -5
- package/dist/components/layout/toolbar/FileUploadTool.js +3 -3
- package/dist/components/layout/toolbar/FullScreenTool.js +3 -3
- package/dist/components/layout/toolbar/MenuItem.js +3 -3
- package/dist/components/layout/toolbar/MenuSeparator.js +3 -3
- package/dist/components/layout/toolbar/MostPageTool.js +6 -5
- package/dist/components/layout/toolbar/OtherTool.js +6 -5
- package/dist/components/layout/toolbar/Paginate.js +6 -5
- package/dist/components/layout/toolbar/PrintTool.js +6 -5
- package/dist/components/layout/toolbar/RPMenuItem.js +3 -3
- package/dist/components/layout/toolbar/RPMoreOptions.js +7 -6
- package/dist/components/layout/toolbar/RPToolbar.js +6 -5
- package/dist/components/layout/toolbar/RPToolbarEnd.js +6 -5
- package/dist/components/layout/toolbar/RotateTool.js +3 -3
- package/dist/components/layout/toolbar/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/SearchCloseButton.js +2 -2
- package/dist/components/layout/toolbar/SearchResultNavigator.js +6 -5
- package/dist/components/layout/toolbar/SearchTool.js +6 -5
- package/dist/components/layout/toolbar/SelectionModeTool.js +3 -3
- package/dist/components/layout/toolbar/ThumbnailTool.js +7 -6
- package/dist/components/layout/toolbar/ToolbarCustom.js +7 -6
- package/dist/components/layout/toolbar/ToolbarDefault.js +7 -6
- package/dist/components/layout/toolbar/ToolbarLayout.js +7 -6
- package/dist/components/layout/toolbar/ViewModeTool.js +3 -3
- package/dist/components/layout/toolbar/ZoomTool.js +6 -5
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +7 -6
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +7 -6
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -6
- package/dist/components/layout/toolbar/tools/NextPageTool.js +7 -6
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +7 -6
- package/dist/components/layout/toolbar/tools/PrintTool.js +7 -6
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +2 -2
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +7 -6
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelDisplay.js +6 -5
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +7 -6
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +2 -2
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +7 -6
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +7 -6
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +7 -6
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +7 -6
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +7 -6
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +7 -6
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +3 -3
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +3 -3
- package/dist/components/page/AnnotationLayer.js +6 -5
- package/dist/components/page/CanvasLayer.js +6 -5
- package/dist/components/page/DualPage.js +6 -5
- package/dist/components/page/RPPage.js +6 -5
- package/dist/components/page/SinglePage.js +6 -5
- package/dist/components/page/TextHighlightLayer.js +6 -5
- package/dist/components/page/TextLayer.js +6 -5
- package/dist/components/ui/Checkbox.js +1 -1
- package/dist/components/ui/DropDown.js +3 -3
- package/dist/components/ui/LoadingIndicator.js +6 -5
- package/dist/components/ui/RPTooltip.js +415 -201
- package/dist/contexts/PaginationContext.js +8 -7
- package/dist/contexts/PrintContext.js +8 -7
- package/dist/contexts/RenderQueueProvider.js +8 -7
- package/dist/contexts/SearchContext.js +8 -7
- package/dist/contexts/ThumbnailsContext.js +8 -7
- package/dist/floating-ui.react-dom-6b2fe0df.js +1474 -0
- package/dist/{index-c9a2990a.js → index-35c7f4a2.js} +3 -3
- package/dist/index-f563c6f0.js +1889 -0
- package/dist/main.js +91 -90
- package/dist/types/utils/hooks/useCopyText.d.ts +1 -0
- package/dist/utils/annotations.js +108 -116
- package/dist/utils/hooks/useCopyText.js +36 -0
- package/dist/utils/hooks/useFileDownload.js +6 -5
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePaginate.js +6 -5
- package/dist/utils/hooks/usePresentPage.js +6 -5
- package/dist/utils/hooks/usePrint.js +6 -5
- package/dist/utils/hooks/useScrollToPage.js +6 -5
- package/dist/utils/hooks/useSearch.js +6 -5
- package/dist/utils/hooks/useThumbnail.js +6 -5
- package/dist/utils/hooks/useVirtualReactWindow.js +6 -5
- package/package.json +1 -1
- package/dist/index-808ea7bf.js +0 -1685
- package/dist/index-a48ec088.js +0 -1672
package/dist/main.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { RPProvider as
|
|
2
|
-
import { a as
|
|
3
|
-
import { RPConfig as
|
|
4
|
-
import { RPLayout as
|
|
5
|
-
import { RPController as
|
|
6
|
-
import { RPTheme as
|
|
7
|
-
import { RPDropFileZone as
|
|
8
|
-
import { useDarkModeContext as
|
|
9
|
-
import { useDocumentContext as
|
|
10
|
-
import { useRotationContext as
|
|
11
|
-
import { useViewModeContext as
|
|
12
|
-
import { useDropFileZoneContext as
|
|
13
|
-
import { useOpenFileContext as
|
|
14
|
-
import { useZoomContext as
|
|
15
|
-
import { useHighlightContext as
|
|
16
|
-
import { usePdfProperties as
|
|
17
|
-
import { useFullScreenContext as
|
|
18
|
-
import { usePageRotateContext as
|
|
19
|
-
import { useElementPageContext as
|
|
20
|
-
import { ThemeSwitcherTool as
|
|
21
|
-
import { ThumbnailTool as
|
|
22
|
-
import { FileUploadTool as
|
|
23
|
-
import { FileDownloadTool as
|
|
24
|
-
import { PrintTool as
|
|
25
|
-
import { FullScreenTool as
|
|
26
|
-
import { PreviousPageTool as
|
|
27
|
-
import { NextPageTool as
|
|
28
|
-
import { InputPageTool as
|
|
29
|
-
import { ZoomInTool as
|
|
30
|
-
import { ZoomOutTool as
|
|
31
|
-
import { ZoomLevelTool as
|
|
32
|
-
import { DocumentPropertiesTool as
|
|
33
|
-
import { RotateClockwiseTool as
|
|
34
|
-
import { RotateCounterclockwiseTool as
|
|
35
|
-
import { RPHorizontalBar as
|
|
36
|
-
import { RPVerticalBar as
|
|
37
|
-
import { SelectionModeSwitcherTool as
|
|
38
|
-
import { Locales as
|
|
1
|
+
import { RPProvider as Lr } from "./components/RPProvider.js";
|
|
2
|
+
import { a as Vr, R as br, S as kr, b as yr, u as Br, c as Hr, d as Ir } from "./ToolbarLayout.module-e3f86395.js";
|
|
3
|
+
import { RPConfig as zr } from "./components/RPConfig.js";
|
|
4
|
+
import { RPLayout as Nr } from "./components/layout/RPLayout.js";
|
|
5
|
+
import { RPController as jr } from "./components/RPController.js";
|
|
6
|
+
import { RPTheme as Ar } from "./components/RPTheme.js";
|
|
7
|
+
import { RPDropFileZone as Jr } from "./components/RPDropFileZone.js";
|
|
8
|
+
import { useDarkModeContext as Qr } from "./contexts/DarkModeContext.js";
|
|
9
|
+
import { useDocumentContext as Xr } from "./contexts/RPDocumentContext.js";
|
|
10
|
+
import { useRotationContext as _r } from "./contexts/RotationContext.js";
|
|
11
|
+
import { useViewModeContext as ot } from "./contexts/ViewModeContext.js";
|
|
12
|
+
import { useDropFileZoneContext as tt } from "./contexts/DropFileZoneContext.js";
|
|
13
|
+
import { useOpenFileContext as pt } from "./contexts/FileInputContext.js";
|
|
14
|
+
import { useZoomContext as et } from "./contexts/ZoomContext.js";
|
|
15
|
+
import { useHighlightContext as lt } from "./contexts/HighlightContext.js";
|
|
16
|
+
import { usePdfProperties as nt } from "./utils/hooks/usePdfProperties.js";
|
|
17
|
+
import { useFullScreenContext as st } from "./contexts/FullScreenContext.js";
|
|
18
|
+
import { usePageRotateContext as Pt } from "./utils/hooks/usePageRotateContext.js";
|
|
19
|
+
import { useElementPageContext as Ct } from "./contexts/ElementPageContext.js";
|
|
20
|
+
import { ThemeSwitcherTool as Rt } from "./components/layout/toolbar/tools/ThemeSwitcherTool.js";
|
|
21
|
+
import { ThumbnailTool as gt } from "./components/layout/toolbar/tools/ThumbnailTool.js";
|
|
22
|
+
import { FileUploadTool as St } from "./components/layout/toolbar/tools/FileUploadTool.js";
|
|
23
|
+
import { FileDownloadTool as Dt } from "./components/layout/toolbar/tools/FileDownloadTool.js";
|
|
24
|
+
import { PrintTool as Zt } from "./components/layout/toolbar/tools/PrintTool.js";
|
|
25
|
+
import { FullScreenTool as Lt } from "./components/layout/toolbar/tools/FullScreenTool.js";
|
|
26
|
+
import { PreviousPageTool as Vt } from "./components/layout/toolbar/tools/PreviousPageTool.js";
|
|
27
|
+
import { NextPageTool as kt } from "./components/layout/toolbar/tools/NextPageTool.js";
|
|
28
|
+
import { InputPageTool as Bt } from "./components/layout/toolbar/tools/InputPageTool.js";
|
|
29
|
+
import { ZoomInTool as It } from "./components/layout/toolbar/tools/ZoomInTool.js";
|
|
30
|
+
import { ZoomOutTool as zt } from "./components/layout/toolbar/tools/ZoomOutTool.js";
|
|
31
|
+
import { ZoomLevelTool as Nt } from "./components/layout/toolbar/tools/ZoomLevelTool.js";
|
|
32
|
+
import { DocumentPropertiesTool as jt } from "./components/layout/toolbar/tools/DocumentPropertiesTool.js";
|
|
33
|
+
import { RotateClockwiseTool as At } from "./components/layout/toolbar/tools/RotateClockwiseTool.js";
|
|
34
|
+
import { RotateCounterclockwiseTool as Jt } from "./components/layout/toolbar/tools/RotateCounterclockwiseTool.js";
|
|
35
|
+
import { RPHorizontalBar as Qt } from "./components/layout/toolbar/tools/defaults/RPHorizontalBar.js";
|
|
36
|
+
import { RPVerticalBar as Xt } from "./components/layout/toolbar/tools/defaults/RPVerticalBar.js";
|
|
37
|
+
import { SelectionModeSwitcherTool as _t } from "./components/layout/toolbar/tools/SelectionModeSwitcherTool.js";
|
|
38
|
+
import { Locales as om, ScrollMode as rm, SelectionMode as tm, ThemeVariables as mm, ViewMode as pm, ZoomLevel as im } from "./utils/types.js";
|
|
39
39
|
import "react/jsx-runtime";
|
|
40
40
|
import "react";
|
|
41
41
|
import "./contexts/DocumentPasswordContext.js";
|
|
@@ -89,15 +89,15 @@ import "./components/layout/WrapperLayout.js";
|
|
|
89
89
|
import "./LayoutWrapper-6224491f.js";
|
|
90
90
|
import "./SearchCloseButton-08d57275.js";
|
|
91
91
|
import "./components/ui/RPTooltip.js";
|
|
92
|
-
import "./index-
|
|
92
|
+
import "./index-35c7f4a2.js";
|
|
93
93
|
import "react-dom";
|
|
94
|
-
import "./
|
|
94
|
+
import "./floating-ui.react-dom-6b2fe0df.js";
|
|
95
95
|
import "./components/icons/CloseIcon.js";
|
|
96
96
|
import "./components/ui/Checkbox.js";
|
|
97
97
|
import "./components/icons/CheckIcon.js";
|
|
98
98
|
import "./contexts/IconContext.js";
|
|
99
99
|
import "./components/ui/DropDown.js";
|
|
100
|
-
import "./index-
|
|
100
|
+
import "./index-f563c6f0.js";
|
|
101
101
|
import "./components/layout/toolbar/MenuItem.js";
|
|
102
102
|
import "./components/layout/toolbar/MenuSeparator.js";
|
|
103
103
|
import "./utils/dateFormatter.js";
|
|
@@ -116,6 +116,7 @@ import "./utils/hooks/useGrabScroll.js";
|
|
|
116
116
|
import "./utils/hooks/usePinch.js";
|
|
117
117
|
import "./utils/hooks/useDebounce.js";
|
|
118
118
|
import "./components/ui/PasswordModal.js";
|
|
119
|
+
import "./utils/hooks/useCopyText.js";
|
|
119
120
|
import "./utils/getScrollDistance.js";
|
|
120
121
|
import "./utils/getWordPositionInPage.js";
|
|
121
122
|
import "./utils/getThumbnailViewport.js";
|
|
@@ -169,53 +170,53 @@ import "./utils/getElementPositionInPage.js";
|
|
|
169
170
|
import "./components/icons/ChevronDownIcon.js";
|
|
170
171
|
import "./components/layout/toolbar/ThumbnailTool.js";
|
|
171
172
|
export {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
173
|
+
jt as DocumentPropertiesTool,
|
|
174
|
+
Dt as FileDownloadTool,
|
|
175
|
+
St as FileUploadTool,
|
|
176
|
+
Lt as FullScreenTool,
|
|
177
|
+
Bt as InputPageTool,
|
|
178
|
+
om as Locales,
|
|
179
|
+
kt as NextPageTool,
|
|
180
|
+
Vt as PreviousPageTool,
|
|
181
|
+
Zt as PrintTool,
|
|
182
|
+
zr as RPConfig,
|
|
183
|
+
jr as RPController,
|
|
184
|
+
Vr as RPDefaultLayout,
|
|
185
|
+
Jr as RPDropFileZone,
|
|
186
|
+
Qt as RPHorizontalBar,
|
|
187
|
+
Nr as RPLayout,
|
|
188
|
+
br as RPPages,
|
|
189
|
+
Lr as RPProvider,
|
|
190
|
+
Ar as RPTheme,
|
|
191
|
+
Xt as RPVerticalBar,
|
|
192
|
+
At as RotateClockwiseTool,
|
|
193
|
+
Jt as RotateCounterclockwiseTool,
|
|
194
|
+
rm as ScrollMode,
|
|
195
|
+
kr as SearchTool,
|
|
196
|
+
tm as SelectionMode,
|
|
197
|
+
_t as SelectionModeSwitcherTool,
|
|
198
|
+
Rt as ThemeSwitcherTool,
|
|
199
|
+
mm as ThemeVariables,
|
|
200
|
+
gt as ThumbnailTool,
|
|
201
|
+
pm as ViewMode,
|
|
202
|
+
It as ZoomInTool,
|
|
203
|
+
im as ZoomLevel,
|
|
204
|
+
Nt as ZoomLevelTool,
|
|
205
|
+
zt as ZoomOutTool,
|
|
206
|
+
Qr as useDarkModeContext,
|
|
207
|
+
Xr as useDocumentContext,
|
|
208
|
+
tt as useDropFileZoneContext,
|
|
209
|
+
Ct as useElementPageContext,
|
|
210
|
+
yr as useFileDownload,
|
|
211
|
+
st as useFullScreenContext,
|
|
212
|
+
lt as useHighlightContext,
|
|
213
|
+
pt as useOpenFileContext,
|
|
214
|
+
Pt as usePageRotateContext,
|
|
215
|
+
Br as usePaginationContext,
|
|
216
|
+
nt as usePdfProperties,
|
|
217
|
+
Hr as usePrintContext,
|
|
218
|
+
_r as useRotationContext,
|
|
219
|
+
Ir as useSearchContext,
|
|
220
|
+
ot as useViewModeContext,
|
|
221
|
+
et as useZoomContext
|
|
221
222
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useCopyText: (container: HTMLElement | null) => void;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { sanitizeExternalUrl as
|
|
2
|
-
import { AnnotationSubType as
|
|
1
|
+
import { sanitizeExternalUrl as L } from "./sanitizeExternalUrl.js";
|
|
2
|
+
import { AnnotationSubType as _, AnnotationType as l } from "./types.js";
|
|
3
3
|
import { dateFormatter as I } from "./dateFormatter.js";
|
|
4
4
|
import "../th_TH-d627cd51.js";
|
|
5
|
-
const v = ["click", "dblclick", "input", "change"],
|
|
5
|
+
const v = ["click", "dblclick", "input", "change"], g = /* @__PURE__ */ new Map(), E = (e, t) => `${e.loadingTask.docId}___${t.num}R${t.gen === 0 ? "" : t.gen}`;
|
|
6
6
|
function x(e, t) {
|
|
7
|
-
const n =
|
|
8
|
-
return
|
|
7
|
+
const n = E(e, t);
|
|
8
|
+
return g.has(n) ? g.get(n) ?? null : null;
|
|
9
9
|
}
|
|
10
10
|
const B = (e, t, n) => {
|
|
11
|
-
|
|
11
|
+
g.set(E(e, t), n);
|
|
12
12
|
}, O = (e, t) => {
|
|
13
13
|
switch (t[1].name) {
|
|
14
14
|
case "XYZ":
|
|
15
15
|
return {
|
|
16
|
-
bottomOffset: (n,
|
|
17
|
-
leftOffset: (n,
|
|
16
|
+
bottomOffset: (n, a) => t[3] === null ? a : t[3],
|
|
17
|
+
leftOffset: (n, a) => t[2] === null ? 0 : t[2],
|
|
18
18
|
pageIndex: e,
|
|
19
19
|
scaleTo: t[4]
|
|
20
20
|
};
|
|
@@ -43,15 +43,15 @@ const B = (e, t, n) => {
|
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
-
async function
|
|
46
|
+
async function b(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
|
|
50
|
-
if (
|
|
51
|
-
const r = await e.getPageIndex(
|
|
52
|
-
return B(e,
|
|
49
|
+
const a = n[0], s = x(e, a);
|
|
50
|
+
if (s === null) {
|
|
51
|
+
const r = await e.getPageIndex(a);
|
|
52
|
+
return B(e, a, r), await b(e, n);
|
|
53
53
|
} else
|
|
54
|
-
return O(
|
|
54
|
+
return O(s, n);
|
|
55
55
|
} else
|
|
56
56
|
return O(n[0], n);
|
|
57
57
|
}
|
|
@@ -59,40 +59,40 @@ const M = (e) => {
|
|
|
59
59
|
const n = e.target.parentNode;
|
|
60
60
|
if (!n)
|
|
61
61
|
return;
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const a = new MutationObserver((s) => {
|
|
63
|
+
s.forEach(() => {
|
|
64
64
|
n.querySelectorAll(
|
|
65
65
|
'[data-l10n-id="pdfjs-annotation-date-time-string"]'
|
|
66
66
|
).forEach((o) => {
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
67
|
+
const c = o.getAttribute("data-l10n-args");
|
|
68
|
+
if (c) {
|
|
69
69
|
try {
|
|
70
|
-
const { dateObj:
|
|
71
|
-
|
|
70
|
+
const { dateObj: i } = JSON.parse(c);
|
|
71
|
+
i && (o.textContent = I(i));
|
|
72
72
|
} catch {
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
a.disconnect();
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
});
|
|
79
|
-
return
|
|
79
|
+
return a.observe(n, {
|
|
80
80
|
childList: !0,
|
|
81
81
|
// Watch for changes to child elements
|
|
82
82
|
subtree: !0,
|
|
83
83
|
// Watch all descendants, not just direct children
|
|
84
84
|
attributes: !0
|
|
85
85
|
// Watch for changes to attributes
|
|
86
|
-
}), () =>
|
|
87
|
-
}, P = (e, t, n,
|
|
86
|
+
}), () => a.disconnect();
|
|
87
|
+
}, P = (e, t, n, a) => {
|
|
88
88
|
if (e.type !== "click")
|
|
89
89
|
return;
|
|
90
|
-
const
|
|
90
|
+
const s = e.target, r = s.getAttribute("data-element-id"), o = s.getAttribute("href");
|
|
91
91
|
if (o && o !== "#")
|
|
92
92
|
return;
|
|
93
|
-
const
|
|
94
|
-
!
|
|
95
|
-
|
|
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
96
|
});
|
|
97
97
|
};
|
|
98
98
|
function U(e, t) {
|
|
@@ -104,44 +104,36 @@ function V(e, t) {
|
|
|
104
104
|
e.removeEventListener(n, t);
|
|
105
105
|
}
|
|
106
106
|
function $(e) {
|
|
107
|
-
const { id: t, url: n, unsafeUrl:
|
|
108
|
-
new MutationObserver((
|
|
107
|
+
const { id: t, url: n, unsafeUrl: a } = e;
|
|
108
|
+
new MutationObserver((r, o) => {
|
|
109
109
|
const c = document.querySelector(`[data-annotation-id="${t}"]`);
|
|
110
110
|
if (c) {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
if (a && !n && !s)
|
|
114
|
-
l == null || l.setAttribute("href", "#");
|
|
115
|
-
else if (n || s) {
|
|
116
|
-
const g = _((n || s) ?? "", "");
|
|
117
|
-
l == null || l.setAttribute("target", "_blank"), l == null || l.setAttribute("href", g), l == null || l.setAttribute("rel", "noopener noreferrer");
|
|
118
|
-
} else
|
|
119
|
-
l == null || l.setAttribute("href", "");
|
|
120
|
-
i.disconnect();
|
|
111
|
+
const i = c.querySelector("a"), p = L((n || a) ?? "", "");
|
|
112
|
+
i && (i == null || i.setAttribute("target", "_blank"), i == null || i.setAttribute("href", p), i == null || i.setAttribute("rel", "noopener noreferrer")), o.disconnect();
|
|
121
113
|
}
|
|
122
114
|
}).observe(document.body, { childList: !0, subtree: !0 });
|
|
123
115
|
}
|
|
124
116
|
function D(e, t, n) {
|
|
125
|
-
const { rotation:
|
|
117
|
+
const { rotation: a, scale: s } = t, r = a % 180 === 0;
|
|
126
118
|
if (e.fieldType === "Btn" && e.pushButton) {
|
|
127
|
-
const o = e.rect[2] - e.rect[0],
|
|
128
|
-
|
|
119
|
+
const o = e.rect[2] - e.rect[0], c = e.rect[3] - e.rect[1], i = document.createElement("canvas");
|
|
120
|
+
i.setAttribute("width", ((r ? o : c) * s).toString()), i.setAttribute("height", ((r ? c : o) * s).toString()), n.set(e.id, i);
|
|
129
121
|
}
|
|
130
122
|
}
|
|
131
|
-
function
|
|
123
|
+
function k(e) {
|
|
132
124
|
var r;
|
|
133
125
|
let t = e;
|
|
134
126
|
for (; t.tagName !== "SECTION"; )
|
|
135
127
|
t = t.parentElement;
|
|
136
|
-
const n = t.getAttribute("aria-haspopup") === "dialog",
|
|
137
|
-
if (!n && !
|
|
128
|
+
const n = t.getAttribute("aria-haspopup") === "dialog", a = t.classList.contains("popupAnnotation");
|
|
129
|
+
if (!n && !a)
|
|
138
130
|
return;
|
|
139
|
-
let
|
|
140
|
-
if (
|
|
141
|
-
const o = t.parentElement.querySelector(`[aria-controls="${
|
|
142
|
-
o && new MutationObserver((
|
|
143
|
-
const
|
|
144
|
-
|
|
131
|
+
let s = t.id || t.getAttribute("aria-controls");
|
|
132
|
+
if (s || (s = (r = t.firstChild) == null ? void 0 : r.id), s && t.parentElement) {
|
|
133
|
+
const o = t.parentElement.querySelector(`[aria-controls="${s}"]`);
|
|
134
|
+
o && new MutationObserver((i, p) => {
|
|
135
|
+
const h = document.querySelectorAll(".popupDate");
|
|
136
|
+
h.length > 0 && (h.forEach((m) => {
|
|
145
137
|
if (m.innerHTML)
|
|
146
138
|
return !1;
|
|
147
139
|
const N = m.getAttribute("data-l10n-args");
|
|
@@ -149,31 +141,31 @@ function S(e) {
|
|
|
149
141
|
const { date: y, time: A } = JSON.parse(N);
|
|
150
142
|
y && A && (m.textContent = `${y}, ${A}`);
|
|
151
143
|
}
|
|
152
|
-
}),
|
|
144
|
+
}), p.disconnect());
|
|
153
145
|
}).observe(o, { childList: !0, subtree: !0 });
|
|
154
146
|
}
|
|
155
147
|
}
|
|
156
|
-
function
|
|
157
|
-
const
|
|
148
|
+
function d(e, t, n) {
|
|
149
|
+
const a = [];
|
|
158
150
|
if (n)
|
|
159
|
-
for (const
|
|
160
|
-
|
|
161
|
-
return
|
|
151
|
+
for (const s of n)
|
|
152
|
+
s[e] === t && a.push(s);
|
|
153
|
+
return a;
|
|
162
154
|
}
|
|
163
|
-
function
|
|
155
|
+
function u(e, t) {
|
|
164
156
|
return { type: e, data: t };
|
|
165
157
|
}
|
|
166
|
-
async function
|
|
158
|
+
async function S(e, t) {
|
|
167
159
|
if (e.dest)
|
|
168
160
|
if (typeof e.dest == "string") {
|
|
169
|
-
const n = await
|
|
170
|
-
return
|
|
161
|
+
const n = await b(t, e.dest);
|
|
162
|
+
return u(l.INTERNAL_LINK, {
|
|
171
163
|
referencedPage: n.pageIndex,
|
|
172
164
|
offset: null
|
|
173
165
|
});
|
|
174
166
|
} else {
|
|
175
167
|
const n = await t.getPageIndex(e.dest[0]);
|
|
176
|
-
return
|
|
168
|
+
return u(l.INTERNAL_LINK, {
|
|
177
169
|
referencedPage: n,
|
|
178
170
|
offset: {
|
|
179
171
|
left: e.dest[2],
|
|
@@ -182,7 +174,7 @@ async function w(e, t) {
|
|
|
182
174
|
});
|
|
183
175
|
}
|
|
184
176
|
else if (e.url)
|
|
185
|
-
return
|
|
177
|
+
return u(l.LINK, {
|
|
186
178
|
url: e.url,
|
|
187
179
|
unsafeUrl: e.unsafeUrl
|
|
188
180
|
});
|
|
@@ -190,113 +182,113 @@ async function w(e, t) {
|
|
|
190
182
|
function T(e) {
|
|
191
183
|
for (const t of e.getElementsByTagName("span")) {
|
|
192
184
|
let n = t.textContent;
|
|
193
|
-
const
|
|
185
|
+
const a = JSON.parse(t.dataset.l10nArgs ?? "{}");
|
|
194
186
|
if (n)
|
|
195
|
-
for (const
|
|
196
|
-
n = n.replace(`{{${
|
|
187
|
+
for (const s in a)
|
|
188
|
+
n = n.replace(`{{${s}}}`, a[s]);
|
|
197
189
|
t.textContent = n;
|
|
198
190
|
}
|
|
199
191
|
}
|
|
200
|
-
function
|
|
201
|
-
return
|
|
192
|
+
function w(e) {
|
|
193
|
+
return u(l.FILE_ATTACHMENT, e.file);
|
|
202
194
|
}
|
|
203
|
-
function
|
|
195
|
+
function f(e, t) {
|
|
204
196
|
switch (e.type) {
|
|
205
197
|
case "textarea":
|
|
206
198
|
case "text":
|
|
207
|
-
return
|
|
199
|
+
return u(l.FORM_TEXT, {
|
|
208
200
|
fieldName: e.name,
|
|
209
201
|
value: e.value
|
|
210
202
|
});
|
|
211
203
|
case "select-one":
|
|
212
204
|
case "select-multiple":
|
|
213
205
|
const n = [];
|
|
214
|
-
for (const
|
|
206
|
+
for (const s of e.options)
|
|
215
207
|
n.push({
|
|
216
|
-
value:
|
|
217
|
-
label:
|
|
208
|
+
value: s.value,
|
|
209
|
+
label: s.label
|
|
218
210
|
});
|
|
219
|
-
const
|
|
220
|
-
for (const
|
|
221
|
-
|
|
222
|
-
value:
|
|
223
|
-
label:
|
|
211
|
+
const a = [];
|
|
212
|
+
for (const s of e.selectedOptions)
|
|
213
|
+
a.push({
|
|
214
|
+
value: s.value,
|
|
215
|
+
label: s.label
|
|
224
216
|
});
|
|
225
|
-
return
|
|
217
|
+
return u(l.FORM_SELECT, {
|
|
226
218
|
fieldName: e.name,
|
|
227
|
-
value:
|
|
219
|
+
value: a,
|
|
228
220
|
options: n
|
|
229
221
|
});
|
|
230
222
|
case "checkbox":
|
|
231
|
-
return
|
|
223
|
+
return u(l.FORM_CHECKBOX, {
|
|
232
224
|
fieldName: e.name,
|
|
233
225
|
checked: e.checked
|
|
234
226
|
});
|
|
235
227
|
case "radio":
|
|
236
|
-
return
|
|
228
|
+
return u(l.FORM_RADIO, {
|
|
237
229
|
fieldName: e.name,
|
|
238
230
|
...t
|
|
239
231
|
});
|
|
240
232
|
case "button":
|
|
241
|
-
return
|
|
233
|
+
return u(l.FORM_BUTTON, {
|
|
242
234
|
fieldName: e.name,
|
|
243
235
|
...t
|
|
244
236
|
});
|
|
245
237
|
}
|
|
246
238
|
}
|
|
247
239
|
async function W(e, t, n) {
|
|
248
|
-
var
|
|
249
|
-
let
|
|
250
|
-
if (
|
|
251
|
-
if (
|
|
252
|
-
const r = (
|
|
240
|
+
var s;
|
|
241
|
+
let a = e.target.parentNode;
|
|
242
|
+
if (a.tagName === "DIV" && (a = a.firstChild), k(a), typeof a.className != "object")
|
|
243
|
+
if (a.className === "linkAnnotation" && e.type === "click") {
|
|
244
|
+
const r = (s = a.dataset) == null ? void 0 : s.annotationId;
|
|
253
245
|
if (r) {
|
|
254
|
-
const o =
|
|
246
|
+
const o = d("id", r, n);
|
|
255
247
|
if (o.length)
|
|
256
|
-
return await
|
|
248
|
+
return await S(o[0], t);
|
|
257
249
|
}
|
|
258
250
|
} else if (
|
|
259
251
|
/* annotation.className.includes('popupAnnotation') || */
|
|
260
|
-
|
|
252
|
+
a.className.includes("textAnnotation")
|
|
261
253
|
)
|
|
262
|
-
T(
|
|
263
|
-
else if (
|
|
264
|
-
T(
|
|
265
|
-
const r =
|
|
254
|
+
T(a);
|
|
255
|
+
else if (a.className.includes("fileAttachmentAnnotation")) {
|
|
256
|
+
T(a);
|
|
257
|
+
const r = a.dataset.annotationId;
|
|
266
258
|
if (r && e.type === "dblclick")
|
|
267
|
-
return
|
|
268
|
-
} else if (
|
|
269
|
-
let r =
|
|
270
|
-
return r || (r =
|
|
259
|
+
return w(d("id", r, n)[0]);
|
|
260
|
+
} else if (a.className.includes("textWidgetAnnotation") && e.type === "input") {
|
|
261
|
+
let r = a.getElementsByTagName("input")[0];
|
|
262
|
+
return r || (r = a.getElementsByTagName("textarea")[0]), f(r);
|
|
271
263
|
} else {
|
|
272
|
-
if (
|
|
273
|
-
return
|
|
274
|
-
if (
|
|
275
|
-
return
|
|
276
|
-
if (
|
|
277
|
-
const r =
|
|
264
|
+
if (a.className.includes("choiceWidgetAnnotation") && e.type === "input")
|
|
265
|
+
return f(a.getElementsByTagName("select")[0]);
|
|
266
|
+
if (a.className.includes("buttonWidgetAnnotation checkBox") && e.type === "change")
|
|
267
|
+
return f(a.getElementsByTagName("input")[0]);
|
|
268
|
+
if (a.className.includes("buttonWidgetAnnotation radioButton") && e.type === "change") {
|
|
269
|
+
const r = a.dataset.annotationId;
|
|
278
270
|
if (r) {
|
|
279
|
-
const o =
|
|
280
|
-
for (const
|
|
271
|
+
const o = d("id", r, n)[0], c = [];
|
|
272
|
+
for (const i of d(
|
|
281
273
|
"fieldName",
|
|
282
274
|
o.fieldName,
|
|
283
275
|
n
|
|
284
276
|
))
|
|
285
|
-
|
|
286
|
-
return
|
|
277
|
+
i.buttonValue && c.push(i.buttonValue);
|
|
278
|
+
return f(a.getElementsByTagName("input")[0], {
|
|
287
279
|
value: o.buttonValue,
|
|
288
280
|
defaultValue: o.fieldValue,
|
|
289
|
-
options:
|
|
281
|
+
options: c
|
|
290
282
|
});
|
|
291
283
|
}
|
|
292
|
-
} else if (
|
|
293
|
-
const r =
|
|
284
|
+
} else if (a.className.includes("buttonWidgetAnnotation pushButton") && e.type === "click") {
|
|
285
|
+
const r = a.dataset.annotationId;
|
|
294
286
|
if (r) {
|
|
295
|
-
const o =
|
|
296
|
-
return
|
|
287
|
+
const o = d("id", r, n)[0], { action: c } = o;
|
|
288
|
+
return c && ["Print", "SaveAs"].includes(c) ? { type: l.BUTTON, data: o } : o.resetForm ? f(
|
|
297
289
|
{ name: o.fieldName, type: "button" },
|
|
298
290
|
{ actions: o.actions, reset: !0 }
|
|
299
|
-
) :
|
|
291
|
+
) : f(
|
|
300
292
|
{ name: o.fieldName, type: "button" },
|
|
301
293
|
{ actions: o.actions, reset: !1 }
|
|
302
294
|
);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useRef as o, useEffect as i } from "react";
|
|
2
|
+
const s = /[\x00-\x1F]/g;
|
|
3
|
+
let c = null, r = null;
|
|
4
|
+
function d(e) {
|
|
5
|
+
return c || (c = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, r = /* @__PURE__ */ new Map([["ſt", "ſt"]])), e.replace(
|
|
6
|
+
c,
|
|
7
|
+
(f, u, t) => u ? u.normalize("NFKC") : (r == null ? void 0 : r.get(t)) || ""
|
|
8
|
+
);
|
|
9
|
+
}
|
|
10
|
+
function p(e, f = !1) {
|
|
11
|
+
return s.test(e) ? f ? e.replace(s, (u) => u === "\0" ? "" : " ") : e.replace(/\x00/g, "") : e;
|
|
12
|
+
}
|
|
13
|
+
const x = (e) => {
|
|
14
|
+
const f = o(!1), u = o(null);
|
|
15
|
+
i(() => {
|
|
16
|
+
if (!e || f.current)
|
|
17
|
+
return;
|
|
18
|
+
const t = (n) => {
|
|
19
|
+
var l;
|
|
20
|
+
const b = document.getSelection();
|
|
21
|
+
if (!b)
|
|
22
|
+
return;
|
|
23
|
+
const a = b.toString();
|
|
24
|
+
a && ((l = n.clipboardData) == null || l.setData(
|
|
25
|
+
"text/plain",
|
|
26
|
+
p(d(a))
|
|
27
|
+
), n.preventDefault(), n.stopPropagation());
|
|
28
|
+
};
|
|
29
|
+
return e.addEventListener("copy", t), u.current = e, f.current = !0, () => {
|
|
30
|
+
u.current && (u.current.removeEventListener("copy", t), f.current = !1);
|
|
31
|
+
};
|
|
32
|
+
}, [e]);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
x as useCopyText
|
|
36
|
+
};
|