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