@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.
- package/dist/Checkbox.module-3edaacbb.js +7 -0
- package/dist/Combination-9a0a3e65.js +693 -0
- package/dist/Container.module-f8b5c306.js +6 -0
- package/dist/DropDown.module-a78567cb.js +11 -0
- package/dist/MenuItem.module-bc11d0d3.js +6 -0
- package/dist/MenuSeparator.module-89b2ff7f.js +6 -0
- package/dist/PropertyItem.module-db0150cc.js +8 -0
- package/dist/RPSplitter.module-13d612c4.js +7 -0
- package/dist/RPTheme.module-bd9038da.js +8 -0
- package/dist/RotateTool.module-03987eba.js +6 -0
- package/dist/SearchTool.module-016f3a8d.js +16 -0
- package/dist/ToolbarLayout.module-88476995.js +2464 -0
- package/dist/WrapperLayout.module-147bc943.js +6 -0
- package/dist/assets/ToolbarLayout.css +1 -0
- package/dist/components/RPConfig.js +673 -691
- package/dist/components/RPController.js +34 -34
- package/dist/components/RPDropFileZone.js +21 -23
- package/dist/components/RPPages.js +21 -18
- package/dist/components/RPProvider.js +19 -15
- package/dist/components/layout/Container.js +10 -11
- package/dist/components/layout/LayoutContainer.js +19 -16
- package/dist/components/layout/RPDefaultLayout.js +76 -14
- package/dist/components/layout/RPLayout.js +74 -24
- package/dist/components/layout/WrapperLayout.js +7 -8
- package/dist/components/layout/sidebar/RPSidebar.js +51 -12
- package/dist/components/layout/sidebar/RPSplitter.js +7 -9
- package/dist/components/layout/sidebar/Thumbnail.js +49 -2
- package/dist/components/layout/sidebar/Thumbnails.js +1 -1
- package/dist/components/layout/toolbar/DocumentDialog.js +307 -24
- package/dist/components/layout/toolbar/FileDownloadTool.js +23 -13
- package/dist/components/layout/toolbar/MenuItem.js +6 -7
- package/dist/components/layout/toolbar/MenuSeparator.js +4 -5
- package/dist/components/layout/toolbar/MostPageTool.js +50 -23
- package/dist/components/layout/toolbar/OtherTool.js +115 -22
- package/dist/components/layout/toolbar/Paginate.js +99 -17
- package/dist/components/layout/toolbar/PrintTool.js +43 -13
- package/dist/components/layout/toolbar/PropertyItem.js +5 -8
- package/dist/components/layout/toolbar/RPToolbar.js +28 -7
- package/dist/components/layout/toolbar/RPToolbarEnd.js +22 -7
- package/dist/components/layout/toolbar/RotateTool.js +20 -21
- package/dist/components/layout/toolbar/ScrollModeTool.js +1 -1
- package/dist/components/layout/toolbar/SearchCloseButton.js +19 -7
- package/dist/components/layout/toolbar/SearchResultNavigator.js +42 -8
- package/dist/components/layout/toolbar/SearchTool.js +198 -29
- package/dist/components/layout/toolbar/SelectionModeTool.js +1 -1
- package/dist/components/layout/toolbar/ThumbnailTool.js +3 -3
- package/dist/components/layout/toolbar/ToolbarCustom.js +48 -20
- package/dist/components/layout/toolbar/ToolbarDefault.js +82 -0
- package/dist/components/layout/toolbar/ToolbarLayout.js +10 -0
- package/dist/components/layout/toolbar/ViewModeTool.js +1 -1
- package/dist/components/layout/toolbar/ZoomTool.js +140 -28
- package/dist/components/layout/toolbar/tools/FileDownloadTool.js +3 -3
- package/dist/components/layout/toolbar/tools/InputPageTool.js +11 -11
- package/dist/components/layout/toolbar/tools/NextPageTool.js +21 -18
- package/dist/components/layout/toolbar/tools/PreviousPageTool.js +1 -1
- package/dist/components/layout/toolbar/tools/PrintTool.js +3 -3
- package/dist/components/layout/toolbar/tools/ThumbnailTool.js +1 -1
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +10 -10
- package/dist/components/layout/toolbar/tools/defaults/{TopbarDefaultTools.js → RPHorizontalBar.js} +29 -20
- package/dist/components/layout/toolbar/tools/defaults/RPVerticalBar.js +16 -0
- package/dist/components/page/AnnotationLayer.js +20 -17
- package/dist/components/page/CanvasLayer.js +20 -18
- package/dist/components/page/DualPage.js +1 -1
- package/dist/components/page/RPPage.js +20 -17
- package/dist/components/page/SinglePage.js +1 -1
- package/dist/components/page/TextHighlightLayer.js +20 -17
- package/dist/components/page/TextLayer.js +20 -17
- package/dist/components/ui/Checkbox.js +125 -239
- package/dist/components/ui/DropDown.js +13 -19
- package/dist/components/ui/LoadingIndicator.js +22 -5
- package/dist/components/ui/RPTooltip.js +133 -133
- package/dist/contexts/ElementPageContext.js +37 -37
- package/dist/contexts/FileInputContext.js +18 -20
- package/dist/contexts/PaginationContext.js +4 -4
- package/dist/contexts/PrintContext.js +1 -1
- package/dist/contexts/RenderQueueProvider.js +10 -0
- package/dist/contexts/SearchContext.js +3 -3
- package/dist/contexts/ThumbnailsContext.js +1 -1
- package/dist/contexts/ViewportContext.js +42 -35
- package/dist/index-2160dd99.js +307 -0
- package/dist/{index-5f66a29f.js → index-492f99d0.js} +491 -515
- package/dist/index-49b9a615.js +978 -0
- package/dist/main.js +76 -73
- package/dist/types/components/layout/RPDefaultLayout.d.ts +2 -1
- package/dist/types/components/layout/RPLayout.d.ts +2 -1
- package/dist/types/components/layout/sidebar/Thumbnail.d.ts +0 -1
- package/dist/types/components/layout/toolbar/RPToolbar.d.ts +2 -3
- package/dist/types/components/layout/toolbar/ToolbarCustom.d.ts +2 -2
- package/dist/types/components/layout/toolbar/ToolbarDefault.d.ts +4 -0
- package/dist/types/components/layout/toolbar/ToolbarLayout.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPHorizontalBar.d.ts +3 -0
- package/dist/types/components/layout/toolbar/tools/defaults/RPVerticalBar.d.ts +3 -0
- package/dist/types/contexts/RenderQueueProvider.d.ts +16 -0
- package/dist/types/main.d.ts +3 -3
- package/dist/types/utils/Queue.d.ts +18 -0
- package/dist/types/utils/renderPage.d.ts +1 -6
- package/dist/types/utils/types.d.ts +22 -17
- package/dist/utils/Queue.js +47 -0
- package/dist/utils/hooks/useFileDownload.js +20 -17
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePageRotateContext.js +14 -14
- package/dist/utils/hooks/usePaginate.js +20 -17
- package/dist/utils/hooks/usePresentPage.js +20 -17
- package/dist/utils/hooks/usePrint.js +20 -17
- package/dist/utils/hooks/useScrollToPage.js +20 -17
- package/dist/utils/hooks/useSearch.js +20 -17
- package/dist/utils/hooks/useThumbnail.js +20 -18
- package/dist/utils/hooks/useVirtualReactWindow.js +20 -17
- package/package.json +1 -1
- package/dist/RPLayout-5892502c.js +0 -3494
- package/dist/SearchCloseButton-cbf182aa.js +0 -33
- package/dist/assets/RPLayout.css +0 -1
- package/dist/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.js +0 -16
- package/dist/index-00f8683a.js +0 -1672
- package/dist/index-6b37f504.js +0 -332
- package/dist/types/components/layout/toolbar/tools/defaults/LeftSidebarDefaultTools.d.ts +0 -3
- package/dist/types/components/layout/toolbar/tools/defaults/TopbarDefaultTools.d.ts +0 -3
- /package/dist/assets/{RPDropFileZone.css → RPTheme.css} +0 -0
- /package/dist/assets/{SearchCloseButton.css → SearchTool.css} +0 -0
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import { jsx as p, jsxs as
|
|
1
|
+
import { jsx as p, jsxs as O } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { P as
|
|
4
|
-
import { c as G, u as $, R as ee, A as te, D as oe, C as re, a as ne } from "../../index-
|
|
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 =
|
|
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
|
-
|
|
8
|
+
S.span,
|
|
21
9
|
{
|
|
22
10
|
...e,
|
|
23
11
|
ref: o,
|
|
24
|
-
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 =
|
|
29
|
-
var
|
|
29
|
+
F.displayName = ae;
|
|
30
|
+
var ie = F, [R, De] = z("Tooltip", [
|
|
30
31
|
G
|
|
31
|
-
]),
|
|
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 =
|
|
35
|
+
delayDuration: t = le,
|
|
35
36
|
skipDelayDuration: r = 300,
|
|
36
37
|
disableHoverableContent: n = !1,
|
|
37
|
-
children:
|
|
38
|
-
} = e,
|
|
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
|
|
41
|
-
return () => window.clearTimeout(
|
|
41
|
+
const l = d.current;
|
|
42
|
+
return () => window.clearTimeout(l);
|
|
42
43
|
}, []), /* @__PURE__ */ p(
|
|
43
|
-
|
|
44
|
+
ce,
|
|
44
45
|
{
|
|
45
46
|
scope: o,
|
|
46
|
-
|
|
47
|
+
isOpenDelayed: c,
|
|
47
48
|
delayDuration: t,
|
|
48
49
|
onOpen: s.useCallback(() => {
|
|
49
|
-
window.clearTimeout(
|
|
50
|
+
window.clearTimeout(d.current), v(!1);
|
|
50
51
|
}, []),
|
|
51
52
|
onClose: s.useCallback(() => {
|
|
52
|
-
window.clearTimeout(
|
|
53
|
-
() =>
|
|
53
|
+
window.clearTimeout(d.current), d.current = window.setTimeout(
|
|
54
|
+
() => v(!0),
|
|
54
55
|
r
|
|
55
56
|
);
|
|
56
57
|
}, [r]),
|
|
57
|
-
isPointerInTransitRef:
|
|
58
|
-
onPointerInTransitChange: s.useCallback((
|
|
59
|
-
|
|
58
|
+
isPointerInTransitRef: a,
|
|
59
|
+
onPointerInTransitChange: s.useCallback((l) => {
|
|
60
|
+
a.current = l;
|
|
60
61
|
}, []),
|
|
61
62
|
disableHoverableContent: n,
|
|
62
|
-
children:
|
|
63
|
+
children: i
|
|
63
64
|
}
|
|
64
65
|
);
|
|
65
66
|
};
|
|
66
|
-
|
|
67
|
-
var
|
|
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:
|
|
74
|
-
disableHoverableContent:
|
|
73
|
+
defaultOpen: n = !1,
|
|
74
|
+
onOpenChange: i,
|
|
75
|
+
disableHoverableContent: c,
|
|
75
76
|
delayDuration: v
|
|
76
|
-
} = e, a = I(
|
|
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
|
|
79
|
-
onChange: (
|
|
80
|
-
|
|
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]),
|
|
85
|
+
}, [m]), P = s.useCallback(() => {
|
|
86
86
|
window.clearTimeout(u.current), u.current = 0, m(!1);
|
|
87
|
-
}, [m]),
|
|
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
|
-
|
|
95
|
+
ue,
|
|
96
96
|
{
|
|
97
97
|
scope: o,
|
|
98
|
-
contentId:
|
|
98
|
+
contentId: y,
|
|
99
99
|
open: x,
|
|
100
100
|
stateAttribute: b,
|
|
101
|
-
trigger:
|
|
101
|
+
trigger: l,
|
|
102
102
|
onTriggerChange: f,
|
|
103
103
|
onTriggerEnter: s.useCallback(() => {
|
|
104
|
-
a.
|
|
105
|
-
}, [a.
|
|
104
|
+
a.isOpenDelayed ? M() : E();
|
|
105
|
+
}, [a.isOpenDelayed, M, E]),
|
|
106
106
|
onTriggerLeave: s.useCallback(() => {
|
|
107
|
-
|
|
108
|
-
}, [
|
|
107
|
+
h ? P() : (window.clearTimeout(u.current), u.current = 0);
|
|
108
|
+
}, [P, h]),
|
|
109
109
|
onOpen: E,
|
|
110
|
-
onClose:
|
|
111
|
-
disableHoverableContent:
|
|
110
|
+
onClose: P,
|
|
111
|
+
disableHoverableContent: h,
|
|
112
112
|
children: t
|
|
113
113
|
}
|
|
114
114
|
) });
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
var k = "TooltipTrigger",
|
|
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),
|
|
120
|
-
return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ p(te, { asChild: !0, ...
|
|
121
|
-
|
|
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, (
|
|
128
|
-
|
|
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(),
|
|
131
|
+
n.onTriggerLeave(), l.current = !1;
|
|
132
132
|
}),
|
|
133
133
|
onPointerDown: g(e.onPointerDown, () => {
|
|
134
|
-
|
|
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
|
-
|
|
146
|
-
var
|
|
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 =
|
|
151
|
-
return /* @__PURE__ */ p(Q, { present: r ||
|
|
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
|
-
),
|
|
154
|
-
const t = D(w, e.__scopeTooltip), r = I(w, e.__scopeTooltip), n = s.useRef(null),
|
|
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
|
-
(
|
|
158
|
-
const T =
|
|
159
|
-
v(
|
|
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(() => () =>
|
|
164
|
-
if (a &&
|
|
165
|
-
const
|
|
166
|
-
return a.addEventListener("pointerleave",
|
|
167
|
-
a.removeEventListener("pointerleave",
|
|
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,
|
|
171
|
-
if (
|
|
172
|
-
const
|
|
173
|
-
const T = C.target, x = { x: C.clientX, y: C.clientY }, m = (a == null ? void 0 : a.contains(T)) || (
|
|
174
|
-
m ?
|
|
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",
|
|
176
|
+
return document.addEventListener("pointermove", h), () => document.removeEventListener("pointermove", h);
|
|
177
177
|
}
|
|
178
|
-
}, [a,
|
|
179
|
-
}), [
|
|
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:
|
|
186
|
-
onPointerDownOutside:
|
|
185
|
+
onEscapeKeyDown: i,
|
|
186
|
+
onPointerDownOutside: c,
|
|
187
187
|
...v
|
|
188
|
-
} = e, a = D(w, t), d =
|
|
189
|
-
return s.useEffect(() => (document.addEventListener(
|
|
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 = (
|
|
192
|
-
const u =
|
|
193
|
-
u != null && u.contains(a.trigger) &&
|
|
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,
|
|
197
|
+
}, [a.trigger, l]), /* @__PURE__ */ p(
|
|
198
198
|
oe,
|
|
199
199
|
{
|
|
200
200
|
asChild: !0,
|
|
201
201
|
disableOutsidePointerEvents: !1,
|
|
202
|
-
onEscapeKeyDown:
|
|
203
|
-
onPointerDownOutside:
|
|
202
|
+
onEscapeKeyDown: i,
|
|
203
|
+
onPointerDownOutside: c,
|
|
204
204
|
onFocusOutside: (f) => f.preventDefault(),
|
|
205
|
-
onDismiss:
|
|
206
|
-
children: /* @__PURE__ */
|
|
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(
|
|
223
|
-
/* @__PURE__ */ p(
|
|
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",
|
|
232
|
+
var X = "TooltipArrow", K = s.forwardRef(
|
|
233
233
|
(e, o) => {
|
|
234
|
-
const { __scopeTooltip: t, ...r } = e, n =
|
|
235
|
-
return
|
|
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
|
-
|
|
242
|
-
function
|
|
243
|
-
const t = Math.abs(o.top - e.y), r = Math.abs(o.bottom - e.y), n = Math.abs(o.right - e.x),
|
|
244
|
-
switch (Math.min(t, r, n,
|
|
245
|
-
case
|
|
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
|
|
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
|
|
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
|
|
296
|
+
function me(e, o) {
|
|
297
297
|
const { x: t, y: r } = e;
|
|
298
298
|
let n = !1;
|
|
299
|
-
for (let
|
|
300
|
-
const v = o[
|
|
301
|
-
|
|
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
|
|
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),
|
|
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
|
|
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
|
|
317
|
-
if ((
|
|
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
|
|
330
|
-
if ((
|
|
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
|
|
340
|
-
tooltipContent:
|
|
341
|
-
tooltipArrow:
|
|
342
|
-
fadeIn:
|
|
343
|
-
},
|
|
344
|
-
({ children: e, content: o, className: t, style: r }, n) => /* @__PURE__ */ p(
|
|
345
|
-
/* @__PURE__ */ p(
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
/* @__PURE__ */ p(
|
|
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
|
-
|
|
353
|
+
Le as default
|
|
354
354
|
};
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { LicenseType as
|
|
4
|
-
import { useDimensionPagesContext as
|
|
5
|
-
import { usePagesRotateContext as
|
|
6
|
-
import { useLicenseContext as
|
|
7
|
-
import { useZoomContext as
|
|
8
|
-
import { ORGANIZATION_ALLOWED_FEATURES_MESSAGE as
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
11
|
-
(e,
|
|
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
|
|
13
|
+
const s = { width: t[e], height: c[e] };
|
|
14
14
|
return {
|
|
15
15
|
...n,
|
|
16
|
-
[e]:
|
|
16
|
+
[e]: r(n[e], s, m[e], f)
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
},
|
|
20
20
|
[t, c, f, m]
|
|
21
|
-
),
|
|
22
|
-
o((
|
|
23
|
-
const n = { ...
|
|
21
|
+
), p = u((e) => {
|
|
22
|
+
o((r) => {
|
|
23
|
+
const n = { ...r };
|
|
24
24
|
return delete n[e], n;
|
|
25
25
|
});
|
|
26
|
-
}, []),
|
|
26
|
+
}, []), v = u((e, r) => {
|
|
27
27
|
o((n) => {
|
|
28
|
-
const
|
|
29
|
-
return
|
|
28
|
+
const s = { ...n };
|
|
29
|
+
return s[e] = s[e].filter((D, C) => C !== r), s;
|
|
30
30
|
});
|
|
31
31
|
}, []);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
32
|
+
return /* @__PURE__ */ L(
|
|
33
|
+
d.Provider,
|
|
34
34
|
{
|
|
35
|
-
value: { updateElement:
|
|
36
|
-
children:
|
|
35
|
+
value: { updateElement: x, clearElements: p, removeElement: v, elementList: l },
|
|
36
|
+
children: i
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
},
|
|
39
|
+
}, a = () => {
|
|
40
40
|
}, U = () => {
|
|
41
|
-
const
|
|
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:
|
|
45
|
-
clearElements:
|
|
46
|
-
removeElement:
|
|
44
|
+
updateElement: a,
|
|
45
|
+
clearElements: a,
|
|
46
|
+
removeElement: a,
|
|
47
47
|
elementList: {}
|
|
48
48
|
};
|
|
49
|
-
if (!(
|
|
49
|
+
if (!(l !== R.Developer))
|
|
50
50
|
return {
|
|
51
51
|
updateElement: () => {
|
|
52
|
-
t.current === 0 && (console.error(
|
|
52
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
53
53
|
},
|
|
54
54
|
clearElements: () => {
|
|
55
|
-
t.current === 0 && (console.error(
|
|
55
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
56
56
|
},
|
|
57
57
|
removeElement: () => {
|
|
58
|
-
t.current === 0 && (console.error(
|
|
58
|
+
t.current === 0 && (console.error(E), t.current++);
|
|
59
59
|
},
|
|
60
60
|
elementList: {}
|
|
61
61
|
};
|
|
62
|
-
}, [
|
|
63
|
-
if (!
|
|
62
|
+
}, [l, o]);
|
|
63
|
+
if (!i)
|
|
64
64
|
throw new Error("useElementPageContext must be used within a ElementPageProvider");
|
|
65
|
-
return c ||
|
|
65
|
+
return c || i;
|
|
66
66
|
};
|
|
67
67
|
export {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
d as ElementPageContext,
|
|
69
|
+
z as ElementPageProvider,
|
|
70
70
|
U as useElementPageContext
|
|
71
71
|
};
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useDocumentContext as
|
|
4
|
-
import { useDocumentPasswordContext as
|
|
5
|
-
const
|
|
6
|
-
const { setFilename:
|
|
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
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const n = (
|
|
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
|
|
17
|
-
|
|
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__ */
|
|
17
|
+
return /* @__PURE__ */ m(l.Provider, { value: { openFile: f }, children: [
|
|
20
18
|
t,
|
|
21
|
-
/* @__PURE__ */
|
|
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:
|
|
26
|
+
onChange: d
|
|
29
27
|
}
|
|
30
28
|
)
|
|
31
29
|
] });
|
|
32
|
-
},
|
|
33
|
-
const t =
|
|
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
|
-
|
|
40
|
-
|
|
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 {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
e as PaginationContext,
|
|
8
|
+
m as PaginationProvider,
|
|
9
|
+
p as usePaginationContext
|
|
10
10
|
};
|
|
@@ -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
|
+
};
|