@pdf-viewer/react 1.9.0-beta.2 → 1.9.0-beta.4
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/RPLayout-5892502c.js +3494 -0
- package/dist/{SearchCloseButton-ddb9877e.js → SearchCloseButton-cbf182aa.js} +7 -6
- package/dist/assets/Checkbox.css +1 -1
- package/dist/assets/RPLayout.css +1 -1
- package/dist/components/RPConfig.js +691 -673
- package/dist/components/RPController.js +1 -1
- package/dist/components/RPPages.js +4 -5
- package/dist/components/layout/LayoutContainer.js +5 -5
- package/dist/components/layout/RPDefaultLayout.js +1 -1
- package/dist/components/layout/RPLayout.js +4 -5
- 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 +3 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +4 -5
- package/dist/components/layout/toolbar/DocumentProperties.js +23 -19
- 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 +5 -6
- 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 +2 -2
- 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 +35 -37
- package/dist/components/layout/toolbar/SearchCloseButton.js +1 -1
- package/dist/components/layout/toolbar/SearchResultNavigator.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +3 -4
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/ToolbarCustom.js +4 -5
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +4 -3
- 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 +5 -6
- 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/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
- package/dist/components/layout/toolbar/tools/defaults/TopbarDefaultTools.js +1 -1
- package/dist/components/page/AnnotationLayer.js +4 -5
- package/dist/components/page/CanvasLayer.js +4 -5
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +4 -4
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +4 -5
- package/dist/components/page/TextLayer.js +4 -5
- package/dist/components/ui/Button.js +8 -8
- package/dist/components/ui/Checkbox.js +243 -120
- package/dist/components/ui/DropDown.js +16 -16
- package/dist/components/ui/Input.js +11 -11
- package/dist/components/ui/LoadingIndicator.js +1 -1
- package/dist/components/ui/RPTooltip.js +211 -426
- package/dist/contexts/ElementPageContext.js +54 -43
- 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/index-00f8683a.js +1672 -0
- package/dist/index-5f66a29f.js +1681 -0
- package/dist/index-6b37f504.js +332 -0
- package/dist/main.js +1 -1
- package/dist/types/components/layout/LayoutContainer.d.ts +5 -1
- package/dist/types/components/layout/sidebar/Thumbnails.d.ts +3 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +3 -1
- package/dist/types/components/page/RPPage.d.ts +3 -1
- package/dist/types/components/ui/Button.d.ts +3 -1
- package/dist/types/components/ui/Checkbox.d.ts +1 -0
- package/dist/types/components/ui/DropDown.d.ts +2 -1
- package/dist/types/components/ui/Input.d.ts +3 -1
- package/dist/types/components/ui/RPTooltip.d.ts +3 -1
- package/dist/types/utils/types.d.ts +3 -1
- package/dist/types/utils/withRef.d.ts +4 -0
- package/dist/utils/hooks/useFileDownload.js +4 -5
- package/dist/utils/hooks/useLicense.js +26 -24
- package/dist/utils/hooks/usePageRotateContext.js +19 -20
- package/dist/utils/hooks/usePaginate.js +4 -5
- package/dist/utils/hooks/usePresentPage.js +4 -5
- package/dist/utils/hooks/usePrint.js +4 -5
- package/dist/utils/hooks/useScrollToPage.js +4 -5
- package/dist/utils/hooks/useSearch.js +4 -5
- package/dist/utils/hooks/useThumbnail.js +4 -5
- package/dist/utils/hooks/useVirtualReactWindow.js +4 -5
- package/dist/utils/types.js +6 -6
- package/dist/utils/withRef.js +8 -0
- package/package.json +1 -1
- package/dist/Popover-1faa77f6.js +0 -1445
- package/dist/RPLayout-81cd4970.js +0 -3393
- package/dist/assets/Popover.css +0 -1
- package/dist/component-1da194e8.js +0 -337
- package/dist/components/ui/Popover.js +0 -6
- package/dist/floating-ui.react-dom-15b9b819.js +0 -1310
- package/dist/index-1cb41342.js +0 -307
- package/dist/index-7279fb4e.js +0 -1557
- package/dist/index-aa2d3884.js +0 -140
- package/dist/types/components/ui/Popover.d.ts +0 -9
|
@@ -1,60 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { LicenseType as
|
|
4
|
-
import { useDimensionPagesContext as
|
|
5
|
-
import { usePagesRotateContext as
|
|
1
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as P, useState as h, useCallback as u, useContext as g, useRef as A, useMemo as R } from "react";
|
|
3
|
+
import { LicenseType as d } from "../utils/types.js";
|
|
4
|
+
import { useDimensionPagesContext as T } from "./DimensionPagesContext.js";
|
|
5
|
+
import { usePagesRotateContext as y } from "./PagesRotateContext.js";
|
|
6
6
|
import { useLicenseContext as O } from "./LicenseContext.js";
|
|
7
|
-
import { useZoomContext as
|
|
8
|
-
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as
|
|
9
|
-
const x =
|
|
10
|
-
const [
|
|
11
|
-
(e,
|
|
12
|
-
|
|
13
|
-
const
|
|
7
|
+
import { useZoomContext as S } from "./ZoomContext.js";
|
|
8
|
+
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as a } from "../utils/const.js";
|
|
9
|
+
const x = P(void 0), k = ({ children: l }) => {
|
|
10
|
+
const [r, o] = h({}), { widths: t, heights: c } = T(), { pageRotate: m } = y(), { zoomLevel: f } = S(), p = u(
|
|
11
|
+
(e, s) => {
|
|
12
|
+
o((n) => {
|
|
13
|
+
const i = { width: t[e], height: c[e] };
|
|
14
14
|
return {
|
|
15
|
-
...
|
|
16
|
-
[e]:
|
|
15
|
+
...n,
|
|
16
|
+
[e]: s(n[e], i, m[e], f)
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
|
-
[
|
|
21
|
-
),
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
return delete
|
|
20
|
+
[t, c, f, m]
|
|
21
|
+
), C = u((e) => {
|
|
22
|
+
o((s) => {
|
|
23
|
+
const n = { ...s };
|
|
24
|
+
return delete n[e], n;
|
|
25
25
|
});
|
|
26
|
-
}, []),
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
return
|
|
26
|
+
}, []), L = u((e, s) => {
|
|
27
|
+
o((n) => {
|
|
28
|
+
const i = { ...n };
|
|
29
|
+
return i[e] = i[e].filter((_, v) => v !== s), i;
|
|
30
30
|
});
|
|
31
31
|
}, []);
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
return /* @__PURE__ */ w(
|
|
33
33
|
x.Provider,
|
|
34
34
|
{
|
|
35
|
-
value: { updateElement:
|
|
36
|
-
children:
|
|
35
|
+
value: { updateElement: p, clearElements: C, removeElement: L, elementList: r },
|
|
36
|
+
children: l
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
}, E = () => {
|
|
40
|
+
}, U = () => {
|
|
41
|
+
const l = g(x), { type: r, validating: o } = O(), t = A(0), c = R(() => {
|
|
42
|
+
if (o !== !1)
|
|
43
|
+
return {
|
|
44
|
+
updateElement: E,
|
|
45
|
+
clearElements: E,
|
|
46
|
+
removeElement: E,
|
|
47
|
+
elementList: {}
|
|
48
|
+
};
|
|
49
|
+
if (!(r ? [d.Organization, d.FreeTrial].includes(r) : !1))
|
|
50
|
+
return {
|
|
51
|
+
updateElement: () => {
|
|
52
|
+
t.current === 0 && (console.error(a), t.current++);
|
|
53
|
+
},
|
|
54
|
+
clearElements: () => {
|
|
55
|
+
t.current === 0 && (console.error(a), t.current++);
|
|
56
|
+
},
|
|
57
|
+
removeElement: () => {
|
|
58
|
+
t.current === 0 && (console.error(a), t.current++);
|
|
59
|
+
},
|
|
60
|
+
elementList: {}
|
|
61
|
+
};
|
|
62
|
+
}, [r, o]);
|
|
63
|
+
if (!l)
|
|
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 || l;
|
|
55
66
|
};
|
|
56
67
|
export {
|
|
57
68
|
x as ElementPageContext,
|
|
58
|
-
|
|
59
|
-
|
|
69
|
+
k as ElementPageProvider,
|
|
70
|
+
U as useElementPageContext
|
|
60
71
|
};
|