@pdf-viewer/react 1.8.0-beta.4 → 1.8.0-beta.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.
|
@@ -11,7 +11,7 @@ const d = ({ child: e }) => {
|
|
|
11
11
|
};
|
|
12
12
|
}, [e]), /* @__PURE__ */ n("div", { ref: t });
|
|
13
13
|
}, h = ({ pageNumber: e }) => {
|
|
14
|
-
const {
|
|
14
|
+
const { elementList: t } = a(), o = l(null), r = i(() => {
|
|
15
15
|
var m;
|
|
16
16
|
return (m = t[e]) == null ? void 0 : m.map((u, s) => u instanceof HTMLElement ? /* @__PURE__ */ n(d, { child: u }, s) : /* @__PURE__ */ n("div", { children: u }, s));
|
|
17
17
|
}, [t, e]);
|
|
@@ -1,52 +1,59 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
2
|
+
import { createContext as w, useState as C, useCallback as a, useContext as P } from "react";
|
|
3
3
|
import { LicenseType as g } from "../utils/types.js";
|
|
4
|
-
import { useDimensionPagesContext as
|
|
5
|
-
import { usePagesRotateContext as
|
|
6
|
-
import { useLicenseContext as
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { useDimensionPagesContext as p } from "./DimensionPagesContext.js";
|
|
5
|
+
import { usePagesRotateContext as y } from "./PagesRotateContext.js";
|
|
6
|
+
import { useLicenseContext as L } from "./LicenseContext.js";
|
|
7
|
+
import { useZoomContext as z } from "./ZoomContext.js";
|
|
8
|
+
const E = w(void 0), _ = ({ children: s }) => {
|
|
9
|
+
const [i, r] = C({}), { widths: l, heights: m } = p(), { pageRotate: c } = y(), { zoomLevel: u } = z(), h = a(
|
|
9
10
|
(e, n) => {
|
|
10
11
|
r((t) => {
|
|
11
12
|
const o = { width: l[e], height: m[e] };
|
|
12
13
|
return {
|
|
13
14
|
...t,
|
|
14
|
-
[e]: n(t[e], o,
|
|
15
|
+
[e]: n(t[e], o, c[e], u)
|
|
15
16
|
};
|
|
16
17
|
});
|
|
17
18
|
},
|
|
18
|
-
[l, m]
|
|
19
|
-
),
|
|
19
|
+
[l, m, u, c]
|
|
20
|
+
), f = a((e) => {
|
|
20
21
|
r((n) => {
|
|
21
22
|
const t = { ...n };
|
|
22
23
|
return delete t[e], t;
|
|
23
24
|
});
|
|
24
|
-
}, []),
|
|
25
|
+
}, []), v = a((e, n) => {
|
|
25
26
|
r((t) => {
|
|
26
27
|
const o = { ...t };
|
|
27
|
-
return o[e] = o[e].filter((T,
|
|
28
|
+
return o[e] = o[e].filter((T, x) => x !== n), o;
|
|
28
29
|
});
|
|
29
30
|
}, []);
|
|
30
|
-
return /* @__PURE__ */ d(
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
return /* @__PURE__ */ d(
|
|
32
|
+
E.Provider,
|
|
33
|
+
{
|
|
34
|
+
value: { updateElement: h, clearElements: f, removeElement: v, elementList: i },
|
|
35
|
+
children: s
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}, b = () => {
|
|
39
|
+
const s = P(E), { type: i } = L();
|
|
33
40
|
if (!s)
|
|
34
41
|
throw new Error("useElementPageContext must be used within a ElementPageProvider");
|
|
35
42
|
return i !== g.Organization ? {
|
|
36
43
|
updateElement: () => {
|
|
37
44
|
console.warn("This feature is only available in the organization version");
|
|
38
45
|
},
|
|
39
|
-
|
|
46
|
+
clearElements: () => {
|
|
40
47
|
console.warn("This feature is only available in the organization version");
|
|
41
48
|
},
|
|
42
49
|
removeElement: () => {
|
|
43
50
|
console.warn("This feature is only available in the organization version");
|
|
44
51
|
},
|
|
45
|
-
|
|
52
|
+
elementList: {}
|
|
46
53
|
} : s;
|
|
47
54
|
};
|
|
48
55
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
E as ElementPageContext,
|
|
57
|
+
_ as ElementPageProvider,
|
|
58
|
+
b as useElementPageContext
|
|
52
59
|
};
|
|
@@ -677,10 +677,10 @@ export interface useElementPage {
|
|
|
677
677
|
updateElement: (pageNumber: number, element: (prevElements: Array<HTMLElement | JSX.Element>, dimension: {
|
|
678
678
|
width: number;
|
|
679
679
|
height: number;
|
|
680
|
-
}, rotate: number) => Array<HTMLElement | JSX.Element>) => void;
|
|
680
|
+
}, rotate: number, zoomLevel: number) => Array<HTMLElement | JSX.Element>) => void;
|
|
681
681
|
removeElement: (pageNumber: number, index: number) => void;
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
clearElements: (pageNumber: number) => void;
|
|
683
|
+
elementList: Record<number, Array<HTMLElement | JSX.Element>>;
|
|
684
684
|
}
|
|
685
685
|
export interface MatchHighlight extends MatchValue {
|
|
686
686
|
keyword: string | RegExp;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState as g, useCallback as h, useEffect as A } from "react";
|
|
2
2
|
import { appConsole as c } from "../appConsole.js";
|
|
3
|
-
const b = /* @__PURE__ */ new Date("2025-07-17T02:
|
|
3
|
+
const b = /* @__PURE__ */ new Date("2025-07-17T02:49:43.071Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
|
|
4
4
|
invalidLicense: `You are currently using without a valid license. ${l}`,
|
|
5
5
|
mismatchedDomain: `Your license key is not valid for the current domain / IP. ${l}`,
|
|
6
6
|
expired: `Your license key has expired. ${l}`,
|