@sheetxl/utils-react 0.7.21 → 0.7.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{BA9O-cekHrH5qrOm.cjs → O75UN37bxYdOt58p.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/index.mjs +640 -630
- package/browser/esm/{DTq8GPy7DLZm2D6S.mjs → r7vPXPCC6zFI-B4m.mjs} +1 -1
- package/node/esm/{4mSSJ5fhNdMhHCE6.mjs → CJ8rg6a2gULy0991.mjs} +1 -1
- package/node/esm/index.mjs +598 -588
- package/package.json +2 -2
- package/types/index.d.ts +198 -124
package/node/esm/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.22
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
7
|
+
import t, { useRef as e, useReducer as n, useMemo as o, useEffect as r, useState as i, memo as s, forwardRef as l, useCallback as a, createContext as c, useContext as h, useLayoutEffect as u, createElement as d, useImperativeHandle as p, Component as m } from "react";
|
|
8
|
+
import { CommonUtils as f, DefaultNotifier as _, Notifier as g, InternalClipboard as y, ClipboardUtils as v, MimeType as w } from "@sheetxl/utils";
|
|
9
|
+
import * as b from "detect-it";
|
|
10
10
|
import { jsx as x, jsxs as S, Fragment as E } from "react/jsx-runtime";
|
|
11
11
|
import { mergeRefs as L } from "react-merge-refs";
|
|
12
12
|
import { useMeasure as M } from "react-use";
|
|
@@ -17,10 +17,10 @@ const P = { General: "general", Left: "left", Right: "right", Center: "center",
|
|
|
17
17
|
class $ {
|
|
18
18
|
constructor(t2, e2, n2, o2) {
|
|
19
19
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
|
|
20
|
-
console.log(`implement: ${this.
|
|
20
|
+
console.log(`implement: ${this.getLabel()} : ${this.getDescription()}`);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
getKey() {
|
|
24
24
|
return this._key;
|
|
25
25
|
}
|
|
26
26
|
_resolve(t2, e2) {
|
|
@@ -30,10 +30,10 @@ class $ {
|
|
|
30
30
|
}
|
|
31
31
|
return t2;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
getTarget() {
|
|
34
34
|
return "function" == typeof this._target ? this._target() : this._target;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
getLabel(t2, e2) {
|
|
37
37
|
const n2 = this._scopedLabels?.[t2] || this._label;
|
|
38
38
|
let o2 = null;
|
|
39
39
|
if ("function" == typeof n2) {
|
|
@@ -42,25 +42,25 @@ class $ {
|
|
|
42
42
|
} else o2 = n2;
|
|
43
43
|
return o2;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
getDescription(t2) {
|
|
46
46
|
return this._resolve(this._description, t2);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
getTags(t2) {
|
|
49
49
|
return this._resolve(this._tags, t2);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
getIcon(t2) {
|
|
52
52
|
return this._resolve(this._icon, t2);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
getShortcut() {
|
|
55
55
|
return this._resolve(this._shortcut);
|
|
56
56
|
}
|
|
57
57
|
disabled() {
|
|
58
58
|
return this._resolve(this._disabled) || !this._callback;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
getState() {
|
|
61
61
|
return this._resolve(this._state);
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
getContext() {
|
|
64
64
|
return "function" == typeof this._context ? this._context() : this._context;
|
|
65
65
|
}
|
|
66
66
|
async execute(t2, e2) {
|
|
@@ -128,11 +128,39 @@ class $ {
|
|
|
128
128
|
}
|
|
129
129
|
class K extends $ {
|
|
130
130
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
function I(t2, i2 = null) {
|
|
132
|
+
const s2 = e(i2);
|
|
133
|
+
s2.current = i2;
|
|
134
|
+
const [l2, a2] = n((t3) => t3 + 1, 0), c2 = o(() => Array.isArray(t2) ? t2 : [t2], [t2]);
|
|
135
|
+
return r(() => {
|
|
136
|
+
const t3 = c2 ? c2.length : 0;
|
|
137
|
+
if (0 === t3) return;
|
|
138
|
+
const e2 = (t4, e3) => {
|
|
139
|
+
s2.current?.onChange?.(e3), a2();
|
|
140
|
+
};
|
|
141
|
+
let n2 = null;
|
|
142
|
+
i2 && (n2 = { onExecute(t4, e3) {
|
|
143
|
+
s2.current?.onExecute?.(t4, e3);
|
|
144
|
+
}, onError(t4, e3, n3) {
|
|
145
|
+
s2.current?.onError?.(t4, e3, n3);
|
|
146
|
+
} });
|
|
147
|
+
const o2 = /* @__PURE__ */ new Set();
|
|
148
|
+
for (let r2 = 0; r2 < t3; r2++) {
|
|
149
|
+
const t4 = c2[r2];
|
|
150
|
+
t4 && (o2.add(t4.addPropertyListener(f.debounce(e2, 0), true)), i2 && o2.add(t4.addExecuteListener(n2)));
|
|
151
|
+
}
|
|
152
|
+
return () => {
|
|
153
|
+
o2.forEach((t4) => {
|
|
154
|
+
t4?.();
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
}, [t2]), l2;
|
|
158
|
+
}
|
|
159
|
+
const O = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), N = {};
|
|
160
|
+
function H() {
|
|
161
|
+
return b;
|
|
134
162
|
}
|
|
135
|
-
const
|
|
163
|
+
const R = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : f.camelToPrettyCase(t2), W = (t2, e2) => {
|
|
136
164
|
let n2 = false, o2 = false;
|
|
137
165
|
const r2 = { nativeEvent: t2, currentTarget: e2 || t2.currentTarget, target: t2.target, bubbles: t2.bubbles, cancelable: t2.cancelable, defaultPrevented: t2.defaultPrevented, eventPhase: t2.eventPhase, isTrusted: t2.isTrusted, preventDefault: () => {
|
|
138
166
|
n2 = true, t2.preventDefault();
|
|
@@ -142,16 +170,16 @@ const H = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : t.c
|
|
|
142
170
|
}, timeStamp: t2.timeStamp, type: t2.type };
|
|
143
171
|
for (const e3 in t2) e3 in r2 || "function" == typeof t2[e3] || (r2[e3] = t2[e3]);
|
|
144
172
|
return r2;
|
|
145
|
-
},
|
|
173
|
+
}, V = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: N, boundPixel: function(t2, e2 = false, n2 = 0) {
|
|
146
174
|
return t2;
|
|
147
|
-
}, createSyntheticEvent:
|
|
148
|
-
class
|
|
149
|
-
constructor(
|
|
150
|
-
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid =
|
|
151
|
-
const
|
|
152
|
-
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (
|
|
153
|
-
const
|
|
154
|
-
i2 &&
|
|
175
|
+
}, createSyntheticEvent: W, detectIt: H, focusableNodeNames: O, toPrettyKeyCode: R }, Symbol.toStringTag, { value: "Module" }));
|
|
176
|
+
class F {
|
|
177
|
+
constructor(t2, e2) {
|
|
178
|
+
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = f.uuidV4(), this._target = t2, this._groupKey = e2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
179
|
+
const n2 = this;
|
|
180
|
+
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t3, e3) => {
|
|
181
|
+
const o2 = n2._root._listenersByKey, r2 = e3.getKey(), i2 = o2.get(r2);
|
|
182
|
+
i2 && n2._notifyCommands(i2, "onCommandChange", e3);
|
|
155
183
|
};
|
|
156
184
|
}
|
|
157
185
|
_getCommand(t2) {
|
|
@@ -173,7 +201,7 @@ class V {
|
|
|
173
201
|
n3 && (o2 = n3), t3 = t3._parent;
|
|
174
202
|
}
|
|
175
203
|
}
|
|
176
|
-
o2 || (o2 = new
|
|
204
|
+
o2 || (o2 = new F(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
|
|
177
205
|
const r2 = (t3, o3) => {
|
|
178
206
|
!t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
|
|
179
207
|
};
|
|
@@ -189,23 +217,23 @@ class V {
|
|
|
189
217
|
return this._nodes.get(t2);
|
|
190
218
|
}
|
|
191
219
|
_addCommands(t2, e2 = void 0) {
|
|
192
|
-
const n2 = this._commandsByKey, o2 = this._commandsByShortcut, r2 = this._root._commandsPropertyListener, i2 = this._root._unListenersByCommand;
|
|
193
|
-
for (let
|
|
194
|
-
const
|
|
220
|
+
const n2 = this._commandsByKey, o2 = this._commandsByShortcut, r2 = this._root._commandsPropertyListener, i2 = this._root._unListenersByCommand, s2 = t2.length;
|
|
221
|
+
for (let l2 = 0; l2 < s2; l2++) {
|
|
222
|
+
const s3 = t2[l2], a2 = s3.getKey();
|
|
195
223
|
if (n2.has(a2) && !e2) {
|
|
196
224
|
void 0 === e2 && console.warn("command already registered", a2);
|
|
197
225
|
continue;
|
|
198
226
|
}
|
|
199
|
-
n2.set(a2,
|
|
200
|
-
let c2 = i2.get(
|
|
201
|
-
c2 && (c2(), i2.delete(
|
|
202
|
-
const h2 =
|
|
203
|
-
i2.set(
|
|
204
|
-
const u2 =
|
|
227
|
+
n2.set(a2, s3);
|
|
228
|
+
let c2 = i2.get(s3);
|
|
229
|
+
c2 && (c2(), i2.delete(s3));
|
|
230
|
+
const h2 = s3.addPropertyListener(r2);
|
|
231
|
+
i2.set(s3, h2);
|
|
232
|
+
const u2 = s3.getShortcut();
|
|
205
233
|
if (!u2) continue;
|
|
206
|
-
const d2 = Array.isArray(u2) ? u2 : [u2];
|
|
207
|
-
for (let t3 = 0; t3 <
|
|
208
|
-
const n3 =
|
|
234
|
+
const d2 = Array.isArray(u2) ? u2 : [u2], p2 = d2.length;
|
|
235
|
+
for (let t3 = 0; t3 < p2; t3++) {
|
|
236
|
+
const n3 = Y(d2[t3]), r3 = o2.get(n3);
|
|
209
237
|
r3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${r3}.`), o2.set(n3, a2);
|
|
210
238
|
}
|
|
211
239
|
}
|
|
@@ -218,7 +246,8 @@ class V {
|
|
|
218
246
|
t2 = this._parent;
|
|
219
247
|
const o2 = (t3) => {
|
|
220
248
|
t3._children.forEach((t4) => {
|
|
221
|
-
|
|
249
|
+
const n3 = e2.length, r2 = t4._nodes;
|
|
250
|
+
for (let t5 = 0; t5 < n3; t5++) r2.delete(e2[t5]);
|
|
222
251
|
o2(t4);
|
|
223
252
|
});
|
|
224
253
|
};
|
|
@@ -240,12 +269,12 @@ class V {
|
|
|
240
269
|
findCommandByEvent(t2) {
|
|
241
270
|
const e2 = [];
|
|
242
271
|
t2.altKey && e2.push(z.Alt), t2.shiftKey && e2.push(z.Shift), t2.ctrlKey && e2.push(z.Ctrl), t2.metaKey && e2.push(z.Meta);
|
|
243
|
-
let n2 =
|
|
272
|
+
let n2 = Y({ key: t2.code, modifiers: e2 });
|
|
244
273
|
const o2 = this._commandsByShortcut;
|
|
245
274
|
let r2 = o2.get(n2);
|
|
246
|
-
r2 || (n2 =
|
|
275
|
+
r2 || (n2 = Y({ key: t2.key, modifiers: e2 }), r2 = o2.get(n2)), !r2 && t2.code.startsWith("Digit") && (n2 = Y({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), r2 = this._commandsByShortcut.get(n2)), !r2 && t2.code.startsWith("Key") && (r2 = Y({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), r2 = o2.get(n2));
|
|
247
276
|
let i2 = null;
|
|
248
|
-
return r2 && (i2 = this._commandsByKey.get(r2), i2 && i2.disabled() && (i2 = null), !i2 || i2.
|
|
277
|
+
return r2 && (i2 = this._commandsByKey.get(r2), i2 && i2.disabled() && (i2 = null), !i2 || i2.getTarget() && i2.getTarget().contains(t2.target) || (i2 = null)), i2 || (this._parent?.findCommandByEvent(t2) ?? null);
|
|
249
278
|
}
|
|
250
279
|
dispatchToFocusedCommand(t2) {
|
|
251
280
|
const e2 = this.getActive();
|
|
@@ -264,15 +293,21 @@ class V {
|
|
|
264
293
|
const n2 = this._listeners, o2 = e2?.keys, r2 = this._root._listenersByKey;
|
|
265
294
|
if (o2 && !t2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
266
295
|
let i2 = null;
|
|
267
|
-
if (o2)
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
296
|
+
if (o2) {
|
|
297
|
+
const e3 = o2.length;
|
|
298
|
+
for (let n3 = 0; n3 < e3; n3++) {
|
|
299
|
+
const e4 = o2[n3];
|
|
300
|
+
if (!e4) continue;
|
|
301
|
+
let s2 = r2.get(e4);
|
|
302
|
+
s2 || (s2 = /* @__PURE__ */ new Set(), r2.set(e4, s2)), i2 || (i2 = []), i2.push(s2), s2.add(t2);
|
|
303
|
+
}
|
|
272
304
|
}
|
|
273
305
|
return n2.add(t2), () => {
|
|
274
|
-
if (i2)
|
|
275
|
-
i2
|
|
306
|
+
if (i2) {
|
|
307
|
+
const e3 = i2.length;
|
|
308
|
+
for (let n3 = 0; n3 < e3; n3++) {
|
|
309
|
+
i2[n3].delete(t2);
|
|
310
|
+
}
|
|
276
311
|
}
|
|
277
312
|
n2.delete(t2);
|
|
278
313
|
};
|
|
@@ -302,134 +337,109 @@ class V {
|
|
|
302
337
|
}), t2;
|
|
303
338
|
}
|
|
304
339
|
}
|
|
305
|
-
const
|
|
340
|
+
const j = f.getOS() === f.OSType.MacOS || f.getOS() === f.OSType.IOS ? "Cmd" : "Ctrl", X = f.getOS() === f.OSType.MacOS || f.getOS() === f.OSType.IOS ? "⌘" : "^", Y = (t2, e2 = false) => {
|
|
306
341
|
const n2 = {};
|
|
307
342
|
for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
|
|
308
343
|
let o2 = "";
|
|
309
|
-
return (n2?.[z.Ctrl] || n2?.[z.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ?
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
const o2 =
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
if (!s2 || 0 === s2.length) return;
|
|
317
|
-
const e3 = (t2, e4) => {
|
|
318
|
-
o2.current?.onChange?.(e4), i2();
|
|
319
|
-
};
|
|
320
|
-
let r3 = null;
|
|
321
|
-
n2 && (r3 = { onExecute(t2, e4) {
|
|
322
|
-
o2.current?.onExecute?.(t2, e4);
|
|
323
|
-
}, onError(t2, e4, n3) {
|
|
324
|
-
o2.current?.onError?.(t2, e4, n3);
|
|
325
|
-
} });
|
|
326
|
-
const l2 = /* @__PURE__ */ new Set();
|
|
327
|
-
for (let o3 = 0; o3 < s2.length; o3++) l2.add(s2[o3]?.addPropertyListener(t.debounce(e3, 0), true)), n2 && l2.add(s2[o3]?.addExecuteListener(r3));
|
|
328
|
-
return () => {
|
|
329
|
-
l2.forEach((t2) => {
|
|
330
|
-
t2?.();
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
}, [e2]), r2;
|
|
334
|
-
}
|
|
335
|
-
const U = (e2, n2) => {
|
|
336
|
-
if (!n2 || !e2 || 0 === n2.length) return t.EmptyArray;
|
|
337
|
-
const o2 = n2.length, r2 = new Array(o2);
|
|
338
|
-
for (let t2 = 0; t2 < o2; t2++) {
|
|
339
|
-
const o3 = n2[t2], i2 = o3 ? e2.getCommand(o3) : null;
|
|
340
|
-
r2[t2] = i2;
|
|
344
|
+
return (n2?.[z.Ctrl] || n2?.[z.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? X : j)), n2?.[z.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[z.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + R(t2.key), o2;
|
|
345
|
+
}, U = (t2, e2) => {
|
|
346
|
+
if (!e2 || !t2 || 0 === e2.length) return f.EmptyArray;
|
|
347
|
+
const n2 = e2.length, o2 = new Array(n2);
|
|
348
|
+
for (let r2 = 0; r2 < n2; r2++) {
|
|
349
|
+
const n3 = e2[r2], i2 = n3 ? t2.getCommand(n3) : null;
|
|
350
|
+
o2[r2] = i2;
|
|
341
351
|
}
|
|
342
|
-
return
|
|
352
|
+
return o2;
|
|
343
353
|
};
|
|
344
|
-
function G(t2,
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
-
const [
|
|
348
|
-
return
|
|
349
|
-
const
|
|
350
|
-
const
|
|
351
|
-
|
|
354
|
+
function G(t2, n2 = null, o2 = null, s2) {
|
|
355
|
+
const l2 = e(o2);
|
|
356
|
+
l2.current = o2, n2 && !Array.isArray(n2) && (n2 = [n2]);
|
|
357
|
+
const [a2, c2] = i(U(t2, n2)), h2 = s2 ? [...s2, t2] : [t2];
|
|
358
|
+
return r(() => {
|
|
359
|
+
const e2 = { onGroupChange: () => {
|
|
360
|
+
const e3 = U(t2, n2);
|
|
361
|
+
c2(e3), l2.current?.onChange?.(this);
|
|
352
362
|
} };
|
|
353
363
|
let o3;
|
|
354
|
-
|
|
355
|
-
|
|
364
|
+
n2 && n2.length > 0 && (o3 = { keys: n2 }, e2.onCommandChange = (e3, o4) => {
|
|
365
|
+
l2.current?.onChange?.(t2), c2(U(t2, n2));
|
|
356
366
|
});
|
|
357
|
-
const
|
|
358
|
-
return
|
|
359
|
-
|
|
367
|
+
const r2 = t2?.addListener(e2, o3), i2 = U(t2, n2);
|
|
368
|
+
return c2(i2), l2.current?.onChange && l2.current?.onChange(t2), () => {
|
|
369
|
+
r2?.();
|
|
360
370
|
};
|
|
361
|
-
},
|
|
371
|
+
}, h2), a2;
|
|
362
372
|
}
|
|
363
|
-
const q = { Toolbar: "toolbar", Menuitem: "menuitem" }, Z = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, J =
|
|
364
|
-
const { refFocusStart:
|
|
365
|
-
if (
|
|
366
|
-
const t3 =
|
|
367
|
-
let
|
|
368
|
-
const
|
|
369
|
-
for (let
|
|
370
|
-
const
|
|
373
|
+
const q = { Toolbar: "toolbar", Menuitem: "menuitem" }, Z = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" }, J = s(l((t2, n2) => {
|
|
374
|
+
const { refFocusStart: o2, ...r2 } = t2, i2 = e(null), s2 = a(() => {
|
|
375
|
+
if (o2) return void o2?.current?.focus();
|
|
376
|
+
const t3 = i2.current.parentElement.children;
|
|
377
|
+
let e2 = [];
|
|
378
|
+
const n3 = t3.length;
|
|
379
|
+
for (let o3 = 0; o3 < n3 && t3[o3] !== i2.current; o3++) {
|
|
380
|
+
const n4 = t3[o3], r3 = n4.getAttribute("tabindex");
|
|
371
381
|
if (null == r3 || "-1" === r3) continue;
|
|
372
|
-
"true" !==
|
|
382
|
+
"true" !== n4.getAttribute("disabled") && (n4.focus && e2.push({ tabindex: parseInt(r3), child: n4 }));
|
|
373
383
|
}
|
|
374
|
-
0 !==
|
|
375
|
-
return t4.tabindex -
|
|
376
|
-
}),
|
|
377
|
-
}, [
|
|
378
|
-
return x("div", { tabIndex: 0, ref: L([
|
|
384
|
+
0 !== e2.length && (e2.sort(function(t4, e3) {
|
|
385
|
+
return t4.tabindex - e3.tabindex;
|
|
386
|
+
}), e2[0].child.focus());
|
|
387
|
+
}, [o2]);
|
|
388
|
+
return x("div", { tabIndex: 0, ref: L([i2, n2]), onFocus: s2, ...r2 });
|
|
379
389
|
}));
|
|
380
|
-
const Q =
|
|
381
|
-
const { className:
|
|
382
|
-
const n3 =
|
|
383
|
-
return (function(
|
|
384
|
-
if (0 ===
|
|
385
|
-
function
|
|
386
|
-
let
|
|
387
|
-
return r3(
|
|
390
|
+
const Q = s(l((n2, r2) => {
|
|
391
|
+
const { className: i2, style: s2, children: l2, radius: a2 = 4, strokeWidth: c2 = 1, strokeColor: h2 = "grey", ...u2 } = n2, [d2, { width: p2, height: m2 }] = M(), f2 = e(null), _2 = (t2, e2 = 0) => {
|
|
392
|
+
const n3 = t2 / 2, o2 = m2 - n3 + e2;
|
|
393
|
+
return (function(t3, e3, n4 = false) {
|
|
394
|
+
if (0 === e3) return t3;
|
|
395
|
+
function o3(t4, e4, n5) {
|
|
396
|
+
let o4 = e4.x - t4.x, i4 = e4.y - t4.y, s4 = Math.sqrt(o4 * o4 + i4 * i4);
|
|
397
|
+
return r3(t4, e4, Math.min(1, n5 / s4));
|
|
388
398
|
}
|
|
389
|
-
function r3(
|
|
390
|
-
return { x:
|
|
399
|
+
function r3(t4, e4, n5) {
|
|
400
|
+
return { x: t4.x + (e4.x - t4.x) * n5, y: t4.y + (e4.y - t4.y) * n5 };
|
|
391
401
|
}
|
|
392
|
-
function i3(
|
|
393
|
-
|
|
402
|
+
function i3(t4, e4) {
|
|
403
|
+
t4.length > 2 && (t4[t4.length - 2] = e4.x, t4[t4.length - 1] = e4.y);
|
|
394
404
|
}
|
|
395
|
-
function s3(
|
|
396
|
-
return { x: parseFloat(
|
|
405
|
+
function s3(t4) {
|
|
406
|
+
return { x: parseFloat(t4[t4.length - 2]), y: parseFloat(t4[t4.length - 1]) };
|
|
397
407
|
}
|
|
398
|
-
let
|
|
399
|
-
let n5 =
|
|
400
|
-
return n5 ? (
|
|
401
|
-
}, []).reduce(function(
|
|
402
|
-
return parseFloat(
|
|
403
|
-
}, []),
|
|
404
|
-
if (
|
|
405
|
-
let
|
|
406
|
-
"Z" ===
|
|
407
|
-
for (let
|
|
408
|
-
let
|
|
409
|
-
if (d3 &&
|
|
410
|
-
let
|
|
411
|
-
n4 ? (
|
|
412
|
-
let f3 = r3(
|
|
413
|
-
g3.origPoint = p3,
|
|
414
|
-
} else
|
|
408
|
+
let l3 = t3.split(/[,\s]/).reduce(function(t4, e4) {
|
|
409
|
+
let n5 = e4.match("([a-zA-Z])(.+)");
|
|
410
|
+
return n5 ? (t4.push(n5[1]), t4.push(n5[2])) : t4.push(e4), t4;
|
|
411
|
+
}, []).reduce(function(t4, e4) {
|
|
412
|
+
return parseFloat(e4) == e4 && t4.length ? t4[t4.length - 1].push(e4) : t4.push([e4]), t4;
|
|
413
|
+
}, []), a3 = [];
|
|
414
|
+
if (l3.length > 1) {
|
|
415
|
+
let t4 = s3(l3[0]), c3 = null;
|
|
416
|
+
"Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", t4.x, t4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
|
|
417
|
+
for (let t5 = 1; t5 < l3.length; t5++) {
|
|
418
|
+
let h3 = a3[a3.length - 1], u3 = l3[t5], d3 = u3 === c3 ? l3[1] : l3[t5 + 1];
|
|
419
|
+
if (d3 && h3 && h3.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
|
|
420
|
+
let t6, l4, c4 = s3(h3), p3 = s3(u3), m3 = s3(d3);
|
|
421
|
+
n4 ? (t6 = r3(p3, h3.origPoint || c4, e3), l4 = r3(p3, d3.origPoint || m3, e3)) : (t6 = o3(p3, c4, e3), l4 = o3(p3, m3, e3)), i3(u3, t6), u3.origPoint = p3, a3.push(u3);
|
|
422
|
+
let f3 = r3(t6, p3, 0.5), _3 = r3(p3, l4, 0.5), g3 = ["C", f3.x, f3.y, _3.x, _3.y, l4.x, l4.y];
|
|
423
|
+
g3.origPoint = p3, a3.push(g3);
|
|
424
|
+
} else a3.push(u3);
|
|
415
425
|
}
|
|
416
426
|
if (c3) {
|
|
417
|
-
let
|
|
418
|
-
|
|
427
|
+
let t5 = s3(a3[a3.length - 1]);
|
|
428
|
+
a3.push(["Z"]), i3(a3[0], t5);
|
|
419
429
|
}
|
|
420
|
-
} else
|
|
421
|
-
return
|
|
422
|
-
return
|
|
430
|
+
} else a3 = l3;
|
|
431
|
+
return a3.reduce(function(t4, e4) {
|
|
432
|
+
return t4 + e4.join(" ") + " ";
|
|
423
433
|
}, "");
|
|
424
|
-
})(`${`M 0 ${n3} L ${
|
|
425
|
-
}, g2 =
|
|
426
|
-
if (0 ===
|
|
427
|
-
const
|
|
428
|
-
return _2(
|
|
429
|
-
}, [g2,
|
|
430
|
-
return S("div", { className:
|
|
434
|
+
})(`${`M 0 ${n3} L ${a2 - 0.5} ${n3} L ${a2 - 0.5} ${o2} L ${2 * a2} ${o2}`} ${`L ${p2 - 2 * a2} ${o2}`} ${`M ${p2 - 2 * a2} ${o2} L ${p2 - a2} ${o2} L ${p2 - a2} ${n3} L ${p2} ${n3}`}`, a2);
|
|
435
|
+
}, g2 = o(() => _2(c2), [p2, m2, a2, c2]), y2 = o(() => {
|
|
436
|
+
if (0 === a2) return;
|
|
437
|
+
const t2 = a2 / 2;
|
|
438
|
+
return _2(a2) + `L ${p2} 0 L 0 0 L 0 ${t2}`;
|
|
439
|
+
}, [g2, a2, c2]), v2 = o(() => ({ style: { clipPath: `path('${y2}')` } }), [y2]);
|
|
440
|
+
return S("div", { className: i2, style: { display: "flex", flexDirection: "row", ...s2 }, ...u2, ref: L([f2, d2, r2]), children: [t.isValidElement(l2) ? t.cloneElement(l2, v2) : x(E, {}), x("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: p2, height: m2, viewBox: `0 0 ${p2} ${m2}`, children: x("path", { d: g2, stroke: h2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: c2 }) })] });
|
|
431
441
|
})), tt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
432
|
-
class et extends
|
|
442
|
+
class et extends _ {
|
|
433
443
|
setOverrides(t2) {
|
|
434
444
|
super.setOverrides(t2);
|
|
435
445
|
}
|
|
@@ -437,9 +447,9 @@ class et extends e {
|
|
|
437
447
|
return this._overrides;
|
|
438
448
|
}
|
|
439
449
|
showMessage(t2, e2) {
|
|
440
|
-
const
|
|
441
|
-
if (
|
|
442
|
-
e2?.type !== tt.Warning ? e2?.type !== tt.Error ?
|
|
450
|
+
const n2 = this.getDelegate();
|
|
451
|
+
if (n2?.showMessage) return n2.showMessage(t2, e2);
|
|
452
|
+
e2?.type !== tt.Warning ? e2?.type !== tt.Error ? g.log(t2) : g.error(t2) : g.warn(t2);
|
|
443
453
|
}
|
|
444
454
|
showBusy(t2, e2) {
|
|
445
455
|
const n2 = this.getDelegate();
|
|
@@ -454,7 +464,7 @@ class et extends e {
|
|
|
454
464
|
}
|
|
455
465
|
showError(t2) {
|
|
456
466
|
const e2 = this.getDelegate();
|
|
457
|
-
e2?.showError ? e2.showError(t2) :
|
|
467
|
+
e2?.showError ? e2.showError(t2) : g.error(t2);
|
|
458
468
|
}
|
|
459
469
|
showOptions(t2) {
|
|
460
470
|
const e2 = this.getDelegate();
|
|
@@ -465,61 +475,61 @@ class et extends e {
|
|
|
465
475
|
return e2?.showInput ? e2.showInput(t2) : Promise.resolve({ input: "", option: "" });
|
|
466
476
|
}
|
|
467
477
|
}
|
|
468
|
-
const nt =
|
|
469
|
-
const
|
|
470
|
-
return
|
|
471
|
-
|
|
478
|
+
const nt = c(new et()), ot = ({ children: e2, notifier: n2 }) => (t.useEffect(() => {
|
|
479
|
+
const t2 = g.getOverrides();
|
|
480
|
+
return g.setOverrides(n2), () => {
|
|
481
|
+
g.setOverrides(t2);
|
|
472
482
|
};
|
|
473
|
-
}, [
|
|
483
|
+
}, [n2]), t.createElement(nt.Provider, { value: n2 }, e2)), rt = () => h(nt), it = 3, st = 0.5, lt = 50, at = (t2) => ({ x: t2.x, y: t2.y, width: t2.width, height: t2.height, top: t2.top, left: t2.left, right: t2.right, bottom: t2.bottom });
|
|
474
484
|
function ct(t2 = {}) {
|
|
475
|
-
const { threshold:
|
|
476
|
-
|
|
477
|
-
}, [
|
|
478
|
-
return
|
|
479
|
-
|
|
480
|
-
}, [
|
|
481
|
-
const t3 =
|
|
485
|
+
const { threshold: o2 = st, stillnessThreshold: s2 = it, maxHierarchyDepth: l2 = lt } = t2, [c2, h2] = M(), u2 = e(null), [d2, p2] = n((t3) => t3 + 1, 0), m2 = e(void 0), f2 = e({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), _2 = a((t3) => {
|
|
486
|
+
u2.current = t3, "function" == typeof c2 && c2(t3);
|
|
487
|
+
}, [c2]), [g2, y2] = i(h2);
|
|
488
|
+
return r(() => {
|
|
489
|
+
h2 && !g2 && y2(h2);
|
|
490
|
+
}, [h2, g2]), r(() => {
|
|
491
|
+
const t3 = u2.current;
|
|
482
492
|
if (!t3) return;
|
|
483
|
-
let
|
|
484
|
-
const
|
|
493
|
+
let e2 = false, n2 = 0;
|
|
494
|
+
const r2 = () => {
|
|
485
495
|
if (!t3) return;
|
|
486
|
-
const
|
|
487
|
-
Math.abs(
|
|
496
|
+
const i3 = t3.getBoundingClientRect(), l3 = f2.current;
|
|
497
|
+
Math.abs(i3.x - l3.x) > o2 || Math.abs(i3.y - l3.y) > o2 || Math.abs(i3.width - l3.width) > o2 || Math.abs(i3.height - l3.height) > o2 ? (e2 || (e2 = true, y2(at(i3)), p2()), n2 = 0) : n2++, e2 && n2 >= s2 && (e2 = false, y2(at(i3)), p2()), f2.current = at(i3), m2.current = requestAnimationFrame(r2);
|
|
488
498
|
};
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
|
|
499
|
+
m2.current = requestAnimationFrame(r2);
|
|
500
|
+
const i2 = (t4) => {
|
|
501
|
+
e2 = true, p2();
|
|
502
|
+
}, a2 = (t4) => {
|
|
503
|
+
e2 = false, n2 = s2, p2();
|
|
494
504
|
};
|
|
495
|
-
let
|
|
496
|
-
const
|
|
497
|
-
for (;
|
|
505
|
+
let c3 = t3;
|
|
506
|
+
const h3 = [];
|
|
507
|
+
for (; c3 && c3 !== document.documentElement && (c3.addEventListener("animationstart", i2, true), c3.addEventListener("animationend", a2, true), c3.addEventListener("transitionstart", i2, true), c3.addEventListener("transitionend", a2, true), h3.push(c3), c3 = c3.parentElement, !(h3.length > l2)); ) ;
|
|
498
508
|
return () => {
|
|
499
|
-
|
|
500
|
-
t4.removeEventListener("animationstart",
|
|
509
|
+
m2.current && cancelAnimationFrame(m2.current), h3.forEach((t4) => {
|
|
510
|
+
t4.removeEventListener("animationstart", i2, true), t4.removeEventListener("animationend", a2, true), t4.removeEventListener("transitionstart", i2, true), t4.removeEventListener("transitionend", a2, true);
|
|
501
511
|
});
|
|
502
512
|
};
|
|
503
|
-
}, [
|
|
513
|
+
}, [d2, h2, o2, s2, l2]), [_2, g2];
|
|
504
514
|
}
|
|
505
|
-
const ht = (t2,
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
515
|
+
const ht = (t2, n2) => {
|
|
516
|
+
const o2 = a((...e2) => t2?.(...e2), n2), r2 = e(null);
|
|
517
|
+
r2.current = o2;
|
|
518
|
+
const i2 = a((...t3) => r2.current?.(...t3), []);
|
|
519
|
+
if (r2.current) return i2;
|
|
510
520
|
};
|
|
511
521
|
function ut(t2) {
|
|
512
|
-
const [
|
|
513
|
-
return
|
|
522
|
+
const [n2, o2] = i("undefined" != typeof window ? window.devicePixelRatio : 1), s2 = e(null);
|
|
523
|
+
return r(() => {
|
|
514
524
|
if (!("undefined" != typeof window && "matchMedia" in window)) return;
|
|
515
525
|
const t3 = () => {
|
|
516
|
-
const
|
|
517
|
-
|
|
526
|
+
const e2 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
527
|
+
e2.addEventListener("change", t3, { once: true, passive: true }), o2(window.devicePixelRatio), s2.current = { mediaMatcher: e2, listener: t3 };
|
|
518
528
|
};
|
|
519
529
|
return t3(), () => {
|
|
520
|
-
|
|
530
|
+
s2.current && s2.current.mediaMatcher.removeEventListener("change", s2.current.listener);
|
|
521
531
|
};
|
|
522
|
-
}, [t2]),
|
|
532
|
+
}, [t2]), n2;
|
|
523
533
|
}
|
|
524
534
|
function dt(t2) {
|
|
525
535
|
if ("undefined" == typeof window) return 1;
|
|
@@ -528,7 +538,7 @@ function dt(t2) {
|
|
|
528
538
|
}
|
|
529
539
|
function pt(t2, e2, n2) {
|
|
530
540
|
const o2 = ht(e2, [e2]);
|
|
531
|
-
|
|
541
|
+
r(() => {
|
|
532
542
|
const e3 = (e4) => {
|
|
533
543
|
t2.current && !t2.current.contains(e4.target) && o2(e4);
|
|
534
544
|
};
|
|
@@ -539,11 +549,11 @@ function pt(t2, e2, n2) {
|
|
|
539
549
|
}
|
|
540
550
|
let mt = 0;
|
|
541
551
|
function ft() {
|
|
542
|
-
const [t2, e2] =
|
|
552
|
+
const [t2, e2] = i(!!document.fullscreenElement), n2 = a(() => {
|
|
543
553
|
const t3 = document.fullscreenElement;
|
|
544
554
|
return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
|
|
545
555
|
}, []);
|
|
546
|
-
return
|
|
556
|
+
return r(() => {
|
|
547
557
|
function t3() {
|
|
548
558
|
const t4 = document.fullscreenElement;
|
|
549
559
|
if (e2(!!t4), !t4) return;
|
|
@@ -559,60 +569,60 @@ function ft() {
|
|
|
559
569
|
}
|
|
560
570
|
function _t(t2) {
|
|
561
571
|
if (!t2) throw new Error("must have a PointerHandlerOptions");
|
|
562
|
-
const { onPointerDown:
|
|
572
|
+
const { onPointerDown: n2, onPointerUp: o2, onPointerMoveOrWait: i2, processTouch: s2 = false, consumeTouch: l2 = true } = t2, c2 = ht(n2, [n2]), h2 = ht(o2, [o2]), u2 = ht(i2, [i2]), d2 = e(false), p2 = t2?.timerInitial ?? 230, m2 = t2?.timerContinuous ?? p2 / 2, f2 = e(null), _2 = e(null), g2 = e(null), y2 = e(null), v2 = a(() => {
|
|
563
573
|
y2.current && (clearTimeout(y2.current), y2.current = null);
|
|
564
|
-
}, []), w2 =
|
|
574
|
+
}, []), w2 = a((t3) => {
|
|
565
575
|
y2.current = setTimeout(() => {
|
|
566
576
|
window.requestAnimationFrame(() => {
|
|
567
|
-
if (false ===
|
|
568
|
-
const t4 = _2.current,
|
|
569
|
-
|
|
570
|
-
}), w2(
|
|
571
|
-
}, t3 ??
|
|
577
|
+
if (false === d2.current) return;
|
|
578
|
+
const t4 = _2.current, e2 = f2.current, n3 = W(t4, e2.currentTarget);
|
|
579
|
+
u2?.(n3, g2.current, e2);
|
|
580
|
+
}), w2(m2);
|
|
581
|
+
}, t3 ?? p2);
|
|
572
582
|
}, []);
|
|
573
|
-
|
|
574
|
-
const b2 =
|
|
583
|
+
r(() => () => v2(), []);
|
|
584
|
+
const b2 = s2 ? "pointer" : "mouse", x2 = a((t3) => {
|
|
575
585
|
t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
|
|
576
586
|
}, []), S2 = ht((t3) => {
|
|
577
587
|
document.removeEventListener(`${b2}move`, M2), document.removeEventListener(`${b2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", C2), document.removeEventListener("touchstart", x2, { capture: true }), document.removeEventListener("touchmove", x2, { capture: true }), window.removeEventListener("blur", E2), v2(), window.requestAnimationFrame(() => {
|
|
578
|
-
if (false ===
|
|
579
|
-
|
|
580
|
-
const
|
|
581
|
-
|
|
588
|
+
if (false === d2.current) return;
|
|
589
|
+
d2.current = false;
|
|
590
|
+
const e2 = t3, n3 = f2.current, o3 = W(e2, n3.currentTarget);
|
|
591
|
+
h2?.(o3, g2.current, n3), g2.current = null;
|
|
582
592
|
});
|
|
583
|
-
}, []), E2 =
|
|
584
|
-
false !==
|
|
593
|
+
}, []), E2 = a(() => {
|
|
594
|
+
false !== d2.current && (d2.current = false, S2(_2.current));
|
|
585
595
|
}, []), L2 = ht(() => {
|
|
586
|
-
v2(), w2(
|
|
587
|
-
if (false ===
|
|
588
|
-
const t3 = _2.current,
|
|
589
|
-
|
|
596
|
+
v2(), w2(m2), window.requestAnimationFrame(() => {
|
|
597
|
+
if (false === d2.current) return;
|
|
598
|
+
const t3 = _2.current, e2 = f2.current, n3 = W(t3, e2.currentTarget);
|
|
599
|
+
u2?.(n3, g2.current, e2);
|
|
590
600
|
});
|
|
591
|
-
}, [
|
|
601
|
+
}, [m2]), M2 = ht((t3) => {
|
|
592
602
|
_2.current = t3, L2();
|
|
593
603
|
}, []), T2 = ht((t3) => {
|
|
594
604
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
595
605
|
}, []), C2 = ht((t3) => {
|
|
596
606
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
597
|
-
}, [
|
|
607
|
+
}, [m2]);
|
|
598
608
|
return ht((t3) => {
|
|
599
609
|
if (t3.isDefaultPrevented()) return;
|
|
600
610
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
|
|
601
|
-
false !==
|
|
602
|
-
}, [
|
|
611
|
+
false !== c2(t3, g2.current) && (f2.current = t3, _2.current = t3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, M2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", C2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), s2 && l2 && (document.addEventListener("touchstart", x2, { passive: false, capture: true }), document.addEventListener("touchmove", x2, { passive: false, capture: true })), d2.current = true, w2(p2));
|
|
612
|
+
}, [p2, s2]);
|
|
603
613
|
}
|
|
604
614
|
function gt(t2, e2) {
|
|
605
615
|
return _t({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
|
|
606
616
|
t2?.(o2);
|
|
607
617
|
}, ...e2 });
|
|
608
618
|
}
|
|
609
|
-
const yt = ({ initValue: t2, useHookBody:
|
|
610
|
-
const
|
|
611
|
-
if ("function" != typeof
|
|
612
|
-
const
|
|
613
|
-
return
|
|
614
|
-
|
|
615
|
-
}, [
|
|
619
|
+
const yt = ({ initValue: t2, useHookBody: n2, applyStateChange: o2 }) => {
|
|
620
|
+
const r2 = e(t2);
|
|
621
|
+
if ("function" != typeof n2) throw new Error("function expected as hook body parameter. got " + typeof n2);
|
|
622
|
+
const i2 = n2();
|
|
623
|
+
return u(() => {
|
|
624
|
+
r2.current !== i2 && (r2.current = i2, o2(i2));
|
|
625
|
+
}, [o2, i2]), null;
|
|
616
626
|
}, vt = (t2) => {
|
|
617
627
|
console && console.warn && console.warn(t2);
|
|
618
628
|
}, wt = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
|
|
@@ -620,16 +630,16 @@ let bt = 1, xt = false, St = false;
|
|
|
620
630
|
const Et = [], Lt = [], Mt = () => {
|
|
621
631
|
Lt.forEach((t2) => t2());
|
|
622
632
|
}, Tt = ({ automaticContainerInternalUseOnly: t2 }) => {
|
|
623
|
-
const [
|
|
624
|
-
return
|
|
625
|
-
let
|
|
626
|
-
function
|
|
627
|
-
if (
|
|
633
|
+
const [n2, o2] = i([]), s2 = e([]);
|
|
634
|
+
return s2.current = n2, t2 || false !== xt || (St = true), r(() => {
|
|
635
|
+
let e2 = true;
|
|
636
|
+
function n3() {
|
|
637
|
+
if (e2) return Lt[0] !== n3 ? (t2 || true !== xt || vt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void o2((t3) => [])) : void o2([...Et]);
|
|
628
638
|
}
|
|
629
|
-
return Lt.push(
|
|
630
|
-
|
|
639
|
+
return Lt.push(n3), Mt(), () => {
|
|
640
|
+
e2 = false, s2.current?.length > 0 && vt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(n3), 1), Mt();
|
|
631
641
|
};
|
|
632
|
-
}, [t2]), x(E, { children:
|
|
642
|
+
}, [t2]), x(E, { children: n2.map(({ hook: t3, key: e2 }) => d(yt, { ...t3, key: e2 })) });
|
|
633
643
|
}, Ct = (t2) => {
|
|
634
644
|
const e2 = bt++;
|
|
635
645
|
return Et.push({ hook: t2, key: e2 }), 0 === Lt.length && false === St && (xt = true, ((t3) => {
|
|
@@ -643,14 +653,14 @@ const Et = [], Lt = [], Mt = () => {
|
|
|
643
653
|
};
|
|
644
654
|
let kt = null;
|
|
645
655
|
kt || (kt = (t2, e2, n2 = {}) => {
|
|
646
|
-
let o2,
|
|
647
|
-
const
|
|
648
|
-
|
|
649
|
-
},
|
|
656
|
+
let o2, s2, l2 = false, a2 = false, c2 = [], { unmountIfNoConsumers: h2 = false } = n2;
|
|
657
|
+
const u2 = (t3) => {
|
|
658
|
+
s2 = t3, k(() => c2.forEach((e3) => e3(t3)));
|
|
659
|
+
}, d2 = () => (a2 || (s2 = "function" == typeof t2 ? t2() : t2, a2 = true), s2);
|
|
650
660
|
return () => {
|
|
651
|
-
const [n3,
|
|
652
|
-
return
|
|
653
|
-
|
|
661
|
+
const [n3, a3] = i(d2);
|
|
662
|
+
return r(() => (l2 || (l2 = true, o2 = Ct({ initValue: t2, useHookBody: e2, applyStateChange: u2 })), c2.push(a3), s2 !== n3 && a3(s2), () => {
|
|
663
|
+
c2.splice(c2.indexOf(a3), 1), 0 === c2.length && h2 && (o2(), l2 = false);
|
|
654
664
|
}), []), n3;
|
|
655
665
|
};
|
|
656
666
|
});
|
|
@@ -659,180 +669,180 @@ let Pt = () => {
|
|
|
659
669
|
console.warn("You must call useEditMode before setting its state.");
|
|
660
670
|
};
|
|
661
671
|
const zt = Dt(null, () => {
|
|
662
|
-
const [t2, e2] =
|
|
672
|
+
const [t2, e2] = i(null);
|
|
663
673
|
return Pt = e2, t2;
|
|
664
674
|
}), At = () => {
|
|
665
675
|
const t2 = zt();
|
|
666
|
-
return
|
|
676
|
+
return o(() => ({ setMode: (t3) => {
|
|
667
677
|
Pt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
|
|
668
678
|
}, getMode: () => t2 }), [t2]);
|
|
669
679
|
}, Bt = Dt({ setClipboard: (t2) => {
|
|
670
680
|
throw new Error("This is only available via the useClipboard.");
|
|
671
|
-
}, getClipboard: () =>
|
|
672
|
-
const [t2,
|
|
673
|
-
return { setClipboard: (t3) =>
|
|
674
|
-
}), $t = (
|
|
675
|
-
const { source:
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
if (!
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
}, [
|
|
682
|
-
const
|
|
683
|
-
if (!
|
|
684
|
-
let
|
|
681
|
+
}, getClipboard: () => y.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
682
|
+
const [t2, n2] = i(y.Global);
|
|
683
|
+
return { setClipboard: (t3) => n2(t3), getClipboard: () => t2, refNativeCopy: e(null), refNativeLastKey: e(null) };
|
|
684
|
+
}), $t = (t2) => {
|
|
685
|
+
const { source: e2, target: n2, onPaste: i2, onClipboardUpdate: s2, commands: l2 } = t2, c2 = rt(), h2 = ht(s2, [s2]), u2 = ht(i2, [i2]), { getClipboard: d2, refNativeCopy: p2 } = Bt(), m2 = d2();
|
|
686
|
+
o(() => {
|
|
687
|
+
const t3 = e2?.element, o2 = n2?.element ?? e2?.element;
|
|
688
|
+
if (!l2) return;
|
|
689
|
+
const r2 = [new K("cut", t3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [z.Ctrl] } }), new K("copy", t3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [z.Ctrl] } }), new K("paste", o2, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [z.Ctrl] }, { key: "F8", modifiers: [z.Ctrl] }] })];
|
|
690
|
+
l2?.addCommands(r2, true);
|
|
691
|
+
}, [l2]);
|
|
692
|
+
const _2 = ht(async (t3) => {
|
|
693
|
+
if (!e2?.element) return;
|
|
694
|
+
let n3 = null;
|
|
685
695
|
try {
|
|
686
|
-
|
|
687
|
-
} catch (
|
|
688
|
-
throw
|
|
696
|
+
n3 = e2.doCopy?.(t3), "string" == typeof n3 ? await m2.writeText(n3) : await m2.writeReference(n3);
|
|
697
|
+
} catch (t4) {
|
|
698
|
+
throw t4;
|
|
689
699
|
}
|
|
690
|
-
}, [
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
|
|
700
|
+
}, [e2, c2]), g2 = ht(async (t3) => {
|
|
701
|
+
const n3 = e2?.element?.();
|
|
702
|
+
if (n3) {
|
|
703
|
+
p2.current = { sourceElement: n3, args: t3 };
|
|
694
704
|
try {
|
|
695
|
-
await
|
|
696
|
-
} catch (
|
|
697
|
-
|
|
705
|
+
await _2(t3);
|
|
706
|
+
} catch (t4) {
|
|
707
|
+
c2.showError?.(t4);
|
|
698
708
|
}
|
|
699
709
|
}
|
|
700
|
-
}, [
|
|
701
|
-
|
|
702
|
-
}, []), x2 = ht(async (
|
|
710
|
+
}, [e2?.element, c2]), b2 = a(() => {
|
|
711
|
+
g2({ isCut: true });
|
|
712
|
+
}, []), x2 = ht(async (t3, e3, n3) => {
|
|
703
713
|
try {
|
|
704
|
-
if (false === await
|
|
705
|
-
|
|
706
|
-
} catch (
|
|
707
|
-
|
|
714
|
+
if (false === await t3.doPaste(e3, n3)) return;
|
|
715
|
+
u2?.(e3, n3);
|
|
716
|
+
} catch (t4) {
|
|
717
|
+
c2.showError?.(t4);
|
|
708
718
|
}
|
|
709
|
-
}, [
|
|
710
|
-
const r2 =
|
|
711
|
-
if (r2 && await
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
return await x2(
|
|
715
|
-
} catch (
|
|
716
|
-
|
|
719
|
+
}, [u2]), S2 = ht(async (t3, e3, o2) => {
|
|
720
|
+
const r2 = n2?.element?.();
|
|
721
|
+
if (r2 && await f.whenFocus(r2), !t3 && !e3) return;
|
|
722
|
+
const i3 = await c2.showBusy?.("Pasting...");
|
|
723
|
+
if (e3) try {
|
|
724
|
+
return await x2(n2, e3, o2), void i3?.();
|
|
725
|
+
} catch (t4) {
|
|
726
|
+
i3?.(), c2.showError?.(t4);
|
|
717
727
|
}
|
|
718
|
-
let
|
|
719
|
-
|
|
728
|
+
let s3, l3 = n2.importFromExternal;
|
|
729
|
+
l3 || (l3 = (e4, n3) => ({ getItemType: () => "text", toText: () => t3.text, isClipboardItem: true }));
|
|
720
730
|
try {
|
|
721
|
-
|
|
722
|
-
} catch (
|
|
723
|
-
|
|
731
|
+
s3 = await l3(t3, { isCut: false });
|
|
732
|
+
} catch (t4) {
|
|
733
|
+
i3?.(), c2.showError?.(t4);
|
|
724
734
|
}
|
|
725
|
-
if (
|
|
726
|
-
const
|
|
727
|
-
await x2(
|
|
728
|
-
} catch (
|
|
729
|
-
|
|
735
|
+
if (s3) try {
|
|
736
|
+
const t4 = await Promise.resolve(s3);
|
|
737
|
+
await x2(n2, t4, o2), i3?.();
|
|
738
|
+
} catch (t4) {
|
|
739
|
+
i3?.(), c2.showError?.(t4);
|
|
730
740
|
}
|
|
731
|
-
else
|
|
732
|
-
}, [x2,
|
|
733
|
-
if (
|
|
734
|
-
const e3 = await
|
|
735
|
-
if (e3) return void await S2(null, e3,
|
|
741
|
+
else i3?.();
|
|
742
|
+
}, [x2, n2, c2]), E2 = ht(async (t3) => {
|
|
743
|
+
if (n2?.element) try {
|
|
744
|
+
const e3 = await m2.readReference();
|
|
745
|
+
if (e3) return void await S2(null, e3, t3);
|
|
736
746
|
const n3 = [];
|
|
737
|
-
n3[0] = await
|
|
747
|
+
n3[0] = await v.readStringFromClipboard(m2, w.plain), n3[1] = await v.readHTMLFromClipboard(m2, w.html), n3[2] = await v.readBlobFromClipboard(m2, w.png);
|
|
738
748
|
const o2 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
|
|
739
|
-
await S2(o2, null,
|
|
740
|
-
} catch (
|
|
741
|
-
if ("Document is not focused." ===
|
|
742
|
-
|
|
749
|
+
await S2(o2, null, t3);
|
|
750
|
+
} catch (t4) {
|
|
751
|
+
if ("Document is not focused." === t4?.message) return;
|
|
752
|
+
c2.showError?.(t4);
|
|
743
753
|
}
|
|
744
|
-
}, [S2,
|
|
745
|
-
return ht(async (
|
|
746
|
-
}, [
|
|
747
|
-
}, [
|
|
748
|
-
if (!
|
|
749
|
-
const
|
|
750
|
-
const e4 = await
|
|
751
|
-
|
|
752
|
-
}, e3 = (
|
|
753
|
-
|
|
754
|
-
}, n3 = (
|
|
755
|
-
|
|
754
|
+
}, [S2, n2?.element, c2]);
|
|
755
|
+
return ht(async (t3) => {
|
|
756
|
+
}, [e2?.element]), ht(async (t3) => {
|
|
757
|
+
}, [n2?.element, S2, c2]), r(() => {
|
|
758
|
+
if (!m2) return;
|
|
759
|
+
const t3 = async (t4) => {
|
|
760
|
+
const e4 = await m2.readReference();
|
|
761
|
+
h2?.(e4);
|
|
762
|
+
}, e3 = (t4) => {
|
|
763
|
+
c2.showMessage?.(y.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
764
|
+
}, n3 = (t4) => {
|
|
765
|
+
c2.showMessage?.(y.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
756
766
|
};
|
|
757
|
-
return
|
|
758
|
-
|
|
767
|
+
return m2.addEventListener("clipboardchange", t3), m2.addEventListener("clipboarderrorread", e3), m2.addEventListener("clipboarderrorwrite", n3), () => {
|
|
768
|
+
m2.removeEventListener("clipboardchange", t3), m2.removeEventListener("clipboarderrorread", e3), m2.removeEventListener("clipboarderrorwrite", n3);
|
|
759
769
|
};
|
|
760
|
-
}, [
|
|
761
|
-
}, [
|
|
762
|
-
|
|
763
|
-
}, [
|
|
770
|
+
}, [m2, c2]), r(() => {
|
|
771
|
+
}, [_2, S2, e2, n2]), r(() => {
|
|
772
|
+
l2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !e2 || !n2 }), l2?.getCommand("copy")?.updateCallback(g2).update({ disabled: !e2 }), l2?.getCommand("paste")?.updateCallback(E2).update({ disabled: !n2 });
|
|
773
|
+
}, [e2, n2, l2]), { paste: E2, copy: g2, clipboard: m2 };
|
|
764
774
|
};
|
|
765
|
-
function Kt(t2,
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
if (
|
|
769
|
-
const
|
|
770
|
-
Object.keys(
|
|
775
|
+
function Kt(t2, n2 = true) {
|
|
776
|
+
const o2 = e(t2);
|
|
777
|
+
r(() => {
|
|
778
|
+
if (n2) {
|
|
779
|
+
const e2 = Object.entries(t2).reduce((t3, [e3, n3]) => (o2.current[e3] !== n3 && (t3[e3] = [o2.current[e3], n3]), t3), {});
|
|
780
|
+
Object.keys(e2).length > 0 && console.log("Changed props:", e2);
|
|
771
781
|
}
|
|
772
|
-
|
|
782
|
+
o2.current = t2;
|
|
773
783
|
});
|
|
774
784
|
}
|
|
775
|
-
let
|
|
776
|
-
var Nt = "undefined" != typeof document ?
|
|
777
|
-
const Ht = () => "sheetxl-ui-" +
|
|
778
|
-
const Rt =
|
|
779
|
-
const [
|
|
785
|
+
let It = false, Ot = 0;
|
|
786
|
+
var Nt = "undefined" != typeof document ? u : r;
|
|
787
|
+
const Ht = () => "sheetxl-ui-" + Ot++;
|
|
788
|
+
const Rt = t["useId".toString()], Wt = null != Rt ? Rt : function() {
|
|
789
|
+
const [e2, n2] = t.useState(() => It ? Ht() : void 0);
|
|
780
790
|
return Nt(() => {
|
|
781
|
-
null ==
|
|
782
|
-
}, []),
|
|
783
|
-
|
|
784
|
-
}, []),
|
|
791
|
+
null == e2 && n2(Ht());
|
|
792
|
+
}, []), t.useEffect(() => {
|
|
793
|
+
It || (It = true);
|
|
794
|
+
}, []), e2;
|
|
785
795
|
}, Vt = [];
|
|
786
|
-
function Ft(t2,
|
|
787
|
-
const
|
|
788
|
-
return
|
|
789
|
-
if (!
|
|
790
|
-
const t3 =
|
|
791
|
-
if (!
|
|
792
|
-
const
|
|
793
|
-
for (let
|
|
794
|
-
const
|
|
795
|
-
Object.defineProperty(t3,
|
|
796
|
+
function Ft(t2, n2, o2 = Vt) {
|
|
797
|
+
const r2 = e(null);
|
|
798
|
+
return p(t2, () => {
|
|
799
|
+
if (!r2.current) return;
|
|
800
|
+
const t3 = r2.current, e2 = n2?.();
|
|
801
|
+
if (!e2 || "object" != typeof e2) throw new Error("attributes must return a plain object of values");
|
|
802
|
+
const o3 = Object.keys(e2), i2 = o3.length;
|
|
803
|
+
for (let n3 = 0; n3 < i2; n3++) {
|
|
804
|
+
const r3 = o3[n3], i3 = e2[r3];
|
|
805
|
+
Object.defineProperty(t3, r3, { value: i3, writable: true, configurable: true, enumerable: true });
|
|
796
806
|
}
|
|
797
807
|
return t3;
|
|
798
|
-
},
|
|
808
|
+
}, o2), r2;
|
|
799
809
|
}
|
|
800
810
|
const jt = "Undo the last action.", Xt = "Repeat the last action or undo the redo.", Yt = (t2) => `Redo ${t2}`, Ut = ({ manager: t2, commands: e2, disabled: n2 }) => {
|
|
801
|
-
const
|
|
811
|
+
const i2 = rt(), s2 = ht((e3) => {
|
|
802
812
|
try {
|
|
803
813
|
t2?.undo(e3);
|
|
804
814
|
} catch (t3) {
|
|
805
|
-
|
|
815
|
+
i2.error(t3);
|
|
806
816
|
}
|
|
807
|
-
}, [t2]),
|
|
817
|
+
}, [t2]), l2 = ht((e3) => {
|
|
808
818
|
try {
|
|
809
819
|
t2?.redo(e3);
|
|
810
820
|
} catch (t3) {
|
|
811
|
-
|
|
821
|
+
i2.error(t3);
|
|
812
822
|
}
|
|
813
823
|
}, [t2]);
|
|
814
|
-
return
|
|
824
|
+
return o(() => {
|
|
815
825
|
if (!e2) return;
|
|
816
826
|
const t3 = { contains: (t4) => true, focus() {
|
|
817
|
-
} }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [z.Ctrl] }, disabled: true },
|
|
827
|
+
} }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [z.Ctrl] }, disabled: true }, s2), new $("redo", t3, { label: "Redo", description: Xt, shortcut: [{ key: "y", modifiers: [z.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [z.Alt] }], disabled: true }, l2)];
|
|
818
828
|
e2?.addCommands(n3, true);
|
|
819
|
-
}, [e2]),
|
|
829
|
+
}, [e2]), r(() => {
|
|
820
830
|
if (!e2) return;
|
|
821
|
-
const
|
|
822
|
-
const
|
|
831
|
+
const o2 = () => {
|
|
832
|
+
const o3 = t2?.getTopUndoDescription(), r3 = {};
|
|
823
833
|
var i3;
|
|
824
|
-
e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description:
|
|
825
|
-
const
|
|
826
|
-
e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description:
|
|
834
|
+
e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o3 ? (i3 = o3, `Undo ${i3}`) : jt, state: r3, context: { undoManager: t2 } });
|
|
835
|
+
const s3 = t2?.getTopRedoDescription();
|
|
836
|
+
e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s3 ? Yt(s3) : Xt, state: r3, context: { undoManager: t2 } });
|
|
827
837
|
};
|
|
828
|
-
if (
|
|
829
|
-
const
|
|
830
|
-
|
|
838
|
+
if (o2(), !t2) return;
|
|
839
|
+
const r2 = t2.addListener({ onStackChange() {
|
|
840
|
+
o2();
|
|
831
841
|
} });
|
|
832
|
-
return () =>
|
|
833
|
-
}, [t2, e2, n2]), { undo:
|
|
842
|
+
return () => r2?.();
|
|
843
|
+
}, [t2, e2, n2]), { undo: s2, redo: l2 };
|
|
834
844
|
};
|
|
835
|
-
class Gt extends
|
|
845
|
+
class Gt extends m {
|
|
836
846
|
static getDerivedStateFromError() {
|
|
837
847
|
return { hasError: true };
|
|
838
848
|
}
|
|
@@ -844,7 +854,7 @@ class Gt extends b {
|
|
|
844
854
|
}
|
|
845
855
|
}
|
|
846
856
|
const qt = ({ children: t2 }) => {
|
|
847
|
-
const e2 = rt(), n2 =
|
|
857
|
+
const e2 = rt(), n2 = a((t3) => {
|
|
848
858
|
e2.showError(t3);
|
|
849
859
|
}, [e2]);
|
|
850
860
|
return x(Gt, { onError: n2, children: t2 });
|
|
@@ -867,7 +877,7 @@ class Zt {
|
|
|
867
877
|
}
|
|
868
878
|
const Jt = ({ children: t2 }) => {
|
|
869
879
|
const e2 = rt();
|
|
870
|
-
return
|
|
880
|
+
return r(() => {
|
|
871
881
|
const t3 = new Zt(e2);
|
|
872
882
|
return () => {
|
|
873
883
|
t3.cleanup();
|
|
@@ -881,54 +891,54 @@ const Jt = ({ children: t2 }) => {
|
|
|
881
891
|
const n2 = { percent: null, pixels: null };
|
|
882
892
|
let o2 = e2;
|
|
883
893
|
return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
|
|
884
|
-
}, se =
|
|
885
|
-
const { elementBefore:
|
|
894
|
+
}, se = s(l((n2, s2) => {
|
|
895
|
+
const { elementBefore: l2, elementAfter: a2, splitDirection: c2 = "row", fixedPane: h2 = null, position: u2, onPositionChange: d2, minBefore: p2, maxBefore: m2, minAfter: f2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, propsResizer: k2 = ne, propsPane: D2 = ne, propsPaneBefore: P2 = ne, propsPaneAfter: z2 = ne, renderResizer: A2 = ee } = n2;
|
|
886
896
|
if (g2) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
887
|
-
const B2 =
|
|
888
|
-
let
|
|
889
|
-
|
|
890
|
-
const
|
|
891
|
-
return { fixedPaneOffset:
|
|
892
|
-
}, [p2, m2, f2, _2]), K2 = ht(
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
}, [
|
|
896
|
-
const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" ===
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
let s3 = oe(
|
|
900
|
-
|
|
901
|
-
const m3 = Math.max(0, Math.min(100, s3 /
|
|
902
|
-
return
|
|
903
|
-
})(
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
}, [
|
|
897
|
+
const B2 = o(() => t.isValidElement(a2) && t.isValidElement(l2), [a2, l2]), $2 = o(() => {
|
|
898
|
+
let t2 = null;
|
|
899
|
+
h2 && ("before" === h2 ? t2 = 0 : "after" === h2 && (t2 = 1));
|
|
900
|
+
const e2 = null === t2;
|
|
901
|
+
return { fixedPaneOffset: t2, isPercent: e2, minBefore: ie(p2, e2), maxBefore: ie(m2, e2), minAfter: ie(f2, e2), maxAfter: ie(_2, e2) };
|
|
902
|
+
}, [p2, m2, f2, _2]), K2 = ht(d2, [d2]), [I2, O2] = i(() => ie(u2, null === h2));
|
|
903
|
+
r(() => {
|
|
904
|
+
O2(ie(u2, null === h2));
|
|
905
|
+
}, [u2, h2]);
|
|
906
|
+
const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" === c2 ? V2 : F2, X2 = "row" === c2 ? H2 : R2, Y2 = o(() => ((t2, e2, n3, o2) => {
|
|
907
|
+
const r2 = [null, null], i2 = [null, null];
|
|
908
|
+
if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e2) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (r2[0] = t2?.pixels, i2[1] = 100) : (r2[1] = t2?.pixels - n3, i2[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (i2[0] = t2?.percent, i2[1] = 100 - t2?.percent) : (i2[1] = t2?.percent, i2[0] = 100 - t2?.percent)), { percents: i2, pixels: r2, minBefore: re(o2.minBefore, true), maxBefore: re(o2.maxBefore, true), minAfter: re(o2.minAfter), maxAfter: re(o2.maxAfter) };
|
|
909
|
+
let s3 = oe(t2, e2, 1 !== o2.fixedPaneOffset), l3 = e2 - n3, a3 = oe(o2.minBefore, l3, true) ?? 0, c3 = oe(o2.maxBefore, l3, true) ?? l3, h3 = 0, u3 = 0, d3 = 0, p3 = l3;
|
|
910
|
+
h3 = (oe(o2.maxAfter, e2, false) ?? n3) - n3, u3 = oe(o2.minAfter, e2, false) ?? e2, d3 = Math.max(a3, h3), p3 = Math.min(c3, u3), s3 = Math.max(d3, Math.min(s3, p3)), u3 = Math.min(l3 - s3, oe(o2.maxAfter, l3 - s3, true) ?? l3), h3 = Math.min(l3 - s3, oe(o2.minAfter, l3 - s3, true) ?? l3), r2[0] = s3, r2[1] = l3 - r2[0];
|
|
911
|
+
const m3 = Math.max(0, Math.min(100, s3 / l3 * 100));
|
|
912
|
+
return i2[0] = m3, i2[1] = 100 - i2[0], { percents: i2, pixels: r2, minBefore: `${a3}px`, minAfter: `${h3}px`, maxBefore: `${r2[0]}px`, maxAfter: `${r2[1]}px` };
|
|
913
|
+
})(I2, X2, j2, $2), [$2, I2, X2, j2, c2]), [U2, G2] = i(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = e(null), tt2 = e(null), et2 = e(null), { style: nt2, className: ot2, ...rt2 } = D2, it2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = P2, { className: ct2, style: ut2, ...dt2 } = z2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: c2, display: "flex" }, { className: mt2, style: ft2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t2) => {
|
|
914
|
+
const e2 = ie(t2, null === h2);
|
|
915
|
+
O2(e2);
|
|
916
|
+
}, [h2]), vt2 = ht((t2) => {
|
|
907
917
|
if (w2 || !U2) return;
|
|
908
|
-
const
|
|
918
|
+
const e2 = xt2.current?.getBoundingClientRect();
|
|
909
919
|
let n3 = 0;
|
|
910
|
-
n3 = "row" ===
|
|
911
|
-
}, [$2,
|
|
920
|
+
n3 = "row" === c2 ? (t2.clientX ?? t2.touches?.[0]?.clientX) - e2.x : (t2.clientY ?? t2.touches?.[0]?.clientY) - e2.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === $2.fixedPaneOffset && (n3 = X2 - n3), u2 && I2.pixels === n3 || O2({ pixels: n3, percent: null }), Z2?.(n3), t2.stopPropagation(), t2.preventDefault();
|
|
921
|
+
}, [$2, c2, w2, U2, I2, X2]), wt2 = ht((t2) => {
|
|
912
922
|
if (document.removeEventListener("pointermove", vt2), document.removeEventListener("touchmove", vt2), document.removeEventListener("pointerup", wt2), !U2) return;
|
|
913
|
-
if (G2(false), !
|
|
914
|
-
J2(
|
|
915
|
-
if (!ie(
|
|
916
|
-
const
|
|
917
|
-
null ===
|
|
923
|
+
if (G2(false), !I2) return;
|
|
924
|
+
J2(I2.pixels);
|
|
925
|
+
if (!ie(u2, null === h2) || I2.pixels !== u2) {
|
|
926
|
+
const t3 = { ...I2 };
|
|
927
|
+
null === t3.percent && (t3.percent = t3.pixels / X2 * 100), K2(t3);
|
|
918
928
|
}
|
|
919
|
-
|
|
920
|
-
}, [
|
|
921
|
-
_t2?.(
|
|
922
|
-
}, [_t2]), xt2 = Ft(
|
|
923
|
-
if (!
|
|
924
|
-
const
|
|
925
|
-
return x("div", { ref: Q2, className: T("before", ot2, st2), style:
|
|
926
|
-
}, [
|
|
927
|
-
if (!
|
|
928
|
-
const
|
|
929
|
-
return x("div", { ref: et2, className: T("after", ot2, ct2), style:
|
|
930
|
-
}, [
|
|
931
|
-
return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" ===
|
|
929
|
+
t2.stopPropagation(), t2.preventDefault();
|
|
930
|
+
}, [I2, U2, u2, h2, X2]), bt2 = ht((t2) => {
|
|
931
|
+
_t2?.(t2), t2.defaultPrevented || w2 || U2 || (G2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
|
|
932
|
+
}, [_t2]), xt2 = Ft(s2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = o(() => B2 ? A2?.({ key: "resizer", ref: L([W2, tt2]), className: T("resizer", mt2), onPointerDownCapture: bt2, style: { cursor: w2 ? void 0 : "row" === c2 ? "ew-resize" : "ns-resize", minWidth: "row" === c2 ? "2px" : void 0, minHeight: "row" !== c2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ft2 }, splitDirection: c2, disabled: w2, ...gt2 }) : null, [B2, mt2, gt2, c2, ft2, w2]), Et2 = "row" === c2 ? "Width" : "Height", Lt2 = o(() => {
|
|
933
|
+
if (!l2) return null;
|
|
934
|
+
const t2 = { ...it2, ...lt2, flex: 0 === $2.fixedPaneOffset && null !== Y2?.pixels[0] ? `0 0 ${Math.round(Y2?.pixels[0])}px` : `1 1 ${Math.round(Y2?.percents[0] ?? 100)}%`, [`min${Et2}`]: Y2?.minBefore, [`max${Et2}`]: a2 ? Y2?.maxBefore : "100%" };
|
|
935
|
+
return x("div", { ref: Q2, className: T("before", ot2, st2), style: t2, ...rt2, ...at2, children: l2 }, "before");
|
|
936
|
+
}, [l2, D2, P2, $2, Y2]), Mt2 = o(() => {
|
|
937
|
+
if (!a2) return null;
|
|
938
|
+
const t2 = { ...it2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== Y2?.pixels[1] ? `0 0 ${Math.round(Y2?.pixels[1])}px` : `1 1 ${Math.round(Y2?.percents[1] ?? 100)}%`, [`min${Et2}`]: Y2?.minAfter, [`max${Et2}`]: l2 ? Y2?.maxAfter : "100%" };
|
|
939
|
+
return x("div", { ref: et2, className: T("after", ot2, ct2), style: t2, ...rt2, ...dt2, children: a2 }, "after");
|
|
940
|
+
}, [a2, D2, z2, $2, Y2]);
|
|
941
|
+
return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" === c2 ? "vertical" : "horizontal", { dragging: U2 }, y2), style: pt2, children: [Lt2, St2, Mt2] });
|
|
932
942
|
}));
|
|
933
943
|
function le(t2) {
|
|
934
944
|
if ("function" == typeof t2) return t2;
|
|
@@ -1159,36 +1169,36 @@ function de() {
|
|
|
1159
1169
|
}
|
|
1160
1170
|
se.displayName = "SplitPane";
|
|
1161
1171
|
const pe = de();
|
|
1162
|
-
pe.register("base", () => import("./
|
|
1163
|
-
const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e =
|
|
1164
|
-
const { iconKey: n2, packKey:
|
|
1165
|
-
|
|
1166
|
-
let
|
|
1167
|
-
if (!
|
|
1168
|
-
const
|
|
1169
|
-
return void _2({ glyph:
|
|
1172
|
+
pe.register("base", () => import("./CJ8rg6a2gULy0991.mjs"));
|
|
1173
|
+
const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_Icon_17dpm_10" }, _e = s((e2) => {
|
|
1174
|
+
const { iconKey: n2, packKey: r2, className: i2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, propsSource: u2, children: d2, ...p2 } = e2, [m2, _2] = t.useState(null);
|
|
1175
|
+
t.useEffect(() => {
|
|
1176
|
+
let t2 = true, e3 = r2, o2 = n2;
|
|
1177
|
+
if (!o2) {
|
|
1178
|
+
const t3 = pe.getPack(e3);
|
|
1179
|
+
return void _2({ glyph: t3 ? { svg: f.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ?? pe.getActive() });
|
|
1170
1180
|
}
|
|
1171
|
-
if (
|
|
1172
|
-
const [
|
|
1173
|
-
|
|
1181
|
+
if (o2.includes(":")) {
|
|
1182
|
+
const [t3, n3] = o2.split(":");
|
|
1183
|
+
e3 = t3, o2 = n3;
|
|
1174
1184
|
}
|
|
1175
|
-
return pe.resolve(
|
|
1176
|
-
|
|
1185
|
+
return pe.resolve(o2, { packKey: e3 }).then((e4) => {
|
|
1186
|
+
t2 && _2(e4);
|
|
1177
1187
|
}), () => {
|
|
1178
|
-
|
|
1188
|
+
t2 = false;
|
|
1179
1189
|
};
|
|
1180
|
-
}, [n2,
|
|
1181
|
-
const g2 =
|
|
1190
|
+
}, [n2, r2]);
|
|
1191
|
+
const g2 = m2?.pack, y2 = m2?.glyph, v2 = m2?.packKey;
|
|
1182
1192
|
let w2 = y2 ? y2.svg : void 0;
|
|
1183
|
-
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 =
|
|
1184
|
-
const t2 = { ...
|
|
1193
|
+
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 = o(() => [fe.Icon, "icon", i2].filter(Boolean).join(" "), [i2]), M2 = o(() => {
|
|
1194
|
+
const t2 = { ...s2 };
|
|
1185
1195
|
return t2["--icon-size"] = E2, t2;
|
|
1186
|
-
}, [
|
|
1187
|
-
if (
|
|
1196
|
+
}, [s2, E2]), T2 = l2 ?? (a2 ? "img" : "presentation"), C2 = h2 ?? (!a2 || void 0), k2 = (t2) => x("span", { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...p2, children: t2 });
|
|
1197
|
+
if (d2) return k2(d2);
|
|
1188
1198
|
if (S2) return k2(x("span", { children: "string" == typeof S2 ? S2 : S2.text }));
|
|
1189
1199
|
if (b2) return k2(x("img", { src: b2.src, alt: a2 ?? "" }));
|
|
1190
1200
|
if (y2 && "react" in y2) {
|
|
1191
|
-
const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...
|
|
1201
|
+
const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...p2, ...u2 };
|
|
1192
1202
|
return k2(x(t2, { ...e3 }));
|
|
1193
1203
|
}
|
|
1194
1204
|
const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
@@ -1200,12 +1210,12 @@ const me = (t2) => x("svg", { ...t2, children: x("path", {}) }), fe = { Icon: "_
|
|
|
1200
1210
|
return k2(x("svg", { ...D2, children: P2 ? P2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
|
|
1201
1211
|
});
|
|
1202
1212
|
function ge(t2) {
|
|
1203
|
-
const { isWalking: e2 = false, themedType: n2 = "info", speed:
|
|
1213
|
+
const { isWalking: e2 = false, themedType: n2 = "info", speed: r2 = 120, dashGap: i2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: h2, ...u2 } = t2, d2 = o(() => {
|
|
1204
1214
|
if (!e2) return;
|
|
1205
|
-
const t3 = { "--walk-duration": `${
|
|
1215
|
+
const t3 = { "--walk-duration": `${r2 * (i2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${i2}px` };
|
|
1206
1216
|
return n2 && "accent" !== n2 && (t3["--icon-accent"] = `var(--icon-${n2})`), t3;
|
|
1207
|
-
}, [e2,
|
|
1208
|
-
return x(_e, { iconKey:
|
|
1217
|
+
}, [e2, r2, i2, s2, n2]), p2 = o(() => e2 ? h2 + " walking" : h2, [e2, h2]);
|
|
1218
|
+
return x(_e, { iconKey: l2, packKey: a2, className: p2, style: { ...c2, ...d2 }, ...u2 });
|
|
1209
1219
|
}
|
|
1210
1220
|
class ye {
|
|
1211
1221
|
constructor() {
|
|
@@ -1221,89 +1231,89 @@ class ye {
|
|
|
1221
1231
|
this.store.delete(t2);
|
|
1222
1232
|
}
|
|
1223
1233
|
}
|
|
1224
|
-
const ve =
|
|
1234
|
+
const ve = c(null), we = { parse: (t2) => t2 ? JSON.parse(t2) : null, stringify: JSON.stringify }, be = { store: new ye(), namespace: "", serializer: we, debounceMs: 0, crossTabSync: false, notify: () => {
|
|
1225
1235
|
}, subscribeKey: () => () => {
|
|
1226
1236
|
} };
|
|
1227
|
-
function xe(t2,
|
|
1228
|
-
const { store:
|
|
1237
|
+
function xe(t2, n2, s2 = Se) {
|
|
1238
|
+
const { store: l2, namespace: a2, serializer: c2, debounceMs: u2, subscribeKey: d2 } = h(ve) || be, p2 = s2.serializer ?? c2 ?? we, m2 = o(() => `${a2}:${t2}`, [a2, t2]), f2 = e(null), _2 = `${m2}::v`, [g2, y2] = i(() => {
|
|
1229
1239
|
let t3;
|
|
1230
1240
|
try {
|
|
1231
|
-
if ("undefined" != typeof window && "localStorage" in window &&
|
|
1232
|
-
const
|
|
1233
|
-
null !=
|
|
1241
|
+
if ("undefined" != typeof window && "localStorage" in window && m2.startsWith(a2)) {
|
|
1242
|
+
const e2 = window.localStorage?.getItem(m2) ?? null;
|
|
1243
|
+
null != e2 && (t3 = p2.parse(e2));
|
|
1234
1244
|
}
|
|
1235
1245
|
} catch {
|
|
1236
1246
|
}
|
|
1237
1247
|
if (void 0 === t3) {
|
|
1238
|
-
const t4 =
|
|
1248
|
+
const t4 = n2;
|
|
1239
1249
|
return "function" == typeof t4 ? t4() : t4;
|
|
1240
1250
|
}
|
|
1241
1251
|
return t3;
|
|
1242
1252
|
});
|
|
1243
|
-
|
|
1253
|
+
r(() => {
|
|
1244
1254
|
let t3 = true;
|
|
1245
1255
|
return (async () => {
|
|
1246
|
-
const [
|
|
1247
|
-
let
|
|
1256
|
+
const [e2, o2] = await Promise.all([l2.getItem(m2), l2.getItem(_2)]);
|
|
1257
|
+
let r2;
|
|
1248
1258
|
try {
|
|
1249
|
-
|
|
1259
|
+
r2 = null == e2 ? void 0 : p2.parse(e2);
|
|
1250
1260
|
} catch {
|
|
1251
1261
|
}
|
|
1252
|
-
const
|
|
1253
|
-
if (void 0 ===
|
|
1254
|
-
if (!
|
|
1255
|
-
|
|
1262
|
+
const i2 = null == o2 ? void 0 : Number.parseInt(o2, 10);
|
|
1263
|
+
if (void 0 === r2) {
|
|
1264
|
+
if (!s2.lazy && void 0 !== n2) {
|
|
1265
|
+
r2 = "function" == typeof n2 ? n2() : n2, await l2.setItem(m2, p2.stringify(r2)), null != s2.version && await l2.setItem(_2, String(s2.version));
|
|
1256
1266
|
}
|
|
1257
|
-
} else if (null !=
|
|
1258
|
-
|
|
1267
|
+
} else if (null != s2.version && void 0 !== i2 && i2 !== s2.version && s2.migrate) {
|
|
1268
|
+
r2 = s2.migrate(r2, i2), await l2.setItem(m2, p2.stringify(r2)), await l2.setItem(_2, String(s2.version));
|
|
1259
1269
|
}
|
|
1260
|
-
t3 && void 0 !==
|
|
1270
|
+
t3 && void 0 !== r2 && y2(r2);
|
|
1261
1271
|
})(), () => {
|
|
1262
1272
|
t3 = false;
|
|
1263
1273
|
};
|
|
1264
|
-
}, [
|
|
1265
|
-
const t3 = await
|
|
1274
|
+
}, [l2, m2, _2, s2.version, s2.migrate, s2.lazy]), r(() => d2(t2, async () => {
|
|
1275
|
+
const t3 = await l2.getItem(m2);
|
|
1266
1276
|
if (null != t3) try {
|
|
1267
|
-
y2(
|
|
1277
|
+
y2(p2.parse(t3));
|
|
1268
1278
|
} catch {
|
|
1269
1279
|
}
|
|
1270
|
-
}), [
|
|
1280
|
+
}), [l2, m2, d2, t2]);
|
|
1271
1281
|
const v2 = async (t3) => {
|
|
1272
|
-
await
|
|
1282
|
+
await l2.setItem(m2, p2.stringify(t3)), null != s2.version && await l2.setItem(_2, String(s2.version));
|
|
1273
1283
|
};
|
|
1274
|
-
return [
|
|
1275
|
-
y2((
|
|
1276
|
-
const n3 = "function" == typeof t3 ? t3(
|
|
1277
|
-
return
|
|
1284
|
+
return [g2, (t3) => {
|
|
1285
|
+
y2((e2) => {
|
|
1286
|
+
const n3 = "function" == typeof t3 ? t3(e2) : t3;
|
|
1287
|
+
return f2.current && clearTimeout(f2.current), u2 > 0 ? f2.current = setTimeout(() => {
|
|
1278
1288
|
v2(n3);
|
|
1279
|
-
},
|
|
1289
|
+
}, u2) : v2(n3), n3;
|
|
1280
1290
|
});
|
|
1281
1291
|
}, () => {
|
|
1282
|
-
if (
|
|
1283
|
-
const t3 = "function" == typeof
|
|
1292
|
+
if (f2.current && clearTimeout(f2.current), l2.removeItem(m2), l2.removeItem(_2), void 0 !== n2) {
|
|
1293
|
+
const t3 = "function" == typeof n2 ? n2() : n2;
|
|
1284
1294
|
y2(t3);
|
|
1285
1295
|
} else y2(void 0);
|
|
1286
1296
|
}];
|
|
1287
1297
|
}
|
|
1288
1298
|
const Se = {};
|
|
1289
1299
|
function Ee(t2) {
|
|
1290
|
-
const { store:
|
|
1291
|
-
const
|
|
1292
|
-
|
|
1293
|
-
}, subscribeKey(t3,
|
|
1294
|
-
const n3 =
|
|
1295
|
-
return
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1300
|
+
const { store: n2, namespace: i2 = "", serializer: s2 = Le, debounceMs: l2 = 0, crossTabSync: a2 = true, children: c2 } = t2, h2 = o(() => "undefined" == typeof window ? new ye() : n2 ?? new ye(), [n2]), u2 = e(/* @__PURE__ */ new Map()), d2 = o(() => ({ store: h2, namespace: i2, serializer: s2, debounceMs: l2, crossTabSync: a2, notify(t3) {
|
|
1301
|
+
const e2 = u2.current.get(t3);
|
|
1302
|
+
e2 && e2.forEach((t4) => t4());
|
|
1303
|
+
}, subscribeKey(t3, e2) {
|
|
1304
|
+
const n3 = u2.current, o2 = n3.get(t3) ?? /* @__PURE__ */ new Set();
|
|
1305
|
+
return o2.add(e2), n3.set(t3, o2), () => {
|
|
1306
|
+
const o3 = n3.get(t3);
|
|
1307
|
+
o3 && (o3.delete(e2), 0 === o3.size && n3.delete(t3));
|
|
1298
1308
|
};
|
|
1299
|
-
} }), [
|
|
1300
|
-
return
|
|
1309
|
+
} }), [h2, i2, s2, l2, a2]);
|
|
1310
|
+
return r(() => {
|
|
1301
1311
|
if (d2.crossTabSync && d2.store.subscribe) return d2.store.subscribe((t3) => {
|
|
1302
1312
|
if (!t3.startsWith(d2.namespace + ":")) return;
|
|
1303
|
-
const
|
|
1304
|
-
d2.notify(
|
|
1313
|
+
const e2 = t3.slice(d2.namespace.length + 1);
|
|
1314
|
+
d2.notify(e2);
|
|
1305
1315
|
});
|
|
1306
|
-
}, [d2]), x(ve.Provider, { value: d2, children:
|
|
1316
|
+
}, [d2]), x(ve.Provider, { value: d2, children: c2 });
|
|
1307
1317
|
}
|
|
1308
1318
|
const Le = { parse: (t2) => null == t2 ? null : JSON.parse(t2), stringify: JSON.stringify };
|
|
1309
1319
|
class Me {
|
|
@@ -1345,59 +1355,59 @@ const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar:
|
|
|
1345
1355
|
}, Be = (t2) => {
|
|
1346
1356
|
const { style: e2, orientation: n2 = Te.Vertical, ...o2 } = t2, r2 = n2 === Te.Vertical;
|
|
1347
1357
|
return x("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...o2, children: x("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: x("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
|
|
1348
|
-
}, $e =
|
|
1349
|
-
const { borderColor:
|
|
1358
|
+
}, $e = H().supportsTouchEvents, Ke = s(l((t2, n2) => {
|
|
1359
|
+
const { borderColor: s2 = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: l2 = "var(--sxl-app-color-background, white)", fillColor: a2 = "var(--sxl-app-color-grey, grey)", borderWidth: c2 = 3, size: h2 = 22, style: u2, className: d2, onPointerDown: p2, onPointerMove: m2, onPointerUp: f2, orientation: _2 = Te.Vertical, offset: g2 = 0, currentTouchAnchor: y2, elementParent: v2, elementRoot: w2, key: b2, ...M2 } = t2;
|
|
1350
1360
|
if (!$e) return null;
|
|
1351
|
-
const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), P2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] =
|
|
1361
|
+
const C2 = ht(p2, [p2]), k2 = ht(m2, [m2]), P2 = ht(f2, [f2]), z2 = _2 === Te.Vertical, [A2, B2] = i(false), $2 = _t(o(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e2) => {
|
|
1352
1362
|
B2(true), C2?.(t3), t3.preventDefault(), t3.stopPropagation();
|
|
1353
|
-
}, onPointerMoveOrWait: (t3,
|
|
1363
|
+
}, onPointerMoveOrWait: (t3, e2, n3) => {
|
|
1354
1364
|
k2?.(t3);
|
|
1355
|
-
}, onPointerUp: (t3,
|
|
1365
|
+
}, onPointerUp: (t3, e2, n3) => {
|
|
1356
1366
|
B2(false), P2?.(n3), t3.preventDefault(), t3.stopPropagation();
|
|
1357
|
-
} }), [])), K2 =
|
|
1358
|
-
const t3 =
|
|
1359
|
-
return { x: z2 ? -t3 : g2 +
|
|
1360
|
-
}, [z2, g2,
|
|
1361
|
-
return
|
|
1367
|
+
} }), [])), K2 = o(() => {
|
|
1368
|
+
const t3 = h2 / 2 + c2 / 2 + 6;
|
|
1369
|
+
return { x: z2 ? -t3 : g2 + h2, y: z2 ? g2 + h2 : -t3, width: 0, height: 0 };
|
|
1370
|
+
}, [z2, g2, h2]), [I2, { y: O2, x: N2 }] = ct(), H2 = e(null), { getPortalContainer: R2, isFullscreen: W2 } = ft(), [V2, F2] = i(null);
|
|
1371
|
+
return r(() => {
|
|
1362
1372
|
const t3 = H2.current?.getBoundingClientRect();
|
|
1363
1373
|
if (!t3) return void F2(null);
|
|
1364
|
-
let
|
|
1365
|
-
for (;
|
|
1366
|
-
F2(D(x("div", { className: T("touch-thumb", Ce["touch-thumb"],
|
|
1367
|
-
}, [
|
|
1374
|
+
let e2 = 0, o2 = 0, r2 = v2;
|
|
1375
|
+
for (; r2; ) e2 += r2.scrollLeft, o2 += r2.scrollTop, r2 = w2 && r2 === w2.parentElement ? null : r2.parentElement;
|
|
1376
|
+
F2(D(x("div", { className: T("touch-thumb", Ce["touch-thumb"], d2, Ce, { dragging: A2 }), ref: n2, style: { left: e2 + (t3?.x ?? 0) - (h2 + c2) / 2, top: o2 + (t3?.y ?? 0) - (h2 + c2) / 2, width: z2 ? h2 : 1.8 * h2, height: z2 ? 1.8 * h2 : h2, borderWidth: `${c2}px`, boxShadow: A2 ? `${l2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: s2, backgroundColor: l2, opacity: y2 ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${a2}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...u2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
|
|
1377
|
+
}, [O2, A2, s2, l2, a2, N2, K2?.x, K2?.y, K2?.width, K2?.height, d2, y2, l2, h2, c2, s2, v2, W2, b2]), K2 ? S(E, { children: [x("div", { ref: L([I2, H2]), style: { position: "absolute", left: K2.x, top: K2.y, opacity: 0 } }), V2] }) : null;
|
|
1368
1378
|
}));
|
|
1369
1379
|
Ke.displayName = "TouchThumbHandle";
|
|
1370
|
-
const
|
|
1371
|
-
const { offset:
|
|
1372
|
-
ht(
|
|
1373
|
-
const [$2, K2] =
|
|
1374
|
-
if (0 ===
|
|
1380
|
+
const Ie = 24, Oe = s(l((t2, n2) => {
|
|
1381
|
+
const { offset: s2 = 0, totalSize: l2 = 0, viewportSize: c2 = 0, style: h2, className: u2, orientation: d2 = Te.Vertical, onScrollOffset: p2, onScroll: m2, showCustomScrollButtons: f2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Ie, maxThumbSize: w2, renderScrollButtonStart: b2 = ze, renderScrollButtonEnd: C2 = Ae, propsTouchThumb: k2, propsThumb: D2, onMouseDown: P2, ...z2 } = t2, A2 = "touch" === H().primaryInput, B2 = f2 ?? !A2;
|
|
1382
|
+
ht(m2, [m2]);
|
|
1383
|
+
const [$2, K2] = i({ offset: 0, length: 0, disabled: false }), I2 = e(-1), O2 = d2 === Te.Vertical, [N2, { width: R2, height: W2 }] = M(), V2 = O2 ? W2 : R2, F2 = ht((t3, e2, n3) => {
|
|
1384
|
+
if (0 === e2 || 0 === n3) {
|
|
1375
1385
|
const t4 = { offset: 0, length: v2, disabled: true };
|
|
1376
1386
|
return K2(t4), t4;
|
|
1377
1387
|
}
|
|
1378
|
-
if (
|
|
1379
|
-
const
|
|
1380
|
-
return { offset: Math.min(Math.max(0, s3), V2 -
|
|
1388
|
+
if (e2 >= n3) return { offset: 0, length: V2, disabled: true };
|
|
1389
|
+
const o2 = n3 / V2, r2 = e2 / o2, i2 = Math.min(Math.max(v2, r2), Math.min(V2, w2 ?? Number.MAX_SAFE_INTEGER)), s3 = t3 / o2;
|
|
1390
|
+
return { offset: Math.min(Math.max(0, s3), V2 - i2), length: i2, disabled: false };
|
|
1381
1391
|
}, [V2, v2, w2]), j2 = ht((t3) => {
|
|
1382
|
-
const
|
|
1383
|
-
K2(F2(n3,
|
|
1384
|
-
}, [
|
|
1385
|
-
K2(F2(t3,
|
|
1386
|
-
}, [
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
}, [
|
|
1390
|
-
0 !== V2 && K2(F2(
|
|
1391
|
-
}, [
|
|
1392
|
-
const Y2 = Math.max(0,
|
|
1393
|
-
G2(true), q2.current =
|
|
1394
|
-
}, [
|
|
1392
|
+
const e2 = l2 / V2, n3 = Math.round(t3 * e2);
|
|
1393
|
+
K2(F2(n3, c2, l2)), p2?.(n3, c2, l2), I2.current = t3;
|
|
1394
|
+
}, [p2, c2, l2, V2, $2]), X2 = ht((t3) => {
|
|
1395
|
+
K2(F2(t3, c2, l2)), p2?.(t3, c2, l2), I2.current = t3;
|
|
1396
|
+
}, [p2, c2, l2]);
|
|
1397
|
+
r(() => {
|
|
1398
|
+
I2.current !== s2 && 0 !== V2 && (I2.current = -1, K2(F2(s2, c2, l2)));
|
|
1399
|
+
}, [s2]), r(() => {
|
|
1400
|
+
0 !== V2 && K2(F2(s2, c2, l2));
|
|
1401
|
+
}, [c2, l2, O2, V2]);
|
|
1402
|
+
const Y2 = Math.max(0, l2 - c2), [U2, G2] = i(false), q2 = e(0), Z2 = e(0), J2 = Ft(n2, () => ({ isScrollbar: () => true }), []), Q2 = ht((t3) => {
|
|
1403
|
+
G2(true), q2.current = O2 ? t3.clientY : t3.clientX, Z2.current = $2.offset;
|
|
1404
|
+
}, [O2, $2]), tt2 = ht((t3) => {
|
|
1395
1405
|
t3.currentTarget.setPointerCapture(t3.pointerId), Q2(t3), t3.stopPropagation();
|
|
1396
1406
|
}, [P2]), et2 = ht((t3) => {
|
|
1397
1407
|
if (!U2) return;
|
|
1398
|
-
const
|
|
1408
|
+
const e2 = (O2 ? t3.clientY : t3.clientX) - q2.current, n3 = Z2.current + e2;
|
|
1399
1409
|
j2(n3);
|
|
1400
|
-
}, [U2,
|
|
1410
|
+
}, [U2, O2]), nt2 = ht((t3) => {
|
|
1401
1411
|
et2(t3);
|
|
1402
1412
|
}, []), ot2 = ht((t3) => {
|
|
1403
1413
|
G2(false);
|
|
@@ -1409,45 +1419,45 @@ const Oe = 24, Ie = p(m((t2, e2) => {
|
|
|
1409
1419
|
ot2(t3);
|
|
1410
1420
|
}, []), it2 = ht((t3) => {
|
|
1411
1421
|
if (!t3.currentTarget) return;
|
|
1412
|
-
const
|
|
1422
|
+
const e2 = t3.currentTarget.getBoundingClientRect(), n3 = O2 ? t3.clientY - e2.top : t3.clientX - e2.left;
|
|
1413
1423
|
j2(n3);
|
|
1414
|
-
}, [
|
|
1415
|
-
const
|
|
1416
|
-
|
|
1417
|
-
}, [
|
|
1424
|
+
}, [O2, $2, c2, l2]), st2 = ht((t3) => {
|
|
1425
|
+
const e2 = Math.max(1, Math.floor(0.9 * c2));
|
|
1426
|
+
O2 ? ("ArrowDown" === t3.key && j2(Math.min(Y2, s2 + 1)), "ArrowUp" === t3.key && j2(Math.max(0, s2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, s2 + e2)), "PageUp" === t3.key && j2(Math.max(0, s2 - e2)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2)) : ("ArrowRight" === t3.key && j2(Math.min(Y2, s2 + 1)), "ArrowLeft" === t3.key && j2(Math.max(0, s2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, s2 + e2)), "PageUp" === t3.key && j2(Math.max(0, s2 - e2)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2));
|
|
1427
|
+
}, [O2, c2, l2, s2, Y2]), lt2 = e(null), at2 = o(() => {
|
|
1418
1428
|
const t3 = $2.disabled;
|
|
1419
1429
|
if (t3) return null;
|
|
1420
|
-
const
|
|
1421
|
-
return !A2 || t3 ?
|
|
1422
|
-
}, [$2, v2, Y2,
|
|
1430
|
+
const e2 = x("div", { ...D2, className: T(Ce.thumb, { disabled: t3 }), ref: lt2, role: "slider", "aria-label": O2 ? "Rows" : "Columns", "aria-orientation": O2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": s2, tabIndex: 0, style: { ...D2?.style, position: "relative", [O2 ? "height" : "width"]: `${$2.length}px`, [O2 ? "width" : "height"]: "100%", transform: O2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [O2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: P2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: rt2 });
|
|
1431
|
+
return !A2 || t3 ? e2 : S(E, { children: [e2, x(Ke, { ...k2, offset: $2.offset, orientation: O2 ? Te.Vertical : Te.Horizontal, onPointerDown: Q2, onPointerMove: et2, onPointerUp: ot2 })] });
|
|
1432
|
+
}, [$2, v2, Y2, s2, O2, A2, P2, k2, D2]), [ct2, ut2] = i(null), dt2 = ht(() => {
|
|
1423
1433
|
let t3;
|
|
1424
|
-
t3 = "function" == typeof _2 ? _2(
|
|
1425
|
-
const
|
|
1426
|
-
return X2(
|
|
1427
|
-
}, [_2,
|
|
1434
|
+
t3 = "function" == typeof _2 ? _2(s2, c2, l2) : s2 - _2;
|
|
1435
|
+
const e2 = Math.max(0, t3);
|
|
1436
|
+
return X2(e2), ut2(e2), e2;
|
|
1437
|
+
}, [_2, s2, c2, l2]), pt2 = ht(() => {
|
|
1428
1438
|
let t3;
|
|
1429
|
-
t3 = "function" == typeof _2 ? _2(
|
|
1430
|
-
const
|
|
1431
|
-
return X2(
|
|
1432
|
-
}, [_2,
|
|
1439
|
+
t3 = "function" == typeof _2 ? _2(s2, c2, l2) : s2 + _2;
|
|
1440
|
+
const e2 = Math.min(Y2, t3);
|
|
1441
|
+
return X2(e2), ut2(e2), e2;
|
|
1442
|
+
}, [_2, s2, Y2, c2, l2]), mt2 = e(null), ft2 = e(null), _t2 = a(() => {
|
|
1433
1443
|
mt2.current && (clearTimeout(mt2.current), mt2.current = null, ft2.current = null);
|
|
1434
|
-
}, []), gt2 =
|
|
1444
|
+
}, []), gt2 = a((t3, e2, n3, o2 = g2) => {
|
|
1435
1445
|
ft2.current = t3, mt2.current = setTimeout(() => {
|
|
1436
1446
|
const t4 = n3 ? dt2() : pt2();
|
|
1437
1447
|
t4 !== ft2.current ? gt2(t4, false, n3, y2) : _t2();
|
|
1438
|
-
},
|
|
1448
|
+
}, e2 ? 0 : o2);
|
|
1439
1449
|
}, [dt2, pt2, _t2]);
|
|
1440
|
-
|
|
1441
|
-
const yt2 =
|
|
1450
|
+
r(() => () => _t2(), [_t2]);
|
|
1451
|
+
const yt2 = o(() => {
|
|
1442
1452
|
if (!B2) return null;
|
|
1443
|
-
const t3 = { orientation:
|
|
1453
|
+
const t3 = { orientation: d2, disabled: s2 <= 0, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(s2, true, true) };
|
|
1444
1454
|
return b2?.(t3);
|
|
1445
|
-
}, [B2,
|
|
1455
|
+
}, [B2, d2, s2, ct2]), vt2 = o(() => {
|
|
1446
1456
|
if (!B2) return null;
|
|
1447
|
-
const t3 = { orientation:
|
|
1457
|
+
const t3 = { orientation: d2, disabled: s2 >= Y2, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(s2, true, false) };
|
|
1448
1458
|
return C2?.(t3);
|
|
1449
|
-
}, [B2,
|
|
1450
|
-
return S("div", { ref: L([J2,
|
|
1459
|
+
}, [B2, d2, s2, Y2, ct2]), wt2 = O2 ? "vertical" : "horizontal";
|
|
1460
|
+
return S("div", { ref: L([J2, n2]), className: T(u2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": A2 }), style: h2, ...z2, children: [yt2, x("div", { ref: N2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": s2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: P2, onPointerDown: it2, onKeyDown: st2, children: at2 }), vt2] });
|
|
1451
1461
|
}));
|
|
1452
1462
|
let Ne = Date.now, He = 1e3, Re = {}, We = 1;
|
|
1453
1463
|
const Ve = (t2) => {
|
|
@@ -1644,7 +1654,7 @@ class Ye {
|
|
|
1644
1654
|
}
|
|
1645
1655
|
}
|
|
1646
1656
|
}
|
|
1647
|
-
const Ue = (t2) => x(
|
|
1657
|
+
const Ue = (t2) => x(Oe, { ...t2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, r2 = 0) => {
|
|
1648
1658
|
for (let r3 = 0; r3 < n2.length; r3++) {
|
|
1649
1659
|
const i2 = n2[r3].getBoundingClientRect();
|
|
1650
1660
|
let s2 = i2.left - e2, l2 = s2 + i2.width;
|
|
@@ -1656,73 +1666,73 @@ const Ue = (t2) => x(Ie, { ...t2 }), Ge = Object.freeze(Object.defineProperty({
|
|
|
1656
1666
|
} }, Symbol.toStringTag, { value: "Module" })), qe = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Ze = (t2) => {
|
|
1657
1667
|
const e2 = t2?.width, n2 = t2?.height;
|
|
1658
1668
|
return x("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } });
|
|
1659
|
-
}, Je =
|
|
1660
|
-
const { children:
|
|
1661
|
-
|
|
1662
|
-
C2.current && (C2.current.__scrollTop ===
|
|
1663
|
-
}, [
|
|
1664
|
-
const k2 =
|
|
1665
|
-
b2?.({ left: t3, top:
|
|
1666
|
-
}, []), D2 =
|
|
1669
|
+
}, Je = s(l((t2, n2) => {
|
|
1670
|
+
const { children: i2, viewport: s2, onScrollViewport: l2, showHorizontalScrollbar: c2 = true, showVerticalScrollbar: h2 = true, createScrollCorner: u2 = Ze, renderScrollbarHorizontal: d2 = Ue, renderScrollbarVertical: p2 = Ue, style: m2, className: f2, touchElement: _2, disableTouch: g2, ...y2 } = t2, v2 = c2 && d2, w2 = h2 && p2, b2 = ht(l2, [l2]), L2 = Ft(n2, () => ({ isScrollPane: () => true }), []), C2 = e(null);
|
|
1671
|
+
r(() => {
|
|
1672
|
+
C2.current && (C2.current.__scrollTop === s2?.top && C2.current.__scrollLeft === s2?.left || C2.current.__isDecelerating || C2.current?.scrollTo(s2?.left, s2?.top, false));
|
|
1673
|
+
}, [s2?.left, s2?.top, _2]);
|
|
1674
|
+
const k2 = a((t3, e2) => {
|
|
1675
|
+
b2?.({ left: t3, top: e2 });
|
|
1676
|
+
}, []), D2 = a((t3) => {
|
|
1667
1677
|
C2.current?.doTouchStart(t3.touches, t3.timeStamp);
|
|
1668
|
-
}, []), P2 =
|
|
1678
|
+
}, []), P2 = a((t3) => {
|
|
1669
1679
|
t3.preventDefault(), C2.current?.doTouchMove(t3.touches, t3.timeStamp);
|
|
1670
|
-
}, []), z2 =
|
|
1680
|
+
}, []), z2 = a((t3) => {
|
|
1671
1681
|
C2.current?.doTouchEnd(t3.timeStamp);
|
|
1672
|
-
}, []), A2 =
|
|
1673
|
-
C2.current.setDimensions(t3,
|
|
1682
|
+
}, []), A2 = a(({ containerWidth: t3, containerHeight: e2, totalWidth: n3, totalHeight: o2 }) => {
|
|
1683
|
+
C2.current.setDimensions(t3, e2, n3, o2);
|
|
1674
1684
|
}, []);
|
|
1675
|
-
|
|
1685
|
+
r(() => {
|
|
1676
1686
|
const t3 = _2 ?? L2.current;
|
|
1677
|
-
if (!g2 &&
|
|
1687
|
+
if (!g2 && H().supportsTouchEvents && t3 && s2) {
|
|
1678
1688
|
if (!C2.current) {
|
|
1679
1689
|
const t4 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1680
1690
|
C2.current = new Ye(k2, t4);
|
|
1681
1691
|
}
|
|
1682
|
-
|
|
1692
|
+
H().supportsTouchEvents && (t3.addEventListener("touchstart", D2), t3.addEventListener("touchend", z2), t3.addEventListener("touchmove", P2)), A2({ containerWidth: s2?.width, containerHeight: s2?.height, totalWidth: s2?.totalWidth, totalHeight: s2?.totalHeight });
|
|
1683
1693
|
}
|
|
1684
1694
|
return () => {
|
|
1685
1695
|
t3?.removeEventListener("touchstart", D2), t3?.removeEventListener("touchend", z2), t3?.removeEventListener("touchmove", P2);
|
|
1686
1696
|
};
|
|
1687
|
-
}, [
|
|
1688
|
-
const [B2, { width: $2 }] = M(), [K2, { height:
|
|
1697
|
+
}, [s2?.width, s2?.height, s2?.totalWidth, s2?.totalHeight, g2, _2]);
|
|
1698
|
+
const [B2, { width: $2 }] = M(), [K2, { height: I2 }] = M(), O2 = o(() => {
|
|
1689
1699
|
if (!w2) return null;
|
|
1690
|
-
const t3 =
|
|
1700
|
+
const t3 = p2({ orientation: Te.Vertical, offset: s2?.top, viewportSize: s2?.height, totalSize: s2?.totalHeight, onScrollOffset: (t4) => {
|
|
1691
1701
|
b2?.({ top: t4 });
|
|
1692
1702
|
} });
|
|
1693
1703
|
return x("div", { className: T("vertical-container", qe["vertical-container"]), ref: B2, children: t3 });
|
|
1694
|
-
}, [
|
|
1704
|
+
}, [p2, s2?.top, s2?.height, s2?.totalHeight]), N2 = o(() => {
|
|
1695
1705
|
if (!v2) return null;
|
|
1696
|
-
const t3 =
|
|
1706
|
+
const t3 = d2({ orientation: Te.Horizontal, offset: s2?.left, viewportSize: s2?.width, totalSize: s2?.totalWidth, onScrollOffset: (t4) => {
|
|
1697
1707
|
b2?.({ left: t4 });
|
|
1698
1708
|
} });
|
|
1699
|
-
return S("div", { className: T("horizontal-corner-container", qe["horizontal-corner-container"]), children: [x("div", { className: T("horizontal-sizer", qe["horizontal-sizer"]), style: { width: `calc(100% - ${$2}px)` }, children: x("div", { ref: K2, className: T("scrollbar-sizer", qe["scrollbar-sizer"]), children: t3 }) }), w2 ?
|
|
1700
|
-
}, [
|
|
1701
|
-
return x("div", { className: T(
|
|
1709
|
+
return S("div", { className: T("horizontal-corner-container", qe["horizontal-corner-container"]), children: [x("div", { className: T("horizontal-sizer", qe["horizontal-sizer"]), style: { width: `calc(100% - ${$2}px)` }, children: x("div", { ref: K2, className: T("scrollbar-sizer", qe["scrollbar-sizer"]), children: t3 }) }), w2 ? u2({ width: $2, height: I2 }) : x(E, {})] });
|
|
1710
|
+
}, [d2, s2?.left, s2?.width, s2?.totalWidth, w2, u2, $2, I2]);
|
|
1711
|
+
return x("div", { className: T(f2, "scrollpane", qe.scrollpane), style: { minWidth: w2 ? `${$2}px` : void 0, minHeight: v2 ? `${I2}px` : void 0, ...m2 }, ...y2, ref: L2, children: S("div", { className: T("scrollpane-content", qe["scrollpane-content"]), children: [S("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: [x("div", { className: T("scrollpane-content-element", qe["scrollpane-content-element"]), children: i2 }), w2 ? O2 : x(E, {})] }), v2 ? N2 : x(E, {})] }) });
|
|
1702
1712
|
}));
|
|
1703
1713
|
Je.displayName = "ScrollPane";
|
|
1704
|
-
const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn =
|
|
1705
|
-
const { offset: n2 = 0, viewportSize:
|
|
1706
|
-
|
|
1707
|
-
const w2 = ht(
|
|
1708
|
-
const t3 = 0 ===
|
|
1709
|
-
return { offset: Math.ceil(n2 / e3), totalSize:
|
|
1710
|
-
}, [n2,
|
|
1711
|
-
const
|
|
1712
|
-
Math.abs(t3 -
|
|
1713
|
-
}, [
|
|
1714
|
-
}, []), M2 =
|
|
1714
|
+
const Qe = 300, tn = 100, en = 1e6, nn = 100, on = 50, rn = s(l((t2, e2) => {
|
|
1715
|
+
const { offset: n2 = 0, viewportSize: r2 = 0, totalSize: s2 = 0, minSize: l2 = 0, endGap: c2 = Qe, endScrollIncrement: h2 = tn, style: u2 = N, onMouseDown: d2, onScrollOffset: p2, onScroll: m2, scaleLimit: f2 = en, scaleFactor: _2 = nn, precisionFactor: g2 = on, renderScrollbar: y2 = Ue, ...v2 } = t2;
|
|
1716
|
+
m2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1717
|
+
const w2 = ht(d2, [d2]), [b2, x2] = i(false), S2 = o(() => {
|
|
1718
|
+
const t3 = 0 === f2 ? s2 : Math.min(s2 ?? 0, Math.max(l2 ?? 0, (n2 ?? 0) + (r2 ?? 0)) + (c2 ?? 0)), e3 = 0 !== f2 && t3 > f2 ? _2 : 1, o2 = e3 / g2, i2 = Math.ceil(t3 / e3);
|
|
1719
|
+
return { offset: Math.ceil(n2 / e3), totalSize: i2, viewportSize: Math.ceil(r2 / e3), scaledOffset: n2, scaledTotalSize: s2, scaledViewportSize: r2, factor: e3, precision: o2 };
|
|
1720
|
+
}, [n2, s2, r2, b2, l2, c2, h2]), E2 = ht((t3, e3, n3) => {
|
|
1721
|
+
const o2 = S2.offset;
|
|
1722
|
+
Math.abs(t3 - o2) < S2.precision && (t3 = o2), p2?.(t3 * S2.factor, o2, S2.viewportSize);
|
|
1723
|
+
}, [p2, S2]), L2 = a((t3) => {
|
|
1724
|
+
}, []), M2 = a((t3) => {
|
|
1715
1725
|
document.removeEventListener("mousemove", L2), document.removeEventListener("mouseup", M2), x2(false);
|
|
1716
|
-
}, []), T2 =
|
|
1726
|
+
}, []), T2 = a((t3) => {
|
|
1717
1727
|
x2(true), w2?.(t3), document.addEventListener("mousemove", L2, { passive: true }), document.addEventListener("mouseup", M2, { passive: true });
|
|
1718
1728
|
}, [L2, M2]);
|
|
1719
|
-
return y2({ style:
|
|
1729
|
+
return y2({ style: u2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2, ref: e2 });
|
|
1720
1730
|
}));
|
|
1721
1731
|
rn.displayName = "VirtualScrollbar";
|
|
1722
1732
|
export {
|
|
1723
1733
|
$ as Command,
|
|
1724
1734
|
q as CommandButtonType,
|
|
1725
|
-
|
|
1735
|
+
F as CommandGroup,
|
|
1726
1736
|
pe as DefaultDynamicIconService,
|
|
1727
1737
|
et as DefaultReactNotifier,
|
|
1728
1738
|
_e as DynamicIcon,
|
|
@@ -1738,11 +1748,11 @@ export {
|
|
|
1738
1748
|
tt as NotifierType,
|
|
1739
1749
|
Ee as PersistenceStateProvider,
|
|
1740
1750
|
qt as ReactErrorBoundary,
|
|
1741
|
-
|
|
1751
|
+
V as ReactUtils,
|
|
1742
1752
|
Q as RoundedTab,
|
|
1743
1753
|
Je as ScrollPane,
|
|
1744
1754
|
Ge as ScrollUtils,
|
|
1745
|
-
|
|
1755
|
+
Oe as Scrollbar,
|
|
1746
1756
|
Te as ScrollbarOrientation,
|
|
1747
1757
|
K as SimpleCommand,
|
|
1748
1758
|
se as SplitPane,
|
|
@@ -1757,10 +1767,10 @@ export {
|
|
|
1757
1767
|
Ae as defaultCreateScrollEndButton,
|
|
1758
1768
|
ze as defaultCreateScrollStartButton,
|
|
1759
1769
|
dt as getDevicePixelRatio,
|
|
1760
|
-
|
|
1770
|
+
Y as toShortcutString,
|
|
1761
1771
|
ct as useAnimatedMeasure,
|
|
1762
1772
|
ht as useCallbackRef,
|
|
1763
|
-
|
|
1773
|
+
I as useCommand,
|
|
1764
1774
|
G as useCommands,
|
|
1765
1775
|
$t as useCopyPaste,
|
|
1766
1776
|
ut as useDevicePixelRatio,
|