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