@cyca/react-timeline-editor 0.2.2-alpha.2 → 0.2.2-alpha.4
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.
|
@@ -1,23 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* @license React
|
|
10
|
-
* react-jsx-runtime.production.js
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
var le;
|
|
18
|
-
function sn() {
|
|
19
|
-
if (le) return It;
|
|
20
|
-
le = 1;
|
|
1
|
+
import * as Jt from "react";
|
|
2
|
+
import Zt, { useRef as Q, useEffect as Vt, useEffectEvent as Zn, useImperativeHandle as nn, useState as ne, useLayoutEffect as $e, useCallback as Qn } from "react";
|
|
3
|
+
import { flushSync as tr } from "react-dom";
|
|
4
|
+
var Le = { exports: {} }, Re = {};
|
|
5
|
+
var sn;
|
|
6
|
+
function er() {
|
|
7
|
+
if (sn) return Re;
|
|
8
|
+
sn = 1;
|
|
21
9
|
var n = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
22
10
|
function e(r, s, i) {
|
|
23
11
|
var o = null;
|
|
@@ -34,289 +22,283 @@ function sn() {
|
|
|
34
22
|
props: i
|
|
35
23
|
};
|
|
36
24
|
}
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
function on() {
|
|
51
|
-
return ue || (ue = 1, process.env.NODE_ENV !== "production" && function() {
|
|
52
|
-
function n(f) {
|
|
53
|
-
if (f == null) return null;
|
|
54
|
-
if (typeof f == "function")
|
|
55
|
-
return f.$$typeof === j ? null : f.displayName || f.name || null;
|
|
56
|
-
if (typeof f == "string") return f;
|
|
57
|
-
switch (f) {
|
|
58
|
-
case m:
|
|
25
|
+
return Re.Fragment = t, Re.jsx = e, Re.jsxs = e, Re;
|
|
26
|
+
}
|
|
27
|
+
var Te = {};
|
|
28
|
+
var on;
|
|
29
|
+
function nr() {
|
|
30
|
+
return on || (on = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
31
|
+
function n(u) {
|
|
32
|
+
if (u == null) return null;
|
|
33
|
+
if (typeof u == "function")
|
|
34
|
+
return u.$$typeof === X ? null : u.displayName || u.name || null;
|
|
35
|
+
if (typeof u == "string") return u;
|
|
36
|
+
switch (u) {
|
|
37
|
+
case b:
|
|
59
38
|
return "Fragment";
|
|
60
|
-
case v:
|
|
61
|
-
return "Profiler";
|
|
62
39
|
case h:
|
|
40
|
+
return "Profiler";
|
|
41
|
+
case w:
|
|
63
42
|
return "StrictMode";
|
|
64
|
-
case
|
|
43
|
+
case y:
|
|
65
44
|
return "Suspense";
|
|
66
|
-
case
|
|
45
|
+
case E:
|
|
67
46
|
return "SuspenseList";
|
|
68
|
-
case
|
|
47
|
+
case H:
|
|
69
48
|
return "Activity";
|
|
70
49
|
}
|
|
71
|
-
if (typeof
|
|
72
|
-
switch (typeof
|
|
50
|
+
if (typeof u == "object")
|
|
51
|
+
switch (typeof u.tag == "number" && console.error(
|
|
73
52
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
74
|
-
),
|
|
75
|
-
case
|
|
53
|
+
), u.$$typeof) {
|
|
54
|
+
case p:
|
|
76
55
|
return "Portal";
|
|
77
|
-
case
|
|
78
|
-
return
|
|
56
|
+
case O:
|
|
57
|
+
return u.displayName || "Context";
|
|
79
58
|
case x:
|
|
80
|
-
return (
|
|
81
|
-
case
|
|
82
|
-
var
|
|
83
|
-
return
|
|
84
|
-
case
|
|
85
|
-
return
|
|
86
|
-
case
|
|
87
|
-
|
|
59
|
+
return (u._context.displayName || "Context") + ".Consumer";
|
|
60
|
+
case _:
|
|
61
|
+
var T = u.render;
|
|
62
|
+
return u = u.displayName, u || (u = T.displayName || T.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
63
|
+
case P:
|
|
64
|
+
return T = u.displayName || null, T !== null ? T : n(u.type) || "Memo";
|
|
65
|
+
case C:
|
|
66
|
+
T = u._payload, u = u._init;
|
|
88
67
|
try {
|
|
89
|
-
return n(
|
|
68
|
+
return n(u(T));
|
|
90
69
|
} catch {
|
|
91
70
|
}
|
|
92
71
|
}
|
|
93
72
|
return null;
|
|
94
73
|
}
|
|
95
|
-
function t(
|
|
96
|
-
return "" +
|
|
74
|
+
function t(u) {
|
|
75
|
+
return "" + u;
|
|
97
76
|
}
|
|
98
|
-
function e(
|
|
77
|
+
function e(u) {
|
|
99
78
|
try {
|
|
100
|
-
t(
|
|
101
|
-
var
|
|
79
|
+
t(u);
|
|
80
|
+
var T = !1;
|
|
102
81
|
} catch {
|
|
103
|
-
|
|
82
|
+
T = !0;
|
|
104
83
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
return
|
|
109
|
-
|
|
84
|
+
if (T) {
|
|
85
|
+
T = console;
|
|
86
|
+
var I = T.error, V = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
87
|
+
return I.call(
|
|
88
|
+
T,
|
|
110
89
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
111
|
-
|
|
112
|
-
), t(
|
|
90
|
+
V
|
|
91
|
+
), t(u);
|
|
113
92
|
}
|
|
114
93
|
}
|
|
115
|
-
function r(
|
|
116
|
-
if (
|
|
117
|
-
if (typeof
|
|
94
|
+
function r(u) {
|
|
95
|
+
if (u === b) return "<>";
|
|
96
|
+
if (typeof u == "object" && u !== null && u.$$typeof === C)
|
|
118
97
|
return "<...>";
|
|
119
98
|
try {
|
|
120
|
-
var
|
|
121
|
-
return
|
|
99
|
+
var T = n(u);
|
|
100
|
+
return T ? "<" + T + ">" : "<...>";
|
|
122
101
|
} catch {
|
|
123
102
|
return "<...>";
|
|
124
103
|
}
|
|
125
104
|
}
|
|
126
105
|
function s() {
|
|
127
|
-
var
|
|
128
|
-
return
|
|
106
|
+
var u = z.A;
|
|
107
|
+
return u === null ? null : u.getOwner();
|
|
129
108
|
}
|
|
130
109
|
function i() {
|
|
131
110
|
return Error("react-stack-top-frame");
|
|
132
111
|
}
|
|
133
|
-
function o(
|
|
134
|
-
if (
|
|
135
|
-
var
|
|
136
|
-
if (
|
|
112
|
+
function o(u) {
|
|
113
|
+
if (F.call(u, "key")) {
|
|
114
|
+
var T = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
115
|
+
if (T && T.isReactWarning) return !1;
|
|
137
116
|
}
|
|
138
|
-
return
|
|
117
|
+
return u.key !== void 0;
|
|
139
118
|
}
|
|
140
|
-
function c(
|
|
141
|
-
function
|
|
142
|
-
|
|
119
|
+
function c(u, T) {
|
|
120
|
+
function I() {
|
|
121
|
+
R || (R = !0, console.error(
|
|
143
122
|
"%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)",
|
|
144
|
-
|
|
123
|
+
T
|
|
145
124
|
));
|
|
146
125
|
}
|
|
147
|
-
|
|
148
|
-
get:
|
|
126
|
+
I.isReactWarning = !0, Object.defineProperty(u, "key", {
|
|
127
|
+
get: I,
|
|
149
128
|
configurable: !0
|
|
150
129
|
});
|
|
151
130
|
}
|
|
152
|
-
function
|
|
153
|
-
var
|
|
154
|
-
return
|
|
131
|
+
function a() {
|
|
132
|
+
var u = n(this.type);
|
|
133
|
+
return M[u] || (M[u] = !0, console.error(
|
|
155
134
|
"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."
|
|
156
|
-
)),
|
|
135
|
+
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
157
136
|
}
|
|
158
|
-
function u
|
|
159
|
-
var
|
|
160
|
-
return
|
|
161
|
-
$$typeof:
|
|
162
|
-
type:
|
|
163
|
-
key:
|
|
164
|
-
props:
|
|
165
|
-
_owner:
|
|
166
|
-
}, (
|
|
137
|
+
function f(u, T, I, V, _t, vt) {
|
|
138
|
+
var D = I.ref;
|
|
139
|
+
return u = {
|
|
140
|
+
$$typeof: v,
|
|
141
|
+
type: u,
|
|
142
|
+
key: T,
|
|
143
|
+
props: I,
|
|
144
|
+
_owner: V
|
|
145
|
+
}, (D !== void 0 ? D : null) !== null ? Object.defineProperty(u, "ref", {
|
|
167
146
|
enumerable: !1,
|
|
168
|
-
get:
|
|
169
|
-
}) : Object.defineProperty(
|
|
147
|
+
get: a
|
|
148
|
+
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
170
149
|
configurable: !1,
|
|
171
150
|
enumerable: !1,
|
|
172
151
|
writable: !0,
|
|
173
152
|
value: 0
|
|
174
|
-
}), Object.defineProperty(
|
|
153
|
+
}), Object.defineProperty(u, "_debugInfo", {
|
|
175
154
|
configurable: !1,
|
|
176
155
|
enumerable: !1,
|
|
177
156
|
writable: !0,
|
|
178
157
|
value: null
|
|
179
|
-
}), Object.defineProperty(
|
|
158
|
+
}), Object.defineProperty(u, "_debugStack", {
|
|
180
159
|
configurable: !1,
|
|
181
160
|
enumerable: !1,
|
|
182
161
|
writable: !0,
|
|
183
|
-
value:
|
|
184
|
-
}), Object.defineProperty(
|
|
162
|
+
value: _t
|
|
163
|
+
}), Object.defineProperty(u, "_debugTask", {
|
|
185
164
|
configurable: !1,
|
|
186
165
|
enumerable: !1,
|
|
187
166
|
writable: !0,
|
|
188
|
-
value:
|
|
189
|
-
}), Object.freeze && (Object.freeze(
|
|
167
|
+
value: vt
|
|
168
|
+
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
190
169
|
}
|
|
191
|
-
function
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
if (
|
|
196
|
-
for (
|
|
197
|
-
|
|
198
|
-
Object.freeze && Object.freeze(
|
|
170
|
+
function l(u, T, I, V, _t, vt) {
|
|
171
|
+
var D = T.children;
|
|
172
|
+
if (D !== void 0)
|
|
173
|
+
if (V)
|
|
174
|
+
if (q(D)) {
|
|
175
|
+
for (V = 0; V < D.length; V++)
|
|
176
|
+
m(D[V]);
|
|
177
|
+
Object.freeze && Object.freeze(D);
|
|
199
178
|
} else
|
|
200
179
|
console.error(
|
|
201
180
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
202
181
|
);
|
|
203
|
-
else
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
var
|
|
207
|
-
return
|
|
182
|
+
else m(D);
|
|
183
|
+
if (F.call(T, "key")) {
|
|
184
|
+
D = n(u);
|
|
185
|
+
var rt = Object.keys(T).filter(function(k) {
|
|
186
|
+
return k !== "key";
|
|
208
187
|
});
|
|
209
|
-
|
|
188
|
+
V = 0 < rt.length ? "{key: someKey, " + rt.join(": ..., ") + ": ...}" : "{key: someKey}", gt[D + V] || (rt = 0 < rt.length ? "{" + rt.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
210
189
|
`A props object containing a "key" prop is being spread into JSX:
|
|
211
190
|
let props = %s;
|
|
212
191
|
<%s {...props} />
|
|
213
192
|
React keys must be passed directly to JSX without using spread:
|
|
214
193
|
let props = %s;
|
|
215
194
|
<%s key={someKey} {...props} />`,
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
),
|
|
195
|
+
V,
|
|
196
|
+
D,
|
|
197
|
+
rt,
|
|
198
|
+
D
|
|
199
|
+
), gt[D + V] = !0);
|
|
221
200
|
}
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
for (var
|
|
225
|
-
|
|
226
|
-
} else
|
|
227
|
-
return
|
|
228
|
-
|
|
229
|
-
typeof
|
|
230
|
-
),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
201
|
+
if (D = null, I !== void 0 && (e(I), D = "" + I), o(T) && (e(T.key), D = "" + T.key), "key" in T) {
|
|
202
|
+
I = {};
|
|
203
|
+
for (var $ in T)
|
|
204
|
+
$ !== "key" && (I[$] = T[$]);
|
|
205
|
+
} else I = T;
|
|
206
|
+
return D && c(
|
|
207
|
+
I,
|
|
208
|
+
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
209
|
+
), f(
|
|
210
|
+
u,
|
|
211
|
+
D,
|
|
212
|
+
I,
|
|
234
213
|
s(),
|
|
235
|
-
|
|
236
|
-
|
|
214
|
+
_t,
|
|
215
|
+
vt
|
|
237
216
|
);
|
|
238
217
|
}
|
|
239
|
-
function
|
|
240
|
-
|
|
218
|
+
function m(u) {
|
|
219
|
+
d(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === C && (u._payload.status === "fulfilled" ? d(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
|
|
241
220
|
}
|
|
242
|
-
function
|
|
243
|
-
return typeof
|
|
221
|
+
function d(u) {
|
|
222
|
+
return typeof u == "object" && u !== null && u.$$typeof === v;
|
|
244
223
|
}
|
|
245
|
-
var
|
|
224
|
+
var g = Zt, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), h = Symbol.for("react.profiler"), x = Symbol.for("react.consumer"), O = Symbol.for("react.context"), _ = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), z = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, F = Object.prototype.hasOwnProperty, q = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
246
225
|
return null;
|
|
247
226
|
};
|
|
248
|
-
|
|
249
|
-
react_stack_bottom_frame: function(
|
|
250
|
-
return
|
|
227
|
+
g = {
|
|
228
|
+
react_stack_bottom_frame: function(u) {
|
|
229
|
+
return u();
|
|
251
230
|
}
|
|
252
231
|
};
|
|
253
|
-
var
|
|
254
|
-
|
|
232
|
+
var R, M = {}, U = g.react_stack_bottom_frame.bind(
|
|
233
|
+
g,
|
|
255
234
|
i
|
|
256
|
-
)(),
|
|
257
|
-
|
|
258
|
-
var
|
|
259
|
-
return
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
235
|
+
)(), ft = S(r(i)), gt = {};
|
|
236
|
+
Te.Fragment = b, Te.jsx = function(u, T, I) {
|
|
237
|
+
var V = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
238
|
+
return l(
|
|
239
|
+
u,
|
|
240
|
+
T,
|
|
241
|
+
I,
|
|
263
242
|
!1,
|
|
264
|
-
|
|
265
|
-
|
|
243
|
+
V ? Error("react-stack-top-frame") : U,
|
|
244
|
+
V ? S(r(u)) : ft
|
|
266
245
|
);
|
|
267
|
-
},
|
|
268
|
-
var
|
|
269
|
-
return
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
246
|
+
}, Te.jsxs = function(u, T, I) {
|
|
247
|
+
var V = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
248
|
+
return l(
|
|
249
|
+
u,
|
|
250
|
+
T,
|
|
251
|
+
I,
|
|
273
252
|
!0,
|
|
274
|
-
|
|
275
|
-
|
|
253
|
+
V ? Error("react-stack-top-frame") : U,
|
|
254
|
+
V ? S(r(u)) : ft
|
|
276
255
|
);
|
|
277
256
|
};
|
|
278
|
-
}()),
|
|
257
|
+
})()), Te;
|
|
258
|
+
}
|
|
259
|
+
var cn;
|
|
260
|
+
function rr() {
|
|
261
|
+
return cn || (cn = 1, process.env.NODE_ENV === "production" ? Le.exports = er() : Le.exports = nr()), Le.exports;
|
|
279
262
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
const ne = "timeline-editor", cn = 0, $t = 1, Ie = 10, Bt = 160, Ht = 20, re = 1, se = 8, fe = 32, ie = 20, Pe = 5, Zt = {
|
|
263
|
+
var N = rr();
|
|
264
|
+
const Je = "timeline-editor", sr = 0, ze = 1, Mn = 10, Fe = 160, Ue = 20, Ze = 1, Qe = 8, an = 32, tn = 20, In = 5, Xe = {
|
|
283
265
|
trace: 0,
|
|
284
266
|
debug: 1,
|
|
285
267
|
info: 2,
|
|
286
268
|
warn: 3,
|
|
287
269
|
error: 4,
|
|
288
270
|
silent: 5
|
|
289
|
-
},
|
|
271
|
+
}, ir = [
|
|
290
272
|
"trace",
|
|
291
273
|
"debug",
|
|
292
274
|
"info",
|
|
293
275
|
"warn",
|
|
294
276
|
"error"
|
|
295
277
|
];
|
|
296
|
-
var
|
|
278
|
+
var or = class Pn {
|
|
279
|
+
s;
|
|
280
|
+
ls = /* @__PURE__ */ new Map();
|
|
281
|
+
lvl;
|
|
282
|
+
def;
|
|
283
|
+
n;
|
|
284
|
+
r;
|
|
285
|
+
c = console;
|
|
286
|
+
e;
|
|
287
|
+
trace;
|
|
288
|
+
debug;
|
|
289
|
+
info;
|
|
290
|
+
warn;
|
|
291
|
+
error;
|
|
297
292
|
constructor(t, e, r, s) {
|
|
298
|
-
ot(this, "s");
|
|
299
|
-
ot(this, "ls", /* @__PURE__ */ new Map());
|
|
300
|
-
ot(this, "lvl");
|
|
301
|
-
ot(this, "def");
|
|
302
|
-
ot(this, "n");
|
|
303
|
-
ot(this, "r");
|
|
304
|
-
ot(this, "c", console);
|
|
305
|
-
ot(this, "e");
|
|
306
|
-
ot(this, "trace");
|
|
307
|
-
ot(this, "debug");
|
|
308
|
-
ot(this, "info");
|
|
309
|
-
ot(this, "warn");
|
|
310
|
-
ot(this, "error");
|
|
311
|
-
ot(this, "noop", () => {
|
|
312
|
-
});
|
|
313
293
|
this.s = t, this.e = e, this.n = r, this.r = s, this.bindMethods();
|
|
314
294
|
}
|
|
295
|
+
noop = () => {
|
|
296
|
+
};
|
|
315
297
|
bindMethods() {
|
|
316
|
-
|
|
298
|
+
ir.forEach((t) => {
|
|
317
299
|
const e = this.e.bind(this.c, t, this.n);
|
|
318
300
|
Object.defineProperty(this, t, {
|
|
319
|
-
get: () =>
|
|
301
|
+
get: () => Xe[t] >= Xe[this.currentLevel()] ? e : this.noop,
|
|
320
302
|
configurable: !0
|
|
321
303
|
});
|
|
322
304
|
});
|
|
@@ -327,7 +309,7 @@ var ln = class ke {
|
|
|
327
309
|
currentLevel() {
|
|
328
310
|
if (this.lvl) return this.lvl;
|
|
329
311
|
const t = this.s.get(this.storageKey());
|
|
330
|
-
return t && t in
|
|
312
|
+
return t && t in Xe ? (this.lvl = t, this.lvl) : this.def ? this.def : this.r ? this.r.currentLevel() : "trace";
|
|
331
313
|
}
|
|
332
314
|
setLevel(t) {
|
|
333
315
|
return this.lvl = t, this.s.set(this.storageKey(), t), this;
|
|
@@ -341,8 +323,8 @@ var ln = class ke {
|
|
|
341
323
|
getLogger(t) {
|
|
342
324
|
if (!t) throw new Error("Logger name required");
|
|
343
325
|
if (!this.ls.has(t)) {
|
|
344
|
-
const e = new
|
|
345
|
-
this.ls.set(t,
|
|
326
|
+
const e = new Pn(this.s, this.e, t, this.r || this);
|
|
327
|
+
this.ls.set(t, kn(e));
|
|
346
328
|
}
|
|
347
329
|
return this.ls.get(t);
|
|
348
330
|
}
|
|
@@ -356,14 +338,14 @@ var ln = class ke {
|
|
|
356
338
|
this.c = t, this.bindMethods();
|
|
357
339
|
}
|
|
358
340
|
};
|
|
359
|
-
function
|
|
341
|
+
function kn(n) {
|
|
360
342
|
return new Proxy(n, { get(t, e, r) {
|
|
361
343
|
if (e in t) return Reflect.get(t, e, r);
|
|
362
344
|
const s = t.c[e];
|
|
363
345
|
return typeof s == "function" ? s.bind(t.c) : s;
|
|
364
346
|
} });
|
|
365
347
|
}
|
|
366
|
-
var
|
|
348
|
+
var cr = class {
|
|
367
349
|
get(n) {
|
|
368
350
|
return localStorage.getItem(n);
|
|
369
351
|
}
|
|
@@ -374,13 +356,13 @@ var un = class {
|
|
|
374
356
|
localStorage.removeItem(n);
|
|
375
357
|
}
|
|
376
358
|
};
|
|
377
|
-
const
|
|
359
|
+
const ar = {
|
|
378
360
|
trace: "#95bdb7",
|
|
379
361
|
debug: "#ad95b8",
|
|
380
362
|
info: "#b6bd73",
|
|
381
363
|
warn: "#88a1bb",
|
|
382
364
|
error: "#bf6c69"
|
|
383
|
-
},
|
|
365
|
+
}, ln = {
|
|
384
366
|
info: "⚡️",
|
|
385
367
|
success: "✔",
|
|
386
368
|
warn: "▲",
|
|
@@ -388,27 +370,29 @@ const fn = {
|
|
|
388
370
|
log: "●",
|
|
389
371
|
trace: "◔",
|
|
390
372
|
debug: "◌"
|
|
391
|
-
},
|
|
392
|
-
const r = e ? `${
|
|
393
|
-
return (n[t] || n.log).bind(n, `%c${r}%c`, `color: ${
|
|
394
|
-
} },
|
|
395
|
-
function
|
|
373
|
+
}, lr = { bind(n, t, e) {
|
|
374
|
+
const r = e ? `${ln[t]} ${String(e)}:` : `${ln[t]}`;
|
|
375
|
+
return (n[t] || n.log).bind(n, `%c${r}%c`, `color: ${ar[t]}; font-weight: bold;`, "color: inherit");
|
|
376
|
+
} }, qt = kn(new or(new cr(), lr));
|
|
377
|
+
function ur(n) {
|
|
396
378
|
let {
|
|
397
379
|
editorData: t = [],
|
|
398
380
|
effects: e = {},
|
|
399
381
|
scrollTop: r = 0,
|
|
400
|
-
scale: s =
|
|
401
|
-
scaleSplitCount: i =
|
|
402
|
-
scaleWidth: o =
|
|
403
|
-
startLeft: c =
|
|
404
|
-
minScaleCount:
|
|
405
|
-
maxScaleCount:
|
|
406
|
-
rowHeight:
|
|
382
|
+
scale: s = ze,
|
|
383
|
+
scaleSplitCount: i = Mn,
|
|
384
|
+
scaleWidth: o = Fe,
|
|
385
|
+
startLeft: c = Ue,
|
|
386
|
+
minScaleCount: a = tn,
|
|
387
|
+
maxScaleCount: f = 1 / 0,
|
|
388
|
+
rowHeight: l = an
|
|
407
389
|
} = n;
|
|
408
|
-
s <= 0 && (
|
|
409
|
-
const
|
|
410
|
-
|
|
411
|
-
|
|
390
|
+
s <= 0 && (qt.error("Error: scale must be greater than 0!"), s = ze), r < 0 && (qt.warn("Warning: scrollTop cannot be less than 0!"), r = 0), i <= 0 && (qt.warn("Warning: scaleSplitCount cannot be less than 1!"), i = 1), o <= 0 && (qt.warn("Warning: scaleWidth must be greater than 0!"), o = Fe), c < 0 && (qt.warn("Warning: startLeft cannot be less than 0!"), c = 0), a < 1 && (qt.warn("Warning: minScaleCount must be greater than 1!"), a = tn), a = parseInt(a + ""), f < a && (qt.warn("Warning: maxScaleCount cannot be less than minScaleCount!"), f = a), f = f === 1 / 0 ? 1 / 0 : parseInt(f + ""), l <= 0 && (qt.warn("Warning: rowHeight must be greater than 0!"), l = an);
|
|
391
|
+
const m = {
|
|
392
|
+
...n
|
|
393
|
+
};
|
|
394
|
+
return delete m.style, {
|
|
395
|
+
...m,
|
|
412
396
|
editorData: t,
|
|
413
397
|
effects: e,
|
|
414
398
|
scrollTop: r,
|
|
@@ -416,52 +400,101 @@ function hn(n) {
|
|
|
416
400
|
scaleSplitCount: i,
|
|
417
401
|
scaleWidth: o,
|
|
418
402
|
startLeft: c,
|
|
419
|
-
minScaleCount:
|
|
420
|
-
maxScaleCount:
|
|
421
|
-
rowHeight:
|
|
403
|
+
minScaleCount: a,
|
|
404
|
+
maxScaleCount: f,
|
|
405
|
+
rowHeight: l
|
|
422
406
|
};
|
|
423
407
|
}
|
|
424
|
-
function
|
|
425
|
-
const {
|
|
408
|
+
function $t(n, t) {
|
|
409
|
+
const {
|
|
410
|
+
startLeft: e,
|
|
411
|
+
scale: r,
|
|
412
|
+
scaleWidth: s
|
|
413
|
+
} = t;
|
|
426
414
|
return e + n / r * s;
|
|
427
415
|
}
|
|
428
|
-
function
|
|
429
|
-
const {
|
|
416
|
+
function re(n, t) {
|
|
417
|
+
const {
|
|
418
|
+
startLeft: e,
|
|
419
|
+
scale: r,
|
|
420
|
+
scaleWidth: s
|
|
421
|
+
} = t;
|
|
430
422
|
return (n - e) / s * r;
|
|
431
423
|
}
|
|
432
|
-
function
|
|
433
|
-
const {
|
|
424
|
+
function Ae(n, t) {
|
|
425
|
+
const {
|
|
426
|
+
left: e,
|
|
427
|
+
width: r
|
|
428
|
+
} = n, s = re(e, t), i = re(e + r, t);
|
|
434
429
|
return {
|
|
435
430
|
start: s,
|
|
436
431
|
end: i
|
|
437
432
|
};
|
|
438
433
|
}
|
|
439
|
-
function
|
|
440
|
-
const {
|
|
434
|
+
function Nn(n, t) {
|
|
435
|
+
const {
|
|
436
|
+
start: e,
|
|
437
|
+
end: r
|
|
438
|
+
} = n, s = $t(e, t), i = $t(r, t) - s;
|
|
441
439
|
return {
|
|
442
440
|
left: s,
|
|
443
441
|
width: i
|
|
444
442
|
};
|
|
445
443
|
}
|
|
446
|
-
function
|
|
444
|
+
function fr(n, t) {
|
|
447
445
|
let e = 0;
|
|
448
446
|
return n.forEach((s) => {
|
|
449
447
|
s.actions.forEach((i) => {
|
|
450
448
|
e = Math.max(e, i.end);
|
|
451
449
|
});
|
|
452
|
-
}), Math.ceil(e / t.scale) +
|
|
450
|
+
}), Math.ceil(e / t.scale) + In;
|
|
453
451
|
}
|
|
454
|
-
function
|
|
455
|
-
const {
|
|
456
|
-
|
|
452
|
+
function dr(n, t) {
|
|
453
|
+
const {
|
|
454
|
+
startLeft: e,
|
|
455
|
+
scaleWidth: r
|
|
456
|
+
} = t, s = Math.ceil((n - e) / r);
|
|
457
|
+
return Math.max(s + In, t.scaleCount);
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function hr(n, t) {
|
|
459
460
|
const e = [];
|
|
460
461
|
return n.forEach((r) => {
|
|
461
|
-
e.push(
|
|
462
|
+
e.push($t(r.start, t)), e.push($t(r.end, t));
|
|
462
463
|
}), e;
|
|
463
464
|
}
|
|
464
|
-
|
|
465
|
+
var Me = { exports: {} }, Ye = {};
|
|
466
|
+
var un;
|
|
467
|
+
function mr() {
|
|
468
|
+
if (un) return Ye;
|
|
469
|
+
un = 1;
|
|
470
|
+
var n = Zt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
471
|
+
return Ye.c = function(t) {
|
|
472
|
+
return n.H.useMemoCache(t);
|
|
473
|
+
}, Ye;
|
|
474
|
+
}
|
|
475
|
+
var Ge = {};
|
|
476
|
+
var fn;
|
|
477
|
+
function pr() {
|
|
478
|
+
return fn || (fn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
479
|
+
var n = Zt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
480
|
+
Ge.c = function(t) {
|
|
481
|
+
var e = n.H;
|
|
482
|
+
return e === null && console.error(
|
|
483
|
+
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
484
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
485
|
+
2. You might be breaking the Rules of Hooks
|
|
486
|
+
3. You might have more than one copy of React in the same app
|
|
487
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
488
|
+
), e.useMemoCache(t);
|
|
489
|
+
};
|
|
490
|
+
})()), Ge;
|
|
491
|
+
}
|
|
492
|
+
var dn;
|
|
493
|
+
function gr() {
|
|
494
|
+
return dn || (dn = 1, process.env.NODE_ENV === "production" ? Me.exports = mr() : Me.exports = pr()), Me.exports;
|
|
495
|
+
}
|
|
496
|
+
var Qt = gr();
|
|
497
|
+
function _r(n) {
|
|
465
498
|
for (var t = [], e = 1; e < arguments.length; e++)
|
|
466
499
|
t[e - 1] = arguments[e];
|
|
467
500
|
return t.map(function(r) {
|
|
@@ -470,54 +503,70 @@ function vn(n) {
|
|
|
470
503
|
}).join(" ");
|
|
471
504
|
}).join(" ");
|
|
472
505
|
}
|
|
473
|
-
function
|
|
474
|
-
return
|
|
475
|
-
}
|
|
476
|
-
const
|
|
477
|
-
function
|
|
478
|
-
const t =
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
if (u.clientX >= e.current || u.clientX <= t.current) {
|
|
488
|
-
s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
489
|
-
const g = Math.abs(u.clientX >= e.current ? u.clientX - e.current : u.clientX - t.current);
|
|
490
|
-
r.current = Math.min(Number((g / pe).toFixed(0)) * Wt, he);
|
|
491
|
-
const O = (u.clientX >= e.current ? 1 : -1) * r.current, S = () => {
|
|
492
|
-
a && a(O), s.current = requestAnimationFrame(S);
|
|
493
|
-
};
|
|
494
|
-
return s.current = requestAnimationFrame(S), !1;
|
|
495
|
-
} else
|
|
496
|
-
s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
497
|
-
return !0;
|
|
498
|
-
},
|
|
499
|
-
dealResizeAutoScroll: (u, a, g) => {
|
|
500
|
-
if (u.clientX >= e.current || u.clientX < t.current) {
|
|
501
|
-
s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
502
|
-
const p = Math.abs(u.clientX >= e.current ? u.clientX - e.current : u.clientX - t.current);
|
|
503
|
-
r.current = Math.min(Number((p / pe).toFixed(0)) * Wt, he);
|
|
504
|
-
const S = (u.clientX >= e.current ? 1 : -1) * r.current, y = () => {
|
|
505
|
-
g && g(S), s.current = requestAnimationFrame(y);
|
|
506
|
-
};
|
|
507
|
-
return s.current = requestAnimationFrame(y), !1;
|
|
508
|
-
} else
|
|
509
|
-
s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
510
|
-
return !0;
|
|
511
|
-
},
|
|
512
|
-
stopAutoScroll: () => {
|
|
513
|
-
t.current = Number.MIN_SAFE_INTEGER, e.current = Number.MAX_SAFE_INTEGER, r.current = Wt, s.current !== void 0 && cancelAnimationFrame(s.current);
|
|
506
|
+
function mt(...n) {
|
|
507
|
+
return _r(`${Je}-`, ...n);
|
|
508
|
+
}
|
|
509
|
+
const Ie = 1, hn = 3, mn = 10;
|
|
510
|
+
function vr(n) {
|
|
511
|
+
const t = Qt.c(7), e = Q(Number.MIN_SAFE_INTEGER), r = Q(Number.MAX_SAFE_INTEGER), s = Q(Ie), i = Q(void 0);
|
|
512
|
+
let o;
|
|
513
|
+
t[0] !== n ? (o = () => {
|
|
514
|
+
if (n?.current) {
|
|
515
|
+
const {
|
|
516
|
+
left: p,
|
|
517
|
+
width: b
|
|
518
|
+
} = n.current.getBoundingClientRect();
|
|
519
|
+
e.current = p, r.current = p + b;
|
|
514
520
|
}
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
|
|
521
|
+
}, t[0] = n, t[1] = o) : o = t[1];
|
|
522
|
+
const c = o;
|
|
523
|
+
let a;
|
|
524
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (p, b) => {
|
|
525
|
+
if (p.clientX >= r.current || p.clientX <= e.current) {
|
|
526
|
+
i.current !== void 0 && cancelAnimationFrame(i.current);
|
|
527
|
+
const w = Math.abs(p.clientX >= r.current ? p.clientX - r.current : p.clientX - e.current);
|
|
528
|
+
s.current = Math.min(Number((w / mn).toFixed(0)) * Ie, hn);
|
|
529
|
+
const x = (p.clientX >= r.current ? 1 : -1) * s.current, O = () => {
|
|
530
|
+
b && b(x), i.current = requestAnimationFrame(O);
|
|
531
|
+
};
|
|
532
|
+
return i.current = requestAnimationFrame(O), !1;
|
|
533
|
+
} else
|
|
534
|
+
i.current !== void 0 && cancelAnimationFrame(i.current);
|
|
535
|
+
return !0;
|
|
536
|
+
}, t[2] = a) : a = t[2];
|
|
537
|
+
const f = a;
|
|
538
|
+
let l;
|
|
539
|
+
t[3] === Symbol.for("react.memo_cache_sentinel") ? (l = (p, b, w) => {
|
|
540
|
+
if (p.clientX >= r.current || p.clientX < e.current) {
|
|
541
|
+
i.current !== void 0 && cancelAnimationFrame(i.current);
|
|
542
|
+
const h = Math.abs(p.clientX >= r.current ? p.clientX - r.current : p.clientX - e.current);
|
|
543
|
+
s.current = Math.min(Number((h / mn).toFixed(0)) * Ie, hn);
|
|
544
|
+
const O = (p.clientX >= r.current ? 1 : -1) * s.current, _ = () => {
|
|
545
|
+
w && w(O), i.current = requestAnimationFrame(_);
|
|
546
|
+
};
|
|
547
|
+
return i.current = requestAnimationFrame(_), !1;
|
|
548
|
+
} else
|
|
549
|
+
i.current !== void 0 && cancelAnimationFrame(i.current);
|
|
550
|
+
return !0;
|
|
551
|
+
}, t[3] = l) : l = t[3];
|
|
552
|
+
const m = l;
|
|
553
|
+
let d;
|
|
554
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (d = () => {
|
|
555
|
+
e.current = Number.MIN_SAFE_INTEGER, r.current = Number.MAX_SAFE_INTEGER, s.current = Ie, i.current !== void 0 && cancelAnimationFrame(i.current);
|
|
556
|
+
}, t[4] = d) : d = t[4];
|
|
557
|
+
const g = d;
|
|
558
|
+
let v;
|
|
559
|
+
return t[5] !== c ? (v = {
|
|
560
|
+
initAutoScroll: c,
|
|
561
|
+
dealDragAutoScroll: f,
|
|
562
|
+
dealResizeAutoScroll: m,
|
|
563
|
+
stopAutoScroll: g
|
|
564
|
+
}, t[5] = c, t[6] = v) : v = t[6], v;
|
|
565
|
+
}
|
|
566
|
+
function br(n, t, e) {
|
|
518
567
|
return Math.max(t, Math.min(n, e));
|
|
519
568
|
}
|
|
520
|
-
const
|
|
569
|
+
const pt = {
|
|
521
570
|
toVector(n, t) {
|
|
522
571
|
return n === void 0 && (n = t), Array.isArray(n) ? n : [n, n];
|
|
523
572
|
},
|
|
@@ -534,17 +583,17 @@ const rt = {
|
|
|
534
583
|
n[0] -= t[0], n[1] -= t[1];
|
|
535
584
|
}
|
|
536
585
|
};
|
|
537
|
-
function
|
|
586
|
+
function pn(n, t, e) {
|
|
538
587
|
return t === 0 || Math.abs(t) === 1 / 0 ? Math.pow(n, e * 5) : n * t * e / (t + e * n);
|
|
539
588
|
}
|
|
540
|
-
function
|
|
541
|
-
return r === 0 ?
|
|
589
|
+
function gn(n, t, e, r = 0.15) {
|
|
590
|
+
return r === 0 ? br(n, t, e) : n < t ? -pn(t - n, e - t, r) + t : n > e ? +pn(n - e, e - t, r) + e : n;
|
|
542
591
|
}
|
|
543
|
-
function
|
|
544
|
-
const [[i, o], [c,
|
|
545
|
-
return [
|
|
592
|
+
function yr(n, [t, e], [r, s]) {
|
|
593
|
+
const [[i, o], [c, a]] = n;
|
|
594
|
+
return [gn(t, i, o, r), gn(e, c, a, s)];
|
|
546
595
|
}
|
|
547
|
-
function
|
|
596
|
+
function wr(n, t) {
|
|
548
597
|
if (typeof n != "object" || n === null) return n;
|
|
549
598
|
var e = n[Symbol.toPrimitive];
|
|
550
599
|
if (e !== void 0) {
|
|
@@ -554,19 +603,19 @@ function En(n, t) {
|
|
|
554
603
|
}
|
|
555
604
|
return (t === "string" ? String : Number)(n);
|
|
556
605
|
}
|
|
557
|
-
function
|
|
558
|
-
var t =
|
|
606
|
+
function Er(n) {
|
|
607
|
+
var t = wr(n, "string");
|
|
559
608
|
return typeof t == "symbol" ? t : String(t);
|
|
560
609
|
}
|
|
561
|
-
function
|
|
562
|
-
return t =
|
|
610
|
+
function St(n, t, e) {
|
|
611
|
+
return t = Er(t), t in n ? Object.defineProperty(n, t, {
|
|
563
612
|
value: e,
|
|
564
613
|
enumerable: !0,
|
|
565
614
|
configurable: !0,
|
|
566
615
|
writable: !0
|
|
567
616
|
}) : n[t] = e, n;
|
|
568
617
|
}
|
|
569
|
-
function
|
|
618
|
+
function _n(n, t) {
|
|
570
619
|
var e = Object.keys(n);
|
|
571
620
|
if (Object.getOwnPropertySymbols) {
|
|
572
621
|
var r = Object.getOwnPropertySymbols(n);
|
|
@@ -576,18 +625,18 @@ function ve(n, t) {
|
|
|
576
625
|
}
|
|
577
626
|
return e;
|
|
578
627
|
}
|
|
579
|
-
function
|
|
628
|
+
function nt(n) {
|
|
580
629
|
for (var t = 1; t < arguments.length; t++) {
|
|
581
630
|
var e = arguments[t] != null ? arguments[t] : {};
|
|
582
|
-
t % 2 ?
|
|
583
|
-
|
|
584
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) :
|
|
631
|
+
t % 2 ? _n(Object(e), !0).forEach(function(r) {
|
|
632
|
+
St(n, r, e[r]);
|
|
633
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : _n(Object(e)).forEach(function(r) {
|
|
585
634
|
Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
|
|
586
635
|
});
|
|
587
636
|
}
|
|
588
637
|
return n;
|
|
589
638
|
}
|
|
590
|
-
const
|
|
639
|
+
const jn = {
|
|
591
640
|
pointer: {
|
|
592
641
|
start: "down",
|
|
593
642
|
change: "move",
|
|
@@ -609,63 +658,63 @@ const je = {
|
|
|
609
658
|
end: "end"
|
|
610
659
|
}
|
|
611
660
|
};
|
|
612
|
-
function
|
|
661
|
+
function vn(n) {
|
|
613
662
|
return n ? n[0].toUpperCase() + n.slice(1) : "";
|
|
614
663
|
}
|
|
615
|
-
const
|
|
616
|
-
function
|
|
617
|
-
return n && !
|
|
664
|
+
const Sr = ["enter", "leave"];
|
|
665
|
+
function xr(n = !1, t) {
|
|
666
|
+
return n && !Sr.includes(t);
|
|
618
667
|
}
|
|
619
|
-
function
|
|
620
|
-
const r =
|
|
621
|
-
return "on" +
|
|
668
|
+
function Rr(n, t = "", e = !1) {
|
|
669
|
+
const r = jn[n], s = r && r[t] || t;
|
|
670
|
+
return "on" + vn(n) + vn(s) + (xr(e, s) ? "Capture" : "");
|
|
622
671
|
}
|
|
623
|
-
const
|
|
624
|
-
function
|
|
672
|
+
const Tr = ["gotpointercapture", "lostpointercapture"];
|
|
673
|
+
function Ar(n) {
|
|
625
674
|
let t = n.substring(2).toLowerCase();
|
|
626
675
|
const e = !!~t.indexOf("passive");
|
|
627
676
|
e && (t = t.replace("passive", ""));
|
|
628
|
-
const r =
|
|
677
|
+
const r = Tr.includes(t) ? "capturecapture" : "capture", s = !!~t.indexOf(r);
|
|
629
678
|
return s && (t = t.replace("capture", "")), {
|
|
630
679
|
device: t,
|
|
631
680
|
capture: s,
|
|
632
681
|
passive: e
|
|
633
682
|
};
|
|
634
683
|
}
|
|
635
|
-
function
|
|
636
|
-
const e =
|
|
684
|
+
function Or(n, t = "") {
|
|
685
|
+
const e = jn[n], r = e && e[t] || t;
|
|
637
686
|
return n + r;
|
|
638
687
|
}
|
|
639
|
-
function
|
|
688
|
+
function He(n) {
|
|
640
689
|
return "touches" in n;
|
|
641
690
|
}
|
|
642
|
-
function
|
|
643
|
-
return
|
|
691
|
+
function Wn(n) {
|
|
692
|
+
return He(n) ? "touch" : "pointerType" in n ? n.pointerType : "mouse";
|
|
644
693
|
}
|
|
645
|
-
function
|
|
694
|
+
function Cr(n) {
|
|
646
695
|
return Array.from(n.touches).filter((t) => {
|
|
647
696
|
var e, r;
|
|
648
697
|
return t.target === n.currentTarget || ((e = n.currentTarget) === null || e === void 0 || (r = e.contains) === null || r === void 0 ? void 0 : r.call(e, t.target));
|
|
649
698
|
});
|
|
650
699
|
}
|
|
651
|
-
function
|
|
700
|
+
function Dr(n) {
|
|
652
701
|
return n.type === "touchend" || n.type === "touchcancel" ? n.changedTouches : n.targetTouches;
|
|
653
702
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
703
|
+
function zn(n) {
|
|
704
|
+
return He(n) ? Dr(n)[0] : n;
|
|
656
705
|
}
|
|
657
|
-
function
|
|
658
|
-
return
|
|
706
|
+
function Lr(n) {
|
|
707
|
+
return Cr(n).map((t) => t.identifier);
|
|
659
708
|
}
|
|
660
|
-
function
|
|
661
|
-
const t =
|
|
662
|
-
return
|
|
709
|
+
function Ke(n) {
|
|
710
|
+
const t = zn(n);
|
|
711
|
+
return He(n) ? t.identifier : t.pointerId;
|
|
663
712
|
}
|
|
664
|
-
function
|
|
665
|
-
const t =
|
|
713
|
+
function bn(n) {
|
|
714
|
+
const t = zn(n);
|
|
666
715
|
return [t.clientX, t.clientY];
|
|
667
716
|
}
|
|
668
|
-
function
|
|
717
|
+
function Mr(n) {
|
|
669
718
|
const t = {};
|
|
670
719
|
if ("buttons" in n && (t.buttons = n.buttons), "shiftKey" in n) {
|
|
671
720
|
const {
|
|
@@ -683,24 +732,24 @@ function In(n) {
|
|
|
683
732
|
}
|
|
684
733
|
return t;
|
|
685
734
|
}
|
|
686
|
-
function
|
|
735
|
+
function Ve(n, ...t) {
|
|
687
736
|
return typeof n == "function" ? n(...t) : n;
|
|
688
737
|
}
|
|
689
|
-
function
|
|
738
|
+
function Ir() {
|
|
690
739
|
}
|
|
691
|
-
function
|
|
692
|
-
return n.length === 0 ?
|
|
740
|
+
function Pr(...n) {
|
|
741
|
+
return n.length === 0 ? Ir : n.length === 1 ? n[0] : function() {
|
|
693
742
|
let t;
|
|
694
743
|
for (const e of n)
|
|
695
744
|
t = e.apply(this, arguments) || t;
|
|
696
745
|
return t;
|
|
697
746
|
};
|
|
698
747
|
}
|
|
699
|
-
function
|
|
748
|
+
function yn(n, t) {
|
|
700
749
|
return Object.assign({}, t, n || {});
|
|
701
750
|
}
|
|
702
|
-
const
|
|
703
|
-
class
|
|
751
|
+
const kr = 32;
|
|
752
|
+
class Nr {
|
|
704
753
|
constructor(t, e, r) {
|
|
705
754
|
this.ctrl = t, this.args = e, this.key = r, this.state || (this.state = {}, this.computeValues([0, 0]), this.computeInitial(), this.init && this.init(), this.reset());
|
|
706
755
|
}
|
|
@@ -739,7 +788,7 @@ class Nn {
|
|
|
739
788
|
}
|
|
740
789
|
start(t) {
|
|
741
790
|
const e = this.state, r = this.config;
|
|
742
|
-
e._active || (this.reset(), this.computeInitial(), e._active = !0, e.target = t.target, e.currentTarget = t.currentTarget, e.lastOffset = r.from ?
|
|
791
|
+
e._active || (this.reset(), this.computeInitial(), e._active = !0, e.target = t.target, e.currentTarget = t.currentTarget, e.lastOffset = r.from ? Ve(r.from, e) : e.offset, e.offset = e.lastOffset, e.startTime = e.timeStamp = t.timeStamp);
|
|
743
792
|
}
|
|
744
793
|
computeValues(t) {
|
|
745
794
|
const e = this.state;
|
|
@@ -757,38 +806,38 @@ class Nn {
|
|
|
757
806
|
} = this;
|
|
758
807
|
e.args = this.args;
|
|
759
808
|
let i = 0;
|
|
760
|
-
if (t && (e.event = t, r.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s,
|
|
761
|
-
const
|
|
762
|
-
|
|
809
|
+
if (t && (e.event = t, r.preventDefault && t.cancelable && e.event.preventDefault(), e.type = t.type, s.touches = this.ctrl.pointerIds.size || this.ctrl.touchIds.size, s.locked = !!document.pointerLockElement, Object.assign(s, Mr(t)), s.down = s.pressed = s.buttons % 2 === 1 || s.touches > 0, i = t.timeStamp - e.timeStamp, e.timeStamp = t.timeStamp, e.elapsedTime = e.timeStamp - e.startTime), e._active) {
|
|
810
|
+
const y = e._delta.map(Math.abs);
|
|
811
|
+
pt.addTo(e._distance, y);
|
|
763
812
|
}
|
|
764
813
|
this.axisIntent && this.axisIntent(t);
|
|
765
|
-
const [o, c] = e._movement, [
|
|
766
|
-
_step:
|
|
767
|
-
values:
|
|
814
|
+
const [o, c] = e._movement, [a, f] = r.threshold, {
|
|
815
|
+
_step: l,
|
|
816
|
+
values: m
|
|
768
817
|
} = e;
|
|
769
|
-
if (r.hasCustomTransform ? (
|
|
770
|
-
const
|
|
818
|
+
if (r.hasCustomTransform ? (l[0] === !1 && (l[0] = Math.abs(o) >= a && m[0]), l[1] === !1 && (l[1] = Math.abs(c) >= f && m[1])) : (l[0] === !1 && (l[0] = Math.abs(o) >= a && Math.sign(o) * a), l[1] === !1 && (l[1] = Math.abs(c) >= f && Math.sign(c) * f)), e.intentional = l[0] !== !1 || l[1] !== !1, !e.intentional) return;
|
|
819
|
+
const d = [0, 0];
|
|
771
820
|
if (r.hasCustomTransform) {
|
|
772
|
-
const [
|
|
773
|
-
|
|
821
|
+
const [y, E] = m;
|
|
822
|
+
d[0] = l[0] !== !1 ? y - l[0] : 0, d[1] = l[1] !== !1 ? E - l[1] : 0;
|
|
774
823
|
} else
|
|
775
|
-
|
|
776
|
-
this.restrictToAxis && !e._blocked && this.restrictToAxis(
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
const [
|
|
780
|
-
e.overflow = [
|
|
781
|
-
const
|
|
782
|
-
if (e.offset =
|
|
783
|
-
e.delta =
|
|
784
|
-
const
|
|
785
|
-
|
|
824
|
+
d[0] = l[0] !== !1 ? o - l[0] : 0, d[1] = l[1] !== !1 ? c - l[1] : 0;
|
|
825
|
+
this.restrictToAxis && !e._blocked && this.restrictToAxis(d);
|
|
826
|
+
const g = e.offset, v = e._active && !e._blocked || e.active;
|
|
827
|
+
v && (e.first = e._active && !e.active, e.last = !e._active && e.active, e.active = s[this.ingKey] = e._active, t && (e.first && ("bounds" in r && (e._bounds = Ve(r.bounds, e)), this.setup && this.setup()), e.movement = d, this.computeOffset()));
|
|
828
|
+
const [p, b] = e.offset, [[w, h], [x, O]] = e._bounds;
|
|
829
|
+
e.overflow = [p < w ? -1 : p > h ? 1 : 0, b < x ? -1 : b > O ? 1 : 0], e._movementBound[0] = e.overflow[0] ? e._movementBound[0] === !1 ? e._movement[0] : e._movementBound[0] : !1, e._movementBound[1] = e.overflow[1] ? e._movementBound[1] === !1 ? e._movement[1] : e._movementBound[1] : !1;
|
|
830
|
+
const _ = e._active ? r.rubberband || [0, 0] : [0, 0];
|
|
831
|
+
if (e.offset = yr(e._bounds, e.offset, _), e.delta = pt.sub(e.offset, g), this.computeMovement(), v && (!e.last || i > kr)) {
|
|
832
|
+
e.delta = pt.sub(e.offset, g);
|
|
833
|
+
const y = e.delta.map(Math.abs);
|
|
834
|
+
pt.addTo(e.distance, y), e.direction = e.delta.map(Math.sign), e._direction = e._delta.map(Math.sign), !e.first && i > 0 && (e.velocity = [y[0] / i, y[1] / i], e.timeDelta = i);
|
|
786
835
|
}
|
|
787
836
|
}
|
|
788
837
|
emit() {
|
|
789
838
|
const t = this.state, e = this.shared, r = this.config;
|
|
790
839
|
if (t._active || this.clean(), (t._blocked || !t.intentional) && !t._force && !r.triggerAllEvents) return;
|
|
791
|
-
const s = this.handler(
|
|
840
|
+
const s = this.handler(nt(nt(nt({}, e), t), {}, {
|
|
792
841
|
[this.aliasKey]: t.values
|
|
793
842
|
}));
|
|
794
843
|
s !== void 0 && (t.memo = s);
|
|
@@ -797,16 +846,16 @@ class Nn {
|
|
|
797
846
|
this.eventStore.clean(), this.timeoutStore.clean();
|
|
798
847
|
}
|
|
799
848
|
}
|
|
800
|
-
function
|
|
849
|
+
function jr([n, t], e) {
|
|
801
850
|
const r = Math.abs(n), s = Math.abs(t);
|
|
802
851
|
if (r > s && r > e)
|
|
803
852
|
return "x";
|
|
804
853
|
if (s > r && s > e)
|
|
805
854
|
return "y";
|
|
806
855
|
}
|
|
807
|
-
class
|
|
856
|
+
class Wr extends Nr {
|
|
808
857
|
constructor(...t) {
|
|
809
|
-
super(...t),
|
|
858
|
+
super(...t), St(this, "aliasKey", "xy");
|
|
810
859
|
}
|
|
811
860
|
reset() {
|
|
812
861
|
super.reset(), this.state.axis = void 0;
|
|
@@ -815,16 +864,16 @@ class Wn extends Nn {
|
|
|
815
864
|
this.state.offset = [0, 0], this.state.lastOffset = [0, 0];
|
|
816
865
|
}
|
|
817
866
|
computeOffset() {
|
|
818
|
-
this.state.offset =
|
|
867
|
+
this.state.offset = pt.add(this.state.lastOffset, this.state.movement);
|
|
819
868
|
}
|
|
820
869
|
computeMovement() {
|
|
821
|
-
this.state.movement =
|
|
870
|
+
this.state.movement = pt.sub(this.state.offset, this.state.lastOffset);
|
|
822
871
|
}
|
|
823
872
|
axisIntent(t) {
|
|
824
873
|
const e = this.state, r = this.config;
|
|
825
874
|
if (!e.axis && t) {
|
|
826
|
-
const s = typeof r.axisThreshold == "object" ? r.axisThreshold[
|
|
827
|
-
e.axis =
|
|
875
|
+
const s = typeof r.axisThreshold == "object" ? r.axisThreshold[Wn(t)] : r.axisThreshold;
|
|
876
|
+
e.axis = jr(e._movement, s);
|
|
828
877
|
}
|
|
829
878
|
e._blocked = (r.lockDirection || !!r.axis) && !e.axis || !!r.axis && r.axis !== e.axis;
|
|
830
879
|
}
|
|
@@ -840,12 +889,12 @@ class Wn extends Nn {
|
|
|
840
889
|
}
|
|
841
890
|
}
|
|
842
891
|
}
|
|
843
|
-
const
|
|
892
|
+
const wn = (n) => n, En = 0.15, rn = {
|
|
844
893
|
enabled(n = !0) {
|
|
845
894
|
return n;
|
|
846
895
|
},
|
|
847
896
|
eventOptions(n, t, e) {
|
|
848
|
-
return
|
|
897
|
+
return nt(nt({}, e.shared.eventOptions), n);
|
|
849
898
|
},
|
|
850
899
|
preventDefault(n = !1) {
|
|
851
900
|
return n;
|
|
@@ -856,33 +905,33 @@ const Ee = (n) => n, we = 0.15, ae = {
|
|
|
856
905
|
rubberband(n = 0) {
|
|
857
906
|
switch (n) {
|
|
858
907
|
case !0:
|
|
859
|
-
return [
|
|
908
|
+
return [En, En];
|
|
860
909
|
case !1:
|
|
861
910
|
return [0, 0];
|
|
862
911
|
default:
|
|
863
|
-
return
|
|
912
|
+
return pt.toVector(n);
|
|
864
913
|
}
|
|
865
914
|
},
|
|
866
915
|
from(n) {
|
|
867
916
|
if (typeof n == "function") return n;
|
|
868
|
-
if (n != null) return
|
|
917
|
+
if (n != null) return pt.toVector(n);
|
|
869
918
|
},
|
|
870
919
|
transform(n, t, e) {
|
|
871
920
|
const r = n || e.shared.transform;
|
|
872
921
|
if (this.hasCustomTransform = !!r, process.env.NODE_ENV === "development") {
|
|
873
|
-
const s = r ||
|
|
922
|
+
const s = r || wn;
|
|
874
923
|
return (i) => {
|
|
875
924
|
const o = s(i);
|
|
876
925
|
return (!isFinite(o[0]) || !isFinite(o[1])) && console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${o[0]},${[1]}]`), o;
|
|
877
926
|
};
|
|
878
927
|
}
|
|
879
|
-
return r ||
|
|
928
|
+
return r || wn;
|
|
880
929
|
},
|
|
881
930
|
threshold(n) {
|
|
882
|
-
return
|
|
931
|
+
return pt.toVector(n, 0);
|
|
883
932
|
}
|
|
884
933
|
};
|
|
885
|
-
process.env.NODE_ENV === "development" && Object.assign(
|
|
934
|
+
process.env.NODE_ENV === "development" && Object.assign(rn, {
|
|
886
935
|
domTarget(n) {
|
|
887
936
|
if (n !== void 0)
|
|
888
937
|
throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
|
|
@@ -899,18 +948,18 @@ process.env.NODE_ENV === "development" && Object.assign(ae, {
|
|
|
899
948
|
return NaN;
|
|
900
949
|
}
|
|
901
950
|
});
|
|
902
|
-
const
|
|
951
|
+
const zr = 0, Oe = nt(nt({}, rn), {}, {
|
|
903
952
|
axis(n, t, {
|
|
904
953
|
axis: e
|
|
905
954
|
}) {
|
|
906
955
|
if (this.lockDirection = e === "lock", !this.lockDirection) return e;
|
|
907
956
|
},
|
|
908
|
-
axisThreshold(n =
|
|
957
|
+
axisThreshold(n = zr) {
|
|
909
958
|
return n;
|
|
910
959
|
},
|
|
911
960
|
bounds(n = {}) {
|
|
912
961
|
if (typeof n == "function")
|
|
913
|
-
return (i) =>
|
|
962
|
+
return (i) => Oe.bounds(n(i));
|
|
914
963
|
if ("current" in n)
|
|
915
964
|
return () => n.current;
|
|
916
965
|
if (typeof HTMLElement == "function" && n instanceof HTMLElement)
|
|
@@ -923,15 +972,15 @@ const zn = 0, Lt = G(G({}, ae), {}, {
|
|
|
923
972
|
} = n;
|
|
924
973
|
return [[t, e], [r, s]];
|
|
925
974
|
}
|
|
926
|
-
}),
|
|
975
|
+
}), Sn = {
|
|
927
976
|
ArrowRight: (n, t = 1) => [n * t, 0],
|
|
928
977
|
ArrowLeft: (n, t = 1) => [-1 * n * t, 0],
|
|
929
978
|
ArrowUp: (n, t = 1) => [0, -1 * n * t],
|
|
930
979
|
ArrowDown: (n, t = 1) => [0, n * t]
|
|
931
980
|
};
|
|
932
|
-
class
|
|
981
|
+
class Fr extends Wr {
|
|
933
982
|
constructor(...t) {
|
|
934
|
-
super(...t),
|
|
983
|
+
super(...t), St(this, "ingKey", "dragging");
|
|
935
984
|
}
|
|
936
985
|
reset() {
|
|
937
986
|
super.reset();
|
|
@@ -947,7 +996,7 @@ class Fn extends Wn {
|
|
|
947
996
|
top: e.top - r.top + t.offset[1],
|
|
948
997
|
bottom: e.bottom - r.bottom + t.offset[1]
|
|
949
998
|
};
|
|
950
|
-
t._bounds =
|
|
999
|
+
t._bounds = Oe.bounds(s);
|
|
951
1000
|
}
|
|
952
1001
|
}
|
|
953
1002
|
cancel() {
|
|
@@ -966,7 +1015,7 @@ class Fn extends Wn {
|
|
|
966
1015
|
const e = this.config, r = this.state;
|
|
967
1016
|
if (t.buttons != null && (Array.isArray(e.pointerButtons) ? !e.pointerButtons.includes(t.buttons) : e.pointerButtons !== -1 && e.pointerButtons !== t.buttons)) return;
|
|
968
1017
|
const s = this.ctrl.setEventIds(t);
|
|
969
|
-
e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && r._pointerActive) && (this.start(t), this.setupPointer(t), r._pointerId =
|
|
1018
|
+
e.pointerCapture && t.target.setPointerCapture(t.pointerId), !(s && s.size > 1 && r._pointerActive) && (this.start(t), this.setupPointer(t), r._pointerId = Ke(t), r._pointerActive = !0, this.computeValues(bn(t)), this.computeInitial(), e.preventScrollAxis && Wn(t) !== "mouse" ? (r._active = !1, this.setupScrollPrevention(t)) : e.delay > 0 ? (this.setupDelayTrigger(t), e.triggerAllEvents && (this.compute(t), this.emit())) : this.startPointerDrag(t));
|
|
970
1019
|
}
|
|
971
1020
|
startPointerDrag(t) {
|
|
972
1021
|
const e = this.state;
|
|
@@ -975,10 +1024,10 @@ class Fn extends Wn {
|
|
|
975
1024
|
pointerMove(t) {
|
|
976
1025
|
const e = this.state, r = this.config;
|
|
977
1026
|
if (!e._pointerActive) return;
|
|
978
|
-
const s =
|
|
1027
|
+
const s = Ke(t);
|
|
979
1028
|
if (e._pointerId !== void 0 && s !== e._pointerId) return;
|
|
980
|
-
const i =
|
|
981
|
-
if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta =
|
|
1029
|
+
const i = bn(t);
|
|
1030
|
+
if (document.pointerLockElement === t.target ? e._delta = [t.movementX, t.movementY] : (e._delta = pt.sub(i, e._values), this.computeValues(i)), pt.addTo(e._movement, e._delta), this.compute(t), e._delayed && e.intentional) {
|
|
982
1031
|
this.timeoutStore.remove("dragDelay"), e.active = !1, this.startPointerDrag(t);
|
|
983
1032
|
return;
|
|
984
1033
|
}
|
|
@@ -1004,17 +1053,17 @@ class Fn extends Wn {
|
|
|
1004
1053
|
}
|
|
1005
1054
|
const e = this.state, r = this.config;
|
|
1006
1055
|
if (!e._active || !e._pointerActive) return;
|
|
1007
|
-
const s =
|
|
1056
|
+
const s = Ke(t);
|
|
1008
1057
|
if (e._pointerId !== void 0 && s !== e._pointerId) return;
|
|
1009
1058
|
this.state._pointerActive = !1, this.setActive(), this.compute(t);
|
|
1010
1059
|
const [i, o] = e._distance;
|
|
1011
1060
|
if (e.tap = i <= r.tapsThreshold && o <= r.tapsThreshold, e.tap && r.filterTaps)
|
|
1012
1061
|
e._force = !0;
|
|
1013
1062
|
else {
|
|
1014
|
-
const [c,
|
|
1015
|
-
if (e.elapsedTime <
|
|
1016
|
-
const
|
|
1017
|
-
|
|
1063
|
+
const [c, a] = e._delta, [f, l] = e._movement, [m, d] = r.swipe.velocity, [g, v] = r.swipe.distance, p = r.swipe.duration;
|
|
1064
|
+
if (e.elapsedTime < p) {
|
|
1065
|
+
const b = Math.abs(c / e.timeDelta), w = Math.abs(a / e.timeDelta);
|
|
1066
|
+
b > m && Math.abs(f) > g && (e.swipe[0] = Math.sign(c)), w > d && Math.abs(l) > v && (e.swipe[1] = Math.sign(a));
|
|
1018
1067
|
}
|
|
1019
1068
|
}
|
|
1020
1069
|
this.emit();
|
|
@@ -1041,7 +1090,7 @@ class Fn extends Wn {
|
|
|
1041
1090
|
this.state._preventScroll && t.cancelable && t.preventDefault();
|
|
1042
1091
|
}
|
|
1043
1092
|
setupScrollPrevention(t) {
|
|
1044
|
-
this.state._preventScroll = !1,
|
|
1093
|
+
this.state._preventScroll = !1, Vr(t);
|
|
1045
1094
|
const e = this.eventStore.add(this.sharedConfig.window, "touch", "change", this.preventScroll.bind(this), {
|
|
1046
1095
|
passive: !1
|
|
1047
1096
|
});
|
|
@@ -1053,14 +1102,14 @@ class Fn extends Wn {
|
|
|
1053
1102
|
}, this.config.delay);
|
|
1054
1103
|
}
|
|
1055
1104
|
keyDown(t) {
|
|
1056
|
-
const e =
|
|
1105
|
+
const e = Sn[t.key];
|
|
1057
1106
|
if (e) {
|
|
1058
1107
|
const r = this.state, s = t.shiftKey ? 10 : t.altKey ? 0.1 : 1;
|
|
1059
|
-
this.start(t), r._delta = e(this.config.keyboardDisplacement, s), r._keyboardActive = !0,
|
|
1108
|
+
this.start(t), r._delta = e(this.config.keyboardDisplacement, s), r._keyboardActive = !0, pt.addTo(r._movement, r._delta), this.compute(t), this.emit();
|
|
1060
1109
|
}
|
|
1061
1110
|
}
|
|
1062
1111
|
keyUp(t) {
|
|
1063
|
-
t.key in
|
|
1112
|
+
t.key in Sn && (this.state._keyboardActive = !1, this.setActive(), this.compute(t), this.emit());
|
|
1064
1113
|
}
|
|
1065
1114
|
bind(t) {
|
|
1066
1115
|
const e = this.config.device;
|
|
@@ -1070,41 +1119,41 @@ class Fn extends Wn {
|
|
|
1070
1119
|
});
|
|
1071
1120
|
}
|
|
1072
1121
|
}
|
|
1073
|
-
function
|
|
1122
|
+
function Vr(n) {
|
|
1074
1123
|
"persist" in n && typeof n.persist == "function" && n.persist();
|
|
1075
1124
|
}
|
|
1076
|
-
const
|
|
1077
|
-
function
|
|
1078
|
-
return
|
|
1125
|
+
const Ce = typeof window < "u" && window.document && window.document.createElement;
|
|
1126
|
+
function Fn() {
|
|
1127
|
+
return Ce && "ontouchstart" in window;
|
|
1079
1128
|
}
|
|
1080
|
-
function
|
|
1081
|
-
return
|
|
1129
|
+
function $r() {
|
|
1130
|
+
return Fn() || Ce && window.navigator.maxTouchPoints > 1;
|
|
1082
1131
|
}
|
|
1083
|
-
function
|
|
1084
|
-
return
|
|
1132
|
+
function Ur() {
|
|
1133
|
+
return Ce && "onpointerdown" in window;
|
|
1085
1134
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1135
|
+
function Hr() {
|
|
1136
|
+
return Ce && "exitPointerLock" in window.document;
|
|
1088
1137
|
}
|
|
1089
|
-
function
|
|
1138
|
+
function Br() {
|
|
1090
1139
|
try {
|
|
1091
1140
|
return "constructor" in GestureEvent;
|
|
1092
1141
|
} catch {
|
|
1093
1142
|
return !1;
|
|
1094
1143
|
}
|
|
1095
1144
|
}
|
|
1096
|
-
const
|
|
1097
|
-
isBrowser:
|
|
1098
|
-
gesture:
|
|
1099
|
-
touch:
|
|
1100
|
-
touchscreen:
|
|
1101
|
-
pointer:
|
|
1102
|
-
pointerLock:
|
|
1103
|
-
},
|
|
1145
|
+
const Mt = {
|
|
1146
|
+
isBrowser: Ce,
|
|
1147
|
+
gesture: Br(),
|
|
1148
|
+
touch: Fn(),
|
|
1149
|
+
touchscreen: $r(),
|
|
1150
|
+
pointer: Ur(),
|
|
1151
|
+
pointerLock: Hr()
|
|
1152
|
+
}, Xr = 250, Yr = 180, Gr = 0.5, Kr = 50, qr = 250, Jr = 10, xn = {
|
|
1104
1153
|
mouse: 0,
|
|
1105
1154
|
touch: 0,
|
|
1106
1155
|
pen: 8
|
|
1107
|
-
},
|
|
1156
|
+
}, Vn = nt(nt({}, Oe), {}, {
|
|
1108
1157
|
device(n, t, {
|
|
1109
1158
|
pointer: {
|
|
1110
1159
|
touch: e = !1,
|
|
@@ -1112,12 +1161,12 @@ const lt = {
|
|
|
1112
1161
|
mouse: s = !1
|
|
1113
1162
|
} = {}
|
|
1114
1163
|
}) {
|
|
1115
|
-
return this.pointerLock = r &&
|
|
1164
|
+
return this.pointerLock = r && Mt.pointerLock, Mt.touch && e ? "touch" : this.pointerLock ? "mouse" : Mt.pointer && !s ? "pointer" : Mt.touch ? "touch" : "mouse";
|
|
1116
1165
|
},
|
|
1117
1166
|
preventScrollAxis(n, t, {
|
|
1118
1167
|
preventScroll: e
|
|
1119
1168
|
}) {
|
|
1120
|
-
if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && n ?
|
|
1169
|
+
if (this.preventScrollDelay = typeof e == "number" ? e : e || e === void 0 && n ? Xr : void 0, !(!Mt.touchscreen || e === !1))
|
|
1121
1170
|
return n || (e !== void 0 ? "y" : void 0);
|
|
1122
1171
|
},
|
|
1123
1172
|
pointerCapture(n, t, {
|
|
@@ -1134,24 +1183,24 @@ const lt = {
|
|
|
1134
1183
|
tapsThreshold: r = 3,
|
|
1135
1184
|
axis: s = void 0
|
|
1136
1185
|
}) {
|
|
1137
|
-
const i =
|
|
1186
|
+
const i = pt.toVector(n, e ? r : s ? 1 : 0);
|
|
1138
1187
|
return this.filterTaps = e, this.tapsThreshold = r, i;
|
|
1139
1188
|
},
|
|
1140
1189
|
swipe({
|
|
1141
|
-
velocity: n =
|
|
1142
|
-
distance: t =
|
|
1143
|
-
duration: e =
|
|
1190
|
+
velocity: n = Gr,
|
|
1191
|
+
distance: t = Kr,
|
|
1192
|
+
duration: e = qr
|
|
1144
1193
|
} = {}) {
|
|
1145
1194
|
return {
|
|
1146
|
-
velocity: this.transform(
|
|
1147
|
-
distance: this.transform(
|
|
1195
|
+
velocity: this.transform(pt.toVector(n)),
|
|
1196
|
+
distance: this.transform(pt.toVector(t)),
|
|
1148
1197
|
duration: e
|
|
1149
1198
|
};
|
|
1150
1199
|
},
|
|
1151
1200
|
delay(n = 0) {
|
|
1152
1201
|
switch (n) {
|
|
1153
1202
|
case !0:
|
|
1154
|
-
return
|
|
1203
|
+
return Yr;
|
|
1155
1204
|
case !1:
|
|
1156
1205
|
return 0;
|
|
1157
1206
|
default:
|
|
@@ -1159,13 +1208,13 @@ const lt = {
|
|
|
1159
1208
|
}
|
|
1160
1209
|
},
|
|
1161
1210
|
axisThreshold(n) {
|
|
1162
|
-
return n ?
|
|
1211
|
+
return n ? nt(nt({}, xn), n) : xn;
|
|
1163
1212
|
},
|
|
1164
|
-
keyboardDisplacement(n =
|
|
1213
|
+
keyboardDisplacement(n = Jr) {
|
|
1165
1214
|
return n;
|
|
1166
1215
|
}
|
|
1167
1216
|
});
|
|
1168
|
-
process.env.NODE_ENV === "development" && Object.assign(
|
|
1217
|
+
process.env.NODE_ENV === "development" && Object.assign(Vn, {
|
|
1169
1218
|
useTouch(n) {
|
|
1170
1219
|
if (n !== void 0)
|
|
1171
1220
|
throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");
|
|
@@ -1192,18 +1241,18 @@ process.env.NODE_ENV === "development" && Object.assign(Ve, {
|
|
|
1192
1241
|
return NaN;
|
|
1193
1242
|
}
|
|
1194
1243
|
});
|
|
1195
|
-
|
|
1244
|
+
nt(nt({}, rn), {}, {
|
|
1196
1245
|
device(n, t, {
|
|
1197
1246
|
shared: e,
|
|
1198
1247
|
pointer: {
|
|
1199
1248
|
touch: r = !1
|
|
1200
1249
|
} = {}
|
|
1201
1250
|
}) {
|
|
1202
|
-
if (e.target && !
|
|
1203
|
-
if (
|
|
1204
|
-
if (
|
|
1205
|
-
if (
|
|
1206
|
-
if (
|
|
1251
|
+
if (e.target && !Mt.touch && Mt.gesture) return "gesture";
|
|
1252
|
+
if (Mt.touch && r) return "touch";
|
|
1253
|
+
if (Mt.touchscreen) {
|
|
1254
|
+
if (Mt.pointer) return "pointer";
|
|
1255
|
+
if (Mt.touch) return "touch";
|
|
1207
1256
|
}
|
|
1208
1257
|
},
|
|
1209
1258
|
bounds(n, t, {
|
|
@@ -1211,13 +1260,13 @@ G(G({}, ae), {}, {
|
|
|
1211
1260
|
angleBounds: r = {}
|
|
1212
1261
|
}) {
|
|
1213
1262
|
const s = (o) => {
|
|
1214
|
-
const c =
|
|
1263
|
+
const c = yn(Ve(e, o), {
|
|
1215
1264
|
min: -1 / 0,
|
|
1216
1265
|
max: 1 / 0
|
|
1217
1266
|
});
|
|
1218
1267
|
return [c.min, c.max];
|
|
1219
1268
|
}, i = (o) => {
|
|
1220
|
-
const c =
|
|
1269
|
+
const c = yn(Ve(r, o), {
|
|
1221
1270
|
min: -1 / 0,
|
|
1222
1271
|
max: 1 / 0
|
|
1223
1272
|
});
|
|
@@ -1226,7 +1275,7 @@ G(G({}, ae), {}, {
|
|
|
1226
1275
|
return typeof e != "function" && typeof r != "function" ? [s(), i()] : (o) => [s(o), i(o)];
|
|
1227
1276
|
},
|
|
1228
1277
|
threshold(n, t, e) {
|
|
1229
|
-
return this.lockDirection = e.axis === "lock",
|
|
1278
|
+
return this.lockDirection = e.axis === "lock", pt.toVector(n, this.lockDirection ? [0.1, 3] : 0);
|
|
1230
1279
|
},
|
|
1231
1280
|
modifierKey(n) {
|
|
1232
1281
|
return n === void 0 ? "ctrlKey" : n;
|
|
@@ -1235,31 +1284,31 @@ G(G({}, ae), {}, {
|
|
|
1235
1284
|
return n;
|
|
1236
1285
|
}
|
|
1237
1286
|
});
|
|
1238
|
-
|
|
1287
|
+
nt(nt({}, Oe), {}, {
|
|
1239
1288
|
mouseOnly: (n = !0) => n
|
|
1240
1289
|
});
|
|
1241
|
-
|
|
1290
|
+
nt(nt({}, Oe), {}, {
|
|
1242
1291
|
mouseOnly: (n = !0) => n
|
|
1243
1292
|
});
|
|
1244
|
-
const
|
|
1245
|
-
function
|
|
1246
|
-
|
|
1293
|
+
const $n = /* @__PURE__ */ new Map(), en = /* @__PURE__ */ new Map();
|
|
1294
|
+
function Zr(n) {
|
|
1295
|
+
$n.set(n.key, n.engine), en.set(n.key, n.resolver);
|
|
1247
1296
|
}
|
|
1248
|
-
const
|
|
1297
|
+
const Qr = {
|
|
1249
1298
|
key: "drag",
|
|
1250
|
-
engine:
|
|
1251
|
-
resolver:
|
|
1299
|
+
engine: Fr,
|
|
1300
|
+
resolver: Vn
|
|
1252
1301
|
};
|
|
1253
|
-
function
|
|
1302
|
+
function ts(n, t) {
|
|
1254
1303
|
if (n == null) return {};
|
|
1255
1304
|
var e = {}, r = Object.keys(n), s, i;
|
|
1256
1305
|
for (i = 0; i < r.length; i++)
|
|
1257
1306
|
s = r[i], !(t.indexOf(s) >= 0) && (e[s] = n[s]);
|
|
1258
1307
|
return e;
|
|
1259
1308
|
}
|
|
1260
|
-
function
|
|
1309
|
+
function es(n, t) {
|
|
1261
1310
|
if (n == null) return {};
|
|
1262
|
-
var e =
|
|
1311
|
+
var e = ts(n, t), r, s;
|
|
1263
1312
|
if (Object.getOwnPropertySymbols) {
|
|
1264
1313
|
var i = Object.getOwnPropertySymbols(n);
|
|
1265
1314
|
for (s = 0; s < i.length; s++)
|
|
@@ -1267,7 +1316,7 @@ function er(n, t) {
|
|
|
1267
1316
|
}
|
|
1268
1317
|
return e;
|
|
1269
1318
|
}
|
|
1270
|
-
const
|
|
1319
|
+
const ns = {
|
|
1271
1320
|
target(n) {
|
|
1272
1321
|
if (n)
|
|
1273
1322
|
return () => "current" in n ? n.current : n;
|
|
@@ -1275,7 +1324,7 @@ const nr = {
|
|
|
1275
1324
|
enabled(n = !0) {
|
|
1276
1325
|
return n;
|
|
1277
1326
|
},
|
|
1278
|
-
window(n =
|
|
1327
|
+
window(n = Mt.isBrowser ? window : void 0) {
|
|
1279
1328
|
return n;
|
|
1280
1329
|
},
|
|
1281
1330
|
eventOptions({
|
|
@@ -1290,8 +1339,8 @@ const nr = {
|
|
|
1290
1339
|
transform(n) {
|
|
1291
1340
|
return n;
|
|
1292
1341
|
}
|
|
1293
|
-
},
|
|
1294
|
-
function
|
|
1342
|
+
}, rs = ["target", "eventOptions", "window", "enabled", "transform"];
|
|
1343
|
+
function ke(n = {}, t) {
|
|
1295
1344
|
const e = {};
|
|
1296
1345
|
for (const [r, s] of Object.entries(t))
|
|
1297
1346
|
switch (typeof s) {
|
|
@@ -1303,7 +1352,7 @@ function Ft(n = {}, t) {
|
|
|
1303
1352
|
e[r] = s.call(e, n[r], r, n);
|
|
1304
1353
|
break;
|
|
1305
1354
|
case "object":
|
|
1306
|
-
e[r] =
|
|
1355
|
+
e[r] = ke(n[r], s);
|
|
1307
1356
|
break;
|
|
1308
1357
|
case "boolean":
|
|
1309
1358
|
s && (e[r] = n[r]);
|
|
@@ -1311,59 +1360,59 @@ function Ft(n = {}, t) {
|
|
|
1311
1360
|
}
|
|
1312
1361
|
return e;
|
|
1313
1362
|
}
|
|
1314
|
-
function
|
|
1363
|
+
function ss(n, t, e = {}) {
|
|
1315
1364
|
const r = n, {
|
|
1316
1365
|
target: s,
|
|
1317
1366
|
eventOptions: i,
|
|
1318
1367
|
window: o,
|
|
1319
1368
|
enabled: c,
|
|
1320
|
-
transform:
|
|
1321
|
-
} = r,
|
|
1322
|
-
if (e.shared =
|
|
1369
|
+
transform: a
|
|
1370
|
+
} = r, f = es(r, rs);
|
|
1371
|
+
if (e.shared = ke({
|
|
1323
1372
|
target: s,
|
|
1324
1373
|
eventOptions: i,
|
|
1325
1374
|
window: o,
|
|
1326
1375
|
enabled: c,
|
|
1327
|
-
transform:
|
|
1328
|
-
},
|
|
1329
|
-
const
|
|
1330
|
-
e[t] =
|
|
1376
|
+
transform: a
|
|
1377
|
+
}, ns), t) {
|
|
1378
|
+
const l = en.get(t);
|
|
1379
|
+
e[t] = ke(nt({
|
|
1331
1380
|
shared: e.shared
|
|
1332
|
-
},
|
|
1381
|
+
}, f), l);
|
|
1333
1382
|
} else
|
|
1334
|
-
for (const
|
|
1335
|
-
const
|
|
1336
|
-
if (
|
|
1337
|
-
e[
|
|
1383
|
+
for (const l in f) {
|
|
1384
|
+
const m = en.get(l);
|
|
1385
|
+
if (m)
|
|
1386
|
+
e[l] = ke(nt({
|
|
1338
1387
|
shared: e.shared
|
|
1339
|
-
},
|
|
1340
|
-
else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(
|
|
1341
|
-
if (
|
|
1388
|
+
}, f[l]), m);
|
|
1389
|
+
else if (process.env.NODE_ENV === "development" && !["drag", "pinch", "scroll", "wheel", "move", "hover"].includes(l)) {
|
|
1390
|
+
if (l === "domTarget")
|
|
1342
1391
|
throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");
|
|
1343
|
-
console.warn(`[@use-gesture]: Unknown config key \`${
|
|
1392
|
+
console.warn(`[@use-gesture]: Unknown config key \`${l}\` was used. Please read the documentation for further information.`);
|
|
1344
1393
|
}
|
|
1345
1394
|
}
|
|
1346
1395
|
return e;
|
|
1347
1396
|
}
|
|
1348
|
-
class
|
|
1397
|
+
class Un {
|
|
1349
1398
|
constructor(t, e) {
|
|
1350
|
-
|
|
1399
|
+
St(this, "_listeners", /* @__PURE__ */ new Set()), this._ctrl = t, this._gestureKey = e;
|
|
1351
1400
|
}
|
|
1352
1401
|
add(t, e, r, s, i) {
|
|
1353
|
-
const o = this._listeners, c =
|
|
1354
|
-
t.addEventListener(c, s,
|
|
1355
|
-
const
|
|
1356
|
-
t.removeEventListener(c, s,
|
|
1402
|
+
const o = this._listeners, c = Or(e, r), a = this._gestureKey ? this._ctrl.config[this._gestureKey].eventOptions : {}, f = nt(nt({}, a), i);
|
|
1403
|
+
t.addEventListener(c, s, f);
|
|
1404
|
+
const l = () => {
|
|
1405
|
+
t.removeEventListener(c, s, f), o.delete(l);
|
|
1357
1406
|
};
|
|
1358
|
-
return o.add(
|
|
1407
|
+
return o.add(l), l;
|
|
1359
1408
|
}
|
|
1360
1409
|
clean() {
|
|
1361
1410
|
this._listeners.forEach((t) => t()), this._listeners.clear();
|
|
1362
1411
|
}
|
|
1363
1412
|
}
|
|
1364
|
-
class
|
|
1413
|
+
class is {
|
|
1365
1414
|
constructor() {
|
|
1366
|
-
|
|
1415
|
+
St(this, "_timeouts", /* @__PURE__ */ new Map());
|
|
1367
1416
|
}
|
|
1368
1417
|
add(t, e, r = 140, ...s) {
|
|
1369
1418
|
this.remove(t), this._timeouts.set(t, window.setTimeout(e, r, ...s));
|
|
@@ -1376,20 +1425,20 @@ class ir {
|
|
|
1376
1425
|
this._timeouts.forEach((t) => void window.clearTimeout(t)), this._timeouts.clear();
|
|
1377
1426
|
}
|
|
1378
1427
|
}
|
|
1379
|
-
class
|
|
1428
|
+
class os {
|
|
1380
1429
|
constructor(t) {
|
|
1381
|
-
|
|
1430
|
+
St(this, "gestures", /* @__PURE__ */ new Set()), St(this, "_targetEventStore", new Un(this)), St(this, "gestureEventStores", {}), St(this, "gestureTimeoutStores", {}), St(this, "handlers", {}), St(this, "config", {}), St(this, "pointerIds", /* @__PURE__ */ new Set()), St(this, "touchIds", /* @__PURE__ */ new Set()), St(this, "state", {
|
|
1382
1431
|
shared: {
|
|
1383
1432
|
shiftKey: !1,
|
|
1384
1433
|
metaKey: !1,
|
|
1385
1434
|
ctrlKey: !1,
|
|
1386
1435
|
altKey: !1
|
|
1387
1436
|
}
|
|
1388
|
-
}),
|
|
1437
|
+
}), cs(this, t);
|
|
1389
1438
|
}
|
|
1390
1439
|
setEventIds(t) {
|
|
1391
|
-
if (
|
|
1392
|
-
return this.touchIds = new Set(
|
|
1440
|
+
if (He(t))
|
|
1441
|
+
return this.touchIds = new Set(Lr(t)), this.touchIds;
|
|
1393
1442
|
if ("pointerId" in t)
|
|
1394
1443
|
return t.type === "pointerup" || t.type === "pointercancel" ? this.pointerIds.delete(t.pointerId) : t.type === "pointerdown" && this.pointerIds.add(t.pointerId), this.pointerIds;
|
|
1395
1444
|
}
|
|
@@ -1397,7 +1446,7 @@ class or {
|
|
|
1397
1446
|
this.handlers = t, this.nativeHandlers = e;
|
|
1398
1447
|
}
|
|
1399
1448
|
applyConfig(t, e) {
|
|
1400
|
-
this.config =
|
|
1449
|
+
this.config = ss(t, e, this.config);
|
|
1401
1450
|
}
|
|
1402
1451
|
clean() {
|
|
1403
1452
|
this._targetEventStore.clean();
|
|
@@ -1413,49 +1462,49 @@ class or {
|
|
|
1413
1462
|
if (!(e.target && (s = e.target(), !s))) {
|
|
1414
1463
|
if (e.enabled) {
|
|
1415
1464
|
for (const o of this.gestures) {
|
|
1416
|
-
const c = this.config[o],
|
|
1465
|
+
const c = this.config[o], a = Rn(r, c.eventOptions, !!s);
|
|
1417
1466
|
if (c.enabled) {
|
|
1418
|
-
const
|
|
1419
|
-
new
|
|
1467
|
+
const f = $n.get(o);
|
|
1468
|
+
new f(this, t, o).bind(a);
|
|
1420
1469
|
}
|
|
1421
1470
|
}
|
|
1422
|
-
const i =
|
|
1471
|
+
const i = Rn(r, e.eventOptions, !!s);
|
|
1423
1472
|
for (const o in this.nativeHandlers)
|
|
1424
|
-
i(o, "", (c) => this.nativeHandlers[o](
|
|
1473
|
+
i(o, "", (c) => this.nativeHandlers[o](nt(nt({}, this.state.shared), {}, {
|
|
1425
1474
|
event: c,
|
|
1426
1475
|
args: t
|
|
1427
1476
|
})), void 0, !0);
|
|
1428
1477
|
}
|
|
1429
1478
|
for (const i in r)
|
|
1430
|
-
r[i] =
|
|
1479
|
+
r[i] = Pr(...r[i]);
|
|
1431
1480
|
if (!s) return r;
|
|
1432
1481
|
for (const i in r) {
|
|
1433
1482
|
const {
|
|
1434
1483
|
device: o,
|
|
1435
1484
|
capture: c,
|
|
1436
|
-
passive:
|
|
1437
|
-
} =
|
|
1485
|
+
passive: a
|
|
1486
|
+
} = Ar(i);
|
|
1438
1487
|
this._targetEventStore.add(s, o, "", r[i], {
|
|
1439
1488
|
capture: c,
|
|
1440
|
-
passive:
|
|
1489
|
+
passive: a
|
|
1441
1490
|
});
|
|
1442
1491
|
}
|
|
1443
1492
|
}
|
|
1444
1493
|
}
|
|
1445
1494
|
}
|
|
1446
|
-
function
|
|
1447
|
-
n.gestures.add(t), n.gestureEventStores[t] = new
|
|
1495
|
+
function Ee(n, t) {
|
|
1496
|
+
n.gestures.add(t), n.gestureEventStores[t] = new Un(n, t), n.gestureTimeoutStores[t] = new is();
|
|
1448
1497
|
}
|
|
1449
|
-
function
|
|
1450
|
-
t.drag &&
|
|
1498
|
+
function cs(n, t) {
|
|
1499
|
+
t.drag && Ee(n, "drag"), t.wheel && Ee(n, "wheel"), t.scroll && Ee(n, "scroll"), t.move && Ee(n, "move"), t.pinch && Ee(n, "pinch"), t.hover && Ee(n, "hover");
|
|
1451
1500
|
}
|
|
1452
|
-
const
|
|
1453
|
-
var
|
|
1454
|
-
const
|
|
1455
|
-
let
|
|
1456
|
-
e &&
|
|
1501
|
+
const Rn = (n, t, e) => (r, s, i, o = {}, c = !1) => {
|
|
1502
|
+
var a, f;
|
|
1503
|
+
const l = (a = o.capture) !== null && a !== void 0 ? a : t.capture, m = (f = o.passive) !== null && f !== void 0 ? f : t.passive;
|
|
1504
|
+
let d = c ? r : Rr(r, s, l);
|
|
1505
|
+
e && m && (d += "Passive"), n[d] = n[d] || [], n[d].push(i);
|
|
1457
1506
|
};
|
|
1458
|
-
function
|
|
1507
|
+
function as(n, t) {
|
|
1459
1508
|
if (typeof n != "object" || n === null) return n;
|
|
1460
1509
|
var e = n[Symbol.toPrimitive];
|
|
1461
1510
|
if (e !== void 0) {
|
|
@@ -1465,19 +1514,19 @@ function ar(n, t) {
|
|
|
1465
1514
|
}
|
|
1466
1515
|
return (t === "string" ? String : Number)(n);
|
|
1467
1516
|
}
|
|
1468
|
-
function
|
|
1469
|
-
var t =
|
|
1517
|
+
function ls(n) {
|
|
1518
|
+
var t = as(n, "string");
|
|
1470
1519
|
return typeof t == "symbol" ? t : String(t);
|
|
1471
1520
|
}
|
|
1472
|
-
function
|
|
1473
|
-
return t =
|
|
1521
|
+
function us(n, t, e) {
|
|
1522
|
+
return t = ls(t), t in n ? Object.defineProperty(n, t, {
|
|
1474
1523
|
value: e,
|
|
1475
1524
|
enumerable: !0,
|
|
1476
1525
|
configurable: !0,
|
|
1477
1526
|
writable: !0
|
|
1478
1527
|
}) : n[t] = e, n;
|
|
1479
1528
|
}
|
|
1480
|
-
function
|
|
1529
|
+
function Tn(n, t) {
|
|
1481
1530
|
var e = Object.keys(n);
|
|
1482
1531
|
if (Object.getOwnPropertySymbols) {
|
|
1483
1532
|
var r = Object.getOwnPropertySymbols(n);
|
|
@@ -1487,20 +1536,20 @@ function Oe(n, t) {
|
|
|
1487
1536
|
}
|
|
1488
1537
|
return e;
|
|
1489
1538
|
}
|
|
1490
|
-
function
|
|
1539
|
+
function Pe(n) {
|
|
1491
1540
|
for (var t = 1; t < arguments.length; t++) {
|
|
1492
1541
|
var e = arguments[t] != null ? arguments[t] : {};
|
|
1493
|
-
t % 2 ?
|
|
1494
|
-
|
|
1495
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) :
|
|
1542
|
+
t % 2 ? Tn(Object(e), !0).forEach(function(r) {
|
|
1543
|
+
us(n, r, e[r]);
|
|
1544
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(n, Object.getOwnPropertyDescriptors(e)) : Tn(Object(e)).forEach(function(r) {
|
|
1496
1545
|
Object.defineProperty(n, r, Object.getOwnPropertyDescriptor(e, r));
|
|
1497
1546
|
});
|
|
1498
1547
|
}
|
|
1499
1548
|
return n;
|
|
1500
1549
|
}
|
|
1501
|
-
class
|
|
1550
|
+
class fs {
|
|
1502
1551
|
constructor(t, e, r, s, i) {
|
|
1503
|
-
this._target = t, this._gestureKey = s, this._ctrl = new
|
|
1552
|
+
this._target = t, this._gestureKey = s, this._ctrl = new os(e), this._ctrl.applyHandlers(e, i), this._ctrl.applyConfig(Pe(Pe({}, r), {}, {
|
|
1504
1553
|
target: t
|
|
1505
1554
|
}), s), this._ctrl.effect();
|
|
1506
1555
|
}
|
|
@@ -1508,25 +1557,28 @@ class fr {
|
|
|
1508
1557
|
this._ctrl.clean();
|
|
1509
1558
|
}
|
|
1510
1559
|
setConfig(t) {
|
|
1511
|
-
this._ctrl.clean(), this._ctrl.applyConfig(
|
|
1560
|
+
this._ctrl.clean(), this._ctrl.applyConfig(Pe(Pe({}, t), {}, {
|
|
1512
1561
|
target: this._target
|
|
1513
1562
|
}), this._gestureKey), this._ctrl.effect();
|
|
1514
1563
|
}
|
|
1515
1564
|
}
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1565
|
+
const qe = function(t, e, r) {
|
|
1566
|
+
return Zr(Qr), new fs(t, {
|
|
1518
1567
|
drag: e
|
|
1519
1568
|
}, r || {}, "drag");
|
|
1520
1569
|
};
|
|
1521
|
-
function
|
|
1570
|
+
function Hn(...n) {
|
|
1522
1571
|
const t = n.filter(Boolean);
|
|
1523
1572
|
return t.length <= 1 ? t[0] || null : function(r) {
|
|
1524
1573
|
for (const s of t)
|
|
1525
1574
|
typeof s == "function" ? s(r) : s && (s.current = r);
|
|
1526
1575
|
};
|
|
1527
1576
|
}
|
|
1528
|
-
const
|
|
1529
|
-
|
|
1577
|
+
const Bn = ({
|
|
1578
|
+
children: n,
|
|
1579
|
+
...t
|
|
1580
|
+
}) => {
|
|
1581
|
+
const e = Zt.Children.only(n), r = ds(e), s = e.props || {}, i = s.style || {}, o = {
|
|
1530
1582
|
...t,
|
|
1531
1583
|
...s,
|
|
1532
1584
|
// child's own props take precedence
|
|
@@ -1534,304 +1586,443 @@ const Xe = ({ children: n, ...t }) => {
|
|
|
1534
1586
|
...t.style ?? {},
|
|
1535
1587
|
...i
|
|
1536
1588
|
},
|
|
1537
|
-
ref:
|
|
1589
|
+
ref: Hn(r, t.ref)
|
|
1538
1590
|
};
|
|
1539
|
-
return
|
|
1591
|
+
return Zt.cloneElement(e, o);
|
|
1540
1592
|
};
|
|
1541
|
-
function
|
|
1542
|
-
|
|
1543
|
-
let t = (r = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : r.get;
|
|
1593
|
+
function ds(n) {
|
|
1594
|
+
let t = Object.getOwnPropertyDescriptor(n, "ref")?.get;
|
|
1544
1595
|
return t && "isReactWarning" in t && t.isReactWarning ? n.props.ref : n.props.ref || n.ref;
|
|
1545
1596
|
}
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1597
|
+
const hs = ({
|
|
1598
|
+
children: n,
|
|
1599
|
+
interactRef: t,
|
|
1600
|
+
draggable: e,
|
|
1601
|
+
resizable: r,
|
|
1602
|
+
draggableOptions: s,
|
|
1603
|
+
resizableOptions: i
|
|
1604
|
+
}) => {
|
|
1605
|
+
const o = Q(null), c = Q(void 0), a = Q(void 0), f = Q(void 0), l = Q(void 0), m = Q(void 0), d = Q(null), g = Q(null);
|
|
1606
|
+
Vt(() => {
|
|
1607
|
+
c.current = s, a.current = i;
|
|
1550
1608
|
}, [s, i]);
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1609
|
+
const v = Zn(() => {
|
|
1610
|
+
o.current && (e && c.current && (f.current = new qe(o.current, (p) => {
|
|
1611
|
+
const {
|
|
1612
|
+
active: b,
|
|
1613
|
+
delta: w,
|
|
1614
|
+
xy: h,
|
|
1615
|
+
event: x,
|
|
1616
|
+
first: O,
|
|
1617
|
+
last: _
|
|
1618
|
+
} = p, y = x?.target;
|
|
1619
|
+
if (y && (y === d.current || y === g.current || d.current && d.current.contains(y) || g.current && g.current.contains(y)))
|
|
1620
|
+
return;
|
|
1621
|
+
const E = {
|
|
1622
|
+
target: o.current,
|
|
1623
|
+
dx: w[0],
|
|
1624
|
+
dy: w[1],
|
|
1625
|
+
clientX: h[0],
|
|
1626
|
+
clientY: h[1]
|
|
1627
|
+
};
|
|
1628
|
+
O ? c.current?.onstart?.(E) : _ ? c.current?.onend?.(E) : b && c.current?.onmove?.(E);
|
|
1629
|
+
}, {
|
|
1630
|
+
axis: c.current?.lockAxis === "x" ? "x" : void 0,
|
|
1631
|
+
pointer: {
|
|
1632
|
+
capture: !0
|
|
1572
1633
|
}
|
|
1573
|
-
)), r &&
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1634
|
+
})), r && a.current?.edges && (a.current.edges.left && (d.current || (d.current = o.current.querySelector(a.current.edges.left)), l.current = new qe(d.current, (p) => {
|
|
1635
|
+
const {
|
|
1636
|
+
active: b,
|
|
1637
|
+
delta: w,
|
|
1638
|
+
xy: h,
|
|
1639
|
+
first: x,
|
|
1640
|
+
last: O
|
|
1641
|
+
} = p, _ = {
|
|
1642
|
+
target: o.current,
|
|
1643
|
+
dx: w[0],
|
|
1644
|
+
dy: 0,
|
|
1645
|
+
clientX: h[0],
|
|
1646
|
+
clientY: h[1],
|
|
1647
|
+
edges: {
|
|
1648
|
+
left: !0
|
|
1649
|
+
},
|
|
1650
|
+
deltaRect: {
|
|
1651
|
+
left: w[0]
|
|
1652
|
+
}
|
|
1653
|
+
};
|
|
1654
|
+
O ? a.current?.onend?.(_) : x ? a.current?.onstart?.(_) : b && a.current?.onmove?.(_);
|
|
1655
|
+
}, {
|
|
1656
|
+
pointer: {
|
|
1657
|
+
capture: !0
|
|
1658
|
+
}
|
|
1659
|
+
})), a.current.edges.right && (g.current || (g.current = o.current.querySelector(a.current.edges.right)), m.current = new qe(g.current, (p) => {
|
|
1660
|
+
const {
|
|
1661
|
+
active: b,
|
|
1662
|
+
delta: w,
|
|
1663
|
+
xy: h,
|
|
1664
|
+
first: x,
|
|
1665
|
+
last: O
|
|
1666
|
+
} = p, _ = {
|
|
1667
|
+
target: o.current,
|
|
1668
|
+
dx: w[0],
|
|
1669
|
+
dy: 0,
|
|
1670
|
+
clientX: h[0],
|
|
1671
|
+
clientY: h[1],
|
|
1672
|
+
edges: {
|
|
1673
|
+
right: !0
|
|
1674
|
+
},
|
|
1675
|
+
deltaRect: {
|
|
1676
|
+
right: w[0]
|
|
1677
|
+
}
|
|
1678
|
+
};
|
|
1679
|
+
O ? a.current?.onend?.(_) : x ? a.current?.onstart?.(_) : b && a.current?.onmove?.(_);
|
|
1680
|
+
}, {
|
|
1681
|
+
pointer: {
|
|
1682
|
+
capture: !0
|
|
1683
|
+
}
|
|
1684
|
+
}))));
|
|
1606
1685
|
});
|
|
1607
|
-
return
|
|
1608
|
-
var m, h, v;
|
|
1686
|
+
return Vt(() => {
|
|
1609
1687
|
if (!o.current) return;
|
|
1610
|
-
|
|
1611
|
-
const
|
|
1688
|
+
f.current?.destroy(), l.current?.destroy(), m.current?.destroy();
|
|
1689
|
+
const p = {
|
|
1612
1690
|
target: o.current,
|
|
1613
1691
|
unset: () => {
|
|
1614
|
-
|
|
1615
|
-
(x = u.current) == null || x.destroy(), (T = a.current) == null || T.destroy(), (b = g.current) == null || b.destroy();
|
|
1692
|
+
f.current?.destroy(), l.current?.destroy(), m.current?.destroy();
|
|
1616
1693
|
}
|
|
1617
1694
|
};
|
|
1618
|
-
t && (t.current =
|
|
1619
|
-
}, [e, r, t]),
|
|
1620
|
-
}, Ge = Mt.forwardRef(
|
|
1621
|
-
({
|
|
1695
|
+
t && (t.current = p), v();
|
|
1696
|
+
}, [e, r, t]), Bn({
|
|
1622
1697
|
children: n,
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1698
|
+
ref: o,
|
|
1699
|
+
draggable: !1,
|
|
1700
|
+
style: {
|
|
1701
|
+
...e && {
|
|
1702
|
+
touchAction: "none"
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
}, Xn = Zt.forwardRef((n, t) => {
|
|
1707
|
+
const e = Qt.c(72), {
|
|
1708
|
+
children: r,
|
|
1709
|
+
edges: s,
|
|
1710
|
+
left: i,
|
|
1711
|
+
width: o,
|
|
1712
|
+
start: c,
|
|
1713
|
+
grid: a,
|
|
1714
|
+
bounds: f,
|
|
1715
|
+
enableResizing: l,
|
|
1716
|
+
enableDragging: m,
|
|
1717
|
+
adsorptionDistance: d,
|
|
1718
|
+
adsorptionPositions: g,
|
|
1719
|
+
onResizeStart: v,
|
|
1637
1720
|
onResize: p,
|
|
1638
|
-
onResizeEnd:
|
|
1639
|
-
onDragStart:
|
|
1640
|
-
onDragEnd:
|
|
1641
|
-
onDrag:
|
|
1642
|
-
parentRef:
|
|
1643
|
-
deltaScrollLeft:
|
|
1644
|
-
},
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
if (!((_ = T.current) != null && _.target)) return 0;
|
|
1665
|
-
const d = T.current.target;
|
|
1666
|
-
return parseFloat(((E = d == null ? void 0 : d.dataset) == null ? void 0 : E.left) || "0");
|
|
1667
|
-
}, st = () => {
|
|
1668
|
-
var _, E;
|
|
1669
|
-
if (!((_ = T.current) != null && _.target)) return 0;
|
|
1670
|
-
const d = T.current.target;
|
|
1671
|
-
return parseFloat(((E = d == null ? void 0 : d.dataset) == null ? void 0 : E.width) || "0");
|
|
1721
|
+
onResizeEnd: b,
|
|
1722
|
+
onDragStart: w,
|
|
1723
|
+
onDragEnd: h,
|
|
1724
|
+
onDrag: x,
|
|
1725
|
+
parentRef: O,
|
|
1726
|
+
deltaScrollLeft: _
|
|
1727
|
+
} = n, y = c === void 0 ? Ue : c, E = a === void 0 ? Ze : a;
|
|
1728
|
+
let P;
|
|
1729
|
+
e[0] !== f ? (P = f === void 0 ? {
|
|
1730
|
+
left: Number.MIN_SAFE_INTEGER,
|
|
1731
|
+
right: Number.MAX_SAFE_INTEGER
|
|
1732
|
+
} : f, e[0] = f, e[1] = P) : P = e[1];
|
|
1733
|
+
const C = P, H = l === void 0 ? !0 : l, X = m === void 0 ? !0 : m, z = d === void 0 ? Qe : d;
|
|
1734
|
+
let F;
|
|
1735
|
+
e[2] !== g ? (F = g === void 0 ? [] : g, e[2] = g, e[3] = F) : F = e[3];
|
|
1736
|
+
const q = F, S = Q(void 0), R = Q(0), M = Q(!1), {
|
|
1737
|
+
initAutoScroll: U,
|
|
1738
|
+
dealDragAutoScroll: ft,
|
|
1739
|
+
dealResizeAutoScroll: gt,
|
|
1740
|
+
stopAutoScroll: u
|
|
1741
|
+
} = vr(O);
|
|
1742
|
+
let T, I;
|
|
1743
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (T = () => {
|
|
1744
|
+
const L = S.current;
|
|
1745
|
+
return () => {
|
|
1746
|
+
L?.unset();
|
|
1672
1747
|
};
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1748
|
+
}, I = [], e[4] = T, e[5] = I) : (T = e[4], I = e[5]), Vt(T, I);
|
|
1749
|
+
let V;
|
|
1750
|
+
e[6] === Symbol.for("react.memo_cache_sentinel") ? (V = (L, K) => {
|
|
1751
|
+
const B = K === void 0 ? !0 : K;
|
|
1752
|
+
if (!S.current || !S.current.target)
|
|
1753
|
+
return;
|
|
1754
|
+
B && (R.current = 0);
|
|
1755
|
+
const W = S.current.target;
|
|
1756
|
+
W.style.left = `${L}px`, Object.assign(W.dataset, {
|
|
1757
|
+
left: L
|
|
1758
|
+
});
|
|
1759
|
+
}, e[6] = V) : V = e[6];
|
|
1760
|
+
const _t = V;
|
|
1761
|
+
let vt;
|
|
1762
|
+
e[7] === Symbol.for("react.memo_cache_sentinel") ? (vt = (L, K) => {
|
|
1763
|
+
const B = K === void 0 ? !0 : K;
|
|
1764
|
+
if (!S.current || !S.current.target)
|
|
1765
|
+
return;
|
|
1766
|
+
B && (R.current = 0);
|
|
1767
|
+
const W = S.current.target;
|
|
1768
|
+
W.style.width = `${L}px`, Object.assign(W.dataset, {
|
|
1769
|
+
width: L
|
|
1770
|
+
});
|
|
1771
|
+
}, e[7] = vt) : vt = e[7];
|
|
1772
|
+
const D = vt;
|
|
1773
|
+
let rt;
|
|
1774
|
+
e[8] === Symbol.for("react.memo_cache_sentinel") ? (rt = () => {
|
|
1775
|
+
if (!S.current?.target)
|
|
1776
|
+
return 0;
|
|
1777
|
+
const L = S.current.target;
|
|
1778
|
+
return parseFloat(L?.dataset?.left || "0");
|
|
1779
|
+
}, e[8] = rt) : rt = e[8];
|
|
1780
|
+
const $ = rt;
|
|
1781
|
+
let k;
|
|
1782
|
+
e[9] === Symbol.for("react.memo_cache_sentinel") ? (k = () => {
|
|
1783
|
+
if (!S.current?.target)
|
|
1784
|
+
return 0;
|
|
1785
|
+
const L = S.current.target;
|
|
1786
|
+
return parseFloat(L?.dataset?.width || "0");
|
|
1787
|
+
}, e[9] = k) : k = e[9];
|
|
1788
|
+
const j = k;
|
|
1789
|
+
let jt, Ut;
|
|
1790
|
+
e[10] !== o ? (jt = () => {
|
|
1791
|
+
if (!S.current?.target)
|
|
1792
|
+
return;
|
|
1793
|
+
const L = S.current.target;
|
|
1794
|
+
D(typeof o > "u" ? L.offsetWidth : o, !1);
|
|
1795
|
+
}, Ut = [o], e[10] = o, e[11] = jt, e[12] = Ut) : (jt = e[11], Ut = e[12]), Vt(jt, Ut);
|
|
1796
|
+
let It, xt;
|
|
1797
|
+
e[13] !== i ? (It = () => {
|
|
1798
|
+
_t(i || 0, !1);
|
|
1799
|
+
}, xt = [i], e[13] = i, e[14] = It, e[15] = xt) : (It = e[14], xt = e[15]), Vt(It, xt);
|
|
1800
|
+
let Rt;
|
|
1801
|
+
e[16] === Symbol.for("react.memo_cache_sentinel") ? (Rt = () => ({
|
|
1802
|
+
updateLeft: (L) => _t(L || 0, !1),
|
|
1803
|
+
updateWidth: (L) => D(L, !1),
|
|
1804
|
+
getLeft: $,
|
|
1805
|
+
getWidth: j
|
|
1806
|
+
}), e[16] = Rt) : Rt = e[16], nn(t, Rt);
|
|
1807
|
+
let At;
|
|
1808
|
+
e[17] !== U || e[18] !== w ? (At = () => {
|
|
1809
|
+
R.current = 0, M.current = !1, U(), w && w();
|
|
1810
|
+
}, e[17] = U, e[18] = w, e[19] = At) : At = e[19];
|
|
1811
|
+
const Wt = At;
|
|
1812
|
+
let Ot;
|
|
1813
|
+
e[20] !== z || e[21] !== q || e[22] !== C || e[23] !== E || e[24] !== x || e[25] !== y ? (Ot = (L) => {
|
|
1814
|
+
const {
|
|
1815
|
+
preLeft: K,
|
|
1816
|
+
preWidth: B,
|
|
1817
|
+
scrollDelta: W
|
|
1818
|
+
} = L, tt = M.current ? z : E;
|
|
1819
|
+
if (Math.abs(R.current) >= tt) {
|
|
1820
|
+
const lt = parseInt(R.current / tt + "");
|
|
1821
|
+
let A = K + lt * tt, et = A;
|
|
1822
|
+
const ot = Number.MAX_SAFE_INTEGER;
|
|
1823
|
+
if (q.forEach((G) => {
|
|
1824
|
+
const ct = Math.abs(G - A);
|
|
1825
|
+
ct < z && ct < ot && (et = G);
|
|
1826
|
+
const dt = Math.abs(G - (A + B));
|
|
1827
|
+
dt < z && dt < ot && (et = G - B);
|
|
1828
|
+
}), et !== A ? (M.current = !0, A = et) : ((A - y) % E !== 0 && (A = y + E * Math.round((A - y) / E)), M.current = !1), R.current = R.current % tt, A < C.left ? A = C.left : A + B > C.right && (A = C.right - B), x && x({
|
|
1829
|
+
lastLeft: K,
|
|
1830
|
+
left: A,
|
|
1831
|
+
lastWidth: B,
|
|
1832
|
+
width: B
|
|
1833
|
+
}, W) === !1)
|
|
1718
1834
|
return;
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1835
|
+
_t(A, !1);
|
|
1836
|
+
}
|
|
1837
|
+
}, e[20] = z, e[21] = q, e[22] = C, e[23] = E, e[24] = x, e[25] = y, e[26] = Ot) : Ot = e[26];
|
|
1838
|
+
const Ct = Ot;
|
|
1839
|
+
let Dt;
|
|
1840
|
+
e[27] !== ft || e[28] !== _ || e[29] !== Ct || e[30] !== O ? (Dt = (L) => {
|
|
1841
|
+
const K = L.target;
|
|
1842
|
+
if (_ && O?.current && !ft(L, (et) => {
|
|
1843
|
+
_(et);
|
|
1844
|
+
const {
|
|
1845
|
+
left: ot,
|
|
1846
|
+
width: G
|
|
1847
|
+
} = K.dataset, ct = parseFloat(ot || "0"), dt = parseFloat(G || "0");
|
|
1848
|
+
R.current = R.current + et, Ct({
|
|
1849
|
+
preLeft: ct,
|
|
1850
|
+
preWidth: dt,
|
|
1851
|
+
scrollDelta: et
|
|
1852
|
+
});
|
|
1853
|
+
}))
|
|
1854
|
+
return;
|
|
1855
|
+
const {
|
|
1856
|
+
left: B,
|
|
1857
|
+
width: W
|
|
1858
|
+
} = K.dataset, tt = parseFloat(B || "0"), lt = parseFloat(W || "0");
|
|
1859
|
+
R.current = R.current + L.dx, Ct({
|
|
1860
|
+
preLeft: tt,
|
|
1861
|
+
preWidth: lt
|
|
1862
|
+
});
|
|
1863
|
+
}, e[27] = ft, e[28] = _, e[29] = Ct, e[30] = O, e[31] = Dt) : Dt = e[31];
|
|
1864
|
+
const te = Dt;
|
|
1865
|
+
let J;
|
|
1866
|
+
e[32] !== h || e[33] !== u ? (J = (L) => {
|
|
1867
|
+
R.current = 0, M.current = !1, u();
|
|
1868
|
+
const K = L.target, {
|
|
1869
|
+
left: B,
|
|
1870
|
+
width: W
|
|
1871
|
+
} = K.dataset;
|
|
1872
|
+
h && h({
|
|
1873
|
+
left: parseFloat(B || "0"),
|
|
1874
|
+
width: parseFloat(W || "0")
|
|
1875
|
+
});
|
|
1876
|
+
}, e[32] = h, e[33] = u, e[34] = J) : J = e[34];
|
|
1877
|
+
const Z = J;
|
|
1878
|
+
let Y;
|
|
1879
|
+
e[35] !== U || e[36] !== v ? (Y = (L) => {
|
|
1880
|
+
R.current = 0, M.current = !1, U();
|
|
1881
|
+
const K = L.edges?.right ? "right" : "left";
|
|
1882
|
+
v && v(K);
|
|
1883
|
+
}, e[35] = U, e[36] = v, e[37] = Y) : Y = e[37];
|
|
1884
|
+
const it = Y;
|
|
1885
|
+
let bt;
|
|
1886
|
+
e[38] !== z || e[39] !== q || e[40] !== C || e[41] !== E || e[42] !== p || e[43] !== y ? (bt = (L) => {
|
|
1887
|
+
const {
|
|
1888
|
+
dir: K,
|
|
1889
|
+
preWidth: B,
|
|
1890
|
+
preLeft: W
|
|
1891
|
+
} = L, tt = M.current ? z : E;
|
|
1892
|
+
if (K === "left") {
|
|
1893
|
+
if (Math.abs(R.current) >= tt) {
|
|
1894
|
+
const lt = parseInt(R.current / tt + "");
|
|
1895
|
+
let A = W + lt * tt, et = A;
|
|
1896
|
+
const ot = Number.MAX_SAFE_INTEGER;
|
|
1897
|
+
q.forEach((dt) => {
|
|
1898
|
+
const Nt = Math.abs(dt - A);
|
|
1899
|
+
Nt < z && Nt < ot && (et = dt);
|
|
1900
|
+
}), et !== A ? (M.current = !0, A = et) : ((A - y) % E !== 0 && (A = y + E * Math.round((A - y) / E)), M.current = !1), R.current = R.current % tt;
|
|
1901
|
+
const G = W + B;
|
|
1902
|
+
A < C.left && (A = C.left);
|
|
1903
|
+
const ct = G - A;
|
|
1904
|
+
if (p && p("left", {
|
|
1905
|
+
lastLeft: W,
|
|
1906
|
+
lastWidth: B,
|
|
1907
|
+
left: A,
|
|
1908
|
+
width: ct
|
|
1771
1909
|
}) === !1)
|
|
1772
1910
|
return;
|
|
1773
|
-
|
|
1911
|
+
_t(A, !1), D(ct, !1);
|
|
1774
1912
|
}
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1913
|
+
} else if (K === "right" && Math.abs(R.current) >= tt) {
|
|
1914
|
+
const lt = parseInt(R.current / E + "");
|
|
1915
|
+
let A = B + lt * E, et = W + A;
|
|
1916
|
+
const ot = Number.MAX_SAFE_INTEGER;
|
|
1917
|
+
if (q.forEach((G) => {
|
|
1918
|
+
const ct = Math.abs(G - (W + A));
|
|
1919
|
+
ct < z && ct < ot && (et = G);
|
|
1920
|
+
}), et !== W + A)
|
|
1921
|
+
M.current = !0, A = et - W;
|
|
1922
|
+
else {
|
|
1923
|
+
let G = W + A;
|
|
1924
|
+
(G - y) % E !== 0 && (G = y + E * Math.round((G - y) / E), A = G - W), M.current = !1;
|
|
1925
|
+
}
|
|
1926
|
+
if (R.current = R.current % tt, W + A > C.right && (A = C.right - W), p && p("right", {
|
|
1927
|
+
lastLeft: W,
|
|
1928
|
+
lastWidth: B,
|
|
1929
|
+
left: W,
|
|
1930
|
+
width: A
|
|
1931
|
+
}) === !1)
|
|
1784
1932
|
return;
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1933
|
+
D(A, !1);
|
|
1934
|
+
}
|
|
1935
|
+
}, e[38] = z, e[39] = q, e[40] = C, e[41] = E, e[42] = p, e[43] = y, e[44] = bt) : bt = e[44];
|
|
1936
|
+
const Tt = bt;
|
|
1937
|
+
let Pt;
|
|
1938
|
+
e[45] !== gt || e[46] !== _ || e[47] !== O || e[48] !== Tt ? (Pt = (L) => {
|
|
1939
|
+
const K = L.target, B = L.edges?.left ? "left" : "right";
|
|
1940
|
+
if (_ && O?.current && !gt(L, B, (ot) => {
|
|
1941
|
+
_(ot);
|
|
1942
|
+
const {
|
|
1943
|
+
left: G,
|
|
1944
|
+
width: ct
|
|
1945
|
+
} = K.dataset, dt = parseFloat(G || "0"), Nt = parseFloat(ct || "0");
|
|
1946
|
+
R.current = R.current + ot, Tt({
|
|
1947
|
+
preLeft: dt,
|
|
1948
|
+
preWidth: Nt,
|
|
1949
|
+
dir: B
|
|
1796
1950
|
});
|
|
1797
|
-
}
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1951
|
+
}))
|
|
1952
|
+
return;
|
|
1953
|
+
const {
|
|
1954
|
+
left: W,
|
|
1955
|
+
width: tt
|
|
1956
|
+
} = K.dataset, lt = parseFloat(W || "0"), A = parseFloat(tt || "0");
|
|
1957
|
+
R.current = R.current + (B === "left" ? L.deltaRect?.left || 0 : L.deltaRect?.right || 0), Tt({
|
|
1958
|
+
preLeft: lt,
|
|
1959
|
+
preWidth: A,
|
|
1960
|
+
dir: B
|
|
1961
|
+
});
|
|
1962
|
+
}, e[45] = gt, e[46] = _, e[47] = O, e[48] = Tt, e[49] = Pt) : Pt = e[49];
|
|
1963
|
+
const Ht = Pt;
|
|
1964
|
+
let Bt;
|
|
1965
|
+
e[50] !== b || e[51] !== u ? (Bt = (L) => {
|
|
1966
|
+
R.current = 0, M.current = !1, u();
|
|
1967
|
+
const K = L.target, {
|
|
1968
|
+
left: B,
|
|
1969
|
+
width: W
|
|
1970
|
+
} = K.dataset, tt = L.edges?.right ? "right" : "left";
|
|
1971
|
+
b && b(tt, {
|
|
1972
|
+
left: parseFloat(B || "0"),
|
|
1973
|
+
width: parseFloat(W || "0")
|
|
1974
|
+
});
|
|
1975
|
+
}, e[50] = b, e[51] = u, e[52] = Bt) : Bt = e[52];
|
|
1976
|
+
const ee = Bt;
|
|
1977
|
+
let kt;
|
|
1978
|
+
e[53] !== te || e[54] !== Wt || e[55] !== Z ? (kt = {
|
|
1979
|
+
lockAxis: "x",
|
|
1980
|
+
onmove: te,
|
|
1981
|
+
onstart: Wt,
|
|
1982
|
+
onend: Z,
|
|
1983
|
+
cursorChecker: ms
|
|
1984
|
+
}, e[53] = te, e[54] = Wt, e[55] = Z, e[56] = kt) : kt = e[56];
|
|
1985
|
+
let zt;
|
|
1986
|
+
e[57] !== s || e[58] !== Ht || e[59] !== it || e[60] !== ee ? (zt = {
|
|
1987
|
+
axis: "x",
|
|
1988
|
+
invert: "none",
|
|
1989
|
+
edges: s,
|
|
1990
|
+
onmove: Ht,
|
|
1991
|
+
onstart: it,
|
|
1992
|
+
onend: ee
|
|
1993
|
+
}, e[57] = s, e[58] = Ht, e[59] = it, e[60] = ee, e[61] = zt) : zt = e[61];
|
|
1994
|
+
const Yt = r;
|
|
1995
|
+
let Ft;
|
|
1996
|
+
e[62] !== i || e[63] !== Yt || e[64] !== o ? (Ft = Bn({
|
|
1997
|
+
children: Yt,
|
|
1998
|
+
style: {
|
|
1999
|
+
left: i,
|
|
2000
|
+
width: o
|
|
2001
|
+
}
|
|
2002
|
+
}), e[62] = i, e[63] = Yt, e[64] = o, e[65] = Ft) : Ft = e[65];
|
|
2003
|
+
let Xt;
|
|
2004
|
+
return e[66] !== X || e[67] !== H || e[68] !== kt || e[69] !== zt || e[70] !== Ft ? (Xt = /* @__PURE__ */ N.jsx(hs, { interactRef: S, draggable: X, resizable: H, draggableOptions: kt, resizableOptions: zt, children: Ft }), e[66] = X, e[67] = H, e[68] = kt, e[69] = zt, e[70] = Ft, e[71] = Xt) : Xt = e[71], Xt;
|
|
2005
|
+
});
|
|
2006
|
+
function ms() {
|
|
2007
|
+
return "";
|
|
2008
|
+
}
|
|
2009
|
+
const Yn = Jt.forwardRef(({
|
|
2010
|
+
children: n
|
|
2011
|
+
}, t) => {
|
|
2012
|
+
const [e, r] = Jt.useState({
|
|
1825
2013
|
clientHeight: 0,
|
|
1826
2014
|
clientWidth: 0,
|
|
1827
2015
|
scrollHeight: 0,
|
|
1828
2016
|
scrollLeft: 0,
|
|
1829
2017
|
scrollTop: 0,
|
|
1830
2018
|
scrollWidth: 0
|
|
1831
|
-
}), s =
|
|
1832
|
-
r((o) => ({
|
|
2019
|
+
}), s = Jt.useCallback((i) => {
|
|
2020
|
+
r((o) => ({
|
|
2021
|
+
...o,
|
|
2022
|
+
...i
|
|
2023
|
+
}));
|
|
1833
2024
|
}, []);
|
|
1834
|
-
return
|
|
2025
|
+
return Jt.useImperativeHandle(t, () => ({
|
|
1835
2026
|
get state() {
|
|
1836
2027
|
return e;
|
|
1837
2028
|
},
|
|
@@ -1842,164 +2033,150 @@ const hr = ({ children: n, interactRef: t, draggable: e, resizable: r, draggable
|
|
|
1842
2033
|
onScroll: s
|
|
1843
2034
|
});
|
|
1844
2035
|
});
|
|
1845
|
-
|
|
1846
|
-
const
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
);
|
|
2036
|
+
Yn.displayName = "ScrollSync";
|
|
2037
|
+
const ps = (n) => {
|
|
2038
|
+
const t = Qt.c(42), {
|
|
2039
|
+
disableDrag: e,
|
|
2040
|
+
cursorTime: r,
|
|
2041
|
+
setCursor: s,
|
|
2042
|
+
startLeft: i,
|
|
2043
|
+
timelineWidth: o,
|
|
2044
|
+
scaleWidth: c,
|
|
2045
|
+
scale: a,
|
|
2046
|
+
scrollLeft: f,
|
|
2047
|
+
scrollSync: l,
|
|
2048
|
+
areaRef: m,
|
|
2049
|
+
maxScaleCount: d,
|
|
2050
|
+
deltaScrollLeft: g,
|
|
2051
|
+
onCursorDragStart: v,
|
|
2052
|
+
onCursorDrag: p,
|
|
2053
|
+
onCursorDragEnd: b
|
|
2054
|
+
} = n, w = Q(null), h = Q(void 0);
|
|
2055
|
+
let x, O;
|
|
2056
|
+
t[0] !== r || t[1] !== a || t[2] !== c || t[3] !== f || t[4] !== i ? (x = () => {
|
|
2057
|
+
if (typeof h.current > "u" && w.current) {
|
|
2058
|
+
const ft = i ?? 20, gt = c ?? 160, u = a ?? 1;
|
|
2059
|
+
w.current.updateLeft($t(r, {
|
|
2060
|
+
startLeft: ft,
|
|
2061
|
+
scaleWidth: gt,
|
|
2062
|
+
scale: u
|
|
2063
|
+
}) - f);
|
|
1874
2064
|
}
|
|
1875
|
-
}, [
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
if (typeof m.current < "u") {
|
|
1903
|
-
const b = Tt(m.current + c, {
|
|
1904
|
-
startLeft: h,
|
|
1905
|
-
scale: x,
|
|
1906
|
-
scaleWidth: v
|
|
1907
|
-
});
|
|
1908
|
-
e({ time: b }), S && S(b);
|
|
1909
|
-
}
|
|
1910
|
-
m.current = void 0;
|
|
1911
|
-
},
|
|
1912
|
-
onDrag: ({ left: b }, C = 0) => {
|
|
1913
|
-
var k, N;
|
|
1914
|
-
if (!((k = l.current) != null && k.state)) return !1;
|
|
1915
|
-
const I = l.current.state.scrollLeft;
|
|
1916
|
-
if (!C || I === 0 ? b < h - I ? m.current = h - I : m.current = b : typeof m.current < "u" && m.current < h - I - C && (m.current = h - I - C), typeof m.current < "u") {
|
|
1917
|
-
(N = y.current) == null || N.updateLeft(m.current);
|
|
1918
|
-
const L = Tt(
|
|
1919
|
-
m.current + I,
|
|
1920
|
-
{ startLeft: h, scale: x, scaleWidth: v }
|
|
1921
|
-
);
|
|
1922
|
-
e({ time: L }), O && O(L);
|
|
1923
|
-
}
|
|
1924
|
-
return !1;
|
|
1925
|
-
},
|
|
1926
|
-
children: /* @__PURE__ */ P.jsxs("div", { className: tt("cursor"), children: [
|
|
1927
|
-
/* @__PURE__ */ P.jsx(
|
|
1928
|
-
"svg",
|
|
1929
|
-
{
|
|
1930
|
-
className: tt("cursor-top"),
|
|
1931
|
-
width: "8",
|
|
1932
|
-
height: "12",
|
|
1933
|
-
viewBox: "0 0 8 12",
|
|
1934
|
-
fill: "none",
|
|
1935
|
-
children: /* @__PURE__ */ P.jsx(
|
|
1936
|
-
"path",
|
|
1937
|
-
{
|
|
1938
|
-
d: "M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z",
|
|
1939
|
-
fill: "#5297FF"
|
|
1940
|
-
}
|
|
1941
|
-
)
|
|
1942
|
-
}
|
|
1943
|
-
),
|
|
1944
|
-
/* @__PURE__ */ P.jsx("div", { className: tt("cursor-area") })
|
|
1945
|
-
] })
|
|
2065
|
+
}, O = [r, i, c, a, f], t[0] = r, t[1] = a, t[2] = c, t[3] = f, t[4] = i, t[5] = x, t[6] = O) : (x = t[5], O = t[6]), Vt(x, O);
|
|
2066
|
+
const _ = i ?? 20, y = c ?? 160, E = a ?? 1, C = Math.min(o, (d ?? 1 / 0) * y + _ - f);
|
|
2067
|
+
let H;
|
|
2068
|
+
t[7] !== C ? (H = {
|
|
2069
|
+
left: 0,
|
|
2070
|
+
right: C
|
|
2071
|
+
}, t[7] = C, t[8] = H) : H = t[8];
|
|
2072
|
+
const X = !e;
|
|
2073
|
+
let z;
|
|
2074
|
+
t[9] !== r || t[10] !== _ || t[11] !== v || t[12] !== E || t[13] !== f || t[14] !== y ? (z = () => {
|
|
2075
|
+
v && v(r), h.current = $t(r, {
|
|
2076
|
+
startLeft: _,
|
|
2077
|
+
scaleWidth: y,
|
|
2078
|
+
scale: E
|
|
2079
|
+
}) - f, w.current?.updateLeft(h.current);
|
|
2080
|
+
}, t[9] = r, t[10] = _, t[11] = v, t[12] = E, t[13] = f, t[14] = y, t[15] = z) : z = t[15];
|
|
2081
|
+
let F;
|
|
2082
|
+
t[16] !== _ || t[17] !== b || t[18] !== E || t[19] !== f || t[20] !== s || t[21] !== y ? (F = () => {
|
|
2083
|
+
if (typeof h.current < "u") {
|
|
2084
|
+
const ft = re(h.current + f, {
|
|
2085
|
+
startLeft: _,
|
|
2086
|
+
scale: E,
|
|
2087
|
+
scaleWidth: y
|
|
2088
|
+
});
|
|
2089
|
+
s({
|
|
2090
|
+
time: ft
|
|
2091
|
+
}), b && b(ft);
|
|
1946
2092
|
}
|
|
1947
|
-
|
|
2093
|
+
h.current = void 0;
|
|
2094
|
+
}, t[16] = _, t[17] = b, t[18] = E, t[19] = f, t[20] = s, t[21] = y, t[22] = F) : F = t[22];
|
|
2095
|
+
let q;
|
|
2096
|
+
t[23] !== _ || t[24] !== p || t[25] !== E || t[26] !== l.current || t[27] !== s || t[28] !== y ? (q = (ft, gt) => {
|
|
2097
|
+
const {
|
|
2098
|
+
left: u
|
|
2099
|
+
} = ft, T = gt === void 0 ? 0 : gt;
|
|
2100
|
+
if (!l.current?.state)
|
|
2101
|
+
return !1;
|
|
2102
|
+
const I = l.current.state.scrollLeft;
|
|
2103
|
+
if (!T || I === 0 ? u < _ - I ? h.current = _ - I : h.current = u : typeof h.current < "u" && h.current < _ - I - T && (h.current = _ - I - T), typeof h.current < "u") {
|
|
2104
|
+
w.current?.updateLeft(h.current);
|
|
2105
|
+
const V = re(h.current + I, {
|
|
2106
|
+
startLeft: _,
|
|
2107
|
+
scale: E,
|
|
2108
|
+
scaleWidth: y
|
|
2109
|
+
});
|
|
2110
|
+
s({
|
|
2111
|
+
time: V
|
|
2112
|
+
}), p && p(V);
|
|
2113
|
+
}
|
|
2114
|
+
return !1;
|
|
2115
|
+
}, t[23] = _, t[24] = p, t[25] = E, t[26] = l.current, t[27] = s, t[28] = y, t[29] = q) : q = t[29];
|
|
2116
|
+
let S, R;
|
|
2117
|
+
t[30] === Symbol.for("react.memo_cache_sentinel") ? (R = mt("cursor"), S = mt("cursor-top"), t[30] = S, t[31] = R) : (S = t[30], R = t[31]);
|
|
2118
|
+
let M;
|
|
2119
|
+
t[32] === Symbol.for("react.memo_cache_sentinel") ? (M = /* @__PURE__ */ N.jsxs("div", { className: R, children: [
|
|
2120
|
+
/* @__PURE__ */ N.jsx("svg", { className: S, width: "8", height: "12", viewBox: "0 0 8 12", fill: "none", children: /* @__PURE__ */ N.jsx("path", { d: "M0 1C0 0.447715 0.447715 0 1 0H7C7.55228 0 8 0.447715 8 1V9.38197C8 9.76074 7.786 10.107 7.44721 10.2764L4.44721 11.7764C4.16569 11.9172 3.83431 11.9172 3.55279 11.7764L0.552786 10.2764C0.214002 10.107 0 9.76074 0 9.38197V1Z", fill: "#5297FF" }) }),
|
|
2121
|
+
/* @__PURE__ */ N.jsx("div", { className: mt("cursor-area") })
|
|
2122
|
+
] }), t[32] = M) : M = t[32];
|
|
2123
|
+
let U;
|
|
2124
|
+
return t[33] !== m || t[34] !== g || t[35] !== _ || t[36] !== H || t[37] !== X || t[38] !== z || t[39] !== F || t[40] !== q ? (U = /* @__PURE__ */ N.jsx(Xn, { start: _, ref: w, parentRef: m, bounds: H, deltaScrollLeft: g, enableDragging: X, enableResizing: !1, onDragStart: z, onDragEnd: F, onDrag: q, children: M }), t[33] = m, t[34] = g, t[35] = _, t[36] = H, t[37] = X, t[38] = z, t[39] = F, t[40] = q, t[41] = U) : U = t[41], U;
|
|
1948
2125
|
};
|
|
1949
|
-
function
|
|
2126
|
+
function Se(n, t, e) {
|
|
1950
2127
|
let r = e.initialDeps ?? [], s;
|
|
1951
2128
|
function i() {
|
|
1952
|
-
var o, c,
|
|
1953
|
-
let
|
|
1954
|
-
e.key && ((o = e.debug) != null && o.call(e)) && (
|
|
1955
|
-
const
|
|
1956
|
-
if (!(
|
|
2129
|
+
var o, c, a, f;
|
|
2130
|
+
let l;
|
|
2131
|
+
e.key && ((o = e.debug) != null && o.call(e)) && (l = Date.now());
|
|
2132
|
+
const m = n();
|
|
2133
|
+
if (!(m.length !== r.length || m.some((v, p) => r[p] !== v)))
|
|
1957
2134
|
return s;
|
|
1958
|
-
r =
|
|
1959
|
-
let
|
|
1960
|
-
if (e.key && ((c = e.debug) != null && c.call(e)) && (
|
|
1961
|
-
const
|
|
1962
|
-
for (
|
|
1963
|
-
|
|
1964
|
-
return
|
|
2135
|
+
r = m;
|
|
2136
|
+
let g;
|
|
2137
|
+
if (e.key && ((c = e.debug) != null && c.call(e)) && (g = Date.now()), s = t(...m), e.key && ((a = e.debug) != null && a.call(e))) {
|
|
2138
|
+
const v = Math.round((Date.now() - l) * 100) / 100, p = Math.round((Date.now() - g) * 100) / 100, b = p / 16, w = (h, x) => {
|
|
2139
|
+
for (h = String(h); h.length < x; )
|
|
2140
|
+
h = " " + h;
|
|
2141
|
+
return h;
|
|
1965
2142
|
};
|
|
1966
2143
|
console.info(
|
|
1967
|
-
`%c⏱ ${
|
|
2144
|
+
`%c⏱ ${w(p, 5)} /${w(v, 5)} ms`,
|
|
1968
2145
|
`
|
|
1969
2146
|
font-size: .6rem;
|
|
1970
2147
|
font-weight: bold;
|
|
1971
2148
|
color: hsl(${Math.max(
|
|
1972
2149
|
0,
|
|
1973
|
-
Math.min(120 - 120 *
|
|
2150
|
+
Math.min(120 - 120 * b, 120)
|
|
1974
2151
|
)}deg 100% 31%);`,
|
|
1975
|
-
e
|
|
2152
|
+
e?.key
|
|
1976
2153
|
);
|
|
1977
2154
|
}
|
|
1978
|
-
return (
|
|
2155
|
+
return (f = e?.onChange) == null || f.call(e, s), s;
|
|
1979
2156
|
}
|
|
1980
2157
|
return i.updateDeps = (o) => {
|
|
1981
2158
|
r = o;
|
|
1982
2159
|
}, i;
|
|
1983
2160
|
}
|
|
1984
|
-
function
|
|
2161
|
+
function An(n, t) {
|
|
1985
2162
|
if (n === void 0)
|
|
1986
2163
|
throw new Error("Unexpected undefined");
|
|
1987
2164
|
return n;
|
|
1988
2165
|
}
|
|
1989
|
-
const
|
|
2166
|
+
const gs = (n, t) => Math.abs(n - t) < 1.01, _s = (n, t, e) => {
|
|
1990
2167
|
let r;
|
|
1991
2168
|
return function(...s) {
|
|
1992
2169
|
n.clearTimeout(r), r = n.setTimeout(() => t.apply(this, s), e);
|
|
1993
2170
|
};
|
|
1994
|
-
},
|
|
2171
|
+
}, On = (n) => {
|
|
1995
2172
|
const { offsetWidth: t, offsetHeight: e } = n;
|
|
1996
2173
|
return { width: t, height: e };
|
|
1997
|
-
},
|
|
2174
|
+
}, vs = (n) => n, bs = (n) => {
|
|
1998
2175
|
const t = Math.max(n.startIndex - n.overscan, 0), e = Math.min(n.endIndex + n.overscan, n.count - 1), r = [];
|
|
1999
2176
|
for (let s = t; s <= e; s++)
|
|
2000
2177
|
r.push(s);
|
|
2001
2178
|
return r;
|
|
2002
|
-
},
|
|
2179
|
+
}, ys = (n, t) => {
|
|
2003
2180
|
const e = n.scrollElement;
|
|
2004
2181
|
if (!e)
|
|
2005
2182
|
return;
|
|
@@ -2007,32 +2184,32 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
|
|
|
2007
2184
|
if (!r)
|
|
2008
2185
|
return;
|
|
2009
2186
|
const s = (o) => {
|
|
2010
|
-
const { width: c, height:
|
|
2011
|
-
t({ width: Math.round(c), height: Math.round(
|
|
2187
|
+
const { width: c, height: a } = o;
|
|
2188
|
+
t({ width: Math.round(c), height: Math.round(a) });
|
|
2012
2189
|
};
|
|
2013
|
-
if (s(
|
|
2190
|
+
if (s(On(e)), !r.ResizeObserver)
|
|
2014
2191
|
return () => {
|
|
2015
2192
|
};
|
|
2016
2193
|
const i = new r.ResizeObserver((o) => {
|
|
2017
2194
|
const c = () => {
|
|
2018
|
-
const
|
|
2019
|
-
if (
|
|
2020
|
-
const
|
|
2021
|
-
if (
|
|
2022
|
-
s({ width:
|
|
2195
|
+
const a = o[0];
|
|
2196
|
+
if (a?.borderBoxSize) {
|
|
2197
|
+
const f = a.borderBoxSize[0];
|
|
2198
|
+
if (f) {
|
|
2199
|
+
s({ width: f.inlineSize, height: f.blockSize });
|
|
2023
2200
|
return;
|
|
2024
2201
|
}
|
|
2025
2202
|
}
|
|
2026
|
-
s(
|
|
2203
|
+
s(On(e));
|
|
2027
2204
|
};
|
|
2028
2205
|
n.options.useAnimationFrameWithResizeObserver ? requestAnimationFrame(c) : c();
|
|
2029
2206
|
});
|
|
2030
2207
|
return i.observe(e, { box: "border-box" }), () => {
|
|
2031
2208
|
i.unobserve(e);
|
|
2032
2209
|
};
|
|
2033
|
-
},
|
|
2210
|
+
}, Cn = {
|
|
2034
2211
|
passive: !0
|
|
2035
|
-
},
|
|
2212
|
+
}, Dn = typeof window > "u" ? !0 : "onscrollend" in window, ws = (n, t) => {
|
|
2036
2213
|
const e = n.scrollElement;
|
|
2037
2214
|
if (!e)
|
|
2038
2215
|
return;
|
|
@@ -2040,24 +2217,24 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
|
|
|
2040
2217
|
if (!r)
|
|
2041
2218
|
return;
|
|
2042
2219
|
let s = 0;
|
|
2043
|
-
const i = n.options.useScrollendEvent &&
|
|
2044
|
-
} :
|
|
2220
|
+
const i = n.options.useScrollendEvent && Dn ? () => {
|
|
2221
|
+
} : _s(
|
|
2045
2222
|
r,
|
|
2046
2223
|
() => {
|
|
2047
2224
|
t(s, !1);
|
|
2048
2225
|
},
|
|
2049
2226
|
n.options.isScrollingResetDelay
|
|
2050
|
-
), o = (
|
|
2051
|
-
const { horizontal:
|
|
2052
|
-
s =
|
|
2053
|
-
}, c = o(!0),
|
|
2054
|
-
|
|
2055
|
-
const
|
|
2056
|
-
return
|
|
2057
|
-
e.removeEventListener("scroll", c),
|
|
2227
|
+
), o = (l) => () => {
|
|
2228
|
+
const { horizontal: m, isRtl: d } = n.options;
|
|
2229
|
+
s = m ? e.scrollLeft * (d && -1 || 1) : e.scrollTop, i(), t(s, l);
|
|
2230
|
+
}, c = o(!0), a = o(!1);
|
|
2231
|
+
a(), e.addEventListener("scroll", c, Cn);
|
|
2232
|
+
const f = n.options.useScrollendEvent && Dn;
|
|
2233
|
+
return f && e.addEventListener("scrollend", a, Cn), () => {
|
|
2234
|
+
e.removeEventListener("scroll", c), f && e.removeEventListener("scrollend", a);
|
|
2058
2235
|
};
|
|
2059
|
-
},
|
|
2060
|
-
if (t
|
|
2236
|
+
}, Es = (n, t, e) => {
|
|
2237
|
+
if (t?.borderBoxSize) {
|
|
2061
2238
|
const r = t.borderBoxSize[0];
|
|
2062
2239
|
if (r)
|
|
2063
2240
|
return Math.round(
|
|
@@ -2065,7 +2242,7 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
|
|
|
2065
2242
|
);
|
|
2066
2243
|
}
|
|
2067
2244
|
return n[e.options.horizontal ? "offsetWidth" : "offsetHeight"];
|
|
2068
|
-
},
|
|
2245
|
+
}, Ss = (n, {
|
|
2069
2246
|
adjustments: t = 0,
|
|
2070
2247
|
behavior: e
|
|
2071
2248
|
}, r) => {
|
|
@@ -2076,7 +2253,7 @@ const mr = (n, t) => Math.abs(n - t) < 1.01, gr = (n, t, e) => {
|
|
|
2076
2253
|
behavior: e
|
|
2077
2254
|
});
|
|
2078
2255
|
};
|
|
2079
|
-
class
|
|
2256
|
+
class xs {
|
|
2080
2257
|
constructor(t) {
|
|
2081
2258
|
this.unsubs = [], this.scrollElement = null, this.targetWindow = null, this.isScrolling = !1, this.measurementsCache = [], this.itemSizeCache = /* @__PURE__ */ new Map(), this.pendingMeasuredCacheIndexes = [], this.scrollRect = null, this.scrollOffset = null, this.scrollDirection = null, this.scrollAdjustments = 0, this.elementsCache = /* @__PURE__ */ new Map(), this.observer = /* @__PURE__ */ (() => {
|
|
2082
2259
|
let e = null;
|
|
@@ -2114,11 +2291,11 @@ class Sr {
|
|
|
2114
2291
|
scrollPaddingStart: 0,
|
|
2115
2292
|
scrollPaddingEnd: 0,
|
|
2116
2293
|
horizontal: !1,
|
|
2117
|
-
getItemKey:
|
|
2118
|
-
rangeExtractor:
|
|
2294
|
+
getItemKey: vs,
|
|
2295
|
+
rangeExtractor: bs,
|
|
2119
2296
|
onChange: () => {
|
|
2120
2297
|
},
|
|
2121
|
-
measureElement:
|
|
2298
|
+
measureElement: Es,
|
|
2122
2299
|
initialRect: { width: 0, height: 0 },
|
|
2123
2300
|
scrollMargin: 0,
|
|
2124
2301
|
gap: 0,
|
|
@@ -2135,7 +2312,7 @@ class Sr {
|
|
|
2135
2312
|
}, this.notify = (e) => {
|
|
2136
2313
|
var r, s;
|
|
2137
2314
|
(s = (r = this.options).onChange) == null || s.call(r, this, e);
|
|
2138
|
-
}, this.maybeNotify =
|
|
2315
|
+
}, this.maybeNotify = Se(
|
|
2139
2316
|
() => (this.calculateRange(), [
|
|
2140
2317
|
this.isScrolling,
|
|
2141
2318
|
this.range ? this.range.startIndex : null,
|
|
@@ -2186,14 +2363,14 @@ class Sr {
|
|
|
2186
2363
|
const c = e[o];
|
|
2187
2364
|
if (s.has(c.lane))
|
|
2188
2365
|
continue;
|
|
2189
|
-
const
|
|
2366
|
+
const a = i.get(
|
|
2190
2367
|
c.lane
|
|
2191
2368
|
);
|
|
2192
|
-
if (
|
|
2369
|
+
if (a == null || c.end > a.end ? i.set(c.lane, c) : c.end < a.end && s.set(c.lane, !0), s.size === this.options.lanes)
|
|
2193
2370
|
break;
|
|
2194
2371
|
}
|
|
2195
2372
|
return i.size === this.options.lanes ? Array.from(i.values()).sort((o, c) => o.end === c.end ? o.index - c.index : o.end - c.end)[0] : void 0;
|
|
2196
|
-
}, this.getMeasurementOptions =
|
|
2373
|
+
}, this.getMeasurementOptions = Se(
|
|
2197
2374
|
() => [
|
|
2198
2375
|
this.options.count,
|
|
2199
2376
|
this.options.paddingStart,
|
|
@@ -2211,42 +2388,42 @@ class Sr {
|
|
|
2211
2388
|
{
|
|
2212
2389
|
key: !1
|
|
2213
2390
|
}
|
|
2214
|
-
), this.getMeasurements =
|
|
2391
|
+
), this.getMeasurements = Se(
|
|
2215
2392
|
() => [this.getMeasurementOptions(), this.itemSizeCache],
|
|
2216
2393
|
({ count: e, paddingStart: r, scrollMargin: s, getItemKey: i, enabled: o }, c) => {
|
|
2217
2394
|
if (!o)
|
|
2218
2395
|
return this.measurementsCache = [], this.itemSizeCache.clear(), [];
|
|
2219
|
-
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((
|
|
2220
|
-
this.itemSizeCache.set(
|
|
2396
|
+
this.measurementsCache.length === 0 && (this.measurementsCache = this.options.initialMeasurementsCache, this.measurementsCache.forEach((l) => {
|
|
2397
|
+
this.itemSizeCache.set(l.key, l.size);
|
|
2221
2398
|
}));
|
|
2222
|
-
const
|
|
2399
|
+
const a = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
|
|
2223
2400
|
this.pendingMeasuredCacheIndexes = [];
|
|
2224
|
-
const
|
|
2225
|
-
for (let
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
index:
|
|
2229
|
-
start:
|
|
2230
|
-
size:
|
|
2231
|
-
end:
|
|
2232
|
-
key:
|
|
2233
|
-
lane:
|
|
2401
|
+
const f = this.measurementsCache.slice(0, a);
|
|
2402
|
+
for (let l = a; l < e; l++) {
|
|
2403
|
+
const m = i(l), d = this.options.lanes === 1 ? f[l - 1] : this.getFurthestMeasurement(f, l), g = d ? d.end + this.options.gap : r + s, v = c.get(m), p = typeof v == "number" ? v : this.options.estimateSize(l), b = g + p, w = d ? d.lane : l % this.options.lanes;
|
|
2404
|
+
f[l] = {
|
|
2405
|
+
index: l,
|
|
2406
|
+
start: g,
|
|
2407
|
+
size: p,
|
|
2408
|
+
end: b,
|
|
2409
|
+
key: m,
|
|
2410
|
+
lane: w
|
|
2234
2411
|
};
|
|
2235
2412
|
}
|
|
2236
|
-
return this.measurementsCache =
|
|
2413
|
+
return this.measurementsCache = f, f;
|
|
2237
2414
|
},
|
|
2238
2415
|
{
|
|
2239
2416
|
key: process.env.NODE_ENV !== "production" && "getMeasurements",
|
|
2240
2417
|
debug: () => this.options.debug
|
|
2241
2418
|
}
|
|
2242
|
-
), this.calculateRange =
|
|
2419
|
+
), this.calculateRange = Se(
|
|
2243
2420
|
() => [
|
|
2244
2421
|
this.getMeasurements(),
|
|
2245
2422
|
this.getSize(),
|
|
2246
2423
|
this.getScrollOffset(),
|
|
2247
2424
|
this.options.lanes
|
|
2248
2425
|
],
|
|
2249
|
-
(e, r, s, i) => this.range = e.length > 0 && r > 0 ?
|
|
2426
|
+
(e, r, s, i) => this.range = e.length > 0 && r > 0 ? Rs({
|
|
2250
2427
|
measurements: e,
|
|
2251
2428
|
outerSize: r,
|
|
2252
2429
|
scrollOffset: s,
|
|
@@ -2256,7 +2433,7 @@ class Sr {
|
|
|
2256
2433
|
key: process.env.NODE_ENV !== "production" && "calculateRange",
|
|
2257
2434
|
debug: () => this.options.debug
|
|
2258
2435
|
}
|
|
2259
|
-
), this.getVirtualIndexes =
|
|
2436
|
+
), this.getVirtualIndexes = Se(
|
|
2260
2437
|
() => {
|
|
2261
2438
|
let e = null, r = null;
|
|
2262
2439
|
const s = this.calculateRange();
|
|
@@ -2306,13 +2483,13 @@ class Sr {
|
|
|
2306
2483
|
return;
|
|
2307
2484
|
}
|
|
2308
2485
|
this._measureElement(e, void 0);
|
|
2309
|
-
}, this.getVirtualItems =
|
|
2486
|
+
}, this.getVirtualItems = Se(
|
|
2310
2487
|
() => [this.getVirtualIndexes(), this.getMeasurements()],
|
|
2311
2488
|
(e, r) => {
|
|
2312
2489
|
const s = [];
|
|
2313
2490
|
for (let i = 0, o = e.length; i < o; i++) {
|
|
2314
|
-
const c = e[i],
|
|
2315
|
-
s.push(
|
|
2491
|
+
const c = e[i], a = r[c];
|
|
2492
|
+
s.push(a);
|
|
2316
2493
|
}
|
|
2317
2494
|
return s;
|
|
2318
2495
|
},
|
|
@@ -2323,11 +2500,11 @@ class Sr {
|
|
|
2323
2500
|
), this.getVirtualItemForOffset = (e) => {
|
|
2324
2501
|
const r = this.getMeasurements();
|
|
2325
2502
|
if (r.length !== 0)
|
|
2326
|
-
return
|
|
2327
|
-
r[
|
|
2503
|
+
return An(
|
|
2504
|
+
r[Gn(
|
|
2328
2505
|
0,
|
|
2329
2506
|
r.length - 1,
|
|
2330
|
-
(s) =>
|
|
2507
|
+
(s) => An(r[s]).start,
|
|
2331
2508
|
e
|
|
2332
2509
|
)]
|
|
2333
2510
|
);
|
|
@@ -2366,24 +2543,24 @@ class Sr {
|
|
|
2366
2543
|
"The `smooth` scroll behavior is not fully supported with dynamic size."
|
|
2367
2544
|
), e = Math.max(0, Math.min(e, this.options.count - 1));
|
|
2368
2545
|
let i = 0;
|
|
2369
|
-
const o = 10, c = (
|
|
2546
|
+
const o = 10, c = (f) => {
|
|
2370
2547
|
if (!this.targetWindow) return;
|
|
2371
|
-
const
|
|
2372
|
-
if (!
|
|
2548
|
+
const l = this.getOffsetForIndex(e, f);
|
|
2549
|
+
if (!l) {
|
|
2373
2550
|
console.warn("Failed to get offset for index:", e);
|
|
2374
2551
|
return;
|
|
2375
2552
|
}
|
|
2376
|
-
const [
|
|
2377
|
-
this._scrollToOffset(
|
|
2378
|
-
const
|
|
2379
|
-
if (!
|
|
2553
|
+
const [m, d] = l;
|
|
2554
|
+
this._scrollToOffset(m, { adjustments: void 0, behavior: s }), this.targetWindow.requestAnimationFrame(() => {
|
|
2555
|
+
const g = this.getScrollOffset(), v = this.getOffsetForIndex(e, d);
|
|
2556
|
+
if (!v) {
|
|
2380
2557
|
console.warn("Failed to get offset for index:", e);
|
|
2381
2558
|
return;
|
|
2382
2559
|
}
|
|
2383
|
-
|
|
2560
|
+
gs(v[0], g) || a(d);
|
|
2384
2561
|
});
|
|
2385
|
-
},
|
|
2386
|
-
this.targetWindow && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => c(
|
|
2562
|
+
}, a = (f) => {
|
|
2563
|
+
this.targetWindow && (i++, i < o ? (process.env.NODE_ENV !== "production" && this.options.debug && console.info("Schedule retry", i, o), this.targetWindow.requestAnimationFrame(() => c(f))) : console.warn(
|
|
2387
2564
|
`Failed to scroll to index ${e} after ${o} attempts.`
|
|
2388
2565
|
));
|
|
2389
2566
|
};
|
|
@@ -2426,7 +2603,7 @@ class Sr {
|
|
|
2426
2603
|
}, this.setOptions(t);
|
|
2427
2604
|
}
|
|
2428
2605
|
}
|
|
2429
|
-
const
|
|
2606
|
+
const Gn = (n, t, e, r) => {
|
|
2430
2607
|
for (; n <= t; ) {
|
|
2431
2608
|
const s = (n + t) / 2 | 0, i = e(s);
|
|
2432
2609
|
if (i < r)
|
|
@@ -2438,19 +2615,19 @@ const Ye = (n, t, e, r) => {
|
|
|
2438
2615
|
}
|
|
2439
2616
|
return n > 0 ? n - 1 : 0;
|
|
2440
2617
|
};
|
|
2441
|
-
function
|
|
2618
|
+
function Rs({
|
|
2442
2619
|
measurements: n,
|
|
2443
2620
|
outerSize: t,
|
|
2444
2621
|
scrollOffset: e,
|
|
2445
2622
|
lanes: r
|
|
2446
2623
|
}) {
|
|
2447
|
-
const s = n.length - 1, i = (
|
|
2624
|
+
const s = n.length - 1, i = (a) => n[a].start;
|
|
2448
2625
|
if (n.length <= r)
|
|
2449
2626
|
return {
|
|
2450
2627
|
startIndex: 0,
|
|
2451
2628
|
endIndex: s
|
|
2452
2629
|
};
|
|
2453
|
-
let o =
|
|
2630
|
+
let o = Gn(
|
|
2454
2631
|
0,
|
|
2455
2632
|
s,
|
|
2456
2633
|
i,
|
|
@@ -2460,279 +2637,540 @@ function xr({
|
|
|
2460
2637
|
for (; c < s && n[c].end < e + t; )
|
|
2461
2638
|
c++;
|
|
2462
2639
|
else if (r > 1) {
|
|
2463
|
-
const
|
|
2464
|
-
for (; c < s &&
|
|
2465
|
-
const
|
|
2466
|
-
l
|
|
2640
|
+
const a = Array(r).fill(0);
|
|
2641
|
+
for (; c < s && a.some((l) => l < e + t); ) {
|
|
2642
|
+
const l = n[c];
|
|
2643
|
+
a[l.lane] = l.end, c++;
|
|
2467
2644
|
}
|
|
2468
|
-
const
|
|
2469
|
-
for (; o >= 0 &&
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2645
|
+
const f = Array(r).fill(e + t);
|
|
2646
|
+
for (; o >= 0 && f.some((l) => l >= e); ) {
|
|
2647
|
+
const l = n[o];
|
|
2648
|
+
f[l.lane] = l.start, o--;
|
|
2472
2649
|
}
|
|
2473
2650
|
o = Math.max(0, o - o % r), c = Math.min(s, c + (r - 1 - c % r));
|
|
2474
2651
|
}
|
|
2475
2652
|
return { startIndex: o, endIndex: c };
|
|
2476
2653
|
}
|
|
2477
|
-
const
|
|
2478
|
-
function
|
|
2479
|
-
const t =
|
|
2654
|
+
const Ln = typeof document < "u" ? Jt.useLayoutEffect : Jt.useEffect;
|
|
2655
|
+
function Ts(n) {
|
|
2656
|
+
const t = Jt.useReducer(() => ({}), {})[1], e = {
|
|
2480
2657
|
...n,
|
|
2481
2658
|
onChange: (s, i) => {
|
|
2482
2659
|
var o;
|
|
2483
|
-
i ?
|
|
2660
|
+
i ? tr(t) : t(), (o = n.onChange) == null || o.call(n, s, i);
|
|
2484
2661
|
}
|
|
2485
|
-
}, [r] =
|
|
2486
|
-
() => new
|
|
2662
|
+
}, [r] = Jt.useState(
|
|
2663
|
+
() => new xs(e)
|
|
2487
2664
|
);
|
|
2488
|
-
return r.setOptions(e),
|
|
2665
|
+
return r.setOptions(e), Ln(() => r._didMount(), []), Ln(() => r._willUpdate()), r;
|
|
2489
2666
|
}
|
|
2490
|
-
function
|
|
2491
|
-
return
|
|
2492
|
-
observeElementRect:
|
|
2493
|
-
observeElementOffset:
|
|
2494
|
-
scrollToFn:
|
|
2667
|
+
function Kn(n) {
|
|
2668
|
+
return Ts({
|
|
2669
|
+
observeElementRect: ys,
|
|
2670
|
+
observeElementOffset: ws,
|
|
2671
|
+
scrollToFn: Ss,
|
|
2495
2672
|
...n
|
|
2496
2673
|
});
|
|
2497
2674
|
}
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2675
|
+
const As = (n) => {
|
|
2676
|
+
const t = Qt.c(12), {
|
|
2677
|
+
isMoving: e,
|
|
2678
|
+
movePositions: r,
|
|
2679
|
+
assistPositions: s,
|
|
2680
|
+
scrollLeft: i
|
|
2681
|
+
} = n;
|
|
2682
|
+
let o, c;
|
|
2683
|
+
if (t[0] !== e || t[1] !== i || t[2] !== r || t[3] !== s) {
|
|
2684
|
+
const f = r === void 0 ? [] : r;
|
|
2685
|
+
let l;
|
|
2686
|
+
t[6] !== s ? (l = s === void 0 ? [] : s, t[6] = s, t[7] = l) : l = t[7];
|
|
2687
|
+
const m = l;
|
|
2688
|
+
t[8] === Symbol.for("react.memo_cache_sentinel") ? (o = mt("drag-line-container"), t[8] = o) : o = t[8], c = e && f.filter((d) => m.includes(d)).map((d, g) => /* @__PURE__ */ N.jsx("div", { className: mt("drag-line"), style: {
|
|
2689
|
+
left: d - i
|
|
2690
|
+
} }, g)), t[0] = e, t[1] = i, t[2] = r, t[3] = s, t[4] = o, t[5] = c;
|
|
2691
|
+
} else
|
|
2692
|
+
o = t[4], c = t[5];
|
|
2693
|
+
let a;
|
|
2694
|
+
return t[9] !== o || t[10] !== c ? (a = /* @__PURE__ */ N.jsx("div", { className: o, children: c }), t[9] = o, t[10] = c, t[11] = a) : a = t[11], a;
|
|
2695
|
+
}, Os = (n) => {
|
|
2696
|
+
const t = Qt.c(198), {
|
|
2697
|
+
editorData: e,
|
|
2698
|
+
row: r,
|
|
2699
|
+
action: s,
|
|
2700
|
+
effects: i,
|
|
2701
|
+
rowHeight: o,
|
|
2702
|
+
scale: c,
|
|
2703
|
+
scaleWidth: a,
|
|
2704
|
+
scaleSplitCount: f,
|
|
2705
|
+
startLeft: l,
|
|
2706
|
+
gridSnap: m,
|
|
2707
|
+
disableDrag: d,
|
|
2708
|
+
scaleCount: g,
|
|
2709
|
+
maxScaleCount: v,
|
|
2710
|
+
setScaleCount: p,
|
|
2711
|
+
onActionMoveStart: b,
|
|
2712
|
+
onActionMoving: w,
|
|
2713
|
+
onActionMoveEnd: h,
|
|
2714
|
+
onActionResizeStart: x,
|
|
2715
|
+
onActionResizeEnd: O,
|
|
2716
|
+
onActionResizing: _,
|
|
2717
|
+
dragLineData: y,
|
|
2718
|
+
setEditorData: E,
|
|
2719
|
+
onClickAction: P,
|
|
2720
|
+
onClickActionOnly: C,
|
|
2721
|
+
onDoubleClickAction: H,
|
|
2722
|
+
onContextMenuAction: X,
|
|
2723
|
+
getActionRender: z,
|
|
2724
|
+
handleTime: F,
|
|
2725
|
+
areaRef: q,
|
|
2726
|
+
deltaScrollLeft: S
|
|
2727
|
+
} = n, R = Q(null), M = Q(!1), {
|
|
2728
|
+
id: U,
|
|
2729
|
+
maxEnd: ft,
|
|
2730
|
+
minStart: gt,
|
|
2731
|
+
end: u,
|
|
2732
|
+
start: T,
|
|
2733
|
+
selected: I,
|
|
2734
|
+
flexible: V,
|
|
2735
|
+
movable: _t,
|
|
2736
|
+
effectId: vt
|
|
2737
|
+
} = s, D = V === void 0 ? !0 : V, rt = _t === void 0 ? !0 : _t, $ = c ?? ze, k = a ?? Fe, j = l ?? Ue, jt = f ?? Mn, Ut = v ?? Number.MAX_SAFE_INTEGER, It = gt || 0;
|
|
2738
|
+
let xt;
|
|
2739
|
+
t[0] !== $ || t[1] !== k || t[2] !== j || t[3] !== It ? (xt = $t(It, {
|
|
2740
|
+
startLeft: j,
|
|
2741
|
+
scale: $,
|
|
2742
|
+
scaleWidth: k
|
|
2743
|
+
}), t[0] = $, t[1] = k, t[2] = j, t[3] = It, t[4] = xt) : xt = t[4];
|
|
2744
|
+
const Rt = xt, At = ft || Number.MAX_VALUE;
|
|
2745
|
+
let Wt;
|
|
2746
|
+
t[5] !== $ || t[6] !== k || t[7] !== j || t[8] !== At ? (Wt = $t(At, {
|
|
2747
|
+
startLeft: j,
|
|
2748
|
+
scale: $,
|
|
2749
|
+
scaleWidth: k
|
|
2750
|
+
}), t[5] = $, t[6] = k, t[7] = j, t[8] = At, t[9] = Wt) : Wt = t[9];
|
|
2751
|
+
const Ot = Math.min(Ut * k + j, Wt);
|
|
2752
|
+
let Ct;
|
|
2753
|
+
t[10] !== u || t[11] !== $ || t[12] !== k || t[13] !== j || t[14] !== T ? (Ct = Nn({
|
|
2754
|
+
start: T,
|
|
2755
|
+
end: u
|
|
2756
|
+
}, {
|
|
2757
|
+
startLeft: j,
|
|
2758
|
+
scale: $,
|
|
2759
|
+
scaleWidth: k
|
|
2760
|
+
}), t[10] = u, t[11] = $, t[12] = k, t[13] = j, t[14] = T, t[15] = Ct) : Ct = t[15];
|
|
2761
|
+
const Dt = Ct, [te, J] = ne(null), Z = te ?? Dt, Y = k / jt;
|
|
2762
|
+
let it;
|
|
2763
|
+
t[16] !== vt || t[17] !== i || t[18] !== D || t[19] !== rt || t[20] !== I ? (it = ["action"], rt && it.push("action-movable"), I && it.push("action-selected"), D && it.push("action-flexible"), i[vt] && it.push(`action-effect-${vt}`), t[16] = vt, t[17] = i, t[18] = D, t[19] = rt, t[20] = I, t[21] = it) : it = t[21];
|
|
2764
|
+
let bt;
|
|
2765
|
+
t[22] !== k || t[23] !== j || t[24] !== g || t[25] !== p ? (bt = (yt, wt) => {
|
|
2766
|
+
const st = dr(yt + wt, {
|
|
2767
|
+
startLeft: j,
|
|
2552
2768
|
scaleCount: g,
|
|
2553
|
-
scaleWidth:
|
|
2769
|
+
scaleWidth: k
|
|
2554
2770
|
});
|
|
2555
|
-
|
|
2556
|
-
},
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
},
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
if (M.current = !0,
|
|
2573
|
-
const {
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
{
|
|
2592
|
-
ref: st,
|
|
2593
|
-
parentRef: W,
|
|
2594
|
-
start: w,
|
|
2595
|
-
left: at.left,
|
|
2596
|
-
width: at.width,
|
|
2597
|
-
grid: u && wt || re,
|
|
2598
|
-
adsorptionDistance: u ? Math.max((wt || re) / 2, se) : se,
|
|
2599
|
-
adsorptionPositions: T.assistPositions,
|
|
2600
|
-
bounds: {
|
|
2601
|
-
left: $,
|
|
2602
|
-
right: J
|
|
2603
|
-
},
|
|
2604
|
-
edges: {
|
|
2605
|
-
left: !a && A && `.${tt("action-left-stretch")}`,
|
|
2606
|
-
right: !a && A && `.${tt("action-right-stretch")}`
|
|
2607
|
-
},
|
|
2608
|
-
enableDragging: !a && d,
|
|
2609
|
-
enableResizing: !a && A,
|
|
2610
|
-
onDragStart: Kt,
|
|
2611
|
-
onDrag: jt,
|
|
2612
|
-
onDragEnd: St,
|
|
2613
|
-
onResizeStart: qt,
|
|
2614
|
-
onResize: Q,
|
|
2615
|
-
onResizeEnd: nt,
|
|
2616
|
-
deltaScrollLeft: Y,
|
|
2617
|
-
children: /* @__PURE__ */ P.jsxs(
|
|
2618
|
-
"div",
|
|
2619
|
-
{
|
|
2620
|
-
onMouseDown: () => {
|
|
2621
|
-
M.current = !1;
|
|
2622
|
-
},
|
|
2623
|
-
onClick: (z) => {
|
|
2624
|
-
let B;
|
|
2625
|
-
C && (B = j(z), C(z, { row: t, action: e, time: B })), !M.current && I && (B === void 0 && (B = j(z)), I(z, { row: t, action: e, time: B }));
|
|
2626
|
-
},
|
|
2627
|
-
onDoubleClick: (z) => {
|
|
2628
|
-
if (k) {
|
|
2629
|
-
const B = j(z);
|
|
2630
|
-
k(z, { row: t, action: e, time: B });
|
|
2631
|
-
}
|
|
2632
|
-
},
|
|
2633
|
-
onContextMenu: (z) => {
|
|
2634
|
-
if (N) {
|
|
2635
|
-
const B = j(z);
|
|
2636
|
-
N(z, { row: t, action: e, time: B });
|
|
2637
|
-
}
|
|
2638
|
-
},
|
|
2639
|
-
className: tt((ut || []).join(" ")),
|
|
2640
|
-
style: { height: s },
|
|
2641
|
-
children: [
|
|
2642
|
-
L && L(H, At),
|
|
2643
|
-
A && /* @__PURE__ */ P.jsx("div", { className: tt("action-left-stretch"), style: { touchAction: "none" } }),
|
|
2644
|
-
A && /* @__PURE__ */ P.jsx("div", { className: tt("action-right-stretch"), style: { touchAction: "none" } })
|
|
2645
|
-
]
|
|
2646
|
-
}
|
|
2647
|
-
)
|
|
2648
|
-
}
|
|
2649
|
-
);
|
|
2650
|
-
}, Rr = (n) => {
|
|
2651
|
-
const { rowData: t, style: e = {}, onClickRow: r, onDoubleClickRow: s, onContextMenuRow: i, areaRef: o, scrollLeft: c, startLeft: l, scale: u, scaleWidth: a } = n, g = ["edit-row"];
|
|
2652
|
-
t != null && t.selected && g.push("edit-row-selected");
|
|
2653
|
-
const p = u ?? $t, O = a ?? Bt, S = l ?? Ht, y = (m) => {
|
|
2654
|
-
if (!o.current) return 0;
|
|
2655
|
-
const h = o.current.getBoundingClientRect(), x = m.clientX - h.x + c;
|
|
2656
|
-
return Tt(x, { startLeft: S, scale: p, scaleWidth: O });
|
|
2657
|
-
};
|
|
2658
|
-
return /* @__PURE__ */ P.jsx(
|
|
2659
|
-
"div",
|
|
2660
|
-
{
|
|
2661
|
-
className: `${tt(...g)} ${((t == null ? void 0 : t.classNames) || []).join(" ")}`,
|
|
2662
|
-
style: e,
|
|
2663
|
-
onClick: (m) => {
|
|
2664
|
-
if (t && r) {
|
|
2665
|
-
const h = y(m);
|
|
2666
|
-
r(m, { row: t, time: h });
|
|
2667
|
-
}
|
|
2668
|
-
},
|
|
2669
|
-
onDoubleClick: (m) => {
|
|
2670
|
-
if (t && s) {
|
|
2671
|
-
const h = y(m);
|
|
2672
|
-
s(m, { row: t, time: h });
|
|
2673
|
-
}
|
|
2674
|
-
},
|
|
2675
|
-
onContextMenu: (m) => {
|
|
2676
|
-
if (t && i) {
|
|
2677
|
-
const h = y(m);
|
|
2678
|
-
i(m, { row: t, time: h });
|
|
2679
|
-
}
|
|
2680
|
-
},
|
|
2681
|
-
children: t && (t.actions || []).map((m) => /* @__PURE__ */ P.jsx(Ar, { ...n, handleTime: y, row: t, action: m }, m.id))
|
|
2771
|
+
st !== g && p(st);
|
|
2772
|
+
}, t[22] = k, t[23] = j, t[24] = g, t[25] = p, t[26] = bt) : bt = t[26];
|
|
2773
|
+
const Tt = bt;
|
|
2774
|
+
let Pt;
|
|
2775
|
+
t[27] !== s || t[28] !== b || t[29] !== r ? (Pt = () => {
|
|
2776
|
+
b && b({
|
|
2777
|
+
action: s,
|
|
2778
|
+
row: r
|
|
2779
|
+
});
|
|
2780
|
+
}, t[27] = s, t[28] = b, t[29] = r, t[30] = Pt) : Pt = t[30];
|
|
2781
|
+
const Ht = Pt;
|
|
2782
|
+
let Bt;
|
|
2783
|
+
t[31] !== s || t[32] !== Tt || t[33] !== w || t[34] !== r || t[35] !== $ || t[36] !== k || t[37] !== j ? (Bt = (yt) => {
|
|
2784
|
+
const {
|
|
2785
|
+
left: wt,
|
|
2786
|
+
width: st
|
|
2787
|
+
} = yt;
|
|
2788
|
+
if (M.current = !0, w) {
|
|
2789
|
+
const {
|
|
2790
|
+
start: ht,
|
|
2791
|
+
end: Et
|
|
2792
|
+
} = Ae({
|
|
2793
|
+
left: wt,
|
|
2794
|
+
width: st
|
|
2795
|
+
}, {
|
|
2796
|
+
scaleWidth: k,
|
|
2797
|
+
scale: $,
|
|
2798
|
+
startLeft: j
|
|
2799
|
+
});
|
|
2800
|
+
if (w({
|
|
2801
|
+
action: s,
|
|
2802
|
+
row: r,
|
|
2803
|
+
start: ht,
|
|
2804
|
+
end: Et
|
|
2805
|
+
}) === !1)
|
|
2806
|
+
return !1;
|
|
2682
2807
|
}
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2808
|
+
J({
|
|
2809
|
+
left: wt,
|
|
2810
|
+
width: st
|
|
2811
|
+
}), Tt(wt, st);
|
|
2812
|
+
}, t[31] = s, t[32] = Tt, t[33] = w, t[34] = r, t[35] = $, t[36] = k, t[37] = j, t[38] = Bt) : Bt = t[38];
|
|
2813
|
+
const ee = Bt;
|
|
2814
|
+
let kt;
|
|
2815
|
+
t[39] !== e || t[40] !== U || t[41] !== h || t[42] !== r || t[43] !== $ || t[44] !== k || t[45] !== j || t[46] !== E ? (kt = (yt) => {
|
|
2816
|
+
const {
|
|
2817
|
+
left: wt,
|
|
2818
|
+
width: st
|
|
2819
|
+
} = yt, {
|
|
2820
|
+
start: ht,
|
|
2821
|
+
end: Et
|
|
2822
|
+
} = Ae({
|
|
2823
|
+
left: wt,
|
|
2824
|
+
width: st
|
|
2825
|
+
}, {
|
|
2826
|
+
scaleWidth: k,
|
|
2827
|
+
scale: $,
|
|
2828
|
+
startLeft: j
|
|
2829
|
+
}), Lt = e.find((ut) => ut.id === r.id);
|
|
2830
|
+
if (!Lt)
|
|
2831
|
+
return;
|
|
2832
|
+
const at = Lt.actions.find((ut) => ut.id === U);
|
|
2833
|
+
at && (at.start = ht, at.end = Et, E(e), h && h({
|
|
2834
|
+
action: at,
|
|
2835
|
+
row: r,
|
|
2836
|
+
start: ht,
|
|
2837
|
+
end: Et
|
|
2838
|
+
}), J(null));
|
|
2839
|
+
}, t[39] = e, t[40] = U, t[41] = h, t[42] = r, t[43] = $, t[44] = k, t[45] = j, t[46] = E, t[47] = kt) : kt = t[47];
|
|
2840
|
+
const zt = kt;
|
|
2841
|
+
let Yt;
|
|
2842
|
+
t[48] !== s || t[49] !== x || t[50] !== r ? (Yt = (yt) => {
|
|
2843
|
+
x && x({
|
|
2844
|
+
action: s,
|
|
2845
|
+
row: r,
|
|
2846
|
+
dir: yt
|
|
2847
|
+
});
|
|
2848
|
+
}, t[48] = s, t[49] = x, t[50] = r, t[51] = Yt) : Yt = t[51];
|
|
2849
|
+
const Ft = Yt;
|
|
2850
|
+
let Xt;
|
|
2851
|
+
t[52] !== s || t[53] !== Tt || t[54] !== _ || t[55] !== r || t[56] !== $ || t[57] !== k || t[58] !== j ? (Xt = (yt, wt) => {
|
|
2852
|
+
const {
|
|
2853
|
+
left: st,
|
|
2854
|
+
width: ht
|
|
2855
|
+
} = wt;
|
|
2856
|
+
if (M.current = !0, _) {
|
|
2857
|
+
const {
|
|
2858
|
+
start: Et,
|
|
2859
|
+
end: Lt
|
|
2860
|
+
} = Ae({
|
|
2861
|
+
left: st,
|
|
2862
|
+
width: ht
|
|
2863
|
+
}, {
|
|
2864
|
+
scaleWidth: k,
|
|
2865
|
+
scale: $,
|
|
2866
|
+
startLeft: j
|
|
2694
2867
|
});
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2868
|
+
if (_({
|
|
2869
|
+
action: s,
|
|
2870
|
+
row: r,
|
|
2871
|
+
start: Et,
|
|
2872
|
+
end: Lt,
|
|
2873
|
+
dir: yt
|
|
2874
|
+
}) === !1)
|
|
2875
|
+
return !1;
|
|
2876
|
+
}
|
|
2877
|
+
J({
|
|
2878
|
+
left: st,
|
|
2879
|
+
width: ht
|
|
2880
|
+
}), Tt(st, ht);
|
|
2881
|
+
}, t[52] = s, t[53] = Tt, t[54] = _, t[55] = r, t[56] = $, t[57] = k, t[58] = j, t[59] = Xt) : Xt = t[59];
|
|
2882
|
+
const L = Xt;
|
|
2883
|
+
let K;
|
|
2884
|
+
t[60] !== e || t[61] !== U || t[62] !== O || t[63] !== r || t[64] !== $ || t[65] !== k || t[66] !== j || t[67] !== E ? (K = (yt, wt) => {
|
|
2885
|
+
const {
|
|
2886
|
+
left: st,
|
|
2887
|
+
width: ht
|
|
2888
|
+
} = wt, {
|
|
2889
|
+
start: Et,
|
|
2890
|
+
end: Lt
|
|
2891
|
+
} = Ae({
|
|
2892
|
+
left: st,
|
|
2893
|
+
width: ht
|
|
2894
|
+
}, {
|
|
2895
|
+
scaleWidth: k,
|
|
2896
|
+
scale: $,
|
|
2897
|
+
startLeft: j
|
|
2898
|
+
}), at = e.find((Be) => Be.id === r.id);
|
|
2899
|
+
if (!at)
|
|
2900
|
+
return;
|
|
2901
|
+
const ut = at.actions.find((Be) => Be.id === U);
|
|
2902
|
+
ut && (ut.start = Et, ut.end = Lt, E(e), O && O({
|
|
2903
|
+
action: ut,
|
|
2904
|
+
row: r,
|
|
2905
|
+
start: Et,
|
|
2906
|
+
end: Lt,
|
|
2907
|
+
dir: yt
|
|
2908
|
+
}), J(null));
|
|
2909
|
+
}, t[60] = e, t[61] = U, t[62] = O, t[63] = r, t[64] = $, t[65] = k, t[66] = j, t[67] = E, t[68] = K) : K = t[68];
|
|
2910
|
+
const B = K;
|
|
2911
|
+
let W, tt, lt, A, et, ot, G, ct, dt, Nt, se, ie, oe, ce, ae, le, Gt, Kt, ue, fe, de, he, me, pe, ge, _e, ve;
|
|
2912
|
+
if (t[69] !== s || t[70] !== q || t[71] !== it || t[72] !== S || t[73] !== d || t[74] !== y.assistPositions || t[75] !== D || t[76] !== z || t[77] !== Y || t[78] !== m || t[79] !== ee || t[80] !== zt || t[81] !== Ht || t[82] !== B || t[83] !== Ft || t[84] !== L || t[85] !== F || t[86] !== Rt || t[87] !== rt || t[88] !== P || t[89] !== C || t[90] !== X || t[91] !== H || t[92] !== Ot || t[93] !== r || t[94] !== o || t[95] !== $ || t[96] !== k || t[97] !== j || t[98] !== Z.left || t[99] !== Z.width) {
|
|
2913
|
+
const yt = {
|
|
2914
|
+
...s,
|
|
2915
|
+
...Ae({
|
|
2916
|
+
left: Z.left,
|
|
2917
|
+
width: Z.width
|
|
2918
|
+
}, {
|
|
2919
|
+
startLeft: j,
|
|
2920
|
+
scaleWidth: k,
|
|
2921
|
+
scale: $
|
|
2922
|
+
})
|
|
2923
|
+
}, wt = {
|
|
2924
|
+
...r,
|
|
2925
|
+
actions: [...r.actions]
|
|
2926
|
+
};
|
|
2927
|
+
r.actions.includes(s) && (wt.actions[r.actions.indexOf(s)] = yt), W = Xn, dt = R, Nt = q, se = j, ie = Z.left, oe = Z.width, ce = m && Y || Ze, ae = m ? Math.max((Y || Ze) / 2, Qe) : Qe, le = y.assistPositions, t[127] !== Rt || t[128] !== Ot ? (Gt = {
|
|
2928
|
+
left: Rt,
|
|
2929
|
+
right: Ot
|
|
2930
|
+
}, t[127] = Rt, t[128] = Ot, t[129] = Gt) : Gt = t[129];
|
|
2931
|
+
let st;
|
|
2932
|
+
t[130] !== d || t[131] !== D ? (st = !d && D && `.${mt("action-left-stretch")}`, t[130] = d, t[131] = D, t[132] = st) : st = t[132];
|
|
2933
|
+
let ht;
|
|
2934
|
+
t[133] !== d || t[134] !== D ? (ht = !d && D && `.${mt("action-right-stretch")}`, t[133] = d, t[134] = D, t[135] = ht) : ht = t[135], t[136] !== st || t[137] !== ht ? (Kt = {
|
|
2935
|
+
left: st,
|
|
2936
|
+
right: ht
|
|
2937
|
+
}, t[136] = st, t[137] = ht, t[138] = Kt) : Kt = t[138], ue = !d && rt, fe = !d && D, de = Ht, he = ee, me = zt, pe = Ft, ge = L, _e = B, ve = S, t[139] === Symbol.for("react.memo_cache_sentinel") ? (tt = () => {
|
|
2938
|
+
M.current = !1;
|
|
2939
|
+
}, t[139] = tt) : tt = t[139], t[140] !== s || t[141] !== F || t[142] !== P || t[143] !== C || t[144] !== r ? (lt = (at) => {
|
|
2940
|
+
let ut;
|
|
2941
|
+
P && (ut = F(at), P(at, {
|
|
2942
|
+
row: r,
|
|
2943
|
+
action: s,
|
|
2944
|
+
time: ut
|
|
2945
|
+
})), !M.current && C && (ut === void 0 && (ut = F(at)), C(at, {
|
|
2946
|
+
row: r,
|
|
2947
|
+
action: s,
|
|
2948
|
+
time: ut
|
|
2702
2949
|
}));
|
|
2703
|
-
},
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
u ? l.forEach((x) => {
|
|
2711
|
-
x.actions.forEach((T) => {
|
|
2712
|
-
u.includes(T.id) && h.push(T);
|
|
2950
|
+
}, t[140] = s, t[141] = F, t[142] = P, t[143] = C, t[144] = r, t[145] = lt) : lt = t[145], t[146] !== s || t[147] !== F || t[148] !== H || t[149] !== r ? (A = (at) => {
|
|
2951
|
+
if (H) {
|
|
2952
|
+
const ut = F(at);
|
|
2953
|
+
H(at, {
|
|
2954
|
+
row: r,
|
|
2955
|
+
action: s,
|
|
2956
|
+
time: ut
|
|
2713
2957
|
});
|
|
2714
|
-
}
|
|
2715
|
-
|
|
2716
|
-
|
|
2958
|
+
}
|
|
2959
|
+
}, t[146] = s, t[147] = F, t[148] = H, t[149] = r, t[150] = A) : A = t[150], t[151] !== s || t[152] !== F || t[153] !== X || t[154] !== r ? (et = (at) => {
|
|
2960
|
+
if (X) {
|
|
2961
|
+
const ut = F(at);
|
|
2962
|
+
X(at, {
|
|
2963
|
+
row: r,
|
|
2964
|
+
action: s,
|
|
2965
|
+
time: ut
|
|
2717
2966
|
});
|
|
2967
|
+
}
|
|
2968
|
+
}, t[151] = s, t[152] = F, t[153] = X, t[154] = r, t[155] = et) : et = t[155];
|
|
2969
|
+
let Et;
|
|
2970
|
+
t[156] !== it ? (Et = it || [], t[156] = it, t[157] = Et) : Et = t[157];
|
|
2971
|
+
const Lt = Et.join(" ");
|
|
2972
|
+
t[158] !== Lt ? (ot = mt(Lt), t[158] = Lt, t[159] = ot) : ot = t[159], t[160] !== o ? (G = {
|
|
2973
|
+
height: o
|
|
2974
|
+
}, t[160] = o, t[161] = G) : G = t[161], ct = z && z(yt, wt), t[69] = s, t[70] = q, t[71] = it, t[72] = S, t[73] = d, t[74] = y.assistPositions, t[75] = D, t[76] = z, t[77] = Y, t[78] = m, t[79] = ee, t[80] = zt, t[81] = Ht, t[82] = B, t[83] = Ft, t[84] = L, t[85] = F, t[86] = Rt, t[87] = rt, t[88] = P, t[89] = C, t[90] = X, t[91] = H, t[92] = Ot, t[93] = r, t[94] = o, t[95] = $, t[96] = k, t[97] = j, t[98] = Z.left, t[99] = Z.width, t[100] = W, t[101] = tt, t[102] = lt, t[103] = A, t[104] = et, t[105] = ot, t[106] = G, t[107] = ct, t[108] = dt, t[109] = Nt, t[110] = se, t[111] = ie, t[112] = oe, t[113] = ce, t[114] = ae, t[115] = le, t[116] = Gt, t[117] = Kt, t[118] = ue, t[119] = fe, t[120] = de, t[121] = he, t[122] = me, t[123] = pe, t[124] = ge, t[125] = _e, t[126] = ve;
|
|
2975
|
+
} else
|
|
2976
|
+
W = t[100], tt = t[101], lt = t[102], A = t[103], et = t[104], ot = t[105], G = t[106], ct = t[107], dt = t[108], Nt = t[109], se = t[110], ie = t[111], oe = t[112], ce = t[113], ae = t[114], le = t[115], Gt = t[116], Kt = t[117], ue = t[118], fe = t[119], de = t[120], he = t[121], me = t[122], pe = t[123], ge = t[124], _e = t[125], ve = t[126];
|
|
2977
|
+
let be;
|
|
2978
|
+
t[162] !== D ? (be = D && /* @__PURE__ */ N.jsx("div", { className: mt("action-left-stretch"), style: {
|
|
2979
|
+
touchAction: "none"
|
|
2980
|
+
} }), t[162] = D, t[163] = be) : be = t[163];
|
|
2981
|
+
let ye;
|
|
2982
|
+
t[164] !== D ? (ye = D && /* @__PURE__ */ N.jsx("div", { className: mt("action-right-stretch"), style: {
|
|
2983
|
+
touchAction: "none"
|
|
2984
|
+
} }), t[164] = D, t[165] = ye) : ye = t[165];
|
|
2985
|
+
let we;
|
|
2986
|
+
t[166] !== tt || t[167] !== lt || t[168] !== A || t[169] !== et || t[170] !== ot || t[171] !== G || t[172] !== ct || t[173] !== be || t[174] !== ye ? (we = /* @__PURE__ */ N.jsxs("div", { onMouseDown: tt, onClick: lt, onDoubleClick: A, onContextMenu: et, className: ot, style: G, children: [
|
|
2987
|
+
ct,
|
|
2988
|
+
be,
|
|
2989
|
+
ye
|
|
2990
|
+
] }), t[166] = tt, t[167] = lt, t[168] = A, t[169] = et, t[170] = ot, t[171] = G, t[172] = ct, t[173] = be, t[174] = ye, t[175] = we) : we = t[175];
|
|
2991
|
+
let De;
|
|
2992
|
+
return t[176] !== W || t[177] !== dt || t[178] !== Nt || t[179] !== se || t[180] !== ie || t[181] !== oe || t[182] !== ce || t[183] !== ae || t[184] !== le || t[185] !== Gt || t[186] !== Kt || t[187] !== ue || t[188] !== fe || t[189] !== de || t[190] !== he || t[191] !== me || t[192] !== pe || t[193] !== ge || t[194] !== _e || t[195] !== ve || t[196] !== we ? (De = /* @__PURE__ */ N.jsx(W, { ref: dt, parentRef: Nt, start: se, left: ie, width: oe, grid: ce, adsorptionDistance: ae, adsorptionPositions: le, bounds: Gt, edges: Kt, enableDragging: ue, enableResizing: fe, onDragStart: de, onDrag: he, onDragEnd: me, onResizeStart: pe, onResize: ge, onResizeEnd: _e, deltaScrollLeft: ve, children: we }), t[176] = W, t[177] = dt, t[178] = Nt, t[179] = se, t[180] = ie, t[181] = oe, t[182] = ce, t[183] = ae, t[184] = le, t[185] = Gt, t[186] = Kt, t[187] = ue, t[188] = fe, t[189] = de, t[190] = he, t[191] = me, t[192] = pe, t[193] = ge, t[194] = _e, t[195] = ve, t[196] = we, t[197] = De) : De = t[197], De;
|
|
2993
|
+
}, Cs = (n) => {
|
|
2994
|
+
const t = Qt.c(43), {
|
|
2995
|
+
rowData: e,
|
|
2996
|
+
style: r,
|
|
2997
|
+
onClickRow: s,
|
|
2998
|
+
onDoubleClickRow: i,
|
|
2999
|
+
onContextMenuRow: o,
|
|
3000
|
+
areaRef: c,
|
|
3001
|
+
scrollLeft: a,
|
|
3002
|
+
startLeft: f,
|
|
3003
|
+
scale: l,
|
|
3004
|
+
scaleWidth: m
|
|
3005
|
+
} = n;
|
|
3006
|
+
let d;
|
|
3007
|
+
t[0] !== r ? (d = r === void 0 ? {} : r, t[0] = r, t[1] = d) : d = t[1];
|
|
3008
|
+
const g = d;
|
|
3009
|
+
let v, p;
|
|
3010
|
+
if (t[2] !== c || t[3] !== e?.selected || t[4] !== l || t[5] !== m || t[6] !== a || t[7] !== f) {
|
|
3011
|
+
const P = ["edit-row"];
|
|
3012
|
+
e?.selected && P.push("edit-row-selected");
|
|
3013
|
+
const C = l ?? ze, H = m ?? Fe, X = f ?? Ue;
|
|
3014
|
+
let z;
|
|
3015
|
+
t[10] !== c || t[11] !== C || t[12] !== H || t[13] !== X || t[14] !== a ? (z = (F) => {
|
|
3016
|
+
if (!c.current)
|
|
3017
|
+
return 0;
|
|
3018
|
+
const q = c.current.getBoundingClientRect(), R = F.clientX - q.x + a;
|
|
3019
|
+
return re(R, {
|
|
3020
|
+
startLeft: X,
|
|
3021
|
+
scale: C,
|
|
3022
|
+
scaleWidth: H
|
|
2718
3023
|
});
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
3024
|
+
}, t[10] = c, t[11] = C, t[12] = H, t[13] = X, t[14] = a, t[15] = z) : z = t[15], v = z, p = mt(...P), t[2] = c, t[3] = e?.selected, t[4] = l, t[5] = m, t[6] = a, t[7] = f, t[8] = v, t[9] = p;
|
|
3025
|
+
} else
|
|
3026
|
+
v = t[8], p = t[9];
|
|
3027
|
+
let b;
|
|
3028
|
+
t[16] !== e?.classNames ? (b = e?.classNames || [], t[16] = e?.classNames, t[17] = b) : b = t[17];
|
|
3029
|
+
let w;
|
|
3030
|
+
t[18] !== b ? (w = b.join(" "), t[18] = b, t[19] = w) : w = t[19];
|
|
3031
|
+
const h = `${p} ${w}`;
|
|
3032
|
+
let x;
|
|
3033
|
+
t[20] !== v || t[21] !== s || t[22] !== e ? (x = (P) => {
|
|
3034
|
+
if (e && s) {
|
|
3035
|
+
const C = v(P);
|
|
3036
|
+
s(P, {
|
|
3037
|
+
row: e,
|
|
3038
|
+
time: C
|
|
2723
3039
|
});
|
|
2724
|
-
return m || v.push(y), v;
|
|
2725
|
-
},
|
|
2726
|
-
defaultGetMovePosition: (c) => {
|
|
2727
|
-
const { start: l, end: u, dir: a, scale: g, scaleWidth: p, startLeft: O } = c, { left: S, width: y } = Ne({ start: l, end: u }, { startLeft: O, scaleWidth: p, scale: g });
|
|
2728
|
-
return a ? a === "right" ? [S + y] : [S] : [S, S + y];
|
|
2729
3040
|
}
|
|
2730
|
-
};
|
|
3041
|
+
}, t[20] = v, t[21] = s, t[22] = e, t[23] = x) : x = t[23];
|
|
3042
|
+
let O;
|
|
3043
|
+
t[24] !== v || t[25] !== i || t[26] !== e ? (O = (P) => {
|
|
3044
|
+
if (e && i) {
|
|
3045
|
+
const C = v(P);
|
|
3046
|
+
i(P, {
|
|
3047
|
+
row: e,
|
|
3048
|
+
time: C
|
|
3049
|
+
});
|
|
3050
|
+
}
|
|
3051
|
+
}, t[24] = v, t[25] = i, t[26] = e, t[27] = O) : O = t[27];
|
|
3052
|
+
let _;
|
|
3053
|
+
t[28] !== v || t[29] !== o || t[30] !== e ? (_ = (P) => {
|
|
3054
|
+
if (e && o) {
|
|
3055
|
+
const C = v(P);
|
|
3056
|
+
o(P, {
|
|
3057
|
+
row: e,
|
|
3058
|
+
time: C
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
}, t[28] = v, t[29] = o, t[30] = e, t[31] = _) : _ = t[31];
|
|
3062
|
+
let y;
|
|
3063
|
+
t[32] !== v || t[33] !== n || t[34] !== e ? (y = e && (e.actions || []).map((P) => /* @__PURE__ */ N.jsx(Os, { ...n, handleTime: v, row: e, action: P }, P.id)), t[32] = v, t[33] = n, t[34] = e, t[35] = y) : y = t[35];
|
|
3064
|
+
let E;
|
|
3065
|
+
return t[36] !== g || t[37] !== h || t[38] !== x || t[39] !== O || t[40] !== _ || t[41] !== y ? (E = /* @__PURE__ */ N.jsx("div", { className: h, style: g, onClick: x, onDoubleClick: O, onContextMenu: _, children: y }), t[36] = g, t[37] = h, t[38] = x, t[39] = O, t[40] = _, t[41] = y, t[42] = E) : E = t[42], E;
|
|
3066
|
+
};
|
|
3067
|
+
function Ds() {
|
|
3068
|
+
const n = Qt.c(6);
|
|
3069
|
+
let t;
|
|
3070
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
|
|
3071
|
+
isMoving: !1,
|
|
3072
|
+
movePositions: [],
|
|
3073
|
+
assistPositions: []
|
|
3074
|
+
}, n[0] = t) : t = n[0];
|
|
3075
|
+
const [e, r] = ne(t), s = Ms, i = Ls;
|
|
3076
|
+
let o;
|
|
3077
|
+
n[1] === Symbol.for("react.memo_cache_sentinel") ? (o = (g) => {
|
|
3078
|
+
const {
|
|
3079
|
+
movePositions: v,
|
|
3080
|
+
assistPositions: p
|
|
3081
|
+
} = g;
|
|
3082
|
+
r({
|
|
3083
|
+
isMoving: !0,
|
|
3084
|
+
movePositions: v || [],
|
|
3085
|
+
assistPositions: p || []
|
|
3086
|
+
});
|
|
3087
|
+
}, n[1] = o) : o = n[1];
|
|
3088
|
+
const c = o;
|
|
3089
|
+
let a;
|
|
3090
|
+
n[2] === Symbol.for("react.memo_cache_sentinel") ? (a = (g) => {
|
|
3091
|
+
const {
|
|
3092
|
+
movePositions: v,
|
|
3093
|
+
assistPositions: p
|
|
3094
|
+
} = g;
|
|
3095
|
+
r((b) => ({
|
|
3096
|
+
...b,
|
|
3097
|
+
movePositions: v || b.movePositions,
|
|
3098
|
+
assistPositions: p || b.assistPositions
|
|
3099
|
+
}));
|
|
3100
|
+
}, n[2] = a) : a = n[2];
|
|
3101
|
+
const f = a;
|
|
3102
|
+
let l;
|
|
3103
|
+
n[3] === Symbol.for("react.memo_cache_sentinel") ? (l = () => {
|
|
3104
|
+
r({
|
|
3105
|
+
isMoving: !1,
|
|
3106
|
+
movePositions: [],
|
|
3107
|
+
assistPositions: []
|
|
3108
|
+
});
|
|
3109
|
+
}, n[3] = l) : l = n[3];
|
|
3110
|
+
const m = l;
|
|
3111
|
+
let d;
|
|
3112
|
+
return n[4] !== e ? (d = {
|
|
3113
|
+
initDragLine: c,
|
|
3114
|
+
updateDragLine: f,
|
|
3115
|
+
disposeDragLine: m,
|
|
3116
|
+
dragLineData: e,
|
|
3117
|
+
defaultGetAssistPosition: s,
|
|
3118
|
+
defaultGetMovePosition: i
|
|
3119
|
+
}, n[4] = e, n[5] = d) : d = n[5], d;
|
|
3120
|
+
}
|
|
3121
|
+
function Ls(n) {
|
|
3122
|
+
const {
|
|
3123
|
+
start: t,
|
|
3124
|
+
end: e,
|
|
3125
|
+
dir: r,
|
|
3126
|
+
scale: s,
|
|
3127
|
+
scaleWidth: i,
|
|
3128
|
+
startLeft: o
|
|
3129
|
+
} = n, {
|
|
3130
|
+
left: c,
|
|
3131
|
+
width: a
|
|
3132
|
+
} = Nn({
|
|
3133
|
+
start: t,
|
|
3134
|
+
end: e
|
|
3135
|
+
}, {
|
|
3136
|
+
startLeft: o,
|
|
3137
|
+
scaleWidth: i,
|
|
3138
|
+
scale: s
|
|
3139
|
+
});
|
|
3140
|
+
return r ? r === "right" ? [c + a] : [c] : [c, c + a];
|
|
2731
3141
|
}
|
|
2732
|
-
function
|
|
3142
|
+
function Ms(n) {
|
|
3143
|
+
const {
|
|
3144
|
+
editorData: t,
|
|
3145
|
+
assistActionIds: e,
|
|
3146
|
+
action: r,
|
|
3147
|
+
row: s,
|
|
3148
|
+
scale: i,
|
|
3149
|
+
scaleWidth: o,
|
|
3150
|
+
startLeft: c,
|
|
3151
|
+
cursorLeft: a,
|
|
3152
|
+
hideCursor: f
|
|
3153
|
+
} = n, l = [];
|
|
3154
|
+
e ? t.forEach((d) => {
|
|
3155
|
+
d.actions.forEach((g) => {
|
|
3156
|
+
e.includes(g.id) && l.push(g);
|
|
3157
|
+
});
|
|
3158
|
+
}) : t.forEach((d) => {
|
|
3159
|
+
d.id !== s.id ? l.push(...d.actions) : d.actions.forEach((g) => {
|
|
3160
|
+
g.id !== r.id && l.push(g);
|
|
3161
|
+
});
|
|
3162
|
+
});
|
|
3163
|
+
const m = hr(l, {
|
|
3164
|
+
startLeft: c,
|
|
3165
|
+
scale: i,
|
|
3166
|
+
scaleWidth: o
|
|
3167
|
+
});
|
|
3168
|
+
return f || m.push(a), m;
|
|
3169
|
+
}
|
|
3170
|
+
function Is(n) {
|
|
2733
3171
|
return typeof n == "object" && n !== null;
|
|
2734
3172
|
}
|
|
2735
|
-
function
|
|
3173
|
+
function Ps(n, t, e) {
|
|
2736
3174
|
if (n instanceof EventTarget)
|
|
2737
3175
|
return [n];
|
|
2738
3176
|
if (typeof n == "string") {
|
|
@@ -2741,48 +3179,47 @@ function Mr(n, t, e) {
|
|
|
2741
3179
|
}
|
|
2742
3180
|
return Array.from(n);
|
|
2743
3181
|
}
|
|
2744
|
-
function
|
|
2745
|
-
return
|
|
3182
|
+
function ks(n) {
|
|
3183
|
+
return Is(n) && "ownerSVGElement" in n;
|
|
2746
3184
|
}
|
|
2747
|
-
const
|
|
2748
|
-
let
|
|
2749
|
-
const
|
|
2750
|
-
function
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
r(n, {
|
|
3185
|
+
const Ne = /* @__PURE__ */ new WeakMap();
|
|
3186
|
+
let je;
|
|
3187
|
+
const qn = (n, t, e) => (r, s) => s && s[0] ? s[0][n + "Size"] : ks(r) && "getBBox" in r ? r.getBBox()[t] : r[e], Ns = /* @__PURE__ */ qn("inline", "width", "offsetWidth"), js = /* @__PURE__ */ qn("block", "height", "offsetHeight");
|
|
3188
|
+
function Ws({ target: n, borderBoxSize: t }) {
|
|
3189
|
+
Ne.get(n)?.forEach((e) => {
|
|
3190
|
+
e(n, {
|
|
2754
3191
|
get width() {
|
|
2755
|
-
return
|
|
3192
|
+
return Ns(n, t);
|
|
2756
3193
|
},
|
|
2757
3194
|
get height() {
|
|
2758
|
-
return
|
|
3195
|
+
return js(n, t);
|
|
2759
3196
|
}
|
|
2760
3197
|
});
|
|
2761
3198
|
});
|
|
2762
3199
|
}
|
|
2763
|
-
function
|
|
2764
|
-
n.forEach(
|
|
3200
|
+
function zs(n) {
|
|
3201
|
+
n.forEach(Ws);
|
|
2765
3202
|
}
|
|
2766
|
-
function
|
|
2767
|
-
typeof ResizeObserver > "u" || (
|
|
3203
|
+
function Fs() {
|
|
3204
|
+
typeof ResizeObserver > "u" || (je = new ResizeObserver(zs));
|
|
2768
3205
|
}
|
|
2769
|
-
function
|
|
2770
|
-
|
|
2771
|
-
const e =
|
|
3206
|
+
function Vs(n, t) {
|
|
3207
|
+
je || Fs();
|
|
3208
|
+
const e = Ps(n);
|
|
2772
3209
|
return e.forEach((r) => {
|
|
2773
|
-
let s =
|
|
2774
|
-
s || (s = /* @__PURE__ */ new Set(),
|
|
3210
|
+
let s = Ne.get(r);
|
|
3211
|
+
s || (s = /* @__PURE__ */ new Set(), Ne.set(r, s)), s.add(t), je?.observe(r);
|
|
2775
3212
|
}), () => {
|
|
2776
3213
|
e.forEach((r) => {
|
|
2777
|
-
const s =
|
|
2778
|
-
s
|
|
3214
|
+
const s = Ne.get(r);
|
|
3215
|
+
s?.delete(t), s?.size || je?.unobserve(r);
|
|
2779
3216
|
});
|
|
2780
3217
|
};
|
|
2781
3218
|
}
|
|
2782
|
-
const
|
|
2783
|
-
let
|
|
2784
|
-
function
|
|
2785
|
-
|
|
3219
|
+
const We = /* @__PURE__ */ new Set();
|
|
3220
|
+
let xe;
|
|
3221
|
+
function $s() {
|
|
3222
|
+
xe = () => {
|
|
2786
3223
|
const n = {
|
|
2787
3224
|
get width() {
|
|
2788
3225
|
return window.innerWidth;
|
|
@@ -2791,26 +3228,48 @@ function zr() {
|
|
|
2791
3228
|
return window.innerHeight;
|
|
2792
3229
|
}
|
|
2793
3230
|
};
|
|
2794
|
-
|
|
2795
|
-
}, window.addEventListener("resize",
|
|
3231
|
+
We.forEach((t) => t(n));
|
|
3232
|
+
}, window.addEventListener("resize", xe);
|
|
2796
3233
|
}
|
|
2797
|
-
function
|
|
2798
|
-
return
|
|
2799
|
-
|
|
3234
|
+
function Us(n) {
|
|
3235
|
+
return We.add(n), xe || $s(), () => {
|
|
3236
|
+
We.delete(n), !We.size && typeof xe == "function" && (window.removeEventListener("resize", xe), xe = void 0);
|
|
2800
3237
|
};
|
|
2801
3238
|
}
|
|
2802
|
-
function
|
|
2803
|
-
return typeof n == "function" ?
|
|
2804
|
-
}
|
|
2805
|
-
function
|
|
2806
|
-
const
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
3239
|
+
function Hs(n, t) {
|
|
3240
|
+
return typeof n == "function" ? Us(n) : Vs(n, t);
|
|
3241
|
+
}
|
|
3242
|
+
function Jn(n) {
|
|
3243
|
+
const t = Qt.c(16);
|
|
3244
|
+
let e, r, s;
|
|
3245
|
+
t[0] !== n ? ({
|
|
3246
|
+
render: s,
|
|
3247
|
+
ref: r,
|
|
3248
|
+
...e
|
|
3249
|
+
} = n, t[0] = n, t[1] = e, t[2] = r, t[3] = s) : (e = t[1], r = t[2], s = t[3]);
|
|
3250
|
+
let i;
|
|
3251
|
+
t[4] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
3252
|
+
width: 0,
|
|
3253
|
+
height: 0
|
|
3254
|
+
}, t[4] = i) : i = t[4];
|
|
3255
|
+
const [o, c] = ne(i), a = Q(null);
|
|
3256
|
+
let f, l;
|
|
3257
|
+
t[5] === Symbol.for("react.memo_cache_sentinel") ? (f = () => {
|
|
3258
|
+
a.current && Hs(a.current, (v, p) => {
|
|
3259
|
+
c({
|
|
3260
|
+
width: p.width,
|
|
3261
|
+
height: p.height
|
|
3262
|
+
});
|
|
2810
3263
|
});
|
|
2811
|
-
}, []
|
|
2812
|
-
|
|
2813
|
-
|
|
3264
|
+
}, l = [], t[5] = f, t[6] = l) : (f = t[5], l = t[6]), $e(f, l);
|
|
3265
|
+
let m;
|
|
3266
|
+
t[7] !== r ? (m = Hn(a, r), t[7] = r, t[8] = m) : m = t[8];
|
|
3267
|
+
let d;
|
|
3268
|
+
t[9] !== s || t[10] !== o ? (d = s(o), t[9] = s, t[10] = o, t[11] = d) : d = t[11];
|
|
3269
|
+
let g;
|
|
3270
|
+
return t[12] !== e || t[13] !== m || t[14] !== d ? (g = /* @__PURE__ */ N.jsx("div", { ref: m, ...e, children: d }), t[12] = e, t[13] = m, t[14] = d, t[15] = g) : g = t[15], g;
|
|
3271
|
+
}
|
|
3272
|
+
const Bs = ({
|
|
2814
3273
|
width: n,
|
|
2815
3274
|
height: t,
|
|
2816
3275
|
editAreaRef: e,
|
|
@@ -2819,409 +3278,329 @@ const Ur = ({
|
|
|
2819
3278
|
scaleWidth: i,
|
|
2820
3279
|
scaleCount: o,
|
|
2821
3280
|
setScaleCount: c,
|
|
2822
|
-
startLeft:
|
|
2823
|
-
scrollLeft:
|
|
2824
|
-
scrollTop:
|
|
2825
|
-
scale:
|
|
2826
|
-
dragLine:
|
|
2827
|
-
getAssistDragLineActionIds:
|
|
2828
|
-
onActionMoveEnd:
|
|
2829
|
-
onActionMoveStart:
|
|
2830
|
-
onActionMoving:
|
|
2831
|
-
onActionResizeEnd:
|
|
2832
|
-
onActionResizeStart:
|
|
3281
|
+
startLeft: a,
|
|
3282
|
+
scrollLeft: f,
|
|
3283
|
+
scrollTop: l,
|
|
3284
|
+
scale: m,
|
|
3285
|
+
dragLine: d,
|
|
3286
|
+
getAssistDragLineActionIds: g,
|
|
3287
|
+
onActionMoveEnd: v,
|
|
3288
|
+
onActionMoveStart: p,
|
|
3289
|
+
onActionMoving: b,
|
|
3290
|
+
onActionResizeEnd: w,
|
|
3291
|
+
onActionResizeStart: h,
|
|
2833
3292
|
onActionResizing: x,
|
|
2834
|
-
onScroll:
|
|
2835
|
-
cursorTime:
|
|
2836
|
-
hideCursor:
|
|
2837
|
-
setEditorData:
|
|
2838
|
-
deltaScrollLeft:
|
|
2839
|
-
timelineWidth:
|
|
3293
|
+
onScroll: O,
|
|
3294
|
+
cursorTime: _,
|
|
3295
|
+
hideCursor: y,
|
|
3296
|
+
setEditorData: E,
|
|
3297
|
+
deltaScrollLeft: P,
|
|
3298
|
+
timelineWidth: C,
|
|
2840
3299
|
// Pass remaining CommonProp fields
|
|
2841
|
-
getActionRender:
|
|
2842
|
-
getScaleRender:
|
|
2843
|
-
onClickRow:
|
|
2844
|
-
onDoubleClickRow:
|
|
2845
|
-
onContextMenuRow:
|
|
2846
|
-
onClickAction:
|
|
2847
|
-
onClickActionOnly:
|
|
2848
|
-
onDoubleClickAction:
|
|
2849
|
-
onContextMenuAction:
|
|
2850
|
-
onCursorDragStart:
|
|
2851
|
-
onCursorDragEnd:
|
|
2852
|
-
onCursorDrag:
|
|
2853
|
-
onClickTimeArea:
|
|
2854
|
-
gridSnap:
|
|
2855
|
-
effects:
|
|
3300
|
+
getActionRender: H,
|
|
3301
|
+
getScaleRender: X,
|
|
3302
|
+
onClickRow: z,
|
|
3303
|
+
onDoubleClickRow: F,
|
|
3304
|
+
onContextMenuRow: q,
|
|
3305
|
+
onClickAction: S,
|
|
3306
|
+
onClickActionOnly: R,
|
|
3307
|
+
onDoubleClickAction: M,
|
|
3308
|
+
onContextMenuAction: U,
|
|
3309
|
+
onCursorDragStart: ft,
|
|
3310
|
+
onCursorDragEnd: gt,
|
|
3311
|
+
onCursorDrag: u,
|
|
3312
|
+
onClickTimeArea: T,
|
|
3313
|
+
gridSnap: I,
|
|
3314
|
+
effects: V
|
|
2856
3315
|
}) => {
|
|
2857
|
-
const {
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
3316
|
+
const {
|
|
3317
|
+
dragLineData: _t,
|
|
3318
|
+
initDragLine: vt,
|
|
3319
|
+
updateDragLine: D,
|
|
3320
|
+
disposeDragLine: rt,
|
|
3321
|
+
defaultGetAssistPosition: $,
|
|
3322
|
+
defaultGetMovePosition: k
|
|
3323
|
+
} = Ds(), j = Q(null), jt = Q(-1), Ut = (J) => {
|
|
3324
|
+
if (d) {
|
|
3325
|
+
const Z = g && g({
|
|
3326
|
+
action: J.action,
|
|
3327
|
+
row: J.row,
|
|
2862
3328
|
editorData: r
|
|
2863
|
-
}),
|
|
3329
|
+
}), Y = i ?? 160, it = m ?? 1, bt = a ?? 20, Tt = y ?? !1, Pt = $t(_, {
|
|
3330
|
+
scaleWidth: Y,
|
|
3331
|
+
scale: it,
|
|
3332
|
+
startLeft: bt
|
|
3333
|
+
}), Ht = $({
|
|
2864
3334
|
editorData: r,
|
|
2865
|
-
assistActionIds:
|
|
2866
|
-
action:
|
|
2867
|
-
row:
|
|
2868
|
-
scale:
|
|
2869
|
-
scaleWidth:
|
|
2870
|
-
startLeft:
|
|
2871
|
-
hideCursor:
|
|
2872
|
-
cursorLeft:
|
|
3335
|
+
assistActionIds: Z,
|
|
3336
|
+
action: J.action,
|
|
3337
|
+
row: J.row,
|
|
3338
|
+
scale: it,
|
|
3339
|
+
scaleWidth: Y,
|
|
3340
|
+
startLeft: bt,
|
|
3341
|
+
hideCursor: Tt,
|
|
3342
|
+
cursorLeft: Pt
|
|
3343
|
+
});
|
|
3344
|
+
vt({
|
|
3345
|
+
assistPositions: Ht
|
|
2873
3346
|
});
|
|
2874
|
-
D({ assistPositions: ft });
|
|
2875
3347
|
}
|
|
2876
|
-
},
|
|
2877
|
-
if (
|
|
2878
|
-
const
|
|
2879
|
-
...
|
|
2880
|
-
startLeft:
|
|
3348
|
+
}, It = (J) => {
|
|
3349
|
+
if (d) {
|
|
3350
|
+
const bt = k({
|
|
3351
|
+
...J,
|
|
3352
|
+
startLeft: a ?? 20,
|
|
2881
3353
|
scaleWidth: i ?? 160,
|
|
2882
|
-
scale:
|
|
3354
|
+
scale: m ?? 1
|
|
3355
|
+
});
|
|
3356
|
+
D({
|
|
3357
|
+
movePositions: bt
|
|
2883
3358
|
});
|
|
2884
|
-
w({ movePositions: z });
|
|
2885
3359
|
}
|
|
2886
3360
|
};
|
|
2887
|
-
let
|
|
2888
|
-
const
|
|
2889
|
-
const
|
|
2890
|
-
return
|
|
3361
|
+
let xt = 0;
|
|
3362
|
+
const Rt = s ?? 32, At = r.map((J) => {
|
|
3363
|
+
const Z = J.rowHeight || Rt;
|
|
3364
|
+
return xt += Z, Z;
|
|
2891
3365
|
});
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
})),
|
|
2895
|
-
const
|
|
2896
|
-
count:
|
|
2897
|
-
getScrollElement: () =>
|
|
2898
|
-
estimateSize: (
|
|
3366
|
+
xt < t && (At.push(t - xt), jt.current !== t && jt.current >= 0 && setTimeout(() => {
|
|
3367
|
+
Dt.measure();
|
|
3368
|
+
})), jt.current = t;
|
|
3369
|
+
const Wt = i ?? 160, Ot = a ?? 20, Ct = Math.max(o * Wt + Ot, n), Dt = Kn({
|
|
3370
|
+
count: At.length,
|
|
3371
|
+
getScrollElement: () => j.current,
|
|
3372
|
+
estimateSize: (J) => At[J] ?? Rt,
|
|
2899
3373
|
overscan: 10
|
|
2900
3374
|
});
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
}, [
|
|
2904
|
-
|
|
2905
|
-
}, [r,
|
|
2906
|
-
const
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2909
|
-
clientHeight:
|
|
2910
|
-
clientWidth:
|
|
2911
|
-
scrollHeight:
|
|
2912
|
-
scrollLeft:
|
|
2913
|
-
scrollTop:
|
|
2914
|
-
scrollWidth:
|
|
3375
|
+
$e(() => {
|
|
3376
|
+
j.current && (l !== void 0 && (j.current.scrollTop = l), f !== void 0 && (j.current.scrollLeft = f));
|
|
3377
|
+
}, [l, f]), Vt(() => {
|
|
3378
|
+
Dt.measure();
|
|
3379
|
+
}, [r, Dt]);
|
|
3380
|
+
const te = (J) => {
|
|
3381
|
+
const Z = J.currentTarget;
|
|
3382
|
+
O({
|
|
3383
|
+
clientHeight: Z.clientHeight,
|
|
3384
|
+
clientWidth: Z.clientWidth,
|
|
3385
|
+
scrollHeight: Z.scrollHeight,
|
|
3386
|
+
scrollLeft: Z.scrollLeft,
|
|
3387
|
+
scrollTop: Z.scrollTop,
|
|
3388
|
+
scrollWidth: Z.scrollWidth
|
|
2915
3389
|
});
|
|
2916
3390
|
};
|
|
2917
|
-
return /* @__PURE__ */
|
|
2918
|
-
/* @__PURE__ */
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
editorData: r,
|
|
2941
|
-
rowHeight: s,
|
|
2942
|
-
scaleWidth: i,
|
|
2943
|
-
startLeft: l,
|
|
2944
|
-
scale: g,
|
|
2945
|
-
hideCursor: C,
|
|
2946
|
-
timelineWidth: N,
|
|
2947
|
-
getActionRender: L,
|
|
2948
|
-
getScaleRender: j,
|
|
2949
|
-
onClickRow: W,
|
|
2950
|
-
onDoubleClickRow: Y,
|
|
2951
|
-
onContextMenuRow: st,
|
|
2952
|
-
onClickAction: M,
|
|
2953
|
-
onClickActionOnly: U,
|
|
2954
|
-
onDoubleClickAction: q,
|
|
2955
|
-
onContextMenuAction: K,
|
|
2956
|
-
onCursorDragStart: mt,
|
|
2957
|
-
onCursorDragEnd: dt,
|
|
2958
|
-
onCursorDrag: f,
|
|
2959
|
-
onClickTimeArea: A,
|
|
2960
|
-
gridSnap: d,
|
|
2961
|
-
effects: _,
|
|
2962
|
-
setEditorData: I,
|
|
2963
|
-
deltaScrollLeft: k,
|
|
2964
|
-
style: {
|
|
2965
|
-
position: "absolute",
|
|
2966
|
-
top: 0,
|
|
2967
|
-
left: 0,
|
|
2968
|
-
width: jt,
|
|
2969
|
-
height: `${Q.size}px`,
|
|
2970
|
-
transform: `translateY(${Q.start}px)`,
|
|
2971
|
-
backgroundPositionX: `0, ${l ?? 20}px`,
|
|
2972
|
-
backgroundSize: `${l ?? 20}px, ${i ?? 160}px`
|
|
2973
|
-
},
|
|
2974
|
-
areaRef: e,
|
|
2975
|
-
rowData: nt,
|
|
2976
|
-
dragLineData: E,
|
|
2977
|
-
onActionMoveStart: (H) => (et(H), y && y(H)),
|
|
2978
|
-
onActionResizeStart: (H) => (et(H), v && v(H)),
|
|
2979
|
-
onActionMoving: (H) => (Z(H), m && m(H)),
|
|
2980
|
-
onActionResizing: (H) => (Z(H), x && x(H)),
|
|
2981
|
-
onActionResizeEnd: (H) => (X(), h && h(H)),
|
|
2982
|
-
onActionMoveEnd: (H) => (X(), S && S(H)),
|
|
2983
|
-
scrollLeft: u
|
|
2984
|
-
},
|
|
2985
|
-
Q.key
|
|
2986
|
-
);
|
|
2987
|
-
})
|
|
2988
|
-
}
|
|
2989
|
-
)
|
|
2990
|
-
}
|
|
2991
|
-
),
|
|
2992
|
-
p && /* @__PURE__ */ P.jsx(Or, { scrollLeft: u, ...E })
|
|
3391
|
+
return /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
|
|
3392
|
+
/* @__PURE__ */ N.jsx("div", { ref: j, style: {
|
|
3393
|
+
width: n,
|
|
3394
|
+
height: t,
|
|
3395
|
+
overflow: "auto"
|
|
3396
|
+
}, onScroll: te, children: /* @__PURE__ */ N.jsx("div", { style: {
|
|
3397
|
+
height: `${Dt.getTotalSize()}px`,
|
|
3398
|
+
width: Ct,
|
|
3399
|
+
position: "relative"
|
|
3400
|
+
}, children: Dt.getVirtualItems().map((J) => {
|
|
3401
|
+
const Z = r[J.index];
|
|
3402
|
+
return /* @__PURE__ */ N.jsx(Cs, { scaleCount: o, setScaleCount: c, cursorTime: _, editorData: r, rowHeight: s, scaleWidth: i, startLeft: a, scale: m, hideCursor: y, timelineWidth: C, getActionRender: H, getScaleRender: X, onClickRow: z, onDoubleClickRow: F, onContextMenuRow: q, onClickAction: S, onClickActionOnly: R, onDoubleClickAction: M, onContextMenuAction: U, onCursorDragStart: ft, onCursorDragEnd: gt, onCursorDrag: u, onClickTimeArea: T, gridSnap: I, effects: V, setEditorData: E, deltaScrollLeft: P, style: {
|
|
3403
|
+
position: "absolute",
|
|
3404
|
+
top: 0,
|
|
3405
|
+
left: 0,
|
|
3406
|
+
width: Ct,
|
|
3407
|
+
height: `${J.size}px`,
|
|
3408
|
+
transform: `translateY(${J.start}px)`,
|
|
3409
|
+
backgroundPositionX: `0, ${a ?? 20}px`,
|
|
3410
|
+
backgroundSize: `${a ?? 20}px, ${i ?? 160}px`
|
|
3411
|
+
}, areaRef: e, rowData: Z, dragLineData: _t, onActionMoveStart: (Y) => (Ut(Y), p && p(Y)), onActionResizeStart: (Y) => (Ut(Y), h && h(Y)), onActionMoving: (Y) => (It(Y), b && b(Y)), onActionResizing: (Y) => (It(Y), x && x(Y)), onActionResizeEnd: (Y) => (rt(), w && w(Y)), onActionMoveEnd: (Y) => (rt(), v && v(Y)), scrollLeft: f }, J.key);
|
|
3412
|
+
}) }) }),
|
|
3413
|
+
d && /* @__PURE__ */ N.jsx(As, { scrollLeft: f, ..._t })
|
|
2993
3414
|
] });
|
|
2994
|
-
},
|
|
2995
|
-
const e =
|
|
2996
|
-
return
|
|
3415
|
+
}, Xs = Zt.forwardRef((n, t) => {
|
|
3416
|
+
const e = Q(null);
|
|
3417
|
+
return nn(t, () => ({
|
|
2997
3418
|
get domRef() {
|
|
2998
3419
|
return e;
|
|
2999
3420
|
}
|
|
3000
|
-
})), /* @__PURE__ */
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
})
|
|
3017
|
-
const
|
|
3018
|
-
const
|
|
3019
|
-
switch (
|
|
3421
|
+
})), /* @__PURE__ */ N.jsx(Jn, { ref: e, className: mt("edit-area"), render: ({
|
|
3422
|
+
width: r,
|
|
3423
|
+
height: s
|
|
3424
|
+
}) => /* @__PURE__ */ N.jsx(Bs, { ...n, width: r, height: s, editAreaRef: e }) });
|
|
3425
|
+
}), Ys = ({
|
|
3426
|
+
setCursor: n,
|
|
3427
|
+
maxScaleCount: t,
|
|
3428
|
+
hideCursor: e,
|
|
3429
|
+
scale: r,
|
|
3430
|
+
scaleWidth: s,
|
|
3431
|
+
scaleCount: i,
|
|
3432
|
+
scaleSplitCount: o,
|
|
3433
|
+
startLeft: c,
|
|
3434
|
+
scrollLeft: a,
|
|
3435
|
+
onClickTimeArea: f,
|
|
3436
|
+
getScaleRender: l
|
|
3437
|
+
}) => {
|
|
3438
|
+
const m = Q(null), d = (o ?? 0) > 0, g = (b) => {
|
|
3439
|
+
const w = o ?? 1, h = s ?? 160, x = c ?? 20;
|
|
3440
|
+
switch (b) {
|
|
3020
3441
|
case 0:
|
|
3021
3442
|
return x;
|
|
3022
3443
|
default:
|
|
3023
|
-
return
|
|
3444
|
+
return d ? h / w : h;
|
|
3024
3445
|
}
|
|
3025
|
-
},
|
|
3446
|
+
}, v = d ? i * (o ?? 1) + 1 : i, p = Kn({
|
|
3026
3447
|
horizontal: !0,
|
|
3027
|
-
count:
|
|
3028
|
-
getScrollElement: () =>
|
|
3029
|
-
estimateSize:
|
|
3448
|
+
count: v,
|
|
3449
|
+
getScrollElement: () => m.current,
|
|
3450
|
+
estimateSize: g,
|
|
3030
3451
|
overscan: 10
|
|
3031
3452
|
});
|
|
3032
|
-
return
|
|
3033
|
-
|
|
3034
|
-
}, [
|
|
3035
|
-
|
|
3036
|
-
}, [s, c,
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
)
|
|
3084
|
-
}
|
|
3085
|
-
),
|
|
3086
|
-
/* @__PURE__ */ P.jsx(
|
|
3087
|
-
"div",
|
|
3088
|
-
{
|
|
3089
|
-
style: { width: m, height: h },
|
|
3090
|
-
onClick: (v) => {
|
|
3091
|
-
if (e) return;
|
|
3092
|
-
const x = c ?? 20, T = s ?? 160, b = r ?? 1, C = t ?? 1 / 0, I = v.currentTarget.getBoundingClientRect(), k = v.clientX - I.x, N = Math.max(k + l, x);
|
|
3093
|
-
if (N > C * T + x - l) return;
|
|
3094
|
-
const L = Tt(N, { startLeft: x, scale: b, scaleWidth: T });
|
|
3095
|
-
(u && u(L, v)) !== !1 && n({ time: L });
|
|
3096
|
-
},
|
|
3097
|
-
className: tt("time-area-interact")
|
|
3098
|
-
}
|
|
3099
|
-
)
|
|
3100
|
-
] })
|
|
3101
|
-
}
|
|
3102
|
-
);
|
|
3103
|
-
}, Yr = Mt.forwardRef((n, t) => {
|
|
3104
|
-
const e = hn(n), { style: r } = n;
|
|
3453
|
+
return $e(() => {
|
|
3454
|
+
m.current && a !== void 0 && (m.current.scrollLeft = a);
|
|
3455
|
+
}, [a]), Vt(() => {
|
|
3456
|
+
p.measure();
|
|
3457
|
+
}, [s, c, p]), /* @__PURE__ */ N.jsx(Jn, { className: mt("time-area"), render: ({
|
|
3458
|
+
width: b,
|
|
3459
|
+
height: w
|
|
3460
|
+
}) => /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
|
|
3461
|
+
/* @__PURE__ */ N.jsx("div", { className: mt("time-area-virtual"), ref: m, style: {
|
|
3462
|
+
width: b,
|
|
3463
|
+
height: w,
|
|
3464
|
+
overflowX: "hidden",
|
|
3465
|
+
overflowY: "hidden"
|
|
3466
|
+
}, children: /* @__PURE__ */ N.jsx("div", { style: {
|
|
3467
|
+
width: `${p.getTotalSize()}px`,
|
|
3468
|
+
height: "100%",
|
|
3469
|
+
position: "relative"
|
|
3470
|
+
}, children: p.getVirtualItems().map((h) => {
|
|
3471
|
+
const x = h.index, O = o ?? 1, _ = r ?? 1, y = d ? x % O === 0 : !0, E = ["time-unit"];
|
|
3472
|
+
y && E.push("time-unit-big");
|
|
3473
|
+
const P = (d ? x / O : x) * _;
|
|
3474
|
+
return /* @__PURE__ */ N.jsx("div", { "data-index": h.index, style: {
|
|
3475
|
+
position: "absolute",
|
|
3476
|
+
top: 0,
|
|
3477
|
+
left: 0,
|
|
3478
|
+
height: "100%",
|
|
3479
|
+
width: `${h.size}px`,
|
|
3480
|
+
transform: `translateX(${h.start}px)`
|
|
3481
|
+
}, className: mt(...E), children: y && /* @__PURE__ */ N.jsx("div", { className: mt("time-unit-scale"), children: l ? l(P) : P }) }, h.key);
|
|
3482
|
+
}) }) }),
|
|
3483
|
+
/* @__PURE__ */ N.jsx("div", { style: {
|
|
3484
|
+
width: b,
|
|
3485
|
+
height: w
|
|
3486
|
+
}, onClick: (h) => {
|
|
3487
|
+
if (e) return;
|
|
3488
|
+
const x = c ?? 20, O = s ?? 160, _ = r ?? 1, y = t ?? 1 / 0, E = h.currentTarget.getBoundingClientRect(), P = h.clientX - E.x, C = Math.max(P + a, x);
|
|
3489
|
+
if (C > y * O + x - a) return;
|
|
3490
|
+
const H = re(C, {
|
|
3491
|
+
startLeft: x,
|
|
3492
|
+
scale: _,
|
|
3493
|
+
scaleWidth: O
|
|
3494
|
+
});
|
|
3495
|
+
(f && f(H, h)) !== !1 && n({
|
|
3496
|
+
time: H
|
|
3497
|
+
});
|
|
3498
|
+
}, className: mt("time-area-interact") })
|
|
3499
|
+
] }) });
|
|
3500
|
+
}, qs = Zt.forwardRef((n, t) => {
|
|
3501
|
+
const e = ur(n), {
|
|
3502
|
+
style: r
|
|
3503
|
+
} = n;
|
|
3105
3504
|
let {
|
|
3106
3505
|
editorData: s,
|
|
3107
3506
|
scrollTop: i,
|
|
3108
3507
|
autoScroll: o,
|
|
3109
3508
|
hideCursor: c,
|
|
3110
|
-
disableDrag:
|
|
3111
|
-
scale:
|
|
3112
|
-
scaleWidth:
|
|
3113
|
-
startLeft:
|
|
3114
|
-
minScaleCount:
|
|
3115
|
-
maxScaleCount:
|
|
3116
|
-
onChange:
|
|
3117
|
-
onScroll:
|
|
3509
|
+
disableDrag: a,
|
|
3510
|
+
scale: f = 1,
|
|
3511
|
+
scaleWidth: l = 160,
|
|
3512
|
+
startLeft: m = 20,
|
|
3513
|
+
minScaleCount: d = 20,
|
|
3514
|
+
maxScaleCount: g = 1 / 0,
|
|
3515
|
+
onChange: v,
|
|
3516
|
+
onScroll: p
|
|
3118
3517
|
} = e;
|
|
3119
|
-
const
|
|
3120
|
-
(
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3518
|
+
const b = Q(null), w = Q(null), h = Q(null), [x, O] = ne(s), [_, y] = ne(tn), [E, P] = ne(sr), [C, H] = ne(Number.MAX_SAFE_INTEGER), X = Qn((S) => {
|
|
3519
|
+
const R = Math.min(g, Math.max(d, S));
|
|
3520
|
+
y(R);
|
|
3521
|
+
}, [g, d]);
|
|
3522
|
+
$e(() => {
|
|
3523
|
+
X(fr(s, {
|
|
3524
|
+
scale: f
|
|
3525
|
+
})), O(s);
|
|
3526
|
+
}, [s, d, g, f, X]), Vt(() => {
|
|
3527
|
+
i !== void 0 && h.current?.setScrollState((S) => ({
|
|
3528
|
+
...S,
|
|
3529
|
+
scrollTop: i
|
|
3530
|
+
}));
|
|
3131
3531
|
}, [i]);
|
|
3132
|
-
const
|
|
3133
|
-
S
|
|
3134
|
-
},
|
|
3135
|
-
let {
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3532
|
+
const z = (S) => {
|
|
3533
|
+
v?.(S);
|
|
3534
|
+
}, F = (S) => {
|
|
3535
|
+
let {
|
|
3536
|
+
left: R,
|
|
3537
|
+
time: M
|
|
3538
|
+
} = S;
|
|
3539
|
+
if (typeof R > "u" && typeof M > "u") return !0;
|
|
3540
|
+
typeof M > "u" && (R = $t(M ?? 0, {
|
|
3541
|
+
startLeft: m,
|
|
3542
|
+
scale: f,
|
|
3543
|
+
scaleWidth: l
|
|
3544
|
+
}), M = re(R, {
|
|
3545
|
+
startLeft: m,
|
|
3546
|
+
scale: f,
|
|
3547
|
+
scaleWidth: l
|
|
3548
|
+
}));
|
|
3549
|
+
let U = !0;
|
|
3550
|
+
return P(M), U;
|
|
3551
|
+
}, q = (S) => {
|
|
3552
|
+
!h.current?.state || h.current.state.scrollLeft + S > _ * (l - 1) + m - C || h.current && h.current.setScrollState((M) => ({
|
|
3553
|
+
...M,
|
|
3554
|
+
scrollLeft: Math.max(M.scrollLeft + S, 0)
|
|
3555
|
+
}));
|
|
3143
3556
|
};
|
|
3144
|
-
return
|
|
3557
|
+
return nn(t, () => ({
|
|
3145
3558
|
get target() {
|
|
3146
|
-
return
|
|
3559
|
+
return b.current;
|
|
3147
3560
|
},
|
|
3148
|
-
set time(
|
|
3149
|
-
|
|
3561
|
+
set time(S) {
|
|
3562
|
+
F({
|
|
3563
|
+
time: S
|
|
3564
|
+
});
|
|
3150
3565
|
},
|
|
3151
3566
|
get time() {
|
|
3152
|
-
return
|
|
3567
|
+
return E;
|
|
3153
3568
|
},
|
|
3154
|
-
setScrollLeft: (
|
|
3155
|
-
|
|
3569
|
+
setScrollLeft: (S) => {
|
|
3570
|
+
h.current && h.current.setScrollState((R) => ({
|
|
3571
|
+
...R,
|
|
3572
|
+
scrollLeft: Math.max(S, 0)
|
|
3573
|
+
}));
|
|
3156
3574
|
},
|
|
3157
|
-
setScrollTop: (
|
|
3158
|
-
|
|
3575
|
+
setScrollTop: (S) => {
|
|
3576
|
+
h.current && h.current.setScrollState((R) => ({
|
|
3577
|
+
...R,
|
|
3578
|
+
scrollTop: Math.max(S, 0)
|
|
3579
|
+
}));
|
|
3159
3580
|
}
|
|
3160
|
-
})),
|
|
3161
|
-
if (
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3581
|
+
})), Vt(() => {
|
|
3582
|
+
if (w.current) {
|
|
3583
|
+
const S = new ResizeObserver(() => {
|
|
3584
|
+
w.current && H(w.current.getBoundingClientRect().width);
|
|
3164
3585
|
});
|
|
3165
|
-
return
|
|
3166
|
-
|
|
3586
|
+
return S.observe(w.current), () => {
|
|
3587
|
+
S && S.disconnect();
|
|
3167
3588
|
};
|
|
3168
3589
|
}
|
|
3169
|
-
}, []), /* @__PURE__ */
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
onScroll: q,
|
|
3182
|
-
scrollLeft: M
|
|
3183
|
-
}
|
|
3184
|
-
),
|
|
3185
|
-
/* @__PURE__ */ P.jsx(
|
|
3186
|
-
$r,
|
|
3187
|
-
{
|
|
3188
|
-
...e,
|
|
3189
|
-
timelineWidth: N,
|
|
3190
|
-
ref: (K) => {
|
|
3191
|
-
K != null && K.domRef.current && (h.current = K.domRef.current);
|
|
3192
|
-
},
|
|
3193
|
-
disableDrag: l,
|
|
3194
|
-
editorData: x,
|
|
3195
|
-
cursorTime: I,
|
|
3196
|
-
scaleCount: b,
|
|
3197
|
-
setScaleCount: j,
|
|
3198
|
-
scrollTop: U,
|
|
3199
|
-
scrollLeft: M,
|
|
3200
|
-
setEditorData: W,
|
|
3201
|
-
deltaScrollLeft: o ? st : void 0,
|
|
3202
|
-
onScroll: (K) => {
|
|
3203
|
-
q(K), y == null || y(K);
|
|
3204
|
-
}
|
|
3205
|
-
}
|
|
3206
|
-
),
|
|
3207
|
-
!c && /* @__PURE__ */ P.jsx(
|
|
3208
|
-
pr,
|
|
3209
|
-
{
|
|
3210
|
-
...e,
|
|
3211
|
-
timelineWidth: N,
|
|
3212
|
-
scrollLeft: M,
|
|
3213
|
-
scaleCount: b,
|
|
3214
|
-
setScaleCount: j,
|
|
3215
|
-
setCursor: Y,
|
|
3216
|
-
cursorTime: I,
|
|
3217
|
-
editorData: x,
|
|
3218
|
-
areaRef: h,
|
|
3219
|
-
scrollSync: v,
|
|
3220
|
-
deltaScrollLeft: o ? st : void 0
|
|
3221
|
-
}
|
|
3222
|
-
)
|
|
3590
|
+
}, []), /* @__PURE__ */ N.jsx("div", { ref: b, style: r, className: `${Je} ${a ? Je + "-disable" : ""}`, children: /* @__PURE__ */ N.jsx(Yn, { ref: h, children: ({
|
|
3591
|
+
scrollLeft: S,
|
|
3592
|
+
scrollTop: R,
|
|
3593
|
+
onScroll: M
|
|
3594
|
+
}) => /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
|
|
3595
|
+
/* @__PURE__ */ N.jsx(Ys, { ...e, timelineWidth: C, disableDrag: a, setCursor: F, cursorTime: E, editorData: x, scaleCount: _, setScaleCount: X, onScroll: M, scrollLeft: S }),
|
|
3596
|
+
/* @__PURE__ */ N.jsx(Xs, { ...e, timelineWidth: C, ref: (U) => {
|
|
3597
|
+
U?.domRef.current && (w.current = U.domRef.current);
|
|
3598
|
+
}, disableDrag: a, editorData: x, cursorTime: E, scaleCount: _, setScaleCount: X, scrollTop: R, scrollLeft: S, setEditorData: z, deltaScrollLeft: o ? q : void 0, onScroll: (U) => {
|
|
3599
|
+
M(U), p?.(U);
|
|
3600
|
+
} }),
|
|
3601
|
+
!c && /* @__PURE__ */ N.jsx(ps, { ...e, timelineWidth: C, scrollLeft: S, scaleCount: _, setScaleCount: X, setCursor: F, cursorTime: E, editorData: x, areaRef: w, scrollSync: h, deltaScrollLeft: o ? q : void 0 })
|
|
3223
3602
|
] }) }) });
|
|
3224
3603
|
});
|
|
3225
3604
|
export {
|
|
3226
|
-
|
|
3605
|
+
qs as Timeline
|
|
3227
3606
|
};
|