@react-pdf-kit/viewer 0.0.0-experimental.3 → 0.0.0-experimental.5
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-479e39c6.js → Combination-136ff99c.js} +184 -187
- package/dist/assets/style.css +1 -1
- package/dist/components/RPConfig.js +16 -6
- package/dist/components/RPController.js +3 -4
- package/dist/components/RPDropFileZone.js +35 -29
- package/dist/components/RPPages.js +76 -84
- package/dist/components/RPProvider.js +3 -4
- package/dist/components/layout/RPDefaultLayout.js +11 -10
- package/dist/components/layout/RPLayout.js +27 -25
- package/dist/components/layout/WrapperLayout.js +10 -11
- package/dist/components/layout/sidebar/RPSidebar.js +7 -8
- package/dist/components/layout/sidebar/Thumbnail.js +3 -4
- package/dist/components/layout/sidebar/Thumbnails.js +3 -4
- package/dist/components/layout/toolbar/DarkModeTool.js +4 -4
- package/dist/components/layout/toolbar/DocumentDialog.js +8 -9
- package/dist/components/layout/toolbar/DocumentProperties.js +6 -6
- package/dist/components/layout/toolbar/FileDownloadTool.js +9 -10
- package/dist/components/layout/toolbar/FileUploadTool.js +9 -10
- package/dist/components/layout/toolbar/FullScreenTool.js +6 -6
- package/dist/components/layout/toolbar/MenuItem.js +6 -6
- package/dist/components/layout/toolbar/MenuSeparator.js +6 -6
- package/dist/components/layout/toolbar/MostPageTool.js +9 -10
- package/dist/components/layout/toolbar/OtherTool.js +9 -10
- package/dist/components/layout/toolbar/Paginate.js +7 -8
- package/dist/components/layout/toolbar/PrintTool.js +9 -10
- package/dist/components/layout/toolbar/RPMenuItem.js +6 -6
- package/dist/components/layout/toolbar/RPMoreOptions.js +9 -10
- package/dist/components/layout/toolbar/RPToolbar.js +9 -10
- package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -10
- package/dist/components/layout/toolbar/RotateTool.js +9 -10
- package/dist/components/layout/toolbar/ScrollModeTool.js +6 -6
- package/dist/components/layout/toolbar/SearchCloseButton.js +4 -4
- package/dist/components/layout/toolbar/SearchResultNavigator.js +7 -8
- package/dist/components/layout/toolbar/SearchTool.js +11 -12
- package/dist/components/layout/toolbar/SelectionModeTool.js +6 -6
- package/dist/components/layout/toolbar/ThumbnailTool.js +7 -8
- package/dist/components/layout/toolbar/ToolbarCustom.js +3 -4
- package/dist/components/layout/toolbar/ToolbarDefault.js +9 -10
- package/dist/components/layout/toolbar/ToolbarLayout.js +9 -10
- package/dist/components/layout/toolbar/ViewModeTool.js +6 -6
- package/dist/components/layout/toolbar/ZoomTool.js +9 -10
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +8 -9
- package/dist/components/layout/toolbar/tools/DualPageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +11 -10
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +7 -8
- package/dist/components/layout/toolbar/tools/FileUploadTool.js +7 -8
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +11 -10
- package/dist/components/layout/toolbar/tools/FullScreenTool.js +4 -4
- package/dist/components/layout/toolbar/tools/HorizontalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/InputPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/LastPageTool.js +11 -10
- package/dist/components/layout/toolbar/tools/NextPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/PageScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +7 -8
- package/dist/components/layout/toolbar/tools/PrintTool.js +7 -8
- package/dist/components/layout/toolbar/tools/RotateClockwiseTool.js +7 -8
- package/dist/components/layout/toolbar/tools/RotateCounterclockwiseTool.js +7 -8
- package/dist/components/layout/toolbar/tools/SelectionModeSwitcherTool.js +4 -4
- package/dist/components/layout/toolbar/tools/SinglePageTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ThemeSwitcherTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +7 -8
- package/dist/components/layout/toolbar/tools/VerticalScrollingTool.js +4 -4
- package/dist/components/layout/toolbar/tools/ZoomInTool.js +7 -8
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +19 -20
- package/dist/components/layout/toolbar/tools/ZoomOutTool.js +7 -8
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +9 -10
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +7 -8
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +9 -10
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +6 -6
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +6 -6
- package/dist/components/page/AnnotationLayer.js +24 -25
- package/dist/components/page/CanvasLayer.js +3 -4
- package/dist/components/page/CustomElement.js +3 -4
- package/dist/components/page/DualPage.js +3 -4
- package/dist/components/page/DualPageWithCover.js +3 -4
- package/dist/components/page/RPPage.js +4 -5
- package/dist/components/page/SinglePage.js +3 -4
- package/dist/components/page/TextHighlightLayer.js +15 -16
- package/dist/components/page/TextLayer.js +11 -12
- package/dist/components/ui/Checkbox.js +2 -2
- package/dist/components/ui/DropDown.js +6 -6
- package/dist/components/ui/LoadingIndicator.js +7 -8
- package/dist/components/ui/RPTooltip.js +411 -197
- package/dist/contexts/ConfigContext.js +5 -4
- package/dist/contexts/DimensionPagesContext.js +5 -6
- package/dist/contexts/DropFileZoneContext.js +4 -5
- package/dist/contexts/ElementPageContext.js +5 -6
- package/dist/contexts/FileInputContext.js +5 -6
- package/dist/contexts/HighlightContext.js +5 -6
- package/dist/contexts/LayoutDropFileZoneContext.js +11 -0
- package/dist/contexts/PagesRotateContext.js +5 -6
- package/dist/contexts/PaginationContext.js +5 -6
- package/dist/contexts/PrintContext.js +16 -17
- package/dist/contexts/RPDocumentContext.js +13 -14
- package/dist/contexts/RenderQueueProvider.js +5 -6
- package/dist/contexts/RotationContext.js +8 -9
- package/dist/contexts/SearchContext.js +5 -6
- package/dist/contexts/ThumbnailsContext.js +4 -5
- package/dist/contexts/ZoomContext.js +5 -6
- package/dist/floating-ui.react-dom-5ec29bd6.js +1327 -0
- package/dist/index-61f59539.js +1198 -0
- package/dist/{index-ada501c4.js → index-655864a7.js} +1 -1
- package/dist/{index-113053cf.js → index-c0faa594.js} +2 -2
- package/dist/{index-23911b43.js → index-e3ee9457.js} +6 -6
- package/dist/main.js +117 -115
- package/dist/polyfills.js +8055 -0
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +2 -2
- package/dist/types/contexts/LayoutDropFileZoneContext.d.ts +9 -0
- package/dist/types/contexts/RPDocumentContext.d.ts +1 -1
- package/dist/types/contexts/RenderQueueProvider.d.ts +1 -1
- package/dist/types/contexts/RenderedPagesCache.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/dist/types/utils/annotations.d.ts +2 -2
- package/dist/types/utils/getThumbnailViewport.d.ts +2 -2
- package/dist/types/utils/highlight.d.ts +5 -5
- package/dist/types/utils/hooks/useDropFileZone.d.ts +5 -0
- package/dist/types/utils/hooks/useHighlight.d.ts +1 -1
- package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
- package/dist/types/utils/hooks/useLoadWorker.d.ts +1 -5
- package/dist/types/utils/hooks/usePdfProperties.d.ts +1 -1
- package/dist/types/utils/link_service.d.ts +3 -2
- package/dist/types/utils/renderPage.d.ts +2 -2
- package/dist/types/utils/types.d.ts +8 -5
- package/dist/utils/hooks/useDropFileZone.js +12 -0
- package/dist/utils/hooks/useFileDownload.js +5 -6
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/useLoadPdf.js +70 -95
- package/dist/utils/hooks/useLoadWorker.js +14 -4
- package/dist/utils/hooks/usePageRotateContext.js +7 -8
- package/dist/utils/hooks/usePaginate.js +3 -4
- package/dist/utils/hooks/usePinch.js +10 -11
- package/dist/utils/hooks/usePresentPage.js +3 -4
- package/dist/utils/hooks/usePrint.js +55 -54
- package/dist/utils/hooks/useRotate.js +3 -4
- package/dist/utils/hooks/useScrollToPage.js +3 -4
- package/dist/utils/hooks/useSearch.js +15 -16
- package/dist/utils/hooks/useThumbnail.js +17 -18
- package/dist/utils/hooks/useVirtualReactWindow.js +3 -4
- package/dist/utils/link_service.js +19 -18
- package/dist/utils/renderPage.js +1 -1
- package/package.json +13 -4
- package/dist/index-535ad364.js +0 -983
- package/dist/index-d0f0aa9a.js +0 -1542
|
@@ -5,8 +5,7 @@ import { useHighlightContext as V } from "../../contexts/HighlightContext.js";
|
|
|
5
5
|
import { normalizeSingleKeyword as Y, sortHighlightPosition as Z, unwrap as tt } from "./searchHighlight.js";
|
|
6
6
|
import { isMatchEntireWord as et } from "../../utils/highlight.js";
|
|
7
7
|
import "../../utils/hooks/useLoadPdf.js";
|
|
8
|
-
import "
|
|
9
|
-
import "@pdf-viewer/pdfium/compat";
|
|
8
|
+
import "pdfjs-dist";
|
|
10
9
|
import "../../utils/types.js";
|
|
11
10
|
import "../../de_DE-a553b162.js";
|
|
12
11
|
import "../../utils/getThumbnailViewport.js";
|
|
@@ -21,8 +20,8 @@ import "../../utils/charators.js";
|
|
|
21
20
|
import "../../utils/const.js";
|
|
22
21
|
const nt = {
|
|
23
22
|
"rp-text-highlight": "_rp-text-highlight_jdkf8_1"
|
|
24
|
-
},
|
|
25
|
-
const [$, v] = A(), { pages: R } = U(), { highlightKeywords:
|
|
23
|
+
}, Tt = ({ pageNumber: w, viewport: O }) => {
|
|
24
|
+
const [$, v] = A(), { pages: R } = U(), { highlightKeywords: d } = V(), M = !0, C = N(null), [P, q] = A(null), [_, b] = A([]);
|
|
26
25
|
H(() => {
|
|
27
26
|
C.current && q(C.current.parentElement);
|
|
28
27
|
}, [C]), H(() => {
|
|
@@ -34,13 +33,13 @@ const nt = {
|
|
|
34
33
|
v(n);
|
|
35
34
|
})();
|
|
36
35
|
}, [R, w]);
|
|
37
|
-
const j = Q(() =>
|
|
36
|
+
const j = Q(() => d ? d.map((t) => {
|
|
38
37
|
var e, n;
|
|
39
38
|
return {
|
|
40
39
|
...Y(t.keyword, (e = t.options) == null ? void 0 : e.matchCase, (n = t.options) == null ? void 0 : n.wholeWords),
|
|
41
40
|
color: t.highlightColor
|
|
42
41
|
};
|
|
43
|
-
}) : [], [
|
|
42
|
+
}) : [], [d]);
|
|
44
43
|
function D(t, e) {
|
|
45
44
|
if (!t)
|
|
46
45
|
return;
|
|
@@ -85,7 +84,7 @@ const nt = {
|
|
|
85
84
|
s.setStart(o, c), s.setEnd(o, l + 1);
|
|
86
85
|
const h = document.createElement("span");
|
|
87
86
|
h.style.width = "auto", s.surroundContents(h);
|
|
88
|
-
const a = h.getBoundingClientRect(), f = t.getBoundingClientRect(), m = f.height,
|
|
87
|
+
const a = h.getBoundingClientRect(), f = t.getBoundingClientRect(), m = f.height, p = f.width, x = 100 * (a.left - f.left) / p, E = 100 * (a.top - f.top) / m, S = 100 * a.height / m, g = 100 * a.width / p;
|
|
89
88
|
return tt(h), {
|
|
90
89
|
keywordStr: e,
|
|
91
90
|
left: x,
|
|
@@ -93,7 +92,7 @@ const nt = {
|
|
|
93
92
|
height: S,
|
|
94
93
|
width: g,
|
|
95
94
|
pageHeight: m,
|
|
96
|
-
pageWidth:
|
|
95
|
+
pageWidth: p
|
|
97
96
|
};
|
|
98
97
|
};
|
|
99
98
|
async function z(t, e) {
|
|
@@ -130,14 +129,14 @@ const nt = {
|
|
|
130
129
|
const { keyword: l, regExp: h, wholeWords: a, color: f } = c, m = l;
|
|
131
130
|
if (!m.trim())
|
|
132
131
|
return;
|
|
133
|
-
const
|
|
132
|
+
const p = h.flags.indexOf("g") === -1 ? new RegExp(h, `${h.flags}g`) : h;
|
|
134
133
|
let x;
|
|
135
134
|
const E = [];
|
|
136
|
-
for (; (x =
|
|
135
|
+
for (; (x = p.exec(i)) !== null; )
|
|
137
136
|
a && !et(i, x.index, x[0].length) || E.push({
|
|
138
|
-
keyword:
|
|
137
|
+
keyword: p,
|
|
139
138
|
startIndex: x.index,
|
|
140
|
-
endIndex:
|
|
139
|
+
endIndex: p.lastIndex
|
|
141
140
|
});
|
|
142
141
|
const S = E.map((g) => ({
|
|
143
142
|
keyword: g.keyword,
|
|
@@ -169,17 +168,17 @@ const nt = {
|
|
|
169
168
|
};
|
|
170
169
|
return H(() => {
|
|
171
170
|
(async () => {
|
|
172
|
-
if (!
|
|
171
|
+
if (!d || d.length === 0) {
|
|
173
172
|
b([]);
|
|
174
173
|
return;
|
|
175
174
|
}
|
|
176
175
|
try {
|
|
177
|
-
await z(w,
|
|
176
|
+
await z(w, d);
|
|
178
177
|
} catch (e) {
|
|
179
178
|
console.error(e);
|
|
180
179
|
}
|
|
181
180
|
})();
|
|
182
|
-
}, [M,
|
|
181
|
+
}, [M, d, w, $, O]), /* @__PURE__ */ k(J, { children: /* @__PURE__ */ k("div", { ref: C, "data-rp": `page-${w}-textHighlightLayer`, children: _.map((t, e) => /* @__PURE__ */ k(
|
|
183
182
|
"div",
|
|
184
183
|
{
|
|
185
184
|
className: nt["rp-text-highlight"],
|
|
@@ -195,5 +194,5 @@ const nt = {
|
|
|
195
194
|
)) }) });
|
|
196
195
|
};
|
|
197
196
|
export {
|
|
198
|
-
|
|
197
|
+
Tt as TextHighlightLayer
|
|
199
198
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as B } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as g, useState as H, useMemo as P, useCallback as _, useEffect as w } from "react";
|
|
3
3
|
import { useDocumentContext as G } from "../../contexts/RPDocumentContext.js";
|
|
4
|
-
import
|
|
4
|
+
import * as J from "pdfjs-dist";
|
|
5
5
|
import { resetDivs as $, highlightMatches as U } from "../../utils/highlight.js";
|
|
6
6
|
import { useSearchContext as V } from "../../contexts/SearchContext.js";
|
|
7
7
|
import "../../utils/hooks/useLoadPdf.js";
|
|
8
|
-
import "@pdf-viewer/pdfium";
|
|
9
8
|
import "../../utils/types.js";
|
|
10
9
|
import "../../de_DE-a553b162.js";
|
|
11
10
|
import "../../utils/getThumbnailViewport.js";
|
|
@@ -43,8 +42,8 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
43
42
|
selecting: X,
|
|
44
43
|
markedContent: z,
|
|
45
44
|
"rp-text-layer-text": "_rp-text-layer-text_1553j_61"
|
|
46
|
-
},
|
|
47
|
-
const { pageNumber: d } =
|
|
45
|
+
}, Ae = (k) => {
|
|
46
|
+
const { pageNumber: d } = k, { pages: R } = G(), i = g(null), { matches: O, currentMatch: v } = V(), [D, A] = H(
|
|
48
47
|
[]
|
|
49
48
|
), p = g(), h = g(), L = g([]), y = P(() => O.filter((r) => r.pageIndex === d - 1), [O, d]), T = _(
|
|
50
49
|
(r, t, e = !1) => {
|
|
@@ -96,7 +95,7 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
96
95
|
document.addEventListener(
|
|
97
96
|
"selectionchange",
|
|
98
97
|
() => {
|
|
99
|
-
var M,
|
|
98
|
+
var M, j;
|
|
100
99
|
const o = document.getSelection();
|
|
101
100
|
if (!o)
|
|
102
101
|
return;
|
|
@@ -125,7 +124,7 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
125
124
|
const m = (M = u.parentElement) == null ? void 0 : M.closest(
|
|
126
125
|
a["rp-text-layer"]
|
|
127
126
|
), S = m == null ? void 0 : m.querySelector(".endOfContent");
|
|
128
|
-
S && m && (S.style.width = m.style.width, S.style.height = m.style.height, (
|
|
127
|
+
S && m && (S.style.width = m.style.width, S.style.height = m.style.height, (j = u.parentElement) == null || j.insertBefore(S, u.nextSibling)), n = l.cloneRange();
|
|
129
128
|
},
|
|
130
129
|
{ signal: t }
|
|
131
130
|
);
|
|
@@ -135,7 +134,7 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
135
134
|
}), [E]);
|
|
136
135
|
const q = _(() => {
|
|
137
136
|
i.current && i.current.classList.add(a.selecting);
|
|
138
|
-
}, []),
|
|
137
|
+
}, []), I = _(() => {
|
|
139
138
|
i.current && i.current.classList.remove(a.selecting);
|
|
140
139
|
}, []);
|
|
141
140
|
return w(() => {
|
|
@@ -159,7 +158,7 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
159
158
|
const t = i.current;
|
|
160
159
|
return p.current && p.current.cancel(), r.page.getTextContent().then((e) => {
|
|
161
160
|
const n = r.page.getViewport({ scale: 1 });
|
|
162
|
-
return p.current = new J({
|
|
161
|
+
return p.current = new J.TextLayer({
|
|
163
162
|
viewport: n,
|
|
164
163
|
textContentSource: e,
|
|
165
164
|
container: t
|
|
@@ -185,7 +184,7 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
185
184
|
});
|
|
186
185
|
const t = (e = p.current) == null ? void 0 : e.textDivs;
|
|
187
186
|
t && h.current && T(h.current, t, !0);
|
|
188
|
-
}, [T]), /* @__PURE__ */
|
|
187
|
+
}, [T]), /* @__PURE__ */ B(
|
|
189
188
|
"div",
|
|
190
189
|
{
|
|
191
190
|
"data-rp-text-layer": !0,
|
|
@@ -193,10 +192,10 @@ const X = "_selecting_1553j_14", z = "_markedContent_1553j_37", a = {
|
|
|
193
192
|
className: a["rp-text-layer"],
|
|
194
193
|
ref: i,
|
|
195
194
|
onMouseDown: q,
|
|
196
|
-
onMouseUp:
|
|
195
|
+
onMouseUp: I
|
|
197
196
|
}
|
|
198
197
|
);
|
|
199
198
|
};
|
|
200
199
|
export {
|
|
201
|
-
|
|
200
|
+
Ae as TextLayer
|
|
202
201
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as w, Fragment as U } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { c as z, a as B, P as y, b as S, d as G, f as K } from "../../index-
|
|
4
|
-
import { u as X } from "../../index-
|
|
3
|
+
import { c as z, a as B, P as y, b as S, d as G, f as K } from "../../index-c0faa594.js";
|
|
4
|
+
import { u as X } from "../../index-655864a7.js";
|
|
5
5
|
import { CheckIcon as J } from "../icons/CheckIcon.js";
|
|
6
6
|
import "react-dom";
|
|
7
7
|
function Q(e) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as p, jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { R as l, T as c, P as _, C as m } from "../../index-
|
|
2
|
+
import { R as l, T as c, P as _, C as m } from "../../index-61f59539.js";
|
|
3
3
|
import { c as A } from "../../clsx-0c6e471a.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import "../../index-
|
|
5
|
+
import "../../index-c0faa594.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import "../../index-
|
|
8
|
-
import "../../Combination-
|
|
9
|
-
import "../../
|
|
10
|
-
import "../../index-
|
|
7
|
+
import "../../index-e3ee9457.js";
|
|
8
|
+
import "../../Combination-136ff99c.js";
|
|
9
|
+
import "../../floating-ui.react-dom-5ec29bd6.js";
|
|
10
|
+
import "../../index-655864a7.js";
|
|
11
11
|
const F = "_slideDownAndFade_1vzkq_1", w = "_slideLeftAndFade_1vzkq_1", f = "_slideUpAndFade_1vzkq_1", g = "_slideRightAndFade_1vzkq_1", h = {
|
|
12
12
|
"rp-dropdown-content": "_rp-dropdown-content_1vzkq_1",
|
|
13
13
|
slideDownAndFade: F,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
1
|
+
import { jsx as a, jsxs as t } from "react/jsx-runtime";
|
|
2
2
|
import { c as o } from "../../clsx-0c6e471a.js";
|
|
3
3
|
import { usePrintContext as p } from "../../contexts/PrintContext.js";
|
|
4
4
|
import { useLocalizationContext as d } from "../../contexts/LocalizationContext.js";
|
|
@@ -6,8 +6,7 @@ import "react";
|
|
|
6
6
|
import "../../utils/hooks/usePrint.js";
|
|
7
7
|
import "../../contexts/RPDocumentContext.js";
|
|
8
8
|
import "../../utils/hooks/useLoadPdf.js";
|
|
9
|
-
import "
|
|
10
|
-
import "@pdf-viewer/pdfium/compat";
|
|
9
|
+
import "pdfjs-dist";
|
|
11
10
|
import "../../utils/types.js";
|
|
12
11
|
import "../../de_DE-a553b162.js";
|
|
13
12
|
import "../../utils/getThumbnailViewport.js";
|
|
@@ -26,10 +25,10 @@ const s = "_loading_wazy2_1", i = {
|
|
|
26
25
|
"rp-loading-progress": "_rp-loading-progress_wazy2_35",
|
|
27
26
|
"rp-loading-cancel-button": "_rp-loading-cancel-button_wazy2_55",
|
|
28
27
|
loading: s
|
|
29
|
-
},
|
|
28
|
+
}, I = ({ percentage: n }) => {
|
|
30
29
|
const { cancel: l } = p(), { localeMessages: r } = d();
|
|
31
|
-
return
|
|
32
|
-
/* @__PURE__ */
|
|
30
|
+
return n < 1 ? null : /* @__PURE__ */ a("div", { className: o(i["rp-loading-overlay"]), children: /* @__PURE__ */ t("div", { className: o(i["rp-loading-modal"]), children: [
|
|
31
|
+
/* @__PURE__ */ t("div", { className: o(i["rp-loading-title"]), children: [
|
|
33
32
|
r == null ? void 0 : r.printLoadingMessage,
|
|
34
33
|
"..."
|
|
35
34
|
] }),
|
|
@@ -37,12 +36,12 @@ const s = "_loading_wazy2_1", i = {
|
|
|
37
36
|
"div",
|
|
38
37
|
{
|
|
39
38
|
className: o(i["rp-loading-progress"]),
|
|
40
|
-
style: { width: `${
|
|
39
|
+
style: { width: `${n}%` }
|
|
41
40
|
}
|
|
42
41
|
) }),
|
|
43
42
|
/* @__PURE__ */ a("button", { className: o(i["rp-loading-cancel-button"]), onClick: l, children: r == null ? void 0 : r.printCancelLabel })
|
|
44
43
|
] }) });
|
|
45
44
|
};
|
|
46
45
|
export {
|
|
47
|
-
|
|
46
|
+
I as default
|
|
48
47
|
};
|