@luciodale/swipe-bar 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SwipeBarProvider.d.ts +2 -1
- package/dist/SwipeBarProvider.d.ts.map +1 -1
- package/dist/swipe-bar.es.js +787 -766
- package/dist/swipe-bar.umd.js +4 -4
- package/dist/swipeSidebarShared.d.ts +2 -0
- package/dist/swipeSidebarShared.d.ts.map +1 -1
- package/dist/test-utils.d.ts.map +1 -1
- package/dist/useSwipeBarContext.d.ts +35 -14
- package/dist/useSwipeBarContext.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/swipe-bar.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var Re = { exports: {} },
|
|
1
|
+
import xt, { createContext as Rt, useState as Q, useRef as L, useMemo as Je, useCallback as B, useEffect as z, useContext as Tt } from "react";
|
|
2
|
+
var Re = { exports: {} }, me = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var Re = { exports: {} }, he = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
12
|
+
var $e;
|
|
13
|
+
function Ot() {
|
|
14
|
+
if ($e) return me;
|
|
15
|
+
$e = 1;
|
|
16
16
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
17
|
-
function r(i,
|
|
17
|
+
function r(i, s, o) {
|
|
18
18
|
var f = null;
|
|
19
|
-
if (o !== void 0 && (f = "" + o),
|
|
19
|
+
if (o !== void 0 && (f = "" + o), s.key !== void 0 && (f = "" + s.key), "key" in s) {
|
|
20
20
|
o = {};
|
|
21
|
-
for (var c in
|
|
22
|
-
c !== "key" && (o[c] =
|
|
23
|
-
} else o =
|
|
24
|
-
return
|
|
21
|
+
for (var c in s)
|
|
22
|
+
c !== "key" && (o[c] = s[c]);
|
|
23
|
+
} else o = s;
|
|
24
|
+
return s = o.ref, {
|
|
25
25
|
$$typeof: e,
|
|
26
26
|
type: i,
|
|
27
27
|
key: f,
|
|
28
|
-
ref:
|
|
28
|
+
ref: s !== void 0 ? s : null,
|
|
29
29
|
props: o
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return me.Fragment = t, me.jsx = r, me.jsxs = r, me;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var ve = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,44 +41,44 @@ var me = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
44
|
+
var We;
|
|
45
|
+
function Et() {
|
|
46
|
+
return We || (We = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
47
|
function e(n) {
|
|
48
48
|
if (n == null) return null;
|
|
49
49
|
if (typeof n == "function")
|
|
50
|
-
return n.$$typeof ===
|
|
50
|
+
return n.$$typeof === V ? null : n.displayName || n.name || null;
|
|
51
51
|
if (typeof n == "string") return n;
|
|
52
52
|
switch (n) {
|
|
53
|
-
case A:
|
|
54
|
-
return "Fragment";
|
|
55
53
|
case M:
|
|
56
|
-
return "
|
|
54
|
+
return "Fragment";
|
|
57
55
|
case C:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case _:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case k:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case v:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case P:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof n == "object")
|
|
67
67
|
switch (typeof n.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), n.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case p:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case j:
|
|
73
73
|
return n.displayName || "Context";
|
|
74
|
-
case
|
|
74
|
+
case Y:
|
|
75
75
|
return (n._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
76
|
+
case $:
|
|
77
77
|
var h = n.render;
|
|
78
78
|
return n = n.displayName, n || (n = h.displayName || h.name || "", n = n !== "" ? "ForwardRef(" + n + ")" : "ForwardRef"), n;
|
|
79
|
-
case
|
|
79
|
+
case y:
|
|
80
80
|
return h = n.displayName || null, h !== null ? h : e(n.type) || "Memo";
|
|
81
|
-
case
|
|
81
|
+
case O:
|
|
82
82
|
h = n._payload, n = n._init;
|
|
83
83
|
try {
|
|
84
84
|
return e(n(h));
|
|
@@ -99,17 +99,17 @@ function Tt() {
|
|
|
99
99
|
}
|
|
100
100
|
if (h) {
|
|
101
101
|
h = console;
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var R = h.error, x = typeof Symbol == "function" && Symbol.toStringTag && n[Symbol.toStringTag] || n.constructor.name || "Object";
|
|
103
|
+
return R.call(
|
|
104
104
|
h,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
106
|
+
x
|
|
107
107
|
), t(n);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function i(n) {
|
|
111
|
-
if (n ===
|
|
112
|
-
if (typeof n == "object" && n !== null && n.$$typeof ===
|
|
111
|
+
if (n === M) return "<>";
|
|
112
|
+
if (typeof n == "object" && n !== null && n.$$typeof === O)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
115
|
var h = e(n);
|
|
@@ -118,47 +118,47 @@ function Tt() {
|
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var n =
|
|
121
|
+
function s() {
|
|
122
|
+
var n = D.A;
|
|
123
123
|
return n === null ? null : n.getOwner();
|
|
124
124
|
}
|
|
125
125
|
function o() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
128
|
function f(n) {
|
|
129
|
-
if (
|
|
129
|
+
if (q.call(n, "key")) {
|
|
130
130
|
var h = Object.getOwnPropertyDescriptor(n, "key").get;
|
|
131
131
|
if (h && h.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return n.key !== void 0;
|
|
134
134
|
}
|
|
135
135
|
function c(n, h) {
|
|
136
|
-
function
|
|
137
|
-
|
|
136
|
+
function R() {
|
|
137
|
+
F || (F = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
139
|
h
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
R.isReactWarning = !0, Object.defineProperty(n, "key", {
|
|
143
|
+
get: R,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
function d() {
|
|
148
148
|
var n = e(this.type);
|
|
149
|
-
return
|
|
149
|
+
return U[n] || (U[n] = !0, console.error(
|
|
150
150
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
151
|
)), n = this.props.ref, n !== void 0 ? n : null;
|
|
152
152
|
}
|
|
153
|
-
function u(n, h,
|
|
154
|
-
var
|
|
153
|
+
function u(n, h, R, x, Z, N) {
|
|
154
|
+
var X = R.ref;
|
|
155
155
|
return n = {
|
|
156
156
|
$$typeof: I,
|
|
157
157
|
type: n,
|
|
158
158
|
key: h,
|
|
159
|
-
props:
|
|
160
|
-
_owner:
|
|
161
|
-
}, (
|
|
159
|
+
props: R,
|
|
160
|
+
_owner: x
|
|
161
|
+
}, (X !== void 0 ? X : null) !== null ? Object.defineProperty(n, "ref", {
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
get: d
|
|
164
164
|
}) : Object.defineProperty(n, "ref", { enumerable: !1, value: null }), n._store = {}, Object.defineProperty(n._store, "validated", {
|
|
@@ -175,117 +175,117 @@ function Tt() {
|
|
|
175
175
|
configurable: !1,
|
|
176
176
|
enumerable: !1,
|
|
177
177
|
writable: !0,
|
|
178
|
-
value:
|
|
178
|
+
value: Z
|
|
179
179
|
}), Object.defineProperty(n, "_debugTask", {
|
|
180
180
|
configurable: !1,
|
|
181
181
|
enumerable: !1,
|
|
182
182
|
writable: !0,
|
|
183
|
-
value:
|
|
183
|
+
value: N
|
|
184
184
|
}), Object.freeze && (Object.freeze(n.props), Object.freeze(n)), n;
|
|
185
185
|
}
|
|
186
|
-
function T(n, h,
|
|
187
|
-
var
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
if (G(
|
|
191
|
-
for (
|
|
192
|
-
w(
|
|
193
|
-
Object.freeze && Object.freeze(
|
|
186
|
+
function T(n, h, R, x, Z, N) {
|
|
187
|
+
var X = h.children;
|
|
188
|
+
if (X !== void 0)
|
|
189
|
+
if (x)
|
|
190
|
+
if (G(X)) {
|
|
191
|
+
for (x = 0; x < X.length; x++)
|
|
192
|
+
w(X[x]);
|
|
193
|
+
Object.freeze && Object.freeze(X);
|
|
194
194
|
} else
|
|
195
195
|
console.error(
|
|
196
196
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
197
|
);
|
|
198
|
-
else w(
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
var
|
|
202
|
-
return
|
|
198
|
+
else w(X);
|
|
199
|
+
if (q.call(h, "key")) {
|
|
200
|
+
X = e(n);
|
|
201
|
+
var J = Object.keys(h).filter(function(pe) {
|
|
202
|
+
return pe !== "key";
|
|
203
203
|
});
|
|
204
|
-
|
|
204
|
+
x = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", ae[X + x] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
205
|
`A props object containing a "key" prop is being spread into JSX:
|
|
206
206
|
let props = %s;
|
|
207
207
|
<%s {...props} />
|
|
208
208
|
React keys must be passed directly to JSX without using spread:
|
|
209
209
|
let props = %s;
|
|
210
210
|
<%s key={someKey} {...props} />`,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
), ae[
|
|
211
|
+
x,
|
|
212
|
+
X,
|
|
213
|
+
J,
|
|
214
|
+
X
|
|
215
|
+
), ae[X + x] = !0);
|
|
216
216
|
}
|
|
217
|
-
if (
|
|
218
|
-
|
|
217
|
+
if (X = null, R !== void 0 && (r(R), X = "" + R), f(h) && (r(h.key), X = "" + h.key), "key" in h) {
|
|
218
|
+
R = {};
|
|
219
219
|
for (var ge in h)
|
|
220
|
-
ge !== "key" && (
|
|
221
|
-
} else
|
|
222
|
-
return
|
|
223
|
-
|
|
220
|
+
ge !== "key" && (R[ge] = h[ge]);
|
|
221
|
+
} else R = h;
|
|
222
|
+
return X && c(
|
|
223
|
+
R,
|
|
224
224
|
typeof n == "function" ? n.displayName || n.name || "Unknown" : n
|
|
225
225
|
), u(
|
|
226
226
|
n,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
227
|
+
X,
|
|
228
|
+
R,
|
|
229
|
+
s(),
|
|
230
|
+
Z,
|
|
231
|
+
N
|
|
232
232
|
);
|
|
233
233
|
}
|
|
234
234
|
function w(n) {
|
|
235
|
-
|
|
235
|
+
b(n) ? n._store && (n._store.validated = 1) : typeof n == "object" && n !== null && n.$$typeof === O && (n._payload.status === "fulfilled" ? b(n._payload.value) && n._payload.value._store && (n._payload.value._store.validated = 1) : n._store && (n._store.validated = 1));
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function b(n) {
|
|
238
238
|
return typeof n == "object" && n !== null && n.$$typeof === I;
|
|
239
239
|
}
|
|
240
|
-
var
|
|
240
|
+
var S = xt, I = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), M = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), Y = Symbol.for("react.consumer"), j = Symbol.for("react.context"), $ = Symbol.for("react.forward_ref"), k = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), y = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), V = Symbol.for("react.client.reference"), D = S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, q = Object.prototype.hasOwnProperty, G = Array.isArray, H = console.createTask ? console.createTask : function() {
|
|
241
241
|
return null;
|
|
242
242
|
};
|
|
243
|
-
|
|
243
|
+
S = {
|
|
244
244
|
react_stack_bottom_frame: function(n) {
|
|
245
245
|
return n();
|
|
246
246
|
}
|
|
247
247
|
};
|
|
248
|
-
var
|
|
249
|
-
|
|
248
|
+
var F, U = {}, oe = S.react_stack_bottom_frame.bind(
|
|
249
|
+
S,
|
|
250
250
|
o
|
|
251
|
-
)(),
|
|
252
|
-
|
|
253
|
-
var
|
|
251
|
+
)(), ne = H(i(o)), ae = {};
|
|
252
|
+
ve.Fragment = M, ve.jsx = function(n, h, R) {
|
|
253
|
+
var x = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
254
254
|
return T(
|
|
255
255
|
n,
|
|
256
256
|
h,
|
|
257
|
-
|
|
257
|
+
R,
|
|
258
258
|
!1,
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
x ? Error("react-stack-top-frame") : oe,
|
|
260
|
+
x ? H(i(n)) : ne
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
262
|
+
}, ve.jsxs = function(n, h, R) {
|
|
263
|
+
var x = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
264
264
|
return T(
|
|
265
265
|
n,
|
|
266
266
|
h,
|
|
267
|
-
|
|
267
|
+
R,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
x ? Error("react-stack-top-frame") : oe,
|
|
270
|
+
x ? H(i(n)) : ne
|
|
271
271
|
);
|
|
272
272
|
};
|
|
273
|
-
}()),
|
|
273
|
+
}()), ve;
|
|
274
274
|
}
|
|
275
|
-
process.env.NODE_ENV === "production" ? Re.exports =
|
|
276
|
-
var
|
|
277
|
-
const
|
|
275
|
+
process.env.NODE_ENV === "production" ? Re.exports = Ot() : Re.exports = Et();
|
|
276
|
+
var E = Re.exports;
|
|
277
|
+
const Ke = Rt(null), ye = (e) => {
|
|
278
278
|
throw new Error(`Unhandled sidebar side: ${e}`);
|
|
279
|
-
},
|
|
279
|
+
}, we = {
|
|
280
280
|
isOpen: !1,
|
|
281
281
|
anchorState: "closed",
|
|
282
282
|
meta: null
|
|
283
|
-
},
|
|
283
|
+
}, hr = ({
|
|
284
284
|
children: e,
|
|
285
285
|
sidebarWidthPx: t,
|
|
286
286
|
transitionMs: r,
|
|
287
287
|
edgeActivationWidthPx: i,
|
|
288
|
-
dragActivationDeltaPx:
|
|
288
|
+
dragActivationDeltaPx: s,
|
|
289
289
|
showOverlay: o,
|
|
290
290
|
isAbsolute: f,
|
|
291
291
|
overlayBackgroundColor: c,
|
|
@@ -293,391 +293,409 @@ const Je = yt(null), ye = (e) => {
|
|
|
293
293
|
toggleIconSizePx: u,
|
|
294
294
|
toggleIconEdgeDistancePx: T,
|
|
295
295
|
showToggle: w,
|
|
296
|
-
mediaQueryWidth:
|
|
297
|
-
swipeBarZIndex:
|
|
296
|
+
mediaQueryWidth: b,
|
|
297
|
+
swipeBarZIndex: S,
|
|
298
298
|
toggleZIndex: I,
|
|
299
|
-
overlayZIndex:
|
|
300
|
-
fadeContent:
|
|
301
|
-
fadeContentTransitionMs:
|
|
302
|
-
closeSidebarOnOverlayClick:
|
|
299
|
+
overlayZIndex: p,
|
|
300
|
+
fadeContent: M,
|
|
301
|
+
fadeContentTransitionMs: _,
|
|
302
|
+
closeSidebarOnOverlayClick: C,
|
|
303
|
+
resetMetaOnClose: Y
|
|
303
304
|
}) => {
|
|
304
|
-
var
|
|
305
|
-
const [
|
|
306
|
-
() => Object.values(
|
|
307
|
-
[
|
|
308
|
-
), ce =
|
|
309
|
-
sidebarWidthPx: t ??
|
|
310
|
-
sidebarHeightPx:
|
|
311
|
-
transitionMs: r ??
|
|
312
|
-
edgeActivationWidthPx: i ??
|
|
313
|
-
dragActivationDeltaPx:
|
|
314
|
-
showOverlay: o ??
|
|
315
|
-
isAbsolute: f ??
|
|
316
|
-
overlayBackgroundColor: c ??
|
|
317
|
-
toggleIconColor: d ??
|
|
318
|
-
toggleIconSizePx: u ??
|
|
319
|
-
toggleIconEdgeDistancePx: T ??
|
|
320
|
-
showToggle: w ??
|
|
321
|
-
mediaQueryWidth:
|
|
322
|
-
swipeBarZIndex:
|
|
323
|
-
toggleZIndex: I ??
|
|
324
|
-
overlayZIndex:
|
|
325
|
-
fadeContent:
|
|
326
|
-
fadeContentTransitionMs:
|
|
327
|
-
swipeToOpen:
|
|
328
|
-
swipeToClose:
|
|
329
|
-
midAnchorPoint:
|
|
330
|
-
midAnchorPointPx:
|
|
305
|
+
var De, Xe;
|
|
306
|
+
const [j, $] = Q(null), [k, v] = Q(!1), [y, O] = Q(!1), [P, V] = Q({}), [D, q] = Q({}), G = L(null), H = L(null), F = L(null), U = L(null), [oe, ne] = Q(null), [ae, n] = Q(null), [h, R] = Q({}), [x, Z] = Q({}), N = L(/* @__PURE__ */ new Map()), X = L(null), J = L([]), ge = ((De = h.primary) == null ? void 0 : De.isOpen) ?? !1, pe = ((Xe = h.primary) == null ? void 0 : Xe.anchorState) ?? "closed", _e = Je(
|
|
307
|
+
() => Object.values(h).some((l) => l.isOpen),
|
|
308
|
+
[h]
|
|
309
|
+
), ce = N.current.get("primary"), it = (ce == null ? void 0 : ce.sidebarRef) ?? { current: null }, ot = (ce == null ? void 0 : ce.toggleRef) ?? { current: null }, at = x.primary ?? {}, [st, ct] = Q({
|
|
310
|
+
sidebarWidthPx: t ?? It,
|
|
311
|
+
sidebarHeightPx: Be,
|
|
312
|
+
transitionMs: r ?? At,
|
|
313
|
+
edgeActivationWidthPx: i ?? Pt,
|
|
314
|
+
dragActivationDeltaPx: s ?? Mt,
|
|
315
|
+
showOverlay: o ?? Ct,
|
|
316
|
+
isAbsolute: f ?? Lt,
|
|
317
|
+
overlayBackgroundColor: c ?? et,
|
|
318
|
+
toggleIconColor: d ?? Dt,
|
|
319
|
+
toggleIconSizePx: u ?? Xt,
|
|
320
|
+
toggleIconEdgeDistancePx: T ?? Yt,
|
|
321
|
+
showToggle: w ?? $t,
|
|
322
|
+
mediaQueryWidth: b ?? Te,
|
|
323
|
+
swipeBarZIndex: S ?? Wt,
|
|
324
|
+
toggleZIndex: I ?? Bt,
|
|
325
|
+
overlayZIndex: p ?? jt,
|
|
326
|
+
fadeContent: M ?? Ft,
|
|
327
|
+
fadeContentTransitionMs: _ ?? Nt,
|
|
328
|
+
swipeToOpen: Ht,
|
|
329
|
+
swipeToClose: Gt,
|
|
330
|
+
midAnchorPoint: Ut,
|
|
331
|
+
midAnchorPointPx: Be / 3,
|
|
331
332
|
disabled: !1,
|
|
332
|
-
closeSidebarOnOverlayClick:
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
closeSidebarOnOverlayClick: C ?? _t,
|
|
334
|
+
resetMetaOnClose: Y ?? !1
|
|
335
|
+
}), lt = B((l, a) => {
|
|
336
|
+
N.current.set(l, a), R((g) => g[l] ? g : { ...g, [l]: { ...we } });
|
|
337
|
+
}, []), ut = B((l) => {
|
|
338
|
+
N.current.delete(l), R((a) => {
|
|
339
|
+
const g = { ...a };
|
|
338
340
|
return delete g[l], g;
|
|
339
|
-
}),
|
|
340
|
-
const g = { ...
|
|
341
|
+
}), Z((a) => {
|
|
342
|
+
const g = { ...a };
|
|
341
343
|
return delete g[l], g;
|
|
342
344
|
});
|
|
343
|
-
}, []),
|
|
344
|
-
(l,
|
|
345
|
-
|
|
345
|
+
}, []), dt = B((l) => N.current.get(l), []), ft = B(
|
|
346
|
+
(l, a) => {
|
|
347
|
+
Z((g) => g[l] === a ? g : { ...g, [l]: a });
|
|
346
348
|
},
|
|
347
349
|
[]
|
|
348
|
-
),
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
return
|
|
350
|
+
), te = B((l, a) => {
|
|
351
|
+
R((g) => {
|
|
352
|
+
const m = g[l] ?? we;
|
|
353
|
+
return m.isOpen === a ? g : { ...g, [l]: { ...m, isOpen: a } };
|
|
352
354
|
});
|
|
353
|
-
}, []),
|
|
354
|
-
(l,
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
return
|
|
355
|
+
}, []), re = B(
|
|
356
|
+
(l, a) => {
|
|
357
|
+
R((g) => {
|
|
358
|
+
const m = g[l] ?? we;
|
|
359
|
+
return m.anchorState === a ? g : { ...g, [l]: { ...m, anchorState: a } };
|
|
358
360
|
});
|
|
359
361
|
},
|
|
360
362
|
[]
|
|
361
|
-
),
|
|
362
|
-
|
|
363
|
-
const
|
|
364
|
-
return
|
|
363
|
+
), he = B((l, a) => {
|
|
364
|
+
R((g) => {
|
|
365
|
+
const m = g[l] ?? we;
|
|
366
|
+
return m.meta === a ? g : { ...g, [l]: { ...m, meta: a } };
|
|
365
367
|
});
|
|
366
368
|
}, []);
|
|
367
|
-
|
|
369
|
+
z(() => (k || y || _e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
|
|
368
370
|
document.body.style.overflow = "";
|
|
369
|
-
}), [
|
|
371
|
+
}), [k, y, _e]), z(() => {
|
|
370
372
|
var l;
|
|
371
|
-
if (
|
|
372
|
-
const
|
|
373
|
-
|
|
373
|
+
if (P.fadeContent === !1) {
|
|
374
|
+
const a = (l = G.current) == null ? void 0 : l.firstElementChild;
|
|
375
|
+
a && (a.style.opacity = "1");
|
|
374
376
|
}
|
|
375
|
-
}, [
|
|
377
|
+
}, [P.fadeContent]), z(() => {
|
|
376
378
|
var l;
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
|
|
379
|
+
if (D.fadeContent === !1) {
|
|
380
|
+
const a = (l = H.current) == null ? void 0 : l.firstElementChild;
|
|
381
|
+
a && (a.style.opacity = "1");
|
|
380
382
|
}
|
|
381
|
-
}, [
|
|
383
|
+
}, [D.fadeContent]), z(() => {
|
|
382
384
|
var l;
|
|
383
|
-
for (const [
|
|
385
|
+
for (const [a, g] of Object.entries(x))
|
|
384
386
|
if (g.fadeContent === !1) {
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
+
const m = N.current.get(a), A = (l = m == null ? void 0 : m.sidebarRef.current) == null ? void 0 : l.firstElementChild;
|
|
388
|
+
A && (A.style.opacity = "1");
|
|
389
|
+
}
|
|
390
|
+
}, [x]);
|
|
391
|
+
const gt = B((l) => {
|
|
392
|
+
ct((a) => ({ ...a, ...l }));
|
|
393
|
+
}, []), le = B((l, a) => {
|
|
394
|
+
const g = l === "left" ? ne : n;
|
|
395
|
+
a != null && a.resetMeta ? g(null) : (a == null ? void 0 : a.meta) !== void 0 && g(a.meta);
|
|
396
|
+
}, []), ie = B(
|
|
397
|
+
(l, a) => {
|
|
398
|
+
a != null && a.resetMeta ? he(l, null) : (a == null ? void 0 : a.meta) !== void 0 && he(l, a.meta);
|
|
399
|
+
},
|
|
400
|
+
[he]
|
|
401
|
+
), ht = B(
|
|
402
|
+
(l, a) => {
|
|
403
|
+
if (l === "left")
|
|
404
|
+
ne(a);
|
|
405
|
+
else if (l === "right")
|
|
406
|
+
n(a);
|
|
407
|
+
else {
|
|
408
|
+
const g = a;
|
|
409
|
+
he(g.id, g.meta);
|
|
387
410
|
}
|
|
388
|
-
}, [p]);
|
|
389
|
-
const ft = N((l) => {
|
|
390
|
-
st((s) => ({ ...s, ...l }));
|
|
391
|
-
}, []), le = N((l, s) => {
|
|
392
|
-
const g = l === "left" ? ie : ae;
|
|
393
|
-
s != null && s.resetMeta ? g(null) : (s == null ? void 0 : s.meta) !== void 0 && g(s.meta);
|
|
394
|
-
}, []), te = N(
|
|
395
|
-
(l, s) => {
|
|
396
|
-
s != null && s.resetMeta ? Se(l, null) : (s == null ? void 0 : s.meta) !== void 0 && Se(l, s.meta);
|
|
397
411
|
},
|
|
398
|
-
[
|
|
399
|
-
), se =
|
|
400
|
-
const
|
|
401
|
-
g !== -1 &&
|
|
402
|
-
}, []),
|
|
403
|
-
const
|
|
404
|
-
g !== -1 &&
|
|
405
|
-
}, []),
|
|
406
|
-
(l,
|
|
407
|
-
const g = (
|
|
412
|
+
[he]
|
|
413
|
+
), se = B((l) => {
|
|
414
|
+
const a = J.current, g = a.indexOf(l);
|
|
415
|
+
g !== -1 && a.splice(g, 1), a.push(l), $("bottom");
|
|
416
|
+
}, []), Le = B((l) => {
|
|
417
|
+
const a = J.current, g = a.indexOf(l);
|
|
418
|
+
g !== -1 && a.splice(g, 1), R((m) => (Object.entries(m).some(([W, K]) => W !== l && K.isOpen) || $(null), m));
|
|
419
|
+
}, []), mt = B(
|
|
420
|
+
(l, a) => {
|
|
421
|
+
const g = (m, A, W, K) => {
|
|
408
422
|
xe({
|
|
409
423
|
side: l,
|
|
410
|
-
ref:
|
|
411
|
-
options:
|
|
412
|
-
toggleRef:
|
|
424
|
+
ref: m,
|
|
425
|
+
options: A,
|
|
426
|
+
toggleRef: W,
|
|
413
427
|
afterApply: () => {
|
|
414
|
-
|
|
428
|
+
K(!0), $(l);
|
|
415
429
|
}
|
|
416
430
|
});
|
|
417
431
|
};
|
|
418
432
|
if (l === "left") {
|
|
419
|
-
if (
|
|
420
|
-
le("left",
|
|
433
|
+
if (P.disabled) return;
|
|
434
|
+
le("left", a), g(G, P, F, v);
|
|
421
435
|
} else if (l === "right") {
|
|
422
|
-
if (
|
|
423
|
-
le("right",
|
|
436
|
+
if (D.disabled) return;
|
|
437
|
+
le("right", a), g(H, D, U, O);
|
|
424
438
|
} else if (l === "bottom") {
|
|
425
|
-
const
|
|
426
|
-
if (!
|
|
427
|
-
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
ref:
|
|
431
|
-
options:
|
|
432
|
-
toggleRef:
|
|
439
|
+
const m = (a == null ? void 0 : a.id) ?? "primary", A = x[m], W = N.current.get(m);
|
|
440
|
+
if (!A || !W || A.disabled) return;
|
|
441
|
+
ie(m, a);
|
|
442
|
+
const K = A.sidebarHeightPx ?? 0, pt = A.mediaQueryWidth ?? 640, Ye = window.innerWidth < pt, yt = Ye ? A.midAnchorPointPx ?? 0 : K;
|
|
443
|
+
Ye && A.midAnchorPoint && !A.swipeToOpen && yt < K ? Ne({
|
|
444
|
+
ref: W.sidebarRef,
|
|
445
|
+
options: A,
|
|
446
|
+
toggleRef: W.toggleRef,
|
|
433
447
|
afterApply: () => {
|
|
434
|
-
|
|
448
|
+
te(m, !0), re(m, "midAnchor"), se(m);
|
|
435
449
|
}
|
|
436
450
|
}) : xe({
|
|
437
451
|
side: l,
|
|
438
|
-
ref:
|
|
439
|
-
options:
|
|
440
|
-
toggleRef:
|
|
452
|
+
ref: W.sidebarRef,
|
|
453
|
+
options: A,
|
|
454
|
+
toggleRef: W.toggleRef,
|
|
441
455
|
afterApply: () => {
|
|
442
|
-
|
|
456
|
+
te(m, !0), re(m, "open"), se(m);
|
|
443
457
|
}
|
|
444
458
|
});
|
|
445
459
|
} else
|
|
446
460
|
ye(l);
|
|
447
461
|
},
|
|
448
462
|
[
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
463
|
+
P,
|
|
464
|
+
D,
|
|
465
|
+
x,
|
|
466
|
+
te,
|
|
467
|
+
re,
|
|
454
468
|
se,
|
|
455
469
|
le,
|
|
456
|
-
|
|
470
|
+
ie
|
|
457
471
|
]
|
|
458
|
-
),
|
|
459
|
-
(l,
|
|
472
|
+
), vt = B(
|
|
473
|
+
(l, a) => {
|
|
460
474
|
if (l !== "bottom") return;
|
|
461
|
-
const g = (
|
|
462
|
-
!
|
|
463
|
-
ref:
|
|
464
|
-
options:
|
|
465
|
-
toggleRef:
|
|
475
|
+
const g = (a == null ? void 0 : a.id) ?? "primary", m = x[g], A = N.current.get(g);
|
|
476
|
+
!m || !A || m.disabled || (ie(g, a), Ne({
|
|
477
|
+
ref: A.sidebarRef,
|
|
478
|
+
options: m,
|
|
479
|
+
toggleRef: A.toggleRef,
|
|
466
480
|
afterApply: () => {
|
|
467
|
-
|
|
481
|
+
te(g, !0), re(g, "midAnchor"), se(g);
|
|
468
482
|
}
|
|
469
483
|
}));
|
|
470
484
|
},
|
|
471
485
|
[
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
486
|
+
x,
|
|
487
|
+
te,
|
|
488
|
+
re,
|
|
475
489
|
se,
|
|
476
|
-
|
|
490
|
+
ie
|
|
477
491
|
]
|
|
478
|
-
),
|
|
479
|
-
(l,
|
|
492
|
+
), bt = B(
|
|
493
|
+
(l, a) => {
|
|
480
494
|
if (l !== "bottom") return;
|
|
481
|
-
const g = (
|
|
482
|
-
!
|
|
495
|
+
const g = (a == null ? void 0 : a.id) ?? "primary", m = x[g], A = N.current.get(g);
|
|
496
|
+
!m || !A || m.disabled || (ie(g, a), xe({
|
|
483
497
|
side: l,
|
|
484
|
-
ref:
|
|
485
|
-
options:
|
|
486
|
-
toggleRef:
|
|
498
|
+
ref: A.sidebarRef,
|
|
499
|
+
options: m,
|
|
500
|
+
toggleRef: A.toggleRef,
|
|
487
501
|
afterApply: () => {
|
|
488
|
-
|
|
502
|
+
te(g, !0), re(g, "open"), se(g);
|
|
489
503
|
}
|
|
490
504
|
}));
|
|
491
505
|
},
|
|
492
506
|
[
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
507
|
+
x,
|
|
508
|
+
te,
|
|
509
|
+
re,
|
|
496
510
|
se,
|
|
497
|
-
|
|
511
|
+
ie
|
|
498
512
|
]
|
|
499
|
-
),
|
|
500
|
-
(l,
|
|
501
|
-
const g = (
|
|
502
|
-
|
|
503
|
-
ref:
|
|
504
|
-
options:
|
|
505
|
-
toggleRef:
|
|
513
|
+
), wt = B(
|
|
514
|
+
(l, a) => {
|
|
515
|
+
const g = (m, A, W, K) => {
|
|
516
|
+
ke({
|
|
517
|
+
ref: m,
|
|
518
|
+
options: A,
|
|
519
|
+
toggleRef: W,
|
|
506
520
|
side: l,
|
|
507
521
|
afterApply: () => {
|
|
508
|
-
|
|
522
|
+
K(!1), $(null);
|
|
509
523
|
}
|
|
510
524
|
});
|
|
511
525
|
};
|
|
512
526
|
if (l === "left") {
|
|
513
|
-
if (
|
|
514
|
-
|
|
527
|
+
if (P.disabled) return;
|
|
528
|
+
const m = P.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
|
|
529
|
+
le("left", m), g(G, P, F, v);
|
|
515
530
|
} else if (l === "right") {
|
|
516
|
-
if (
|
|
517
|
-
|
|
531
|
+
if (D.disabled) return;
|
|
532
|
+
const m = D.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
|
|
533
|
+
le("right", m), g(H, D, U, O);
|
|
518
534
|
} else if (l === "bottom") {
|
|
519
|
-
const
|
|
520
|
-
if (!
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
535
|
+
const m = (a == null ? void 0 : a.id) ?? "primary", A = x[m], W = N.current.get(m);
|
|
536
|
+
if (!A || !W || A.disabled) return;
|
|
537
|
+
const K = A.resetMetaOnClose && (a == null ? void 0 : a.meta) === void 0 && (a == null ? void 0 : a.resetMeta) === void 0 ? { ...a, resetMeta: !0 } : a;
|
|
538
|
+
ie(m, K), ke({
|
|
539
|
+
ref: W.sidebarRef,
|
|
540
|
+
options: A,
|
|
541
|
+
toggleRef: W.toggleRef,
|
|
525
542
|
side: l,
|
|
526
543
|
afterApply: () => {
|
|
527
|
-
|
|
544
|
+
te(m, !1), re(m, "closed"), Le(m);
|
|
528
545
|
}
|
|
529
546
|
});
|
|
530
547
|
} else
|
|
531
548
|
ye(l);
|
|
532
549
|
},
|
|
533
550
|
[
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
551
|
+
P,
|
|
552
|
+
D,
|
|
553
|
+
x,
|
|
554
|
+
te,
|
|
555
|
+
re,
|
|
556
|
+
Le,
|
|
540
557
|
le,
|
|
541
|
-
|
|
558
|
+
ie
|
|
542
559
|
]
|
|
543
|
-
),
|
|
544
|
-
(l,
|
|
560
|
+
), St = B(
|
|
561
|
+
(l, a, g) => {
|
|
545
562
|
if (l === "left")
|
|
546
|
-
|
|
547
|
-
ref:
|
|
548
|
-
toggleRef:
|
|
549
|
-
options:
|
|
550
|
-
translateX:
|
|
563
|
+
Fe({
|
|
564
|
+
ref: G,
|
|
565
|
+
toggleRef: F,
|
|
566
|
+
options: P,
|
|
567
|
+
translateX: a
|
|
551
568
|
});
|
|
552
569
|
else if (l === "right")
|
|
553
|
-
|
|
554
|
-
ref:
|
|
570
|
+
Fe({
|
|
571
|
+
ref: H,
|
|
555
572
|
toggleRef: U,
|
|
556
|
-
options:
|
|
557
|
-
translateX:
|
|
573
|
+
options: D,
|
|
574
|
+
translateX: a
|
|
558
575
|
});
|
|
559
576
|
else if (l === "bottom") {
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
562
|
-
|
|
563
|
-
ref:
|
|
564
|
-
toggleRef:
|
|
565
|
-
options:
|
|
566
|
-
translateY:
|
|
577
|
+
const m = (g == null ? void 0 : g.id) ?? "primary", A = x[m], W = N.current.get(m);
|
|
578
|
+
if (!A || !W) return;
|
|
579
|
+
ir({
|
|
580
|
+
ref: W.sidebarRef,
|
|
581
|
+
toggleRef: W.toggleRef,
|
|
582
|
+
options: A,
|
|
583
|
+
translateY: a
|
|
567
584
|
});
|
|
568
585
|
} else
|
|
569
586
|
ye(l);
|
|
570
587
|
},
|
|
571
|
-
[
|
|
588
|
+
[P, D, x]
|
|
572
589
|
);
|
|
573
|
-
return /* @__PURE__ */
|
|
574
|
-
|
|
590
|
+
return /* @__PURE__ */ E.jsx(
|
|
591
|
+
Ke.Provider,
|
|
575
592
|
{
|
|
576
593
|
value: {
|
|
577
|
-
lockedSidebar:
|
|
578
|
-
setLockedSidebar:
|
|
579
|
-
leftSidebarRef:
|
|
580
|
-
rightSidebarRef:
|
|
581
|
-
isLeftOpen:
|
|
582
|
-
isRightOpen:
|
|
594
|
+
lockedSidebar: j,
|
|
595
|
+
setLockedSidebar: $,
|
|
596
|
+
leftSidebarRef: G,
|
|
597
|
+
rightSidebarRef: H,
|
|
598
|
+
isLeftOpen: k,
|
|
599
|
+
isRightOpen: y,
|
|
583
600
|
// Backwards-compat aliases for primary bottom sidebar
|
|
584
|
-
isBottomOpen:
|
|
585
|
-
bottomAnchorState:
|
|
586
|
-
bottomSidebarRef:
|
|
587
|
-
bottomToggleRef:
|
|
588
|
-
bottomSidebarOptions:
|
|
601
|
+
isBottomOpen: ge,
|
|
602
|
+
bottomAnchorState: pe,
|
|
603
|
+
bottomSidebarRef: it,
|
|
604
|
+
bottomToggleRef: ot,
|
|
605
|
+
bottomSidebarOptions: at,
|
|
589
606
|
// Multi-instance bottom sidebar
|
|
590
|
-
bottomSidebars:
|
|
591
|
-
bottomSidebarOptionsMap:
|
|
592
|
-
registerBottomSidebar:
|
|
593
|
-
unregisterBottomSidebar:
|
|
594
|
-
getBottomSidebarRefs:
|
|
595
|
-
activeBottomDragIdRef:
|
|
596
|
-
bottomFocusStackRef:
|
|
607
|
+
bottomSidebars: h,
|
|
608
|
+
bottomSidebarOptionsMap: x,
|
|
609
|
+
registerBottomSidebar: lt,
|
|
610
|
+
unregisterBottomSidebar: ut,
|
|
611
|
+
getBottomSidebarRefs: dt,
|
|
612
|
+
activeBottomDragIdRef: X,
|
|
613
|
+
bottomFocusStackRef: J,
|
|
597
614
|
// Functions
|
|
598
|
-
openSidebar:
|
|
599
|
-
openSidebarFully:
|
|
600
|
-
openSidebarToMidAnchor:
|
|
601
|
-
closeSidebar:
|
|
602
|
-
dragSidebar:
|
|
603
|
-
globalOptions:
|
|
604
|
-
setGlobalOptions:
|
|
605
|
-
leftSidebarOptions:
|
|
606
|
-
rightSidebarOptions:
|
|
607
|
-
setLeftSidebarOptions:
|
|
608
|
-
setRightSidebarOptions:
|
|
609
|
-
setBottomSidebarOptionsById:
|
|
610
|
-
leftToggleRef:
|
|
615
|
+
openSidebar: mt,
|
|
616
|
+
openSidebarFully: bt,
|
|
617
|
+
openSidebarToMidAnchor: vt,
|
|
618
|
+
closeSidebar: wt,
|
|
619
|
+
dragSidebar: St,
|
|
620
|
+
globalOptions: st,
|
|
621
|
+
setGlobalOptions: gt,
|
|
622
|
+
leftSidebarOptions: P,
|
|
623
|
+
rightSidebarOptions: D,
|
|
624
|
+
setLeftSidebarOptions: V,
|
|
625
|
+
setRightSidebarOptions: q,
|
|
626
|
+
setBottomSidebarOptionsById: ft,
|
|
627
|
+
leftToggleRef: F,
|
|
611
628
|
rightToggleRef: U,
|
|
612
|
-
leftMeta:
|
|
613
|
-
rightMeta:
|
|
629
|
+
leftMeta: oe,
|
|
630
|
+
rightMeta: ae,
|
|
631
|
+
setMeta: ht
|
|
614
632
|
},
|
|
615
633
|
children: e
|
|
616
634
|
}
|
|
617
635
|
);
|
|
618
636
|
};
|
|
619
|
-
function
|
|
620
|
-
const e =
|
|
637
|
+
function ee() {
|
|
638
|
+
const e = Tt(Ke);
|
|
621
639
|
if (!e)
|
|
622
640
|
throw new Error("useSwipeBarContext must be used within SwipeBarProvider");
|
|
623
641
|
return e;
|
|
624
642
|
}
|
|
625
|
-
const
|
|
643
|
+
const At = 300, Pt = 40, Mt = 20, It = 320, Be = window.innerHeight, Ct = !0, _t = !0, Lt = !1, et = "rgba(0, 0, 0, 0.5)", Oe = "rgb(36,36,36)", Dt = "white", Xt = 40, Yt = 40, $t = !0, Te = 640, Wt = 30, Bt = 15, jt = 20, je = 0.6, kt = 200, Nt = 100, Ft = !1, Ht = !0, Gt = !0, Ut = !1, ue = "cubic-bezier(0.22, 1, 0.36, 1)", tt = {
|
|
626
644
|
width: 0,
|
|
627
645
|
top: 0,
|
|
628
646
|
bottom: 0,
|
|
629
647
|
flexShrink: 0,
|
|
630
648
|
overflowX: "hidden",
|
|
631
649
|
willChange: "transform"
|
|
632
|
-
},
|
|
650
|
+
}, Zt = {
|
|
633
651
|
transform: "translateX(-100%)"
|
|
634
|
-
},
|
|
652
|
+
}, zt = {
|
|
635
653
|
transform: "translateX(100%)"
|
|
636
|
-
},
|
|
654
|
+
}, Vt = {
|
|
637
655
|
position: "fixed",
|
|
638
656
|
left: 0,
|
|
639
657
|
top: 0,
|
|
640
658
|
bottom: 0
|
|
641
|
-
},
|
|
659
|
+
}, qt = {
|
|
642
660
|
position: "fixed",
|
|
643
661
|
right: 0,
|
|
644
662
|
top: 0,
|
|
645
663
|
bottom: 0
|
|
646
|
-
},
|
|
664
|
+
}, Qt = {
|
|
647
665
|
height: 0,
|
|
648
666
|
left: 0,
|
|
649
667
|
right: 0,
|
|
650
668
|
flexShrink: 0,
|
|
651
669
|
overflowY: "hidden",
|
|
652
670
|
willChange: "transform"
|
|
653
|
-
},
|
|
671
|
+
}, Jt = {
|
|
654
672
|
transform: "translateY(100%)"
|
|
655
|
-
},
|
|
673
|
+
}, Kt = {
|
|
656
674
|
position: "fixed",
|
|
657
675
|
bottom: 0,
|
|
658
676
|
left: 0,
|
|
659
677
|
right: 0
|
|
660
|
-
},
|
|
678
|
+
}, er = {
|
|
661
679
|
position: "fixed",
|
|
662
680
|
top: 0,
|
|
663
681
|
left: 0,
|
|
664
682
|
width: "100%",
|
|
665
683
|
height: "100%",
|
|
666
|
-
backgroundColor:
|
|
684
|
+
backgroundColor: et,
|
|
667
685
|
transitionProperty: "opacity",
|
|
668
686
|
pointerEvents: "none",
|
|
669
687
|
opacity: 0
|
|
670
|
-
},
|
|
688
|
+
}, tr = {
|
|
671
689
|
opacity: 1,
|
|
672
690
|
pointerEvents: "auto"
|
|
673
|
-
},
|
|
691
|
+
}, rt = {
|
|
674
692
|
position: "fixed",
|
|
675
693
|
top: "50%",
|
|
676
694
|
transform: "translateY(-50%)",
|
|
677
695
|
width: "1px",
|
|
678
696
|
display: "flex",
|
|
679
697
|
justifyContent: "center"
|
|
680
|
-
},
|
|
698
|
+
}, rr = {
|
|
681
699
|
position: "fixed",
|
|
682
700
|
bottom: 0,
|
|
683
701
|
left: "50%",
|
|
@@ -685,7 +703,7 @@ const Ot = 300, Et = 40, At = 20, Pt = 320, We = window.innerHeight, It = !0, Mt
|
|
|
685
703
|
height: "1px",
|
|
686
704
|
display: "flex",
|
|
687
705
|
alignItems: "center"
|
|
688
|
-
},
|
|
706
|
+
}, nr = {
|
|
689
707
|
position: "relative",
|
|
690
708
|
cursor: "pointer",
|
|
691
709
|
display: "flex",
|
|
@@ -702,7 +720,7 @@ const Ot = 300, Et = 40, At = 20, Pt = 320, We = window.innerHeight, It = !0, Mt
|
|
|
702
720
|
side: t,
|
|
703
721
|
options: r,
|
|
704
722
|
toggleRef: i,
|
|
705
|
-
afterApply:
|
|
723
|
+
afterApply: s
|
|
706
724
|
}) => {
|
|
707
725
|
const o = be(e), f = r.transitionMs ? r.transitionMs / 2 : 0;
|
|
708
726
|
o && r.fadeContent && (o.style.opacity = "0");
|
|
@@ -720,17 +738,17 @@ const Ot = 300, Et = 40, At = 20, Pt = 320, We = window.innerHeight, It = !0, Mt
|
|
|
720
738
|
}
|
|
721
739
|
i.current && d && (i.current.style.opacity = "1", t === "left" ? i.current.style.transform = `translateY(-50%) translateX(${d}px)` : t === "right" ? i.current.style.transform = `translateY(-50%) translateX(-${d}px)` : t === "bottom" && (i.current.style.transform = `translateX(-50%) translateY(-${d}px)`)), o && r.fadeContent && setTimeout(() => {
|
|
722
740
|
o.style.opacity = "1";
|
|
723
|
-
}, f),
|
|
741
|
+
}, f), s();
|
|
724
742
|
}
|
|
725
743
|
});
|
|
726
744
|
}), setTimeout(() => {
|
|
727
745
|
}, 0);
|
|
728
|
-
},
|
|
746
|
+
}, ke = ({
|
|
729
747
|
ref: e,
|
|
730
748
|
options: t,
|
|
731
749
|
side: r,
|
|
732
750
|
toggleRef: i,
|
|
733
|
-
afterApply:
|
|
751
|
+
afterApply: s
|
|
734
752
|
}) => {
|
|
735
753
|
const o = be(e);
|
|
736
754
|
let f;
|
|
@@ -738,20 +756,20 @@ const Ot = 300, Et = 40, At = 20, Pt = 320, We = window.innerHeight, It = !0, Mt
|
|
|
738
756
|
if (!e.current) return;
|
|
739
757
|
const c = `transform ${t.transitionMs}ms ${ue}`, d = t.isAbsolute ? "" : `, ${f} ${t.transitionMs}ms ${ue}`;
|
|
740
758
|
e.current.style.transition = `${c}${d}`, o && t.fadeContent && (o.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
741
|
-
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"),
|
|
759
|
+
e.current && (r === "left" ? (e.current.style.transform = "translateX(-100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "right" ? (e.current.style.transform = "translateX(100%)", t.isAbsolute || (e.current.style.width = "0px")) : r === "bottom" && (e.current.style.transform = "translateY(100%)", t.isAbsolute || (e.current.style.height = "0px")), i.current && (i.current.style.opacity = "1", r === "left" || r === "right" ? i.current.style.transform = "translateY(-50%)" : r === "bottom" && (i.current.style.transform = "translateX(-50%)")), o && t.fadeContent && (o.style.opacity = "0"), s());
|
|
742
760
|
});
|
|
743
761
|
});
|
|
744
|
-
},
|
|
762
|
+
}, Ne = ({
|
|
745
763
|
ref: e,
|
|
746
764
|
options: t,
|
|
747
765
|
toggleRef: r,
|
|
748
766
|
afterApply: i
|
|
749
767
|
}) => {
|
|
750
|
-
const
|
|
751
|
-
|
|
768
|
+
const s = be(e), o = t.transitionMs ? t.transitionMs / 2 : 0;
|
|
769
|
+
s && t.fadeContent && (s.style.opacity = "0"), s && t.midAnchorPointPx && (s.style.minHeight = `${t.sidebarHeightPx}px`), requestAnimationFrame(() => {
|
|
752
770
|
if (!e.current) return;
|
|
753
771
|
const f = `transform ${t.transitionMs}ms ${ue}`, c = t.isAbsolute ? "" : `, height ${t.transitionMs}ms ${ue}`;
|
|
754
|
-
e.current.style.transition = `${f}${c}`,
|
|
772
|
+
e.current.style.transition = `${f}${c}`, s && t.fadeContent && (s.style.transition = `opacity ${t.fadeContentTransitionMs}ms ease`), requestAnimationFrame(() => {
|
|
755
773
|
if (!e.current) return;
|
|
756
774
|
const d = t.midAnchorPointPx ?? 0, u = t.sidebarHeightPx ?? 0, T = u - d;
|
|
757
775
|
if (e.current.style.transform = `translateY(${T}px)`, !t.isAbsolute)
|
|
@@ -760,72 +778,72 @@ const Ot = 300, Et = 40, At = 20, Pt = 320, We = window.innerHeight, It = !0, Mt
|
|
|
760
778
|
const w = e.current.style.transition;
|
|
761
779
|
e.current.style.transition = f, e.current.style.height = `${u}px`, e.current.style.transition = w;
|
|
762
780
|
}
|
|
763
|
-
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${d}px)`),
|
|
764
|
-
|
|
781
|
+
r.current && (r.current.style.opacity = "1", r.current.style.transform = `translateX(-50%) translateY(-${d}px)`), s && t.fadeContent && setTimeout(() => {
|
|
782
|
+
s.style.opacity = "1";
|
|
765
783
|
}, o), i();
|
|
766
784
|
});
|
|
767
785
|
}), setTimeout(() => {
|
|
768
786
|
}, 0);
|
|
769
|
-
},
|
|
787
|
+
}, Fe = ({
|
|
770
788
|
ref: e,
|
|
771
789
|
toggleRef: t,
|
|
772
790
|
options: r,
|
|
773
791
|
translateX: i
|
|
774
792
|
}) => {
|
|
775
793
|
!e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
776
|
-
const
|
|
794
|
+
const s = be(e);
|
|
777
795
|
if (e.current) {
|
|
778
|
-
if (
|
|
796
|
+
if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarWidthPx && (s.style.minWidth = `${r.sidebarWidthPx}px`), !r.isAbsolute) {
|
|
779
797
|
const o = `${r.sidebarWidthPx}px`;
|
|
780
798
|
e.current.style.width !== o && (e.current.style.width = o);
|
|
781
799
|
}
|
|
782
800
|
e.current.style.transform = `translateX(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateY(-50%) translateX(${i}px)`);
|
|
783
801
|
}
|
|
784
802
|
}));
|
|
785
|
-
},
|
|
803
|
+
}, ir = ({
|
|
786
804
|
ref: e,
|
|
787
805
|
toggleRef: t,
|
|
788
806
|
options: r,
|
|
789
807
|
translateY: i
|
|
790
808
|
}) => {
|
|
791
809
|
!e.current || i === null || (e.current.style.transition = "none", requestAnimationFrame(() => {
|
|
792
|
-
const
|
|
810
|
+
const s = be(e);
|
|
793
811
|
if (e.current) {
|
|
794
|
-
if (
|
|
812
|
+
if (s && r.fadeContent && (s.style.opacity = "0"), s && r.sidebarHeightPx && (s.style.minHeight = `${r.sidebarHeightPx}px`), !r.isAbsolute) {
|
|
795
813
|
const o = `${r.sidebarHeightPx}px`;
|
|
796
814
|
e.current.style.height !== o && (e.current.style.height = o);
|
|
797
815
|
}
|
|
798
816
|
e.current.style.transform = `translateY(${i}px)`, t.current && (t.current.style.opacity = "0", t.current.style.transform = `translateX(-50%) translateY(${i}px)`);
|
|
799
817
|
}
|
|
800
818
|
}));
|
|
801
|
-
},
|
|
819
|
+
}, Se = ({ refs: e, clientX: t, clientY: r, touchId: i, isMouse: s }) => {
|
|
802
820
|
e.draggingRef.current = {
|
|
803
821
|
startX: t,
|
|
804
822
|
startY: r,
|
|
805
823
|
activeTouchId: i,
|
|
806
|
-
isMouse:
|
|
824
|
+
isMouse: s,
|
|
807
825
|
isActivated: !1
|
|
808
826
|
}, e.currentXRef.current = t, e.prevXRef.current = t;
|
|
809
|
-
},
|
|
827
|
+
}, He = ({
|
|
810
828
|
refs: e,
|
|
811
829
|
clientX: t,
|
|
812
830
|
clientY: r,
|
|
813
831
|
touchId: i,
|
|
814
|
-
isMouse:
|
|
832
|
+
isMouse: s
|
|
815
833
|
}) => {
|
|
816
834
|
e.draggingRef.current = {
|
|
817
835
|
startX: t,
|
|
818
836
|
startY: r,
|
|
819
837
|
activeTouchId: i,
|
|
820
|
-
isMouse:
|
|
838
|
+
isMouse: s,
|
|
821
839
|
isActivated: !1
|
|
822
840
|
}, e.currentYRef.current = r, e.prevYRef.current = r;
|
|
823
|
-
},
|
|
841
|
+
}, nt = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
824
842
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null, t(null), r();
|
|
825
|
-
},
|
|
843
|
+
}, or = ({ refs: e, dragSidebar: t, onDeactivate: r }) => {
|
|
826
844
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, t(null);
|
|
827
845
|
}, de = (e) => e instanceof Element ? !!e.closest("input, textarea, [contenteditable='true']") : !1;
|
|
828
|
-
function
|
|
846
|
+
function Ge(e) {
|
|
829
847
|
let t = e instanceof HTMLElement ? e : null;
|
|
830
848
|
for (; t; ) {
|
|
831
849
|
const r = getComputedStyle(t);
|
|
@@ -847,38 +865,39 @@ const Ae = (e, t) => {
|
|
|
847
865
|
if (e[r].identifier === t)
|
|
848
866
|
return !0;
|
|
849
867
|
return !1;
|
|
850
|
-
},
|
|
868
|
+
}, Me = (e, t, r) => {
|
|
851
869
|
const {
|
|
852
870
|
globalOptions: i,
|
|
853
|
-
setLeftSidebarOptions:
|
|
871
|
+
setLeftSidebarOptions: s,
|
|
854
872
|
setRightSidebarOptions: o,
|
|
855
873
|
setBottomSidebarOptionsById: f
|
|
856
|
-
} =
|
|
874
|
+
} = ee(), {
|
|
857
875
|
sidebarWidthPx: c,
|
|
858
876
|
sidebarHeightPx: d,
|
|
859
877
|
transitionMs: u,
|
|
860
878
|
edgeActivationWidthPx: T,
|
|
861
879
|
dragActivationDeltaPx: w,
|
|
862
|
-
showOverlay:
|
|
863
|
-
isAbsolute:
|
|
880
|
+
showOverlay: b,
|
|
881
|
+
isAbsolute: S,
|
|
864
882
|
overlayBackgroundColor: I,
|
|
865
|
-
toggleIconColor:
|
|
866
|
-
toggleIconSizePx:
|
|
867
|
-
toggleIconEdgeDistancePx:
|
|
868
|
-
showToggle:
|
|
869
|
-
mediaQueryWidth:
|
|
870
|
-
swipeBarZIndex:
|
|
871
|
-
toggleZIndex:
|
|
872
|
-
overlayZIndex:
|
|
873
|
-
fadeContent:
|
|
874
|
-
fadeContentTransitionMs:
|
|
875
|
-
swipeToOpen:
|
|
876
|
-
swipeToClose:
|
|
877
|
-
midAnchorPoint:
|
|
878
|
-
midAnchorPointPx:
|
|
879
|
-
disabled:
|
|
880
|
-
closeSidebarOnOverlayClick: G
|
|
881
|
-
|
|
883
|
+
toggleIconColor: p,
|
|
884
|
+
toggleIconSizePx: M,
|
|
885
|
+
toggleIconEdgeDistancePx: _,
|
|
886
|
+
showToggle: C,
|
|
887
|
+
mediaQueryWidth: Y,
|
|
888
|
+
swipeBarZIndex: j,
|
|
889
|
+
toggleZIndex: $,
|
|
890
|
+
overlayZIndex: k,
|
|
891
|
+
fadeContent: v,
|
|
892
|
+
fadeContentTransitionMs: y,
|
|
893
|
+
swipeToOpen: O,
|
|
894
|
+
swipeToClose: P,
|
|
895
|
+
midAnchorPoint: V,
|
|
896
|
+
midAnchorPointPx: D,
|
|
897
|
+
disabled: q,
|
|
898
|
+
closeSidebarOnOverlayClick: G,
|
|
899
|
+
resetMetaOnClose: H
|
|
900
|
+
} = t, F = Je(() => {
|
|
882
901
|
const U = d ?? i.sidebarHeightPx;
|
|
883
902
|
return {
|
|
884
903
|
sidebarWidthPx: c ?? i.sidebarWidthPx,
|
|
@@ -886,25 +905,26 @@ const Ae = (e, t) => {
|
|
|
886
905
|
transitionMs: u ?? i.transitionMs,
|
|
887
906
|
edgeActivationWidthPx: T ?? i.edgeActivationWidthPx,
|
|
888
907
|
dragActivationDeltaPx: w ?? i.dragActivationDeltaPx,
|
|
889
|
-
showOverlay:
|
|
890
|
-
isAbsolute:
|
|
908
|
+
showOverlay: b ?? i.showOverlay,
|
|
909
|
+
isAbsolute: S ?? i.isAbsolute,
|
|
891
910
|
overlayBackgroundColor: I ?? i.overlayBackgroundColor,
|
|
892
|
-
toggleIconColor:
|
|
893
|
-
toggleIconSizePx:
|
|
894
|
-
toggleIconEdgeDistancePx:
|
|
895
|
-
showToggle:
|
|
896
|
-
mediaQueryWidth:
|
|
897
|
-
swipeBarZIndex:
|
|
898
|
-
toggleZIndex:
|
|
899
|
-
overlayZIndex:
|
|
900
|
-
fadeContent:
|
|
901
|
-
fadeContentTransitionMs:
|
|
902
|
-
swipeToOpen:
|
|
903
|
-
swipeToClose:
|
|
904
|
-
midAnchorPoint:
|
|
905
|
-
midAnchorPointPx:
|
|
906
|
-
disabled:
|
|
907
|
-
closeSidebarOnOverlayClick: G ?? i.closeSidebarOnOverlayClick
|
|
911
|
+
toggleIconColor: p ?? i.toggleIconColor,
|
|
912
|
+
toggleIconSizePx: M ?? i.toggleIconSizePx,
|
|
913
|
+
toggleIconEdgeDistancePx: _ ?? i.toggleIconEdgeDistancePx,
|
|
914
|
+
showToggle: C ?? i.showToggle,
|
|
915
|
+
mediaQueryWidth: Y ?? i.mediaQueryWidth,
|
|
916
|
+
swipeBarZIndex: j ?? i.swipeBarZIndex,
|
|
917
|
+
toggleZIndex: $ ?? i.toggleZIndex,
|
|
918
|
+
overlayZIndex: k ?? i.overlayZIndex,
|
|
919
|
+
fadeContent: v ?? i.fadeContent,
|
|
920
|
+
fadeContentTransitionMs: y ?? i.fadeContentTransitionMs,
|
|
921
|
+
swipeToOpen: O ?? i.swipeToOpen,
|
|
922
|
+
swipeToClose: P ?? i.swipeToClose,
|
|
923
|
+
midAnchorPoint: V ?? i.midAnchorPoint,
|
|
924
|
+
midAnchorPointPx: D ?? i.midAnchorPointPx ?? Math.floor(U / 3),
|
|
925
|
+
disabled: q ?? i.disabled,
|
|
926
|
+
closeSidebarOnOverlayClick: G ?? i.closeSidebarOnOverlayClick,
|
|
927
|
+
resetMetaOnClose: H ?? i.resetMetaOnClose
|
|
908
928
|
};
|
|
909
929
|
}, [
|
|
910
930
|
c,
|
|
@@ -912,54 +932,55 @@ const Ae = (e, t) => {
|
|
|
912
932
|
u,
|
|
913
933
|
T,
|
|
914
934
|
w,
|
|
915
|
-
|
|
916
|
-
|
|
935
|
+
b,
|
|
936
|
+
S,
|
|
917
937
|
I,
|
|
918
|
-
|
|
919
|
-
A,
|
|
920
|
-
C,
|
|
938
|
+
p,
|
|
921
939
|
M,
|
|
940
|
+
_,
|
|
941
|
+
C,
|
|
922
942
|
i,
|
|
923
|
-
W,
|
|
924
|
-
D,
|
|
925
|
-
j,
|
|
926
|
-
F,
|
|
927
|
-
m,
|
|
928
|
-
R,
|
|
929
|
-
S,
|
|
930
943
|
Y,
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
944
|
+
j,
|
|
945
|
+
$,
|
|
946
|
+
k,
|
|
947
|
+
v,
|
|
948
|
+
y,
|
|
949
|
+
O,
|
|
950
|
+
P,
|
|
951
|
+
V,
|
|
952
|
+
D,
|
|
953
|
+
q,
|
|
954
|
+
G,
|
|
955
|
+
H
|
|
935
956
|
]);
|
|
936
|
-
return
|
|
937
|
-
e === "left" ?
|
|
957
|
+
return z(() => {
|
|
958
|
+
e === "left" ? s(F) : e === "right" ? o(F) : e === "bottom" ? f(r ?? "primary", F) : Ee(e);
|
|
938
959
|
}, [
|
|
939
960
|
e,
|
|
940
961
|
r,
|
|
941
|
-
|
|
942
|
-
|
|
962
|
+
F,
|
|
963
|
+
s,
|
|
943
964
|
o,
|
|
944
965
|
f
|
|
945
|
-
]),
|
|
966
|
+
]), F;
|
|
946
967
|
};
|
|
947
|
-
function
|
|
968
|
+
function Ie({
|
|
948
969
|
isCollapsed: e,
|
|
949
970
|
setCollapsed: t,
|
|
950
971
|
closeSidebarOnClick: r = !0,
|
|
951
972
|
transitionMs: i,
|
|
952
|
-
overlayBackgroundColor:
|
|
973
|
+
overlayBackgroundColor: s,
|
|
953
974
|
overlayZIndex: o
|
|
954
975
|
}) {
|
|
955
|
-
return /* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ E.jsx(
|
|
956
977
|
"div",
|
|
957
978
|
{
|
|
958
979
|
style: {
|
|
959
980
|
transitionDuration: `${i}ms`,
|
|
960
|
-
...
|
|
961
|
-
...e ? {} :
|
|
962
|
-
...
|
|
981
|
+
...er,
|
|
982
|
+
...e ? {} : tr,
|
|
983
|
+
...s ? { backgroundColor: s } : {},
|
|
963
984
|
zIndex: o
|
|
964
985
|
},
|
|
965
986
|
onMouseDown: (f) => {
|
|
@@ -970,25 +991,25 @@ function Me({
|
|
|
970
991
|
}
|
|
971
992
|
function Ce({ size: e, color: t }) {
|
|
972
993
|
const r = L(null);
|
|
973
|
-
return
|
|
994
|
+
return z(() => {
|
|
974
995
|
const i = () => {
|
|
975
996
|
r.current && (r.current.style.opacity = "1");
|
|
976
|
-
},
|
|
977
|
-
r.current && (r.current.style.opacity = `${
|
|
997
|
+
}, s = () => {
|
|
998
|
+
r.current && (r.current.style.opacity = `${je}`);
|
|
978
999
|
};
|
|
979
|
-
r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave",
|
|
980
|
-
}, []), /* @__PURE__ */
|
|
1000
|
+
r.current && (r.current.addEventListener("mouseenter", i), r.current.addEventListener("mouseleave", s));
|
|
1001
|
+
}, []), /* @__PURE__ */ E.jsx(
|
|
981
1002
|
"div",
|
|
982
1003
|
{
|
|
983
1004
|
style: {
|
|
984
|
-
...
|
|
1005
|
+
...nr
|
|
985
1006
|
},
|
|
986
|
-
children: /* @__PURE__ */
|
|
1007
|
+
children: /* @__PURE__ */ E.jsxs(
|
|
987
1008
|
"svg",
|
|
988
1009
|
{
|
|
989
1010
|
style: {
|
|
990
|
-
transition: `opacity ${
|
|
991
|
-
opacity: `${
|
|
1011
|
+
transition: `opacity ${kt}ms ease`,
|
|
1012
|
+
opacity: `${je}`
|
|
992
1013
|
},
|
|
993
1014
|
ref: r,
|
|
994
1015
|
"aria-hidden": "true",
|
|
@@ -997,8 +1018,8 @@ function Ce({ size: e, color: t }) {
|
|
|
997
1018
|
xmlns: "http://www.w3.org/2000/svg",
|
|
998
1019
|
width: e,
|
|
999
1020
|
children: [
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
1021
|
+
/* @__PURE__ */ E.jsx("g", { strokeWidth: "0" }),
|
|
1022
|
+
/* @__PURE__ */ E.jsx("g", { strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ E.jsx("g", { children: /* @__PURE__ */ E.jsx(
|
|
1002
1023
|
"path",
|
|
1003
1024
|
{
|
|
1004
1025
|
clipRule: "evenodd",
|
|
@@ -1013,25 +1034,25 @@ function Ce({ size: e, color: t }) {
|
|
|
1013
1034
|
}
|
|
1014
1035
|
);
|
|
1015
1036
|
}
|
|
1016
|
-
function
|
|
1037
|
+
function ar({
|
|
1017
1038
|
id: e,
|
|
1018
1039
|
toggleRef: t,
|
|
1019
1040
|
options: r,
|
|
1020
1041
|
showToggle: i = !0,
|
|
1021
|
-
ToggleComponent:
|
|
1042
|
+
ToggleComponent: s
|
|
1022
1043
|
}) {
|
|
1023
1044
|
var u;
|
|
1024
|
-
const { openSidebar: o, closeSidebar: f, bottomSidebars: c } =
|
|
1025
|
-
return i ? /* @__PURE__ */
|
|
1045
|
+
const { openSidebar: o, closeSidebar: f, bottomSidebars: c } = ee(), d = ((u = c[e]) == null ? void 0 : u.isOpen) ?? !1;
|
|
1046
|
+
return i ? /* @__PURE__ */ E.jsx(
|
|
1026
1047
|
"div",
|
|
1027
1048
|
{
|
|
1028
1049
|
ref: t,
|
|
1029
1050
|
style: {
|
|
1030
|
-
...
|
|
1051
|
+
...rr,
|
|
1031
1052
|
transition: `transform ${r.transitionMs}ms ease, opacity ${r.transitionMs}ms ease`,
|
|
1032
1053
|
zIndex: r.toggleZIndex
|
|
1033
1054
|
},
|
|
1034
|
-
children: (!d || d && !r.showOverlay) && /* @__PURE__ */
|
|
1055
|
+
children: (!d || d && !r.showOverlay) && /* @__PURE__ */ E.jsx(
|
|
1035
1056
|
"button",
|
|
1036
1057
|
{
|
|
1037
1058
|
type: "button",
|
|
@@ -1044,27 +1065,27 @@ function ir({
|
|
|
1044
1065
|
// Rotate icon: -90deg points up when closed, 90deg points down when open
|
|
1045
1066
|
transform: d ? "rotate(90deg)" : "rotate(-90deg)"
|
|
1046
1067
|
},
|
|
1047
|
-
children:
|
|
1068
|
+
children: s ?? /* @__PURE__ */ E.jsx(Ce, { size: r.toggleIconSizePx, color: r.toggleIconColor })
|
|
1048
1069
|
}
|
|
1049
1070
|
)
|
|
1050
1071
|
}
|
|
1051
1072
|
) : null;
|
|
1052
1073
|
}
|
|
1053
1074
|
function fe(e = Te) {
|
|
1054
|
-
const t = `(max-width: ${Math.min(e, Te)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i,
|
|
1055
|
-
return
|
|
1075
|
+
const t = `(max-width: ${Math.min(e, Te)}px)`, r = () => typeof window > "u" || typeof window.matchMedia > "u" ? !1 : window.matchMedia(t).matches, [i, s] = Q(r);
|
|
1076
|
+
return z(() => {
|
|
1056
1077
|
if (typeof window > "u" || typeof window.matchMedia > "u")
|
|
1057
1078
|
return;
|
|
1058
|
-
const o = window.matchMedia(t), f = () =>
|
|
1079
|
+
const o = window.matchMedia(t), f = () => s(o.matches);
|
|
1059
1080
|
return f(), o.addEventListener("change", f), () => o.removeEventListener("change", f);
|
|
1060
1081
|
}, [t]), i;
|
|
1061
1082
|
}
|
|
1062
|
-
const
|
|
1083
|
+
const Ue = ({
|
|
1063
1084
|
refs: e,
|
|
1064
1085
|
callbacks: t,
|
|
1065
1086
|
currentY: r,
|
|
1066
1087
|
preventDefault: i,
|
|
1067
|
-
lockPane:
|
|
1088
|
+
lockPane: s,
|
|
1068
1089
|
options: o,
|
|
1069
1090
|
scrollableAncestor: f,
|
|
1070
1091
|
initialScrollTop: c
|
|
@@ -1077,13 +1098,13 @@ const Ge = ({
|
|
|
1077
1098
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1078
1099
|
return;
|
|
1079
1100
|
}
|
|
1080
|
-
const { scrollTop:
|
|
1081
|
-
if (d > 0 &&
|
|
1101
|
+
const { scrollTop: p, scrollHeight: M, clientHeight: _ } = f, C = p > 1, Y = p + _ < M - 1;
|
|
1102
|
+
if (d > 0 && C || d < 0 && Y) {
|
|
1082
1103
|
e.draggingRef.current = null, t.dragSidebar(null);
|
|
1083
1104
|
return;
|
|
1084
1105
|
}
|
|
1085
1106
|
}
|
|
1086
|
-
e.draggingRef.current.isActivated = !0,
|
|
1107
|
+
e.draggingRef.current.isActivated = !0, s();
|
|
1087
1108
|
}
|
|
1088
1109
|
if (!e.draggingRef.current.isActivated) return;
|
|
1089
1110
|
e.prevYRef.current = e.currentYRef.current, e.currentYRef.current = r;
|
|
@@ -1094,54 +1115,54 @@ const Ge = ({
|
|
|
1094
1115
|
return;
|
|
1095
1116
|
}
|
|
1096
1117
|
i();
|
|
1097
|
-
const
|
|
1118
|
+
const b = o.sidebarHeightPx, S = o.midAnchorPointPx, I = o.midAnchorPoint && !o.swipeToOpen && S < b;
|
|
1098
1119
|
if (u)
|
|
1099
1120
|
if (I) {
|
|
1100
|
-
const
|
|
1101
|
-
if (
|
|
1102
|
-
const
|
|
1121
|
+
const p = t.getBottomAnchorState();
|
|
1122
|
+
if (p === "open") {
|
|
1123
|
+
const M = Math.max(
|
|
1103
1124
|
0,
|
|
1104
|
-
Math.min(
|
|
1125
|
+
Math.min(b, d - o.dragActivationDeltaPx)
|
|
1105
1126
|
);
|
|
1106
|
-
t.dragSidebar(
|
|
1107
|
-
} else if (
|
|
1108
|
-
const
|
|
1127
|
+
t.dragSidebar(M);
|
|
1128
|
+
} else if (p === "midAnchor") {
|
|
1129
|
+
const M = b - S, _ = Math.max(
|
|
1109
1130
|
0,
|
|
1110
1131
|
Math.min(
|
|
1111
|
-
|
|
1112
|
-
|
|
1132
|
+
b,
|
|
1133
|
+
M + d - o.dragActivationDeltaPx
|
|
1113
1134
|
)
|
|
1114
1135
|
);
|
|
1115
|
-
t.dragSidebar(
|
|
1136
|
+
t.dragSidebar(_);
|
|
1116
1137
|
}
|
|
1117
1138
|
} else {
|
|
1118
|
-
const
|
|
1139
|
+
const p = Math.max(
|
|
1119
1140
|
0,
|
|
1120
|
-
Math.min(
|
|
1141
|
+
Math.min(b, d - o.dragActivationDeltaPx)
|
|
1121
1142
|
);
|
|
1122
|
-
t.dragSidebar(
|
|
1143
|
+
t.dragSidebar(p);
|
|
1123
1144
|
}
|
|
1124
1145
|
else if (e.draggingRef.current.startY >= T - o.edgeActivationWidthPx)
|
|
1125
1146
|
if (I) {
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1147
|
+
const p = b - S, M = Math.max(
|
|
1148
|
+
p,
|
|
1128
1149
|
Math.min(
|
|
1129
|
-
|
|
1130
|
-
|
|
1150
|
+
b,
|
|
1151
|
+
b + d + o.dragActivationDeltaPx
|
|
1131
1152
|
)
|
|
1132
1153
|
);
|
|
1133
|
-
t.dragSidebar(
|
|
1154
|
+
t.dragSidebar(M);
|
|
1134
1155
|
} else {
|
|
1135
|
-
const
|
|
1156
|
+
const p = Math.max(
|
|
1136
1157
|
0,
|
|
1137
1158
|
Math.min(
|
|
1138
|
-
|
|
1139
|
-
|
|
1159
|
+
b,
|
|
1160
|
+
b + d + o.dragActivationDeltaPx
|
|
1140
1161
|
)
|
|
1141
1162
|
);
|
|
1142
|
-
t.dragSidebar(
|
|
1163
|
+
t.dragSidebar(p);
|
|
1143
1164
|
}
|
|
1144
|
-
},
|
|
1165
|
+
}, Ze = ({
|
|
1145
1166
|
refs: e,
|
|
1146
1167
|
callbacks: t,
|
|
1147
1168
|
options: r,
|
|
@@ -1152,31 +1173,31 @@ const Ge = ({
|
|
|
1152
1173
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null;
|
|
1153
1174
|
return;
|
|
1154
1175
|
}
|
|
1155
|
-
const
|
|
1176
|
+
const s = e.currentYRef.current ?? e.draggingRef.current.startY, o = e.prevYRef.current ?? e.draggingRef.current.startY, f = e.draggingRef.current.startY, c = t.getIsOpen(), d = window.innerHeight;
|
|
1156
1177
|
e.draggingRef.current = null, e.currentYRef.current = null, e.prevYRef.current = null, i();
|
|
1157
|
-
const u =
|
|
1178
|
+
const u = s < o, T = s >= o, w = f >= d - r.edgeActivationWidthPx, b = r.midAnchorPointPx, S = r.sidebarHeightPx, I = r.midAnchorPoint && !r.swipeToOpen && b < S;
|
|
1158
1179
|
if (c)
|
|
1159
1180
|
if (I) {
|
|
1160
|
-
const
|
|
1161
|
-
if (
|
|
1162
|
-
const
|
|
1163
|
-
T ?
|
|
1164
|
-
} else if (
|
|
1165
|
-
const
|
|
1181
|
+
const p = t.getBottomAnchorState(), M = S - b;
|
|
1182
|
+
if (p === "open") {
|
|
1183
|
+
const _ = Math.max(0, s - f);
|
|
1184
|
+
T ? _ > M ? t.closeSidebar() : t.openToMidAnchor() : _ < M ? t.openSidebarFully() : t.closeSidebar(), t.dragSidebar(null);
|
|
1185
|
+
} else if (p === "midAnchor") {
|
|
1186
|
+
const _ = S - b, C = Math.max(
|
|
1166
1187
|
0,
|
|
1167
|
-
Math.min(
|
|
1188
|
+
Math.min(S, _ + (s - f))
|
|
1168
1189
|
);
|
|
1169
|
-
u ?
|
|
1190
|
+
u ? C < M ? t.openSidebarFully() : t.openToMidAnchor() : t.closeSidebar(), t.dragSidebar(null);
|
|
1170
1191
|
}
|
|
1171
1192
|
} else
|
|
1172
1193
|
T ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null);
|
|
1173
1194
|
else w && u ? (I ? t.openToMidAnchor() : t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1174
1195
|
};
|
|
1175
|
-
function
|
|
1176
|
-
var
|
|
1196
|
+
function sr(e, t) {
|
|
1197
|
+
var k, v;
|
|
1177
1198
|
const r = fe(e.mediaQueryWidth), {
|
|
1178
1199
|
lockedSidebar: i,
|
|
1179
|
-
setLockedSidebar:
|
|
1200
|
+
setLockedSidebar: s,
|
|
1180
1201
|
bottomSidebars: o,
|
|
1181
1202
|
openSidebar: f,
|
|
1182
1203
|
openSidebarFully: c,
|
|
@@ -1184,166 +1205,166 @@ function or(e, t) {
|
|
|
1184
1205
|
dragSidebar: u,
|
|
1185
1206
|
openSidebarToMidAnchor: T,
|
|
1186
1207
|
activeBottomDragIdRef: w,
|
|
1187
|
-
bottomFocusStackRef:
|
|
1188
|
-
} =
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}, [I]),
|
|
1208
|
+
bottomFocusStackRef: b
|
|
1209
|
+
} = ee(), S = ((k = o[t]) == null ? void 0 : k.isOpen) ?? !1, I = ((v = o[t]) == null ? void 0 : v.anchorState) ?? "closed", p = L(null), M = L(null), _ = L(null), C = L(null), Y = L(0), j = L(null), $ = L(I);
|
|
1210
|
+
z(() => {
|
|
1211
|
+
$.current = I;
|
|
1212
|
+
}, [I]), z(() => {
|
|
1192
1213
|
if (!r || i && i !== "bottom" || e.disabled) return;
|
|
1193
|
-
const
|
|
1194
|
-
getIsOpen: () =>
|
|
1214
|
+
const y = {
|
|
1215
|
+
getIsOpen: () => S,
|
|
1195
1216
|
openSidebar: () => f("bottom", { id: t }),
|
|
1196
1217
|
openSidebarFully: () => c("bottom", { id: t }),
|
|
1197
1218
|
closeSidebar: () => d("bottom", { id: t }),
|
|
1198
1219
|
dragSidebar: (n) => u("bottom", n, { id: t }),
|
|
1199
|
-
getBottomAnchorState: () =>
|
|
1220
|
+
getBottomAnchorState: () => $.current,
|
|
1200
1221
|
openToMidAnchor: () => T("bottom", { id: t })
|
|
1201
|
-
},
|
|
1202
|
-
draggingRef:
|
|
1203
|
-
currentYRef:
|
|
1204
|
-
prevYRef:
|
|
1205
|
-
},
|
|
1206
|
-
const n =
|
|
1222
|
+
}, O = {
|
|
1223
|
+
draggingRef: p,
|
|
1224
|
+
currentYRef: M,
|
|
1225
|
+
prevYRef: _
|
|
1226
|
+
}, P = () => w.current !== null && w.current !== t, V = () => {
|
|
1227
|
+
const n = b.current;
|
|
1207
1228
|
return n.length === 0 ? !0 : n[n.length - 1] === t;
|
|
1208
|
-
},
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1229
|
+
}, D = () => {
|
|
1230
|
+
if (P()) {
|
|
1231
|
+
p.current = null;
|
|
1211
1232
|
return;
|
|
1212
1233
|
}
|
|
1213
|
-
w.current = t,
|
|
1214
|
-
const n =
|
|
1215
|
-
n && (
|
|
1216
|
-
},
|
|
1234
|
+
w.current = t, s("bottom");
|
|
1235
|
+
const n = C.current;
|
|
1236
|
+
n && (j.current = n.style.overflowY, n.style.overflowY = "hidden");
|
|
1237
|
+
}, q = () => {
|
|
1217
1238
|
w.current === t && (w.current = null);
|
|
1218
|
-
const n =
|
|
1219
|
-
n &&
|
|
1239
|
+
const n = C.current;
|
|
1240
|
+
n && j.current !== null && (n.style.overflowY = j.current, j.current = null);
|
|
1220
1241
|
};
|
|
1221
1242
|
function G(n) {
|
|
1222
|
-
var
|
|
1223
|
-
if (i && i !== "bottom" ||
|
|
1224
|
-
const h = n.changedTouches[0],
|
|
1225
|
-
|
|
1226
|
-
refs:
|
|
1243
|
+
var N;
|
|
1244
|
+
if (i && i !== "bottom" || P() || !V() || de(n.target) || n.changedTouches.length === 0) return;
|
|
1245
|
+
const h = n.changedTouches[0], R = window.innerHeight, x = y.getIsOpen(), Z = h.clientY >= R - e.edgeActivationWidthPx;
|
|
1246
|
+
x && !e.swipeToClose || !x && !e.swipeToOpen || (x || Z) && (C.current = Ge(n.target), Y.current = ((N = C.current) == null ? void 0 : N.scrollTop) ?? 0, He({
|
|
1247
|
+
refs: O,
|
|
1227
1248
|
clientX: h.clientX,
|
|
1228
1249
|
clientY: h.clientY,
|
|
1229
1250
|
touchId: h.identifier,
|
|
1230
1251
|
isMouse: !1
|
|
1231
1252
|
}));
|
|
1232
1253
|
}
|
|
1233
|
-
function
|
|
1254
|
+
function H(n) {
|
|
1234
1255
|
if (i && i !== "bottom") return;
|
|
1235
|
-
if (
|
|
1236
|
-
|
|
1256
|
+
if (P()) {
|
|
1257
|
+
p.current = null;
|
|
1237
1258
|
return;
|
|
1238
1259
|
}
|
|
1239
|
-
if (!
|
|
1240
|
-
const h =
|
|
1241
|
-
|
|
1242
|
-
refs:
|
|
1243
|
-
callbacks:
|
|
1244
|
-
currentY:
|
|
1260
|
+
if (!p.current || p.current.isMouse) return;
|
|
1261
|
+
const h = p.current.activeTouchId, R = Ae(n.changedTouches, h);
|
|
1262
|
+
R && Ue({
|
|
1263
|
+
refs: O,
|
|
1264
|
+
callbacks: y,
|
|
1265
|
+
currentY: R.clientY,
|
|
1245
1266
|
preventDefault: () => n.preventDefault(),
|
|
1246
|
-
lockPane:
|
|
1267
|
+
lockPane: D,
|
|
1247
1268
|
options: e,
|
|
1248
|
-
scrollableAncestor:
|
|
1249
|
-
initialScrollTop:
|
|
1269
|
+
scrollableAncestor: C.current,
|
|
1270
|
+
initialScrollTop: Y.current
|
|
1250
1271
|
});
|
|
1251
1272
|
}
|
|
1252
|
-
function
|
|
1253
|
-
if (i && i !== "bottom" || !
|
|
1254
|
-
const h =
|
|
1255
|
-
Pe(n.changedTouches, h) &&
|
|
1256
|
-
refs:
|
|
1257
|
-
callbacks:
|
|
1273
|
+
function F(n) {
|
|
1274
|
+
if (i && i !== "bottom" || !p.current || p.current.isMouse) return;
|
|
1275
|
+
const h = p.current.activeTouchId;
|
|
1276
|
+
Pe(n.changedTouches, h) && Ze({
|
|
1277
|
+
refs: O,
|
|
1278
|
+
callbacks: y,
|
|
1258
1279
|
options: e,
|
|
1259
|
-
onDragEnd:
|
|
1280
|
+
onDragEnd: q
|
|
1260
1281
|
});
|
|
1261
1282
|
}
|
|
1262
|
-
function
|
|
1263
|
-
i && i !== "bottom" || !
|
|
1264
|
-
refs:
|
|
1265
|
-
dragSidebar:
|
|
1283
|
+
function U() {
|
|
1284
|
+
i && i !== "bottom" || !p.current || p.current.isMouse || (q(), or({
|
|
1285
|
+
refs: O,
|
|
1286
|
+
dragSidebar: y.dragSidebar,
|
|
1266
1287
|
onDeactivate: () => {
|
|
1267
1288
|
}
|
|
1268
1289
|
}));
|
|
1269
1290
|
}
|
|
1270
|
-
function
|
|
1271
|
-
var
|
|
1272
|
-
if (i && i !== "bottom" ||
|
|
1273
|
-
const h = window.innerHeight,
|
|
1274
|
-
|
|
1275
|
-
refs:
|
|
1291
|
+
function oe(n) {
|
|
1292
|
+
var Z;
|
|
1293
|
+
if (i && i !== "bottom" || P() || !V() || de(n.target) || n.button !== 0) return;
|
|
1294
|
+
const h = window.innerHeight, R = y.getIsOpen(), x = n.clientY >= h - e.edgeActivationWidthPx;
|
|
1295
|
+
R && !e.swipeToClose || !R && !e.swipeToOpen || (R || x) && (C.current = Ge(n.target), Y.current = ((Z = C.current) == null ? void 0 : Z.scrollTop) ?? 0, He({
|
|
1296
|
+
refs: O,
|
|
1276
1297
|
clientX: n.clientX,
|
|
1277
1298
|
clientY: n.clientY,
|
|
1278
1299
|
touchId: null,
|
|
1279
1300
|
isMouse: !0
|
|
1280
1301
|
}));
|
|
1281
1302
|
}
|
|
1282
|
-
function
|
|
1303
|
+
function ne(n) {
|
|
1283
1304
|
if (!(i && i !== "bottom")) {
|
|
1284
|
-
if (
|
|
1285
|
-
|
|
1305
|
+
if (P()) {
|
|
1306
|
+
p.current = null;
|
|
1286
1307
|
return;
|
|
1287
1308
|
}
|
|
1288
|
-
!
|
|
1289
|
-
refs:
|
|
1290
|
-
callbacks:
|
|
1309
|
+
!p.current || !p.current.isMouse || Ue({
|
|
1310
|
+
refs: O,
|
|
1311
|
+
callbacks: y,
|
|
1291
1312
|
currentY: n.clientY,
|
|
1292
1313
|
preventDefault: () => n.preventDefault(),
|
|
1293
|
-
lockPane:
|
|
1314
|
+
lockPane: D,
|
|
1294
1315
|
options: e,
|
|
1295
|
-
scrollableAncestor:
|
|
1296
|
-
initialScrollTop:
|
|
1316
|
+
scrollableAncestor: C.current,
|
|
1317
|
+
initialScrollTop: Y.current
|
|
1297
1318
|
});
|
|
1298
1319
|
}
|
|
1299
1320
|
}
|
|
1300
1321
|
function ae() {
|
|
1301
|
-
i && i !== "bottom" || !
|
|
1302
|
-
refs:
|
|
1303
|
-
callbacks:
|
|
1322
|
+
i && i !== "bottom" || !p.current || !p.current.isMouse || Ze({
|
|
1323
|
+
refs: O,
|
|
1324
|
+
callbacks: y,
|
|
1304
1325
|
options: e,
|
|
1305
|
-
onDragEnd:
|
|
1326
|
+
onDragEnd: q
|
|
1306
1327
|
});
|
|
1307
1328
|
}
|
|
1308
|
-
return window.addEventListener("touchstart", G, { passive: !0 }), window.addEventListener("touchmove",
|
|
1309
|
-
window.removeEventListener("touchstart", G), window.removeEventListener("touchmove",
|
|
1329
|
+
return window.addEventListener("touchstart", G, { passive: !0 }), window.addEventListener("touchmove", H, { passive: !1 }), window.addEventListener("touchend", F, { passive: !0 }), window.addEventListener("touchcancel", U, { passive: !0 }), window.addEventListener("mousedown", oe, { passive: !0 }), window.addEventListener("mousemove", ne, { passive: !1 }), window.addEventListener("mouseup", ae, { passive: !0 }), () => {
|
|
1330
|
+
window.removeEventListener("touchstart", G), window.removeEventListener("touchmove", H), window.removeEventListener("touchend", F), window.removeEventListener("touchcancel", U), window.removeEventListener("mousedown", oe), window.removeEventListener("mousemove", ne), window.removeEventListener("mouseup", ae);
|
|
1310
1331
|
};
|
|
1311
1332
|
}, [
|
|
1312
1333
|
t,
|
|
1313
1334
|
r,
|
|
1314
|
-
|
|
1335
|
+
S,
|
|
1315
1336
|
f,
|
|
1316
1337
|
c,
|
|
1317
1338
|
d,
|
|
1318
1339
|
u,
|
|
1319
1340
|
i,
|
|
1320
|
-
|
|
1341
|
+
s,
|
|
1321
1342
|
e,
|
|
1322
1343
|
T,
|
|
1323
1344
|
w,
|
|
1324
|
-
|
|
1345
|
+
b
|
|
1325
1346
|
]);
|
|
1326
1347
|
}
|
|
1327
|
-
function
|
|
1348
|
+
function mr({
|
|
1328
1349
|
id: e = "primary",
|
|
1329
1350
|
className: t,
|
|
1330
1351
|
children: r,
|
|
1331
1352
|
ToggleComponent: i,
|
|
1332
|
-
...
|
|
1353
|
+
...s
|
|
1333
1354
|
}) {
|
|
1334
1355
|
var I;
|
|
1335
|
-
if ((r == null ? void 0 : r.type) ===
|
|
1356
|
+
if ((r == null ? void 0 : r.type) === E.Fragment)
|
|
1336
1357
|
throw new Error("Fragments is not allowed in SwipeBarBottom");
|
|
1337
|
-
const { bottomSidebars: o, closeSidebar: f, registerBottomSidebar: c, unregisterBottomSidebar: d } =
|
|
1338
|
-
|
|
1339
|
-
const w =
|
|
1340
|
-
|
|
1341
|
-
const
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
w.showOverlay && /* @__PURE__ */
|
|
1344
|
-
|
|
1358
|
+
const { bottomSidebars: o, closeSidebar: f, registerBottomSidebar: c, unregisterBottomSidebar: d } = ee(), u = L(null), T = L(null);
|
|
1359
|
+
z(() => (c(e, { sidebarRef: u, toggleRef: T }), () => d(e)), [e, c, d]);
|
|
1360
|
+
const w = Me("bottom", s, e), b = fe(w.mediaQueryWidth);
|
|
1361
|
+
sr(w, e);
|
|
1362
|
+
const S = ((I = o[e]) == null ? void 0 : I.isOpen) ?? !1;
|
|
1363
|
+
return /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1364
|
+
w.showOverlay && /* @__PURE__ */ E.jsx(
|
|
1365
|
+
Ie,
|
|
1345
1366
|
{
|
|
1346
|
-
isCollapsed: !
|
|
1367
|
+
isCollapsed: !S,
|
|
1347
1368
|
setCollapsed: () => f("bottom", { id: e }),
|
|
1348
1369
|
closeSidebarOnClick: w.closeSidebarOnOverlayClick,
|
|
1349
1370
|
transitionMs: w.transitionMs,
|
|
@@ -1351,8 +1372,8 @@ function gr({
|
|
|
1351
1372
|
overlayZIndex: w.overlayZIndex
|
|
1352
1373
|
}
|
|
1353
1374
|
),
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
|
|
1375
|
+
/* @__PURE__ */ E.jsx(
|
|
1376
|
+
ar,
|
|
1356
1377
|
{
|
|
1357
1378
|
id: e,
|
|
1358
1379
|
toggleRef: T,
|
|
@@ -1361,14 +1382,14 @@ function gr({
|
|
|
1361
1382
|
ToggleComponent: i
|
|
1362
1383
|
}
|
|
1363
1384
|
),
|
|
1364
|
-
/* @__PURE__ */
|
|
1385
|
+
/* @__PURE__ */ E.jsx(
|
|
1365
1386
|
"div",
|
|
1366
1387
|
{
|
|
1367
1388
|
ref: u,
|
|
1368
1389
|
style: {
|
|
1369
|
-
...
|
|
1370
|
-
...
|
|
1371
|
-
...w.isAbsolute ||
|
|
1390
|
+
...Qt,
|
|
1391
|
+
...Jt,
|
|
1392
|
+
...w.isAbsolute || b ? Kt : {},
|
|
1372
1393
|
...t ? {} : { backgroundColor: Oe },
|
|
1373
1394
|
zIndex: w.swipeBarZIndex
|
|
1374
1395
|
},
|
|
@@ -1378,19 +1399,19 @@ function gr({
|
|
|
1378
1399
|
)
|
|
1379
1400
|
] });
|
|
1380
1401
|
}
|
|
1381
|
-
function
|
|
1382
|
-
const { openSidebar: i, leftToggleRef:
|
|
1383
|
-
return t ? /* @__PURE__ */
|
|
1402
|
+
function cr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1403
|
+
const { openSidebar: i, leftToggleRef: s, isLeftOpen: o, closeSidebar: f } = ee();
|
|
1404
|
+
return t ? /* @__PURE__ */ E.jsx(
|
|
1384
1405
|
"div",
|
|
1385
1406
|
{
|
|
1386
|
-
ref:
|
|
1407
|
+
ref: s,
|
|
1387
1408
|
style: {
|
|
1388
|
-
...
|
|
1409
|
+
...rt,
|
|
1389
1410
|
transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
|
|
1390
1411
|
left: 0,
|
|
1391
1412
|
zIndex: e.toggleZIndex
|
|
1392
1413
|
},
|
|
1393
|
-
children: (!o || o && !e.showOverlay) && /* @__PURE__ */
|
|
1414
|
+
children: (!o || o && !e.showOverlay) && /* @__PURE__ */ E.jsx(
|
|
1394
1415
|
"button",
|
|
1395
1416
|
{
|
|
1396
1417
|
type: "button",
|
|
@@ -1402,23 +1423,23 @@ function ar({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1402
1423
|
marginLeft: `${e.toggleIconEdgeDistancePx}px`,
|
|
1403
1424
|
...o ? { transform: "rotate(180deg)" } : {}
|
|
1404
1425
|
},
|
|
1405
|
-
children: r ?? /* @__PURE__ */
|
|
1426
|
+
children: r ?? /* @__PURE__ */ E.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1406
1427
|
}
|
|
1407
1428
|
)
|
|
1408
1429
|
}
|
|
1409
1430
|
) : null;
|
|
1410
1431
|
}
|
|
1411
|
-
const
|
|
1432
|
+
const ze = ({
|
|
1412
1433
|
refs: e,
|
|
1413
1434
|
callbacks: t,
|
|
1414
1435
|
currentX: r,
|
|
1415
1436
|
preventDefault: i,
|
|
1416
|
-
lockPane:
|
|
1437
|
+
lockPane: s,
|
|
1417
1438
|
options: o
|
|
1418
1439
|
}) => {
|
|
1419
1440
|
if (!e.draggingRef.current) return;
|
|
1420
1441
|
const f = r - e.draggingRef.current.startX;
|
|
1421
|
-
if (!e.draggingRef.current.isActivated && Math.abs(f) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0,
|
|
1442
|
+
if (!e.draggingRef.current.isActivated && Math.abs(f) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !e.draggingRef.current.isActivated) return;
|
|
1422
1443
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1423
1444
|
const c = t.getIsOpen();
|
|
1424
1445
|
let d = !1;
|
|
@@ -1444,112 +1465,112 @@ const Ze = ({
|
|
|
1444
1465
|
);
|
|
1445
1466
|
t.dragSidebar(T);
|
|
1446
1467
|
}
|
|
1447
|
-
},
|
|
1468
|
+
}, Ve = ({ refs: e, callbacks: t, options: r }) => {
|
|
1448
1469
|
if (!e.draggingRef.current) return;
|
|
1449
1470
|
if (!e.draggingRef.current.isActivated) {
|
|
1450
1471
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1451
1472
|
return;
|
|
1452
1473
|
}
|
|
1453
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX,
|
|
1474
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, f = t.getIsOpen();
|
|
1454
1475
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1455
|
-
const c = i >=
|
|
1476
|
+
const c = i >= s, d = i < s, u = o <= r.edgeActivationWidthPx;
|
|
1456
1477
|
f ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : u && c ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1457
1478
|
};
|
|
1458
|
-
function
|
|
1479
|
+
function lr(e) {
|
|
1459
1480
|
const t = fe(e.mediaQueryWidth), {
|
|
1460
1481
|
lockedSidebar: r,
|
|
1461
1482
|
setLockedSidebar: i,
|
|
1462
|
-
isLeftOpen:
|
|
1483
|
+
isLeftOpen: s,
|
|
1463
1484
|
openSidebar: o,
|
|
1464
1485
|
closeSidebar: f,
|
|
1465
1486
|
dragSidebar: c,
|
|
1466
1487
|
leftSidebarRef: d
|
|
1467
|
-
} =
|
|
1468
|
-
|
|
1488
|
+
} = ee(), u = L(null), T = L(null), w = L(null);
|
|
1489
|
+
z(() => {
|
|
1469
1490
|
if (!t || r && r !== "left" || e.disabled) return;
|
|
1470
|
-
const
|
|
1471
|
-
getIsOpen: () =>
|
|
1491
|
+
const b = {
|
|
1492
|
+
getIsOpen: () => s,
|
|
1472
1493
|
openSidebar: () => o("left"),
|
|
1473
1494
|
closeSidebar: () => f("left"),
|
|
1474
|
-
dragSidebar: (
|
|
1475
|
-
},
|
|
1495
|
+
dragSidebar: (v) => c("left", v)
|
|
1496
|
+
}, S = {
|
|
1476
1497
|
draggingRef: u,
|
|
1477
1498
|
currentXRef: T,
|
|
1478
1499
|
prevXRef: w
|
|
1479
|
-
}, I = () => i("left"),
|
|
1480
|
-
function
|
|
1481
|
-
if (r && r !== "left" || de(
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
refs:
|
|
1485
|
-
clientX:
|
|
1486
|
-
clientY:
|
|
1487
|
-
touchId:
|
|
1500
|
+
}, I = () => i("left"), p = () => i(null);
|
|
1501
|
+
function M(v) {
|
|
1502
|
+
if (r && r !== "left" || de(v.target) || v.changedTouches.length === 0) return;
|
|
1503
|
+
const y = v.changedTouches[0], O = b.getIsOpen(), P = y.clientX <= e.edgeActivationWidthPx;
|
|
1504
|
+
O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && Se({
|
|
1505
|
+
refs: S,
|
|
1506
|
+
clientX: y.clientX,
|
|
1507
|
+
clientY: y.clientY,
|
|
1508
|
+
touchId: y.identifier,
|
|
1488
1509
|
isMouse: !1
|
|
1489
1510
|
});
|
|
1490
1511
|
}
|
|
1491
|
-
function
|
|
1512
|
+
function _(v) {
|
|
1492
1513
|
if (r && r !== "left" || !u.current || u.current.isMouse) return;
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1495
|
-
refs:
|
|
1496
|
-
callbacks:
|
|
1497
|
-
currentX:
|
|
1498
|
-
preventDefault: () =>
|
|
1514
|
+
const y = u.current.activeTouchId, O = Ae(v.changedTouches, y);
|
|
1515
|
+
O && ze({
|
|
1516
|
+
refs: S,
|
|
1517
|
+
callbacks: b,
|
|
1518
|
+
currentX: O.clientX,
|
|
1519
|
+
preventDefault: () => v.preventDefault(),
|
|
1499
1520
|
lockPane: I,
|
|
1500
1521
|
options: e
|
|
1501
1522
|
});
|
|
1502
1523
|
}
|
|
1503
|
-
function
|
|
1524
|
+
function C(v) {
|
|
1504
1525
|
if (r && r !== "left" || !u.current || u.current.isMouse) return;
|
|
1505
|
-
const
|
|
1506
|
-
Pe(
|
|
1507
|
-
refs:
|
|
1508
|
-
callbacks:
|
|
1526
|
+
const y = u.current.activeTouchId;
|
|
1527
|
+
Pe(v.changedTouches, y) && Ve({
|
|
1528
|
+
refs: S,
|
|
1529
|
+
callbacks: b,
|
|
1509
1530
|
options: e
|
|
1510
1531
|
});
|
|
1511
1532
|
}
|
|
1512
|
-
function
|
|
1513
|
-
r && r !== "left" || !u.current || u.current.isMouse ||
|
|
1514
|
-
refs:
|
|
1515
|
-
dragSidebar:
|
|
1516
|
-
onDeactivate:
|
|
1533
|
+
function Y() {
|
|
1534
|
+
r && r !== "left" || !u.current || u.current.isMouse || nt({
|
|
1535
|
+
refs: S,
|
|
1536
|
+
dragSidebar: b.dragSidebar,
|
|
1537
|
+
onDeactivate: p
|
|
1517
1538
|
});
|
|
1518
1539
|
}
|
|
1519
|
-
function
|
|
1520
|
-
if (r && r !== "left" || de(
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
refs:
|
|
1524
|
-
clientX:
|
|
1525
|
-
clientY:
|
|
1540
|
+
function j(v) {
|
|
1541
|
+
if (r && r !== "left" || de(v.target) || v.button !== 0) return;
|
|
1542
|
+
const y = b.getIsOpen(), O = v.clientX <= e.edgeActivationWidthPx;
|
|
1543
|
+
y && !e.swipeToClose || !y && !e.swipeToOpen || (y || O) && Se({
|
|
1544
|
+
refs: S,
|
|
1545
|
+
clientX: v.clientX,
|
|
1546
|
+
clientY: v.clientY,
|
|
1526
1547
|
touchId: null,
|
|
1527
1548
|
isMouse: !0
|
|
1528
1549
|
});
|
|
1529
1550
|
}
|
|
1530
|
-
function
|
|
1531
|
-
r && r !== "left" || !u.current || !u.current.isMouse ||
|
|
1532
|
-
refs:
|
|
1533
|
-
callbacks:
|
|
1534
|
-
currentX:
|
|
1535
|
-
preventDefault: () =>
|
|
1551
|
+
function $(v) {
|
|
1552
|
+
r && r !== "left" || !u.current || !u.current.isMouse || ze({
|
|
1553
|
+
refs: S,
|
|
1554
|
+
callbacks: b,
|
|
1555
|
+
currentX: v.clientX,
|
|
1556
|
+
preventDefault: () => v.preventDefault(),
|
|
1536
1557
|
lockPane: I,
|
|
1537
1558
|
options: e
|
|
1538
1559
|
});
|
|
1539
1560
|
}
|
|
1540
|
-
function
|
|
1541
|
-
r && r !== "left" || !u.current || !u.current.isMouse ||
|
|
1542
|
-
refs:
|
|
1543
|
-
callbacks:
|
|
1561
|
+
function k() {
|
|
1562
|
+
r && r !== "left" || !u.current || !u.current.isMouse || Ve({
|
|
1563
|
+
refs: S,
|
|
1564
|
+
callbacks: b,
|
|
1544
1565
|
options: e
|
|
1545
1566
|
});
|
|
1546
1567
|
}
|
|
1547
|
-
return window.addEventListener("touchstart",
|
|
1548
|
-
window.removeEventListener("touchstart",
|
|
1568
|
+
return window.addEventListener("touchstart", M, { passive: !0 }), window.addEventListener("touchmove", _, { passive: !1 }), window.addEventListener("touchend", C, { passive: !0 }), window.addEventListener("touchcancel", Y, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", $, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
|
|
1569
|
+
window.removeEventListener("touchstart", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", C), window.removeEventListener("touchcancel", Y), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", $), window.removeEventListener("mouseup", k);
|
|
1549
1570
|
};
|
|
1550
1571
|
}, [
|
|
1551
1572
|
t,
|
|
1552
|
-
|
|
1573
|
+
s,
|
|
1553
1574
|
o,
|
|
1554
1575
|
f,
|
|
1555
1576
|
c,
|
|
@@ -1559,20 +1580,20 @@ function sr(e) {
|
|
|
1559
1580
|
e
|
|
1560
1581
|
]);
|
|
1561
1582
|
}
|
|
1562
|
-
function
|
|
1583
|
+
function vr({
|
|
1563
1584
|
className: e,
|
|
1564
1585
|
children: t,
|
|
1565
1586
|
ToggleComponent: r,
|
|
1566
1587
|
...i
|
|
1567
1588
|
}) {
|
|
1568
|
-
if ((t == null ? void 0 : t.type) ===
|
|
1589
|
+
if ((t == null ? void 0 : t.type) === E.Fragment)
|
|
1569
1590
|
throw new Error("Fragments is not allowed in SwipeBarLeft");
|
|
1570
|
-
const { isLeftOpen:
|
|
1571
|
-
return
|
|
1572
|
-
c.showOverlay && /* @__PURE__ */
|
|
1573
|
-
|
|
1591
|
+
const { isLeftOpen: s, closeSidebar: o, leftSidebarRef: f } = ee(), c = Me("left", i), d = fe(c.mediaQueryWidth);
|
|
1592
|
+
return lr(c), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1593
|
+
c.showOverlay && /* @__PURE__ */ E.jsx(
|
|
1594
|
+
Ie,
|
|
1574
1595
|
{
|
|
1575
|
-
isCollapsed: !
|
|
1596
|
+
isCollapsed: !s,
|
|
1576
1597
|
setCollapsed: () => o("left"),
|
|
1577
1598
|
closeSidebarOnClick: c.closeSidebarOnOverlayClick,
|
|
1578
1599
|
transitionMs: c.transitionMs,
|
|
@@ -1580,22 +1601,22 @@ function hr({
|
|
|
1580
1601
|
overlayZIndex: c.overlayZIndex
|
|
1581
1602
|
}
|
|
1582
1603
|
),
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
|
|
1604
|
+
/* @__PURE__ */ E.jsx(
|
|
1605
|
+
cr,
|
|
1585
1606
|
{
|
|
1586
1607
|
options: c,
|
|
1587
1608
|
showToggle: c.showToggle,
|
|
1588
1609
|
ToggleComponent: r
|
|
1589
1610
|
}
|
|
1590
1611
|
),
|
|
1591
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ E.jsx(
|
|
1592
1613
|
"div",
|
|
1593
1614
|
{
|
|
1594
1615
|
ref: f,
|
|
1595
1616
|
style: {
|
|
1596
|
-
...
|
|
1597
|
-
...
|
|
1598
|
-
...c.isAbsolute || d ?
|
|
1617
|
+
...tt,
|
|
1618
|
+
...Zt,
|
|
1619
|
+
...c.isAbsolute || d ? Vt : {},
|
|
1599
1620
|
...e ? {} : { backgroundColor: Oe },
|
|
1600
1621
|
zIndex: c.swipeBarZIndex
|
|
1601
1622
|
},
|
|
@@ -1605,21 +1626,21 @@ function hr({
|
|
|
1605
1626
|
)
|
|
1606
1627
|
] });
|
|
1607
1628
|
}
|
|
1608
|
-
function
|
|
1609
|
-
const { openSidebar: i, rightToggleRef:
|
|
1629
|
+
function ur({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
1630
|
+
const { openSidebar: i, rightToggleRef: s, isRightOpen: o, closeSidebar: f } = ee();
|
|
1610
1631
|
return t ? (
|
|
1611
1632
|
// 1px wide container
|
|
1612
|
-
/* @__PURE__ */
|
|
1633
|
+
/* @__PURE__ */ E.jsx(
|
|
1613
1634
|
"div",
|
|
1614
1635
|
{
|
|
1615
|
-
ref:
|
|
1636
|
+
ref: s,
|
|
1616
1637
|
style: {
|
|
1617
|
-
...
|
|
1638
|
+
...rt,
|
|
1618
1639
|
transition: `transform ${e.transitionMs}ms ease, opacity ${e.transitionMs}ms ease`,
|
|
1619
1640
|
right: 0,
|
|
1620
1641
|
zIndex: e.toggleZIndex
|
|
1621
1642
|
},
|
|
1622
|
-
children: (!o || o && !e.showOverlay) && /* @__PURE__ */
|
|
1643
|
+
children: (!o || o && !e.showOverlay) && /* @__PURE__ */ E.jsx(
|
|
1623
1644
|
"button",
|
|
1624
1645
|
{
|
|
1625
1646
|
type: "button",
|
|
@@ -1632,24 +1653,24 @@ function cr({ options: e, showToggle: t = !0, ToggleComponent: r }) {
|
|
|
1632
1653
|
// reverse because we are using the same icon for both left and right
|
|
1633
1654
|
...o ? {} : { transform: "rotate(180deg)" }
|
|
1634
1655
|
},
|
|
1635
|
-
children: r ?? /* @__PURE__ */
|
|
1656
|
+
children: r ?? /* @__PURE__ */ E.jsx(Ce, { size: e.toggleIconSizePx, color: e.toggleIconColor })
|
|
1636
1657
|
}
|
|
1637
1658
|
)
|
|
1638
1659
|
}
|
|
1639
1660
|
)
|
|
1640
1661
|
) : null;
|
|
1641
1662
|
}
|
|
1642
|
-
const
|
|
1663
|
+
const qe = ({
|
|
1643
1664
|
refs: e,
|
|
1644
1665
|
callbacks: t,
|
|
1645
1666
|
currentX: r,
|
|
1646
1667
|
preventDefault: i,
|
|
1647
|
-
lockPane:
|
|
1668
|
+
lockPane: s,
|
|
1648
1669
|
options: o
|
|
1649
1670
|
}) => {
|
|
1650
1671
|
if (!e.draggingRef.current) return;
|
|
1651
1672
|
const f = window.innerWidth, c = r - e.draggingRef.current.startX, d = e.draggingRef.current.startX >= f - o.edgeActivationWidthPx, u = e.draggingRef.current.isActivated;
|
|
1652
|
-
if (!u && Math.abs(c) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0,
|
|
1673
|
+
if (!u && Math.abs(c) >= o.dragActivationDeltaPx && (e.draggingRef.current.isActivated = !0, s()), !u) return;
|
|
1653
1674
|
e.prevXRef.current = e.currentXRef.current, e.currentXRef.current = r;
|
|
1654
1675
|
const T = t.getIsOpen();
|
|
1655
1676
|
let w = !1;
|
|
@@ -1658,129 +1679,129 @@ const Ve = ({
|
|
|
1658
1679
|
return;
|
|
1659
1680
|
}
|
|
1660
1681
|
i();
|
|
1661
|
-
const
|
|
1682
|
+
const b = o.sidebarWidthPx;
|
|
1662
1683
|
if (T) {
|
|
1663
|
-
const
|
|
1684
|
+
const S = Math.max(
|
|
1664
1685
|
0,
|
|
1665
|
-
Math.min(
|
|
1686
|
+
Math.min(b, c - o.dragActivationDeltaPx)
|
|
1666
1687
|
);
|
|
1667
|
-
t.dragSidebar(
|
|
1688
|
+
t.dragSidebar(S);
|
|
1668
1689
|
} else {
|
|
1669
|
-
const
|
|
1690
|
+
const S = Math.max(
|
|
1670
1691
|
0,
|
|
1671
1692
|
Math.min(
|
|
1672
|
-
|
|
1673
|
-
|
|
1693
|
+
b,
|
|
1694
|
+
b + c + o.dragActivationDeltaPx
|
|
1674
1695
|
)
|
|
1675
1696
|
);
|
|
1676
|
-
t.dragSidebar(
|
|
1697
|
+
t.dragSidebar(S);
|
|
1677
1698
|
}
|
|
1678
|
-
},
|
|
1699
|
+
}, Qe = ({ refs: e, callbacks: t, options: r }) => {
|
|
1679
1700
|
if (!e.draggingRef.current) return;
|
|
1680
1701
|
if (!e.draggingRef.current.isActivated) {
|
|
1681
1702
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1682
1703
|
return;
|
|
1683
1704
|
}
|
|
1684
|
-
const i = e.currentXRef.current ?? e.draggingRef.current.startX,
|
|
1705
|
+
const i = e.currentXRef.current ?? e.draggingRef.current.startX, s = e.prevXRef.current ?? e.draggingRef.current.startX, o = e.draggingRef.current.startX, f = t.getIsOpen(), c = window.innerWidth;
|
|
1685
1706
|
e.draggingRef.current = null, e.currentXRef.current = null, e.prevXRef.current = null;
|
|
1686
|
-
const d = i >
|
|
1707
|
+
const d = i > s, u = i < s, T = o >= c - r.edgeActivationWidthPx;
|
|
1687
1708
|
f ? (d ? t.closeSidebar() : t.openSidebar(), t.dragSidebar(null)) : T && u ? (t.openSidebar(), t.dragSidebar(null)) : (t.closeSidebar(), t.dragSidebar(null));
|
|
1688
1709
|
};
|
|
1689
|
-
function
|
|
1710
|
+
function dr(e) {
|
|
1690
1711
|
const t = fe(e.mediaQueryWidth), {
|
|
1691
1712
|
lockedSidebar: r,
|
|
1692
1713
|
setLockedSidebar: i,
|
|
1693
|
-
isRightOpen:
|
|
1714
|
+
isRightOpen: s,
|
|
1694
1715
|
openSidebar: o,
|
|
1695
1716
|
closeSidebar: f,
|
|
1696
1717
|
dragSidebar: c,
|
|
1697
1718
|
rightSidebarRef: d
|
|
1698
|
-
} =
|
|
1699
|
-
|
|
1719
|
+
} = ee(), u = L(null), T = L(null), w = L(null);
|
|
1720
|
+
z(() => {
|
|
1700
1721
|
if (!t || r && r !== "right" || e.disabled) return;
|
|
1701
|
-
const
|
|
1702
|
-
getIsOpen: () =>
|
|
1722
|
+
const b = {
|
|
1723
|
+
getIsOpen: () => s,
|
|
1703
1724
|
openSidebar: () => o("right"),
|
|
1704
1725
|
closeSidebar: () => f("right"),
|
|
1705
|
-
dragSidebar: (
|
|
1706
|
-
},
|
|
1726
|
+
dragSidebar: (v) => c("right", v)
|
|
1727
|
+
}, S = {
|
|
1707
1728
|
draggingRef: u,
|
|
1708
1729
|
currentXRef: T,
|
|
1709
1730
|
prevXRef: w
|
|
1710
|
-
}, I = () => i("right"),
|
|
1711
|
-
function
|
|
1712
|
-
if (r && r !== "right" || de(
|
|
1713
|
-
const
|
|
1714
|
-
|
|
1715
|
-
refs:
|
|
1716
|
-
clientX:
|
|
1717
|
-
clientY:
|
|
1718
|
-
touchId:
|
|
1731
|
+
}, I = () => i("right"), p = () => i(null);
|
|
1732
|
+
function M(v) {
|
|
1733
|
+
if (r && r !== "right" || de(v.target) || v.changedTouches.length === 0) return;
|
|
1734
|
+
const y = v.changedTouches[0], O = window.innerWidth, P = b.getIsOpen(), V = y.clientX >= O - e.edgeActivationWidthPx;
|
|
1735
|
+
P && !e.swipeToClose || !P && !e.swipeToOpen || (P || V) && Se({
|
|
1736
|
+
refs: S,
|
|
1737
|
+
clientX: y.clientX,
|
|
1738
|
+
clientY: y.clientY,
|
|
1739
|
+
touchId: y.identifier,
|
|
1719
1740
|
isMouse: !1
|
|
1720
1741
|
});
|
|
1721
1742
|
}
|
|
1722
|
-
function
|
|
1743
|
+
function _(v) {
|
|
1723
1744
|
if (r && r !== "right" || !u.current || u.current.isMouse) return;
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1726
|
-
refs:
|
|
1727
|
-
callbacks:
|
|
1728
|
-
currentX:
|
|
1729
|
-
preventDefault: () =>
|
|
1745
|
+
const y = u.current.activeTouchId, O = Ae(v.changedTouches, y);
|
|
1746
|
+
O && qe({
|
|
1747
|
+
refs: S,
|
|
1748
|
+
callbacks: b,
|
|
1749
|
+
currentX: O.clientX,
|
|
1750
|
+
preventDefault: () => v.preventDefault(),
|
|
1730
1751
|
lockPane: I,
|
|
1731
1752
|
options: e
|
|
1732
1753
|
});
|
|
1733
1754
|
}
|
|
1734
|
-
function
|
|
1755
|
+
function C(v) {
|
|
1735
1756
|
if (r && r !== "right" || !u.current || u.current.isMouse) return;
|
|
1736
|
-
const
|
|
1737
|
-
Pe(
|
|
1738
|
-
refs:
|
|
1739
|
-
callbacks:
|
|
1757
|
+
const y = u.current.activeTouchId;
|
|
1758
|
+
Pe(v.changedTouches, y) && Qe({
|
|
1759
|
+
refs: S,
|
|
1760
|
+
callbacks: b,
|
|
1740
1761
|
options: e
|
|
1741
1762
|
});
|
|
1742
1763
|
}
|
|
1743
|
-
function
|
|
1744
|
-
r && r !== "right" || !u.current || u.current.isMouse ||
|
|
1745
|
-
refs:
|
|
1746
|
-
dragSidebar:
|
|
1747
|
-
onDeactivate:
|
|
1764
|
+
function Y() {
|
|
1765
|
+
r && r !== "right" || !u.current || u.current.isMouse || nt({
|
|
1766
|
+
refs: S,
|
|
1767
|
+
dragSidebar: b.dragSidebar,
|
|
1768
|
+
onDeactivate: p
|
|
1748
1769
|
});
|
|
1749
1770
|
}
|
|
1750
|
-
function
|
|
1751
|
-
if (r && r !== "right" || de(
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1754
|
-
refs:
|
|
1755
|
-
clientX:
|
|
1756
|
-
clientY:
|
|
1771
|
+
function j(v) {
|
|
1772
|
+
if (r && r !== "right" || de(v.target) || v.button !== 0) return;
|
|
1773
|
+
const y = window.innerWidth, O = b.getIsOpen(), P = v.clientX >= y - e.edgeActivationWidthPx;
|
|
1774
|
+
O && !e.swipeToClose || !O && !e.swipeToOpen || (O || P) && Se({
|
|
1775
|
+
refs: S,
|
|
1776
|
+
clientX: v.clientX,
|
|
1777
|
+
clientY: v.clientY,
|
|
1757
1778
|
touchId: null,
|
|
1758
1779
|
isMouse: !0
|
|
1759
1780
|
});
|
|
1760
1781
|
}
|
|
1761
|
-
function
|
|
1762
|
-
r && r !== "right" || !u.current || !u.current.isMouse ||
|
|
1763
|
-
refs:
|
|
1764
|
-
callbacks:
|
|
1765
|
-
currentX:
|
|
1766
|
-
preventDefault: () =>
|
|
1782
|
+
function $(v) {
|
|
1783
|
+
r && r !== "right" || !u.current || !u.current.isMouse || qe({
|
|
1784
|
+
refs: S,
|
|
1785
|
+
callbacks: b,
|
|
1786
|
+
currentX: v.clientX,
|
|
1787
|
+
preventDefault: () => v.preventDefault(),
|
|
1767
1788
|
lockPane: I,
|
|
1768
1789
|
options: e
|
|
1769
1790
|
});
|
|
1770
1791
|
}
|
|
1771
|
-
function
|
|
1772
|
-
r && r !== "right" || !u.current || !u.current.isMouse ||
|
|
1773
|
-
refs:
|
|
1774
|
-
callbacks:
|
|
1792
|
+
function k() {
|
|
1793
|
+
r && r !== "right" || !u.current || !u.current.isMouse || Qe({
|
|
1794
|
+
refs: S,
|
|
1795
|
+
callbacks: b,
|
|
1775
1796
|
options: e
|
|
1776
1797
|
});
|
|
1777
1798
|
}
|
|
1778
|
-
return window.addEventListener("touchstart",
|
|
1779
|
-
window.removeEventListener("touchstart",
|
|
1799
|
+
return window.addEventListener("touchstart", M, { passive: !0 }), window.addEventListener("touchmove", _, { passive: !1 }), window.addEventListener("touchend", C, { passive: !0 }), window.addEventListener("touchcancel", Y, { passive: !0 }), window.addEventListener("mousedown", j, { passive: !0 }), window.addEventListener("mousemove", $, { passive: !1 }), window.addEventListener("mouseup", k, { passive: !0 }), () => {
|
|
1800
|
+
window.removeEventListener("touchstart", M), window.removeEventListener("touchmove", _), window.removeEventListener("touchend", C), window.removeEventListener("touchcancel", Y), window.removeEventListener("mousedown", j), window.removeEventListener("mousemove", $), window.removeEventListener("mouseup", k);
|
|
1780
1801
|
};
|
|
1781
1802
|
}, [
|
|
1782
1803
|
t,
|
|
1783
|
-
|
|
1804
|
+
s,
|
|
1784
1805
|
o,
|
|
1785
1806
|
f,
|
|
1786
1807
|
c,
|
|
@@ -1790,20 +1811,20 @@ function lr(e) {
|
|
|
1790
1811
|
e
|
|
1791
1812
|
]);
|
|
1792
1813
|
}
|
|
1793
|
-
function
|
|
1814
|
+
function br({
|
|
1794
1815
|
className: e,
|
|
1795
1816
|
children: t,
|
|
1796
1817
|
ToggleComponent: r,
|
|
1797
1818
|
...i
|
|
1798
1819
|
}) {
|
|
1799
|
-
if ((t == null ? void 0 : t.type) ===
|
|
1820
|
+
if ((t == null ? void 0 : t.type) === E.Fragment)
|
|
1800
1821
|
throw new Error("Fragments is not allowed in SwipeBarRight");
|
|
1801
|
-
const { isRightOpen:
|
|
1802
|
-
return
|
|
1803
|
-
c.showOverlay && /* @__PURE__ */
|
|
1804
|
-
|
|
1822
|
+
const { isRightOpen: s, closeSidebar: o, rightSidebarRef: f } = ee(), c = Me("right", i), d = fe(c.mediaQueryWidth);
|
|
1823
|
+
return dr(c), /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1824
|
+
c.showOverlay && /* @__PURE__ */ E.jsx(
|
|
1825
|
+
Ie,
|
|
1805
1826
|
{
|
|
1806
|
-
isCollapsed: !
|
|
1827
|
+
isCollapsed: !s,
|
|
1807
1828
|
setCollapsed: () => o("right"),
|
|
1808
1829
|
closeSidebarOnClick: c.closeSidebarOnOverlayClick,
|
|
1809
1830
|
transitionMs: c.transitionMs,
|
|
@@ -1811,22 +1832,22 @@ function mr({
|
|
|
1811
1832
|
overlayZIndex: c.overlayZIndex
|
|
1812
1833
|
}
|
|
1813
1834
|
),
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
|
|
1835
|
+
/* @__PURE__ */ E.jsx(
|
|
1836
|
+
ur,
|
|
1816
1837
|
{
|
|
1817
1838
|
options: c,
|
|
1818
1839
|
showToggle: c.showToggle,
|
|
1819
1840
|
ToggleComponent: r
|
|
1820
1841
|
}
|
|
1821
1842
|
),
|
|
1822
|
-
/* @__PURE__ */
|
|
1843
|
+
/* @__PURE__ */ E.jsx(
|
|
1823
1844
|
"div",
|
|
1824
1845
|
{
|
|
1825
1846
|
ref: f,
|
|
1826
1847
|
style: {
|
|
1827
|
-
...
|
|
1828
|
-
...
|
|
1829
|
-
...c.isAbsolute || d ?
|
|
1848
|
+
...tt,
|
|
1849
|
+
...zt,
|
|
1850
|
+
...c.isAbsolute || d ? qt : {},
|
|
1830
1851
|
...e ? {} : { backgroundColor: Oe },
|
|
1831
1852
|
zIndex: c.swipeBarZIndex
|
|
1832
1853
|
},
|
|
@@ -1837,14 +1858,14 @@ function mr({
|
|
|
1837
1858
|
] });
|
|
1838
1859
|
}
|
|
1839
1860
|
export {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1861
|
+
Ie as Overlay,
|
|
1862
|
+
mr as SwipeBarBottom,
|
|
1863
|
+
vr as SwipeBarLeft,
|
|
1864
|
+
hr as SwipeBarProvider,
|
|
1865
|
+
br as SwipeBarRight,
|
|
1866
|
+
ar as ToggleBottom,
|
|
1867
|
+
cr as ToggleLeft,
|
|
1868
|
+
ur as ToggleRight,
|
|
1848
1869
|
fe as useMediaQuery,
|
|
1849
|
-
|
|
1870
|
+
ee as useSwipeBarContext
|
|
1850
1871
|
};
|