@react-pdf-kit/viewer 2.0.0 → 2.0.1-rc.0
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/{Combination-136ff99c.js → Combination-54a77a7a.js} +187 -184
- package/dist/components/layout/RPDefaultLayout.js +2 -2
- package/dist/components/layout/RPLayout.js +2 -2
- package/dist/components/layout/toolbar/DocumentDialog.js +1 -1
- package/dist/components/layout/toolbar/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/MenuItem.js +2 -2
- package/dist/components/layout/toolbar/MenuSeparator.js +2 -2
- package/dist/components/layout/toolbar/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/OtherTool.js +2 -2
- package/dist/components/layout/toolbar/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/RPMenuItem.js +2 -2
- package/dist/components/layout/toolbar/RPMoreOptions.js +2 -2
- package/dist/components/layout/toolbar/RPToolbar.js +2 -2
- package/dist/components/layout/toolbar/RPToolbarEnd.js +2 -2
- package/dist/components/layout/toolbar/RotateTool.js +2 -2
- package/dist/components/layout/toolbar/ScrollModeTool.js +2 -2
- package/dist/components/layout/toolbar/SearchTool.js +2 -2
- package/dist/components/layout/toolbar/SelectionModeTool.js +2 -2
- package/dist/components/layout/toolbar/ToolbarDefault.js +2 -2
- package/dist/components/layout/toolbar/ToolbarLayout.js +2 -2
- package/dist/components/layout/toolbar/ViewModeTool.js +2 -2
- package/dist/components/layout/toolbar/ZoomTool.js +2 -2
- package/dist/components/layout/toolbar/tools/DocumentPropertiesTool.js +1 -1
- package/dist/components/layout/toolbar/tools/DualPageWithCoverTool.js +2 -2
- package/dist/components/layout/toolbar/tools/FirstPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/LastPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/ZoomLevelTool.js +2 -2
- package/dist/components/layout/toolbar/tools/defaults/RPHorizontalBar.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/DocumentProperties.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileDownloadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FileUploadTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/FullScreenTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/MostPageTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/PrintTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/RotateTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ScrollModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/SelectionModeTool.js +2 -2
- package/dist/components/layout/toolbar/tools/more-options/ViewModeTool.js +2 -2
- package/dist/components/ui/DropDown.js +2 -2
- package/dist/{index-61f59539.js → index-4baea9b5.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/utils/hooks/useLicense.js +1 -1
- package/dist/utils/hooks/usePrint.js +82 -93
- package/dist/utils/injectPrintCSS.js +1 -2
- package/package.json +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
import * as u from "react";
|
|
2
|
-
import { useState as
|
|
3
|
-
import
|
|
4
|
-
import { u as
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { a as
|
|
7
|
-
var
|
|
2
|
+
import { useState as Se } from "react";
|
|
3
|
+
import we from "react-dom";
|
|
4
|
+
import { u as Ce, P as ie, a as Re } from "./index-c0faa594.js";
|
|
5
|
+
import { jsx as le } from "react/jsx-runtime";
|
|
6
|
+
import { a as q } from "./index-e3ee9457.js";
|
|
7
|
+
var Ae = "Portal", Te = u.forwardRef((e, t) => {
|
|
8
8
|
var a;
|
|
9
9
|
const { container: n, ...r } = e, [c, i] = u.useState(!1);
|
|
10
|
-
|
|
10
|
+
Ce(() => i(!0), []);
|
|
11
11
|
const l = n || c && ((a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : a.body);
|
|
12
|
-
return l ?
|
|
12
|
+
return l ? we.createPortal(/* @__PURE__ */ le(ie.div, { ...r, ref: t }), l) : null;
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
function
|
|
14
|
+
Te.displayName = Ae;
|
|
15
|
+
var U = 0;
|
|
16
|
+
function At() {
|
|
17
17
|
u.useEffect(() => {
|
|
18
18
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
19
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ??
|
|
20
|
-
|
|
19
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? Q()), document.body.insertAdjacentElement("beforeend", e[1] ?? Q()), U++, () => {
|
|
20
|
+
U === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), U--;
|
|
21
21
|
};
|
|
22
22
|
}, []);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Q() {
|
|
25
25
|
const e = document.createElement("span");
|
|
26
26
|
return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var j = "focusScope.autoFocusOnMount", K = "focusScope.autoFocusOnUnmount", $ = { bubbles: !1, cancelable: !0 }, ke = "FocusScope", Pe = u.forwardRef((e, t) => {
|
|
29
29
|
const {
|
|
30
30
|
loop: n = !1,
|
|
31
31
|
trapped: r = !1,
|
|
32
32
|
onMountAutoFocus: c,
|
|
33
33
|
onUnmountAutoFocus: i,
|
|
34
34
|
...l
|
|
35
|
-
} = e, [a, S] = u.useState(null), b =
|
|
35
|
+
} = e, [a, S] = u.useState(null), b = q(c), g = q(i), f = u.useRef(null), v = Re(t, (o) => S(o)), h = u.useRef({
|
|
36
36
|
paused: !1,
|
|
37
37
|
pause() {
|
|
38
38
|
this.paused = !0;
|
|
@@ -47,16 +47,16 @@ var U = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q =
|
|
|
47
47
|
if (h.paused || !a)
|
|
48
48
|
return;
|
|
49
49
|
const y = p.target;
|
|
50
|
-
a.contains(y) ? f.current = y :
|
|
50
|
+
a.contains(y) ? f.current = y : T(f.current, { select: !0 });
|
|
51
51
|
}, s = function(p) {
|
|
52
52
|
if (h.paused || !a)
|
|
53
53
|
return;
|
|
54
54
|
const y = p.relatedTarget;
|
|
55
|
-
y !== null && (a.contains(y) ||
|
|
55
|
+
y !== null && (a.contains(y) || T(f.current, { select: !0 }));
|
|
56
56
|
}, d = function(p) {
|
|
57
57
|
if (document.activeElement === document.body)
|
|
58
58
|
for (const E of p)
|
|
59
|
-
E.removedNodes.length > 0 &&
|
|
59
|
+
E.removedNodes.length > 0 && T(a);
|
|
60
60
|
};
|
|
61
61
|
document.addEventListener("focusin", o), document.addEventListener("focusout", s);
|
|
62
62
|
const m = new MutationObserver(d);
|
|
@@ -66,16 +66,16 @@ var U = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q =
|
|
|
66
66
|
}
|
|
67
67
|
}, [r, a, h.paused]), u.useEffect(() => {
|
|
68
68
|
if (a) {
|
|
69
|
-
|
|
69
|
+
ee.add(h);
|
|
70
70
|
const o = document.activeElement;
|
|
71
71
|
if (!a.contains(o)) {
|
|
72
|
-
const d = new CustomEvent(
|
|
73
|
-
a.addEventListener(
|
|
72
|
+
const d = new CustomEvent(j, $);
|
|
73
|
+
a.addEventListener(j, b), a.dispatchEvent(d), d.defaultPrevented || (Ne(Ie(se(a)), { select: !0 }), document.activeElement === o && T(a));
|
|
74
74
|
}
|
|
75
75
|
return () => {
|
|
76
|
-
a.removeEventListener(
|
|
77
|
-
const d = new CustomEvent(
|
|
78
|
-
a.addEventListener(
|
|
76
|
+
a.removeEventListener(j, b), setTimeout(() => {
|
|
77
|
+
const d = new CustomEvent(K, $);
|
|
78
|
+
a.addEventListener(K, g), a.dispatchEvent(d), d.defaultPrevented || T(o ?? document.body, { select: !0 }), a.removeEventListener(K, g), ee.remove(h);
|
|
79
79
|
}, 0);
|
|
80
80
|
};
|
|
81
81
|
}
|
|
@@ -86,26 +86,26 @@ var U = "focusScope.autoFocusOnMount", j = "focusScope.autoFocusOnUnmount", q =
|
|
|
86
86
|
return;
|
|
87
87
|
const s = o.key === "Tab" && !o.altKey && !o.ctrlKey && !o.metaKey, d = document.activeElement;
|
|
88
88
|
if (s && d) {
|
|
89
|
-
const m = o.currentTarget, [p, y] =
|
|
90
|
-
p && y ? !o.shiftKey && d === y ? (o.preventDefault(), n &&
|
|
89
|
+
const m = o.currentTarget, [p, y] = Me(m);
|
|
90
|
+
p && y ? !o.shiftKey && d === y ? (o.preventDefault(), n && T(p, { select: !0 })) : o.shiftKey && d === p && (o.preventDefault(), n && T(y, { select: !0 })) : d === m && o.preventDefault();
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
[n, r, h.paused]
|
|
94
94
|
);
|
|
95
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ le(ie.div, { tabIndex: -1, ...l, ref: v, onKeyDown: w });
|
|
96
96
|
});
|
|
97
|
-
|
|
98
|
-
function
|
|
97
|
+
Pe.displayName = ke;
|
|
98
|
+
function Ne(e, { select: t = !1 } = {}) {
|
|
99
99
|
const n = document.activeElement;
|
|
100
100
|
for (const r of e)
|
|
101
|
-
if (
|
|
101
|
+
if (T(r, { select: t }), document.activeElement !== n)
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const t =
|
|
104
|
+
function Me(e) {
|
|
105
|
+
const t = se(e), n = J(t, e), r = J(t.reverse(), e);
|
|
106
106
|
return [n, r];
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function se(e) {
|
|
109
109
|
const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
110
110
|
acceptNode: (r) => {
|
|
111
111
|
const c = r.tagName === "INPUT" && r.type === "hidden";
|
|
@@ -116,12 +116,12 @@ function ie(e) {
|
|
|
116
116
|
t.push(n.currentNode);
|
|
117
117
|
return t;
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function J(e, t) {
|
|
120
120
|
for (const n of e)
|
|
121
|
-
if (!
|
|
121
|
+
if (!Fe(n, { upTo: t }))
|
|
122
122
|
return n;
|
|
123
123
|
}
|
|
124
|
-
function
|
|
124
|
+
function Fe(e, { upTo: t }) {
|
|
125
125
|
if (getComputedStyle(e).visibility === "hidden")
|
|
126
126
|
return !0;
|
|
127
127
|
for (; e; ) {
|
|
@@ -133,54 +133,54 @@ function Pe(e, { upTo: t }) {
|
|
|
133
133
|
}
|
|
134
134
|
return !1;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function Le(e) {
|
|
137
137
|
return e instanceof HTMLInputElement && "select" in e;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function T(e, { select: t = !1 } = {}) {
|
|
140
140
|
if (e && e.focus) {
|
|
141
141
|
const n = document.activeElement;
|
|
142
|
-
e.focus({ preventScroll: !0 }), e !== n &&
|
|
142
|
+
e.focus({ preventScroll: !0 }), e !== n && Le(e) && t && e.select();
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
var
|
|
146
|
-
function
|
|
145
|
+
var ee = Oe();
|
|
146
|
+
function Oe() {
|
|
147
147
|
let e = [];
|
|
148
148
|
return {
|
|
149
149
|
add(t) {
|
|
150
150
|
const n = e[0];
|
|
151
|
-
t !== n && (n == null || n.pause()), e =
|
|
151
|
+
t !== n && (n == null || n.pause()), e = te(e, t), e.unshift(t);
|
|
152
152
|
},
|
|
153
153
|
remove(t) {
|
|
154
154
|
var n;
|
|
155
|
-
e =
|
|
155
|
+
e = te(e, t), (n = e[0]) == null || n.resume();
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function te(e, t) {
|
|
160
160
|
const n = [...e], r = n.indexOf(t);
|
|
161
161
|
return r !== -1 && n.splice(r, 1), n;
|
|
162
162
|
}
|
|
163
|
-
function
|
|
163
|
+
function Ie(e) {
|
|
164
164
|
return e.filter((t) => t.tagName !== "A");
|
|
165
165
|
}
|
|
166
|
-
var
|
|
166
|
+
var xe = function(e) {
|
|
167
167
|
if (typeof document > "u")
|
|
168
168
|
return null;
|
|
169
169
|
var t = Array.isArray(e) ? e[0] : e;
|
|
170
170
|
return t.ownerDocument.body;
|
|
171
|
-
}, k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {},
|
|
172
|
-
return e && (e.host ||
|
|
173
|
-
},
|
|
171
|
+
}, k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {}, H = 0, fe = function(e) {
|
|
172
|
+
return e && (e.host || fe(e.parentNode));
|
|
173
|
+
}, We = function(e, t) {
|
|
174
174
|
return t.map(function(n) {
|
|
175
175
|
if (e.contains(n))
|
|
176
176
|
return n;
|
|
177
|
-
var r =
|
|
177
|
+
var r = fe(n);
|
|
178
178
|
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
179
179
|
}).filter(function(n) {
|
|
180
180
|
return !!n;
|
|
181
181
|
});
|
|
182
|
-
},
|
|
183
|
-
var c =
|
|
182
|
+
}, Be = function(e, t, n, r) {
|
|
183
|
+
var c = We(t, Array.isArray(e) ? e : [e]);
|
|
184
184
|
O[n] || (O[n] = /* @__PURE__ */ new WeakMap());
|
|
185
185
|
var i = O[n], l = [], a = /* @__PURE__ */ new Set(), S = new Set(c), b = function(f) {
|
|
186
186
|
!f || a.has(f) || (a.add(f), b(f.parentNode));
|
|
@@ -199,16 +199,16 @@ var Le = function(e) {
|
|
|
199
199
|
}
|
|
200
200
|
});
|
|
201
201
|
};
|
|
202
|
-
return g(t), a.clear(),
|
|
202
|
+
return g(t), a.clear(), H++, function() {
|
|
203
203
|
l.forEach(function(f) {
|
|
204
204
|
var v = k.get(f) - 1, h = i.get(f) - 1;
|
|
205
205
|
k.set(f, v), i.set(f, h), v || (L.has(f) || f.removeAttribute(r), L.delete(f)), h || f.removeAttribute(n);
|
|
206
|
-
}),
|
|
206
|
+
}), H--, H || (k = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), O = {});
|
|
207
207
|
};
|
|
208
|
-
},
|
|
208
|
+
}, Tt = function(e, t, n) {
|
|
209
209
|
n === void 0 && (n = "data-aria-hidden");
|
|
210
|
-
var r = Array.from(Array.isArray(e) ? e : [e]), c = t ||
|
|
211
|
-
return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))),
|
|
210
|
+
var r = Array.from(Array.isArray(e) ? e : [e]), c = t || xe(e);
|
|
211
|
+
return c ? (r.push.apply(r, Array.from(c.querySelectorAll("[aria-live], script"))), Be(r, c, n, "aria-hidden")) : function() {
|
|
212
212
|
return null;
|
|
213
213
|
};
|
|
214
214
|
}, C = function() {
|
|
@@ -221,7 +221,7 @@ var Le = function(e) {
|
|
|
221
221
|
return t;
|
|
222
222
|
}, C.apply(this, arguments);
|
|
223
223
|
};
|
|
224
|
-
function
|
|
224
|
+
function de(e, t) {
|
|
225
225
|
var n = {};
|
|
226
226
|
for (var r in e)
|
|
227
227
|
Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
@@ -230,18 +230,18 @@ function se(e, t) {
|
|
|
230
230
|
t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
|
|
231
231
|
return n;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function De(e, t, n) {
|
|
234
234
|
if (n || arguments.length === 2)
|
|
235
235
|
for (var r = 0, c = t.length, i; r < c; r++)
|
|
236
236
|
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
237
237
|
return e.concat(i || Array.prototype.slice.call(t));
|
|
238
238
|
}
|
|
239
|
-
var W = "right-scroll-bar-position", B = "width-before-scroll-bar",
|
|
240
|
-
function
|
|
239
|
+
var W = "right-scroll-bar-position", B = "width-before-scroll-bar", _e = "with-scroll-bars-hidden", Ue = "--removed-body-scroll-bar-size";
|
|
240
|
+
function V(e, t) {
|
|
241
241
|
return typeof e == "function" ? e(t) : e && (e.current = t), e;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
244
|
-
var n =
|
|
243
|
+
function je(e, t) {
|
|
244
|
+
var n = Se(function() {
|
|
245
245
|
return {
|
|
246
246
|
// value
|
|
247
247
|
value: e,
|
|
@@ -261,31 +261,31 @@ function De(e, t) {
|
|
|
261
261
|
})[0];
|
|
262
262
|
return n.callback = t, n.facade;
|
|
263
263
|
}
|
|
264
|
-
var
|
|
265
|
-
function
|
|
266
|
-
var n =
|
|
264
|
+
var Ke = typeof window < "u" ? u.useLayoutEffect : u.useEffect, ne = /* @__PURE__ */ new WeakMap();
|
|
265
|
+
function He(e, t) {
|
|
266
|
+
var n = je(t || null, function(r) {
|
|
267
267
|
return e.forEach(function(c) {
|
|
268
|
-
return
|
|
268
|
+
return V(c, r);
|
|
269
269
|
});
|
|
270
270
|
});
|
|
271
|
-
return
|
|
272
|
-
var r =
|
|
271
|
+
return Ke(function() {
|
|
272
|
+
var r = ne.get(n);
|
|
273
273
|
if (r) {
|
|
274
274
|
var c = new Set(r), i = new Set(e), l = n.current;
|
|
275
275
|
c.forEach(function(a) {
|
|
276
|
-
i.has(a) ||
|
|
276
|
+
i.has(a) || V(a, null);
|
|
277
277
|
}), i.forEach(function(a) {
|
|
278
|
-
c.has(a) ||
|
|
278
|
+
c.has(a) || V(a, l);
|
|
279
279
|
});
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
ne.set(n, e);
|
|
282
282
|
}, [e]), n;
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Ve(e) {
|
|
285
285
|
return e;
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
t === void 0 && (t =
|
|
287
|
+
function Xe(e, t) {
|
|
288
|
+
t === void 0 && (t = Ve);
|
|
289
289
|
var n = [], r = !1, c = {
|
|
290
290
|
read: function() {
|
|
291
291
|
if (r)
|
|
@@ -339,13 +339,13 @@ function Ke(e, t) {
|
|
|
339
339
|
};
|
|
340
340
|
return c;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function Ye(e) {
|
|
343
343
|
e === void 0 && (e = {});
|
|
344
|
-
var t =
|
|
344
|
+
var t = Xe(null);
|
|
345
345
|
return t.options = C({ async: !0, ssr: !1 }, e), t;
|
|
346
346
|
}
|
|
347
|
-
var
|
|
348
|
-
var t = e.sideCar, n =
|
|
347
|
+
var ve = function(e) {
|
|
348
|
+
var t = e.sideCar, n = de(e, ["sideCar"]);
|
|
349
349
|
if (!t)
|
|
350
350
|
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
351
351
|
var r = t.read();
|
|
@@ -353,22 +353,22 @@ var fe = function(e) {
|
|
|
353
353
|
throw new Error("Sidecar medium not found");
|
|
354
354
|
return u.createElement(r, C({}, n));
|
|
355
355
|
};
|
|
356
|
-
|
|
357
|
-
function
|
|
358
|
-
return e.useMedium(t),
|
|
356
|
+
ve.isSideCarExport = !0;
|
|
357
|
+
function Ge(e, t) {
|
|
358
|
+
return e.useMedium(t), ve;
|
|
359
359
|
}
|
|
360
|
-
var
|
|
360
|
+
var he = Ye(), X = function() {
|
|
361
361
|
}, D = u.forwardRef(function(e, t) {
|
|
362
362
|
var n = u.useRef(null), r = u.useState({
|
|
363
|
-
onScrollCapture:
|
|
364
|
-
onWheelCapture:
|
|
365
|
-
onTouchMoveCapture:
|
|
366
|
-
}), c = r[0], i = r[1], l = e.forwardProps, a = e.children, S = e.className, b = e.removeScrollBar, g = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, o = e.inert, s = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y =
|
|
363
|
+
onScrollCapture: X,
|
|
364
|
+
onWheelCapture: X,
|
|
365
|
+
onTouchMoveCapture: X
|
|
366
|
+
}), c = r[0], i = r[1], l = e.forwardProps, a = e.children, S = e.className, b = e.removeScrollBar, g = e.enabled, f = e.shards, v = e.sideCar, h = e.noRelative, w = e.noIsolation, o = e.inert, s = e.allowPinchZoom, d = e.as, m = d === void 0 ? "div" : d, p = e.gapMode, y = de(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = v, R = He([n, t]), A = C(C({}, y), c);
|
|
367
367
|
return u.createElement(
|
|
368
368
|
u.Fragment,
|
|
369
369
|
null,
|
|
370
|
-
g && u.createElement(E, { sideCar:
|
|
371
|
-
l ? u.cloneElement(u.Children.only(a), C(C({},
|
|
370
|
+
g && u.createElement(E, { sideCar: he, removeScrollBar: b, shards: f, noRelative: h, noIsolation: w, inert: o, setCallbacks: i, allowPinchZoom: !!s, lockRef: n, gapMode: p }),
|
|
371
|
+
l ? u.cloneElement(u.Children.only(a), C(C({}, A), { ref: R })) : u.createElement(m, C({}, A, { className: S, ref: R }), a)
|
|
372
372
|
);
|
|
373
373
|
});
|
|
374
374
|
D.defaultProps = {
|
|
@@ -380,39 +380,39 @@ D.classNames = {
|
|
|
380
380
|
fullWidth: B,
|
|
381
381
|
zeroRight: W
|
|
382
382
|
};
|
|
383
|
-
var
|
|
384
|
-
if (
|
|
385
|
-
return
|
|
383
|
+
var re, ze = function() {
|
|
384
|
+
if (re)
|
|
385
|
+
return re;
|
|
386
386
|
if (typeof __webpack_nonce__ < "u")
|
|
387
387
|
return __webpack_nonce__;
|
|
388
388
|
};
|
|
389
|
-
function
|
|
389
|
+
function Ze() {
|
|
390
390
|
if (!document)
|
|
391
391
|
return null;
|
|
392
392
|
var e = document.createElement("style");
|
|
393
393
|
e.type = "text/css";
|
|
394
|
-
var t =
|
|
394
|
+
var t = ze();
|
|
395
395
|
return t && e.setAttribute("nonce", t), e;
|
|
396
396
|
}
|
|
397
|
-
function
|
|
397
|
+
function qe(e, t) {
|
|
398
398
|
e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function Qe(e) {
|
|
401
401
|
var t = document.head || document.getElementsByTagName("head")[0];
|
|
402
402
|
t.appendChild(e);
|
|
403
403
|
}
|
|
404
|
-
var
|
|
404
|
+
var $e = function() {
|
|
405
405
|
var e = 0, t = null;
|
|
406
406
|
return {
|
|
407
407
|
add: function(n) {
|
|
408
|
-
e == 0 && (t =
|
|
408
|
+
e == 0 && (t = Ze()) && (qe(t, n), Qe(t)), e++;
|
|
409
409
|
},
|
|
410
410
|
remove: function() {
|
|
411
411
|
e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
|
|
412
412
|
}
|
|
413
413
|
};
|
|
414
|
-
},
|
|
415
|
-
var e =
|
|
414
|
+
}, Je = function() {
|
|
415
|
+
var e = $e();
|
|
416
416
|
return function(t, n) {
|
|
417
417
|
u.useEffect(function() {
|
|
418
418
|
return e.add(t), function() {
|
|
@@ -420,40 +420,40 @@ var Ze = function() {
|
|
|
420
420
|
};
|
|
421
421
|
}, [t && n]);
|
|
422
422
|
};
|
|
423
|
-
},
|
|
424
|
-
var e =
|
|
423
|
+
}, me = function() {
|
|
424
|
+
var e = Je(), t = function(n) {
|
|
425
425
|
var r = n.styles, c = n.dynamic;
|
|
426
426
|
return e(r, c), null;
|
|
427
427
|
};
|
|
428
428
|
return t;
|
|
429
|
-
},
|
|
429
|
+
}, et = {
|
|
430
430
|
left: 0,
|
|
431
431
|
top: 0,
|
|
432
432
|
right: 0,
|
|
433
433
|
gap: 0
|
|
434
|
-
},
|
|
434
|
+
}, Y = function(e) {
|
|
435
435
|
return parseInt(e || "", 10) || 0;
|
|
436
|
-
},
|
|
436
|
+
}, tt = function(e) {
|
|
437
437
|
var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], c = t[e === "padding" ? "paddingRight" : "marginRight"];
|
|
438
|
-
return [
|
|
439
|
-
},
|
|
438
|
+
return [Y(n), Y(r), Y(c)];
|
|
439
|
+
}, nt = function(e) {
|
|
440
440
|
if (e === void 0 && (e = "margin"), typeof window > "u")
|
|
441
|
-
return
|
|
442
|
-
var t =
|
|
441
|
+
return et;
|
|
442
|
+
var t = tt(e), n = document.documentElement.clientWidth, r = window.innerWidth;
|
|
443
443
|
return {
|
|
444
444
|
left: t[0],
|
|
445
445
|
top: t[1],
|
|
446
446
|
right: t[2],
|
|
447
447
|
gap: Math.max(0, r - n + t[2] - t[0])
|
|
448
448
|
};
|
|
449
|
-
},
|
|
449
|
+
}, rt = me(), M = "data-scroll-locked", at = function(e, t, n, r) {
|
|
450
450
|
var c = e.left, i = e.top, l = e.right, a = e.gap;
|
|
451
451
|
return n === void 0 && (n = "margin"), `
|
|
452
|
-
.`.concat(
|
|
452
|
+
.`.concat(_e, ` {
|
|
453
453
|
overflow: hidden `).concat(r, `;
|
|
454
454
|
padding-right: `).concat(a, "px ").concat(r, `;
|
|
455
455
|
}
|
|
456
|
-
body[`).concat(
|
|
456
|
+
body[`).concat(M, `] {
|
|
457
457
|
overflow: hidden `).concat(r, `;
|
|
458
458
|
overscroll-behavior: contain;
|
|
459
459
|
`).concat([
|
|
@@ -486,94 +486,94 @@ var Ze = function() {
|
|
|
486
486
|
margin-right: 0 `).concat(r, `;
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
body[`).concat(
|
|
490
|
-
`).concat(
|
|
489
|
+
body[`).concat(M, `] {
|
|
490
|
+
`).concat(Ue, ": ").concat(a, `px;
|
|
491
491
|
}
|
|
492
492
|
`);
|
|
493
|
-
},
|
|
494
|
-
var e = parseInt(document.body.getAttribute(
|
|
493
|
+
}, ae = function() {
|
|
494
|
+
var e = parseInt(document.body.getAttribute(M) || "0", 10);
|
|
495
495
|
return isFinite(e) ? e : 0;
|
|
496
|
-
},
|
|
496
|
+
}, ot = function() {
|
|
497
497
|
u.useEffect(function() {
|
|
498
|
-
return document.body.setAttribute(
|
|
499
|
-
var e =
|
|
500
|
-
e <= 0 ? document.body.removeAttribute(
|
|
498
|
+
return document.body.setAttribute(M, (ae() + 1).toString()), function() {
|
|
499
|
+
var e = ae() - 1;
|
|
500
|
+
e <= 0 ? document.body.removeAttribute(M) : document.body.setAttribute(M, e.toString());
|
|
501
501
|
};
|
|
502
502
|
}, []);
|
|
503
|
-
},
|
|
503
|
+
}, ct = function(e) {
|
|
504
504
|
var t = e.noRelative, n = e.noImportant, r = e.gapMode, c = r === void 0 ? "margin" : r;
|
|
505
|
-
|
|
505
|
+
ot();
|
|
506
506
|
var i = u.useMemo(function() {
|
|
507
|
-
return
|
|
507
|
+
return nt(c);
|
|
508
508
|
}, [c]);
|
|
509
|
-
return u.createElement(
|
|
510
|
-
},
|
|
509
|
+
return u.createElement(rt, { styles: at(i, !t, c, n ? "" : "!important") });
|
|
510
|
+
}, G = !1;
|
|
511
511
|
if (typeof window < "u")
|
|
512
512
|
try {
|
|
513
513
|
var I = Object.defineProperty({}, "passive", {
|
|
514
514
|
get: function() {
|
|
515
|
-
return
|
|
515
|
+
return G = !0, !0;
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
window.addEventListener("test", I, I), window.removeEventListener("test", I, I);
|
|
519
519
|
} catch {
|
|
520
|
-
|
|
520
|
+
G = !1;
|
|
521
521
|
}
|
|
522
|
-
var P =
|
|
522
|
+
var P = G ? { passive: !1 } : !1, ut = function(e) {
|
|
523
523
|
return e.tagName === "TEXTAREA";
|
|
524
|
-
},
|
|
524
|
+
}, pe = function(e, t) {
|
|
525
525
|
if (!(e instanceof Element))
|
|
526
526
|
return !1;
|
|
527
527
|
var n = window.getComputedStyle(e);
|
|
528
528
|
return (
|
|
529
529
|
// not-not-scrollable
|
|
530
530
|
n[t] !== "hidden" && // contains scroll inside self
|
|
531
|
-
!(n.overflowY === n.overflowX && !
|
|
531
|
+
!(n.overflowY === n.overflowX && !ut(e) && n[t] === "visible")
|
|
532
532
|
);
|
|
533
|
-
},
|
|
534
|
-
return
|
|
535
|
-
},
|
|
536
|
-
return
|
|
537
|
-
},
|
|
533
|
+
}, it = function(e) {
|
|
534
|
+
return pe(e, "overflowY");
|
|
535
|
+
}, lt = function(e) {
|
|
536
|
+
return pe(e, "overflowX");
|
|
537
|
+
}, oe = function(e, t) {
|
|
538
538
|
var n = t.ownerDocument, r = t;
|
|
539
539
|
do {
|
|
540
540
|
typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
|
|
541
|
-
var c =
|
|
541
|
+
var c = ge(e, r);
|
|
542
542
|
if (c) {
|
|
543
|
-
var i =
|
|
543
|
+
var i = ye(e, r), l = i[1], a = i[2];
|
|
544
544
|
if (l > a)
|
|
545
545
|
return !0;
|
|
546
546
|
}
|
|
547
547
|
r = r.parentNode;
|
|
548
548
|
} while (r && r !== n.body);
|
|
549
549
|
return !1;
|
|
550
|
-
},
|
|
550
|
+
}, st = function(e) {
|
|
551
551
|
var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
|
|
552
552
|
return [
|
|
553
553
|
t,
|
|
554
554
|
n,
|
|
555
555
|
r
|
|
556
556
|
];
|
|
557
|
-
},
|
|
557
|
+
}, ft = function(e) {
|
|
558
558
|
var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
|
|
559
559
|
return [
|
|
560
560
|
t,
|
|
561
561
|
n,
|
|
562
562
|
r
|
|
563
563
|
];
|
|
564
|
-
},
|
|
565
|
-
return e === "v" ?
|
|
566
|
-
},
|
|
567
|
-
return e === "v" ?
|
|
568
|
-
},
|
|
564
|
+
}, ge = function(e, t) {
|
|
565
|
+
return e === "v" ? it(t) : lt(t);
|
|
566
|
+
}, ye = function(e, t) {
|
|
567
|
+
return e === "v" ? st(t) : ft(t);
|
|
568
|
+
}, dt = function(e, t) {
|
|
569
569
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
570
|
-
},
|
|
571
|
-
var i =
|
|
570
|
+
}, vt = function(e, t, n, r, c) {
|
|
571
|
+
var i = dt(e, window.getComputedStyle(t).direction), l = i * r, a = n.target, S = t.contains(a), b = !1, g = l > 0, f = 0, v = 0;
|
|
572
572
|
do {
|
|
573
573
|
if (!a)
|
|
574
574
|
break;
|
|
575
|
-
var h =
|
|
576
|
-
(w || d) &&
|
|
575
|
+
var h = ye(e, a), w = h[0], o = h[1], s = h[2], d = o - s - i * w;
|
|
576
|
+
(w || d) && ge(e, a) && (f += d, v += w);
|
|
577
577
|
var m = a.parentNode;
|
|
578
578
|
a = m && m.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? m.host : m;
|
|
579
579
|
} while (
|
|
@@ -584,26 +584,26 @@ var P = Y ? { passive: !1 } : !1, at = function(e) {
|
|
|
584
584
|
return (g && (c && Math.abs(f) < 1 || !c && l > f) || !g && (c && Math.abs(v) < 1 || !c && -l > v)) && (b = !0), b;
|
|
585
585
|
}, x = function(e) {
|
|
586
586
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
587
|
-
},
|
|
587
|
+
}, ce = function(e) {
|
|
588
588
|
return [e.deltaX, e.deltaY];
|
|
589
|
-
},
|
|
589
|
+
}, ue = function(e) {
|
|
590
590
|
return e && "current" in e ? e.current : e;
|
|
591
|
-
},
|
|
591
|
+
}, ht = function(e, t) {
|
|
592
592
|
return e[0] === t[0] && e[1] === t[1];
|
|
593
|
-
},
|
|
593
|
+
}, mt = function(e) {
|
|
594
594
|
return `
|
|
595
595
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
596
596
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
597
597
|
`);
|
|
598
|
-
},
|
|
599
|
-
function
|
|
600
|
-
var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(
|
|
598
|
+
}, pt = 0, N = [];
|
|
599
|
+
function gt(e) {
|
|
600
|
+
var t = u.useRef([]), n = u.useRef([0, 0]), r = u.useRef(), c = u.useState(pt++)[0], i = u.useState(me)[0], l = u.useRef(e);
|
|
601
601
|
u.useEffect(function() {
|
|
602
602
|
l.current = e;
|
|
603
603
|
}, [e]), u.useEffect(function() {
|
|
604
604
|
if (e.inert) {
|
|
605
605
|
document.body.classList.add("block-interactivity-".concat(c));
|
|
606
|
-
var o =
|
|
606
|
+
var o = De([e.lockRef.current], (e.shards || []).map(ue), !0).filter(Boolean);
|
|
607
607
|
return o.forEach(function(s) {
|
|
608
608
|
return s.classList.add("allow-interactivity-".concat(c));
|
|
609
609
|
}), function() {
|
|
@@ -616,37 +616,40 @@ function ht(e) {
|
|
|
616
616
|
var a = u.useCallback(function(o, s) {
|
|
617
617
|
if ("touches" in o && o.touches.length === 2 || o.type === "wheel" && o.ctrlKey)
|
|
618
618
|
return !l.current.allowPinchZoom;
|
|
619
|
-
var d = x(o), m = n.current, p = "deltaX" in o ? o.deltaX : m[0] - d[0], y = "deltaY" in o ? o.deltaY : m[1] - d[1], E,
|
|
620
|
-
if ("touches" in o &&
|
|
619
|
+
var d = x(o), m = n.current, p = "deltaX" in o ? o.deltaX : m[0] - d[0], y = "deltaY" in o ? o.deltaY : m[1] - d[1], E, R = o.target, A = Math.abs(p) > Math.abs(y) ? "h" : "v";
|
|
620
|
+
if ("touches" in o && A === "h" && R.type === "range")
|
|
621
|
+
return !1;
|
|
622
|
+
var z = window.getSelection(), _ = z && z.anchorNode, Ee = _ ? _ === R || _.contains(R) : !1;
|
|
623
|
+
if (Ee)
|
|
621
624
|
return !1;
|
|
622
|
-
var F =
|
|
625
|
+
var F = oe(A, R);
|
|
623
626
|
if (!F)
|
|
624
627
|
return !0;
|
|
625
|
-
if (F ? E =
|
|
628
|
+
if (F ? E = A : (E = A === "v" ? "h" : "v", F = oe(A, R)), !F)
|
|
626
629
|
return !1;
|
|
627
630
|
if (!r.current && "changedTouches" in o && (p || y) && (r.current = E), !E)
|
|
628
631
|
return !0;
|
|
629
|
-
var
|
|
630
|
-
return
|
|
632
|
+
var Z = r.current || E;
|
|
633
|
+
return vt(Z, s, o, Z === "h" ? p : y, !0);
|
|
631
634
|
}, []), S = u.useCallback(function(o) {
|
|
632
635
|
var s = o;
|
|
633
|
-
if (!(!
|
|
634
|
-
var d = "deltaY" in s ?
|
|
635
|
-
return E.name === s.type && (E.target === s.target || s.target === E.shadowParent) &&
|
|
636
|
+
if (!(!N.length || N[N.length - 1] !== i)) {
|
|
637
|
+
var d = "deltaY" in s ? ce(s) : x(s), m = t.current.filter(function(E) {
|
|
638
|
+
return E.name === s.type && (E.target === s.target || s.target === E.shadowParent) && ht(E.delta, d);
|
|
636
639
|
})[0];
|
|
637
640
|
if (m && m.should) {
|
|
638
641
|
s.cancelable && s.preventDefault();
|
|
639
642
|
return;
|
|
640
643
|
}
|
|
641
644
|
if (!m) {
|
|
642
|
-
var p = (l.current.shards || []).map(
|
|
645
|
+
var p = (l.current.shards || []).map(ue).filter(Boolean).filter(function(E) {
|
|
643
646
|
return E.contains(s.target);
|
|
644
647
|
}), y = p.length > 0 ? a(s, p[0]) : !l.current.noIsolation;
|
|
645
648
|
y && s.cancelable && s.preventDefault();
|
|
646
649
|
}
|
|
647
650
|
}
|
|
648
651
|
}, []), b = u.useCallback(function(o, s, d, m) {
|
|
649
|
-
var p = { name: o, delta: s, target: d, should: m, shadowParent:
|
|
652
|
+
var p = { name: o, delta: s, target: d, should: m, shadowParent: yt(d) };
|
|
650
653
|
t.current.push(p), setTimeout(function() {
|
|
651
654
|
t.current = t.current.filter(function(y) {
|
|
652
655
|
return y !== p;
|
|
@@ -655,17 +658,17 @@ function ht(e) {
|
|
|
655
658
|
}, []), g = u.useCallback(function(o) {
|
|
656
659
|
n.current = x(o), r.current = void 0;
|
|
657
660
|
}, []), f = u.useCallback(function(o) {
|
|
658
|
-
b(o.type,
|
|
661
|
+
b(o.type, ce(o), o.target, a(o, e.lockRef.current));
|
|
659
662
|
}, []), v = u.useCallback(function(o) {
|
|
660
663
|
b(o.type, x(o), o.target, a(o, e.lockRef.current));
|
|
661
664
|
}, []);
|
|
662
665
|
u.useEffect(function() {
|
|
663
|
-
return
|
|
666
|
+
return N.push(i), e.setCallbacks({
|
|
664
667
|
onScrollCapture: f,
|
|
665
668
|
onWheelCapture: f,
|
|
666
669
|
onTouchMoveCapture: v
|
|
667
670
|
}), document.addEventListener("wheel", S, P), document.addEventListener("touchmove", S, P), document.addEventListener("touchstart", g, P), function() {
|
|
668
|
-
|
|
671
|
+
N = N.filter(function(o) {
|
|
669
672
|
return o !== i;
|
|
670
673
|
}), document.removeEventListener("wheel", S, P), document.removeEventListener("touchmove", S, P), document.removeEventListener("touchstart", g, P);
|
|
671
674
|
};
|
|
@@ -674,25 +677,25 @@ function ht(e) {
|
|
|
674
677
|
return u.createElement(
|
|
675
678
|
u.Fragment,
|
|
676
679
|
null,
|
|
677
|
-
w ? u.createElement(i, { styles:
|
|
678
|
-
h ? u.createElement(
|
|
680
|
+
w ? u.createElement(i, { styles: mt(c) }) : null,
|
|
681
|
+
h ? u.createElement(ct, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
679
682
|
);
|
|
680
683
|
}
|
|
681
|
-
function
|
|
684
|
+
function yt(e) {
|
|
682
685
|
for (var t = null; e !== null; )
|
|
683
686
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
684
687
|
return t;
|
|
685
688
|
}
|
|
686
|
-
const
|
|
687
|
-
var
|
|
688
|
-
return u.createElement(D, C({}, e, { ref: t, sideCar:
|
|
689
|
+
const bt = Ge(he, gt);
|
|
690
|
+
var be = u.forwardRef(function(e, t) {
|
|
691
|
+
return u.createElement(D, C({}, e, { ref: t, sideCar: bt }));
|
|
689
692
|
});
|
|
690
|
-
|
|
691
|
-
const
|
|
693
|
+
be.classNames = D.classNames;
|
|
694
|
+
const kt = be;
|
|
692
695
|
export {
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
696
|
+
Pe as F,
|
|
697
|
+
Te as P,
|
|
698
|
+
kt as R,
|
|
699
|
+
Tt as h,
|
|
700
|
+
At as u
|
|
698
701
|
};
|