@pdf-viewer/react 1.8.0-beta.5 → 1.8.0-beta.6

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.
@@ -1,59 +1,60 @@
1
- import { jsx as d } from "react/jsx-runtime";
2
- import { createContext as w, useState as C, useCallback as a, useContext as P } from "react";
3
- import { LicenseType as g } from "../utils/types.js";
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(
10
- (e, n) => {
11
- r((t) => {
12
- const o = { width: l[e], height: m[e] };
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { createContext as h, useState as L, useCallback as i, useContext as v } from "react";
3
+ import { LicenseType as w } from "../utils/types.js";
4
+ import { useDimensionPagesContext as g } from "./DimensionPagesContext.js";
5
+ import { usePagesRotateContext as A } from "./PagesRotateContext.js";
6
+ import { useLicenseContext as O } from "./LicenseContext.js";
7
+ import { useZoomContext as R } from "./ZoomContext.js";
8
+ import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as l } from "../utils/const.js";
9
+ const x = h(void 0), j = ({ children: r }) => {
10
+ const [s, m] = L({}), { widths: c, heights: E } = g(), { pageRotate: a } = A(), { zoomLevel: u } = R(), d = i(
11
+ (e, o) => {
12
+ m((t) => {
13
+ const n = { width: c[e], height: E[e] };
13
14
  return {
14
15
  ...t,
15
- [e]: n(t[e], o, c[e], u)
16
+ [e]: o(t[e], n, a[e], u)
16
17
  };
17
18
  });
18
19
  },
19
- [l, m, u, c]
20
- ), f = a((e) => {
21
- r((n) => {
22
- const t = { ...n };
20
+ [c, E, u, a]
21
+ ), f = i((e) => {
22
+ m((o) => {
23
+ const t = { ...o };
23
24
  return delete t[e], t;
24
25
  });
25
- }, []), v = a((e, n) => {
26
- r((t) => {
27
- const o = { ...t };
28
- return o[e] = o[e].filter((T, x) => x !== n), o;
26
+ }, []), C = i((e, o) => {
27
+ m((t) => {
28
+ const n = { ...t };
29
+ return n[e] = n[e].filter((S, P) => P !== o), n;
29
30
  });
30
31
  }, []);
31
- return /* @__PURE__ */ d(
32
- E.Provider,
32
+ return /* @__PURE__ */ p(
33
+ x.Provider,
33
34
  {
34
- value: { updateElement: h, clearElements: f, removeElement: v, elementList: i },
35
- children: s
35
+ value: { updateElement: d, clearElements: f, removeElement: C, elementList: s },
36
+ children: r
36
37
  }
37
38
  );
38
- }, b = () => {
39
- const s = P(E), { type: i } = L();
40
- if (!s)
39
+ }, k = () => {
40
+ const r = v(x), { type: s } = O();
41
+ if (!r)
41
42
  throw new Error("useElementPageContext must be used within a ElementPageProvider");
42
- return i !== g.Organization ? {
43
+ return s !== w.Organization ? {
43
44
  updateElement: () => {
44
- console.warn("This feature is only available in the organization version");
45
+ console.error(l);
45
46
  },
46
47
  clearElements: () => {
47
- console.warn("This feature is only available in the organization version");
48
+ console.error(l);
48
49
  },
49
50
  removeElement: () => {
50
- console.warn("This feature is only available in the organization version");
51
+ console.error(l);
51
52
  },
52
53
  elementList: {}
53
- } : s;
54
+ } : r;
54
55
  };
55
56
  export {
56
- E as ElementPageContext,
57
- _ as ElementPageProvider,
58
- b as useElementPageContext
57
+ x as ElementPageContext,
58
+ j as ElementPageProvider,
59
+ k as useElementPageContext
59
60
  };
@@ -1,2 +1,3 @@
1
1
  import { NormalizedKeyword } from './types';
2
2
  export declare const EMPTY_KEYWORD_REGEXP: NormalizedKeyword;
3
+ export declare const ORGANIZATION_ALLOWED_FEATURES_MESSAGE = "This feature is only available for the Organization license";
@@ -2,7 +2,8 @@ const e = {
2
2
  keyword: "",
3
3
  regExp: new RegExp(" "),
4
4
  wholeWords: !1
5
- };
5
+ }, E = "This feature is only available for the Organization license";
6
6
  export {
7
- e as EMPTY_KEYWORD_REGEXP
7
+ e as EMPTY_KEYWORD_REGEXP,
8
+ E as ORGANIZATION_ALLOWED_FEATURES_MESSAGE
8
9
  };
@@ -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:49:43.071Z"), l = "Please visit https://www.react-pdf.dev/manage-license/ to generate a new license key.", s = {
3
+ const b = /* @__PURE__ */ new Date("2025-07-17T03:26:14.130Z"), 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}`,
@@ -1,26 +1,27 @@
1
- import { useCallback as s } from "react";
1
+ import { useCallback as a } from "react";
2
2
  import { usePagesRotateContext as c } from "../../contexts/PagesRotateContext.js";
3
- import { useLicenseContext as l } from "../../contexts/LicenseContext.js";
4
- import { LicenseType as u } from "../types.js";
5
- const y = () => {
6
- const { setSinglePageRotate: n } = c(), { type: r } = l(), a = s(
7
- (i, t) => {
3
+ import { useLicenseContext as m } from "../../contexts/LicenseContext.js";
4
+ import { LicenseType as f } from "../types.js";
5
+ import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as u } from "../const.js";
6
+ const E = () => {
7
+ const { setSinglePageRotate: n } = c(), { type: s } = m(), i = a(
8
+ (r, t) => {
8
9
  n((e) => {
9
- const o = typeof t == "function" ? t(e[i] || 0) : t;
10
+ const o = typeof t == "function" ? t(e[r] || 0) : t;
10
11
  return o % 90 !== 0 ? (console.warn("rotationDegree must be a multiple of 90 got", o), e) : {
11
12
  ...e,
12
- [i]: o
13
+ [r]: o
13
14
  };
14
15
  });
15
16
  },
16
17
  [n]
17
18
  );
18
- return r !== u.Organization ? {
19
+ return s !== f.Organization ? {
19
20
  rotate: () => {
20
- console.warn("This feature is only available in the organization version");
21
+ console.error(u);
21
22
  }
22
- } : { rotate: a };
23
+ } : { rotate: i };
23
24
  };
24
25
  export {
25
- y as usePageRotateContext
26
+ E as usePageRotateContext
26
27
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pdf-viewer/react",
3
3
  "private": false,
4
4
  "description": "The PDF Viewer component for React and Next.js",
5
- "version": "1.8.0-beta.5",
5
+ "version": "1.8.0-beta.6",
6
6
  "keywords": [
7
7
  "component",
8
8
  "frontend",