@pdf-viewer/react 1.9.0-beta.4 → 1.9.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.
Files changed (119) hide show
  1. package/dist/Checkbox.module-3edaacbb.js +7 -0
  2. package/dist/Combination-9a0a3e65.js +693 -0
  3. package/dist/Container.module-f8b5c306.js +6 -0
  4. package/dist/DropDown.module-a78567cb.js +11 -0
  5. package/dist/MenuItem.module-bc11d0d3.js +6 -0
  6. package/dist/MenuSeparator.module-89b2ff7f.js +6 -0
  7. package/dist/PropertyItem.module-db0150cc.js +8 -0
  8. package/dist/RPSplitter.module-13d612c4.js +7 -0
  9. package/dist/RPTheme.module-bd9038da.js +8 -0
  10. package/dist/RotateTool.module-03987eba.js +6 -0
  11. package/dist/SearchTool.module-016f3a8d.js +16 -0
  12. package/dist/ToolbarLayout.module-88476995.js +2464 -0
  13. package/dist/WrapperLayout.module-147bc943.js +6 -0
  14. package/dist/assets/ToolbarLayout.css +1 -0
  15. package/dist/components/RPConfig.js +673 -691
  16. package/dist/components/RPController.js +34 -34
  17. package/dist/components/RPDropFileZone.js +21 -23
  18. package/dist/components/RPPages.js +21 -18
  19. package/dist/components/RPProvider.js +19 -15
  20. package/dist/components/layout/Container.js +10 -11
  21. package/dist/components/layout/LayoutContainer.js +19 -16
  22. package/dist/components/layout/RPDefaultLayout.js +76 -14
  23. package/dist/components/layout/RPLayout.js +74 -24
  24. package/dist/components/layout/WrapperLayout.js +7 -8
  25. package/dist/components/layout/sidebar/RPSidebar.js +51 -12
  26. package/dist/components/layout/sidebar/RPSplitter.js +7 -9
  27. package/dist/components/layout/sidebar/Thumbnail.js +49 -2
  28. package/dist/components/layout/sidebar/Thumbnails.js +1 -1
  29. package/dist/components/layout/toolbar/DocumentDialog.js +307 -24
  30. package/dist/components/layout/toolbar/FileDownloadTool.js +23 -13
  31. package/dist/components/layout/toolbar/MenuItem.js +6 -7
  32. package/dist/components/layout/toolbar/MenuSeparator.js +4 -5
  33. package/dist/components/layout/toolbar/MostPageTool.js +50 -23
  34. package/dist/components/layout/toolbar/OtherTool.js +115 -22
  35. package/dist/components/layout/toolbar/Paginate.js +99 -17
  36. package/dist/components/layout/toolbar/PrintTool.js +43 -13
  37. package/dist/components/layout/toolbar/PropertyItem.js +5 -8
  38. package/dist/components/layout/toolbar/RPToolbar.js +28 -7
  39. package/dist/components/layout/toolbar/RPToolbarEnd.js +22 -7
  40. package/dist/components/layout/toolbar/RotateTool.js +20 -21
  41. package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
  42. package/dist/components/layout/toolbar/SearchCloseButton.js +19 -7
  43. package/dist/components/layout/toolbar/SearchResultNavigator.js +42 -8
  44. package/dist/components/layout/toolbar/SearchTool.js +198 -29
  45. package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
  46. package/dist/components/layout/toolbar/ThumbnailTool.js +3 -3
  47. package/dist/components/layout/toolbar/ToolbarCustom.js +48 -20
  48. package/dist/components/layout/toolbar/ToolbarDefault.js +82 -0
  49. package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
  50. package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
  51. package/dist/components/layout/toolbar/ZoomTool.js +140 -28
  52. package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -3
  53. package/dist/components/layout/toolbar/tools/InputPageTool.js +11 -11
  54. package/dist/components/layout/toolbar/tools/NextPageTool.js +21 -18
  55. package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
  56. package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
  57. package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
  58. package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +10 -10
  59. package/dist/components/layout/toolbar/tools/defaults/{TopbarDefaultTools.js → RPHorizontalBar.js} +29 -20
  60. package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
  61. package/dist/components/page/AnnotationLayer.js +20 -17
  62. package/dist/components/page/CanvasLayer.js +20 -18
  63. package/dist/components/page/DualPage.js +1 -1
  64. package/dist/components/page/RPPage.js +20 -17
  65. package/dist/components/page/SinglePage.js +1 -1
  66. package/dist/components/page/TextHighlightLayer.js +20 -17
  67. package/dist/components/page/TextLayer.js +20 -17
  68. package/dist/components/ui/Checkbox.js +125 -239
  69. package/dist/components/ui/DropDown.js +13 -19
  70. package/dist/components/ui/LoadingIndicator.js +22 -5
  71. package/dist/components/ui/RPTooltip.js +133 -133
  72. package/dist/contexts/ElementPageContext.js +37 -37
  73. package/dist/contexts/FileInputContext.js +18 -20
  74. package/dist/contexts/PaginationContext.js +4 -4
  75. package/dist/contexts/PrintContext.js +1 -1
  76. package/dist/contexts/RenderQueueProvider.js +10 -0
  77. package/dist/contexts/SearchContext.js +3 -3
  78. package/dist/contexts/ThumbnailsContext.js +1 -1
  79. package/dist/contexts/ViewportContext.js +42 -35
  80. package/dist/index-2160dd99.js +307 -0
  81. package/dist/{index-5f66a29f.js → index-492f99d0.js} +491 -515
  82. package/dist/index-49b9a615.js +978 -0
  83. package/dist/main.js +76 -73
  84. package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -1
  85. package/dist/types/components/layout/RPLayout.d.ts +2 -1
  86. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
  87. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +2 -3
  88. package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +2 -2
  89. package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
  90. package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
  91. package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
  92. package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
  93. package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
  94. package/dist/types/main.d.ts +3 -3
  95. package/dist/types/utils/Queue.d.ts +18 -0
  96. package/dist/types/utils/renderPage.d.ts +1 -6
  97. package/dist/types/utils/types.d.ts +22 -17
  98. package/dist/utils/Queue.js +47 -0
  99. package/dist/utils/hooks/useFileDownload.js +20 -17
  100. package/dist/utils/hooks/useLicense.js +1 -1
  101. package/dist/utils/hooks/usePageRotateContext.js +14 -14
  102. package/dist/utils/hooks/usePaginate.js +20 -17
  103. package/dist/utils/hooks/usePresentPage.js +20 -17
  104. package/dist/utils/hooks/usePrint.js +20 -17
  105. package/dist/utils/hooks/useScrollToPage.js +20 -17
  106. package/dist/utils/hooks/useSearch.js +20 -17
  107. package/dist/utils/hooks/useThumbnail.js +20 -18
  108. package/dist/utils/hooks/useVirtualReactWindow.js +20 -17
  109. package/package.json +1 -1
  110. package/dist/RPLayout-5892502c.js +0 -3494
  111. package/dist/SearchCloseButton-cbf182aa.js +0 -33
  112. package/dist/assets/RPLayout.css +0 -1
  113. package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +0 -16
  114. package/dist/index-00f8683a.js +0 -1672
  115. package/dist/index-6b37f504.js +0 -332
  116. package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +0 -3
  117. package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +0 -3
  118. /package/dist/assets/{RPDropFileZone.css → RPTheme.css} +0 -0
  119. /package/dist/assets/{SearchCloseButton.css → SearchTool.css} +0 -0
@@ -1,90 +1,90 @@
1
- import { jsx as p, jsxs as L } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as O } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { P as M, c as K, e as J, u as j, a as g, b as Q, f as Z } from "../../index-6b37f504.js";
4
- import { c as G, u as $, R as ee, A as te, D as oe, C as re, a as ne } from "../../index-5f66a29f.js";
3
+ import { P as S, c as z, e as J, u as j, a as g, b as Q, g as Z } from "../../index-2160dd99.js";
4
+ import { c as G, u as $, R as ee, A as te, D as oe, C as re, a as ne } from "../../index-492f99d0.js";
5
5
  import { withRef as se } from "../../utils/withRef.js";
6
- import '../../assets/RPTooltip.css';var ae = Object.freeze({
7
- // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
8
- position: "absolute",
9
- border: 0,
10
- width: 1,
11
- height: 1,
12
- padding: 0,
13
- margin: -1,
14
- overflow: "hidden",
15
- clip: "rect(0, 0, 0, 0)",
16
- whiteSpace: "nowrap",
17
- wordWrap: "normal"
18
- }), ie = "VisuallyHidden", F = s.forwardRef(
6
+ import '../../assets/RPTooltip.css';var ae = "VisuallyHidden", F = s.forwardRef(
19
7
  (e, o) => /* @__PURE__ */ p(
20
- M.span,
8
+ S.span,
21
9
  {
22
10
  ...e,
23
11
  ref: o,
24
- style: { ...ae, ...e.style }
12
+ style: {
13
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
14
+ position: "absolute",
15
+ border: 0,
16
+ width: 1,
17
+ height: 1,
18
+ padding: 0,
19
+ margin: -1,
20
+ overflow: "hidden",
21
+ clip: "rect(0, 0, 0, 0)",
22
+ whiteSpace: "nowrap",
23
+ wordWrap: "normal",
24
+ ...e.style
25
+ }
25
26
  }
26
27
  )
27
28
  );
28
- F.displayName = ie;
29
- var le = F, [_, Oe] = K("Tooltip", [
29
+ F.displayName = ae;
30
+ var ie = F, [R, De] = z("Tooltip", [
30
31
  G
31
- ]), A = G(), V = "TooltipProvider", ce = 700, O = "tooltip.open", [ue, I] = _(V), Y = (e) => {
32
+ ]), _ = G(), V = "TooltipProvider", le = 700, L = "tooltip.open", [ce, I] = R(V), B = (e) => {
32
33
  const {
33
34
  __scopeTooltip: o,
34
- delayDuration: t = ce,
35
+ delayDuration: t = le,
35
36
  skipDelayDuration: r = 300,
36
37
  disableHoverableContent: n = !1,
37
- children: l
38
- } = e, i = s.useRef(!0), v = s.useRef(!1), a = s.useRef(0);
38
+ children: i
39
+ } = e, [c, v] = s.useState(!0), a = s.useRef(!1), d = s.useRef(0);
39
40
  return s.useEffect(() => {
40
- const d = a.current;
41
- return () => window.clearTimeout(d);
41
+ const l = d.current;
42
+ return () => window.clearTimeout(l);
42
43
  }, []), /* @__PURE__ */ p(
43
- ue,
44
+ ce,
44
45
  {
45
46
  scope: o,
46
- isOpenDelayedRef: i,
47
+ isOpenDelayed: c,
47
48
  delayDuration: t,
48
49
  onOpen: s.useCallback(() => {
49
- window.clearTimeout(a.current), i.current = !1;
50
+ window.clearTimeout(d.current), v(!1);
50
51
  }, []),
51
52
  onClose: s.useCallback(() => {
52
- window.clearTimeout(a.current), a.current = window.setTimeout(
53
- () => i.current = !0,
53
+ window.clearTimeout(d.current), d.current = window.setTimeout(
54
+ () => v(!0),
54
55
  r
55
56
  );
56
57
  }, [r]),
57
- isPointerInTransitRef: v,
58
- onPointerInTransitChange: s.useCallback((d) => {
59
- v.current = d;
58
+ isPointerInTransitRef: a,
59
+ onPointerInTransitChange: s.useCallback((l) => {
60
+ a.current = l;
60
61
  }, []),
61
62
  disableHoverableContent: n,
62
- children: l
63
+ children: i
63
64
  }
64
65
  );
65
66
  };
66
- Y.displayName = V;
67
- var P = "Tooltip", [pe, D] = _(P), B = (e) => {
67
+ B.displayName = V;
68
+ var A = "Tooltip", [ue, D] = R(A), U = (e) => {
68
69
  const {
69
70
  __scopeTooltip: o,
70
71
  children: t,
71
72
  open: r,
72
- defaultOpen: n,
73
- onOpenChange: l,
74
- disableHoverableContent: i,
73
+ defaultOpen: n = !1,
74
+ onOpenChange: i,
75
+ disableHoverableContent: c,
75
76
  delayDuration: v
76
- } = e, a = I(P, e.__scopeTooltip), d = A(o), [c, f] = s.useState(null), h = $(), u = s.useRef(0), y = i ?? a.disableHoverableContent, C = v ?? a.delayDuration, T = s.useRef(!1), [x, m] = J({
77
+ } = e, a = I(A, e.__scopeTooltip), d = _(o), [l, f] = s.useState(null), y = $(), u = s.useRef(0), h = c ?? a.disableHoverableContent, C = v ?? a.delayDuration, T = s.useRef(!1), [x = !1, m] = J({
77
78
  prop: r,
78
- defaultProp: n ?? !1,
79
- onChange: (S) => {
80
- S ? (a.onOpen(), document.dispatchEvent(new CustomEvent(O))) : a.onClose(), l == null || l(S);
81
- },
82
- caller: P
79
+ defaultProp: n,
80
+ onChange: (N) => {
81
+ N ? (a.onOpen(), document.dispatchEvent(new CustomEvent(L))) : a.onClose(), i == null || i(N);
82
+ }
83
83
  }), b = s.useMemo(() => x ? T.current ? "delayed-open" : "instant-open" : "closed", [x]), E = s.useCallback(() => {
84
84
  window.clearTimeout(u.current), u.current = 0, T.current = !1, m(!0);
85
- }, [m]), R = s.useCallback(() => {
85
+ }, [m]), P = s.useCallback(() => {
86
86
  window.clearTimeout(u.current), u.current = 0, m(!1);
87
- }, [m]), N = s.useCallback(() => {
87
+ }, [m]), M = s.useCallback(() => {
88
88
  window.clearTimeout(u.current), u.current = window.setTimeout(() => {
89
89
  T.current = !0, m(!0), u.current = 0;
90
90
  }, C);
@@ -92,46 +92,46 @@ var P = "Tooltip", [pe, D] = _(P), B = (e) => {
92
92
  return s.useEffect(() => () => {
93
93
  u.current && (window.clearTimeout(u.current), u.current = 0);
94
94
  }, []), /* @__PURE__ */ p(ee, { ...d, children: /* @__PURE__ */ p(
95
- pe,
95
+ ue,
96
96
  {
97
97
  scope: o,
98
- contentId: h,
98
+ contentId: y,
99
99
  open: x,
100
100
  stateAttribute: b,
101
- trigger: c,
101
+ trigger: l,
102
102
  onTriggerChange: f,
103
103
  onTriggerEnter: s.useCallback(() => {
104
- a.isOpenDelayedRef.current ? N() : E();
105
- }, [a.isOpenDelayedRef, N, E]),
104
+ a.isOpenDelayed ? M() : E();
105
+ }, [a.isOpenDelayed, M, E]),
106
106
  onTriggerLeave: s.useCallback(() => {
107
- y ? R() : (window.clearTimeout(u.current), u.current = 0);
108
- }, [R, y]),
107
+ h ? P() : (window.clearTimeout(u.current), u.current = 0);
108
+ }, [P, h]),
109
109
  onOpen: E,
110
- onClose: R,
111
- disableHoverableContent: y,
110
+ onClose: P,
111
+ disableHoverableContent: h,
112
112
  children: t
113
113
  }
114
114
  ) });
115
115
  };
116
- B.displayName = P;
117
- var k = "TooltipTrigger", U = s.forwardRef(
116
+ U.displayName = A;
117
+ var k = "TooltipTrigger", Y = s.forwardRef(
118
118
  (e, o) => {
119
- const { __scopeTooltip: t, ...r } = e, n = D(k, t), l = I(k, t), i = A(t), v = s.useRef(null), a = j(o, v, n.onTriggerChange), d = s.useRef(!1), c = s.useRef(!1), f = s.useCallback(() => d.current = !1, []);
120
- return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(te, { asChild: !0, ...i, children: /* @__PURE__ */ p(
121
- M.button,
119
+ const { __scopeTooltip: t, ...r } = e, n = D(k, t), i = I(k, t), c = _(t), v = s.useRef(null), a = j(o, v, n.onTriggerChange), d = s.useRef(!1), l = s.useRef(!1), f = s.useCallback(() => d.current = !1, []);
120
+ return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(te, { asChild: !0, ...c, children: /* @__PURE__ */ p(
121
+ S.button,
122
122
  {
123
123
  "aria-describedby": n.open ? n.contentId : void 0,
124
124
  "data-state": n.stateAttribute,
125
125
  ...r,
126
126
  ref: a,
127
- onPointerMove: g(e.onPointerMove, (h) => {
128
- h.pointerType !== "touch" && !c.current && !l.isPointerInTransitRef.current && (n.onTriggerEnter(), c.current = !0);
127
+ onPointerMove: g(e.onPointerMove, (y) => {
128
+ y.pointerType !== "touch" && !l.current && !i.isPointerInTransitRef.current && (n.onTriggerEnter(), l.current = !0);
129
129
  }),
130
130
  onPointerLeave: g(e.onPointerLeave, () => {
131
- n.onTriggerLeave(), c.current = !1;
131
+ n.onTriggerLeave(), l.current = !1;
132
132
  }),
133
133
  onPointerDown: g(e.onPointerDown, () => {
134
- n.open && n.onClose(), d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
134
+ d.current = !0, document.addEventListener("pointerup", f, { once: !0 });
135
135
  }),
136
136
  onFocus: g(e.onFocus, () => {
137
137
  d.current || n.onOpen();
@@ -142,68 +142,68 @@ var k = "TooltipTrigger", U = s.forwardRef(
142
142
  ) });
143
143
  }
144
144
  );
145
- U.displayName = k;
146
- var de = "TooltipPortal", [ke, fe] = _(de, {
145
+ Y.displayName = k;
146
+ var pe = "TooltipPortal", [Oe, de] = R(pe, {
147
147
  forceMount: void 0
148
148
  }), w = "TooltipContent", q = s.forwardRef(
149
149
  (e, o) => {
150
- const t = fe(w, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...l } = e, i = D(w, e.__scopeTooltip);
151
- return /* @__PURE__ */ p(Q, { present: r || i.open, children: i.disableHoverableContent ? /* @__PURE__ */ p(W, { side: n, ...l, ref: o }) : /* @__PURE__ */ p(ve, { side: n, ...l, ref: o }) });
150
+ const t = de(w, e.__scopeTooltip), { forceMount: r = t.forceMount, side: n = "top", ...i } = e, c = D(w, e.__scopeTooltip);
151
+ return /* @__PURE__ */ p(Q, { present: r || c.open, children: c.disableHoverableContent ? /* @__PURE__ */ p(W, { side: n, ...i, ref: o }) : /* @__PURE__ */ p(fe, { side: n, ...i, ref: o }) });
152
152
  }
153
- ), ve = s.forwardRef((e, o) => {
154
- const t = D(w, e.__scopeTooltip), r = I(w, e.__scopeTooltip), n = s.useRef(null), l = j(o, n), [i, v] = s.useState(null), { trigger: a, onClose: d } = t, c = n.current, { onPointerInTransitChange: f } = r, h = s.useCallback(() => {
153
+ ), fe = s.forwardRef((e, o) => {
154
+ const t = D(w, e.__scopeTooltip), r = I(w, e.__scopeTooltip), n = s.useRef(null), i = j(o, n), [c, v] = s.useState(null), { trigger: a, onClose: d } = t, l = n.current, { onPointerInTransitChange: f } = r, y = s.useCallback(() => {
155
155
  v(null), f(!1);
156
156
  }, [f]), u = s.useCallback(
157
- (y, C) => {
158
- const T = y.currentTarget, x = { x: y.clientX, y: y.clientY }, m = Ce(x, T.getBoundingClientRect()), b = me(x, m), E = xe(C.getBoundingClientRect()), R = we([...b, ...E]);
159
- v(R), f(!0);
157
+ (h, C) => {
158
+ const T = h.currentTarget, x = { x: h.clientX, y: h.clientY }, m = ye(x, T.getBoundingClientRect()), b = Te(x, m), E = Ce(C.getBoundingClientRect()), P = xe([...b, ...E]);
159
+ v(P), f(!0);
160
160
  },
161
161
  [f]
162
162
  );
163
- return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
164
- if (a && c) {
165
- const y = (T) => u(T, c), C = (T) => u(T, a);
166
- return a.addEventListener("pointerleave", y), c.addEventListener("pointerleave", C), () => {
167
- a.removeEventListener("pointerleave", y), c.removeEventListener("pointerleave", C);
163
+ return s.useEffect(() => () => y(), [y]), s.useEffect(() => {
164
+ if (a && l) {
165
+ const h = (T) => u(T, l), C = (T) => u(T, a);
166
+ return a.addEventListener("pointerleave", h), l.addEventListener("pointerleave", C), () => {
167
+ a.removeEventListener("pointerleave", h), l.removeEventListener("pointerleave", C);
168
168
  };
169
169
  }
170
- }, [a, c, u, h]), s.useEffect(() => {
171
- if (i) {
172
- const y = (C) => {
173
- const T = C.target, x = { x: C.clientX, y: C.clientY }, m = (a == null ? void 0 : a.contains(T)) || (c == null ? void 0 : c.contains(T)), b = !ge(x, i);
174
- m ? h() : b && (h(), d());
170
+ }, [a, l, u, y]), s.useEffect(() => {
171
+ if (c) {
172
+ const h = (C) => {
173
+ const T = C.target, x = { x: C.clientX, y: C.clientY }, m = (a == null ? void 0 : a.contains(T)) || (l == null ? void 0 : l.contains(T)), b = !me(x, c);
174
+ m ? y() : b && (y(), d());
175
175
  };
176
- return document.addEventListener("pointermove", y), () => document.removeEventListener("pointermove", y);
176
+ return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
177
177
  }
178
- }, [a, c, i, d, h]), /* @__PURE__ */ p(W, { ...e, ref: l });
179
- }), [he, ye] = _(P, { isInside: !1 }), Te = Z("TooltipContent"), W = s.forwardRef(
178
+ }, [a, l, c, d, y]), /* @__PURE__ */ p(W, { ...e, ref: i });
179
+ }), [ve, he] = R(A, { isInside: !1 }), W = s.forwardRef(
180
180
  (e, o) => {
181
181
  const {
182
182
  __scopeTooltip: t,
183
183
  children: r,
184
184
  "aria-label": n,
185
- onEscapeKeyDown: l,
186
- onPointerDownOutside: i,
185
+ onEscapeKeyDown: i,
186
+ onPointerDownOutside: c,
187
187
  ...v
188
- } = e, a = D(w, t), d = A(t), { onClose: c } = a;
189
- return s.useEffect(() => (document.addEventListener(O, c), () => document.removeEventListener(O, c)), [c]), s.useEffect(() => {
188
+ } = e, a = D(w, t), d = _(t), { onClose: l } = a;
189
+ return s.useEffect(() => (document.addEventListener(L, l), () => document.removeEventListener(L, l)), [l]), s.useEffect(() => {
190
190
  if (a.trigger) {
191
- const f = (h) => {
192
- const u = h.target;
193
- u != null && u.contains(a.trigger) && c();
191
+ const f = (y) => {
192
+ const u = y.target;
193
+ u != null && u.contains(a.trigger) && l();
194
194
  };
195
195
  return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
196
196
  }
197
- }, [a.trigger, c]), /* @__PURE__ */ p(
197
+ }, [a.trigger, l]), /* @__PURE__ */ p(
198
198
  oe,
199
199
  {
200
200
  asChild: !0,
201
201
  disableOutsidePointerEvents: !1,
202
- onEscapeKeyDown: l,
203
- onPointerDownOutside: i,
202
+ onEscapeKeyDown: i,
203
+ onPointerDownOutside: c,
204
204
  onFocusOutside: (f) => f.preventDefault(),
205
- onDismiss: c,
206
- children: /* @__PURE__ */ L(
205
+ onDismiss: l,
206
+ children: /* @__PURE__ */ O(
207
207
  re,
208
208
  {
209
209
  "data-state": a.stateAttribute,
@@ -219,8 +219,8 @@ var de = "TooltipPortal", [ke, fe] = _(de, {
219
219
  "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
220
220
  },
221
221
  children: [
222
- /* @__PURE__ */ p(Te, { children: r }),
223
- /* @__PURE__ */ p(he, { scope: t, isInside: !0, children: /* @__PURE__ */ p(le, { id: a.contentId, role: "tooltip", children: n || r }) })
222
+ /* @__PURE__ */ p(Z, { children: r }),
223
+ /* @__PURE__ */ p(ve, { scope: t, isInside: !0, children: /* @__PURE__ */ p(ie, { id: a.contentId, role: "tooltip", children: n || r }) })
224
224
  ]
225
225
  }
226
226
  )
@@ -229,20 +229,20 @@ var de = "TooltipPortal", [ke, fe] = _(de, {
229
229
  }
230
230
  );
231
231
  q.displayName = w;
232
- var X = "TooltipArrow", z = s.forwardRef(
232
+ var X = "TooltipArrow", K = s.forwardRef(
233
233
  (e, o) => {
234
- const { __scopeTooltip: t, ...r } = e, n = A(t);
235
- return ye(
234
+ const { __scopeTooltip: t, ...r } = e, n = _(t);
235
+ return he(
236
236
  X,
237
237
  t
238
238
  ).isInside ? null : /* @__PURE__ */ p(ne, { ...n, ...r, ref: o });
239
239
  }
240
240
  );
241
- z.displayName = X;
242
- function Ce(e, o) {
243
- const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), l = Math.abs(o.left - e.x);
244
- switch (Math.min(t, r, n, l)) {
245
- case l:
241
+ K.displayName = X;
242
+ function ye(e, o) {
243
+ const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x), i = Math.abs(o.left - e.x);
244
+ switch (Math.min(t, r, n, i)) {
245
+ case i:
246
246
  return "left";
247
247
  case n:
248
248
  return "right";
@@ -254,7 +254,7 @@ function Ce(e, o) {
254
254
  throw new Error("unreachable");
255
255
  }
256
256
  }
257
- function me(e, o, t = 5) {
257
+ function Te(e, o, t = 5) {
258
258
  const r = [];
259
259
  switch (o) {
260
260
  case "top":
@@ -284,7 +284,7 @@ function me(e, o, t = 5) {
284
284
  }
285
285
  return r;
286
286
  }
287
- function xe(e) {
287
+ function Ce(e) {
288
288
  const { top: o, right: t, bottom: r, left: n } = e;
289
289
  return [
290
290
  { x: n, y: o },
@@ -293,28 +293,28 @@ function xe(e) {
293
293
  { x: n, y: r }
294
294
  ];
295
295
  }
296
- function ge(e, o) {
296
+ function me(e, o) {
297
297
  const { x: t, y: r } = e;
298
298
  let n = !1;
299
- for (let l = 0, i = o.length - 1; l < o.length; i = l++) {
300
- const v = o[l], a = o[i], d = v.x, c = v.y, f = a.x, h = a.y;
301
- c > r != h > r && t < (f - d) * (r - c) / (h - c) + d && (n = !n);
299
+ for (let i = 0, c = o.length - 1; i < o.length; c = i++) {
300
+ const v = o[i].x, a = o[i].y, d = o[c].x, l = o[c].y;
301
+ a > r != l > r && t < (d - v) * (r - a) / (l - a) + v && (n = !n);
302
302
  }
303
303
  return n;
304
304
  }
305
- function we(e) {
305
+ function xe(e) {
306
306
  const o = e.slice();
307
- return o.sort((t, r) => t.x < r.x ? -1 : t.x > r.x ? 1 : t.y < r.y ? -1 : t.y > r.y ? 1 : 0), be(o);
307
+ return o.sort((t, r) => t.x < r.x ? -1 : t.x > r.x ? 1 : t.y < r.y ? -1 : t.y > r.y ? 1 : 0), ge(o);
308
308
  }
309
- function be(e) {
309
+ function ge(e) {
310
310
  if (e.length <= 1)
311
311
  return e.slice();
312
312
  const o = [];
313
313
  for (let r = 0; r < e.length; r++) {
314
314
  const n = e[r];
315
315
  for (; o.length >= 2; ) {
316
- const l = o[o.length - 1], i = o[o.length - 2];
317
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x))
316
+ const i = o[o.length - 1], c = o[o.length - 2];
317
+ if ((i.x - c.x) * (n.y - c.y) >= (i.y - c.y) * (n.x - c.x))
318
318
  o.pop();
319
319
  else
320
320
  break;
@@ -326,8 +326,8 @@ function be(e) {
326
326
  for (let r = e.length - 1; r >= 0; r--) {
327
327
  const n = e[r];
328
328
  for (; t.length >= 2; ) {
329
- const l = t[t.length - 1], i = t[t.length - 2];
330
- if ((l.x - i.x) * (n.y - i.y) >= (l.y - i.y) * (n.x - i.x))
329
+ const i = t[t.length - 1], c = t[t.length - 2];
330
+ if ((i.x - c.x) * (n.y - c.y) >= (i.y - c.y) * (n.x - c.x))
331
331
  t.pop();
332
332
  else
333
333
  break;
@@ -336,19 +336,19 @@ function be(e) {
336
336
  }
337
337
  return t.pop(), o.length === 1 && t.length === 1 && o[0].x === t[0].x && o[0].y === t[0].y ? o : o.concat(t);
338
338
  }
339
- const Ee = "_tooltipContent_12gjy_1", Re = "_tooltipArrow_12gjy_8", Pe = "_fadeIn_12gjy_1", H = {
340
- tooltipContent: Ee,
341
- tooltipArrow: Re,
342
- fadeIn: Pe
343
- }, Ie = se(
344
- ({ children: e, content: o, className: t, style: r }, n) => /* @__PURE__ */ p(Y, { children: /* @__PURE__ */ L(B, { delayDuration: 1e3, children: [
345
- /* @__PURE__ */ p(U, { asChild: !0, children: /* @__PURE__ */ p("div", { ref: n, className: t, style: r, children: e }) }),
346
- /* @__PURE__ */ L(q, { className: H.tooltipContent, sideOffset: 5, children: [
347
- /* @__PURE__ */ p(z, { className: H.tooltipArrow }),
339
+ const we = "_tooltipContent_12gjy_1", be = "_tooltipArrow_12gjy_8", Ee = "_fadeIn_12gjy_1", H = {
340
+ tooltipContent: we,
341
+ tooltipArrow: be,
342
+ fadeIn: Ee
343
+ }, Le = se(
344
+ ({ children: e, content: o, className: t, style: r }, n) => /* @__PURE__ */ p(B, { children: /* @__PURE__ */ O(U, { delayDuration: 1e3, children: [
345
+ /* @__PURE__ */ p(Y, { asChild: !0, children: /* @__PURE__ */ p("div", { ref: n, className: t, style: r, children: e }) }),
346
+ /* @__PURE__ */ O(q, { className: H.tooltipContent, sideOffset: 5, children: [
347
+ /* @__PURE__ */ p(K, { className: H.tooltipArrow }),
348
348
  /* @__PURE__ */ p("span", { children: o })
349
349
  ] })
350
350
  ] }) })
351
351
  );
352
352
  export {
353
- Ie as default
353
+ Le as default
354
354
  };
@@ -1,71 +1,71 @@
1
- import { jsx as w } from "react/jsx-runtime";
2
- import { createContext as P, useState as h, useCallback as u, useContext as g, useRef as A, useMemo as R } from "react";
3
- import { LicenseType as d } from "../utils/types.js";
4
- import { useDimensionPagesContext as T } from "./DimensionPagesContext.js";
5
- import { usePagesRotateContext as y } from "./PagesRotateContext.js";
6
- import { useLicenseContext as O } from "./LicenseContext.js";
7
- import { useZoomContext as S } from "./ZoomContext.js";
8
- import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as a } from "../utils/const.js";
9
- const x = P(void 0), k = ({ children: l }) => {
10
- const [r, o] = h({}), { widths: t, heights: c } = T(), { pageRotate: m } = y(), { zoomLevel: f } = S(), p = u(
11
- (e, s) => {
1
+ import { jsx as L } from "react/jsx-runtime";
2
+ import { createContext as w, useState as P, useCallback as u, useContext as h, useRef as g, useMemo as A } from "react";
3
+ import { LicenseType as R } from "../utils/types.js";
4
+ import { useDimensionPagesContext as y } from "./DimensionPagesContext.js";
5
+ import { usePagesRotateContext as S } from "./PagesRotateContext.js";
6
+ import { useLicenseContext as T } from "./LicenseContext.js";
7
+ import { useZoomContext as _ } from "./ZoomContext.js";
8
+ import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as E } from "../utils/const.js";
9
+ const d = w(void 0), z = ({ children: i }) => {
10
+ const [l, o] = P({}), { widths: t, heights: c } = y(), { pageRotate: m } = S(), { zoomLevel: f } = _(), x = u(
11
+ (e, r) => {
12
12
  o((n) => {
13
- const i = { width: t[e], height: c[e] };
13
+ const s = { width: t[e], height: c[e] };
14
14
  return {
15
15
  ...n,
16
- [e]: s(n[e], i, m[e], f)
16
+ [e]: r(n[e], s, m[e], f)
17
17
  };
18
18
  });
19
19
  },
20
20
  [t, c, f, m]
21
- ), C = u((e) => {
22
- o((s) => {
23
- const n = { ...s };
21
+ ), p = u((e) => {
22
+ o((r) => {
23
+ const n = { ...r };
24
24
  return delete n[e], n;
25
25
  });
26
- }, []), L = u((e, s) => {
26
+ }, []), v = u((e, r) => {
27
27
  o((n) => {
28
- const i = { ...n };
29
- return i[e] = i[e].filter((_, v) => v !== s), i;
28
+ const s = { ...n };
29
+ return s[e] = s[e].filter((D, C) => C !== r), s;
30
30
  });
31
31
  }, []);
32
- return /* @__PURE__ */ w(
33
- x.Provider,
32
+ return /* @__PURE__ */ L(
33
+ d.Provider,
34
34
  {
35
- value: { updateElement: p, clearElements: C, removeElement: L, elementList: r },
36
- children: l
35
+ value: { updateElement: x, clearElements: p, removeElement: v, elementList: l },
36
+ children: i
37
37
  }
38
38
  );
39
- }, E = () => {
39
+ }, a = () => {
40
40
  }, U = () => {
41
- const l = g(x), { type: r, validating: o } = O(), t = A(0), c = R(() => {
41
+ const i = h(d), { type: l, validating: o } = T(), t = g(0), c = A(() => {
42
42
  if (o !== !1)
43
43
  return {
44
- updateElement: E,
45
- clearElements: E,
46
- removeElement: E,
44
+ updateElement: a,
45
+ clearElements: a,
46
+ removeElement: a,
47
47
  elementList: {}
48
48
  };
49
- if (!(r ? [d.Organization, d.FreeTrial].includes(r) : !1))
49
+ if (!(l !== R.Developer))
50
50
  return {
51
51
  updateElement: () => {
52
- t.current === 0 && (console.error(a), t.current++);
52
+ t.current === 0 && (console.error(E), t.current++);
53
53
  },
54
54
  clearElements: () => {
55
- t.current === 0 && (console.error(a), t.current++);
55
+ t.current === 0 && (console.error(E), t.current++);
56
56
  },
57
57
  removeElement: () => {
58
- t.current === 0 && (console.error(a), t.current++);
58
+ t.current === 0 && (console.error(E), t.current++);
59
59
  },
60
60
  elementList: {}
61
61
  };
62
- }, [r, o]);
63
- if (!l)
62
+ }, [l, o]);
63
+ if (!i)
64
64
  throw new Error("useElementPageContext must be used within a ElementPageProvider");
65
- return c || l;
65
+ return c || i;
66
66
  };
67
67
  export {
68
- x as ElementPageContext,
69
- k as ElementPageProvider,
68
+ d as ElementPageContext,
69
+ z as ElementPageProvider,
70
70
  U as useElementPageContext
71
71
  };
@@ -1,41 +1,39 @@
1
- import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
- import { createContext as d, useRef as x, useContext as C } from "react";
3
- import { useDocumentContext as F } from "./RPDocumentContext.js";
4
- import { useDocumentPasswordContext as h } from "./DocumentPasswordContext.js";
5
- const s = d(null), y = ({ children: t }) => {
6
- const { setFilename: i, setPdfSrc: c } = F(), o = x(null), {
7
- setPassword: l
8
- } = h(), u = () => {
1
+ import { jsxs as m, jsx as x } from "react/jsx-runtime";
2
+ import { createContext as C, useRef as c, useContext as F } from "react";
3
+ import { useDocumentContext as h } from "./RPDocumentContext.js";
4
+ import { useDocumentPasswordContext as P } from "./DocumentPasswordContext.js";
5
+ const l = C(null), g = ({ children: t }) => {
6
+ const { setFilename: u, setPdfSrc: p } = h(), r = c(), o = c(null), { setPassword: a } = P(), f = () => {
9
7
  var e;
10
8
  (e = o.current) == null || e.click();
11
- }, p = (e) => {
12
- var r;
13
- const n = (r = e.target.files) == null ? void 0 : r[0];
9
+ }, d = (e) => {
10
+ var i;
11
+ const n = (i = e.target.files) == null ? void 0 : i[0];
14
12
  if (!n || n.type !== "application/pdf")
15
13
  return;
16
- const a = URL.createObjectURL(n);
17
- i(n.name), c(a), e.target.value = "", l("");
14
+ const s = URL.createObjectURL(n);
15
+ r.current && URL.revokeObjectURL(r.current), r.current = s, u(n.name), p(s), e.target.value = "", a("");
18
16
  };
19
- return /* @__PURE__ */ f(s.Provider, { value: { openFile: u }, children: [
17
+ return /* @__PURE__ */ m(l.Provider, { value: { openFile: f }, children: [
20
18
  t,
21
- /* @__PURE__ */ m(
19
+ /* @__PURE__ */ x(
22
20
  "input",
23
21
  {
24
22
  accept: "application/pdf",
25
23
  type: "file",
26
24
  ref: o,
27
25
  style: { display: "none" },
28
- onChange: p
26
+ onChange: d
29
27
  }
30
28
  )
31
29
  ] });
32
- }, I = () => {
33
- const t = C(s);
30
+ }, j = () => {
31
+ const t = F(l);
34
32
  if (!t)
35
33
  throw new Error("useOpenFileContext must be used within FileInputProvider");
36
34
  return t;
37
35
  };
38
36
  export {
39
- y as FileInputProvider,
40
- I as useOpenFileContext
37
+ g as FileInputProvider,
38
+ j as useOpenFileContext
41
39
  };
@@ -1,10 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { p, P as e, u as m } from "../RPLayout-5892502c.js";
3
+ import { t as e, P as m, u as p } from "../ToolbarLayout.module-88476995.js";
4
4
  import "./RPDocumentContext.js";
5
5
  import "../utils/appConsole.js";
6
6
  export {
7
- p as PaginationContext,
8
- e as PaginationProvider,
9
- m as usePaginationContext
7
+ e as PaginationContext,
8
+ m as PaginationProvider,
9
+ p as usePaginationContext
10
10
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { r as e, g as n, d as s } from "../RPLayout-5892502c.js";
3
+ import { w as e, f as n, b as s } from "../ToolbarLayout.module-88476995.js";
4
4
  export {
5
5
  e as PrintContext,
6
6
  n as PrintProvider,
@@ -0,0 +1,10 @@
1
+ import "react/jsx-runtime";
2
+ import "react";
3
+ import "../utils/Queue.js";
4
+ import "../utils/renderPage.js";
5
+ import { B as m, e as p, C as d } from "../ToolbarLayout.module-88476995.js";
6
+ export {
7
+ m as RenderQueueContext,
8
+ p as RenderQueueProvider,
9
+ d as useRenderQueue
10
+ };