@pdf-viewer/react 1.8.0-rc.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Popover-1faa77f6.js → Popover-48c8394c.js} +2 -2
- package/dist/{RPDefaultLayout-2cca5d34.js → RPDefaultLayout-4b330ca1.js} +571 -565
- package/dist/{component-1da194e8.js → component-2aa6e53b.js} +1 -1
- package/dist/components/RPConfig.js +691 -673
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +1 -1
- package/dist/components/layout/LayoutContainer.js +1 -1
- package/dist/components/layout/RPDefaultLayout.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/MenuItem.js +1 -1
- package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/Paginate.js +1 -1
- package/dist/components/layout/toolbar/PrintTool.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/RotateTool.js +1 -1
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- 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/Checkbox.js +228 -116
- package/dist/components/ui/DropDown.js +1 -1
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/Popover.js +1 -1
- package/dist/components/ui/RPTooltip.js +207 -207
- package/dist/contexts/ElementPageContext.js +57 -46
- package/dist/contexts/PaginationContext.js +1 -1
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/SearchContext.js +1 -1
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/{floating-ui.react-dom-15b9b819.js → floating-ui.react-dom-4b1e2e46.js} +394 -380
- package/dist/index-6e0e48fa.js +332 -0
- package/dist/{index-7279fb4e.js → index-951f0f1f.js} +464 -456
- package/dist/index-e3a67935.js +150 -0
- package/dist/main.js +1 -1
- package/dist/types/utils/types.d.ts +1 -0
- package/dist/utils/hooks/useFileDownload.js +1 -1
- package/dist/utils/hooks/useLicense.js +26 -24
- package/dist/utils/hooks/usePageRotateContext.js +17 -14
- 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/package.json +1 -1
- package/dist/index-1cb41342.js +0 -307
- package/dist/index-aa2d3884.js +0 -140
|
@@ -1,60 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { LicenseType as
|
|
4
|
-
import { useDimensionPagesContext as
|
|
5
|
-
import { usePagesRotateContext as
|
|
6
|
-
import { useLicenseContext as
|
|
7
|
-
import { useZoomContext as
|
|
8
|
-
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
11
|
-
(e,
|
|
12
|
-
|
|
13
|
-
const
|
|
1
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as L, useState as g, useCallback as l, useContext as h, useRef as w, useMemo as R } from "react";
|
|
3
|
+
import { LicenseType as A } from "../utils/types.js";
|
|
4
|
+
import { useDimensionPagesContext as y } from "./DimensionPagesContext.js";
|
|
5
|
+
import { usePagesRotateContext as O } from "./PagesRotateContext.js";
|
|
6
|
+
import { useLicenseContext as S } from "./LicenseContext.js";
|
|
7
|
+
import { useZoomContext as T } from "./ZoomContext.js";
|
|
8
|
+
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as u } from "../utils/const.js";
|
|
9
|
+
const d = L(void 0), k = ({ children: i }) => {
|
|
10
|
+
const [m, o] = g({}), { widths: t, heights: c } = y(), { pageRotate: a } = O(), { zoomLevel: f } = T(), x = l(
|
|
11
|
+
(e, r) => {
|
|
12
|
+
o((n) => {
|
|
13
|
+
const s = { width: t[e], height: c[e] };
|
|
14
14
|
return {
|
|
15
|
-
...
|
|
16
|
-
[e]:
|
|
15
|
+
...n,
|
|
16
|
+
[e]: r(n[e], s, a[e], f)
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
|
-
[
|
|
21
|
-
),
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
return delete
|
|
20
|
+
[t, c, f, a]
|
|
21
|
+
), p = l((e) => {
|
|
22
|
+
o((r) => {
|
|
23
|
+
const n = { ...r };
|
|
24
|
+
return delete n[e], n;
|
|
25
25
|
});
|
|
26
|
-
}, []), C =
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
26
|
+
}, []), C = l((e, r) => {
|
|
27
|
+
o((n) => {
|
|
28
|
+
const s = { ...n };
|
|
29
|
+
return s[e] = s[e].filter((_, P) => P !== r), s;
|
|
30
30
|
});
|
|
31
31
|
}, []);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
return /* @__PURE__ */ v(
|
|
33
|
+
d.Provider,
|
|
34
34
|
{
|
|
35
|
-
value: { updateElement:
|
|
36
|
-
children:
|
|
35
|
+
value: { updateElement: x, clearElements: p, removeElement: C, elementList: m },
|
|
36
|
+
children: i
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
}, E = () => {
|
|
40
|
+
}, U = () => {
|
|
41
|
+
const i = h(d), { type: m, validating: o } = S(), t = w(0), c = R(() => {
|
|
42
|
+
if (o !== !1)
|
|
43
|
+
return {
|
|
44
|
+
updateElement: E,
|
|
45
|
+
clearElements: E,
|
|
46
|
+
removeElement: E,
|
|
47
|
+
elementList: {}
|
|
48
|
+
};
|
|
49
|
+
if (m !== A.Organization)
|
|
50
|
+
return {
|
|
51
|
+
updateElement: () => {
|
|
52
|
+
t.current === 0 && (console.error(u), t.current++);
|
|
53
|
+
},
|
|
54
|
+
clearElements: () => {
|
|
55
|
+
t.current === 0 && (console.error(u), t.current++);
|
|
56
|
+
},
|
|
57
|
+
removeElement: () => {
|
|
58
|
+
t.current === 0 && (console.error(u), t.current++);
|
|
59
|
+
},
|
|
60
|
+
elementList: {}
|
|
61
|
+
};
|
|
62
|
+
}, [m, o]);
|
|
63
|
+
if (!i)
|
|
42
64
|
throw new Error("useElementPageContext must be used within a ElementPageProvider");
|
|
43
|
-
return
|
|
44
|
-
updateElement: () => {
|
|
45
|
-
console.error(l);
|
|
46
|
-
},
|
|
47
|
-
clearElements: () => {
|
|
48
|
-
console.error(l);
|
|
49
|
-
},
|
|
50
|
-
removeElement: () => {
|
|
51
|
-
console.error(l);
|
|
52
|
-
},
|
|
53
|
-
elementList: {}
|
|
54
|
-
} : r;
|
|
65
|
+
return c || i;
|
|
55
66
|
};
|
|
56
67
|
export {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
68
|
+
d as ElementPageContext,
|
|
69
|
+
k as ElementPageProvider,
|
|
70
|
+
U as useElementPageContext
|
|
60
71
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { h as e, P as m, u as p } from "../RPDefaultLayout-
|
|
3
|
+
import { h as e, P as m, u as p } from "../RPDefaultLayout-4b330ca1.js";
|
|
4
4
|
import "./RPDocumentContext.js";
|
|
5
5
|
import "../utils/appConsole.js";
|
|
6
6
|
export {
|