@pdf-viewer/react 0.4.0-beta.1 → 0.4.0-beta.2

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 (68) hide show
  1. package/dist/Container-cea98fc1.js +37 -0
  2. package/dist/RPLayout-608b83dd.js +2756 -0
  3. package/dist/components/RPController.js +16 -47
  4. package/dist/components/RPDocument.js +13 -4
  5. package/dist/components/RPDropFileZone.js +18 -17
  6. package/dist/components/RPViewer.js +12 -22
  7. package/dist/components/layout/Container.js +6 -26
  8. package/dist/components/layout/RPLayout.js +14 -57
  9. package/dist/components/layout/WrapperLayout.js +9 -8
  10. package/dist/components/layout/sidebar/RPSidebar.js +9 -32
  11. package/dist/components/layout/sidebar/RPSplitter.js +9 -7
  12. package/dist/components/layout/sidebar/Thumbnail.js +1 -1
  13. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  14. package/dist/components/layout/toolbar/DocumentDialog.js +7 -21
  15. package/dist/components/layout/toolbar/FileDownloadTool.js +1 -1
  16. package/dist/components/layout/toolbar/MenuItem.js +1 -1
  17. package/dist/components/layout/toolbar/MenuSeparator.js +1 -1
  18. package/dist/components/layout/toolbar/MostPageTool.js +9 -23
  19. package/dist/components/layout/toolbar/OtherTool.js +2 -2
  20. package/dist/components/layout/toolbar/Paginate.js +1 -1
  21. package/dist/components/layout/toolbar/PrintTool.js +1 -1
  22. package/dist/components/layout/toolbar/RPToolbar.js +1 -1
  23. package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
  24. package/dist/components/layout/toolbar/RotateTool.js +1 -1
  25. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  26. package/dist/components/layout/toolbar/SearchTool.js +7 -19
  27. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  28. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  29. package/dist/components/layout/toolbar/ZoomTool.js +8 -19
  30. package/dist/components/page/AnnotationLayer.js +9 -23
  31. package/dist/components/page/CanvasLayer.js +7 -22
  32. package/dist/components/page/DualPage.js +1 -1
  33. package/dist/components/page/RPPage.js +8 -22
  34. package/dist/components/page/SinglePage.js +1 -1
  35. package/dist/components/page/TextLayer.js +7 -22
  36. package/dist/components/ui/Checkbox.js +242 -130
  37. package/dist/components/ui/DropDown.js +1 -1
  38. package/dist/components/ui/LoadingIndicator.js +1 -1
  39. package/dist/contexts/PaginateContext.js +3 -3
  40. package/dist/contexts/PrintContext.js +2 -2
  41. package/dist/contexts/RPDocumentContext.js +33 -25
  42. package/dist/contexts/SearchContext.js +3 -3
  43. package/dist/contexts/ThumbnailsContext.js +4 -4
  44. package/dist/{index-3459164c.js → index-8049287f.js} +982 -952
  45. package/dist/main.js +31 -32
  46. package/dist/types/components/layout/RPLayout.d.ts +1 -2
  47. package/dist/types/contexts/RPDocumentContext.d.ts +4 -2
  48. package/dist/types/main.d.ts +1 -0
  49. package/dist/types/utils/hooks/useLoadPdf.d.ts +2 -2
  50. package/dist/types/utils/types.d.ts +9 -2
  51. package/dist/utils/hooks/useFileDownload.js +7 -22
  52. package/dist/utils/hooks/useLicense.js +15 -23
  53. package/dist/utils/hooks/useLoadPdf.js +27 -27
  54. package/dist/utils/hooks/usePaginate.js +8 -21
  55. package/dist/utils/hooks/usePrint.js +7 -22
  56. package/dist/utils/hooks/useScrollToPage.js +9 -21
  57. package/dist/utils/hooks/useSearch.js +9 -22
  58. package/dist/utils/hooks/useThumbnail.js +7 -22
  59. package/dist/utils/hooks/useVirtualReactWindow.js +9 -21
  60. package/package.json +1 -1
  61. package/dist/Container.module-cb7b45b9.js +0 -14
  62. package/dist/RPSplitter.module-13d612c4.js +0 -7
  63. package/dist/RPTheme.module-f756e5cd.js +0 -7
  64. package/dist/Thumbnails-06fa1aa5.js +0 -2657
  65. package/dist/WrapperLayout.module-147bc943.js +0 -6
  66. package/dist/index-743c36f0.js +0 -139
  67. /package/dist/assets/{RPTheme.css → RPDropFileZone.css} +0 -0
  68. /package/dist/assets/{Thumbnails.css → RPLayout.css} +0 -0
@@ -1,9 +1,8 @@
1
- import { jsx as f, Fragment as q, jsxs as M } from "react/jsx-runtime";
1
+ import { jsx as h, Fragment as $, jsxs as M } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import { u as A, c as B, a as K, b as z } from "../../index-743c36f0.js";
4
3
  import "react-dom";
5
- import { CheckIcon as X } from "../icons/CheckIcon.js";
6
- import '../../assets/Checkbox.css';function S(e, t) {
4
+ import { CheckIcon as V } from "../icons/CheckIcon.js";
5
+ import '../../assets/Checkbox.css';function A(e, t) {
7
6
  if (typeof e == "function")
8
7
  return e(t);
9
8
  e != null && (e.current = t);
@@ -12,41 +11,154 @@ function I(...e) {
12
11
  return (t) => {
13
12
  let n = !1;
14
13
  const r = e.map((o) => {
15
- const c = S(o, t);
16
- return !n && typeof c == "function" && (n = !0), c;
14
+ const s = A(o, t);
15
+ return !n && typeof s == "function" && (n = !0), s;
17
16
  });
18
17
  if (n)
19
18
  return () => {
20
19
  for (let o = 0; o < r.length; o++) {
21
- const c = r[o];
22
- typeof c == "function" ? c() : S(e[o], null);
20
+ const s = r[o];
21
+ typeof s == "function" ? s() : A(e[o], null);
23
22
  }
24
23
  };
25
24
  };
26
25
  }
27
- function T(...e) {
26
+ function _(...e) {
28
27
  return i.useCallback(I(...e), e);
29
28
  }
29
+ function q(e, t = []) {
30
+ let n = [];
31
+ function r(s, u) {
32
+ const c = i.createContext(u), a = n.length;
33
+ n = [...n, u];
34
+ const l = (d) => {
35
+ var y;
36
+ const { scope: f, children: m, ...b } = d, v = ((y = f == null ? void 0 : f[e]) == null ? void 0 : y[a]) || c, k = i.useMemo(() => b, Object.values(b));
37
+ return /* @__PURE__ */ h(v.Provider, { value: k, children: m });
38
+ };
39
+ l.displayName = s + "Provider";
40
+ function p(d, f) {
41
+ var v;
42
+ const m = ((v = f == null ? void 0 : f[e]) == null ? void 0 : v[a]) || c, b = i.useContext(m);
43
+ if (b)
44
+ return b;
45
+ if (u !== void 0)
46
+ return u;
47
+ throw new Error(`\`${d}\` must be used within \`${s}\``);
48
+ }
49
+ return [l, p];
50
+ }
51
+ const o = () => {
52
+ const s = n.map((u) => i.createContext(u));
53
+ return function(c) {
54
+ const a = (c == null ? void 0 : c[e]) || s;
55
+ return i.useMemo(
56
+ () => ({ [`__scope${e}`]: { ...c, [e]: a } }),
57
+ [c, a]
58
+ );
59
+ };
60
+ };
61
+ return o.scopeName = e, [r, K(o, ...t)];
62
+ }
63
+ function K(...e) {
64
+ const t = e[0];
65
+ if (e.length === 1)
66
+ return t;
67
+ const n = () => {
68
+ const r = e.map((o) => ({
69
+ useScope: o(),
70
+ scopeName: o.scopeName
71
+ }));
72
+ return function(s) {
73
+ const u = r.reduce((c, { useScope: a, scopeName: l }) => {
74
+ const d = a(s)[`__scope${l}`];
75
+ return { ...c, ...d };
76
+ }, {});
77
+ return i.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
78
+ };
79
+ };
80
+ return n.scopeName = t.scopeName, n;
81
+ }
30
82
  function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
31
83
  return function(o) {
32
84
  if (e == null || e(o), n === !1 || !o.defaultPrevented)
33
85
  return t == null ? void 0 : t(o);
34
86
  };
35
87
  }
36
- function $(e) {
88
+ function T(e) {
89
+ const t = i.useRef(e);
90
+ return i.useEffect(() => {
91
+ t.current = e;
92
+ }), i.useMemo(() => (...n) => {
93
+ var r;
94
+ return (r = t.current) == null ? void 0 : r.call(t, ...n);
95
+ }, []);
96
+ }
97
+ function X({
98
+ prop: e,
99
+ defaultProp: t,
100
+ onChange: n = () => {
101
+ }
102
+ }) {
103
+ const [r, o] = Z({ defaultProp: t, onChange: n }), s = e !== void 0, u = s ? e : r, c = T(n), a = i.useCallback(
104
+ (l) => {
105
+ if (s) {
106
+ const d = typeof l == "function" ? l(e) : l;
107
+ d !== e && c(d);
108
+ } else
109
+ o(l);
110
+ },
111
+ [s, e, o, c]
112
+ );
113
+ return [u, a];
114
+ }
115
+ function Z({
116
+ defaultProp: e,
117
+ onChange: t
118
+ }) {
119
+ const n = i.useState(e), [r] = n, o = i.useRef(r), s = T(t);
120
+ return i.useEffect(() => {
121
+ o.current !== r && (s(r), o.current = r);
122
+ }, [r, o, s]), n;
123
+ }
124
+ function G(e) {
37
125
  const t = i.useRef({ value: e, previous: e });
38
126
  return i.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
39
127
  }
40
- function Z(e, t) {
128
+ var R = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
129
+ };
130
+ function H(e) {
131
+ const [t, n] = i.useState(void 0);
132
+ return R(() => {
133
+ if (e) {
134
+ n({ width: e.offsetWidth, height: e.offsetHeight });
135
+ const r = new ResizeObserver((o) => {
136
+ if (!Array.isArray(o) || !o.length)
137
+ return;
138
+ const s = o[0];
139
+ let u, c;
140
+ if ("borderBoxSize" in s) {
141
+ const a = s.borderBoxSize, l = Array.isArray(a) ? a[0] : a;
142
+ u = l.inlineSize, c = l.blockSize;
143
+ } else
144
+ u = e.offsetWidth, c = e.offsetHeight;
145
+ n({ width: u, height: c });
146
+ });
147
+ return r.observe(e, { box: "border-box" }), () => r.unobserve(e);
148
+ } else
149
+ n(void 0);
150
+ }, [e]), t;
151
+ }
152
+ function J(e, t) {
41
153
  return i.useReducer((n, r) => t[n][r] ?? n, e);
42
154
  }
43
- var _ = (e) => {
44
- const { present: t, children: n } = e, r = G(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), c = T(r.ref, J(o));
45
- return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: c }) : null;
155
+ var D = (e) => {
156
+ const { present: t, children: n } = e, r = Q(t), o = typeof n == "function" ? n({ present: r.isPresent }) : i.Children.only(n), s = _(r.ref, Y(o));
157
+ return typeof n == "function" || r.isPresent ? i.cloneElement(o, { ref: s }) : null;
46
158
  };
47
- _.displayName = "Presence";
48
- function G(e) {
49
- const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), c = i.useRef("none"), a = e ? "mounted" : "unmounted", [s, l] = Z(a, {
159
+ D.displayName = "Presence";
160
+ function Q(e) {
161
+ const [t, n] = i.useState(), r = i.useRef({}), o = i.useRef(e), s = i.useRef("none"), u = e ? "mounted" : "unmounted", [c, a] = J(u, {
50
162
  mounted: {
51
163
  UNMOUNT: "unmounted",
52
164
  ANIMATION_OUT: "unmountSuspended"
@@ -60,63 +172,63 @@ function G(e) {
60
172
  }
61
173
  });
62
174
  return i.useEffect(() => {
63
- const u = R(r.current);
64
- c.current = s === "mounted" ? u : "none";
65
- }, [s]), A(() => {
66
- const u = r.current, p = o.current;
175
+ const l = g(r.current);
176
+ s.current = c === "mounted" ? l : "none";
177
+ }, [c]), R(() => {
178
+ const l = r.current, p = o.current;
67
179
  if (p !== e) {
68
- const d = c.current, m = R(u);
69
- e ? l("MOUNT") : m === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(p && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
180
+ const f = s.current, m = g(l);
181
+ e ? a("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? a("UNMOUNT") : a(p && f !== m ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
70
182
  }
71
- }, [e, l]), A(() => {
183
+ }, [e, a]), R(() => {
72
184
  if (t) {
73
- let u;
74
- const p = t.ownerDocument.defaultView ?? window, C = (m) => {
75
- const y = R(r.current).includes(m.animationName);
76
- if (m.target === t && y && (l("ANIMATION_END"), !o.current)) {
77
- const g = t.style.animationFillMode;
78
- t.style.animationFillMode = "forwards", u = p.setTimeout(() => {
79
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
185
+ let l;
186
+ const p = t.ownerDocument.defaultView ?? window, d = (m) => {
187
+ const v = g(r.current).includes(m.animationName);
188
+ if (m.target === t && v && (a("ANIMATION_END"), !o.current)) {
189
+ const k = t.style.animationFillMode;
190
+ t.style.animationFillMode = "forwards", l = p.setTimeout(() => {
191
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = k);
80
192
  });
81
193
  }
82
- }, d = (m) => {
83
- m.target === t && (c.current = R(r.current));
194
+ }, f = (m) => {
195
+ m.target === t && (s.current = g(r.current));
84
196
  };
85
- return t.addEventListener("animationstart", d), t.addEventListener("animationcancel", C), t.addEventListener("animationend", C), () => {
86
- p.clearTimeout(u), t.removeEventListener("animationstart", d), t.removeEventListener("animationcancel", C), t.removeEventListener("animationend", C);
197
+ return t.addEventListener("animationstart", f), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
198
+ p.clearTimeout(l), t.removeEventListener("animationstart", f), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
87
199
  };
88
200
  } else
89
- l("ANIMATION_END");
90
- }, [t, l]), {
91
- isPresent: ["mounted", "unmountSuspended"].includes(s),
92
- ref: i.useCallback((u) => {
93
- u && (r.current = getComputedStyle(u)), n(u);
201
+ a("ANIMATION_END");
202
+ }, [t, a]), {
203
+ isPresent: ["mounted", "unmountSuspended"].includes(c),
204
+ ref: i.useCallback((l) => {
205
+ l && (r.current = getComputedStyle(l)), n(l);
94
206
  }, [])
95
207
  };
96
208
  }
97
- function R(e) {
209
+ function g(e) {
98
210
  return (e == null ? void 0 : e.animationName) || "none";
99
211
  }
100
- function J(e) {
212
+ function Y(e) {
101
213
  var r, o;
102
214
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
103
215
  return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
104
216
  }
105
- var D = i.forwardRef((e, t) => {
106
- const { children: n, ...r } = e, o = i.Children.toArray(n), c = o.find(Y);
107
- if (c) {
108
- const a = c.props.children, s = o.map((l) => l === c ? i.Children.count(a) > 1 ? i.Children.only(null) : i.isValidElement(a) ? a.props.children : null : l);
109
- return /* @__PURE__ */ f(E, { ...r, ref: t, children: i.isValidElement(a) ? i.cloneElement(a, void 0, s) : null });
217
+ var U = i.forwardRef((e, t) => {
218
+ const { children: n, ...r } = e, o = i.Children.toArray(n), s = o.find(te);
219
+ if (s) {
220
+ const u = s.props.children, c = o.map((a) => a === s ? i.Children.count(u) > 1 ? i.Children.only(null) : i.isValidElement(u) ? u.props.children : null : a);
221
+ return /* @__PURE__ */ h(E, { ...r, ref: t, children: i.isValidElement(u) ? i.cloneElement(u, void 0, c) : null });
110
222
  }
111
- return /* @__PURE__ */ f(E, { ...r, ref: t, children: n });
223
+ return /* @__PURE__ */ h(E, { ...r, ref: t, children: n });
112
224
  });
113
- D.displayName = "Slot";
225
+ U.displayName = "Slot";
114
226
  var E = i.forwardRef((e, t) => {
115
227
  const { children: n, ...r } = e;
116
228
  if (i.isValidElement(n)) {
117
- const o = ee(n);
229
+ const o = re(n);
118
230
  return i.cloneElement(n, {
119
- ...H(r, n.props),
231
+ ...ne(r, n.props),
120
232
  // @ts-ignore
121
233
  ref: t ? I(t, o) : o
122
234
  });
@@ -124,26 +236,26 @@ var E = i.forwardRef((e, t) => {
124
236
  return i.Children.count(n) > 1 ? i.Children.only(null) : null;
125
237
  });
126
238
  E.displayName = "SlotClone";
127
- var Q = ({ children: e }) => /* @__PURE__ */ f(q, { children: e });
128
- function Y(e) {
129
- return i.isValidElement(e) && e.type === Q;
239
+ var ee = ({ children: e }) => /* @__PURE__ */ h($, { children: e });
240
+ function te(e) {
241
+ return i.isValidElement(e) && e.type === ee;
130
242
  }
131
- function H(e, t) {
243
+ function ne(e, t) {
132
244
  const n = { ...t };
133
245
  for (const r in t) {
134
- const o = e[r], c = t[r];
135
- /^on[A-Z]/.test(r) ? o && c ? n[r] = (...s) => {
136
- c(...s), o(...s);
137
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...c } : r === "className" && (n[r] = [o, c].filter(Boolean).join(" "));
246
+ const o = e[r], s = t[r];
247
+ /^on[A-Z]/.test(r) ? o && s ? n[r] = (...c) => {
248
+ s(...c), o(...c);
249
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...s } : r === "className" && (n[r] = [o, s].filter(Boolean).join(" "));
138
250
  }
139
251
  return { ...e, ...n };
140
252
  }
141
- function ee(e) {
253
+ function re(e) {
142
254
  var r, o;
143
255
  let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
144
256
  return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
145
257
  }
146
- var te = [
258
+ var oe = [
147
259
  "a",
148
260
  "button",
149
261
  "div",
@@ -160,85 +272,85 @@ var te = [
160
272
  "span",
161
273
  "svg",
162
274
  "ul"
163
- ], U = te.reduce((e, t) => {
275
+ ], W = oe.reduce((e, t) => {
164
276
  const n = i.forwardRef((r, o) => {
165
- const { asChild: c, ...a } = r, s = c ? D : t;
166
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(s, { ...a, ref: o });
277
+ const { asChild: s, ...u } = r, c = s ? U : t;
278
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(c, { ...u, ref: o });
167
279
  });
168
280
  return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
169
- }, {}), w = "Checkbox", [ne, fe] = B(w), [re, oe] = ne(w), W = i.forwardRef(
281
+ }, {}), w = "Checkbox", [se, me] = q(w), [ie, ce] = se(w), z = i.forwardRef(
170
282
  (e, t) => {
171
283
  const {
172
284
  __scopeCheckbox: n,
173
285
  name: r,
174
286
  checked: o,
175
- defaultChecked: c,
176
- required: a,
177
- disabled: s,
178
- value: l = "on",
179
- onCheckedChange: u,
287
+ defaultChecked: s,
288
+ required: u,
289
+ disabled: c,
290
+ value: a = "on",
291
+ onCheckedChange: l,
180
292
  form: p,
181
- ...C
182
- } = e, [d, m] = i.useState(null), k = T(t, (h) => m(h)), y = i.useRef(!1), g = d ? p || !!d.closest("form") : !0, [N = !1, x] = K({
293
+ ...d
294
+ } = e, [f, m] = i.useState(null), b = _(t, (C) => m(C)), v = i.useRef(!1), k = f ? p || !!f.closest("form") : !0, [y = !1, S] = X({
183
295
  prop: o,
184
- defaultProp: c,
185
- onChange: u
186
- }), V = i.useRef(N);
296
+ defaultProp: s,
297
+ onChange: l
298
+ }), F = i.useRef(y);
187
299
  return i.useEffect(() => {
188
- const h = d == null ? void 0 : d.form;
189
- if (h) {
190
- const v = () => x(V.current);
191
- return h.addEventListener("reset", v), () => h.removeEventListener("reset", v);
300
+ const C = f == null ? void 0 : f.form;
301
+ if (C) {
302
+ const x = () => S(F.current);
303
+ return C.addEventListener("reset", x), () => C.removeEventListener("reset", x);
192
304
  }
193
- }, [d, x]), /* @__PURE__ */ M(re, { scope: n, state: N, disabled: s, children: [
194
- /* @__PURE__ */ f(
195
- U.button,
305
+ }, [f, S]), /* @__PURE__ */ M(ie, { scope: n, state: y, disabled: c, children: [
306
+ /* @__PURE__ */ h(
307
+ W.button,
196
308
  {
197
309
  type: "button",
198
310
  role: "checkbox",
199
- "aria-checked": b(N) ? "mixed" : N,
200
- "aria-required": a,
201
- "data-state": F(N),
202
- "data-disabled": s ? "" : void 0,
203
- disabled: s,
204
- value: l,
205
- ...C,
206
- ref: k,
207
- onKeyDown: O(e.onKeyDown, (h) => {
208
- h.key === "Enter" && h.preventDefault();
311
+ "aria-checked": N(y) ? "mixed" : y,
312
+ "aria-required": u,
313
+ "data-state": B(y),
314
+ "data-disabled": c ? "" : void 0,
315
+ disabled: c,
316
+ value: a,
317
+ ...d,
318
+ ref: b,
319
+ onKeyDown: O(e.onKeyDown, (C) => {
320
+ C.key === "Enter" && C.preventDefault();
209
321
  }),
210
- onClick: O(e.onClick, (h) => {
211
- x((v) => b(v) ? !0 : !v), g && (y.current = h.isPropagationStopped(), y.current || h.stopPropagation());
322
+ onClick: O(e.onClick, (C) => {
323
+ S((x) => N(x) ? !0 : !x), k && (v.current = C.isPropagationStopped(), v.current || C.stopPropagation());
212
324
  })
213
325
  }
214
326
  ),
215
- g && /* @__PURE__ */ f(
216
- ie,
327
+ k && /* @__PURE__ */ h(
328
+ ue,
217
329
  {
218
- control: d,
219
- bubbles: !y.current,
330
+ control: f,
331
+ bubbles: !v.current,
220
332
  name: r,
221
- value: l,
222
- checked: N,
223
- required: a,
224
- disabled: s,
333
+ value: a,
334
+ checked: y,
335
+ required: u,
336
+ disabled: c,
225
337
  form: p,
226
338
  style: { transform: "translateX(-100%)" },
227
- defaultChecked: b(c) ? !1 : c
339
+ defaultChecked: N(s) ? !1 : s
228
340
  }
229
341
  )
230
342
  ] });
231
343
  }
232
344
  );
233
- W.displayName = w;
345
+ z.displayName = w;
234
346
  var L = "CheckboxIndicator", j = i.forwardRef(
235
347
  (e, t) => {
236
- const { __scopeCheckbox: n, forceMount: r, ...o } = e, c = oe(L, n);
237
- return /* @__PURE__ */ f(_, { present: r || b(c.state) || c.state === !0, children: /* @__PURE__ */ f(
238
- U.span,
348
+ const { __scopeCheckbox: n, forceMount: r, ...o } = e, s = ce(L, n);
349
+ return /* @__PURE__ */ h(D, { present: r || N(s.state) || s.state === !0, children: /* @__PURE__ */ h(
350
+ W.span,
239
351
  {
240
- "data-state": F(c.state),
241
- "data-disabled": c.disabled ? "" : void 0,
352
+ "data-state": B(s.state),
353
+ "data-disabled": s.disabled ? "" : void 0,
242
354
  ...o,
243
355
  ref: t,
244
356
  style: { pointerEvents: "none", ...e.style }
@@ -247,28 +359,28 @@ var L = "CheckboxIndicator", j = i.forwardRef(
247
359
  }
248
360
  );
249
361
  j.displayName = L;
250
- var ie = (e) => {
251
- const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...c } = e, a = i.useRef(null), s = $(n), l = z(t);
362
+ var ue = (e) => {
363
+ const { control: t, checked: n, bubbles: r = !0, defaultChecked: o, ...s } = e, u = i.useRef(null), c = G(n), a = H(t);
252
364
  i.useEffect(() => {
253
- const p = a.current, C = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(C, "checked").set;
254
- if (s !== n && m) {
255
- const k = new Event("click", { bubbles: r });
256
- p.indeterminate = b(n), m.call(p, b(n) ? !1 : n), p.dispatchEvent(k);
365
+ const p = u.current, d = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(d, "checked").set;
366
+ if (c !== n && m) {
367
+ const b = new Event("click", { bubbles: r });
368
+ p.indeterminate = N(n), m.call(p, N(n) ? !1 : n), p.dispatchEvent(b);
257
369
  }
258
- }, [s, n, r]);
259
- const u = i.useRef(b(n) ? !1 : n);
260
- return /* @__PURE__ */ f(
370
+ }, [c, n, r]);
371
+ const l = i.useRef(N(n) ? !1 : n);
372
+ return /* @__PURE__ */ h(
261
373
  "input",
262
374
  {
263
375
  type: "checkbox",
264
376
  "aria-hidden": !0,
265
- defaultChecked: o ?? u.current,
266
- ...c,
377
+ defaultChecked: o ?? l.current,
378
+ ...s,
267
379
  tabIndex: -1,
268
- ref: a,
380
+ ref: u,
269
381
  style: {
270
382
  ...e.style,
271
- ...l,
383
+ ...a,
272
384
  position: "absolute",
273
385
  pointerEvents: "none",
274
386
  opacity: 0,
@@ -277,25 +389,25 @@ var ie = (e) => {
277
389
  }
278
390
  );
279
391
  };
280
- function b(e) {
392
+ function N(e) {
281
393
  return e === "indeterminate";
282
394
  }
283
- function F(e) {
284
- return b(e) ? "indeterminate" : e ? "checked" : "unchecked";
395
+ function B(e) {
396
+ return N(e) ? "indeterminate" : e ? "checked" : "unchecked";
285
397
  }
286
- var ce = W, se = j;
398
+ var ae = z, le = j;
287
399
  const P = {
288
400
  "rp-checkbox": "_rp-checkbox_11dq0_1",
289
401
  "rp-checkbox-indicator": "_rp-checkbox-indicator_11dq0_18"
290
- }, pe = ({
402
+ }, he = ({
291
403
  children: e,
292
404
  value: t,
293
405
  name: n,
294
406
  onChange: r
295
407
  }) => /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", position: "relative" }, children: [
296
- /* @__PURE__ */ f(ce, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ f(se, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ f(X, {}) }) }),
297
- /* @__PURE__ */ f("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
408
+ /* @__PURE__ */ h(ae, { className: P["rp-checkbox"], checked: t, id: n, onCheckedChange: r, children: /* @__PURE__ */ h(le, { className: P["rp-checkbox-indicator"], children: /* @__PURE__ */ h(V, {}) }) }),
409
+ /* @__PURE__ */ h("label", { className: P["rp-checkbox-label"], htmlFor: n, children: e })
298
410
  ] });
299
411
  export {
300
- pe as UICheckbox
412
+ he as UICheckbox
301
413
  };
@@ -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-3459164c.js";
2
+ import { R as l, T as c, P as p, C as _ } from "../../index-8049287f.js";
3
3
  import { c as A } from "../../clsx-0c6e471a.js";
4
4
  import '../../assets/DropDown.css';const F = "_slideDownAndFade_1000s_1", w = "_slideLeftAndFade_1000s_1", m = "_slideUpAndFade_1000s_1", f = "_slideRightAndFade_1000s_1", g = {
5
5
  "rp-dropdown-content": "_rp-dropdown-content_1000s_1",
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { L as p } from "../../Thumbnails-06fa1aa5.js";
2
+ import { L as p } from "../../RPLayout-608b83dd.js";
3
3
  import "../../clsx-0c6e471a.js";
4
4
  export {
5
5
  p as default
@@ -1,11 +1,11 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { p as m, h as n, u as s } from "../Thumbnails-06fa1aa5.js";
3
+ import { P as p, k as n, u as P } from "../RPLayout-608b83dd.js";
4
4
  import "./RPDocumentContext.js";
5
5
  import "../utils/appConsole.js";
6
6
  import "./InitialStateContext.js";
7
7
  export {
8
- m as PaginateContext,
8
+ p as PaginateContext,
9
9
  n as PaginateProvider,
10
- s as usePaginateContext
10
+ P as usePaginateContext
11
11
  };
@@ -1,8 +1,8 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { v as e, P as n, b as P } from "../Thumbnails-06fa1aa5.js";
3
+ import { p as e, q as n, c as p } from "../RPLayout-608b83dd.js";
4
4
  export {
5
5
  e as PrintContext,
6
6
  n as PrintProvider,
7
- P as usePrintContext
7
+ p as usePrintContext
8
8
  };
@@ -1,31 +1,39 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import { createContext as l, useState as m, useEffect as P, useMemo as x, useContext as h } from "react";
3
- import { useLoadPdf as C } from "../utils/hooks/useLoadPdf.js";
4
- import { usePdfProperties as v } from "../utils/hooks/usePdfProperties.js";
5
- import { LoaderIcon as g } from "../components/icons/LoaderIcon.js";
6
- import { appConsole as D } from "../utils/appConsole.js";
7
- const c = l({
2
+ import { createContext as x, useState as a, useEffect as C, useMemo as g, useContext as v } from "react";
3
+ import { useLoadPdf as D } from "../utils/hooks/useLoadPdf.js";
4
+ import { usePdfProperties as S } from "../utils/hooks/usePdfProperties.js";
5
+ import { LoaderIcon as y } from "../components/icons/LoaderIcon.js";
6
+ import { appConsole as j } from "../utils/appConsole.js";
7
+ const c = x({
8
8
  pdf: void 0,
9
9
  pages: /* @__PURE__ */ new Map(),
10
10
  setPdfSrc: () => {
11
11
  },
12
12
  setFilename: () => {
13
- }
14
- }), L = ({ children: t, src: e, characterMap: u }) => {
15
- const [o, s] = m(e), { pdf: n, pages: i } = C(o, u), [p, f] = m(), d = v(o, n, p);
16
- P(() => {
17
- f(e == null ? void 0 : e.split("/").pop()), s(e);
13
+ },
14
+ loading: !1
15
+ }), E = ({
16
+ children: t,
17
+ src: e,
18
+ characterMap: l,
19
+ onLoadError: u,
20
+ onLoaded: P
21
+ }) => {
22
+ const [o, i] = a(e), { pdf: n, pages: s, loading: p } = D(o, l, { onLoadError: u, onLoaded: P }), [d, f] = a(), m = S(o, n, d);
23
+ C(() => {
24
+ f(e == null ? void 0 : e.split("/").pop()), i(e);
18
25
  }, [e]);
19
- const a = x(() => ({
26
+ const h = g(() => ({
20
27
  pdf: n,
21
- pages: i,
28
+ pages: s,
22
29
  pdfSrc: o,
23
- setPdfSrc: s,
24
- pdfProperties: d,
30
+ setPdfSrc: i,
31
+ pdfProperties: m,
25
32
  setFilename: f,
26
- filename: p
27
- }), [n, i, o, d]);
28
- return n ? /* @__PURE__ */ r(c.Provider, { value: a, children: t }) : /* @__PURE__ */ r(
33
+ filename: d,
34
+ loading: p
35
+ }), [n, s, o, m, p]);
36
+ return /* @__PURE__ */ r(c.Provider, { value: h, children: n ? t : /* @__PURE__ */ r(
29
37
  "div",
30
38
  {
31
39
  style: {
@@ -35,15 +43,15 @@ const c = l({
35
43
  height: "100%",
36
44
  width: "100%"
37
45
  },
38
- children: /* @__PURE__ */ r(g, {})
46
+ children: /* @__PURE__ */ r(y, {})
39
47
  }
40
- );
41
- }, M = () => {
42
- const t = h(c);
43
- return t.pdf || D.error("Please use this hooks inside children component of RPDocument"), t;
48
+ ) });
49
+ }, R = () => {
50
+ const t = v(c);
51
+ return t.pdf || j.error("Please use this hooks inside children component of RPDocument"), t;
44
52
  };
45
53
  export {
46
- L as DocumentProvider,
54
+ E as DocumentProvider,
47
55
  c as default,
48
- M as useDocumentContext
56
+ R as useDocumentContext
49
57
  };