@pdf-viewer/react 1.4.2 → 1.4.3

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.
Files changed (64) hide show
  1. package/dist/Popover-b7402893.js +1445 -0
  2. package/dist/{RPDefaultLayout-e27ef121.js → RPDefaultLayout-f9017f0e.js} +606 -601
  3. package/dist/component-1da194e8.js +337 -0
  4. package/dist/components/RPConfig.js +270 -259
  5. package/dist/components/RPController.js +1 -1
  6. package/dist/components/RPPages.js +2 -2
  7. package/dist/components/RPProvider.js +12 -11
  8. package/dist/components/layout/LayoutContainer.js +3 -2
  9. package/dist/components/layout/RPDefaultLayout.js +1 -1
  10. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  11. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  12. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  13. package/dist/components/layout/toolbar/DocumentDialog.js +3 -2
  14. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  15. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  16. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  17. package/dist/components/layout/toolbar/MostPageTool.js +4 -3
  18. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  19. package/dist/components/layout/toolbar/Paginate.js +1 -1
  20. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  21. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  22. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  23. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  24. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  25. package/dist/components/layout/toolbar/SearchTool.js +4 -3
  26. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  28. package/dist/components/layout/toolbar/ZoomTool.js +4 -3
  29. package/dist/components/page/AnnotationLayer.js +3 -2
  30. package/dist/components/page/CanvasLayer.js +3 -2
  31. package/dist/components/page/DualPage.js +1 -1
  32. package/dist/components/page/RPPage.js +3 -2
  33. package/dist/components/page/SinglePage.js +1 -1
  34. package/dist/components/page/TextHighlightLayer.js +3 -2
  35. package/dist/components/page/TextLayer.js +3 -2
  36. package/dist/components/ui/Checkbox.js +111 -94
  37. package/dist/components/ui/DropDown.js +1 -1
  38. package/dist/components/ui/LoadingIndicator.js +1 -1
  39. package/dist/components/ui/Popover.js +1 -1
  40. package/dist/components/ui/RPTooltip.js +206 -205
  41. package/dist/contexts/PaginationContext.js +1 -1
  42. package/dist/contexts/PrintContext.js +1 -1
  43. package/dist/contexts/SearchContext.js +1 -1
  44. package/dist/contexts/ThumbnailsContext.js +1 -1
  45. package/dist/floating-ui.react-dom-15b9b819.js +1310 -0
  46. package/dist/index-0f08882b.js +1561 -0
  47. package/dist/index-10ac1200.js +150 -0
  48. package/dist/index-271658fe.js +331 -0
  49. package/dist/main.js +1 -1
  50. package/dist/types/utils/hooks/useWatermark.d.ts +1 -1
  51. package/dist/utils/hooks/useFileDownload.js +3 -2
  52. package/dist/utils/hooks/useLicense.js +1 -1
  53. package/dist/utils/hooks/usePaginate.js +3 -2
  54. package/dist/utils/hooks/usePrint.js +3 -2
  55. package/dist/utils/hooks/useScrollToPage.js +3 -2
  56. package/dist/utils/hooks/useSearch.js +3 -2
  57. package/dist/utils/hooks/useThumbnail.js +3 -2
  58. package/dist/utils/hooks/useVirtualReactWindow.js +3 -2
  59. package/dist/utils/hooks/useWatermark.js +59 -28
  60. package/package.json +2 -2
  61. package/dist/Popover-d11ec15c.js +0 -3061
  62. package/dist/floating-ui.react-dom-88a86594.js +0 -1447
  63. package/dist/index-48ca3f30.js +0 -307
  64. package/dist/index-4ba3ab9a.js +0 -1877
@@ -1,141 +1,158 @@
1
- import { jsxs as g, jsx as s } from "react/jsx-runtime";
2
- import * as c from "react";
3
- import { c as j, u as A, a as B, P as S, b as _, d as H, e as K } from "../../index-48ca3f30.js";
4
- import { CheckIcon as L } from "../icons/CheckIcon.js";
5
- import '../../assets/Checkbox.css';function q(e) {
6
- const r = c.useRef({ value: e, previous: e });
7
- return c.useMemo(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
1
+ import { jsxs as g, jsx as a } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { c as O, u as S, a as j, P, b as N, d as H, e as K } from "../../index-271658fe.js";
4
+ import { CheckIcon as T } from "../icons/CheckIcon.js";
5
+ import '../../assets/Checkbox.css';function U(e) {
6
+ const r = n.useRef({ value: e, previous: e });
7
+ return n.useMemo(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
8
8
  }
9
- var E = "Checkbox", [z, W] = j(E), [F, T] = z(E), w = c.forwardRef(
9
+ var v = "Checkbox", [q, Y] = O(v), [z, F] = q(v), w = n.forwardRef(
10
10
  (e, r) => {
11
11
  const {
12
12
  __scopeCheckbox: t,
13
- name: a,
14
- checked: f,
15
- defaultChecked: n,
16
- required: h,
13
+ name: i,
14
+ checked: p,
15
+ defaultChecked: c,
16
+ required: b,
17
17
  disabled: u,
18
- value: b = "on",
18
+ value: m = "on",
19
19
  onCheckedChange: C,
20
- form: l,
21
- ...x
22
- } = e, [i, m] = c.useState(null), v = A(r, (o) => m(o)), y = c.useRef(!1), I = i ? l || !!i.closest("form") : !0, [p = !1, P] = B({
23
- prop: f,
24
- defaultProp: n,
25
- onChange: C
26
- }), O = c.useRef(p);
27
- return c.useEffect(() => {
28
- const o = i == null ? void 0 : i.form;
29
- if (o) {
30
- const k = () => P(O.current);
31
- return o.addEventListener("reset", k), () => o.removeEventListener("reset", k);
20
+ form: k,
21
+ ...y
22
+ } = e, [o, R] = n.useState(null), I = S(r, (s) => R(s)), l = n.useRef(!1), x = o ? k || !!o.closest("form") : !0, [f, E] = j({
23
+ prop: p,
24
+ defaultProp: c ?? !1,
25
+ onChange: C,
26
+ caller: v
27
+ }), L = n.useRef(f);
28
+ return n.useEffect(() => {
29
+ const s = o == null ? void 0 : o.form;
30
+ if (s) {
31
+ const h = () => E(L.current);
32
+ return s.addEventListener("reset", h), () => s.removeEventListener("reset", h);
32
33
  }
33
- }, [i, P]), /* @__PURE__ */ g(F, { scope: t, state: p, disabled: u, children: [
34
- /* @__PURE__ */ s(
35
- S.button,
34
+ }, [o, E]), /* @__PURE__ */ g(z, { scope: t, state: f, disabled: u, children: [
35
+ /* @__PURE__ */ a(
36
+ P.button,
36
37
  {
37
38
  type: "button",
38
39
  role: "checkbox",
39
- "aria-checked": d(p) ? "mixed" : p,
40
- "aria-required": h,
41
- "data-state": M(p),
40
+ "aria-checked": d(f) ? "mixed" : f,
41
+ "aria-required": b,
42
+ "data-state": A(f),
42
43
  "data-disabled": u ? "" : void 0,
43
44
  disabled: u,
44
- value: b,
45
- ...x,
46
- ref: v,
47
- onKeyDown: _(e.onKeyDown, (o) => {
48
- o.key === "Enter" && o.preventDefault();
45
+ value: m,
46
+ ...y,
47
+ ref: I,
48
+ onKeyDown: N(e.onKeyDown, (s) => {
49
+ s.key === "Enter" && s.preventDefault();
49
50
  }),
50
- onClick: _(e.onClick, (o) => {
51
- P((k) => d(k) ? !0 : !k), I && (y.current = o.isPropagationStopped(), y.current || o.stopPropagation());
51
+ onClick: N(e.onClick, (s) => {
52
+ E((h) => d(h) ? !0 : !h), x && (l.current = s.isPropagationStopped(), l.current || s.stopPropagation());
52
53
  })
53
54
  }
54
55
  ),
55
- I && /* @__PURE__ */ s(
56
- X,
56
+ x && /* @__PURE__ */ a(
57
+ D,
57
58
  {
58
- control: i,
59
- bubbles: !y.current,
60
- name: a,
61
- value: b,
62
- checked: p,
63
- required: h,
59
+ control: o,
60
+ bubbles: !l.current,
61
+ name: i,
62
+ value: m,
63
+ checked: f,
64
+ required: b,
64
65
  disabled: u,
65
- form: l,
66
+ form: k,
66
67
  style: { transform: "translateX(-100%)" },
67
- defaultChecked: d(n) ? !1 : n
68
+ defaultChecked: d(c) ? !1 : c
68
69
  }
69
70
  )
70
71
  ] });
71
72
  }
72
73
  );
73
- w.displayName = E;
74
- var N = "CheckboxIndicator", D = c.forwardRef(
74
+ w.displayName = v;
75
+ var B = "CheckboxIndicator", M = n.forwardRef(
75
76
  (e, r) => {
76
- const { __scopeCheckbox: t, forceMount: a, ...f } = e, n = T(N, t);
77
- return /* @__PURE__ */ s(H, { present: a || d(n.state) || n.state === !0, children: /* @__PURE__ */ s(
78
- S.span,
77
+ const { __scopeCheckbox: t, forceMount: i, ...p } = e, c = F(B, t);
78
+ return /* @__PURE__ */ a(H, { present: i || d(c.state) || c.state === !0, children: /* @__PURE__ */ a(
79
+ P.span,
79
80
  {
80
- "data-state": M(n.state),
81
- "data-disabled": n.disabled ? "" : void 0,
82
- ...f,
81
+ "data-state": A(c.state),
82
+ "data-disabled": c.disabled ? "" : void 0,
83
+ ...p,
83
84
  ref: r,
84
85
  style: { pointerEvents: "none", ...e.style }
85
86
  }
86
87
  ) });
87
88
  }
88
89
  );
89
- D.displayName = N;
90
- var X = (e) => {
91
- const { control: r, checked: t, bubbles: a = !0, defaultChecked: f, ...n } = e, h = c.useRef(null), u = q(t), b = K(r);
92
- c.useEffect(() => {
93
- const l = h.current, x = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(x, "checked").set;
94
- if (u !== t && m) {
95
- const v = new Event("click", { bubbles: a });
96
- l.indeterminate = d(t), m.call(l, d(t) ? !1 : t), l.dispatchEvent(v);
97
- }
98
- }, [u, t, a]);
99
- const C = c.useRef(d(t) ? !1 : t);
100
- return /* @__PURE__ */ s(
101
- "input",
102
- {
103
- type: "checkbox",
104
- "aria-hidden": !0,
105
- defaultChecked: f ?? C.current,
106
- ...n,
107
- tabIndex: -1,
108
- ref: h,
109
- style: {
110
- ...e.style,
111
- ...b,
112
- position: "absolute",
113
- pointerEvents: "none",
114
- opacity: 0,
115
- margin: 0
90
+ M.displayName = B;
91
+ var X = "CheckboxBubbleInput", D = n.forwardRef(
92
+ ({
93
+ __scopeCheckbox: e,
94
+ control: r,
95
+ checked: t,
96
+ bubbles: i = !0,
97
+ defaultChecked: p,
98
+ ...c
99
+ }, b) => {
100
+ const u = n.useRef(null), m = S(u, b), C = U(t), k = K(r);
101
+ n.useEffect(() => {
102
+ const o = u.current;
103
+ if (!o)
104
+ return;
105
+ const R = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(
106
+ R,
107
+ "checked"
108
+ ).set;
109
+ if (C !== t && l) {
110
+ const x = new Event("click", { bubbles: i });
111
+ o.indeterminate = d(t), l.call(o, d(t) ? !1 : t), o.dispatchEvent(x);
116
112
  }
117
- }
118
- );
119
- };
113
+ }, [C, t, i]);
114
+ const y = n.useRef(d(t) ? !1 : t);
115
+ return /* @__PURE__ */ a(
116
+ P.input,
117
+ {
118
+ type: "checkbox",
119
+ "aria-hidden": !0,
120
+ defaultChecked: p ?? y.current,
121
+ ...c,
122
+ tabIndex: -1,
123
+ ref: m,
124
+ style: {
125
+ ...c.style,
126
+ ...k,
127
+ position: "absolute",
128
+ pointerEvents: "none",
129
+ opacity: 0,
130
+ margin: 0
131
+ }
132
+ }
133
+ );
134
+ }
135
+ );
136
+ D.displayName = X;
120
137
  function d(e) {
121
138
  return e === "indeterminate";
122
139
  }
123
- function M(e) {
140
+ function A(e) {
124
141
  return d(e) ? "indeterminate" : e ? "checked" : "unchecked";
125
142
  }
126
- var U = w, G = D;
127
- const R = {
143
+ var G = w, J = M;
144
+ const _ = {
128
145
  "rp-checkbox": "_rp-checkbox_188mv_1",
129
146
  "rp-checkbox-indicator": "_rp-checkbox-indicator_188mv_21"
130
- }, Y = ({
147
+ }, Z = ({
131
148
  children: e,
132
149
  value: r,
133
150
  name: t,
134
- onChange: a
151
+ onChange: i
135
152
  }) => /* @__PURE__ */ g("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
136
- /* @__PURE__ */ s(U, { className: R["rp-checkbox"], checked: r, id: t, onCheckedChange: a, children: /* @__PURE__ */ s(G, { className: R["rp-checkbox-indicator"], children: /* @__PURE__ */ s(L, {}) }) }),
137
- /* @__PURE__ */ s("label", { className: R["rp-checkbox-label"], htmlFor: t, children: e })
153
+ /* @__PURE__ */ a(G, { className: _["rp-checkbox"], checked: r, id: t, onCheckedChange: i, children: /* @__PURE__ */ a(J, { className: _["rp-checkbox-indicator"], children: /* @__PURE__ */ a(T, {}) }) }),
154
+ /* @__PURE__ */ a("label", { className: _["rp-checkbox-label"], htmlFor: t, children: e })
138
155
  ] });
139
156
  export {
140
- Y as UICheckbox
157
+ Z as UICheckbox
141
158
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as i, jsx as d } from "react/jsx-runtime";
2
- import { R as l, T as c, P as p, C as _ } from "../../index-4ba3ab9a.js";
2
+ import { R as l, T as c, P as p, C as _ } from "../../index-0f08882b.js";
3
3
  import { c as m } from "../../clsx-0c6e471a.js";
4
4
  import '../../assets/DropDown.css';const A = "_slideDownAndFade_d12em_1", F = "_slideLeftAndFade_d12em_1", w = "_slideUpAndFade_d12em_1", f = "_slideRightAndFade_d12em_1", g = {
5
5
  "rp-dropdown-content": "_rp-dropdown-content_d12em_1",
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { L as i } from "../../RPDefaultLayout-e27ef121.js";
2
+ import { L as i } from "../../RPDefaultLayout-f9017f0e.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  import "../../contexts/LocalizationContext.js";
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { U as t } from "../../Popover-d11ec15c.js";
2
+ import { U as t } from "../../Popover-b7402893.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  export {
5
5
  t as UIPopOver