@pdf-viewer/react 1.8.5-rc.5 → 1.8.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.
Files changed (60) hide show
  1. package/dist/{RPDefaultLayout-2fc9f5ab.js → RPDefaultLayout-9c9a2159.js} +750 -756
  2. package/dist/assets/RPDefaultLayout.css +1 -1
  3. package/dist/components/RPConfig.js +673 -691
  4. package/dist/components/RPController.js +1 -1
  5. package/dist/components/RPPages.js +1 -1
  6. package/dist/components/layout/LayoutContainer.js +1 -1
  7. package/dist/components/layout/RPDefaultLayout.js +1 -1
  8. package/dist/components/layout/sidebar/RPSidebar.js +1 -1
  9. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  10. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  11. package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
  12. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  13. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  14. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  15. package/dist/components/layout/toolbar/MostPageTool.js +2 -2
  16. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  17. package/dist/components/layout/toolbar/Paginate.js +1 -1
  18. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  19. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  20. package/dist/components/layout/toolbar/RPToolbarEnd.js +1 -1
  21. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  22. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  23. package/dist/components/layout/toolbar/SearchResultNavigator.js +1 -1
  24. package/dist/components/layout/toolbar/SearchTool.js +1 -1
  25. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  27. package/dist/components/layout/toolbar/ZoomTool.js +2 -2
  28. package/dist/components/page/AnnotationLayer.js +1 -1
  29. package/dist/components/page/CanvasLayer.js +1 -1
  30. package/dist/components/page/DualPage.js +1 -1
  31. package/dist/components/page/RPPage.js +1 -1
  32. package/dist/components/page/SinglePage.js +1 -1
  33. package/dist/components/page/TextHighlightLayer.js +1 -1
  34. package/dist/components/page/TextLayer.js +1 -1
  35. package/dist/components/ui/Checkbox.js +125 -237
  36. package/dist/components/ui/DropDown.js +1 -1
  37. package/dist/components/ui/LoadingIndicator.js +1 -1
  38. package/dist/components/ui/RPTooltip.js +424 -211
  39. package/dist/contexts/PaginationContext.js +1 -1
  40. package/dist/contexts/PrintContext.js +1 -1
  41. package/dist/contexts/RenderQueueProvider.js +1 -1
  42. package/dist/contexts/SearchContext.js +1 -1
  43. package/dist/contexts/ThumbnailsContext.js +1 -1
  44. package/dist/floating-ui.react-dom-88a86594.js +1447 -0
  45. package/dist/index-48ca3f30.js +307 -0
  46. package/dist/index-4ba3ab9a.js +1877 -0
  47. package/dist/main.js +1 -1
  48. package/dist/utils/hooks/useFileDownload.js +1 -1
  49. package/dist/utils/hooks/useLicense.js +1 -1
  50. package/dist/utils/hooks/usePaginate.js +1 -1
  51. package/dist/utils/hooks/usePresentPage.js +1 -1
  52. package/dist/utils/hooks/usePrint.js +1 -1
  53. package/dist/utils/hooks/useScrollToPage.js +1 -1
  54. package/dist/utils/hooks/useSearch.js +1 -1
  55. package/dist/utils/hooks/useThumbnail.js +1 -1
  56. package/dist/utils/hooks/useVirtualReactWindow.js +1 -1
  57. package/package.json +1 -1
  58. package/dist/index-0da31711.js +0 -1672
  59. package/dist/index-a7d7ef35.js +0 -1681
  60. package/dist/index-ebf0eeb9.js +0 -332
@@ -1,264 +1,152 @@
1
- import { jsx as i, jsxs as w, Fragment as U } from "react/jsx-runtime";
2
- import * as s from "react";
3
- import { c as z, a as B, P as E, b as S, d as G, f as K, u as X } from "../../index-ebf0eeb9.js";
4
- import { CheckIcon as J } from "../icons/CheckIcon.js";
5
- import '../../assets/Checkbox.css';function Q(e) {
6
- const r = s.useRef({ value: e, previous: e });
7
- return s.useMemo(() => (r.current.value !== e && (r.current.previous = r.current.value, r.current.value = e), r.current.previous), [e]);
1
+ import { jsxs as _, 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 w, b as I, 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]);
8
8
  }
9
- var g = "Checkbox", [V, re] = z(g), [W, P] = V(g);
10
- function Y(e) {
11
- const {
12
- __scopeCheckbox: r,
13
- checked: o,
14
- children: d,
15
- defaultChecked: n,
16
- disabled: t,
17
- form: h,
18
- name: f,
19
- onCheckedChange: u,
20
- required: k,
21
- value: C = "on",
22
- // @ts-expect-error
23
- internal_do_not_use_render: l
24
- } = e, [p, v] = X({
25
- prop: o,
26
- defaultProp: n ?? !1,
27
- onChange: u,
28
- caller: g
29
- }), [m, x] = s.useState(null), [_, c] = s.useState(null), a = s.useRef(!1), I = m ? !!h || !!m.closest("form") : (
30
- // We set this to true by default so that events bubble to forms without JS (SSR)
31
- !0
32
- ), R = {
33
- checked: p,
34
- disabled: t,
35
- setChecked: v,
36
- control: m,
37
- setControl: x,
38
- name: f,
39
- form: h,
40
- value: C,
41
- hasConsumerStoppedPropagationRef: a,
42
- required: k,
43
- defaultChecked: b(n) ? !1 : n,
44
- isFormControl: I,
45
- bubbleInput: _,
46
- setBubbleInput: c
47
- };
48
- return /* @__PURE__ */ i(
49
- W,
50
- {
51
- scope: r,
52
- ...R,
53
- children: Z(l) ? l(R) : d
54
- }
55
- );
56
- }
57
- var M = "CheckboxTrigger", T = s.forwardRef(
58
- ({ __scopeCheckbox: e, onKeyDown: r, onClick: o, ...d }, n) => {
59
- const {
60
- control: t,
61
- value: h,
62
- disabled: f,
63
- checked: u,
64
- required: k,
65
- setControl: C,
66
- setChecked: l,
67
- hasConsumerStoppedPropagationRef: p,
68
- isFormControl: v,
69
- bubbleInput: m
70
- } = P(M, e), x = B(n, C), _ = s.useRef(u);
71
- return s.useEffect(() => {
72
- const c = t == null ? void 0 : t.form;
73
- if (c) {
74
- const a = () => l(_.current);
75
- return c.addEventListener("reset", a), () => c.removeEventListener("reset", a);
76
- }
77
- }, [t, l]), /* @__PURE__ */ i(
78
- E.button,
79
- {
80
- type: "button",
81
- role: "checkbox",
82
- "aria-checked": b(u) ? "mixed" : u,
83
- "aria-required": k,
84
- "data-state": O(u),
85
- "data-disabled": f ? "" : void 0,
86
- disabled: f,
87
- value: h,
88
- ...d,
89
- ref: x,
90
- onKeyDown: S(r, (c) => {
91
- c.key === "Enter" && c.preventDefault();
92
- }),
93
- onClick: S(o, (c) => {
94
- l((a) => b(a) ? !0 : !a), m && v && (p.current = c.isPropagationStopped(), p.current || c.stopPropagation());
95
- })
96
- }
97
- );
98
- }
99
- );
100
- T.displayName = M;
101
- var q = s.forwardRef(
9
+ var E = "Checkbox", [z, W] = j(E), [F, T] = z(E), S = c.forwardRef(
102
10
  (e, r) => {
103
11
  const {
104
- __scopeCheckbox: o,
105
- name: d,
106
- checked: n,
107
- defaultChecked: t,
12
+ __scopeCheckbox: t,
13
+ name: a,
14
+ checked: u,
15
+ defaultChecked: n,
108
16
  required: h,
109
- disabled: f,
110
- value: u,
111
- onCheckedChange: k,
112
- form: C,
113
- ...l
114
- } = e;
115
- return /* @__PURE__ */ i(
116
- Y,
117
- {
118
- __scopeCheckbox: o,
119
- checked: n,
120
- defaultChecked: t,
121
- disabled: f,
122
- required: h,
123
- onCheckedChange: k,
124
- name: d,
125
- form: C,
126
- value: u,
127
- internal_do_not_use_render: ({ isFormControl: p }) => /* @__PURE__ */ w(U, { children: [
128
- /* @__PURE__ */ i(
129
- T,
130
- {
131
- ...l,
132
- ref: r,
133
- __scopeCheckbox: o
134
- }
135
- ),
136
- p && /* @__PURE__ */ i(
137
- L,
138
- {
139
- __scopeCheckbox: o
140
- }
141
- )
142
- ] })
17
+ disabled: l,
18
+ value: b = "on",
19
+ onCheckedChange: m,
20
+ form: p,
21
+ ...x
22
+ } = e, [i, C] = c.useState(null), v = A(r, (o) => C(o)), y = c.useRef(!1), g = i ? p || !!i.closest("form") : !0, [f = !1, P] = B({
23
+ prop: u,
24
+ defaultProp: n,
25
+ onChange: m
26
+ }), O = c.useRef(f);
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);
143
32
  }
144
- );
33
+ }, [i, P]), /* @__PURE__ */ _(F, { scope: t, state: f, disabled: l, children: [
34
+ /* @__PURE__ */ s(
35
+ w.button,
36
+ {
37
+ type: "button",
38
+ role: "checkbox",
39
+ "aria-checked": d(f) ? "mixed" : f,
40
+ "aria-required": h,
41
+ "data-state": M(f),
42
+ "data-disabled": l ? "" : void 0,
43
+ disabled: l,
44
+ value: b,
45
+ ...x,
46
+ ref: v,
47
+ onKeyDown: I(e.onKeyDown, (o) => {
48
+ o.key === "Enter" && o.preventDefault();
49
+ }),
50
+ onClick: I(e.onClick, (o) => {
51
+ P((k) => d(k) ? !0 : !k), g && (y.current = o.isPropagationStopped(), y.current || o.stopPropagation());
52
+ })
53
+ }
54
+ ),
55
+ g && /* @__PURE__ */ s(
56
+ X,
57
+ {
58
+ control: i,
59
+ bubbles: !y.current,
60
+ name: a,
61
+ value: b,
62
+ checked: f,
63
+ required: h,
64
+ disabled: l,
65
+ form: p,
66
+ style: { transform: "translateX(-100%)" },
67
+ defaultChecked: d(n) ? !1 : n
68
+ }
69
+ )
70
+ ] });
145
71
  }
146
72
  );
147
- q.displayName = g;
148
- var A = "CheckboxIndicator", F = s.forwardRef(
73
+ S.displayName = E;
74
+ var N = "CheckboxIndicator", D = c.forwardRef(
149
75
  (e, r) => {
150
- const { __scopeCheckbox: o, forceMount: d, ...n } = e, t = P(A, o);
151
- return /* @__PURE__ */ i(
152
- G,
76
+ const { __scopeCheckbox: t, forceMount: a, ...u } = e, n = T(N, t);
77
+ return /* @__PURE__ */ s(H, { present: a || d(n.state) || n.state === !0, children: /* @__PURE__ */ s(
78
+ w.span,
153
79
  {
154
- present: d || b(t.checked) || t.checked === !0,
155
- children: /* @__PURE__ */ i(
156
- E.span,
157
- {
158
- "data-state": O(t.checked),
159
- "data-disabled": t.disabled ? "" : void 0,
160
- ...n,
161
- ref: r,
162
- style: { pointerEvents: "none", ...e.style }
163
- }
164
- )
80
+ "data-state": M(n.state),
81
+ "data-disabled": n.disabled ? "" : void 0,
82
+ ...u,
83
+ ref: r,
84
+ style: { pointerEvents: "none", ...e.style }
165
85
  }
166
- );
86
+ ) });
167
87
  }
168
88
  );
169
- F.displayName = A;
170
- var D = "CheckboxBubbleInput", L = s.forwardRef(
171
- ({ __scopeCheckbox: e, ...r }, o) => {
172
- const {
173
- control: d,
174
- hasConsumerStoppedPropagationRef: n,
175
- checked: t,
176
- defaultChecked: h,
177
- required: f,
178
- disabled: u,
179
- name: k,
180
- value: C,
181
- form: l,
182
- bubbleInput: p,
183
- setBubbleInput: v
184
- } = P(D, e), m = B(o, v), x = Q(t), _ = K(d);
185
- s.useEffect(() => {
186
- const a = p;
187
- if (!a)
188
- return;
189
- const I = window.HTMLInputElement.prototype, N = Object.getOwnPropertyDescriptor(
190
- I,
191
- "checked"
192
- ).set, j = !n.current;
193
- if (x !== t && N) {
194
- const H = new Event("click", { bubbles: j });
195
- a.indeterminate = b(t), N.call(a, b(t) ? !1 : t), a.dispatchEvent(H);
196
- }
197
- }, [p, x, t, n]);
198
- const c = s.useRef(b(t) ? !1 : t);
199
- return /* @__PURE__ */ i(
200
- E.input,
201
- {
202
- type: "checkbox",
203
- "aria-hidden": !0,
204
- defaultChecked: h ?? c.current,
205
- required: f,
206
- disabled: u,
207
- name: k,
208
- value: C,
209
- form: l,
210
- ...r,
211
- tabIndex: -1,
212
- ref: m,
213
- style: {
214
- ...r.style,
215
- ..._,
216
- position: "absolute",
217
- pointerEvents: "none",
218
- opacity: 0,
219
- margin: 0,
220
- // We transform because the input is absolutely positioned but we have
221
- // rendered it **after** the button. This pulls it back to sit on top
222
- // of the button.
223
- transform: "translateX(-100%)"
224
- }
89
+ D.displayName = N;
90
+ var X = (e) => {
91
+ const { control: r, checked: t, bubbles: a = !0, defaultChecked: u, ...n } = e, h = c.useRef(null), l = q(t), b = K(r);
92
+ c.useEffect(() => {
93
+ const p = h.current, x = window.HTMLInputElement.prototype, C = Object.getOwnPropertyDescriptor(x, "checked").set;
94
+ if (l !== t && C) {
95
+ const v = new Event("click", { bubbles: a });
96
+ p.indeterminate = d(t), C.call(p, d(t) ? !1 : t), p.dispatchEvent(v);
97
+ }
98
+ }, [l, t, a]);
99
+ const m = c.useRef(d(t) ? !1 : t);
100
+ return /* @__PURE__ */ s(
101
+ "input",
102
+ {
103
+ type: "checkbox",
104
+ "aria-hidden": !0,
105
+ defaultChecked: u ?? m.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
225
116
  }
226
- );
227
- }
228
- );
229
- L.displayName = D;
230
- function Z(e) {
231
- return typeof e == "function";
232
- }
233
- function b(e) {
117
+ }
118
+ );
119
+ };
120
+ function d(e) {
234
121
  return e === "indeterminate";
235
122
  }
236
- function O(e) {
237
- return b(e) ? "indeterminate" : e ? "checked" : "unchecked";
123
+ function M(e) {
124
+ return d(e) ? "indeterminate" : e ? "checked" : "unchecked";
238
125
  }
239
- const y = {
126
+ var U = S, G = D;
127
+ const R = {
240
128
  "rp-checkbox": "_rp-checkbox_1vwg8_1",
241
129
  "rp-checkbox-indicator": "_rp-checkbox-indicator_1vwg8_25"
242
- }, oe = ({
130
+ }, Y = ({
243
131
  children: e,
244
132
  value: r,
245
- name: o,
246
- onChange: d,
247
- tabIndex: n
248
- }) => /* @__PURE__ */ w("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
249
- /* @__PURE__ */ i(
250
- q,
133
+ name: t,
134
+ onChange: a,
135
+ tabIndex: u
136
+ }) => /* @__PURE__ */ _("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
137
+ /* @__PURE__ */ s(
138
+ U,
251
139
  {
252
- tabIndex: n,
253
- className: y["rp-checkbox"],
140
+ tabIndex: u,
141
+ className: R["rp-checkbox"],
254
142
  checked: r,
255
- id: o,
256
- onCheckedChange: d,
257
- children: /* @__PURE__ */ i(F, { className: y["rp-checkbox-indicator"], children: /* @__PURE__ */ i(J, {}) })
143
+ id: t,
144
+ onCheckedChange: a,
145
+ children: /* @__PURE__ */ s(G, { className: R["rp-checkbox-indicator"], children: /* @__PURE__ */ s(L, {}) })
258
146
  }
259
147
  ),
260
- /* @__PURE__ */ i("label", { className: y["rp-checkbox-label"], htmlFor: o, children: e })
148
+ /* @__PURE__ */ s("label", { className: R["rp-checkbox-label"], htmlFor: t, children: e })
261
149
  ] });
262
150
  export {
263
- oe as UICheckbox
151
+ Y as UICheckbox
264
152
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as l, jsx as d } from "react/jsx-runtime";
2
- import { R as p, T as c, P as _, C as A } from "../../index-0da31711.js";
2
+ import { R as p, T as c, P as _, C as A } from "../../index-4ba3ab9a.js";
3
3
  import { c as F } from "../../clsx-0c6e471a.js";
4
4
  import '../../assets/DropDown.css';const w = "_slideDownAndFade_1vzkq_1", m = "_slideLeftAndFade_1vzkq_1", f = "_slideUpAndFade_1vzkq_1", g = "_slideRightAndFade_1vzkq_1", h = {
5
5
  "rp-dropdown-content": "_rp-dropdown-content_1vzkq_1",
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { J as i } from "../../RPDefaultLayout-2fc9f5ab.js";
2
+ import { J as i } from "../../RPDefaultLayout-9c9a2159.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  import "../../contexts/LocalizationContext.js";
5
5
  export {