@sheetxl/utils-react 0.7.10 → 0.7.12
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/BGFqkFxbLS0vmmh5.cjs +6 -0
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/CNTtjTL9eZe9TQw2.mjs +12 -0
- package/browser/esm/index.mjs +656 -621
- package/node/assets/style.css +1 -1
- package/node/esm/i36M1qE9kUNw0xW3.mjs +12 -0
- package/node/esm/index.mjs +476 -441
- package/package.json +2 -2
- package/types/index.d.ts +47 -1
- package/browser/cjs/GDXov-yumZio8FPo.cjs +0 -6
- package/browser/esm/DRyP2NC3cYmWNj79.mjs +0 -12
- package/node/esm/ClIkEEc3keHubiqX.mjs +0 -12
package/browser/esm/index.mjs
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent;--scrollbar-size: 13px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_1v478_17 ::-webkit-scrollbar-button{background:transparent}._scrollbar_1v478_17{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_1v478_17 ._vsb-track_1v478_27{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_1v478_17 ._vsb-thumb_1v478_39{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_1v478_17 ._vsb-thumb_1v478_39:hover{background:var(--scrollbar-active-color)}._scrollbar_1v478_17.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_1v478_17.vertical ._vsb-thumb_1v478_39{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.vertical ._vsb-track_1v478_27{width:100%}._scrollbar_1v478_17.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_1v478_17.horizontal ._vsb-thumb_1v478_39{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.horizontal ._vsb-track_1v478_27{height:100%}._scrollbar_1v478_17.dragging ._vsb-thumb_1v478_39{background:var(--scrollbar-active-color)}._scrollbar-button_1v478_80{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar-button_1v478_80>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar-button_1v478_80:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar-button_1v478_80[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar-button_1v478_80.vertical{width:var(--scrollbar-width)}._scrollbar-button_1v478_80.horizontal{height:var(--scrollbar-height)}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}.
|
|
2
|
-
import { jsx as C, Fragment as
|
|
3
|
-
import
|
|
4
|
-
import { unstable_batchedUpdates as _n, createPortal as
|
|
5
|
-
import { DefaultNotifier as
|
|
6
|
-
import { createRoot as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(":root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent;--scrollbar-size: 13px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_1v478_17 ::-webkit-scrollbar-button{background:transparent}._scrollbar_1v478_17{display:flex;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_1v478_17 ._vsb-track_1v478_27{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_1v478_17 ._vsb-thumb_1v478_39{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_1v478_17 ._vsb-thumb_1v478_39:hover{background:var(--scrollbar-active-color)}._scrollbar_1v478_17.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px)}._scrollbar_1v478_17.vertical ._vsb-thumb_1v478_39{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.vertical ._vsb-track_1v478_27{width:100%}._scrollbar_1v478_17.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px)}._scrollbar_1v478_17.horizontal ._vsb-thumb_1v478_39{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_1v478_17.horizontal ._vsb-track_1v478_27{height:100%}._scrollbar_1v478_17.dragging ._vsb-thumb_1v478_39{background:var(--scrollbar-active-color)}._scrollbar-button_1v478_80{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar-button_1v478_80>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar-button_1v478_80:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar-button_1v478_80[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar-button_1v478_80.vertical{width:var(--scrollbar-width)}._scrollbar-button_1v478_80.horizontal{height:var(--scrollbar-height)}._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: .875rem;--icon-size-md: 1rem;--icon-size-lg: 1.25rem;--icon-size-xl: 1.5rem}._Icon_1ld90_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_1ld90_10 .sm{--font-size: var(--icon-size-sm)}._Icon_1ld90_10 .md{--font-size: var(--icon-size-md)}._Icon_1ld90_10 .lg{--font-size: var(--icon-size-lg)}._Icon_1ld90_10 .xl{--font-size: var(--icon-size-xl)}._Icon_1ld90_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_1ld90_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_1ld90_10 .fill,._Icon_1ld90_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_1ld90_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_1ld90_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_1ld90_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_1ld90_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_1ld90_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_1ld90_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_1ld90_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_1ld90_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_1ld90_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_1ld90_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_1ld90_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_1ld90_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_1ld90_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_1ld90_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_1ld90_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_1ld90_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_1ld90_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_1ld90_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_1ld90_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { jsx as C, Fragment as Me, jsxs as Ce } from "react/jsx-runtime";
|
|
3
|
+
import re, { version as hn, useLayoutEffect as _t, useEffect as N, useState as F, useMemo as R, createContext as un, useContext as dn, useRef as O, useReducer as Ht, useCallback as V, createElement as pn, useImperativeHandle as fn, memo as we, forwardRef as ke, Component as mn } from "react";
|
|
4
|
+
import { unstable_batchedUpdates as _n, createPortal as gn } from "react-dom";
|
|
5
|
+
import { DefaultNotifier as yn, Notifier as ye, CommonUtils as q, InternalClipboard as Ze, ClipboardUtils as ot, MimeType as it } from "@sheetxl/utils";
|
|
6
|
+
import { createRoot as vn } from "react-dom/client";
|
|
7
7
|
/**
|
|
8
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
8
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.12
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
function
|
|
13
|
+
const To = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Y = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, ko = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, Po = { Left: 1, Middle: 2, Right: 3 }, ae = { Horizontal: "horizontal", Vertical: "vertical" };
|
|
14
|
+
function It(i) {
|
|
15
15
|
var e, t, n = "";
|
|
16
16
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
17
17
|
else if (typeof i == "object") if (Array.isArray(i)) {
|
|
18
18
|
var o = i.length;
|
|
19
|
-
for (e = 0; e < o; e++) i[e] && (t =
|
|
19
|
+
for (e = 0; e < o; e++) i[e] && (t = It(i[e])) && (n && (n += " "), n += t);
|
|
20
20
|
} else for (t in i) i[t] && (n && (n += " "), n += t);
|
|
21
21
|
return n;
|
|
22
22
|
}
|
|
23
23
|
function le() {
|
|
24
|
-
for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e =
|
|
24
|
+
for (var i, e, t = 0, n = "", o = arguments.length; t < o; t++) (i = arguments[t]) && (e = It(i)) && (n && (n += " "), n += e);
|
|
25
25
|
return n;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function rt(i, e) {
|
|
28
28
|
if (typeof i == "function") return i(e);
|
|
29
29
|
i && (i.current = e);
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var $e = parseInt(hn.split(".")[0], 10) >= 19 ? function(i) {
|
|
32
32
|
return (e) => {
|
|
33
33
|
const t = [];
|
|
34
34
|
for (const n of i) {
|
|
35
|
-
const o =
|
|
36
|
-
t.push(r ? o : () =>
|
|
35
|
+
const o = rt(n, e), r = typeof o == "function";
|
|
36
|
+
t.push(r ? o : () => rt(n, null));
|
|
37
37
|
}
|
|
38
38
|
return () => {
|
|
39
39
|
for (const n of t) n();
|
|
@@ -41,28 +41,28 @@ var Oe = parseInt(an.split(".")[0], 10) >= 19 ? function(i) {
|
|
|
41
41
|
};
|
|
42
42
|
} : function(i) {
|
|
43
43
|
return (e) => {
|
|
44
|
-
for (const t of i)
|
|
44
|
+
for (const t of i) rt(t, e);
|
|
45
45
|
};
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
var i =
|
|
46
|
+
}, wn = function() {
|
|
47
|
+
}, Vt = typeof window < "u", bn = Vt ? _t : N, Et = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
48
|
+
const ve = Vt && window.ResizeObserver !== void 0 ? function() {
|
|
49
|
+
var i = F(null), e = i[0], t = i[1], n = F(Et), o = n[0], r = n[1], a = R(function() {
|
|
50
50
|
return new window.ResizeObserver(function(h) {
|
|
51
51
|
if (h[0]) {
|
|
52
|
-
var s = h[0].contentRect, l = s.x, c = s.y, u = s.width, d = s.height, f = s.top,
|
|
53
|
-
r({ x: l, y: c, width: u, height: d, top: f, left:
|
|
52
|
+
var s = h[0].contentRect, l = s.x, c = s.y, u = s.width, d = s.height, f = s.top, _ = s.left, g = s.bottom, M = s.right;
|
|
53
|
+
r({ x: l, y: c, width: u, height: d, top: f, left: _, bottom: g, right: M });
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}, []);
|
|
57
|
-
return
|
|
57
|
+
return bn(function() {
|
|
58
58
|
if (e) return a.observe(e), function() {
|
|
59
59
|
a.disconnect();
|
|
60
60
|
};
|
|
61
61
|
}, [e]), [t, o];
|
|
62
62
|
} : function() {
|
|
63
|
-
return [
|
|
64
|
-
},
|
|
65
|
-
class
|
|
63
|
+
return [wn, Et];
|
|
64
|
+
}, Lt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
65
|
+
class xn extends yn {
|
|
66
66
|
setOverrides(e) {
|
|
67
67
|
super.setOverrides(e);
|
|
68
68
|
}
|
|
@@ -72,7 +72,7 @@ class bn extends gn {
|
|
|
72
72
|
showMessage(e, t) {
|
|
73
73
|
const n = this.getDelegate();
|
|
74
74
|
if (n?.showMessage) return n.showMessage(e, t);
|
|
75
|
-
t?.type !==
|
|
75
|
+
t?.type !== Lt.Warning ? t?.type !== Lt.Error ? ye.log(e) : ye.error(e) : ye.warn(e);
|
|
76
76
|
}
|
|
77
77
|
showBusy(e, t) {
|
|
78
78
|
const n = this.getDelegate();
|
|
@@ -98,20 +98,52 @@ class bn extends gn {
|
|
|
98
98
|
return t?.showInputOptions ? t.showInputOptions(e) : Promise.resolve({ input: "", option: "" });
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const Wt = un(new xn()), Do = ({ children: i, notifier: e }) => (re.useEffect(() => {
|
|
102
102
|
const t = ye.getOverrides();
|
|
103
103
|
return ye.setOverrides(e), () => {
|
|
104
104
|
ye.setOverrides(t);
|
|
105
105
|
};
|
|
106
|
-
}, [e]),
|
|
106
|
+
}, [e]), re.createElement(Wt.Provider, { value: e }, i)), Qe = () => dn(Wt), Sn = 3, En = 0.5, Ln = 50, st = (i) => ({ x: i.x, y: i.y, width: i.width, height: i.height, top: i.top, left: i.left, right: i.right, bottom: i.bottom });
|
|
107
|
+
function Ao(i = {}) {
|
|
108
|
+
const { threshold: e = En, stillnessThreshold: t = Sn, maxHierarchyDepth: n = Ln } = i, [o, r] = ve(), a = O(null), [h, s] = Ht((_) => _ + 1, 0), l = O(void 0), c = O({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), u = V((_) => {
|
|
109
|
+
a.current = _, typeof o == "function" && o(_);
|
|
110
|
+
}, [o]), [d, f] = F(r);
|
|
111
|
+
return N(() => {
|
|
112
|
+
r && !d && f(r);
|
|
113
|
+
}, [r, d]), N(() => {
|
|
114
|
+
const _ = a.current;
|
|
115
|
+
if (!_) return;
|
|
116
|
+
let g = !1, M = 0;
|
|
117
|
+
const P = () => {
|
|
118
|
+
if (!_) return;
|
|
119
|
+
const S = _.getBoundingClientRect(), T = c.current;
|
|
120
|
+
Math.abs(S.x - T.x) > e || Math.abs(S.y - T.y) > e || Math.abs(S.width - T.width) > e || Math.abs(S.height - T.height) > e ? (g || (g = !0, f(st(S)), s()), M = 0) : M++, g && M >= t && (g = !1, f(st(S)), s()), c.current = st(S), l.current = requestAnimationFrame(P);
|
|
121
|
+
};
|
|
122
|
+
l.current = requestAnimationFrame(P);
|
|
123
|
+
const y = (S) => {
|
|
124
|
+
g = !0, s();
|
|
125
|
+
}, w = (S) => {
|
|
126
|
+
g = !1, M = t, s();
|
|
127
|
+
};
|
|
128
|
+
let m = _;
|
|
129
|
+
const A = [];
|
|
130
|
+
for (; m && m !== document.documentElement && (m.addEventListener("animationstart", y, !0), m.addEventListener("animationend", w, !0), m.addEventListener("transitionstart", y, !0), m.addEventListener("transitionend", w, !0), A.push(m), m = m.parentElement, !(A.length > n)); ) ;
|
|
131
|
+
return () => {
|
|
132
|
+
l.current && cancelAnimationFrame(l.current), A.forEach((S) => {
|
|
133
|
+
S.removeEventListener("animationstart", y, !0), S.removeEventListener("animationend", w, !0), S.removeEventListener("transitionstart", y, !0), S.removeEventListener("transitionend", w, !0);
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
}, [h, r, e, t, n]), [u, d];
|
|
137
|
+
}
|
|
138
|
+
const k = (i, e) => {
|
|
107
139
|
const t = V((...r) => i?.(...r), e), n = O(null);
|
|
108
140
|
n.current = t;
|
|
109
141
|
const o = V((...r) => n.current?.(...r), []);
|
|
110
142
|
if (n.current) return o;
|
|
111
143
|
};
|
|
112
|
-
function
|
|
113
|
-
const [e, t] =
|
|
114
|
-
return
|
|
144
|
+
function zo(i) {
|
|
145
|
+
const [e, t] = F(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
|
|
146
|
+
return N(() => {
|
|
115
147
|
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
116
148
|
const o = () => {
|
|
117
149
|
const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
@@ -122,14 +154,14 @@ function Mo(i) {
|
|
|
122
154
|
};
|
|
123
155
|
}, [i]), e;
|
|
124
156
|
}
|
|
125
|
-
function
|
|
157
|
+
function Bo(i) {
|
|
126
158
|
if (typeof window > "u") return 1;
|
|
127
159
|
const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
|
|
128
160
|
return Math.min(Math.max(1, n ? Math.floor(o) : o), t);
|
|
129
161
|
}
|
|
130
|
-
function
|
|
131
|
-
const n =
|
|
132
|
-
|
|
162
|
+
function Oo(i, e, t) {
|
|
163
|
+
const n = k(e, [e]);
|
|
164
|
+
N(() => {
|
|
133
165
|
const o = (r) => {
|
|
134
166
|
i.current && !i.current.contains(r.target) && n(r);
|
|
135
167
|
};
|
|
@@ -138,108 +170,108 @@ function ko(i, e, t) {
|
|
|
138
170
|
};
|
|
139
171
|
}, [i]);
|
|
140
172
|
}
|
|
141
|
-
function
|
|
173
|
+
function Mn(i) {
|
|
142
174
|
if (!i) throw new Error("must have a PointerHandlerOptions");
|
|
143
|
-
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, a =
|
|
144
|
-
|
|
145
|
-
}, []),
|
|
146
|
-
|
|
175
|
+
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: o = !1, consumeTouch: r = !0 } = i, a = k(e, [e]), h = k(t, [t]), s = k(n, [n]), l = O(!1), c = i?.timerInitial ?? 230, u = i?.timerContinuous ?? c / 2, d = O(null), f = O(null), _ = O(null), g = O(null), M = V(() => {
|
|
176
|
+
g.current && (clearTimeout(g.current), g.current = null);
|
|
177
|
+
}, []), P = V((E) => {
|
|
178
|
+
g.current = setTimeout(() => {
|
|
147
179
|
window.requestAnimationFrame(() => {
|
|
148
|
-
l.current !== !1 && s?.(f.current,
|
|
149
|
-
}),
|
|
150
|
-
},
|
|
180
|
+
l.current !== !1 && s?.(f.current, _.current, d.current);
|
|
181
|
+
}), P(u);
|
|
182
|
+
}, E ?? c);
|
|
151
183
|
}, []);
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
}, []),
|
|
156
|
-
document.removeEventListener(`${
|
|
157
|
-
l.current !== !1 && (l.current = !1, h?.(
|
|
184
|
+
N(() => () => M(), []);
|
|
185
|
+
const y = o ? "pointer" : "mouse", w = V((E) => {
|
|
186
|
+
E.stopPropagation(), E.stopImmediatePropagation(), E.preventDefault();
|
|
187
|
+
}, []), m = k((E) => {
|
|
188
|
+
document.removeEventListener(`${y}move`, T), document.removeEventListener(`${y}up`, m), document.removeEventListener("keydown", I), document.removeEventListener("keyup", x), document.removeEventListener("touchstart", w, { capture: !0 }), document.removeEventListener("touchmove", w, { capture: !0 }), window.removeEventListener("blur", A), M(), window.requestAnimationFrame(() => {
|
|
189
|
+
l.current !== !1 && (l.current = !1, h?.(E, _.current, d.current), _.current = null);
|
|
158
190
|
});
|
|
159
|
-
}, []),
|
|
160
|
-
l.current !== !1 && (l.current = !1,
|
|
161
|
-
}, []),
|
|
162
|
-
|
|
163
|
-
l.current !== !1 && s?.(f.current,
|
|
191
|
+
}, []), A = V(() => {
|
|
192
|
+
l.current !== !1 && (l.current = !1, m(f.current));
|
|
193
|
+
}, []), S = k(() => {
|
|
194
|
+
M(), P(u), window.requestAnimationFrame(() => {
|
|
195
|
+
l.current !== !1 && s?.(f.current, _.current, d.current);
|
|
164
196
|
});
|
|
165
|
-
}, [u]),
|
|
166
|
-
f.current =
|
|
167
|
-
}, []),
|
|
168
|
-
|
|
169
|
-
}, []),
|
|
170
|
-
|
|
197
|
+
}, [u]), T = k((E) => {
|
|
198
|
+
f.current = E, S();
|
|
199
|
+
}, []), I = k((E) => {
|
|
200
|
+
_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, S();
|
|
201
|
+
}, []), x = k((E) => {
|
|
202
|
+
_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, S();
|
|
171
203
|
}, [u]);
|
|
172
|
-
return
|
|
173
|
-
|
|
204
|
+
return k((E) => {
|
|
205
|
+
E.isDefaultPrevented() || (_.current = { ctrlKey: E.ctrlKey, shiftKey: E.shiftKey, altKey: E.altKey, metaKey: E.metaKey }, a(E, _.current) !== !1 && (d.current = E, f.current = E.nativeEvent, document.addEventListener(`${y}up`, m, { passive: !1 }), document.addEventListener(`${y}move`, T, { passive: !1 }), document.addEventListener("keydown", I, { passive: !1 }), document.addEventListener("keyup", x, { passive: !1 }), window.addEventListener("blur", A, { passive: !0 }), o && r && (document.addEventListener("touchstart", w, { passive: !1, capture: !0 }), document.addEventListener("touchmove", w, { passive: !1, capture: !0 })), l.current = !0, P(c)));
|
|
174
206
|
}, [c, o]);
|
|
175
207
|
}
|
|
176
|
-
function
|
|
177
|
-
return
|
|
208
|
+
function $o(i, e) {
|
|
209
|
+
return Mn({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
|
|
178
210
|
i?.(o);
|
|
179
211
|
}, ...e });
|
|
180
212
|
}
|
|
181
|
-
const
|
|
213
|
+
const Cn = ({ initValue: i, useHookBody: e, applyStateChange: t }) => {
|
|
182
214
|
const n = O(i);
|
|
183
215
|
if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
|
|
184
216
|
const o = e();
|
|
185
|
-
return
|
|
217
|
+
return _t(() => {
|
|
186
218
|
n.current !== o && (n.current = o, t(o));
|
|
187
219
|
}, [t, o]), null;
|
|
188
|
-
},
|
|
220
|
+
}, ht = (i) => {
|
|
189
221
|
console && console.warn && console.warn(i);
|
|
190
|
-
},
|
|
191
|
-
let
|
|
192
|
-
const Ye = [], Le = [],
|
|
222
|
+
}, lt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
223
|
+
let Tn = 1, ut = !1, Ft = !1;
|
|
224
|
+
const Ye = [], Le = [], qe = () => {
|
|
193
225
|
Le.forEach((i) => i());
|
|
194
|
-
},
|
|
195
|
-
const [e, t] =
|
|
196
|
-
return n.current = e, i ||
|
|
226
|
+
}, kn = ({ automaticContainerInternalUseOnly: i }) => {
|
|
227
|
+
const [e, t] = F([]), n = O([]);
|
|
228
|
+
return n.current = e, i || ut !== !1 || (Ft = !0), N(() => {
|
|
197
229
|
let o = !0;
|
|
198
230
|
function r() {
|
|
199
|
-
if (o) return Le[0] !== r ? (i ||
|
|
231
|
+
if (o) return Le[0] !== r ? (i || ut !== !0 || ht("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((a) => [])) : void t([...Ye]);
|
|
200
232
|
}
|
|
201
|
-
return Le.push(r),
|
|
202
|
-
o = !1, n.current?.length > 0 &&
|
|
233
|
+
return Le.push(r), qe(), () => {
|
|
234
|
+
o = !1, n.current?.length > 0 && ht("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Le.splice(Le.indexOf(r), 1), qe();
|
|
203
235
|
};
|
|
204
|
-
}, [i]), C(
|
|
205
|
-
},
|
|
206
|
-
const e =
|
|
207
|
-
return Ye.push({ hook: i, key: e }), Le.length === 0 &&
|
|
208
|
-
if (
|
|
209
|
-
const n =
|
|
210
|
-
|
|
211
|
-
} else
|
|
212
|
-
})(
|
|
213
|
-
Ye.splice(Ye.findIndex((t) => t.key === e), 1),
|
|
236
|
+
}, [i]), C(Me, { children: e.map(({ hook: o, key: r }) => pn(Cn, { ...o, key: r })) });
|
|
237
|
+
}, Pn = (i) => {
|
|
238
|
+
const e = Tn++;
|
|
239
|
+
return Ye.push({ hook: i, key: e }), Le.length === 0 && Ft === !1 && (ut = !0, ((t) => {
|
|
240
|
+
if (lt.document && lt.document.createElement) {
|
|
241
|
+
const n = lt.document.createElement("div");
|
|
242
|
+
vn(n).render(C(t, { automaticContainerInternalUseOnly: !0 }));
|
|
243
|
+
} else ht("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
244
|
+
})(kn)), qe(), () => {
|
|
245
|
+
Ye.splice(Ye.findIndex((t) => t.key === e), 1), qe();
|
|
214
246
|
};
|
|
215
247
|
};
|
|
216
|
-
let
|
|
217
|
-
|
|
248
|
+
let dt = null;
|
|
249
|
+
dt || (dt = (i, e, t = {}) => {
|
|
218
250
|
let n, o, r = !1, a = !1, h = [], { unmountIfNoConsumers: s = !1 } = t;
|
|
219
251
|
const l = (u) => {
|
|
220
252
|
o = u, _n(() => h.forEach((d) => d(u)));
|
|
221
253
|
}, c = () => (a || (o = typeof i == "function" ? i() : i, a = !0), o);
|
|
222
254
|
return () => {
|
|
223
|
-
const [u, d] =
|
|
224
|
-
return
|
|
255
|
+
const [u, d] = F(c);
|
|
256
|
+
return N(() => (r || (r = !0, n = Pn({ initValue: i, useHookBody: e, applyStateChange: l })), h.push(d), o !== u && d(o), () => {
|
|
225
257
|
h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), r = !1);
|
|
226
258
|
}), []), u;
|
|
227
259
|
};
|
|
228
260
|
});
|
|
229
|
-
const
|
|
230
|
-
let
|
|
261
|
+
const jt = dt;
|
|
262
|
+
let Ut = () => {
|
|
231
263
|
console.warn("You must call useEditMode before setting its state.");
|
|
232
264
|
};
|
|
233
|
-
const
|
|
234
|
-
const [i, e] =
|
|
235
|
-
return
|
|
236
|
-
}),
|
|
237
|
-
const i =
|
|
238
|
-
return
|
|
239
|
-
|
|
265
|
+
const Dn = jt(null, () => {
|
|
266
|
+
const [i, e] = F(null);
|
|
267
|
+
return Ut = e, i;
|
|
268
|
+
}), Ko = () => {
|
|
269
|
+
const i = Dn();
|
|
270
|
+
return R(() => ({ setMode: (e) => {
|
|
271
|
+
Ut((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
|
|
240
272
|
}, getMode: () => i }), [i]);
|
|
241
273
|
};
|
|
242
|
-
class
|
|
274
|
+
class pt {
|
|
243
275
|
constructor(e, t, n, o) {
|
|
244
276
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = o, o === void 0 && (this._callback = () => {
|
|
245
277
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
@@ -350,21 +382,21 @@ class ht {
|
|
|
350
382
|
}), t;
|
|
351
383
|
}
|
|
352
384
|
}
|
|
353
|
-
class
|
|
385
|
+
class at extends pt {
|
|
354
386
|
}
|
|
355
|
-
var
|
|
387
|
+
var te = typeof window < "u" ? window : { screen: {}, navigator: {} }, Te = (te.matchMedia || function() {
|
|
356
388
|
return { matches: !1 };
|
|
357
|
-
}).bind(
|
|
358
|
-
return
|
|
359
|
-
} },
|
|
389
|
+
}).bind(te), Xt = !1, An = { get passive() {
|
|
390
|
+
return Xt = !0;
|
|
391
|
+
} }, Mt = function() {
|
|
360
392
|
};
|
|
361
|
-
|
|
362
|
-
var
|
|
363
|
-
const
|
|
364
|
-
function
|
|
365
|
-
return
|
|
393
|
+
te.addEventListener && te.addEventListener("p", Mt, An), te.removeEventListener && te.removeEventListener("p", Mt, !1);
|
|
394
|
+
var zn = Xt, Bn = "PointerEvent" in te, gt = "ontouchstart" in te, Yt = gt || "TouchEvent" in te && Te("(any-pointer: coarse)").matches, Ct = (te.navigator.maxTouchPoints || 0) > 0 || Yt, Gt = te.navigator.userAgent || "", On = Te("(pointer: coarse)").matches && /iPad|Macintosh/.test(Gt) && Math.min(te.screen.width || 0, te.screen.height || 0) >= 768, Zt = (Te("(pointer: coarse)").matches || !Te("(pointer: fine)").matches && gt) && !/Windows.*Firefox/.test(Gt), $n = Te("(any-pointer: fine)").matches || Te("(any-hover: hover)").matches || On || !gt, ft = !Ct || !$n && Zt ? Ct ? "touchOnly" : "mouseOnly" : "hybrid", Kn = ft === "mouseOnly" ? "mouse" : ft === "touchOnly" || Zt ? "touch" : "mouse";
|
|
395
|
+
const Rn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: ft, primaryInput: Kn, supportsPassiveEvents: zn, supportsPointerEvents: Bn, supportsTouchEvents: Yt }, Symbol.toStringTag, { value: "Module" })), Nn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), qt = {};
|
|
396
|
+
function mt() {
|
|
397
|
+
return Rn;
|
|
366
398
|
}
|
|
367
|
-
const
|
|
399
|
+
const Qt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : q.camelToPrettyCase(i), Ro = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: qt, boundPixel: function(i, e = !1, t = 0) {
|
|
368
400
|
return i;
|
|
369
401
|
}, createSyntheticEvent: (i) => {
|
|
370
402
|
let e = !1, t = !1;
|
|
@@ -374,8 +406,8 @@ const Gt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : q.cam
|
|
|
374
406
|
t = !0, i.stopPropagation();
|
|
375
407
|
}, isPropagationStopped: () => t, persist: () => {
|
|
376
408
|
}, timeStamp: i.timeStamp, type: i.type };
|
|
377
|
-
}, detectIt:
|
|
378
|
-
class
|
|
409
|
+
}, detectIt: mt, focusableNodeNames: Nn, toPrettyKeyCode: Qt }, Symbol.toStringTag, { value: "Module" }));
|
|
410
|
+
class Jt {
|
|
379
411
|
constructor(e, t) {
|
|
380
412
|
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = q.uuidV4(), this._target = e, this._groupKey = t ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(t, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
381
413
|
const n = this;
|
|
@@ -402,7 +434,7 @@ class Zt {
|
|
|
402
434
|
s && (o = s), h = h._parent;
|
|
403
435
|
}
|
|
404
436
|
}
|
|
405
|
-
o || (o = new
|
|
437
|
+
o || (o = new Jt(e, t), o._parent = this, o._root = this._root, o._unListenersByCommand = null, o._listenersByKey = null, o._commandsPropertyListener = null);
|
|
406
438
|
const r = (h, s) => {
|
|
407
439
|
!h.has(t) || n ? h.set(t, s) : n === void 0 && console.warn("commandGroup already registered", t);
|
|
408
440
|
};
|
|
@@ -433,9 +465,9 @@ class Zt {
|
|
|
433
465
|
const d = s.shortcut();
|
|
434
466
|
if (!d) continue;
|
|
435
467
|
const f = Array.isArray(d) ? d : [d];
|
|
436
|
-
for (let
|
|
437
|
-
const
|
|
438
|
-
|
|
468
|
+
for (let _ = 0; _ < f.length; _++) {
|
|
469
|
+
const g = Be(f[_]), M = o.get(g);
|
|
470
|
+
M && !t && t === void 0 && console.warn(`Shortcut already registered: ${g}, ${l}, ${M}.`), o.set(g, l);
|
|
439
471
|
}
|
|
440
472
|
}
|
|
441
473
|
}
|
|
@@ -468,11 +500,11 @@ class Zt {
|
|
|
468
500
|
}
|
|
469
501
|
findCommandByEvent(e) {
|
|
470
502
|
const t = [];
|
|
471
|
-
e.altKey && t.push(
|
|
472
|
-
let n =
|
|
503
|
+
e.altKey && t.push(Y.Alt), e.shiftKey && t.push(Y.Shift), e.ctrlKey && t.push(Y.Ctrl), e.metaKey && t.push(Y.Meta);
|
|
504
|
+
let n = Be({ key: e.code, modifiers: t });
|
|
473
505
|
const o = this._commandsByShortcut;
|
|
474
506
|
let r = o.get(n);
|
|
475
|
-
r || (n =
|
|
507
|
+
r || (n = Be({ key: e.key, modifiers: t }), r = o.get(n)), !r && e.code.startsWith("Digit") && (n = Be({ key: e.code.substring(5, e.code.length), modifiers: t }), r = this._commandsByShortcut.get(n)), !r && e.code.startsWith("Key") && (r = Be({ key: e.code.substring(3, e.code.length), modifiers: t }), r = o.get(n));
|
|
476
508
|
let a = null;
|
|
477
509
|
return r && (a = this._commandsByKey.get(r), a && a.disabled() && (a = null), !a || a.target() && a.target().contains(e.target) || (a = null)), a || (this._parent?.findCommandByEvent(e) ?? null);
|
|
478
510
|
}
|
|
@@ -529,17 +561,17 @@ class Zt {
|
|
|
529
561
|
}), e;
|
|
530
562
|
}
|
|
531
563
|
}
|
|
532
|
-
const
|
|
564
|
+
const Hn = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "Cmd" : "Ctrl", In = q.getOS() === q.OSType.MacOS || q.getOS() === q.OSType.IOS ? "⌘" : "^", Be = (i, e = !1) => {
|
|
533
565
|
const t = {};
|
|
534
566
|
for (let o = 0; i.modifiers && o < i.modifiers.length; o++) t[i.modifiers[o]] = !0;
|
|
535
567
|
let n = "";
|
|
536
|
-
return (t?.[
|
|
568
|
+
return (t?.[Y.Ctrl] || t?.[Y.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? In : Hn)), t?.[Y.Alt] && (n += e ? "⌥" : "Alt"), t?.[Y.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + Qt(i.key), n;
|
|
537
569
|
};
|
|
538
|
-
function
|
|
570
|
+
function No(i, e = null) {
|
|
539
571
|
const t = O(e);
|
|
540
572
|
t.current = e;
|
|
541
|
-
const [n, o] =
|
|
542
|
-
return
|
|
573
|
+
const [n, o] = Ht((a) => a + 1, 0), r = R(() => Array.isArray(i) ? i : [i], [i]);
|
|
574
|
+
return N(() => {
|
|
543
575
|
if (!r || r.length === 0) return;
|
|
544
576
|
const a = (l, c) => {
|
|
545
577
|
t.current?.onChange?.(c), o();
|
|
@@ -559,7 +591,7 @@ function zo(i, e = null) {
|
|
|
559
591
|
};
|
|
560
592
|
}, [i]), n;
|
|
561
593
|
}
|
|
562
|
-
const
|
|
594
|
+
const Fe = (i, e) => {
|
|
563
595
|
if (!e || !i || e.length === 0) return q.EmptyArray;
|
|
564
596
|
const t = e.length, n = new Array(t);
|
|
565
597
|
for (let o = 0; o < t; o++) {
|
|
@@ -568,124 +600,124 @@ const Ve = (i, e) => {
|
|
|
568
600
|
}
|
|
569
601
|
return n;
|
|
570
602
|
};
|
|
571
|
-
function
|
|
603
|
+
function Ho(i, e = null, t = null, n) {
|
|
572
604
|
const o = O(t);
|
|
573
605
|
o.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
574
|
-
const [r, a] =
|
|
575
|
-
return
|
|
606
|
+
const [r, a] = F(Fe(i, e)), h = n ? [...n, i] : [i];
|
|
607
|
+
return N(() => {
|
|
576
608
|
const s = { onGroupChange: () => {
|
|
577
|
-
const d =
|
|
609
|
+
const d = Fe(i, e);
|
|
578
610
|
a(d), o.current?.onChange?.(this);
|
|
579
611
|
} };
|
|
580
612
|
let l;
|
|
581
613
|
e && e.length > 0 && (l = { keys: e }, s.onCommandChange = (d, f) => {
|
|
582
|
-
o.current?.onChange?.(i), a(
|
|
614
|
+
o.current?.onChange?.(i), a(Fe(i, e));
|
|
583
615
|
});
|
|
584
|
-
const c = i?.addListener(s, l), u =
|
|
616
|
+
const c = i?.addListener(s, l), u = Fe(i, e);
|
|
585
617
|
return a(u), o.current?.onChange && o.current?.onChange(i), () => {
|
|
586
618
|
c?.();
|
|
587
619
|
};
|
|
588
620
|
}, h), r;
|
|
589
621
|
}
|
|
590
|
-
const
|
|
622
|
+
const Io = { Toolbar: "toolbar", Menuitem: "menuitem" }, Vn = jt({ setClipboard: (i) => {
|
|
591
623
|
throw new Error("This is only available via the useClipboard.");
|
|
592
|
-
}, getClipboard: () =>
|
|
593
|
-
const [i, e] =
|
|
624
|
+
}, getClipboard: () => Ze.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
625
|
+
const [i, e] = F(Ze.Global);
|
|
594
626
|
return { setClipboard: (t) => e(t), getClipboard: () => i, refNativeCopy: O(null), refNativeLastKey: O(null) };
|
|
595
|
-
}),
|
|
596
|
-
const { source: e, target: t, onPaste: n, onClipboardUpdate: o, commands: r } = i, a =
|
|
597
|
-
|
|
598
|
-
const
|
|
627
|
+
}), Vo = (i) => {
|
|
628
|
+
const { source: e, target: t, onPaste: n, onClipboardUpdate: o, commands: r } = i, a = Qe(), h = k(o, [o]), s = k(n, [n]), { getClipboard: l, refNativeCopy: c } = Vn(), u = l();
|
|
629
|
+
R(() => {
|
|
630
|
+
const y = e?.element, w = t?.element ?? e?.element;
|
|
599
631
|
if (!r) return;
|
|
600
|
-
const
|
|
601
|
-
r?.addCommands(
|
|
632
|
+
const m = [new at("cut", y, { 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: [Y.Ctrl] } }), new at("copy", y, { 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: [Y.Ctrl] } }), new at("paste", w, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Y.Ctrl] }, { key: "F8", modifiers: [Y.Ctrl] }] })];
|
|
633
|
+
r?.addCommands(m, !0);
|
|
602
634
|
}, [r]);
|
|
603
|
-
const d =
|
|
635
|
+
const d = k(async (y) => {
|
|
604
636
|
if (!e?.element) return;
|
|
605
|
-
let
|
|
637
|
+
let w = null;
|
|
606
638
|
try {
|
|
607
|
-
|
|
608
|
-
} catch (
|
|
609
|
-
throw
|
|
639
|
+
w = e.doCopy?.(y), typeof w == "string" ? await u.writeText(w) : await u.writeReference(w);
|
|
640
|
+
} catch (m) {
|
|
641
|
+
throw m;
|
|
610
642
|
}
|
|
611
|
-
}, [e, a]), f =
|
|
612
|
-
const
|
|
613
|
-
if (
|
|
614
|
-
c.current = { sourceElement:
|
|
643
|
+
}, [e, a]), f = k(async (y) => {
|
|
644
|
+
const w = e?.element?.();
|
|
645
|
+
if (w) {
|
|
646
|
+
c.current = { sourceElement: w, args: y };
|
|
615
647
|
try {
|
|
616
|
-
await d(
|
|
617
|
-
} catch (
|
|
618
|
-
a.showError?.(
|
|
648
|
+
await d(y);
|
|
649
|
+
} catch (m) {
|
|
650
|
+
a.showError?.(m);
|
|
619
651
|
}
|
|
620
652
|
}
|
|
621
|
-
}, [e?.element, a]),
|
|
653
|
+
}, [e?.element, a]), _ = V(() => {
|
|
622
654
|
f({ isCut: !0 });
|
|
623
|
-
}, []),
|
|
655
|
+
}, []), g = k(async (y, w, m) => {
|
|
624
656
|
try {
|
|
625
|
-
if (await
|
|
626
|
-
s?.(
|
|
627
|
-
} catch (
|
|
628
|
-
a.showError?.(
|
|
657
|
+
if (await y.doPaste(w, m) === !1) return;
|
|
658
|
+
s?.(w, m);
|
|
659
|
+
} catch (A) {
|
|
660
|
+
a.showError?.(A);
|
|
629
661
|
}
|
|
630
|
-
}, [s]),
|
|
631
|
-
const
|
|
632
|
-
if (
|
|
633
|
-
const
|
|
634
|
-
if (
|
|
635
|
-
return await
|
|
636
|
-
} catch (
|
|
637
|
-
|
|
662
|
+
}, [s]), M = k(async (y, w, m) => {
|
|
663
|
+
const A = t?.element?.();
|
|
664
|
+
if (A && await q.whenFocus(A), !y && !w) return;
|
|
665
|
+
const S = await a.showBusy?.("Pasting...");
|
|
666
|
+
if (w) try {
|
|
667
|
+
return await g(t, w, m), void S?.();
|
|
668
|
+
} catch (x) {
|
|
669
|
+
S?.(), a.showError?.(x);
|
|
638
670
|
}
|
|
639
|
-
let
|
|
640
|
-
|
|
671
|
+
let T, I = t.importFromExternal;
|
|
672
|
+
I || (I = (x, E) => ({ getItemType: () => "text", toText: () => y.text, isClipboardItem: !0 }));
|
|
641
673
|
try {
|
|
642
|
-
|
|
643
|
-
} catch (
|
|
644
|
-
|
|
674
|
+
T = await I(y, { isCut: !1 });
|
|
675
|
+
} catch (x) {
|
|
676
|
+
S?.(), a.showError?.(x);
|
|
645
677
|
}
|
|
646
|
-
if (
|
|
647
|
-
const
|
|
648
|
-
await
|
|
649
|
-
} catch (
|
|
650
|
-
|
|
678
|
+
if (T) try {
|
|
679
|
+
const x = await Promise.resolve(T);
|
|
680
|
+
await g(t, x, m), S?.();
|
|
681
|
+
} catch (x) {
|
|
682
|
+
S?.(), a.showError?.(x);
|
|
651
683
|
}
|
|
652
|
-
else
|
|
653
|
-
}, [
|
|
684
|
+
else S?.();
|
|
685
|
+
}, [g, t, a]), P = k(async (y) => {
|
|
654
686
|
if (t?.element) try {
|
|
655
|
-
const
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
const
|
|
660
|
-
await
|
|
661
|
-
} catch (
|
|
662
|
-
if (
|
|
663
|
-
a.showError?.(
|
|
687
|
+
const w = await u.readReference();
|
|
688
|
+
if (w) return void await M(null, w, y);
|
|
689
|
+
const m = [];
|
|
690
|
+
m[0] = await ot.readStringFromClipboard(u, it.plain), m[1] = await ot.readHTMLFromClipboard(u, it.html), m[2] = await ot.readBlobFromClipboard(u, it.png);
|
|
691
|
+
const A = { text: m[0] ?? null, html: m[1] ?? null, image: m[2] ?? null };
|
|
692
|
+
await M(A, null, y);
|
|
693
|
+
} catch (w) {
|
|
694
|
+
if (w?.message === "Document is not focused.") return;
|
|
695
|
+
a.showError?.(w);
|
|
664
696
|
}
|
|
665
|
-
}, [
|
|
666
|
-
return
|
|
667
|
-
}, [e?.element]),
|
|
668
|
-
}, [t?.element,
|
|
697
|
+
}, [M, t?.element, a]);
|
|
698
|
+
return k(async (y) => {
|
|
699
|
+
}, [e?.element]), k(async (y) => {
|
|
700
|
+
}, [t?.element, M, a]), N(() => {
|
|
669
701
|
if (!u) return;
|
|
670
|
-
const
|
|
671
|
-
const
|
|
672
|
-
h?.(
|
|
673
|
-
},
|
|
674
|
-
a.showMessage?.(
|
|
675
|
-
},
|
|
676
|
-
a.showMessage?.(
|
|
702
|
+
const y = async (A) => {
|
|
703
|
+
const S = await u.readReference();
|
|
704
|
+
h?.(S);
|
|
705
|
+
}, w = (A) => {
|
|
706
|
+
a.showMessage?.(Ze.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
707
|
+
}, m = (A) => {
|
|
708
|
+
a.showMessage?.(Ze.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
677
709
|
};
|
|
678
|
-
return u.addEventListener("clipboardchange",
|
|
679
|
-
u.removeEventListener("clipboardchange",
|
|
710
|
+
return u.addEventListener("clipboardchange", y), u.addEventListener("clipboarderrorread", w), u.addEventListener("clipboarderrorwrite", m), () => {
|
|
711
|
+
u.removeEventListener("clipboardchange", y), u.removeEventListener("clipboarderrorread", w), u.removeEventListener("clipboarderrorwrite", m);
|
|
680
712
|
};
|
|
681
|
-
}, [u, a]),
|
|
682
|
-
}, [d,
|
|
683
|
-
r?.getCommand("cut")?.updateCallback(
|
|
684
|
-
}, [e, t, r]), { paste:
|
|
713
|
+
}, [u, a]), N(() => {
|
|
714
|
+
}, [d, M, e, t]), N(() => {
|
|
715
|
+
r?.getCommand("cut")?.updateCallback(_).update({ disabled: !e || !t }), r?.getCommand("copy")?.updateCallback(f).update({ disabled: !e }), r?.getCommand("paste")?.updateCallback(P).update({ disabled: !t });
|
|
716
|
+
}, [e, t, r]), { paste: P, copy: f, clipboard: u };
|
|
685
717
|
};
|
|
686
|
-
function
|
|
718
|
+
function Wo(i, e = !0) {
|
|
687
719
|
const t = O(i);
|
|
688
|
-
|
|
720
|
+
N(() => {
|
|
689
721
|
if (e) {
|
|
690
722
|
const n = Object.entries(i).reduce((o, [r, a]) => (t.current[r] !== a && (o[r] = [t.current[r], a]), o), {});
|
|
691
723
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
@@ -693,19 +725,19 @@ function Ko(i, e = !0) {
|
|
|
693
725
|
t.current = i;
|
|
694
726
|
});
|
|
695
727
|
}
|
|
696
|
-
let
|
|
697
|
-
var
|
|
698
|
-
const
|
|
699
|
-
const [i, e] =
|
|
700
|
-
return
|
|
701
|
-
i == null && e(
|
|
702
|
-
}, []),
|
|
703
|
-
|
|
728
|
+
let ct = !1, Wn = 0;
|
|
729
|
+
var Fn = typeof document < "u" ? _t : N;
|
|
730
|
+
const Tt = () => "sheetxl-ui-" + Wn++, kt = re.useId, Fo = kt ?? function() {
|
|
731
|
+
const [i, e] = re.useState(() => ct ? Tt() : void 0);
|
|
732
|
+
return Fn(() => {
|
|
733
|
+
i == null && e(Tt());
|
|
734
|
+
}, []), re.useEffect(() => {
|
|
735
|
+
ct || (ct = !0);
|
|
704
736
|
}, []), i;
|
|
705
|
-
},
|
|
706
|
-
function
|
|
737
|
+
}, jn = [];
|
|
738
|
+
function yt(i, e, t = jn) {
|
|
707
739
|
const n = O(null);
|
|
708
|
-
return
|
|
740
|
+
return fn(i, () => {
|
|
709
741
|
if (!n.current) return;
|
|
710
742
|
const o = n.current, r = e?.();
|
|
711
743
|
if (!r || typeof r != "object") throw new Error("attributes must return a plain object of values");
|
|
@@ -717,33 +749,33 @@ function _t(i, e, t = Nn) {
|
|
|
717
749
|
return o;
|
|
718
750
|
}, t), n;
|
|
719
751
|
}
|
|
720
|
-
const
|
|
721
|
-
const n =
|
|
752
|
+
const Pt = "Undo the last action.", Dt = "Repeat the last action or undo the redo.", Un = (i) => `Redo ${i}`, jo = ({ manager: i, commands: e, disabled: t }) => {
|
|
753
|
+
const n = Qe(), o = k((a) => {
|
|
722
754
|
try {
|
|
723
755
|
i?.undo(a);
|
|
724
756
|
} catch (h) {
|
|
725
757
|
n.error(h);
|
|
726
758
|
}
|
|
727
|
-
}, [i]), r =
|
|
759
|
+
}, [i]), r = k((a) => {
|
|
728
760
|
try {
|
|
729
761
|
i?.redo(a);
|
|
730
762
|
} catch (h) {
|
|
731
763
|
n.error(h);
|
|
732
764
|
}
|
|
733
765
|
}, [i]);
|
|
734
|
-
return
|
|
766
|
+
return R(() => {
|
|
735
767
|
if (!e) return;
|
|
736
768
|
const a = { contains: (s) => !0, focus() {
|
|
737
|
-
} }, h = [new
|
|
769
|
+
} }, h = [new pt("undo", a, { label: "Undo", description: Pt, shortcut: { key: "z", modifiers: [Y.Ctrl] }, disabled: !0 }, o), new pt("redo", a, { label: "Redo", description: Dt, shortcut: [{ key: "y", modifiers: [Y.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Y.Alt] }], disabled: !0 }, r)];
|
|
738
770
|
e?.addCommands(h, !0);
|
|
739
|
-
}, [e]),
|
|
771
|
+
}, [e]), N(() => {
|
|
740
772
|
if (!e) return;
|
|
741
773
|
const a = () => {
|
|
742
774
|
const s = i?.getTopUndoDescription(), l = {};
|
|
743
775
|
var c;
|
|
744
|
-
e.getCommand("undo").update({ disabled: t || !i || !i.hasUndo(), description: s ? (c = s, `Undo ${c}`) :
|
|
776
|
+
e.getCommand("undo").update({ disabled: t || !i || !i.hasUndo(), description: s ? (c = s, `Undo ${c}`) : Pt, state: l, context: { undoManager: i } });
|
|
745
777
|
const u = i?.getTopRedoDescription();
|
|
746
|
-
e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ?
|
|
778
|
+
e.getCommand("redo").update({ disabled: t || !i || !i.hasRedo(), description: u ? Un(u) : Dt, state: l, context: { undoManager: i } });
|
|
747
779
|
};
|
|
748
780
|
if (a(), !i) return;
|
|
749
781
|
const h = i.addListener({ onStackChange() {
|
|
@@ -751,121 +783,142 @@ const Tt = "Undo the last action.", kt = "Repeat the last action or undo the red
|
|
|
751
783
|
} });
|
|
752
784
|
return () => h?.();
|
|
753
785
|
}, [i, e, t]), { undo: o, redo: r };
|
|
754
|
-
},
|
|
755
|
-
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ?
|
|
756
|
-
return C("button", { style: e, className: le(
|
|
757
|
-
},
|
|
758
|
-
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ?
|
|
759
|
-
return C("button", { style: e, className: le(
|
|
760
|
-
},
|
|
786
|
+
}, Xn = "_scrollbar_1v478_17", Yn = "_vsb-track_1v478_27", Gn = "_vsb-thumb_1v478_39", en = "_scrollbar-button_1v478_80", tn = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", nn = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", Zn = { transform: "rotate(180deg)" }, qn = (i) => {
|
|
787
|
+
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ? tn : nn;
|
|
788
|
+
return C("button", { style: e, className: le(en, t, "scroll-button"), disabled: n, ...o, children: C("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: C("path", { d: r }) }) });
|
|
789
|
+
}, Qn = (i) => {
|
|
790
|
+
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ? tn : nn;
|
|
791
|
+
return C("button", { style: e, className: le(en, t, "scroll-button"), disabled: n, ...o, children: C("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: Zn, children: C("path", { d: r }) }) });
|
|
792
|
+
}, Uo = (i) => {
|
|
761
793
|
const { style: e, orientation: t = ae.Vertical, ...n } = i, o = t === ae.Vertical;
|
|
762
794
|
return C("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${o ? "vertical" : "horizontal"} edge`, ...n, children: C("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: o ? "rotate(90) " : "", children: C("path", { style: { transition: "opacity 240ms ease 0s", opacity: i.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" }) }) });
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
const [
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
795
|
+
};
|
|
796
|
+
let je = 0;
|
|
797
|
+
function Xo() {
|
|
798
|
+
const [i, e] = F(!!document.fullscreenElement), t = V(() => {
|
|
799
|
+
const n = document.fullscreenElement;
|
|
800
|
+
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
801
|
+
}, []);
|
|
802
|
+
return N(() => {
|
|
803
|
+
function n() {
|
|
804
|
+
const o = document.fullscreenElement;
|
|
805
|
+
if (e(!!o), !o) return;
|
|
806
|
+
let r = o.querySelector(".fullscreen-portal-root");
|
|
807
|
+
r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
|
|
808
|
+
}
|
|
809
|
+
return je++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
810
|
+
document.removeEventListener("fullscreenchange", n), je--, je <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
|
|
811
|
+
o.parentNode && o.parentNode.removeChild(o);
|
|
812
|
+
}), je = 0);
|
|
813
|
+
};
|
|
814
|
+
}, []), { getPortalContainer: t, isFullscreen: i };
|
|
815
|
+
}
|
|
816
|
+
const Jn = 24, eo = we(ke((i, e) => {
|
|
817
|
+
const { offset: t = 0, totalSize: n = 0, viewportSize: o = 0, style: r, className: a, orientation: h = ae.Vertical, onScrollOffset: s, onScroll: l, showCustomScrollButtons: c = !0, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: _ = Jn, maxThumbSize: g, createScrollStartButton: M = qn, createScrollEndButton: P = Qn, usePortal: y = !1, ...w } = i;
|
|
818
|
+
k(l, [l]);
|
|
819
|
+
const [m, A] = F({ offset: 0, length: 0 }), S = O(-1), T = h === ae.Vertical, [I, { width: x, height: E }] = ve(), z = T ? E : x, L = k((b, $, U) => {
|
|
820
|
+
if ($ === 0 || U === 0) return void A({ offset: 0, length: _ });
|
|
821
|
+
const me = U / z, _e = $ / me, ze = Math.min(Math.max(_, _e), Math.min(z, g ?? Number.MAX_SAFE_INTEGER)), tt = b / me;
|
|
822
|
+
return { offset: Math.min(Math.max(0, tt), z - ze), length: ze };
|
|
823
|
+
}, [z, _, g]), D = k((b) => {
|
|
824
|
+
const $ = n / z, U = Math.round(b * $);
|
|
825
|
+
A(L(U, o, n)), s?.(U, o, n), S.current = b;
|
|
826
|
+
}, [s, o, n, z, m]), p = k((b) => {
|
|
827
|
+
A(L(b, o, n)), s?.(b, o, n), S.current = b;
|
|
775
828
|
}, [s, o, n]);
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}, [t]),
|
|
779
|
-
|
|
780
|
-
}, [o, n,
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
}, [
|
|
784
|
-
if (!
|
|
785
|
-
const
|
|
786
|
-
|
|
787
|
-
}, [
|
|
829
|
+
N(() => {
|
|
830
|
+
S.current !== t && z !== 0 && (S.current = -1, A(L(t, o, n)));
|
|
831
|
+
}, [t]), N(() => {
|
|
832
|
+
z !== 0 && A(L(t, o, n));
|
|
833
|
+
}, [o, n, T, z]);
|
|
834
|
+
const v = Math.max(0, n - o), [K, G] = F(!1), j = O(0), Q = O(0), Z = yt(e, () => ({ isScrollbar: () => !0 }), []), W = k((b) => {
|
|
835
|
+
b.currentTarget.setPointerCapture(b.pointerId), G(!0), j.current = T ? b.clientY : b.clientX, Q.current = m.offset, b.preventDefault(), b.stopPropagation();
|
|
836
|
+
}, [T, m]), oe = k((b) => {
|
|
837
|
+
if (!K) return;
|
|
838
|
+
const $ = (T ? b.clientY : b.clientX) - j.current, U = Q.current + $;
|
|
839
|
+
D(U);
|
|
840
|
+
}, [K, T]), J = k((b) => {
|
|
788
841
|
try {
|
|
789
|
-
|
|
842
|
+
b.currentTarget.releasePointerCapture(b.pointerId);
|
|
790
843
|
} catch {
|
|
791
844
|
}
|
|
792
|
-
|
|
793
|
-
}, []),
|
|
794
|
-
if (!
|
|
795
|
-
const
|
|
796
|
-
|
|
797
|
-
}, [
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
}, [
|
|
801
|
-
let
|
|
802
|
-
|
|
803
|
-
const
|
|
804
|
-
return
|
|
805
|
-
}, [u, t, o, n]),
|
|
806
|
-
let
|
|
807
|
-
|
|
808
|
-
const
|
|
809
|
-
return
|
|
810
|
-
}, [u, t,
|
|
811
|
-
|
|
812
|
-
}, []),
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
},
|
|
817
|
-
}, [
|
|
818
|
-
|
|
819
|
-
const Je =
|
|
845
|
+
G(!1);
|
|
846
|
+
}, []), be = k((b) => {
|
|
847
|
+
if (!b.currentTarget) return;
|
|
848
|
+
const $ = b.currentTarget.getBoundingClientRect(), U = T ? b.clientY - $.top : b.clientX - $.left;
|
|
849
|
+
D(U);
|
|
850
|
+
}, [T, m, o, n]), xe = k((b) => {
|
|
851
|
+
const $ = Math.max(1, Math.floor(0.9 * o));
|
|
852
|
+
T ? (b.key === "ArrowDown" && D(Math.min(v, t + 1)), b.key === "ArrowUp" && D(Math.max(0, t - 1)), b.key === "PageDown" && D(Math.min(v, t + $)), b.key === "PageUp" && D(Math.max(0, t - $)), b.key === "Home" && D(0), b.key === "End" && D(v)) : (b.key === "ArrowRight" && D(Math.min(v, t + 1)), b.key === "ArrowLeft" && D(Math.max(0, t - 1)), b.key === "PageDown" && D(Math.min(v, t + $)), b.key === "PageUp" && D(Math.max(0, t - $)), b.key === "Home" && D(0), b.key === "End" && D(v));
|
|
853
|
+
}, [T, o, n, t, v]), Se = O(null), pe = R(() => C("div", { className: le(Gn), ref: Se, role: "slider", "aria-label": T ? "Rows" : "Columns", "aria-orientation": T ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": v, "aria-valuenow": t, tabIndex: 0, style: { position: y ? "fixed" : "relative", [T ? "height" : "width"]: `${m.length}px`, [T ? "width" : "height"]: "100%", transform: T ? `translateY(${m.offset}px)` : `translateX(${m.offset}px)`, [T ? "minHeight" : "minWidth"]: `${_}px` }, onPointerDown: W, onPointerMove: oe, onPointerUp: J }), [m, _, v, t, T, !1]), [Re, Ne] = F(null), He = k(() => {
|
|
854
|
+
let b;
|
|
855
|
+
b = typeof u == "function" ? u(t, o, n) : t - u;
|
|
856
|
+
const $ = Math.max(0, b);
|
|
857
|
+
return p($), Ne($), $;
|
|
858
|
+
}, [u, t, o, n]), Pe = k(() => {
|
|
859
|
+
let b;
|
|
860
|
+
b = typeof u == "function" ? u(t, o, n) : t + u;
|
|
861
|
+
const $ = Math.min(v, b);
|
|
862
|
+
return p($), Ne($), $;
|
|
863
|
+
}, [u, t, v, o, n]), fe = O(null), Ee = O(null), se = V(() => {
|
|
864
|
+
fe.current && (clearTimeout(fe.current), fe.current = null, Ee.current = null);
|
|
865
|
+
}, []), De = V((b, $, U, me = d) => {
|
|
866
|
+
Ee.current = b, fe.current = setTimeout(() => {
|
|
867
|
+
const _e = U ? He() : Pe();
|
|
868
|
+
_e !== Ee.current ? De(_e, !1, U, f) : se();
|
|
869
|
+
}, $ ? 0 : me);
|
|
870
|
+
}, [He, Pe, se]);
|
|
871
|
+
N(() => () => se(), [se]);
|
|
872
|
+
const Je = R(() => {
|
|
820
873
|
if (!c) return null;
|
|
821
|
-
const
|
|
822
|
-
return
|
|
823
|
-
}, [c, h, t,
|
|
874
|
+
const b = { orientation: h, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => De(t, !0, !0) };
|
|
875
|
+
return M?.(b);
|
|
876
|
+
}, [c, h, t, Re]), et = R(() => {
|
|
824
877
|
if (!c) return null;
|
|
825
|
-
const
|
|
826
|
-
return
|
|
827
|
-
}, [c, h, t,
|
|
828
|
-
return
|
|
878
|
+
const b = { orientation: h, disabled: t >= v, onMouseUp: se, onMouseLeave: se, onMouseDown: () => De(t, !0, !1) };
|
|
879
|
+
return P?.(b);
|
|
880
|
+
}, [c, h, t, v, Re]), Ae = T ? "vertical" : "horizontal";
|
|
881
|
+
return Ce("div", { ref: $e([Z, e]), className: le(a, Xn, Ae, { dragging: K }), style: r, ...w, children: [Je, C("div", { ref: I, role: "scrollbar", "aria-orientation": Ae, "aria-valuemin": 0, "aria-valuemax": v, "aria-valuenow": t, tabIndex: 0, className: le(Yn, "track", Ae), onPointerDown: be, onKeyDown: xe, children: y ? null : pe }), y ? gn(pe, document.body) : null, et] });
|
|
829
882
|
}));
|
|
830
|
-
let
|
|
831
|
-
const
|
|
883
|
+
let At = Date.now, zt = 1e3, de = {}, to = 1;
|
|
884
|
+
const Oe = (i) => {
|
|
832
885
|
let e = de[i] !== null;
|
|
833
886
|
return e && (de[i] = null), e;
|
|
834
|
-
},
|
|
835
|
-
let r =
|
|
887
|
+
}, Bt = (i, e, t, n = 0, o) => {
|
|
888
|
+
let r = At(), a = r, h = 0, s = 0, l = 0, c = to++;
|
|
836
889
|
if (c % 20 == 0) {
|
|
837
890
|
const d = {};
|
|
838
891
|
for (let f in de) d[f] = !0;
|
|
839
892
|
de = d;
|
|
840
893
|
}
|
|
841
894
|
const u = function(d) {
|
|
842
|
-
let f = d !== !0,
|
|
895
|
+
let f = d !== !0, _ = At(), g = !0;
|
|
843
896
|
try {
|
|
844
|
-
|
|
897
|
+
g = (!e || e(c)) ?? !0;
|
|
845
898
|
} catch {
|
|
846
|
-
|
|
899
|
+
g = !1;
|
|
847
900
|
}
|
|
848
|
-
if (!de[c] || !
|
|
901
|
+
if (!de[c] || !g) return de[c] = null, void t?.(60 - s / ((_ - r) / zt), c, !1);
|
|
849
902
|
if (f) {
|
|
850
|
-
l = Math.round((
|
|
851
|
-
for (let
|
|
903
|
+
l = Math.round((_ - a) / 16.666666666666668) - 1;
|
|
904
|
+
for (let y = 0; y < Math.min(l, 4); y++) u(!0), s++;
|
|
852
905
|
}
|
|
853
|
-
n && (h = (
|
|
854
|
-
let
|
|
906
|
+
n && (h = (_ - r) / n, h > 1 && (h = 1));
|
|
907
|
+
let M = o ? o(h) : h, P = !1;
|
|
855
908
|
try {
|
|
856
|
-
|
|
909
|
+
P = i(M, _, f);
|
|
857
910
|
} catch {
|
|
858
|
-
|
|
911
|
+
P = !1;
|
|
859
912
|
}
|
|
860
|
-
|
|
913
|
+
P !== !1 && h !== 1 || !f ? f && (a = _, requestAnimationFrame(u)) : (de[c] = null, t?.(60 - s / ((_ - r) / zt), c, h === 1 || n == null));
|
|
861
914
|
};
|
|
862
915
|
return de[c] = !0, requestAnimationFrame(u), c;
|
|
863
|
-
},
|
|
916
|
+
}, no = function(i) {
|
|
864
917
|
return Math.pow(i - 1, 3) + 1;
|
|
865
|
-
},
|
|
918
|
+
}, oo = function(i) {
|
|
866
919
|
return (i /= 0.5) < 1 ? 0.5 * Math.pow(i, 3) : 0.5 * (Math.pow(i - 2, 3) + 2);
|
|
867
920
|
};
|
|
868
|
-
class
|
|
921
|
+
class io {
|
|
869
922
|
constructor(e, t) {
|
|
870
923
|
this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = e, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t };
|
|
871
924
|
}
|
|
@@ -890,7 +943,7 @@ class eo {
|
|
|
890
943
|
}
|
|
891
944
|
zoomTo(e, t = !1, n, o, r) {
|
|
892
945
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
893
|
-
r && (this.__zoomComplete = r), this.__isDecelerating && (
|
|
946
|
+
r && (this.__zoomComplete = r), this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0);
|
|
894
947
|
const a = this.__zoomLevel;
|
|
895
948
|
n === void 0 && (n = this.__clientWidth / 2), o === void 0 && (o = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
|
|
896
949
|
const h = e / a;
|
|
@@ -901,7 +954,7 @@ class eo {
|
|
|
901
954
|
this.zoomTo(this.__zoomLevel * e, t, n, o, r);
|
|
902
955
|
}
|
|
903
956
|
scrollTo(e, t, n = !1, o = 1) {
|
|
904
|
-
if (this.__isDecelerating && (
|
|
957
|
+
if (this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0), o !== void 0 && o !== this.__zoomLevel) {
|
|
905
958
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
906
959
|
e *= o, t *= o, this.__computeScrollMax(o);
|
|
907
960
|
} else o = this.__zoomLevel;
|
|
@@ -919,7 +972,7 @@ class eo {
|
|
|
919
972
|
if (e.length === void 0) throw new Error("Invalid touch list: " + e);
|
|
920
973
|
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
921
974
|
let n, o;
|
|
922
|
-
this.__interruptedAnimation = !0, this.__isDecelerating && (
|
|
975
|
+
this.__interruptedAnimation = !0, this.__isDecelerating && (Oe(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && (Oe(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
|
|
923
976
|
let r = e.length === 1;
|
|
924
977
|
r ? (n = e[0].pageX, o = e[0].pageY) : (n = Math.abs(e[0].pageX + e[1].pageX) / 2, o = Math.abs(e[0].pageY + e[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = o, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = o, this.__lastTouchMove = t, this.__lastScale = 1, this.__enableScrollX = !r && this.options.scrollingX, this.__enableScrollY = !r && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !r, this.__isSingleTouch = r, this.__positions = [];
|
|
925
978
|
}
|
|
@@ -935,8 +988,8 @@ class eo {
|
|
|
935
988
|
if (n !== void 0 && this.options.zooming) {
|
|
936
989
|
let d = u;
|
|
937
990
|
if (u = u / this.__lastScale * n, u = Math.max(Math.min(u, this.options.maxZoom), this.options.minZoom), d !== u) {
|
|
938
|
-
let f = o - this.__clientLeft,
|
|
939
|
-
l = (f + l) * u / d - f, c = (
|
|
991
|
+
let f = o - this.__clientLeft, _ = r - this.__clientTop;
|
|
992
|
+
l = (f + l) * u / d - f, c = (_ + c) * u / d - _, this.__computeScrollMax(u);
|
|
940
993
|
}
|
|
941
994
|
}
|
|
942
995
|
if (this.__enableScrollX) {
|
|
@@ -974,16 +1027,16 @@ class eo {
|
|
|
974
1027
|
}
|
|
975
1028
|
__publish(e, t, n, o = !1) {
|
|
976
1029
|
const r = this.__isAnimating;
|
|
977
|
-
if (r && (
|
|
1030
|
+
if (r && (Oe(r), this.__isAnimating = 0), o && this.options.animating) {
|
|
978
1031
|
this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
|
|
979
|
-
const a = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = e - a, c = t - h, u = n - s, d = function(
|
|
980
|
-
|
|
981
|
-
}.bind(this), f = function(
|
|
982
|
-
return this.__isAnimating ===
|
|
983
|
-
}.bind(this),
|
|
984
|
-
|
|
1032
|
+
const a = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = e - a, c = t - h, u = n - s, d = function(g, M, P) {
|
|
1033
|
+
P && (this.__scrollLeft = a + l * g, this.__scrollTop = h + c * g, this.__zoomLevel = s + u * g, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
1034
|
+
}.bind(this), f = function(g) {
|
|
1035
|
+
return this.__isAnimating === g;
|
|
1036
|
+
}.bind(this), _ = function(g, M, P) {
|
|
1037
|
+
M === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || P) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
985
1038
|
}.bind(this);
|
|
986
|
-
this.__isAnimating =
|
|
1039
|
+
this.__isAnimating = Bt(d, f, _, this.options.animationDuration, r ? no : oo);
|
|
987
1040
|
} else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
988
1041
|
}
|
|
989
1042
|
__computeScrollMax(e = this.__zoomLevel) {
|
|
@@ -1002,7 +1055,7 @@ class eo {
|
|
|
1002
1055
|
}.bind(this), r = function(a, h, s) {
|
|
1003
1056
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1004
1057
|
}.bind(this);
|
|
1005
|
-
this.__isDecelerating =
|
|
1058
|
+
this.__isDecelerating = Bt(t, o, r);
|
|
1006
1059
|
}
|
|
1007
1060
|
__stepThroughDeceleration(e) {
|
|
1008
1061
|
let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
@@ -1018,7 +1071,7 @@ class eo {
|
|
|
1018
1071
|
}
|
|
1019
1072
|
}
|
|
1020
1073
|
}
|
|
1021
|
-
const
|
|
1074
|
+
const Ke = (i, e) => C(eo, { ...i, ref: e }), Yo = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ke, getScrollTo: (i, e, t, n, o = 0) => {
|
|
1022
1075
|
for (let r = 0; r < t.length; r++) {
|
|
1023
1076
|
const a = t[r].getBoundingClientRect();
|
|
1024
1077
|
let h = a.left - e, s = h + a.width;
|
|
@@ -1027,90 +1080,70 @@ const $e = (i, e) => C(Zn, { ...i, ref: e }), No = Object.freeze(Object.definePr
|
|
|
1027
1080
|
} else if (Math.ceil(s) > Math.ceil(i) + 2) return s;
|
|
1028
1081
|
}
|
|
1029
1082
|
return o;
|
|
1030
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1031
|
-
const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: a = !0, createScrollCorner: h =
|
|
1032
|
-
|
|
1033
|
-
|
|
1083
|
+
} }, Symbol.toStringTag, { value: "Module" })), ro = ({ width: i, height: e }) => C("div", { className: "corner", style: { minWidth: `${i}px`, width: `${i}px`, minHeight: `${e}px`, height: `${e}px` } }), so = we(ke((i, e) => {
|
|
1084
|
+
const { children: t, viewport: n, onScrollViewport: o, showHorizontalScrollbar: r = !0, showVerticalScrollbar: a = !0, createScrollCorner: h = ro, createHorizontalScrollbar: s = Ke, createVerticalScrollbar: l = Ke, style: c, touchElement: u, disableTouch: d, ...f } = i, _ = r && s, g = a && l, M = k(o, [o]), P = yt(e, () => ({ isScrollPane: () => !0 }), []), y = O(null);
|
|
1085
|
+
N(() => {
|
|
1086
|
+
y.current && (y.current.__scrollTop === n?.top && y.current.__scrollLeft === n?.left || y.current.__isDecelerating || y.current?.scrollTo(n?.left, n?.top, !1));
|
|
1034
1087
|
}, [n?.left, n?.top, u]);
|
|
1035
|
-
const
|
|
1036
|
-
|
|
1037
|
-
}, []),
|
|
1038
|
-
|
|
1039
|
-
}, []),
|
|
1040
|
-
p.preventDefault(),
|
|
1041
|
-
}, []),
|
|
1042
|
-
|
|
1043
|
-
}, []),
|
|
1044
|
-
|
|
1088
|
+
const w = V((p, v) => {
|
|
1089
|
+
M?.({ left: p, top: v });
|
|
1090
|
+
}, []), m = V((p) => {
|
|
1091
|
+
y.current?.doTouchStart(p.touches, p.timeStamp);
|
|
1092
|
+
}, []), A = V((p) => {
|
|
1093
|
+
p.preventDefault(), y.current?.doTouchMove(p.touches, p.timeStamp);
|
|
1094
|
+
}, []), S = V((p) => {
|
|
1095
|
+
y.current?.doTouchEnd(p.timeStamp);
|
|
1096
|
+
}, []), T = V(({ containerWidth: p, containerHeight: v, totalWidth: K, totalHeight: G }) => {
|
|
1097
|
+
y.current.setDimensions(p, v, K, G);
|
|
1045
1098
|
}, []);
|
|
1046
|
-
|
|
1047
|
-
const p = u ??
|
|
1048
|
-
if (!d &&
|
|
1049
|
-
if (!
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1099
|
+
N(() => {
|
|
1100
|
+
const p = u ?? P.current;
|
|
1101
|
+
if (!d && mt().supportsTouchEvents && p && n) {
|
|
1102
|
+
if (!y.current) {
|
|
1103
|
+
const v = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1104
|
+
y.current = new io(w, v);
|
|
1052
1105
|
}
|
|
1053
|
-
|
|
1106
|
+
mt().supportsTouchEvents && (p.addEventListener("touchstart", m), p.addEventListener("touchend", S), p.addEventListener("touchmove", A)), T({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
1054
1107
|
}
|
|
1055
1108
|
return () => {
|
|
1056
|
-
p?.removeEventListener("touchstart",
|
|
1109
|
+
p?.removeEventListener("touchstart", m), p?.removeEventListener("touchend", S), p?.removeEventListener("touchmove", A);
|
|
1057
1110
|
};
|
|
1058
1111
|
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, d, u]);
|
|
1059
|
-
const [
|
|
1060
|
-
if (!
|
|
1061
|
-
const p = l({ orientation: ae.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (
|
|
1062
|
-
|
|
1112
|
+
const [I, { width: x }] = ve(), [E, { height: z }] = ve(), L = R(() => {
|
|
1113
|
+
if (!g) return null;
|
|
1114
|
+
const p = l({ orientation: ae.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (v) => {
|
|
1115
|
+
M?.({ top: v });
|
|
1063
1116
|
} });
|
|
1064
|
-
return C("div", { style: { display: "flex", flex: "0" }, ref:
|
|
1065
|
-
}, [l, n?.top, n?.height, n?.totalHeight]),
|
|
1066
|
-
if (!
|
|
1067
|
-
const p = s({ orientation: ae.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (
|
|
1068
|
-
|
|
1117
|
+
return C("div", { style: { display: "flex", flex: "0" }, ref: I, children: p });
|
|
1118
|
+
}, [l, n?.top, n?.height, n?.totalHeight]), D = R(() => {
|
|
1119
|
+
if (!_) return null;
|
|
1120
|
+
const p = s({ orientation: ae.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (v) => {
|
|
1121
|
+
M?.({ left: v });
|
|
1069
1122
|
} });
|
|
1070
|
-
return
|
|
1071
|
-
}, [s, n?.left, n?.width, n?.totalWidth,
|
|
1072
|
-
return C("div", { style: { position: "relative", display: "flex", minWidth:
|
|
1123
|
+
return Ce("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [C("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${x}px)` }, children: C("div", { ref: E, className: "sizer", children: p }) }), g ? h({ width: x, height: z }) : C(Me, {})] });
|
|
1124
|
+
}, [s, n?.left, n?.width, n?.totalWidth, g, h, x, z]);
|
|
1125
|
+
return C("div", { style: { position: "relative", display: "flex", minWidth: g ? `${x}px` : void 0, minHeight: _ ? `${z}px` : void 0, ...c }, ...f, ref: P, children: Ce("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [Ce("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [C("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: t }), g ? L : C(Me, {})] }), _ ? D : C(Me, {})] }) });
|
|
1073
1126
|
}));
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
const [i, e] = Y(!!document.fullscreenElement), t = V(() => {
|
|
1078
|
-
const n = document.fullscreenElement;
|
|
1079
|
-
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
1080
|
-
}, []);
|
|
1081
|
-
return I(() => {
|
|
1082
|
-
function n() {
|
|
1083
|
-
const o = document.fullscreenElement;
|
|
1084
|
-
if (e(!!o), !o) return;
|
|
1085
|
-
let r = o.querySelector(".fullscreen-portal-root");
|
|
1086
|
-
r || (r = document.createElement("div"), r.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", o.appendChild(r));
|
|
1087
|
-
}
|
|
1088
|
-
return Fe++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
1089
|
-
document.removeEventListener("fullscreenchange", n), Fe--, Fe <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((o) => {
|
|
1090
|
-
o.parentNode && o.parentNode.removeChild(o);
|
|
1091
|
-
}), Fe = 0);
|
|
1092
|
-
};
|
|
1093
|
-
}, []), { getPortalContainer: t, isFullscreen: i };
|
|
1094
|
-
}
|
|
1095
|
-
const oo = 300, io = 100, ro = 1e6, so = 100, lo = 50, ao = ve(Pe((i, e) => {
|
|
1096
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: a = oo, endScrollIncrement: h = io, style: s = Xt, onMouseDown: l, onScrollOffset: c, onScroll: u, scaleLimit: d = ro, scaleFactor: f = so, precisionFactor: b = lo, createScrollbar: _ = $e, ...k } = i;
|
|
1127
|
+
so.displayName = "ScrollPane";
|
|
1128
|
+
const lo = 300, ao = 100, co = 1e6, ho = 100, uo = 50, po = we(ke((i, e) => {
|
|
1129
|
+
const { offset: t = 0, viewportSize: n = 0, totalSize: o = 0, minSize: r = 0, endGap: a = lo, endScrollIncrement: h = ao, style: s = qt, onMouseDown: l, onScrollOffset: c, onScroll: u, scaleLimit: d = co, scaleFactor: f = ho, precisionFactor: _ = uo, createScrollbar: g = Ke, ...M } = i;
|
|
1097
1130
|
u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1098
|
-
const
|
|
1099
|
-
const
|
|
1100
|
-
return { offset: Math.ceil(t /
|
|
1101
|
-
}, [t, o, n,
|
|
1102
|
-
const
|
|
1103
|
-
Math.abs(
|
|
1104
|
-
}, [c,
|
|
1105
|
-
}, []),
|
|
1106
|
-
document.removeEventListener("mousemove",
|
|
1107
|
-
}, []),
|
|
1108
|
-
|
|
1109
|
-
}, [
|
|
1110
|
-
return
|
|
1131
|
+
const P = k(l, [l]), [y, w] = F(!1), m = R(() => {
|
|
1132
|
+
const x = d === 0 ? o : Math.min(o ?? 0, Math.max(r ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)), E = d !== 0 && x > d ? f : 1, z = E / _, L = Math.ceil(x / E);
|
|
1133
|
+
return { offset: Math.ceil(t / E), totalSize: L, viewportSize: Math.ceil(n / E), scaledOffset: t, scaledTotalSize: o, scaledViewportSize: n, factor: E, precision: z };
|
|
1134
|
+
}, [t, o, n, y, r, a, h]), A = k((x, E, z) => {
|
|
1135
|
+
const L = m.offset;
|
|
1136
|
+
Math.abs(x - L) < m.precision && (x = L), c?.(x * m.factor, L, m.viewportSize);
|
|
1137
|
+
}, [c, m]), S = V((x) => {
|
|
1138
|
+
}, []), T = V((x) => {
|
|
1139
|
+
document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", T), w(!1);
|
|
1140
|
+
}, []), I = V((x) => {
|
|
1141
|
+
w(!0), P?.(x), document.addEventListener("mousemove", S, { passive: !0 }), document.addEventListener("mouseup", T, { passive: !0 });
|
|
1142
|
+
}, [S, T]);
|
|
1143
|
+
return Ke({ style: s, ...M, offset: m.offset, totalSize: m.totalSize, viewportSize: m.viewportSize, onMouseDown: I, onScrollOffset: A }, e);
|
|
1111
1144
|
}));
|
|
1112
|
-
|
|
1113
|
-
const
|
|
1145
|
+
po.displayName = "VirtualScrollbar";
|
|
1146
|
+
const Go = { 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" }, Zo = we(ke((i, e) => {
|
|
1114
1147
|
const { refFocusStart: t, ...n } = i, o = O(null), r = V(() => {
|
|
1115
1148
|
if (t) return void t?.current?.focus();
|
|
1116
1149
|
const a = o.current.parentElement.children;
|
|
@@ -1124,60 +1157,60 @@ const Vo = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bott
|
|
|
1124
1157
|
return l.tabindex - c.tabindex;
|
|
1125
1158
|
}), h[0].child.focus());
|
|
1126
1159
|
}, [t]);
|
|
1127
|
-
return C("div", { tabIndex: 0, ref:
|
|
1128
|
-
})),
|
|
1129
|
-
const { className: t, style: n, children: o, radius: r = 4, strokeWidth: a = 1, strokeColor: h = "grey", ...s } = i, [l, { width: c, height: u }] =
|
|
1130
|
-
const
|
|
1131
|
-
return (function(
|
|
1132
|
-
if (
|
|
1133
|
-
function
|
|
1134
|
-
let
|
|
1135
|
-
return
|
|
1160
|
+
return C("div", { tabIndex: 0, ref: $e([o, e]), onFocus: r, ...n });
|
|
1161
|
+
})), qo = we(ke((i, e) => {
|
|
1162
|
+
const { className: t, style: n, children: o, radius: r = 4, strokeWidth: a = 1, strokeColor: h = "grey", ...s } = i, [l, { width: c, height: u }] = ve(), d = O(null), f = (P, y = 0) => {
|
|
1163
|
+
const w = P / 2, m = u - w + y;
|
|
1164
|
+
return (function(A, S, T = !1) {
|
|
1165
|
+
if (S === 0) return A;
|
|
1166
|
+
function I(p, v, K) {
|
|
1167
|
+
let G = v.x - p.x, j = v.y - p.y, Q = Math.sqrt(G * G + j * j);
|
|
1168
|
+
return x(p, v, Math.min(1, K / Q));
|
|
1136
1169
|
}
|
|
1137
|
-
function
|
|
1138
|
-
return { x: p.x + (
|
|
1170
|
+
function x(p, v, K) {
|
|
1171
|
+
return { x: p.x + (v.x - p.x) * K, y: p.y + (v.y - p.y) * K };
|
|
1139
1172
|
}
|
|
1140
|
-
function
|
|
1141
|
-
p.length > 2 && (p[p.length - 2] =
|
|
1173
|
+
function E(p, v) {
|
|
1174
|
+
p.length > 2 && (p[p.length - 2] = v.x, p[p.length - 1] = v.y);
|
|
1142
1175
|
}
|
|
1143
|
-
function
|
|
1176
|
+
function z(p) {
|
|
1144
1177
|
return { x: parseFloat(p[p.length - 2]), y: parseFloat(p[p.length - 1]) };
|
|
1145
1178
|
}
|
|
1146
|
-
let
|
|
1147
|
-
let
|
|
1148
|
-
return
|
|
1149
|
-
}, []).reduce(function(p,
|
|
1150
|
-
return parseFloat(
|
|
1151
|
-
}, []),
|
|
1152
|
-
if (
|
|
1153
|
-
let p =
|
|
1154
|
-
|
|
1155
|
-
for (let
|
|
1156
|
-
let
|
|
1157
|
-
if (
|
|
1158
|
-
let
|
|
1159
|
-
|
|
1160
|
-
let
|
|
1161
|
-
|
|
1162
|
-
} else
|
|
1179
|
+
let L = A.split(/[,\s]/).reduce(function(p, v) {
|
|
1180
|
+
let K = v.match("([a-zA-Z])(.+)");
|
|
1181
|
+
return K ? (p.push(K[1]), p.push(K[2])) : p.push(v), p;
|
|
1182
|
+
}, []).reduce(function(p, v) {
|
|
1183
|
+
return parseFloat(v) == v && p.length ? p[p.length - 1].push(v) : p.push([v]), p;
|
|
1184
|
+
}, []), D = [];
|
|
1185
|
+
if (L.length > 1) {
|
|
1186
|
+
let p = z(L[0]), v = null;
|
|
1187
|
+
L[L.length - 1][0] === "Z" && L[0].length > 2 && (v = ["L", p.x, p.y], L[L.length - 1] = v), D.push(L[0]);
|
|
1188
|
+
for (let K = 1; K < L.length; K++) {
|
|
1189
|
+
let G = D[D.length - 1], j = L[K], Q = j === v ? L[1] : L[K + 1];
|
|
1190
|
+
if (Q && G && G.length > 2 && j[0] === "L" && Q.length > 2 && Q[0] === "L") {
|
|
1191
|
+
let Z, W, oe = z(G), J = z(j), be = z(Q);
|
|
1192
|
+
T ? (Z = x(J, G.origPoint || oe, S), W = x(J, Q.origPoint || be, S)) : (Z = I(J, oe, S), W = I(J, be, S)), E(j, Z), j.origPoint = J, D.push(j);
|
|
1193
|
+
let xe = x(Z, J, 0.5), Se = x(J, W, 0.5), pe = ["C", xe.x, xe.y, Se.x, Se.y, W.x, W.y];
|
|
1194
|
+
pe.origPoint = J, D.push(pe);
|
|
1195
|
+
} else D.push(j);
|
|
1163
1196
|
}
|
|
1164
|
-
if (
|
|
1165
|
-
let
|
|
1166
|
-
|
|
1197
|
+
if (v) {
|
|
1198
|
+
let K = z(D[D.length - 1]);
|
|
1199
|
+
D.push(["Z"]), E(D[0], K);
|
|
1167
1200
|
}
|
|
1168
|
-
} else
|
|
1169
|
-
return
|
|
1170
|
-
return p +
|
|
1201
|
+
} else D = L;
|
|
1202
|
+
return D.reduce(function(p, v) {
|
|
1203
|
+
return p + v.join(" ") + " ";
|
|
1171
1204
|
}, "");
|
|
1172
|
-
})(`${`M 0 ${
|
|
1173
|
-
},
|
|
1205
|
+
})(`${`M 0 ${w} L ${r - 0.5} ${w} L ${r - 0.5} ${m} L ${2 * r} ${m}`} ${`L ${c - 2 * r} ${m}`} ${`M ${c - 2 * r} ${m} L ${c - r} ${m} L ${c - r} ${w} L ${c} ${w}`}`, r);
|
|
1206
|
+
}, _ = R(() => f(a), [c, u, r, a]), g = R(() => {
|
|
1174
1207
|
if (r === 0) return;
|
|
1175
|
-
const
|
|
1176
|
-
return f(r) + `L ${c} 0 L 0 0 L 0 ${
|
|
1177
|
-
}, [
|
|
1178
|
-
return
|
|
1208
|
+
const P = r / 2;
|
|
1209
|
+
return f(r) + `L ${c} 0 L 0 0 L 0 ${P}`;
|
|
1210
|
+
}, [_, r, a]), M = R(() => ({ style: { clipPath: `path('${g}')` } }), [g]);
|
|
1211
|
+
return Ce("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...s, ref: $e([d, l, e]), children: [re.isValidElement(o) ? re.cloneElement(o, M) : C(Me, {}), C("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: u, viewBox: `0 0 ${c} ${u}`, children: C("path", { d: _, stroke: h, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
|
|
1179
1212
|
}));
|
|
1180
|
-
class
|
|
1213
|
+
class fo extends mn {
|
|
1181
1214
|
static getDerivedStateFromError() {
|
|
1182
1215
|
return { hasError: !0 };
|
|
1183
1216
|
}
|
|
@@ -1188,13 +1221,13 @@ class co extends fn {
|
|
|
1188
1221
|
return this.props.children;
|
|
1189
1222
|
}
|
|
1190
1223
|
}
|
|
1191
|
-
const
|
|
1192
|
-
const e =
|
|
1224
|
+
const Qo = ({ children: i }) => {
|
|
1225
|
+
const e = Qe(), t = V((n) => {
|
|
1193
1226
|
e.showError(n);
|
|
1194
1227
|
}, [e]);
|
|
1195
|
-
return C(
|
|
1228
|
+
return C(fo, { onError: t, children: i });
|
|
1196
1229
|
};
|
|
1197
|
-
class
|
|
1230
|
+
class mo {
|
|
1198
1231
|
constructor(e) {
|
|
1199
1232
|
this.notifier = e, this.handleUnhandledRejection = (t) => {
|
|
1200
1233
|
const n = t.reason;
|
|
@@ -1210,71 +1243,71 @@ class ho {
|
|
|
1210
1243
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1211
1244
|
}
|
|
1212
1245
|
}
|
|
1213
|
-
const
|
|
1214
|
-
const e =
|
|
1215
|
-
return
|
|
1216
|
-
const t = new
|
|
1246
|
+
const Jo = ({ children: i }) => {
|
|
1247
|
+
const e = Qe();
|
|
1248
|
+
return N(() => {
|
|
1249
|
+
const t = new mo(e);
|
|
1217
1250
|
return () => {
|
|
1218
1251
|
t.cleanup();
|
|
1219
1252
|
};
|
|
1220
|
-
}, [e]), C(
|
|
1221
|
-
},
|
|
1222
|
-
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: a, key: h, hitAreaProps: s =
|
|
1253
|
+
}, [e]), C(Me, { children: i });
|
|
1254
|
+
}, ei = () => null, _o = {}, go = (i) => {
|
|
1255
|
+
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: o = 0, paddingAfter: r = 0, disabled: a, key: h, hitAreaProps: s = _o, ...l } = i, c = n === "row", { style: u, className: d, ...f } = s;
|
|
1223
1256
|
return C("div", { style: { ...t, position: "relative" }, ...l, children: C("div", { className: le("hit-box", d), style: { left: (c ? -o : 0) + "px", width: `calc(100% + ${c ? o + r : 0}px)`, top: (c ? 0 : -o) + "px", height: `calc(100% + ${c ? 0 : o + r}px)`, position: "absolute", ...u }, onPointerDown: a ? void 0 : e, ...f }) }, h);
|
|
1224
|
-
},
|
|
1257
|
+
}, Ue = {}, ge = (i, e, t = !0) => i === null ? null : i.pixels !== null ? t ? i.pixels : e - i.pixels : (t ? i.percent : 100 - i.percent) / 100 * e, Xe = (i, e = !0) => i?.percent ? `${e ? i.percent : 100 - i.percent}%` : i?.pixels ? `${i.pixels}px` : void 0, ue = (i, e) => {
|
|
1225
1258
|
if (i == null) return null;
|
|
1226
1259
|
const t = { percent: null, pixels: null };
|
|
1227
1260
|
let n = e;
|
|
1228
1261
|
return typeof i == "string" && ((i = i.trim().toLowerCase()).endsWith("px") ? (i = i.substring(0, i.length - 2), n = !1) : i.endsWith("%") && (i = i.substring(0, i.length - 1), n = !0), i = parseFloat(i)), n ? t.percent = i : t.pixels = i, Object.freeze(t);
|
|
1229
|
-
},
|
|
1230
|
-
const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: a, onPositionChange: h, minBefore: s, maxBefore: l, minAfter: c, maxAfter: u, children: d, className: f, style:
|
|
1262
|
+
}, yo = we(ke((i, e) => {
|
|
1263
|
+
const { elementBefore: t, elementAfter: n, splitDirection: o = "row", fixedPane: r = null, position: a, onPositionChange: h, minBefore: s, maxBefore: l, minAfter: c, maxAfter: u, children: d, className: f, style: _, disabled: g = !1, onDragStart: M, onDragResize: P, onDragFinish: y, resizerProps: w = Ue, paneProps: m = Ue, paneBeforeProps: A = Ue, paneAfterProps: S = Ue, createResizer: T = go } = i;
|
|
1231
1264
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1232
|
-
const
|
|
1233
|
-
let
|
|
1234
|
-
r && (r === "before" ?
|
|
1235
|
-
const
|
|
1236
|
-
return { fixedPaneOffset:
|
|
1237
|
-
}, [s, l, c, u]),
|
|
1238
|
-
|
|
1239
|
-
|
|
1265
|
+
const I = R(() => re.isValidElement(n) && re.isValidElement(t), [n, t]), x = R(() => {
|
|
1266
|
+
let B = null;
|
|
1267
|
+
r && (r === "before" ? B = 0 : r === "after" && (B = 1));
|
|
1268
|
+
const H = B === null;
|
|
1269
|
+
return { fixedPaneOffset: B, isPercent: H, minBefore: ue(s, H), maxBefore: ue(l, H), minAfter: ue(c, H), maxAfter: ue(u, H) };
|
|
1270
|
+
}, [s, l, c, u]), E = k(h, [h]), [z, L] = F(() => ue(a, r === null));
|
|
1271
|
+
N(() => {
|
|
1272
|
+
L(ue(a, r === null));
|
|
1240
1273
|
}, [a, r]);
|
|
1241
|
-
const [
|
|
1242
|
-
const ce = [null, null],
|
|
1243
|
-
if (
|
|
1244
|
-
let he = ge(
|
|
1245
|
-
We = (ge(
|
|
1246
|
-
const
|
|
1247
|
-
return
|
|
1248
|
-
})(
|
|
1249
|
-
const
|
|
1250
|
-
|
|
1251
|
-
}, [r]),
|
|
1252
|
-
if (
|
|
1253
|
-
const
|
|
1254
|
-
let
|
|
1255
|
-
|
|
1256
|
-
}, [
|
|
1257
|
-
if (document.removeEventListener("pointermove",
|
|
1258
|
-
if (
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1274
|
+
const [D, { width: p, height: v }] = ve(), [K, { width: G, height: j }] = ve(), Q = o === "row" ? G : j, Z = o === "row" ? p : v, W = R(() => ((B, H, ee, X) => {
|
|
1275
|
+
const ce = [null, null], ie = [null, null];
|
|
1276
|
+
if (B || (B = { percent: X.fixedPaneOffset === null ? 50 : null, pixels: X.fixedPaneOffset === null ? null : 0 }), H === 0) return B?.pixels != null ? X.fixedPaneOffset !== 1 ? (ce[0] = B?.pixels, ie[1] = 100) : (ce[1] = B?.pixels - ee, ie[0] = 100) : B?.percent != null && (X.fixedPaneOffset !== 1 ? (ie[0] = B?.percent, ie[1] = 100 - B?.percent) : (ie[1] = B?.percent, ie[0] = 100 - B?.percent)), { percents: ie, pixels: ce, minBefore: Xe(X.minBefore, !0), maxBefore: Xe(X.maxBefore, !0), minAfter: Xe(X.minAfter), maxAfter: Xe(X.maxAfter) };
|
|
1277
|
+
let he = ge(B, H, X.fixedPaneOffset !== 1), ne = H - ee, bt = ge(X.minBefore, ne, !0) ?? 0, an = ge(X.maxBefore, ne, !0) ?? ne, We = 0, nt = 0, xt = 0, St = ne;
|
|
1278
|
+
We = (ge(X.maxAfter, H, !1) ?? ee) - ee, nt = ge(X.minAfter, H, !1) ?? H, xt = Math.max(bt, We), St = Math.min(an, nt), he = Math.max(xt, Math.min(he, St)), nt = Math.min(ne - he, ge(X.maxAfter, ne - he, !0) ?? ne), We = Math.min(ne - he, ge(X.minAfter, ne - he, !0) ?? ne), ce[0] = he, ce[1] = ne - ce[0];
|
|
1279
|
+
const cn = Math.max(0, Math.min(100, he / ne * 100));
|
|
1280
|
+
return ie[0] = cn, ie[1] = 100 - ie[0], { percents: ie, pixels: ce, minBefore: `${bt}px`, minAfter: `${We}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
|
|
1281
|
+
})(z, Z, Q, x), [x, z, Z, Q, o]), [oe, J] = F(!1), be = k(M, [M]), xe = k(P, [P]), Se = k(y, [y]), pe = O(null), Re = O(null), Ne = O(null), { style: He, className: Pe, ...fe } = m, Ee = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...He }, { className: se, style: De, ...Je } = A, { className: et, style: Ae, ...b } = S, $ = { flex: "1 1 100%", width: "100%", ..._, flexDirection: o, display: "flex" }, { className: U, style: me, onPointerDown: _e, ...ze } = w, tt = k((B) => {
|
|
1282
|
+
const H = ue(B, r === null);
|
|
1283
|
+
L(H);
|
|
1284
|
+
}, [r]), Ie = k((B) => {
|
|
1285
|
+
if (g || !oe) return;
|
|
1286
|
+
const H = wt.current?.getBoundingClientRect();
|
|
1287
|
+
let ee = 0;
|
|
1288
|
+
ee = o === "row" ? (B.clientX ?? B.touches?.[0]?.clientX) - H.x : (B.clientY ?? B.touches?.[0]?.clientY) - H.y, ee = Math.max(0, Math.min(Z, ee)), x.fixedPaneOffset === 1 && (ee = Z - ee), a && z.pixels === ee || L({ pixels: ee, percent: null }), xe?.(ee), B.stopPropagation(), B.preventDefault();
|
|
1289
|
+
}, [x, o, g, oe, z, Z]), vt = k((B) => {
|
|
1290
|
+
if (document.removeEventListener("pointermove", Ie), document.removeEventListener("touchmove", Ie), document.removeEventListener("pointerup", vt), !!oe && (J(!1), !!z)) {
|
|
1291
|
+
if (Se(z.pixels), !ue(a, r === null) || z.pixels !== a) {
|
|
1292
|
+
const H = { ...z };
|
|
1293
|
+
H.percent === null && (H.percent = H.pixels / Z * 100), E(H);
|
|
1261
1294
|
}
|
|
1262
|
-
|
|
1295
|
+
B.stopPropagation(), B.preventDefault();
|
|
1263
1296
|
}
|
|
1264
|
-
}, [
|
|
1265
|
-
|
|
1266
|
-
}, [
|
|
1297
|
+
}, [z, oe, a, r, Z]), on = k((B) => {
|
|
1298
|
+
_e?.(B), B.defaultPrevented || g || oe || (J(!0), be(), document.addEventListener("pointermove", Ie, { passive: !1 }), document.addEventListener("touchmove", Ie, { passive: !1 }), document.addEventListener("pointerup", vt, { passive: !1 }));
|
|
1299
|
+
}, [_e]), wt = yt(e, () => ({ setPosition: tt, isSplitPane: () => !0 }), []), rn = R(() => I ? T?.({ key: "resizer", ref: $e([K, Re]), className: le("resizer", U), onPointerDownCapture: on, style: { cursor: g ? void 0 : o === "row" ? "ew-resize" : "ns-resize", minWidth: o === "row" ? "2px" : void 0, minHeight: o !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...me }, splitDirection: o, disabled: g, ...ze }) : null, [I, U, ze, o, me, g]), Ve = o === "row" ? "Width" : "Height", sn = R(() => {
|
|
1267
1300
|
if (!t) return null;
|
|
1268
|
-
const
|
|
1269
|
-
return C("div", { ref:
|
|
1270
|
-
}, [t,
|
|
1301
|
+
const B = { ...Ee, ...De, flex: x.fixedPaneOffset === 0 && W?.pixels[0] !== null ? `0 0 ${Math.round(W?.pixels[0])}px` : `1 1 ${Math.round(W?.percents[0] ?? 100)}%`, [`min${Ve}`]: W?.minBefore, [`max${Ve}`]: n ? W?.maxBefore : "100%" };
|
|
1302
|
+
return C("div", { ref: pe, className: le("before", Pe, se), style: B, ...fe, ...Je, children: t }, "before");
|
|
1303
|
+
}, [t, m, A, x, W]), ln = R(() => {
|
|
1271
1304
|
if (!n) return null;
|
|
1272
|
-
const
|
|
1273
|
-
return C("div", { ref:
|
|
1274
|
-
}, [n,
|
|
1275
|
-
return
|
|
1305
|
+
const B = { ...Ee, ...Ae, flex: x.fixedPaneOffset === 1 && W?.pixels[1] !== null ? `0 0 ${Math.round(W?.pixels[1])}px` : `1 1 ${Math.round(W?.percents[1] ?? 100)}%`, [`min${Ve}`]: W?.minAfter, [`max${Ve}`]: t ? W?.maxAfter : "100%" };
|
|
1306
|
+
return C("div", { ref: Ne, className: le("after", Pe, et), style: B, ...fe, ...b, children: n }, "after");
|
|
1307
|
+
}, [n, m, S, x, W]);
|
|
1308
|
+
return Ce("div", { ref: $e([D, wt]), className: le("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: oe }, f), style: $, children: [sn, rn, ln] });
|
|
1276
1309
|
}));
|
|
1277
|
-
function
|
|
1310
|
+
function vo(i) {
|
|
1278
1311
|
if (typeof i == "function") return i;
|
|
1279
1312
|
if (typeof i == "string") {
|
|
1280
1313
|
const e = i.trim();
|
|
@@ -1286,16 +1319,16 @@ function fo(i) {
|
|
|
1286
1319
|
try {
|
|
1287
1320
|
if (/;base64/i.test(r)) {
|
|
1288
1321
|
if (typeof atob < "u") {
|
|
1289
|
-
const h = atob(a);
|
|
1322
|
+
const h = atob(a), s = h.length;
|
|
1290
1323
|
if (typeof TextDecoder < "u") {
|
|
1291
|
-
const
|
|
1292
|
-
for (let
|
|
1293
|
-
return new TextDecoder("utf-8").decode(
|
|
1324
|
+
const c = new Uint8Array(s);
|
|
1325
|
+
for (let u = 0; u < s; u++) c[u] = h.charCodeAt(u);
|
|
1326
|
+
return new TextDecoder("utf-8").decode(c);
|
|
1294
1327
|
}
|
|
1295
|
-
let
|
|
1296
|
-
for (let
|
|
1297
|
-
|
|
1298
|
-
return decodeURIComponent(
|
|
1328
|
+
let l = "";
|
|
1329
|
+
for (let c = 0; c < s; c++)
|
|
1330
|
+
l += `%${h.charCodeAt(c).toString(16).padStart(2, "0")}`;
|
|
1331
|
+
return decodeURIComponent(l);
|
|
1299
1332
|
}
|
|
1300
1333
|
return (globalThis.Buffer ? globalThis.Buffer.from(a, "base64") : require("buffer").Buffer.from(a, "base64")).toString("utf-8");
|
|
1301
1334
|
}
|
|
@@ -1308,12 +1341,12 @@ function fo(i) {
|
|
|
1308
1341
|
return null;
|
|
1309
1342
|
}
|
|
1310
1343
|
})(e);
|
|
1311
|
-
if (t) return
|
|
1344
|
+
if (t) return Kt(t);
|
|
1312
1345
|
}
|
|
1313
1346
|
if (e.startsWith("<")) {
|
|
1314
|
-
if (/^<\s*svg\b/i.test(e)) return
|
|
1347
|
+
if (/^<\s*svg\b/i.test(e)) return Kt(e);
|
|
1315
1348
|
if (/^<\s*path\b/i.test(e)) {
|
|
1316
|
-
const t =
|
|
1349
|
+
const t = Ot(e);
|
|
1317
1350
|
if (t) return { paths: [{ d: t }] };
|
|
1318
1351
|
}
|
|
1319
1352
|
return { paths: [{ d: e }] };
|
|
@@ -1325,7 +1358,7 @@ function fo(i) {
|
|
|
1325
1358
|
for (const t of i) if (typeof t == "string") {
|
|
1326
1359
|
const n = String(t).trim();
|
|
1327
1360
|
if (n.startsWith("<path")) {
|
|
1328
|
-
const o =
|
|
1361
|
+
const o = Ot(n);
|
|
1329
1362
|
o && e.push({ d: o });
|
|
1330
1363
|
} else e.push({ d: n });
|
|
1331
1364
|
} else t && typeof t == "object" && "d" in t && typeof t.d == "string" && e.push({ ...t });
|
|
@@ -1333,12 +1366,12 @@ function fo(i) {
|
|
|
1333
1366
|
}
|
|
1334
1367
|
return i;
|
|
1335
1368
|
}
|
|
1336
|
-
function
|
|
1369
|
+
function Ot(i) {
|
|
1337
1370
|
const e = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(i);
|
|
1338
1371
|
return e ? e[1] ?? e[2] ?? null : null;
|
|
1339
1372
|
}
|
|
1340
|
-
function
|
|
1341
|
-
if ("svg" in i) return { ...i, svg:
|
|
1373
|
+
function $t(i) {
|
|
1374
|
+
if ("svg" in i) return { ...i, svg: vo(i.svg) };
|
|
1342
1375
|
if ("url" in i) {
|
|
1343
1376
|
const e = typeof i.url == "string" ? { src: i.url } : i.url;
|
|
1344
1377
|
return { ...i, url: e };
|
|
@@ -1349,7 +1382,7 @@ function Bt(i) {
|
|
|
1349
1382
|
}
|
|
1350
1383
|
return i;
|
|
1351
1384
|
}
|
|
1352
|
-
function
|
|
1385
|
+
function Kt(i) {
|
|
1353
1386
|
try {
|
|
1354
1387
|
if (typeof DOMParser < "u") {
|
|
1355
1388
|
const a = new DOMParser().parseFromString(i, "image/svg+xml"), h = a.querySelector("svg"), s = h?.getAttribute("viewBox") ?? void 0, l = [];
|
|
@@ -1358,16 +1391,16 @@ function Ot(i) {
|
|
|
1358
1391
|
if (!u) return;
|
|
1359
1392
|
const d = { d: u }, f = c.getAttribute("class");
|
|
1360
1393
|
f && (d.className = f);
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1394
|
+
const _ = c.getAttribute("fill");
|
|
1395
|
+
_ && _ !== "none" && (d.fill = _);
|
|
1396
|
+
const g = c.getAttribute("stroke");
|
|
1397
|
+
g && (d.stroke = g);
|
|
1398
|
+
const M = c.getAttribute("opacity");
|
|
1399
|
+
M && (d.opacity = Number(M));
|
|
1400
|
+
const P = c.getAttribute("fill-rule");
|
|
1401
|
+
P && (d.fillRule = P);
|
|
1402
|
+
const y = c.getAttribute("clip-rule");
|
|
1403
|
+
y && (d.clipRule = y), l.push(d);
|
|
1371
1404
|
}), { viewBox: s, paths: l };
|
|
1372
1405
|
}
|
|
1373
1406
|
} catch {
|
|
@@ -1377,9 +1410,9 @@ function Ot(i) {
|
|
|
1377
1410
|
for (; r = o.exec(i); ) n.push({ d: r[1] });
|
|
1378
1411
|
return { viewBox: t, paths: n };
|
|
1379
1412
|
}
|
|
1380
|
-
function
|
|
1413
|
+
function Rt(i) {
|
|
1381
1414
|
const e = {};
|
|
1382
|
-
for (const [r, a] of Object.entries(i.icons)) e[r] =
|
|
1415
|
+
for (const [r, a] of Object.entries(i.icons)) e[r] = $t(a);
|
|
1383
1416
|
const t = { label: i.meta?.label ?? "Unnamed", version: i.meta?.version ?? "1.0.0", license: i.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: i.meta?.extends ?? [] };
|
|
1384
1417
|
t.extends.includes("base") || t.extends.push("base");
|
|
1385
1418
|
const n = { meta: t, icons: e }, o = i.overrides;
|
|
@@ -1387,14 +1420,14 @@ function $t(i) {
|
|
|
1387
1420
|
const r = {};
|
|
1388
1421
|
for (const [a, h] of Object.entries(o)) {
|
|
1389
1422
|
const s = {};
|
|
1390
|
-
for (const [l, c] of Object.entries(h)) s[l] =
|
|
1423
|
+
for (const [l, c] of Object.entries(h)) s[l] = $t(c);
|
|
1391
1424
|
r[a] = s;
|
|
1392
1425
|
}
|
|
1393
1426
|
n.__overrides = r;
|
|
1394
1427
|
}
|
|
1395
1428
|
return n;
|
|
1396
1429
|
}
|
|
1397
|
-
function
|
|
1430
|
+
function wo() {
|
|
1398
1431
|
const i = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
1399
1432
|
let t = "base", n = /* @__PURE__ */ new Map();
|
|
1400
1433
|
async function o(s) {
|
|
@@ -1405,7 +1438,7 @@ function _o() {
|
|
|
1405
1438
|
if (!l.loader) throw new Error(`No loader for icon pack: ${s}`);
|
|
1406
1439
|
l.loading = l.loader().then((c) => {
|
|
1407
1440
|
const u = c && typeof c == "object" && "default" in c ? c.default : c;
|
|
1408
|
-
l.pack =
|
|
1441
|
+
l.pack = Rt(u);
|
|
1409
1442
|
}).catch((c) => {
|
|
1410
1443
|
throw l.loading = void 0, c;
|
|
1411
1444
|
});
|
|
@@ -1422,8 +1455,8 @@ function _o() {
|
|
|
1422
1455
|
for (const u of c) {
|
|
1423
1456
|
const d = i.get(u);
|
|
1424
1457
|
if (!d?.pack) continue;
|
|
1425
|
-
const { icons: f } = d.pack,
|
|
1426
|
-
if (
|
|
1458
|
+
const { icons: f } = d.pack, _ = f[e.get(u)?.get(l) ?? l] ?? f[l];
|
|
1459
|
+
if (_) return { glyph: _, pack: d.pack, packKey: u };
|
|
1427
1460
|
}
|
|
1428
1461
|
return null;
|
|
1429
1462
|
}
|
|
@@ -1436,11 +1469,11 @@ function _o() {
|
|
|
1436
1469
|
const f = i.get(u)?.pack;
|
|
1437
1470
|
if (f) {
|
|
1438
1471
|
if (i.get(t)?.pack) {
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1472
|
+
const g = f.__overrides, M = g?.[t]?.[d];
|
|
1473
|
+
if (M) return { glyph: M, pack: f, packKey: u };
|
|
1441
1474
|
}
|
|
1442
|
-
const
|
|
1443
|
-
if (
|
|
1475
|
+
const _ = a(u, d);
|
|
1476
|
+
if (_) return _;
|
|
1444
1477
|
}
|
|
1445
1478
|
return null;
|
|
1446
1479
|
}
|
|
@@ -1448,7 +1481,7 @@ function _o() {
|
|
|
1448
1481
|
}
|
|
1449
1482
|
return { register: function(s, l) {
|
|
1450
1483
|
const c = i.get(s) ?? {};
|
|
1451
|
-
typeof l == "function" ? c.loader = l : c.pack =
|
|
1484
|
+
typeof l == "function" ? c.loader = l : c.pack = Rt(l), i.set(s, c), t || (t = s);
|
|
1452
1485
|
}, prefetch: async function(s = t) {
|
|
1453
1486
|
const l = Array.isArray(s) ? s : [s];
|
|
1454
1487
|
await Promise.all(l.map(o));
|
|
@@ -1500,104 +1533,106 @@ function _o() {
|
|
|
1500
1533
|
return n.set(s, c), c;
|
|
1501
1534
|
} };
|
|
1502
1535
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1536
|
+
yo.displayName = "SplitPane";
|
|
1537
|
+
const Ge = wo();
|
|
1538
|
+
Ge.register("base", () => import("./CNTtjTL9eZe9TQw2.mjs"));
|
|
1539
|
+
const Nt = (i) => C("svg", { ...i, children: C("path", {}) }), bo = { Icon: "_Icon_1ld90_10" }, xo = we((i) => {
|
|
1540
|
+
const { iconKey: e, packKey: t, className: n, style: o, role: r, title: a, size: h, ariaHidden: s, sourceProps: l, children: c, ...u } = i, [d, f] = re.useState(null);
|
|
1541
|
+
re.useEffect(() => {
|
|
1542
|
+
let L = !0, D = t, p = e;
|
|
1509
1543
|
if (!p) {
|
|
1510
|
-
const
|
|
1511
|
-
return void f({ glyph:
|
|
1544
|
+
const v = Ge.getPack(D);
|
|
1545
|
+
return void f({ glyph: v ? { svg: q.EmptyArray } : void 0, pack: v ?? void 0, packKey: D ?? Ge.getActive() });
|
|
1512
1546
|
}
|
|
1513
1547
|
if (p.includes(":")) {
|
|
1514
|
-
const [
|
|
1515
|
-
|
|
1548
|
+
const [v, K] = p.split(":");
|
|
1549
|
+
D = v, p = K;
|
|
1516
1550
|
}
|
|
1517
|
-
return
|
|
1518
|
-
|
|
1551
|
+
return Ge.resolve(p, { packKey: D }).then((v) => {
|
|
1552
|
+
L && f(v);
|
|
1519
1553
|
}), () => {
|
|
1520
|
-
|
|
1554
|
+
L = !1;
|
|
1521
1555
|
};
|
|
1522
1556
|
}, [e, t]);
|
|
1523
|
-
const
|
|
1524
|
-
let
|
|
1525
|
-
const
|
|
1526
|
-
const
|
|
1527
|
-
return
|
|
1528
|
-
}, [o,
|
|
1529
|
-
if (c) return
|
|
1530
|
-
if (
|
|
1531
|
-
if (
|
|
1532
|
-
if (
|
|
1533
|
-
const
|
|
1534
|
-
return
|
|
1535
|
-
}
|
|
1536
|
-
const
|
|
1537
|
-
if (typeof
|
|
1538
|
-
return
|
|
1539
|
-
if (!
|
|
1540
|
-
const
|
|
1541
|
-
return
|
|
1557
|
+
const _ = d?.pack, g = d?.glyph, M = d?.packKey;
|
|
1558
|
+
let P = g ? g.svg : void 0;
|
|
1559
|
+
const y = g && !P ? g.url : void 0, w = !g || P || y ? void 0 : g.emoji, m = h != null ? typeof h == "number" ? `${h}px` : h : void 0, A = R(() => [bo.Icon, "icon", n].filter(Boolean).join(" "), [n]), S = R(() => {
|
|
1560
|
+
const L = { ...o };
|
|
1561
|
+
return L["--icon-size"] = m, L;
|
|
1562
|
+
}, [o, m]), T = r ?? (a ? "img" : "presentation"), I = s ?? (!a || void 0), x = (L) => C("span", { className: A, style: S, role: T, "aria-hidden": I, title: a, "data-icon-glyph": e, "data-icon-pack": M, ...u, children: L });
|
|
1563
|
+
if (c) return x(c);
|
|
1564
|
+
if (w) return x(C("span", { children: typeof w == "string" ? w : w.text }));
|
|
1565
|
+
if (y) return x(C("img", { src: y.src, alt: a ?? "" }));
|
|
1566
|
+
if (g && "react" in g) {
|
|
1567
|
+
const L = g.react, D = { className: A, style: S, role: T, "aria-hidden": I, title: a, ...u, ...l };
|
|
1568
|
+
return x(C(L, { ...D }));
|
|
1569
|
+
}
|
|
1570
|
+
const E = { viewBox: P?.viewBox ?? _?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1571
|
+
if (typeof P == "function")
|
|
1572
|
+
return x(P(E) ?? C(Nt, { ...E }));
|
|
1573
|
+
if (!P) return x(C(Nt, { ...E }));
|
|
1574
|
+
const z = P.paths;
|
|
1575
|
+
return x(C("svg", { ...E, children: z ? z.map((L, D) => C("path", { d: L.d, className: L.className, fill: L.fill, stroke: L.stroke, opacity: L.opacity, fillRule: L.fillRule, clipRule: L.clipRule }, D)) : null }));
|
|
1542
1576
|
});
|
|
1543
|
-
function
|
|
1544
|
-
const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: o = 3, dashLength: r = 5, iconKey: a, packKey: h, style: s, className: l, ...c } = i, u =
|
|
1577
|
+
function ti(i) {
|
|
1578
|
+
const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: o = 3, dashLength: r = 5, iconKey: a, packKey: h, style: s, className: l, ...c } = i, u = R(() => {
|
|
1545
1579
|
if (!e) return;
|
|
1546
1580
|
const f = { "--walk-duration": `${n * (o + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${o}px` };
|
|
1547
1581
|
return t && t !== "accent" && (f["--icon-accent"] = `var(--icon-${t})`), f;
|
|
1548
|
-
}, [e, n, o, r, t]), d =
|
|
1549
|
-
return C(
|
|
1582
|
+
}, [e, n, o, r, t]), d = R(() => e ? l + " walking" : l, [e, l]);
|
|
1583
|
+
return C(xo, { iconKey: a, packKey: h, className: d, style: { ...s, ...u }, ...c });
|
|
1550
1584
|
}
|
|
1551
1585
|
export {
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1586
|
+
pt as Command,
|
|
1587
|
+
Io as CommandButtonType,
|
|
1588
|
+
Jt as CommandGroup,
|
|
1589
|
+
Ge as DefaultDynamicIconService,
|
|
1590
|
+
xn as DefaultReactNotifier,
|
|
1591
|
+
xo as DynamicIcon,
|
|
1592
|
+
ei as ErrorTestPanel,
|
|
1593
|
+
Zo as FocusKeyNavigation,
|
|
1594
|
+
To as HorizontalAlignment,
|
|
1595
|
+
ko as KeyCodes,
|
|
1596
|
+
Y as KeyModifiers,
|
|
1597
|
+
Po as MouseButtonCodes,
|
|
1598
|
+
Do as NotifierProvider,
|
|
1599
|
+
Lt as NotifierType,
|
|
1600
|
+
Qo as ReactErrorBoundary,
|
|
1601
|
+
Ro as ReactUtils,
|
|
1602
|
+
qo as RoundedTab,
|
|
1603
|
+
so as ScrollPane,
|
|
1604
|
+
Yo as ScrollUtils,
|
|
1605
|
+
eo as Scrollbar,
|
|
1572
1606
|
ae as ScrollbarOrientation,
|
|
1573
|
-
|
|
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
|
-
|
|
1607
|
+
at as SimpleCommand,
|
|
1608
|
+
yo as SplitPane,
|
|
1609
|
+
go as SplitPaneResizer,
|
|
1610
|
+
Go as ToolTipPlacement,
|
|
1611
|
+
Jo as UncaughtErrorBoundary,
|
|
1612
|
+
po as VirtualScrollbar,
|
|
1613
|
+
ti as WalkingIcon,
|
|
1614
|
+
wo as createDynamicIconService,
|
|
1615
|
+
ro as defaultCreateScrollCorner,
|
|
1616
|
+
Uo as defaultCreateScrollEdgeButton,
|
|
1617
|
+
Qn as defaultCreateScrollEndButton,
|
|
1618
|
+
qn as defaultCreateScrollStartButton,
|
|
1619
|
+
Bo as getDevicePixelRatio,
|
|
1620
|
+
Be as toShortcutString,
|
|
1621
|
+
Ao as useAnimatedMeasure,
|
|
1622
|
+
k as useCallbackRef,
|
|
1623
|
+
No as useCommand,
|
|
1624
|
+
Ho as useCommands,
|
|
1625
|
+
Vo as useCopyPaste,
|
|
1626
|
+
zo as useDevicePixelRatio,
|
|
1627
|
+
Ko as useEditMode,
|
|
1628
|
+
Xo as useFullscreenPortal,
|
|
1629
|
+
Vn as useGlobalClipboard,
|
|
1630
|
+
Fo as useId,
|
|
1631
|
+
yt as useImperativeElement,
|
|
1632
|
+
$o as useMouseDownAndHoldListener,
|
|
1633
|
+
Qe as useNotifier,
|
|
1634
|
+
Oo as useOnClickOrFocusAway,
|
|
1635
|
+
Mn as useSynchronizedPointerHandler,
|
|
1636
|
+
Wo as useTraceUpdate,
|
|
1637
|
+
jo as useUndoManager
|
|
1603
1638
|
};
|