@sheetxl/utils-react 0.7.9 → 0.7.11
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/CBhk4XX3Jh-fMfEG.cjs +6 -0
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/BNW2XtDFq9P_SHHG.mjs +12 -0
- package/browser/esm/index.mjs +655 -621
- package/node/assets/style.css +1 -1
- package/node/esm/D5BveCGka6K1aPl8.mjs +12 -0
- package/node/esm/index.mjs +471 -437
- package/package.json +2 -2
- package/types/index.d.ts +47 -1
- package/browser/cjs/BR8g9GwalrjWsdSk.cjs +0 -6
- package/browser/esm/B5G0So8kDpXm7CIT.mjs +0 -12
- package/node/esm/BNz6KrxO7ANRIJQq.mjs +0 -12
package/node/esm/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.11
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
7
|
import { jsx as t, Fragment as e, jsxs as n } from "react/jsx-runtime";
|
|
8
|
-
import o, { createContext as i, useContext as r,
|
|
8
|
+
import o, { createContext as i, useContext as r, useRef as s, useReducer as l, useCallback as a, useState as c, useEffect as h, useLayoutEffect as u, createElement as d, useMemo as p, useImperativeHandle as f, memo as _, forwardRef as m, Component as g } from "react";
|
|
9
9
|
import { unstable_batchedUpdates as y, createPortal as v } from "react-dom";
|
|
10
10
|
import w from "clsx";
|
|
11
11
|
import { mergeRefs as x } from "react-merge-refs";
|
|
12
12
|
import { useMeasure as b } from "react-use";
|
|
13
|
-
import { DefaultNotifier as S, Notifier as E, CommonUtils as L, InternalClipboard as M, ClipboardUtils as
|
|
13
|
+
import { DefaultNotifier as S, Notifier as E, CommonUtils as L, InternalClipboard as M, ClipboardUtils as T, MimeType as C } from "@sheetxl/utils";
|
|
14
14
|
import * as k from "detect-it";
|
|
15
15
|
import { createRoot as D } from "react-dom/client";
|
|
16
16
|
const P = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, A = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, z = { 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 }, B = { Left: 1, Middle: 2, Right: 3 }, $ = { Horizontal: "horizontal", Vertical: "vertical" }, O = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
@@ -55,15 +55,47 @@ const H = i(new K()), R = ({ children: t2, notifier: e2 }) => (o.useEffect(() =>
|
|
|
55
55
|
return E.setOverrides(e2), () => {
|
|
56
56
|
E.setOverrides(t3);
|
|
57
57
|
};
|
|
58
|
-
}, [e2]), o.createElement(H.Provider, { value: e2 }, t2)), N = () => r(H), V = (t2
|
|
59
|
-
|
|
58
|
+
}, [e2]), o.createElement(H.Provider, { value: e2 }, t2)), N = () => r(H), W = 3, V = 0.5, I = 50, F = (t2) => ({ x: t2.x, y: t2.y, width: t2.width, height: t2.height, top: t2.top, left: t2.left, right: t2.right, bottom: t2.bottom });
|
|
59
|
+
function j(t2 = {}) {
|
|
60
|
+
const { threshold: e2 = V, stillnessThreshold: n2 = W, maxHierarchyDepth: o2 = I } = t2, [i2, r2] = b(), u2 = s(null), [d2, p2] = l((t3) => t3 + 1, 0), f2 = s(void 0), _2 = s({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), m2 = a((t3) => {
|
|
61
|
+
u2.current = t3, "function" == typeof i2 && i2(t3);
|
|
62
|
+
}, [i2]), [g2, y2] = c(r2);
|
|
63
|
+
return h(() => {
|
|
64
|
+
r2 && !g2 && y2(r2);
|
|
65
|
+
}, [r2, g2]), h(() => {
|
|
66
|
+
const t3 = u2.current;
|
|
67
|
+
if (!t3) return;
|
|
68
|
+
let i3 = false, r3 = 0;
|
|
69
|
+
const s2 = () => {
|
|
70
|
+
if (!t3) return;
|
|
71
|
+
const o3 = t3.getBoundingClientRect(), l3 = _2.current;
|
|
72
|
+
Math.abs(o3.x - l3.x) > e2 || Math.abs(o3.y - l3.y) > e2 || Math.abs(o3.width - l3.width) > e2 || Math.abs(o3.height - l3.height) > e2 ? (i3 || (i3 = true, y2(F(o3)), p2()), r3 = 0) : r3++, i3 && r3 >= n2 && (i3 = false, y2(F(o3)), p2()), _2.current = F(o3), f2.current = requestAnimationFrame(s2);
|
|
73
|
+
};
|
|
74
|
+
f2.current = requestAnimationFrame(s2);
|
|
75
|
+
const l2 = (t4) => {
|
|
76
|
+
i3 = true, p2();
|
|
77
|
+
}, a2 = (t4) => {
|
|
78
|
+
i3 = false, r3 = n2, p2();
|
|
79
|
+
};
|
|
80
|
+
let c2 = t3;
|
|
81
|
+
const h2 = [];
|
|
82
|
+
for (; c2 && c2 !== document.documentElement && (c2.addEventListener("animationstart", l2, true), c2.addEventListener("animationend", a2, true), c2.addEventListener("transitionstart", l2, true), c2.addEventListener("transitionend", a2, true), h2.push(c2), c2 = c2.parentElement, !(h2.length > o2)); ) ;
|
|
83
|
+
return () => {
|
|
84
|
+
f2.current && cancelAnimationFrame(f2.current), h2.forEach((t4) => {
|
|
85
|
+
t4.removeEventListener("animationstart", l2, true), t4.removeEventListener("animationend", a2, true), t4.removeEventListener("transitionstart", l2, true), t4.removeEventListener("transitionend", a2, true);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
}, [d2, r2, e2, n2, o2]), [m2, g2];
|
|
89
|
+
}
|
|
90
|
+
const X = (t2, e2) => {
|
|
91
|
+
const n2 = a((...e3) => t2?.(...e3), e2), o2 = s(null);
|
|
60
92
|
o2.current = n2;
|
|
61
|
-
const i2 =
|
|
93
|
+
const i2 = a((...t3) => o2.current?.(...t3), []);
|
|
62
94
|
if (o2.current) return i2;
|
|
63
95
|
};
|
|
64
|
-
function
|
|
65
|
-
const [e2, n2] =
|
|
66
|
-
return
|
|
96
|
+
function Y(t2) {
|
|
97
|
+
const [e2, n2] = c("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = s(null);
|
|
98
|
+
return h(() => {
|
|
67
99
|
if (!("undefined" != typeof window && "matchMedia" in window)) return;
|
|
68
100
|
const t3 = () => {
|
|
69
101
|
const e3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
@@ -74,14 +106,14 @@ function W(t2) {
|
|
|
74
106
|
};
|
|
75
107
|
}, [t2]), e2;
|
|
76
108
|
}
|
|
77
|
-
function
|
|
109
|
+
function U(t2) {
|
|
78
110
|
if ("undefined" == typeof window) return 1;
|
|
79
111
|
const { defaultDpr: e2 = 1, maxDpr: n2 = 3, round: o2 = true } = t2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : e2;
|
|
80
112
|
return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
|
|
81
113
|
}
|
|
82
|
-
function
|
|
83
|
-
const o2 =
|
|
84
|
-
|
|
114
|
+
function G(t2, e2, n2) {
|
|
115
|
+
const o2 = X(e2, [e2]);
|
|
116
|
+
h(() => {
|
|
85
117
|
const e3 = (e4) => {
|
|
86
118
|
t2.current && !t2.current.contains(e4.target) && o2(e4);
|
|
87
119
|
};
|
|
@@ -90,110 +122,110 @@ function j(t2, e2, n2) {
|
|
|
90
122
|
};
|
|
91
123
|
}, [t2]);
|
|
92
124
|
}
|
|
93
|
-
function
|
|
125
|
+
function Z(t2) {
|
|
94
126
|
if (!t2) throw new Error("must have a PointerHandlerOptions");
|
|
95
|
-
const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: i2 = false, consumeTouch: r2 = true } = t2,
|
|
127
|
+
const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: i2 = false, consumeTouch: r2 = true } = t2, l2 = X(e2, [e2]), c2 = X(n2, [n2]), u2 = X(o2, [o2]), d2 = s(false), p2 = t2?.timerInitial ?? 230, f2 = t2?.timerContinuous ?? p2 / 2, _2 = s(null), m2 = s(null), g2 = s(null), y2 = s(null), v2 = a(() => {
|
|
96
128
|
y2.current && (clearTimeout(y2.current), y2.current = null);
|
|
97
|
-
}, []), w2 =
|
|
129
|
+
}, []), w2 = a((t3) => {
|
|
98
130
|
y2.current = setTimeout(() => {
|
|
99
131
|
window.requestAnimationFrame(() => {
|
|
100
132
|
false !== d2.current && u2?.(m2.current, g2.current, _2.current);
|
|
101
133
|
}), w2(f2);
|
|
102
134
|
}, t3 ?? p2);
|
|
103
135
|
}, []);
|
|
104
|
-
|
|
105
|
-
const x2 = i2 ? "pointer" : "mouse", b2 =
|
|
136
|
+
h(() => () => v2(), []);
|
|
137
|
+
const x2 = i2 ? "pointer" : "mouse", b2 = a((t3) => {
|
|
106
138
|
t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
|
|
107
|
-
}, []), S2 =
|
|
108
|
-
document.removeEventListener(`${x2}move`, M2), document.removeEventListener(`${x2}up`, S2), document.removeEventListener("keydown",
|
|
109
|
-
false !== d2.current && (d2.current = false,
|
|
139
|
+
}, []), S2 = X((t3) => {
|
|
140
|
+
document.removeEventListener(`${x2}move`, M2), document.removeEventListener(`${x2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", C2), document.removeEventListener("touchstart", b2, { capture: true }), document.removeEventListener("touchmove", b2, { capture: true }), window.removeEventListener("blur", E2), v2(), window.requestAnimationFrame(() => {
|
|
141
|
+
false !== d2.current && (d2.current = false, c2?.(t3, g2.current, _2.current), g2.current = null);
|
|
110
142
|
});
|
|
111
|
-
}, []), E2 =
|
|
143
|
+
}, []), E2 = a(() => {
|
|
112
144
|
false !== d2.current && (d2.current = false, S2(m2.current));
|
|
113
|
-
}, []), L2 =
|
|
145
|
+
}, []), L2 = X(() => {
|
|
114
146
|
v2(), w2(f2), window.requestAnimationFrame(() => {
|
|
115
147
|
false !== d2.current && u2?.(m2.current, g2.current, _2.current);
|
|
116
148
|
});
|
|
117
|
-
}, [f2]), M2 =
|
|
149
|
+
}, [f2]), M2 = X((t3) => {
|
|
118
150
|
m2.current = t3, L2();
|
|
119
|
-
}, []),
|
|
151
|
+
}, []), T2 = X((t3) => {
|
|
120
152
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
121
|
-
}, []),
|
|
153
|
+
}, []), C2 = X((t3) => {
|
|
122
154
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
123
155
|
}, [f2]);
|
|
124
|
-
return
|
|
156
|
+
return X((t3) => {
|
|
125
157
|
if (t3.isDefaultPrevented()) return;
|
|
126
158
|
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
|
|
127
|
-
false !==
|
|
159
|
+
false !== l2(t3, g2.current) && (_2.current = t3, m2.current = t3.nativeEvent, document.addEventListener(`${x2}up`, S2, { passive: false }), document.addEventListener(`${x2}move`, M2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", C2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), i2 && r2 && (document.addEventListener("touchstart", b2, { passive: false, capture: true }), document.addEventListener("touchmove", b2, { passive: false, capture: true })), d2.current = true, w2(p2));
|
|
128
160
|
}, [p2, i2]);
|
|
129
161
|
}
|
|
130
|
-
function
|
|
131
|
-
return
|
|
162
|
+
function q(t2, e2) {
|
|
163
|
+
return Z({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
|
|
132
164
|
t2?.(o2);
|
|
133
165
|
}, ...e2 });
|
|
134
166
|
}
|
|
135
|
-
const
|
|
136
|
-
const o2 =
|
|
167
|
+
const J = ({ initValue: t2, useHookBody: e2, applyStateChange: n2 }) => {
|
|
168
|
+
const o2 = s(t2);
|
|
137
169
|
if ("function" != typeof e2) throw new Error("function expected as hook body parameter. got " + typeof e2);
|
|
138
170
|
const i2 = e2();
|
|
139
|
-
return
|
|
171
|
+
return u(() => {
|
|
140
172
|
o2.current !== i2 && (o2.current = i2, n2(i2));
|
|
141
173
|
}, [n2, i2]), null;
|
|
142
|
-
},
|
|
174
|
+
}, Q = (t2) => {
|
|
143
175
|
console && console.warn && console.warn(t2);
|
|
144
|
-
},
|
|
145
|
-
let
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
},
|
|
149
|
-
const [o2, i2] =
|
|
150
|
-
return r2.current = o2, n2 || false !==
|
|
176
|
+
}, tt = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
|
|
177
|
+
let et = 1, nt = false, ot = false;
|
|
178
|
+
const it = [], rt = [], st = () => {
|
|
179
|
+
rt.forEach((t2) => t2());
|
|
180
|
+
}, lt = ({ automaticContainerInternalUseOnly: n2 }) => {
|
|
181
|
+
const [o2, i2] = c([]), r2 = s([]);
|
|
182
|
+
return r2.current = o2, n2 || false !== nt || (ot = true), h(() => {
|
|
151
183
|
let t2 = true;
|
|
152
184
|
function e2() {
|
|
153
|
-
if (t2) return
|
|
185
|
+
if (t2) return rt[0] !== e2 ? (n2 || true !== nt || Q("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void i2((t3) => [])) : void i2([...it]);
|
|
154
186
|
}
|
|
155
|
-
return
|
|
156
|
-
t2 = false, r2.current?.length > 0 &&
|
|
187
|
+
return rt.push(e2), st(), () => {
|
|
188
|
+
t2 = false, r2.current?.length > 0 && Q("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), rt.splice(rt.indexOf(e2), 1), st();
|
|
157
189
|
};
|
|
158
|
-
}, [n2]), t(e, { children: o2.map(({ hook: t2, key: e2 }) =>
|
|
159
|
-
},
|
|
160
|
-
const n2 =
|
|
161
|
-
return
|
|
162
|
-
if (
|
|
163
|
-
const n3 =
|
|
190
|
+
}, [n2]), t(e, { children: o2.map(({ hook: t2, key: e2 }) => d(J, { ...t2, key: e2 })) });
|
|
191
|
+
}, at = (e2) => {
|
|
192
|
+
const n2 = et++;
|
|
193
|
+
return it.push({ hook: e2, key: n2 }), 0 === rt.length && false === ot && (nt = true, ((e3) => {
|
|
194
|
+
if (tt.document && tt.document.createElement) {
|
|
195
|
+
const n3 = tt.document.createElement("div");
|
|
164
196
|
D(n3).render(t(e3, { automaticContainerInternalUseOnly: true }));
|
|
165
|
-
} else
|
|
166
|
-
})(
|
|
167
|
-
|
|
197
|
+
} else Q("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
198
|
+
})(lt)), st(), () => {
|
|
199
|
+
it.splice(it.findIndex((t2) => t2.key === n2), 1), st();
|
|
168
200
|
};
|
|
169
201
|
};
|
|
170
|
-
let
|
|
171
|
-
|
|
172
|
-
let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers:
|
|
202
|
+
let ct = null;
|
|
203
|
+
ct || (ct = (t2, e2, n2 = {}) => {
|
|
204
|
+
let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: a2 = false } = n2;
|
|
173
205
|
const u2 = (t3) => {
|
|
174
206
|
i2 = t3, y(() => l2.forEach((e3) => e3(t3)));
|
|
175
207
|
}, d2 = () => (s2 || (i2 = "function" == typeof t2 ? t2() : t2, s2 = true), i2);
|
|
176
208
|
return () => {
|
|
177
|
-
const [n3, s3] =
|
|
178
|
-
return
|
|
179
|
-
l2.splice(l2.indexOf(s3), 1), 0 === l2.length &&
|
|
209
|
+
const [n3, s3] = c(d2);
|
|
210
|
+
return h(() => (r2 || (r2 = true, o2 = at({ initValue: t2, useHookBody: e2, applyStateChange: u2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
|
|
211
|
+
l2.splice(l2.indexOf(s3), 1), 0 === l2.length && a2 && (o2(), r2 = false);
|
|
180
212
|
}), []), n3;
|
|
181
213
|
};
|
|
182
214
|
});
|
|
183
|
-
const
|
|
184
|
-
let
|
|
215
|
+
const ht = ct;
|
|
216
|
+
let ut = () => {
|
|
185
217
|
console.warn("You must call useEditMode before setting its state.");
|
|
186
218
|
};
|
|
187
|
-
const
|
|
188
|
-
const [t2, e2] =
|
|
189
|
-
return
|
|
190
|
-
}),
|
|
191
|
-
const t2 =
|
|
192
|
-
return
|
|
193
|
-
|
|
219
|
+
const dt = ht(null, () => {
|
|
220
|
+
const [t2, e2] = c(null);
|
|
221
|
+
return ut = e2, t2;
|
|
222
|
+
}), pt = () => {
|
|
223
|
+
const t2 = dt();
|
|
224
|
+
return p(() => ({ setMode: (t3) => {
|
|
225
|
+
ut((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
|
|
194
226
|
}, getMode: () => t2 }), [t2]);
|
|
195
227
|
};
|
|
196
|
-
class
|
|
228
|
+
class ft {
|
|
197
229
|
constructor(t2, e2, n2, o2) {
|
|
198
230
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
|
|
199
231
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
@@ -305,13 +337,13 @@ class ct {
|
|
|
305
337
|
}), e2;
|
|
306
338
|
}
|
|
307
339
|
}
|
|
308
|
-
class
|
|
340
|
+
class _t extends ft {
|
|
309
341
|
}
|
|
310
|
-
const
|
|
311
|
-
function
|
|
342
|
+
const mt = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), gt = {};
|
|
343
|
+
function yt() {
|
|
312
344
|
return k;
|
|
313
345
|
}
|
|
314
|
-
const
|
|
346
|
+
const vt = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : L.camelToPrettyCase(t2), wt = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: gt, boundPixel: function(t2, e2 = false, n2 = 0) {
|
|
315
347
|
return t2;
|
|
316
348
|
}, createSyntheticEvent: (t2) => {
|
|
317
349
|
let e2 = false, n2 = false;
|
|
@@ -321,8 +353,8 @@ const ft = (t2) => "BracketLeft" === t2 ? "[" : "BracketRight" === t2 ? "]" : L.
|
|
|
321
353
|
n2 = true, t2.stopPropagation();
|
|
322
354
|
}, isPropagationStopped: () => n2, persist: () => {
|
|
323
355
|
}, timeStamp: t2.timeStamp, type: t2.type };
|
|
324
|
-
}, detectIt:
|
|
325
|
-
class
|
|
356
|
+
}, detectIt: yt, focusableNodeNames: mt, toPrettyKeyCode: vt }, Symbol.toStringTag, { value: "Module" }));
|
|
357
|
+
class xt {
|
|
326
358
|
constructor(t2, e2) {
|
|
327
359
|
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = L.uuidV4(), this._target = t2, this._groupKey = e2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(e2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
328
360
|
const n2 = this;
|
|
@@ -350,7 +382,7 @@ class mt {
|
|
|
350
382
|
n3 && (o2 = n3), t3 = t3._parent;
|
|
351
383
|
}
|
|
352
384
|
}
|
|
353
|
-
o2 || (o2 = new
|
|
385
|
+
o2 || (o2 = new xt(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
|
|
354
386
|
const i2 = (t3, o3) => {
|
|
355
387
|
!t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
|
|
356
388
|
};
|
|
@@ -382,7 +414,7 @@ class mt {
|
|
|
382
414
|
if (!u2) continue;
|
|
383
415
|
const d2 = Array.isArray(u2) ? u2 : [u2];
|
|
384
416
|
for (let t3 = 0; t3 < d2.length; t3++) {
|
|
385
|
-
const n3 =
|
|
417
|
+
const n3 = Et(d2[t3]), i3 = o2.get(n3);
|
|
386
418
|
i3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
|
|
387
419
|
}
|
|
388
420
|
}
|
|
@@ -417,10 +449,10 @@ class mt {
|
|
|
417
449
|
findCommandByEvent(t2) {
|
|
418
450
|
const e2 = [];
|
|
419
451
|
t2.altKey && e2.push(A.Alt), t2.shiftKey && e2.push(A.Shift), t2.ctrlKey && e2.push(A.Ctrl), t2.metaKey && e2.push(A.Meta);
|
|
420
|
-
let n2 =
|
|
452
|
+
let n2 = Et({ key: t2.code, modifiers: e2 });
|
|
421
453
|
const o2 = this._commandsByShortcut;
|
|
422
454
|
let i2 = o2.get(n2);
|
|
423
|
-
i2 || (n2 =
|
|
455
|
+
i2 || (n2 = Et({ key: t2.key, modifiers: e2 }), i2 = o2.get(n2)), !i2 && t2.code.startsWith("Digit") && (n2 = Et({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && t2.code.startsWith("Key") && (i2 = Et({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), i2 = o2.get(n2));
|
|
424
456
|
let r2 = null;
|
|
425
457
|
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(t2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(t2) ?? null);
|
|
426
458
|
}
|
|
@@ -479,17 +511,17 @@ class mt {
|
|
|
479
511
|
}), t2;
|
|
480
512
|
}
|
|
481
513
|
}
|
|
482
|
-
const
|
|
514
|
+
const bt = L.getOS() === L.OSType.MacOS || L.getOS() === L.OSType.IOS ? "Cmd" : "Ctrl", St = L.getOS() === L.OSType.MacOS || L.getOS() === L.OSType.IOS ? "⌘" : "^", Et = (t2, e2 = false) => {
|
|
483
515
|
const n2 = {};
|
|
484
516
|
for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
|
|
485
517
|
let o2 = "";
|
|
486
|
-
return (n2?.[A.Ctrl] || n2?.[A.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ?
|
|
518
|
+
return (n2?.[A.Ctrl] || n2?.[A.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? St : bt)), n2?.[A.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[A.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + vt(t2.key), o2;
|
|
487
519
|
};
|
|
488
|
-
function
|
|
489
|
-
const n2 =
|
|
520
|
+
function Lt(t2, e2 = null) {
|
|
521
|
+
const n2 = s(e2);
|
|
490
522
|
n2.current = e2;
|
|
491
|
-
const [o2, i2] =
|
|
492
|
-
return
|
|
523
|
+
const [o2, i2] = l((t3) => t3 + 1, 0), r2 = p(() => Array.isArray(t2) ? t2 : [t2], [t2]);
|
|
524
|
+
return h(() => {
|
|
493
525
|
if (!r2 || 0 === r2.length) return;
|
|
494
526
|
const t3 = (t4, e3) => {
|
|
495
527
|
n2.current?.onChange?.(e3), i2();
|
|
@@ -509,7 +541,7 @@ function wt(t2, e2 = null) {
|
|
|
509
541
|
};
|
|
510
542
|
}, [t2]), o2;
|
|
511
543
|
}
|
|
512
|
-
const
|
|
544
|
+
const Mt = (t2, e2) => {
|
|
513
545
|
if (!e2 || !t2 || 0 === e2.length) return L.EmptyArray;
|
|
514
546
|
const n2 = e2.length, o2 = new Array(n2);
|
|
515
547
|
for (let i2 = 0; i2 < n2; i2++) {
|
|
@@ -518,39 +550,39 @@ const xt = (t2, e2) => {
|
|
|
518
550
|
}
|
|
519
551
|
return o2;
|
|
520
552
|
};
|
|
521
|
-
function
|
|
522
|
-
const i2 =
|
|
553
|
+
function Tt(t2, e2 = null, n2 = null, o2) {
|
|
554
|
+
const i2 = s(n2);
|
|
523
555
|
i2.current = n2, e2 && !Array.isArray(e2) && (e2 = [e2]);
|
|
524
|
-
const [r2,
|
|
525
|
-
return
|
|
556
|
+
const [r2, l2] = c(Mt(t2, e2)), a2 = o2 ? [...o2, t2] : [t2];
|
|
557
|
+
return h(() => {
|
|
526
558
|
const n3 = { onGroupChange: () => {
|
|
527
|
-
const n4 =
|
|
528
|
-
|
|
559
|
+
const n4 = Mt(t2, e2);
|
|
560
|
+
l2(n4), i2.current?.onChange?.(this);
|
|
529
561
|
} };
|
|
530
562
|
let o3;
|
|
531
563
|
e2 && e2.length > 0 && (o3 = { keys: e2 }, n3.onCommandChange = (n4, o4) => {
|
|
532
|
-
i2.current?.onChange?.(t2),
|
|
564
|
+
i2.current?.onChange?.(t2), l2(Mt(t2, e2));
|
|
533
565
|
});
|
|
534
|
-
const r3 = t2?.addListener(n3, o3),
|
|
535
|
-
return s2
|
|
566
|
+
const r3 = t2?.addListener(n3, o3), s2 = Mt(t2, e2);
|
|
567
|
+
return l2(s2), i2.current?.onChange && i2.current?.onChange(t2), () => {
|
|
536
568
|
r3?.();
|
|
537
569
|
};
|
|
538
|
-
},
|
|
570
|
+
}, a2), r2;
|
|
539
571
|
}
|
|
540
|
-
const
|
|
572
|
+
const Ct = { Toolbar: "toolbar", Menuitem: "menuitem" }, kt = ht({ setClipboard: (t2) => {
|
|
541
573
|
throw new Error("This is only available via the useClipboard.");
|
|
542
574
|
}, getClipboard: () => M.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
543
|
-
const [t2, e2] =
|
|
544
|
-
return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy:
|
|
545
|
-
}),
|
|
546
|
-
const { source: e2, target: n2, onPaste: o2, onClipboardUpdate: i2, commands: r2 } = t2,
|
|
547
|
-
|
|
575
|
+
const [t2, e2] = c(M.Global);
|
|
576
|
+
return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy: s(null), refNativeLastKey: s(null) };
|
|
577
|
+
}), Dt = (t2) => {
|
|
578
|
+
const { source: e2, target: n2, onPaste: o2, onClipboardUpdate: i2, commands: r2 } = t2, s2 = N(), l2 = X(i2, [i2]), c2 = X(o2, [o2]), { getClipboard: u2, refNativeCopy: d2 } = kt(), f2 = u2();
|
|
579
|
+
p(() => {
|
|
548
580
|
const t3 = e2?.element, o3 = n2?.element ?? e2?.element;
|
|
549
581
|
if (!r2) return;
|
|
550
|
-
const i3 = [new
|
|
582
|
+
const i3 = [new _t("cut", t3, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [A.Ctrl] } }), new _t("copy", t3, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [A.Ctrl] } }), new _t("paste", o3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [A.Ctrl] }, { key: "F8", modifiers: [A.Ctrl] }] })];
|
|
551
583
|
r2?.addCommands(i3, true);
|
|
552
584
|
}, [r2]);
|
|
553
|
-
const _2 =
|
|
585
|
+
const _2 = X(async (t3) => {
|
|
554
586
|
if (!e2?.element) return;
|
|
555
587
|
let n3 = null;
|
|
556
588
|
try {
|
|
@@ -558,84 +590,84 @@ const St = { Toolbar: "toolbar", Menuitem: "menuitem" }, Et = rt({ setClipboard:
|
|
|
558
590
|
} catch (t4) {
|
|
559
591
|
throw t4;
|
|
560
592
|
}
|
|
561
|
-
}, [e2,
|
|
593
|
+
}, [e2, s2]), m2 = X(async (t3) => {
|
|
562
594
|
const n3 = e2?.element?.();
|
|
563
595
|
if (n3) {
|
|
564
|
-
|
|
596
|
+
d2.current = { sourceElement: n3, args: t3 };
|
|
565
597
|
try {
|
|
566
598
|
await _2(t3);
|
|
567
599
|
} catch (t4) {
|
|
568
|
-
|
|
600
|
+
s2.showError?.(t4);
|
|
569
601
|
}
|
|
570
602
|
}
|
|
571
|
-
}, [e2?.element,
|
|
603
|
+
}, [e2?.element, s2]), g2 = a(() => {
|
|
572
604
|
m2({ isCut: true });
|
|
573
|
-
}, []), y2 =
|
|
605
|
+
}, []), y2 = X(async (t3, e3, n3) => {
|
|
574
606
|
try {
|
|
575
607
|
if (false === await t3.doPaste(e3, n3)) return;
|
|
576
|
-
|
|
608
|
+
c2?.(e3, n3);
|
|
577
609
|
} catch (t4) {
|
|
578
|
-
|
|
610
|
+
s2.showError?.(t4);
|
|
579
611
|
}
|
|
580
|
-
}, [
|
|
612
|
+
}, [c2]), v2 = X(async (t3, e3, o3) => {
|
|
581
613
|
const i3 = n2?.element?.();
|
|
582
614
|
if (i3 && await L.whenFocus(i3), !t3 && !e3) return;
|
|
583
|
-
const r3 = await
|
|
615
|
+
const r3 = await s2.showBusy?.("Pasting...");
|
|
584
616
|
if (e3) try {
|
|
585
617
|
return await y2(n2, e3, o3), void r3?.();
|
|
586
618
|
} catch (t4) {
|
|
587
|
-
r3?.(),
|
|
619
|
+
r3?.(), s2.showError?.(t4);
|
|
588
620
|
}
|
|
589
|
-
let
|
|
590
|
-
|
|
621
|
+
let l3, a2 = n2.importFromExternal;
|
|
622
|
+
a2 || (a2 = (e4, n3) => ({ getItemType: () => "text", toText: () => t3.text, isClipboardItem: true }));
|
|
591
623
|
try {
|
|
592
|
-
|
|
624
|
+
l3 = await a2(t3, { isCut: false });
|
|
593
625
|
} catch (t4) {
|
|
594
|
-
r3?.(),
|
|
626
|
+
r3?.(), s2.showError?.(t4);
|
|
595
627
|
}
|
|
596
|
-
if (
|
|
597
|
-
const t4 = await Promise.resolve(
|
|
628
|
+
if (l3) try {
|
|
629
|
+
const t4 = await Promise.resolve(l3);
|
|
598
630
|
await y2(n2, t4, o3), r3?.();
|
|
599
631
|
} catch (t4) {
|
|
600
|
-
r3?.(),
|
|
632
|
+
r3?.(), s2.showError?.(t4);
|
|
601
633
|
}
|
|
602
634
|
else r3?.();
|
|
603
|
-
}, [y2, n2,
|
|
635
|
+
}, [y2, n2, s2]), w2 = X(async (t3) => {
|
|
604
636
|
if (n2?.element) try {
|
|
605
637
|
const e3 = await f2.readReference();
|
|
606
638
|
if (e3) return void await v2(null, e3, t3);
|
|
607
639
|
const n3 = [];
|
|
608
|
-
n3[0] = await
|
|
640
|
+
n3[0] = await T.readStringFromClipboard(f2, C.plain), n3[1] = await T.readHTMLFromClipboard(f2, C.html), n3[2] = await T.readBlobFromClipboard(f2, C.png);
|
|
609
641
|
const o3 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
|
|
610
642
|
await v2(o3, null, t3);
|
|
611
643
|
} catch (t4) {
|
|
612
644
|
if ("Document is not focused." === t4?.message) return;
|
|
613
|
-
|
|
645
|
+
s2.showError?.(t4);
|
|
614
646
|
}
|
|
615
|
-
}, [v2, n2?.element,
|
|
616
|
-
return
|
|
617
|
-
}, [e2?.element]),
|
|
618
|
-
}, [n2?.element, v2,
|
|
647
|
+
}, [v2, n2?.element, s2]);
|
|
648
|
+
return X(async (t3) => {
|
|
649
|
+
}, [e2?.element]), X(async (t3) => {
|
|
650
|
+
}, [n2?.element, v2, s2]), h(() => {
|
|
619
651
|
if (!f2) return;
|
|
620
652
|
const t3 = async (t4) => {
|
|
621
653
|
const e4 = await f2.readReference();
|
|
622
|
-
|
|
654
|
+
l2?.(e4);
|
|
623
655
|
}, e3 = (t4) => {
|
|
624
|
-
|
|
656
|
+
s2.showMessage?.(M.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
625
657
|
}, n3 = (t4) => {
|
|
626
|
-
|
|
658
|
+
s2.showMessage?.(M.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
627
659
|
};
|
|
628
660
|
return f2.addEventListener("clipboardchange", t3), f2.addEventListener("clipboarderrorread", e3), f2.addEventListener("clipboarderrorwrite", n3), () => {
|
|
629
661
|
f2.removeEventListener("clipboardchange", t3), f2.removeEventListener("clipboarderrorread", e3), f2.removeEventListener("clipboarderrorwrite", n3);
|
|
630
662
|
};
|
|
631
|
-
}, [f2,
|
|
632
|
-
}, [_2, v2, e2, n2]),
|
|
663
|
+
}, [f2, s2]), h(() => {
|
|
664
|
+
}, [_2, v2, e2, n2]), h(() => {
|
|
633
665
|
r2?.getCommand("cut")?.updateCallback(g2).update({ disabled: !e2 || !n2 }), r2?.getCommand("copy")?.updateCallback(m2).update({ disabled: !e2 }), r2?.getCommand("paste")?.updateCallback(w2).update({ disabled: !n2 });
|
|
634
666
|
}, [e2, n2, r2]), { paste: w2, copy: m2, clipboard: f2 };
|
|
635
667
|
};
|
|
636
|
-
function
|
|
637
|
-
const n2 =
|
|
638
|
-
|
|
668
|
+
function Pt(t2, e2 = true) {
|
|
669
|
+
const n2 = s(t2);
|
|
670
|
+
h(() => {
|
|
639
671
|
if (e2) {
|
|
640
672
|
const e3 = Object.entries(t2).reduce((t3, [e4, o2]) => (n2.current[e4] !== o2 && (t3[e4] = [n2.current[e4], o2]), t3), {});
|
|
641
673
|
Object.keys(e3).length > 0 && console.log("Changed props:", e3);
|
|
@@ -643,19 +675,19 @@ function Mt(t2, e2 = true) {
|
|
|
643
675
|
n2.current = t2;
|
|
644
676
|
});
|
|
645
677
|
}
|
|
646
|
-
let
|
|
647
|
-
var
|
|
648
|
-
const
|
|
649
|
-
const
|
|
650
|
-
const [t2, e2] = o.useState(() =>
|
|
651
|
-
return
|
|
652
|
-
null == t2 && e2(
|
|
678
|
+
let At = false, zt = 0;
|
|
679
|
+
var Bt = "undefined" != typeof document ? u : h;
|
|
680
|
+
const $t = () => "sheetxl-ui-" + zt++;
|
|
681
|
+
const Ot = o["useId".toString()], Kt = null != Ot ? Ot : function() {
|
|
682
|
+
const [t2, e2] = o.useState(() => At ? $t() : void 0);
|
|
683
|
+
return Bt(() => {
|
|
684
|
+
null == t2 && e2($t());
|
|
653
685
|
}, []), o.useEffect(() => {
|
|
654
|
-
|
|
686
|
+
At || (At = true);
|
|
655
687
|
}, []), t2;
|
|
656
|
-
},
|
|
657
|
-
function
|
|
658
|
-
const o2 =
|
|
688
|
+
}, Ht = [];
|
|
689
|
+
function Rt(t2, e2, n2 = Ht) {
|
|
690
|
+
const o2 = s(null);
|
|
659
691
|
return f(t2, () => {
|
|
660
692
|
if (!o2.current) return;
|
|
661
693
|
const t3 = o2.current, n3 = e2?.();
|
|
@@ -668,33 +700,33 @@ function Bt(t2, e2, n2 = zt) {
|
|
|
668
700
|
return t3;
|
|
669
701
|
}, n2), o2;
|
|
670
702
|
}
|
|
671
|
-
const
|
|
672
|
-
const o2 = N(), i2 =
|
|
703
|
+
const Nt = "Undo the last action.", Wt = "Repeat the last action or undo the redo.", Vt = (t2) => `Redo ${t2}`, It = ({ manager: t2, commands: e2, disabled: n2 }) => {
|
|
704
|
+
const o2 = N(), i2 = X((e3) => {
|
|
673
705
|
try {
|
|
674
706
|
t2?.undo(e3);
|
|
675
707
|
} catch (t3) {
|
|
676
708
|
o2.error(t3);
|
|
677
709
|
}
|
|
678
|
-
}, [t2]), r2 =
|
|
710
|
+
}, [t2]), r2 = X((e3) => {
|
|
679
711
|
try {
|
|
680
712
|
t2?.redo(e3);
|
|
681
713
|
} catch (t3) {
|
|
682
714
|
o2.error(t3);
|
|
683
715
|
}
|
|
684
716
|
}, [t2]);
|
|
685
|
-
return
|
|
717
|
+
return p(() => {
|
|
686
718
|
if (!e2) return;
|
|
687
719
|
const t3 = { contains: (t4) => true, focus() {
|
|
688
|
-
} }, n3 = [new
|
|
720
|
+
} }, n3 = [new ft("undo", t3, { label: "Undo", description: Nt, shortcut: { key: "z", modifiers: [A.Ctrl] }, disabled: true }, i2), new ft("redo", t3, { label: "Redo", description: Wt, shortcut: [{ key: "y", modifiers: [A.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [A.Alt] }], disabled: true }, r2)];
|
|
689
721
|
e2?.addCommands(n3, true);
|
|
690
|
-
}, [e2]),
|
|
722
|
+
}, [e2]), h(() => {
|
|
691
723
|
if (!e2) return;
|
|
692
724
|
const o3 = () => {
|
|
693
725
|
const o4 = t2?.getTopUndoDescription(), i4 = {};
|
|
694
726
|
var r3;
|
|
695
|
-
e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) :
|
|
727
|
+
e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : Nt, state: i4, context: { undoManager: t2 } });
|
|
696
728
|
const s2 = t2?.getTopRedoDescription();
|
|
697
|
-
e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ?
|
|
729
|
+
e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ? Vt(s2) : Wt, state: i4, context: { undoManager: t2 } });
|
|
698
730
|
};
|
|
699
731
|
if (o3(), !t2) return;
|
|
700
732
|
const i3 = t2.addListener({ onStackChange() {
|
|
@@ -702,101 +734,122 @@ const $t = "Undo the last action.", Ot = "Repeat the last action or undo the red
|
|
|
702
734
|
} });
|
|
703
735
|
return () => i3?.();
|
|
704
736
|
}, [t2, e2, n2]), { undo: i2, redo: r2 };
|
|
705
|
-
},
|
|
706
|
-
const { style: n2, orientation: o2 = $.Vertical, disabled: i2, ...r2 } = e2, s2 = o2 === $.Vertical ?
|
|
707
|
-
return t("button", { style: n2, className: w(
|
|
708
|
-
},
|
|
709
|
-
const { style: n2, orientation: o2 = $.Vertical, disabled: i2, ...r2 } = e2, s2 = o2 === $.Vertical ?
|
|
710
|
-
return t("button", { style: n2, className: w(
|
|
711
|
-
},
|
|
737
|
+
}, Ft = "_scrollbar_1v478_17", jt = "_vsb-track_1v478_27", Xt = "_vsb-thumb_1v478_39", Yt = "_scrollbar-button_1v478_80", Ut = "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", Gt = "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", Zt = { transform: "rotate(180deg)" }, qt = (e2) => {
|
|
738
|
+
const { style: n2, orientation: o2 = $.Vertical, disabled: i2, ...r2 } = e2, s2 = o2 === $.Vertical ? Ut : Gt;
|
|
739
|
+
return t("button", { style: n2, className: w(Yt, o2, "scroll-button"), disabled: i2, ...r2, children: t("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: t("path", { d: s2 }) }) });
|
|
740
|
+
}, Jt = (e2) => {
|
|
741
|
+
const { style: n2, orientation: o2 = $.Vertical, disabled: i2, ...r2 } = e2, s2 = o2 === $.Vertical ? Ut : Gt;
|
|
742
|
+
return t("button", { style: n2, className: w(Yt, o2, "scroll-button"), disabled: i2, ...r2, children: t("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: Zt, children: t("path", { d: s2 }) }) });
|
|
743
|
+
}, Qt = (e2) => {
|
|
712
744
|
const { style: n2, orientation: o2 = $.Vertical, ...i2 } = e2, r2 = o2 === $.Vertical;
|
|
713
745
|
return t("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...n2 }, className: `scrollbar-button ${r2 ? "vertical" : "horizontal"} edge`, ...i2, children: t("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r2 ? "rotate(90) " : "", children: t("path", { style: { transition: "opacity 240ms ease 0s", opacity: e2.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" }) }) });
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
const [
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
}, [
|
|
746
|
+
};
|
|
747
|
+
let te = 0;
|
|
748
|
+
function ee() {
|
|
749
|
+
const [t2, e2] = c(!!document.fullscreenElement), n2 = a(() => {
|
|
750
|
+
const t3 = document.fullscreenElement;
|
|
751
|
+
return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
|
|
752
|
+
}, []);
|
|
753
|
+
return h(() => {
|
|
754
|
+
function t3() {
|
|
755
|
+
const t4 = document.fullscreenElement;
|
|
756
|
+
if (e2(!!t4), !t4) return;
|
|
757
|
+
let n3 = t4.querySelector(".fullscreen-portal-root");
|
|
758
|
+
n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t4.appendChild(n3));
|
|
759
|
+
}
|
|
760
|
+
return te++, t3(), document.addEventListener("fullscreenchange", t3), () => {
|
|
761
|
+
document.removeEventListener("fullscreenchange", t3), te--, te <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t4) => {
|
|
762
|
+
t4.parentNode && t4.parentNode.removeChild(t4);
|
|
763
|
+
}), te = 0);
|
|
764
|
+
};
|
|
765
|
+
}, []), { getPortalContainer: n2, isFullscreen: t2 };
|
|
766
|
+
}
|
|
767
|
+
const ne = 24, oe = _(m((e2, o2) => {
|
|
768
|
+
const { offset: i2 = 0, totalSize: r2 = 0, viewportSize: l2 = 0, style: u2, className: d2, orientation: f2 = $.Vertical, onScrollOffset: _2, onScroll: m2, showCustomScrollButtons: g2 = true, scrollButtonIncrement: y2 = 200, scrollButtonInitialRepeatDelay: S2 = 260, scrollButtonAdditionalRepeatDelay: E2 = 120, minThumbSize: L2 = ne, maxThumbSize: M2, createScrollStartButton: T2 = qt, createScrollEndButton: C2 = Jt, usePortal: k2 = false, ...D2 } = e2;
|
|
769
|
+
X(m2, [m2]);
|
|
770
|
+
const [P2, A2] = c({ offset: 0, length: 0 }), z2 = s(-1), B2 = f2 === $.Vertical, [O2, { width: K2, height: H2 }] = b(), R2 = B2 ? H2 : K2, N2 = X((t2, e3, n2) => {
|
|
771
|
+
if (0 === e3 || 0 === n2) return void A2({ offset: 0, length: L2 });
|
|
772
|
+
const o3 = n2 / R2, i3 = e3 / o3, r3 = Math.min(Math.max(L2, i3), Math.min(R2, M2 ?? Number.MAX_SAFE_INTEGER)), s2 = t2 / o3;
|
|
773
|
+
return { offset: Math.min(Math.max(0, s2), R2 - r3), length: r3 };
|
|
774
|
+
}, [R2, L2, M2]), W2 = X((t2) => {
|
|
775
|
+
const e3 = r2 / R2, n2 = Math.round(t2 * e3);
|
|
776
|
+
A2(N2(n2, l2, r2)), _2?.(n2, l2, r2), z2.current = t2;
|
|
777
|
+
}, [_2, l2, r2, R2, P2]), V2 = X((t2) => {
|
|
778
|
+
A2(N2(t2, l2, r2)), _2?.(t2, l2, r2), z2.current = t2;
|
|
779
|
+
}, [_2, l2, r2]);
|
|
780
|
+
h(() => {
|
|
781
|
+
z2.current !== i2 && 0 !== R2 && (z2.current = -1, A2(N2(i2, l2, r2)));
|
|
782
|
+
}, [i2]), h(() => {
|
|
783
|
+
0 !== R2 && A2(N2(i2, l2, r2));
|
|
784
|
+
}, [l2, r2, B2, R2]);
|
|
785
|
+
const I2 = Math.max(0, r2 - l2), [F2, j2] = c(false), Y2 = s(0), U2 = s(0), G2 = Rt(o2, () => ({ isScrollbar: () => true }), []), Z2 = X((t2) => {
|
|
786
|
+
t2.currentTarget.setPointerCapture(t2.pointerId), j2(true), Y2.current = B2 ? t2.clientY : t2.clientX, U2.current = P2.offset, t2.preventDefault(), t2.stopPropagation();
|
|
787
|
+
}, [B2, P2]), q2 = X((t2) => {
|
|
788
|
+
if (!F2) return;
|
|
789
|
+
const e3 = (B2 ? t2.clientY : t2.clientX) - Y2.current, n2 = U2.current + e3;
|
|
790
|
+
W2(n2);
|
|
791
|
+
}, [F2, B2]), J2 = X((t2) => {
|
|
739
792
|
try {
|
|
740
793
|
t2.currentTarget.releasePointerCapture(t2.pointerId);
|
|
741
794
|
} catch {
|
|
742
795
|
}
|
|
743
|
-
|
|
744
|
-
}, []),
|
|
796
|
+
j2(false);
|
|
797
|
+
}, []), Q2 = X((t2) => {
|
|
745
798
|
if (!t2.currentTarget) return;
|
|
746
|
-
const e3 = t2.currentTarget.getBoundingClientRect(), n2 =
|
|
747
|
-
|
|
748
|
-
}, [
|
|
749
|
-
const e3 = Math.max(1, Math.floor(0.9 *
|
|
750
|
-
|
|
751
|
-
}, [
|
|
799
|
+
const e3 = t2.currentTarget.getBoundingClientRect(), n2 = B2 ? t2.clientY - e3.top : t2.clientX - e3.left;
|
|
800
|
+
W2(n2);
|
|
801
|
+
}, [B2, P2, l2, r2]), tt2 = X((t2) => {
|
|
802
|
+
const e3 = Math.max(1, Math.floor(0.9 * l2));
|
|
803
|
+
B2 ? ("ArrowDown" === t2.key && W2(Math.min(I2, i2 + 1)), "ArrowUp" === t2.key && W2(Math.max(0, i2 - 1)), "PageDown" === t2.key && W2(Math.min(I2, i2 + e3)), "PageUp" === t2.key && W2(Math.max(0, i2 - e3)), "Home" === t2.key && W2(0), "End" === t2.key && W2(I2)) : ("ArrowRight" === t2.key && W2(Math.min(I2, i2 + 1)), "ArrowLeft" === t2.key && W2(Math.max(0, i2 - 1)), "PageDown" === t2.key && W2(Math.min(I2, i2 + e3)), "PageUp" === t2.key && W2(Math.max(0, i2 - e3)), "Home" === t2.key && W2(0), "End" === t2.key && W2(I2));
|
|
804
|
+
}, [B2, l2, r2, i2, I2]), et2 = s(null), nt2 = p(() => t("div", { className: w(Xt), ref: et2, role: "slider", "aria-label": B2 ? "Rows" : "Columns", "aria-orientation": B2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": I2, "aria-valuenow": i2, tabIndex: 0, style: { position: k2 ? "fixed" : "relative", [B2 ? "height" : "width"]: `${P2.length}px`, [B2 ? "width" : "height"]: "100%", transform: B2 ? `translateY(${P2.offset}px)` : `translateX(${P2.offset}px)`, [B2 ? "minHeight" : "minWidth"]: `${L2}px` }, onPointerDown: Z2, onPointerMove: q2, onPointerUp: J2 }), [P2, L2, I2, i2, B2, false]), [ot2, it2] = c(null), rt2 = X(() => {
|
|
752
805
|
let t2;
|
|
753
|
-
t2 = "function" == typeof y2 ? y2(i2,
|
|
806
|
+
t2 = "function" == typeof y2 ? y2(i2, l2, r2) : i2 - y2;
|
|
754
807
|
const e3 = Math.max(0, t2);
|
|
755
|
-
return
|
|
756
|
-
}, [y2, i2,
|
|
808
|
+
return V2(e3), it2(e3), e3;
|
|
809
|
+
}, [y2, i2, l2, r2]), st2 = X(() => {
|
|
757
810
|
let t2;
|
|
758
|
-
t2 = "function" == typeof y2 ? y2(i2,
|
|
811
|
+
t2 = "function" == typeof y2 ? y2(i2, l2, r2) : i2 + y2;
|
|
759
812
|
const e3 = Math.min(I2, t2);
|
|
760
|
-
return
|
|
761
|
-
}, [y2, i2, I2,
|
|
762
|
-
|
|
763
|
-
}, []),
|
|
764
|
-
|
|
765
|
-
const t3 = n2 ?
|
|
766
|
-
t3 !==
|
|
813
|
+
return V2(e3), it2(e3), e3;
|
|
814
|
+
}, [y2, i2, I2, l2, r2]), lt2 = s(null), at2 = s(null), ct2 = a(() => {
|
|
815
|
+
lt2.current && (clearTimeout(lt2.current), lt2.current = null, at2.current = null);
|
|
816
|
+
}, []), ht2 = a((t2, e3, n2, o3 = S2) => {
|
|
817
|
+
at2.current = t2, lt2.current = setTimeout(() => {
|
|
818
|
+
const t3 = n2 ? rt2() : st2();
|
|
819
|
+
t3 !== at2.current ? ht2(t3, false, n2, E2) : ct2();
|
|
767
820
|
}, e3 ? 0 : o3);
|
|
768
|
-
}, [
|
|
769
|
-
|
|
770
|
-
const
|
|
821
|
+
}, [rt2, st2, ct2]);
|
|
822
|
+
h(() => () => ct2(), [ct2]);
|
|
823
|
+
const ut2 = p(() => {
|
|
771
824
|
if (!g2) return null;
|
|
772
|
-
const t2 = { orientation: f2, disabled: i2 <= 0, onMouseUp:
|
|
773
|
-
return
|
|
774
|
-
}, [g2, f2, i2,
|
|
825
|
+
const t2 = { orientation: f2, disabled: i2 <= 0, onMouseUp: ct2, onMouseLeave: ct2, onMouseDown: () => ht2(i2, true, true) };
|
|
826
|
+
return T2?.(t2);
|
|
827
|
+
}, [g2, f2, i2, ot2]), dt2 = p(() => {
|
|
775
828
|
if (!g2) return null;
|
|
776
|
-
const t2 = { orientation: f2, disabled: i2 >= I2, onMouseUp:
|
|
829
|
+
const t2 = { orientation: f2, disabled: i2 >= I2, onMouseUp: ct2, onMouseLeave: ct2, onMouseDown: () => ht2(i2, true, false) };
|
|
777
830
|
return C2?.(t2);
|
|
778
|
-
}, [g2, f2, i2, I2,
|
|
779
|
-
return n("div", { ref: x([
|
|
831
|
+
}, [g2, f2, i2, I2, ot2]), pt2 = B2 ? "vertical" : "horizontal";
|
|
832
|
+
return n("div", { ref: x([G2, o2]), className: w(d2, Ft, pt2, { dragging: F2 }), style: u2, ...D2, children: [ut2, t("div", { ref: O2, role: "scrollbar", "aria-orientation": pt2, "aria-valuemin": 0, "aria-valuemax": I2, "aria-valuenow": i2, tabIndex: 0, className: w(jt, "track", pt2), onPointerDown: Q2, onKeyDown: tt2, children: k2 ? null : nt2 }), k2 ? v(nt2, document.body) : null, dt2] });
|
|
780
833
|
}));
|
|
781
|
-
let
|
|
782
|
-
const
|
|
783
|
-
let e2 = null !==
|
|
784
|
-
return e2 && (
|
|
785
|
-
},
|
|
786
|
-
let r2 =
|
|
834
|
+
let ie = Date.now, re = 1e3, se = {}, le = 1;
|
|
835
|
+
const ae = (t2) => {
|
|
836
|
+
let e2 = null !== se[t2];
|
|
837
|
+
return e2 && (se[t2] = null), e2;
|
|
838
|
+
}, ce = (t2, e2, n2, o2 = 0, i2) => {
|
|
839
|
+
let r2 = ie(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = le++;
|
|
787
840
|
if (h2 % 20 == 0) {
|
|
788
841
|
const t3 = {};
|
|
789
|
-
for (let e3 in
|
|
790
|
-
|
|
842
|
+
for (let e3 in se) t3[e3] = true;
|
|
843
|
+
se = t3;
|
|
791
844
|
}
|
|
792
845
|
const u2 = function(d2) {
|
|
793
|
-
let p2 = true !== d2, f2 =
|
|
846
|
+
let p2 = true !== d2, f2 = ie(), _2 = true;
|
|
794
847
|
try {
|
|
795
848
|
_2 = (!e2 || e2(h2)) ?? true;
|
|
796
849
|
} catch (t3) {
|
|
797
850
|
_2 = false;
|
|
798
851
|
}
|
|
799
|
-
if (!
|
|
852
|
+
if (!se[h2] || !_2) return se[h2] = null, void n2?.(60 - a2 / ((f2 - r2) / re), h2, false);
|
|
800
853
|
if (p2) {
|
|
801
854
|
c2 = Math.round((f2 - s2) / 16.666666666666668) - 1;
|
|
802
855
|
for (let t3 = 0; t3 < Math.min(c2, 4); t3++) u2(true), a2++;
|
|
@@ -808,15 +861,15 @@ const ee = (t2) => {
|
|
|
808
861
|
} catch (t3) {
|
|
809
862
|
g2 = false;
|
|
810
863
|
}
|
|
811
|
-
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (
|
|
864
|
+
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (se[h2] = null, n2?.(60 - a2 / ((f2 - r2) / re), h2, 1 === l2 || null == o2));
|
|
812
865
|
};
|
|
813
|
-
return
|
|
814
|
-
},
|
|
866
|
+
return se[h2] = true, requestAnimationFrame(u2), h2;
|
|
867
|
+
}, he = function(t2) {
|
|
815
868
|
return Math.pow(t2 - 1, 3) + 1;
|
|
816
|
-
},
|
|
869
|
+
}, ue = function(t2) {
|
|
817
870
|
return (t2 /= 0.5) < 1 ? 0.5 * Math.pow(t2, 3) : 0.5 * (Math.pow(t2 - 2, 3) + 2);
|
|
818
871
|
};
|
|
819
|
-
class
|
|
872
|
+
class de {
|
|
820
873
|
constructor(t2, e2) {
|
|
821
874
|
this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, 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 = t2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...e2 };
|
|
822
875
|
}
|
|
@@ -841,7 +894,7 @@ class re {
|
|
|
841
894
|
}
|
|
842
895
|
zoomTo(t2, e2 = false, n2, o2, i2) {
|
|
843
896
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
844
|
-
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (
|
|
897
|
+
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (ae(this.__isDecelerating), this.__isDecelerating = 0);
|
|
845
898
|
const r2 = this.__zoomLevel;
|
|
846
899
|
void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), t2 = Math.max(Math.min(t2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t2);
|
|
847
900
|
const s2 = t2 / r2;
|
|
@@ -852,7 +905,7 @@ class re {
|
|
|
852
905
|
this.zoomTo(this.__zoomLevel * t2, e2, n2, o2, i2);
|
|
853
906
|
}
|
|
854
907
|
scrollTo(t2, e2, n2 = false, o2 = 1) {
|
|
855
|
-
if (this.__isDecelerating && (
|
|
908
|
+
if (this.__isDecelerating && (ae(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
|
|
856
909
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
857
910
|
t2 *= o2, e2 *= o2, this.__computeScrollMax(o2);
|
|
858
911
|
} else o2 = this.__zoomLevel;
|
|
@@ -870,7 +923,7 @@ class re {
|
|
|
870
923
|
if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
|
|
871
924
|
if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
|
|
872
925
|
let n2, o2;
|
|
873
|
-
this.__interruptedAnimation = true, this.__isDecelerating && (
|
|
926
|
+
this.__interruptedAnimation = true, this.__isDecelerating && (ae(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (ae(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
|
|
874
927
|
let i2 = 1 === t2.length;
|
|
875
928
|
i2 ? (n2 = t2[0].pageX, o2 = t2[0].pageY) : (n2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, o2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = e2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
|
|
876
929
|
}
|
|
@@ -925,7 +978,7 @@ class re {
|
|
|
925
978
|
}
|
|
926
979
|
__publish(t2, e2, n2, o2 = false) {
|
|
927
980
|
const i2 = this.__isAnimating;
|
|
928
|
-
if (i2 && (
|
|
981
|
+
if (i2 && (ae(i2), this.__isAnimating = 0), o2 && this.options.animating) {
|
|
929
982
|
this.__scheduledLeft = t2, this.__scheduledTop = e2, this.__scheduledZoom = n2;
|
|
930
983
|
const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = t2 - o3, a2 = e2 - r2, c2 = n2 - s2, h2 = function(t3, e3, n3) {
|
|
931
984
|
n3 && (this.__scrollLeft = o3 + l2 * t3, this.__scrollTop = r2 + a2 * t3, this.__zoomLevel = s2 + c2 * t3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
@@ -934,7 +987,7 @@ class re {
|
|
|
934
987
|
}.bind(this), d2 = function(t3, e3, n3) {
|
|
935
988
|
e3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
936
989
|
}.bind(this);
|
|
937
|
-
this.__isAnimating =
|
|
990
|
+
this.__isAnimating = ce(h2, u2, d2, this.options.animationDuration, i2 ? he : ue);
|
|
938
991
|
} else this.__scheduledLeft = this.__scrollLeft = t2, this.__scheduledTop = this.__scrollTop = e2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(t2, e2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
939
992
|
}
|
|
940
993
|
__computeScrollMax(t2 = this.__zoomLevel) {
|
|
@@ -953,7 +1006,7 @@ class re {
|
|
|
953
1006
|
}.bind(this), i2 = function(t3, e3, n3) {
|
|
954
1007
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
955
1008
|
}.bind(this);
|
|
956
|
-
this.__isDecelerating =
|
|
1009
|
+
this.__isDecelerating = ce(e2, o2, i2);
|
|
957
1010
|
}
|
|
958
1011
|
__stepThroughDeceleration(t2) {
|
|
959
1012
|
let e2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
|
|
@@ -973,7 +1026,7 @@ class re {
|
|
|
973
1026
|
}
|
|
974
1027
|
}
|
|
975
1028
|
}
|
|
976
|
-
const
|
|
1029
|
+
const pe = (e2, n2) => t(oe, { ...e2, ref: n2 }), fe = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: pe, getScrollTo: (t2, e2, n2, o2, i2 = 0) => {
|
|
977
1030
|
for (let i3 = 0; i3 < n2.length; i3++) {
|
|
978
1031
|
const r2 = n2[i3].getBoundingClientRect();
|
|
979
1032
|
let s2 = r2.left - e2, l2 = s2 + r2.width;
|
|
@@ -982,91 +1035,71 @@ const se = (e2, n2) => t(Zt, { ...e2, ref: n2 }), le = Object.freeze(Object.defi
|
|
|
982
1035
|
} else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
|
|
983
1036
|
}
|
|
984
1037
|
return i2;
|
|
985
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
986
|
-
const { children: r2, viewport:
|
|
987
|
-
|
|
988
|
-
M2.current && (M2.current.__scrollTop ===
|
|
989
|
-
}, [
|
|
990
|
-
const
|
|
1038
|
+
} }, Symbol.toStringTag, { value: "Module" })), _e = ({ width: e2, height: n2 }) => t("div", { className: "corner", style: { minWidth: `${e2}px`, width: `${e2}px`, minHeight: `${n2}px`, height: `${n2}px` } }), me = _(m((o2, i2) => {
|
|
1039
|
+
const { children: r2, viewport: l2, onScrollViewport: c2, showHorizontalScrollbar: u2 = true, showVerticalScrollbar: d2 = true, createScrollCorner: f2 = _e, createHorizontalScrollbar: _2 = pe, createVerticalScrollbar: m2 = pe, style: g2, touchElement: y2, disableTouch: v2, ...w2 } = o2, x2 = u2 && _2, S2 = d2 && m2, E2 = X(c2, [c2]), L2 = Rt(i2, () => ({ isScrollPane: () => true }), []), M2 = s(null);
|
|
1040
|
+
h(() => {
|
|
1041
|
+
M2.current && (M2.current.__scrollTop === l2?.top && M2.current.__scrollLeft === l2?.left || M2.current.__isDecelerating || M2.current?.scrollTo(l2?.left, l2?.top, false));
|
|
1042
|
+
}, [l2?.left, l2?.top, y2]);
|
|
1043
|
+
const T2 = a((t2, e2) => {
|
|
991
1044
|
E2?.({ left: t2, top: e2 });
|
|
992
|
-
}, []),
|
|
1045
|
+
}, []), C2 = a((t2) => {
|
|
993
1046
|
M2.current?.doTouchStart(t2.touches, t2.timeStamp);
|
|
994
|
-
}, []), k2 =
|
|
1047
|
+
}, []), k2 = a((t2) => {
|
|
995
1048
|
t2.preventDefault(), M2.current?.doTouchMove(t2.touches, t2.timeStamp);
|
|
996
|
-
}, []), D2 =
|
|
1049
|
+
}, []), D2 = a((t2) => {
|
|
997
1050
|
M2.current?.doTouchEnd(t2.timeStamp);
|
|
998
|
-
}, []), P2 =
|
|
1051
|
+
}, []), P2 = a(({ containerWidth: t2, containerHeight: e2, totalWidth: n2, totalHeight: o3 }) => {
|
|
999
1052
|
M2.current.setDimensions(t2, e2, n2, o3);
|
|
1000
1053
|
}, []);
|
|
1001
|
-
|
|
1054
|
+
h(() => {
|
|
1002
1055
|
const t2 = y2 ?? L2.current;
|
|
1003
|
-
if (!v2 &&
|
|
1056
|
+
if (!v2 && yt().supportsTouchEvents && t2 && l2) {
|
|
1004
1057
|
if (!M2.current) {
|
|
1005
1058
|
const t3 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1006
|
-
M2.current = new
|
|
1059
|
+
M2.current = new de(T2, t3);
|
|
1007
1060
|
}
|
|
1008
|
-
|
|
1061
|
+
yt().supportsTouchEvents && (t2.addEventListener("touchstart", C2), t2.addEventListener("touchend", D2), t2.addEventListener("touchmove", k2)), P2({ containerWidth: l2?.width, containerHeight: l2?.height, totalWidth: l2?.totalWidth, totalHeight: l2?.totalHeight });
|
|
1009
1062
|
}
|
|
1010
1063
|
return () => {
|
|
1011
|
-
t2?.removeEventListener("touchstart",
|
|
1064
|
+
t2?.removeEventListener("touchstart", C2), t2?.removeEventListener("touchend", D2), t2?.removeEventListener("touchmove", k2);
|
|
1012
1065
|
};
|
|
1013
|
-
}, [
|
|
1014
|
-
const [A2, { width: z2 }] = b(), [B2, { height: O2 }] = b(), K2 =
|
|
1066
|
+
}, [l2?.width, l2?.height, l2?.totalWidth, l2?.totalHeight, v2, y2]);
|
|
1067
|
+
const [A2, { width: z2 }] = b(), [B2, { height: O2 }] = b(), K2 = p(() => {
|
|
1015
1068
|
if (!S2) return null;
|
|
1016
|
-
const e2 = m2({ orientation: $.Vertical, offset:
|
|
1069
|
+
const e2 = m2({ orientation: $.Vertical, offset: l2?.top, viewportSize: l2?.height, totalSize: l2?.totalHeight, onScrollOffset: (t2) => {
|
|
1017
1070
|
E2?.({ top: t2 });
|
|
1018
1071
|
} });
|
|
1019
1072
|
return t("div", { style: { display: "flex", flex: "0" }, ref: A2, children: e2 });
|
|
1020
|
-
}, [m2,
|
|
1073
|
+
}, [m2, l2?.top, l2?.height, l2?.totalHeight]), H2 = p(() => {
|
|
1021
1074
|
if (!x2) return null;
|
|
1022
|
-
const o3 = _2({ orientation: $.Horizontal, offset:
|
|
1075
|
+
const o3 = _2({ orientation: $.Horizontal, offset: l2?.left, viewportSize: l2?.width, totalSize: l2?.totalWidth, onScrollOffset: (t2) => {
|
|
1023
1076
|
E2?.({ left: t2 });
|
|
1024
1077
|
} });
|
|
1025
1078
|
return n("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${z2}px)` }, children: t("div", { ref: B2, className: "sizer", children: o3 }) }), S2 ? f2({ width: z2, height: O2 }) : t(e, {})] });
|
|
1026
|
-
}, [_2,
|
|
1079
|
+
}, [_2, l2?.left, l2?.width, l2?.totalWidth, S2, f2, z2, O2]);
|
|
1027
1080
|
return t("div", { style: { position: "relative", display: "flex", minWidth: S2 ? `${z2}px` : void 0, minHeight: x2 ? `${O2}px` : void 0, ...g2 }, ...w2, ref: L2, children: n("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [n("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [t("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: r2 }), S2 ? K2 : t(e, {})] }), x2 ? H2 : t(e, {})] }) });
|
|
1028
1081
|
}));
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
const [t2, e2] = a(!!document.fullscreenElement), n2 = s(() => {
|
|
1033
|
-
const t3 = document.fullscreenElement;
|
|
1034
|
-
return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
|
|
1035
|
-
}, []);
|
|
1036
|
-
return c(() => {
|
|
1037
|
-
function t3() {
|
|
1038
|
-
const t4 = document.fullscreenElement;
|
|
1039
|
-
if (e2(!!t4), !t4) return;
|
|
1040
|
-
let n3 = t4.querySelector(".fullscreen-portal-root");
|
|
1041
|
-
n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t4.appendChild(n3));
|
|
1042
|
-
}
|
|
1043
|
-
return he++, t3(), document.addEventListener("fullscreenchange", t3), () => {
|
|
1044
|
-
document.removeEventListener("fullscreenchange", t3), he--, he <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t4) => {
|
|
1045
|
-
t4.parentNode && t4.parentNode.removeChild(t4);
|
|
1046
|
-
}), he = 0);
|
|
1047
|
-
};
|
|
1048
|
-
}, []), { getPortalContainer: n2, isFullscreen: t2 };
|
|
1049
|
-
}
|
|
1050
|
-
const de = 300, pe = 100, fe = 1e6, _e = 100, me = 50, ge = _(m((t2, e2) => {
|
|
1051
|
-
const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: i2 = 0, minSize: r2 = 0, endGap: l2 = de, endScrollIncrement: c2 = pe, style: h2 = dt, onMouseDown: u2, onScrollOffset: p2, onScroll: f2, scaleLimit: _2 = fe, scaleFactor: m2 = _e, precisionFactor: g2 = me, createScrollbar: y2 = se, ...v2 } = t2;
|
|
1082
|
+
me.displayName = "ScrollPane";
|
|
1083
|
+
const ge = 300, ye = 100, ve = 1e6, we = 100, xe = 50, be = _(m((t2, e2) => {
|
|
1084
|
+
const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: i2 = 0, minSize: r2 = 0, endGap: s2 = ge, endScrollIncrement: l2 = ye, style: h2 = gt, onMouseDown: u2, onScrollOffset: d2, onScroll: f2, scaleLimit: _2 = ve, scaleFactor: m2 = we, precisionFactor: g2 = xe, createScrollbar: y2 = pe, ...v2 } = t2;
|
|
1052
1085
|
f2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1053
|
-
const w2 =
|
|
1054
|
-
const t3 = 0 === _2 ? i2 : Math.min(i2 ?? 0, Math.max(r2 ?? 0, (n2 ?? 0) + (o2 ?? 0)) + (
|
|
1055
|
-
return { offset: Math.ceil(n2 / e3), totalSize: a2, viewportSize: Math.ceil(o2 / e3), scaledOffset: n2, scaledTotalSize: i2, scaledViewportSize: o2, factor: e3, precision:
|
|
1056
|
-
}, [n2, i2, o2, x2, r2,
|
|
1086
|
+
const w2 = X(u2, [u2]), [x2, b2] = c(false), S2 = p(() => {
|
|
1087
|
+
const t3 = 0 === _2 ? i2 : Math.min(i2 ?? 0, Math.max(r2 ?? 0, (n2 ?? 0) + (o2 ?? 0)) + (s2 ?? 0)), e3 = 0 !== _2 && t3 > _2 ? m2 : 1, l3 = e3 / g2, a2 = Math.ceil(t3 / e3);
|
|
1088
|
+
return { offset: Math.ceil(n2 / e3), totalSize: a2, viewportSize: Math.ceil(o2 / e3), scaledOffset: n2, scaledTotalSize: i2, scaledViewportSize: o2, factor: e3, precision: l3 };
|
|
1089
|
+
}, [n2, i2, o2, x2, r2, s2, l2]), E2 = X((t3, e3, n3) => {
|
|
1057
1090
|
const o3 = S2.offset;
|
|
1058
|
-
Math.abs(t3 - o3) < S2.precision && (t3 = o3),
|
|
1059
|
-
}, [
|
|
1060
|
-
}, []), M2 =
|
|
1091
|
+
Math.abs(t3 - o3) < S2.precision && (t3 = o3), d2?.(t3 * S2.factor, o3, S2.viewportSize);
|
|
1092
|
+
}, [d2, S2]), L2 = a((t3) => {
|
|
1093
|
+
}, []), M2 = a((t3) => {
|
|
1061
1094
|
document.removeEventListener("mousemove", L2), document.removeEventListener("mouseup", M2), b2(false);
|
|
1062
|
-
}, []),
|
|
1095
|
+
}, []), T2 = a((t3) => {
|
|
1063
1096
|
b2(true), w2?.(t3), document.addEventListener("mousemove", L2, { passive: true }), document.addEventListener("mouseup", M2, { passive: true });
|
|
1064
1097
|
}, [L2, M2]);
|
|
1065
|
-
return
|
|
1098
|
+
return pe({ style: h2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2 }, e2);
|
|
1066
1099
|
}));
|
|
1067
|
-
|
|
1068
|
-
const
|
|
1069
|
-
const { refFocusStart: o2, ...i2 } = e2, r2 =
|
|
1100
|
+
be.displayName = "VirtualScrollbar";
|
|
1101
|
+
const Se = { 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" }, Ee = _(m((e2, n2) => {
|
|
1102
|
+
const { refFocusStart: o2, ...i2 } = e2, r2 = s(null), l2 = a(() => {
|
|
1070
1103
|
if (o2) return void o2?.current?.focus();
|
|
1071
1104
|
const t2 = r2.current.parentElement.children;
|
|
1072
1105
|
let e3 = [];
|
|
@@ -1080,16 +1113,16 @@ const ye = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bott
|
|
|
1080
1113
|
return t3.tabindex - e4.tabindex;
|
|
1081
1114
|
}), e3[0].child.focus());
|
|
1082
1115
|
}, [o2]);
|
|
1083
|
-
return t("div", { tabIndex: 0, ref: x([r2, n2]), onFocus:
|
|
1116
|
+
return t("div", { tabIndex: 0, ref: x([r2, n2]), onFocus: l2, ...i2 });
|
|
1084
1117
|
}));
|
|
1085
|
-
const
|
|
1086
|
-
const { className:
|
|
1118
|
+
const Le = _(m((i2, r2) => {
|
|
1119
|
+
const { className: l2, style: a2, children: c2, radius: h2 = 4, strokeWidth: u2 = 1, strokeColor: d2 = "grey", ...f2 } = i2, [_2, { width: m2, height: g2 }] = b(), y2 = s(null), v2 = (t2, e2 = 0) => {
|
|
1087
1120
|
const n2 = t2 / 2, o2 = g2 - n2 + e2;
|
|
1088
1121
|
return (function(t3, e3, n3 = false) {
|
|
1089
1122
|
if (0 === e3) return t3;
|
|
1090
1123
|
function o3(t4, e4, n4) {
|
|
1091
|
-
let o4 = e4.x - t4.x, r4 = e4.y - t4.y,
|
|
1092
|
-
return i3(t4, e4, Math.min(1, n4 /
|
|
1124
|
+
let o4 = e4.x - t4.x, r4 = e4.y - t4.y, s3 = Math.sqrt(o4 * o4 + r4 * r4);
|
|
1125
|
+
return i3(t4, e4, Math.min(1, n4 / s3));
|
|
1093
1126
|
}
|
|
1094
1127
|
function i3(t4, e4, n4) {
|
|
1095
1128
|
return { x: t4.x + (e4.x - t4.x) * n4, y: t4.y + (e4.y - t4.y) * n4 };
|
|
@@ -1097,44 +1130,44 @@ const we = _(m((i2, r2) => {
|
|
|
1097
1130
|
function r3(t4, e4) {
|
|
1098
1131
|
t4.length > 2 && (t4[t4.length - 2] = e4.x, t4[t4.length - 1] = e4.y);
|
|
1099
1132
|
}
|
|
1100
|
-
function
|
|
1133
|
+
function s2(t4) {
|
|
1101
1134
|
return { x: parseFloat(t4[t4.length - 2]), y: parseFloat(t4[t4.length - 1]) };
|
|
1102
1135
|
}
|
|
1103
|
-
let
|
|
1136
|
+
let l3 = t3.split(/[,\s]/).reduce(function(t4, e4) {
|
|
1104
1137
|
let n4 = e4.match("([a-zA-Z])(.+)");
|
|
1105
1138
|
return n4 ? (t4.push(n4[1]), t4.push(n4[2])) : t4.push(e4), t4;
|
|
1106
1139
|
}, []).reduce(function(t4, e4) {
|
|
1107
1140
|
return parseFloat(e4) == e4 && t4.length ? t4[t4.length - 1].push(e4) : t4.push([e4]), t4;
|
|
1108
1141
|
}, []), a3 = [];
|
|
1109
|
-
if (
|
|
1110
|
-
let t4 =
|
|
1111
|
-
"Z" ===
|
|
1112
|
-
for (let t5 = 1; t5 <
|
|
1113
|
-
let h3 = a3[a3.length - 1], u3 =
|
|
1114
|
-
if (
|
|
1115
|
-
let t6,
|
|
1116
|
-
n3 ? (t6 = i3(
|
|
1117
|
-
let _3 = i3(t6,
|
|
1118
|
-
g3.origPoint =
|
|
1142
|
+
if (l3.length > 1) {
|
|
1143
|
+
let t4 = s2(l3[0]), c3 = null;
|
|
1144
|
+
"Z" === l3[l3.length - 1][0] && l3[0].length > 2 && (c3 = ["L", t4.x, t4.y], l3[l3.length - 1] = c3), a3.push(l3[0]);
|
|
1145
|
+
for (let t5 = 1; t5 < l3.length; t5++) {
|
|
1146
|
+
let h3 = a3[a3.length - 1], u3 = l3[t5], d3 = u3 === c3 ? l3[1] : l3[t5 + 1];
|
|
1147
|
+
if (d3 && h3 && h3.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
|
|
1148
|
+
let t6, l4, c4 = s2(h3), p2 = s2(u3), f3 = s2(d3);
|
|
1149
|
+
n3 ? (t6 = i3(p2, h3.origPoint || c4, e3), l4 = i3(p2, d3.origPoint || f3, e3)) : (t6 = o3(p2, c4, e3), l4 = o3(p2, f3, e3)), r3(u3, t6), u3.origPoint = p2, a3.push(u3);
|
|
1150
|
+
let _3 = i3(t6, p2, 0.5), m3 = i3(p2, l4, 0.5), g3 = ["C", _3.x, _3.y, m3.x, m3.y, l4.x, l4.y];
|
|
1151
|
+
g3.origPoint = p2, a3.push(g3);
|
|
1119
1152
|
} else a3.push(u3);
|
|
1120
1153
|
}
|
|
1121
1154
|
if (c3) {
|
|
1122
|
-
let t5 =
|
|
1155
|
+
let t5 = s2(a3[a3.length - 1]);
|
|
1123
1156
|
a3.push(["Z"]), r3(a3[0], t5);
|
|
1124
1157
|
}
|
|
1125
|
-
} else a3 =
|
|
1158
|
+
} else a3 = l3;
|
|
1126
1159
|
return a3.reduce(function(t4, e4) {
|
|
1127
1160
|
return t4 + e4.join(" ") + " ";
|
|
1128
1161
|
}, "");
|
|
1129
1162
|
})(`${`M 0 ${n2} L ${h2 - 0.5} ${n2} L ${h2 - 0.5} ${o2} L ${2 * h2} ${o2}`} ${`L ${m2 - 2 * h2} ${o2}`} ${`M ${m2 - 2 * h2} ${o2} L ${m2 - h2} ${o2} L ${m2 - h2} ${n2} L ${m2} ${n2}`}`, h2);
|
|
1130
|
-
}, w2 =
|
|
1163
|
+
}, w2 = p(() => v2(u2), [m2, g2, h2, u2]), S2 = p(() => {
|
|
1131
1164
|
if (0 === h2) return;
|
|
1132
1165
|
const t2 = h2 / 2;
|
|
1133
1166
|
return v2(h2) + `L ${m2} 0 L 0 0 L 0 ${t2}`;
|
|
1134
|
-
}, [w2, h2, u2]), E2 =
|
|
1135
|
-
return n("div", { className:
|
|
1167
|
+
}, [w2, h2, u2]), E2 = p(() => ({ style: { clipPath: `path('${S2}')` } }), [S2]);
|
|
1168
|
+
return n("div", { className: l2, style: { display: "flex", flexDirection: "row", ...a2 }, ...f2, ref: x([y2, _2, r2]), children: [o.isValidElement(c2) ? o.cloneElement(c2, E2) : t(e, {}), t("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: m2, height: g2, viewBox: `0 0 ${m2} ${g2}`, children: t("path", { d: w2, stroke: d2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: u2 }) })] });
|
|
1136
1169
|
}));
|
|
1137
|
-
class
|
|
1170
|
+
class Me extends g {
|
|
1138
1171
|
static getDerivedStateFromError() {
|
|
1139
1172
|
return { hasError: true };
|
|
1140
1173
|
}
|
|
@@ -1145,13 +1178,13 @@ class xe extends g {
|
|
|
1145
1178
|
return this.props.children;
|
|
1146
1179
|
}
|
|
1147
1180
|
}
|
|
1148
|
-
const
|
|
1149
|
-
const n2 = N(), o2 =
|
|
1181
|
+
const Te = ({ children: e2 }) => {
|
|
1182
|
+
const n2 = N(), o2 = a((t2) => {
|
|
1150
1183
|
n2.showError(t2);
|
|
1151
1184
|
}, [n2]);
|
|
1152
|
-
return t(
|
|
1185
|
+
return t(Me, { onError: o2, children: e2 });
|
|
1153
1186
|
};
|
|
1154
|
-
class
|
|
1187
|
+
class Ce {
|
|
1155
1188
|
constructor(t2) {
|
|
1156
1189
|
this.notifier = t2, this.handleUnhandledRejection = (t3) => {
|
|
1157
1190
|
const e2 = t3.reason;
|
|
@@ -1167,72 +1200,72 @@ class Se {
|
|
|
1167
1200
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1168
1201
|
}
|
|
1169
1202
|
}
|
|
1170
|
-
const
|
|
1203
|
+
const ke = ({ children: n2 }) => {
|
|
1171
1204
|
const o2 = N();
|
|
1172
|
-
return
|
|
1173
|
-
const t2 = new
|
|
1205
|
+
return h(() => {
|
|
1206
|
+
const t2 = new Ce(o2);
|
|
1174
1207
|
return () => {
|
|
1175
1208
|
t2.cleanup();
|
|
1176
1209
|
};
|
|
1177
1210
|
}, [o2]), t(e, { children: n2 });
|
|
1178
|
-
},
|
|
1179
|
-
const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 =
|
|
1211
|
+
}, De = () => null, Pe = {}, Ae = (e2) => {
|
|
1212
|
+
const { onPointerDown: n2, style: o2, splitDirection: i2, paddingBefore: r2 = 0, paddingAfter: s2 = 0, disabled: l2, key: a2, hitAreaProps: c2 = Pe, ...h2 } = e2, u2 = "row" === i2, { style: d2, className: p2, ...f2 } = c2;
|
|
1180
1213
|
return t("div", { style: { ...o2, position: "relative" }, ...h2, children: t("div", { className: w("hit-box", p2), style: { left: (u2 ? -r2 : 0) + "px", width: `calc(100% + ${u2 ? r2 + s2 : 0}px)`, top: (u2 ? 0 : -r2) + "px", height: `calc(100% + ${u2 ? 0 : r2 + s2}px)`, position: "absolute", ...d2 }, onPointerDown: l2 ? void 0 : n2, ...f2 }) }, a2);
|
|
1181
|
-
},
|
|
1214
|
+
}, ze = {}, Be = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, $e = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, Oe = (t2, e2) => {
|
|
1182
1215
|
if (null == t2) return null;
|
|
1183
1216
|
const n2 = { percent: null, pixels: null };
|
|
1184
1217
|
let o2 = e2;
|
|
1185
1218
|
return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
|
|
1186
|
-
},
|
|
1187
|
-
const { elementBefore: r2, elementAfter:
|
|
1219
|
+
}, Ke = _(m((e2, i2) => {
|
|
1220
|
+
const { elementBefore: r2, elementAfter: l2, splitDirection: a2 = "row", fixedPane: u2 = null, position: d2, onPositionChange: f2, minBefore: _2, maxBefore: m2, minAfter: g2, maxAfter: y2, children: v2, className: S2, style: E2, disabled: L2 = false, onDragStart: M2, onDragResize: T2, onDragFinish: C2, resizerProps: k2 = ze, paneProps: D2 = ze, paneBeforeProps: P2 = ze, paneAfterProps: A2 = ze, createResizer: z2 = Ae } = e2;
|
|
1188
1221
|
if (v2) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1189
|
-
const B2 =
|
|
1222
|
+
const B2 = p(() => o.isValidElement(l2) && o.isValidElement(r2), [l2, r2]), $2 = p(() => {
|
|
1190
1223
|
let t2 = null;
|
|
1191
1224
|
u2 && ("before" === u2 ? t2 = 0 : "after" === u2 && (t2 = 1));
|
|
1192
1225
|
const e3 = null === t2;
|
|
1193
|
-
return { fixedPaneOffset: t2, isPercent: e3, minBefore:
|
|
1194
|
-
}, [_2, m2, g2, y2]), O2 =
|
|
1195
|
-
|
|
1196
|
-
H2(
|
|
1197
|
-
}, [
|
|
1198
|
-
const [R2, { width: N2, height: W2 }] = b(), [
|
|
1226
|
+
return { fixedPaneOffset: t2, isPercent: e3, minBefore: Oe(_2, e3), maxBefore: Oe(m2, e3), minAfter: Oe(g2, e3), maxAfter: Oe(y2, e3) };
|
|
1227
|
+
}, [_2, m2, g2, y2]), O2 = X(f2, [f2]), [K2, H2] = c(() => Oe(d2, null === u2));
|
|
1228
|
+
h(() => {
|
|
1229
|
+
H2(Oe(d2, null === u2));
|
|
1230
|
+
}, [d2, u2]);
|
|
1231
|
+
const [R2, { width: N2, height: W2 }] = b(), [V2, { width: I2, height: F2 }] = b(), j2 = "row" === a2 ? I2 : F2, Y2 = "row" === a2 ? N2 : W2, U2 = p(() => ((t2, e3, n2, o2) => {
|
|
1199
1232
|
const i3 = [null, null], r3 = [null, null];
|
|
1200
|
-
if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e3) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = t2?.pixels, r3[1] = 100) : (i3[1] = t2?.pixels - n2, r3[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (r3[0] = t2?.percent, r3[1] = 100 - t2?.percent) : (r3[1] = t2?.percent, r3[0] = 100 - t2?.percent)), { percents: r3, pixels: i3, minBefore:
|
|
1201
|
-
let
|
|
1202
|
-
|
|
1203
|
-
const f3 = Math.max(0, Math.min(100,
|
|
1204
|
-
return r3[0] = f3, r3[1] = 100 - r3[0], { percents: r3, pixels: i3, minBefore: `${
|
|
1205
|
-
})(K2,
|
|
1206
|
-
const e3 =
|
|
1233
|
+
if (t2 || (t2 = { percent: null === o2.fixedPaneOffset ? 50 : null, pixels: null === o2.fixedPaneOffset ? null : 0 }), 0 === e3) return null != t2?.pixels ? 1 !== o2.fixedPaneOffset ? (i3[0] = t2?.pixels, r3[1] = 100) : (i3[1] = t2?.pixels - n2, r3[0] = 100) : null != t2?.percent && (1 !== o2.fixedPaneOffset ? (r3[0] = t2?.percent, r3[1] = 100 - t2?.percent) : (r3[1] = t2?.percent, r3[0] = 100 - t2?.percent)), { percents: r3, pixels: i3, minBefore: $e(o2.minBefore, true), maxBefore: $e(o2.maxBefore, true), minAfter: $e(o2.minAfter), maxAfter: $e(o2.maxAfter) };
|
|
1234
|
+
let s2 = Be(t2, e3, 1 !== o2.fixedPaneOffset), l3 = e3 - n2, a3 = Be(o2.minBefore, l3, true) ?? 0, c2 = Be(o2.maxBefore, l3, true) ?? l3, h2 = 0, u3 = 0, d3 = 0, p2 = l3;
|
|
1235
|
+
h2 = (Be(o2.maxAfter, e3, false) ?? n2) - n2, u3 = Be(o2.minAfter, e3, false) ?? e3, d3 = Math.max(a3, h2), p2 = Math.min(c2, u3), s2 = Math.max(d3, Math.min(s2, p2)), u3 = Math.min(l3 - s2, Be(o2.maxAfter, l3 - s2, true) ?? l3), h2 = Math.min(l3 - s2, Be(o2.minAfter, l3 - s2, true) ?? l3), i3[0] = s2, i3[1] = l3 - i3[0];
|
|
1236
|
+
const f3 = Math.max(0, Math.min(100, s2 / l3 * 100));
|
|
1237
|
+
return r3[0] = f3, r3[1] = 100 - r3[0], { percents: r3, pixels: i3, minBefore: `${a3}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
|
|
1238
|
+
})(K2, Y2, j2, $2), [$2, K2, Y2, j2, a2]), [G2, Z2] = c(false), q2 = X(M2, [M2]), J2 = X(T2, [T2]), Q2 = X(C2, [C2]), tt2 = s(null), et2 = s(null), nt2 = s(null), { style: ot2, className: it2, ...rt2 } = D2, st2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...ot2 }, { className: lt2, style: at2, ...ct2 } = P2, { className: ht2, style: ut2, ...dt2 } = A2, pt2 = { flex: "1 1 100%", width: "100%", ...E2, flexDirection: a2, display: "flex" }, { className: ft2, style: _t2, onPointerDown: mt2, ...gt2 } = k2, yt2 = X((t2) => {
|
|
1239
|
+
const e3 = Oe(t2, null === u2);
|
|
1207
1240
|
H2(e3);
|
|
1208
|
-
}, [u2]), vt2 =
|
|
1241
|
+
}, [u2]), vt2 = X((t2) => {
|
|
1209
1242
|
if (L2 || !G2) return;
|
|
1210
1243
|
const e3 = bt2.current?.getBoundingClientRect();
|
|
1211
1244
|
let n2 = 0;
|
|
1212
|
-
n2 = "row" ===
|
|
1213
|
-
}, [$2,
|
|
1245
|
+
n2 = "row" === a2 ? (t2.clientX ?? t2.touches?.[0]?.clientX) - e3.x : (t2.clientY ?? t2.touches?.[0]?.clientY) - e3.y, n2 = Math.max(0, Math.min(Y2, n2)), 1 === $2.fixedPaneOffset && (n2 = Y2 - n2), d2 && K2.pixels === n2 || H2({ pixels: n2, percent: null }), J2?.(n2), t2.stopPropagation(), t2.preventDefault();
|
|
1246
|
+
}, [$2, a2, L2, G2, K2, Y2]), wt2 = X((t2) => {
|
|
1214
1247
|
if (document.removeEventListener("pointermove", vt2), document.removeEventListener("touchmove", vt2), document.removeEventListener("pointerup", wt2), !G2) return;
|
|
1215
1248
|
if (Z2(false), !K2) return;
|
|
1216
1249
|
Q2(K2.pixels);
|
|
1217
|
-
if (!
|
|
1250
|
+
if (!Oe(d2, null === u2) || K2.pixels !== d2) {
|
|
1218
1251
|
const t3 = { ...K2 };
|
|
1219
|
-
null === t3.percent && (t3.percent = t3.pixels /
|
|
1252
|
+
null === t3.percent && (t3.percent = t3.pixels / Y2 * 100), O2(t3);
|
|
1220
1253
|
}
|
|
1221
1254
|
t2.stopPropagation(), t2.preventDefault();
|
|
1222
|
-
}, [K2, G2,
|
|
1255
|
+
}, [K2, G2, d2, u2, Y2]), xt2 = X((t2) => {
|
|
1223
1256
|
mt2?.(t2), t2.defaultPrevented || L2 || G2 || (Z2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
|
|
1224
|
-
}, [mt2]), bt2 =
|
|
1257
|
+
}, [mt2]), bt2 = Rt(i2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = p(() => B2 ? z2?.({ key: "resizer", ref: x([V2, et2]), className: w("resizer", ft2), onPointerDownCapture: xt2, style: { cursor: L2 ? void 0 : "row" === a2 ? "ew-resize" : "ns-resize", minWidth: "row" === a2 ? "2px" : void 0, minHeight: "row" !== a2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ..._t2 }, splitDirection: a2, disabled: L2, ...gt2 }) : null, [B2, ft2, gt2, a2, _t2, L2]), Et2 = "row" === a2 ? "Width" : "Height", Lt2 = p(() => {
|
|
1225
1258
|
if (!r2) return null;
|
|
1226
|
-
const e3 = { ...st2, ...at2, flex: 0 === $2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Et2}`]: U2?.minBefore, [`max${Et2}`]:
|
|
1259
|
+
const e3 = { ...st2, ...at2, flex: 0 === $2.fixedPaneOffset && null !== U2?.pixels[0] ? `0 0 ${Math.round(U2?.pixels[0])}px` : `1 1 ${Math.round(U2?.percents[0] ?? 100)}%`, [`min${Et2}`]: U2?.minBefore, [`max${Et2}`]: l2 ? U2?.maxBefore : "100%" };
|
|
1227
1260
|
return t("div", { ref: tt2, className: w("before", it2, lt2), style: e3, ...rt2, ...ct2, children: r2 }, "before");
|
|
1228
|
-
}, [r2, D2, P2, $2, U2]), Mt2 =
|
|
1229
|
-
if (!
|
|
1261
|
+
}, [r2, D2, P2, $2, U2]), Mt2 = p(() => {
|
|
1262
|
+
if (!l2) return null;
|
|
1230
1263
|
const e3 = { ...st2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== U2?.pixels[1] ? `0 0 ${Math.round(U2?.pixels[1])}px` : `1 1 ${Math.round(U2?.percents[1] ?? 100)}%`, [`min${Et2}`]: U2?.minAfter, [`max${Et2}`]: r2 ? U2?.maxAfter : "100%" };
|
|
1231
|
-
return t("div", { ref: nt2, className: w("after", it2, ht2), style: e3, ...rt2, ...dt2, children:
|
|
1232
|
-
}, [
|
|
1233
|
-
return n("div", { ref: x([R2, bt2]), className: w("splitPane", "row" ===
|
|
1264
|
+
return t("div", { ref: nt2, className: w("after", it2, ht2), style: e3, ...rt2, ...dt2, children: l2 }, "after");
|
|
1265
|
+
}, [l2, D2, A2, $2, U2]);
|
|
1266
|
+
return n("div", { ref: x([R2, bt2]), className: w("splitPane", "row" === a2 ? "vertical" : "horizontal", { dragging: G2 }, S2), style: pt2, children: [Lt2, St2, Mt2] });
|
|
1234
1267
|
}));
|
|
1235
|
-
function
|
|
1268
|
+
function He(t2) {
|
|
1236
1269
|
if ("function" == typeof t2) return t2;
|
|
1237
1270
|
if ("string" == typeof t2) {
|
|
1238
1271
|
const e2 = t2.trim();
|
|
@@ -1244,17 +1277,17 @@ function ze(t2) {
|
|
|
1244
1277
|
try {
|
|
1245
1278
|
if (/;base64/i.test(n2)) {
|
|
1246
1279
|
if ("undefined" != typeof atob) {
|
|
1247
|
-
const t5 = atob(o2);
|
|
1280
|
+
const t5 = atob(o2), e4 = t5.length;
|
|
1248
1281
|
if ("undefined" != typeof TextDecoder) {
|
|
1249
|
-
const
|
|
1250
|
-
for (let
|
|
1251
|
-
return new TextDecoder("utf-8").decode(
|
|
1282
|
+
const n4 = new Uint8Array(e4);
|
|
1283
|
+
for (let o3 = 0; o3 < e4; o3++) n4[o3] = t5.charCodeAt(o3);
|
|
1284
|
+
return new TextDecoder("utf-8").decode(n4);
|
|
1252
1285
|
}
|
|
1253
|
-
let
|
|
1254
|
-
for (let
|
|
1255
|
-
|
|
1286
|
+
let n3 = "";
|
|
1287
|
+
for (let o3 = 0; o3 < e4; o3++) {
|
|
1288
|
+
n3 += `%${t5.charCodeAt(o3).toString(16).padStart(2, "0")}`;
|
|
1256
1289
|
}
|
|
1257
|
-
return decodeURIComponent(
|
|
1290
|
+
return decodeURIComponent(n3);
|
|
1258
1291
|
}
|
|
1259
1292
|
return (globalThis.Buffer ? globalThis.Buffer.from(o2, "base64") : require("buffer").Buffer.from(o2, "base64")).toString("utf-8");
|
|
1260
1293
|
}
|
|
@@ -1267,12 +1300,12 @@ function ze(t2) {
|
|
|
1267
1300
|
return null;
|
|
1268
1301
|
}
|
|
1269
1302
|
})(e2);
|
|
1270
|
-
if (t3) return
|
|
1303
|
+
if (t3) return We(t3);
|
|
1271
1304
|
}
|
|
1272
1305
|
if (e2.startsWith("<")) {
|
|
1273
|
-
if (/^<\s*svg\b/i.test(e2)) return
|
|
1306
|
+
if (/^<\s*svg\b/i.test(e2)) return We(e2);
|
|
1274
1307
|
if (/^<\s*path\b/i.test(e2)) {
|
|
1275
|
-
const t3 =
|
|
1308
|
+
const t3 = Re(e2);
|
|
1276
1309
|
if (t3) return { paths: [{ d: t3 }] };
|
|
1277
1310
|
}
|
|
1278
1311
|
return { paths: [{ d: e2 }] };
|
|
@@ -1284,7 +1317,7 @@ function ze(t2) {
|
|
|
1284
1317
|
for (const n2 of t2) if ("string" == typeof n2) {
|
|
1285
1318
|
const t3 = String(n2).trim();
|
|
1286
1319
|
if (t3.startsWith("<path")) {
|
|
1287
|
-
const n3 =
|
|
1320
|
+
const n3 = Re(t3);
|
|
1288
1321
|
n3 && e2.push({ d: n3 });
|
|
1289
1322
|
} else e2.push({ d: t3 });
|
|
1290
1323
|
} else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && e2.push({ ...n2 });
|
|
@@ -1292,12 +1325,12 @@ function ze(t2) {
|
|
|
1292
1325
|
}
|
|
1293
1326
|
return t2;
|
|
1294
1327
|
}
|
|
1295
|
-
function
|
|
1328
|
+
function Re(t2) {
|
|
1296
1329
|
const e2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(t2);
|
|
1297
1330
|
return e2 ? e2[1] ?? e2[2] ?? null : null;
|
|
1298
1331
|
}
|
|
1299
|
-
function
|
|
1300
|
-
if ("svg" in t2) return { ...t2, svg:
|
|
1332
|
+
function Ne(t2) {
|
|
1333
|
+
if ("svg" in t2) return { ...t2, svg: He(t2.svg) };
|
|
1301
1334
|
if ("url" in t2) {
|
|
1302
1335
|
const e2 = "string" == typeof t2.url ? { src: t2.url } : t2.url;
|
|
1303
1336
|
return { ...t2, url: e2 };
|
|
@@ -1308,7 +1341,7 @@ function $e(t2) {
|
|
|
1308
1341
|
}
|
|
1309
1342
|
return t2;
|
|
1310
1343
|
}
|
|
1311
|
-
function
|
|
1344
|
+
function We(t2) {
|
|
1312
1345
|
try {
|
|
1313
1346
|
if ("undefined" != typeof DOMParser) {
|
|
1314
1347
|
const e3 = new DOMParser().parseFromString(t2, "image/svg+xml"), n3 = e3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
|
|
@@ -1336,9 +1369,9 @@ function Oe(t2) {
|
|
|
1336
1369
|
for (; r2 = i2.exec(t2); ) o2.push({ d: r2[1] });
|
|
1337
1370
|
return { viewBox: n2, paths: o2 };
|
|
1338
1371
|
}
|
|
1339
|
-
function
|
|
1372
|
+
function Ve(t2) {
|
|
1340
1373
|
const e2 = {};
|
|
1341
|
-
for (const [n3, o3] of Object.entries(t2.icons)) e2[n3] =
|
|
1374
|
+
for (const [n3, o3] of Object.entries(t2.icons)) e2[n3] = Ne(o3);
|
|
1342
1375
|
const n2 = { label: t2.meta?.label ?? "Unnamed", version: t2.meta?.version ?? "1.0.0", license: t2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: t2.meta?.extends ?? [] };
|
|
1343
1376
|
n2.extends.includes("base") || n2.extends.push("base");
|
|
1344
1377
|
const o2 = { meta: n2, icons: e2 }, i2 = t2.overrides;
|
|
@@ -1346,14 +1379,14 @@ function Ke(t2) {
|
|
|
1346
1379
|
const t3 = {};
|
|
1347
1380
|
for (const [e3, n3] of Object.entries(i2)) {
|
|
1348
1381
|
const o3 = {};
|
|
1349
|
-
for (const [t4, e4] of Object.entries(n3)) o3[t4] =
|
|
1382
|
+
for (const [t4, e4] of Object.entries(n3)) o3[t4] = Ne(e4);
|
|
1350
1383
|
t3[e3] = o3;
|
|
1351
1384
|
}
|
|
1352
1385
|
o2.__overrides = t3;
|
|
1353
1386
|
}
|
|
1354
1387
|
return o2;
|
|
1355
1388
|
}
|
|
1356
|
-
function
|
|
1389
|
+
function Ie() {
|
|
1357
1390
|
const t2 = /* @__PURE__ */ new Map(), e2 = /* @__PURE__ */ new Map();
|
|
1358
1391
|
let n2 = "base", o2 = /* @__PURE__ */ new Map();
|
|
1359
1392
|
async function i2(e3) {
|
|
@@ -1364,7 +1397,7 @@ function He() {
|
|
|
1364
1397
|
if (!o3.loader) throw new Error(`No loader for icon pack: ${e3}`);
|
|
1365
1398
|
o3.loading = o3.loader().then((t3) => {
|
|
1366
1399
|
const e4 = t3 && "object" == typeof t3 && "default" in t3 ? t3.default : t3;
|
|
1367
|
-
o3.pack =
|
|
1400
|
+
o3.pack = Ve(e4);
|
|
1368
1401
|
}).catch((t3) => {
|
|
1369
1402
|
throw o3.loading = void 0, t3;
|
|
1370
1403
|
});
|
|
@@ -1407,7 +1440,7 @@ function He() {
|
|
|
1407
1440
|
}
|
|
1408
1441
|
return { register: function(e3, o3) {
|
|
1409
1442
|
const i3 = t2.get(e3) ?? {};
|
|
1410
|
-
"function" == typeof o3 ? i3.loader = o3 : i3.pack =
|
|
1443
|
+
"function" == typeof o3 ? i3.loader = o3 : i3.pack = Ve(o3), t2.set(e3, i3), n2 || (n2 = e3);
|
|
1411
1444
|
}, prefetch: async function(t3 = n2) {
|
|
1412
1445
|
const e3 = Array.isArray(t3) ? t3 : [t3];
|
|
1413
1446
|
await Promise.all(e3.map(i2));
|
|
@@ -1459,21 +1492,21 @@ function He() {
|
|
|
1459
1492
|
return o2.set(t3, n3), n3;
|
|
1460
1493
|
} };
|
|
1461
1494
|
}
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, sourceProps: u2, children:
|
|
1495
|
+
const Fe = Ie();
|
|
1496
|
+
Fe.register("base", () => import("./D5BveCGka6K1aPl8.mjs"));
|
|
1497
|
+
const je = (e2) => t("svg", { ...e2, children: t("path", {}) }), Xe = { Icon: "_Icon_1ld90_10" }, Ye = _((e2) => {
|
|
1498
|
+
const { iconKey: n2, packKey: i2, className: r2, style: s2, role: l2, title: a2, size: c2, ariaHidden: h2, sourceProps: u2, children: d2, ...f2 } = e2, [_2, m2] = o.useState(null);
|
|
1466
1499
|
o.useEffect(() => {
|
|
1467
1500
|
let t2 = true, e3 = i2, o2 = n2;
|
|
1468
1501
|
if (!o2) {
|
|
1469
|
-
const t3 =
|
|
1470
|
-
return void m2({ glyph: t3 ? { svg: L.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ??
|
|
1502
|
+
const t3 = Fe.getPack(e3);
|
|
1503
|
+
return void m2({ glyph: t3 ? { svg: L.EmptyArray } : void 0, pack: t3 ?? void 0, packKey: e3 ?? Fe.getActive() });
|
|
1471
1504
|
}
|
|
1472
1505
|
if (o2.includes(":")) {
|
|
1473
1506
|
const [t3, n3] = o2.split(":");
|
|
1474
1507
|
e3 = t3, o2 = n3;
|
|
1475
1508
|
}
|
|
1476
|
-
return
|
|
1509
|
+
return Fe.resolve(o2, { packKey: e3 }).then((e4) => {
|
|
1477
1510
|
t2 && m2(e4);
|
|
1478
1511
|
}), () => {
|
|
1479
1512
|
t2 = false;
|
|
@@ -1481,83 +1514,84 @@ const Ne = (e2) => t("svg", { ...e2, children: t("path", {}) }), Ve = { Icon: "_
|
|
|
1481
1514
|
}, [n2, i2]);
|
|
1482
1515
|
const g2 = _2?.pack, y2 = _2?.glyph, v2 = _2?.packKey;
|
|
1483
1516
|
let w2 = y2 ? y2.svg : void 0;
|
|
1484
|
-
const x2 = y2 && !w2 ? y2.url : void 0, b2 = !y2 || w2 || x2 ? void 0 : y2.emoji, S2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, E2 =
|
|
1517
|
+
const x2 = y2 && !w2 ? y2.url : void 0, b2 = !y2 || w2 || x2 ? void 0 : y2.emoji, S2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, E2 = p(() => [Xe.Icon, "icon", r2].filter(Boolean).join(" "), [r2]), M2 = p(() => {
|
|
1485
1518
|
const t2 = { ...s2 };
|
|
1486
1519
|
return t2["--icon-size"] = S2, t2;
|
|
1487
|
-
}, [s2, S2]),
|
|
1488
|
-
if (
|
|
1520
|
+
}, [s2, S2]), T2 = l2 ?? (a2 ? "img" : "presentation"), C2 = h2 ?? (!a2 || void 0), k2 = (e3) => t("span", { className: E2, style: M2, role: T2, "aria-hidden": C2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...f2, children: e3 });
|
|
1521
|
+
if (d2) return k2(d2);
|
|
1489
1522
|
if (b2) return k2(t("span", { children: "string" == typeof b2 ? b2 : b2.text }));
|
|
1490
1523
|
if (x2) return k2(t("img", { src: x2.src, alt: a2 ?? "" }));
|
|
1491
1524
|
if (y2 && "react" in y2) {
|
|
1492
|
-
const e3 = y2.react, n3 = { className: E2, style: M2, role:
|
|
1525
|
+
const e3 = y2.react, n3 = { className: E2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...f2, ...u2 };
|
|
1493
1526
|
return k2(t(e3, { ...n3 }));
|
|
1494
1527
|
}
|
|
1495
1528
|
const D2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1496
1529
|
if ("function" == typeof w2) {
|
|
1497
|
-
return k2(w2(D2) ?? t(
|
|
1530
|
+
return k2(w2(D2) ?? t(je, { ...D2 }));
|
|
1498
1531
|
}
|
|
1499
|
-
if (!w2) return k2(t(
|
|
1532
|
+
if (!w2) return k2(t(je, { ...D2 }));
|
|
1500
1533
|
const P2 = w2.paths;
|
|
1501
1534
|
return k2(t("svg", { ...D2, children: P2 ? P2.map((e3, n3) => t("path", { d: e3.d, className: e3.className, fill: e3.fill, stroke: e3.stroke, opacity: e3.opacity, fillRule: e3.fillRule, clipRule: e3.clipRule }, n3)) : null }));
|
|
1502
1535
|
});
|
|
1503
|
-
function
|
|
1504
|
-
const { isWalking: n2 = false, themedType: o2 = "info", speed: i2 = 120, dashGap: r2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: h2, ...u2 } = e2,
|
|
1536
|
+
function Ue(e2) {
|
|
1537
|
+
const { isWalking: n2 = false, themedType: o2 = "info", speed: i2 = 120, dashGap: r2 = 3, dashLength: s2 = 5, iconKey: l2, packKey: a2, style: c2, className: h2, ...u2 } = e2, d2 = p(() => {
|
|
1505
1538
|
if (!n2) return;
|
|
1506
1539
|
const t2 = { "--walk-duration": `${i2 * (r2 + s2)}ms`, "--walk-dash-length": `${s2}px`, "--walk-dash-gap": `${r2}px` };
|
|
1507
1540
|
return o2 && "accent" !== o2 && (t2["--icon-accent"] = `var(--icon-${o2})`), t2;
|
|
1508
|
-
}, [n2, i2, r2, s2, o2]), f2 =
|
|
1509
|
-
return t(
|
|
1541
|
+
}, [n2, i2, r2, s2, o2]), f2 = p(() => n2 ? h2 + " walking" : h2, [n2, h2]);
|
|
1542
|
+
return t(Ye, { iconKey: l2, packKey: a2, className: f2, style: { ...c2, ...d2 }, ...u2 });
|
|
1510
1543
|
}
|
|
1511
1544
|
export {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1545
|
+
ft as Command,
|
|
1546
|
+
Ct as CommandButtonType,
|
|
1547
|
+
xt as CommandGroup,
|
|
1548
|
+
Fe as DefaultDynamicIconService,
|
|
1516
1549
|
K as DefaultReactNotifier,
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1550
|
+
Ye as DynamicIcon,
|
|
1551
|
+
De as ErrorTestPanel,
|
|
1552
|
+
Ee as FocusKeyNavigation,
|
|
1520
1553
|
P as HorizontalAlignment,
|
|
1521
1554
|
z as KeyCodes,
|
|
1522
1555
|
A as KeyModifiers,
|
|
1523
1556
|
B as MouseButtonCodes,
|
|
1524
1557
|
R as NotifierProvider,
|
|
1525
1558
|
O as NotifierType,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1559
|
+
Te as ReactErrorBoundary,
|
|
1560
|
+
wt as ReactUtils,
|
|
1561
|
+
Le as RoundedTab,
|
|
1562
|
+
me as ScrollPane,
|
|
1563
|
+
fe as ScrollUtils,
|
|
1564
|
+
oe as Scrollbar,
|
|
1532
1565
|
$ as ScrollbarOrientation,
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1566
|
+
_t as SimpleCommand,
|
|
1567
|
+
Ke as SplitPane,
|
|
1568
|
+
Ae as SplitPaneResizer,
|
|
1569
|
+
Se as ToolTipPlacement,
|
|
1570
|
+
ke as UncaughtErrorBoundary,
|
|
1571
|
+
be as VirtualScrollbar,
|
|
1572
|
+
Ue as WalkingIcon,
|
|
1573
|
+
Ie as createDynamicIconService,
|
|
1574
|
+
_e as defaultCreateScrollCorner,
|
|
1575
|
+
Qt as defaultCreateScrollEdgeButton,
|
|
1576
|
+
Jt as defaultCreateScrollEndButton,
|
|
1577
|
+
qt as defaultCreateScrollStartButton,
|
|
1578
|
+
U as getDevicePixelRatio,
|
|
1579
|
+
Et as toShortcutString,
|
|
1580
|
+
j as useAnimatedMeasure,
|
|
1581
|
+
X as useCallbackRef,
|
|
1582
|
+
Lt as useCommand,
|
|
1583
|
+
Tt as useCommands,
|
|
1584
|
+
Dt as useCopyPaste,
|
|
1585
|
+
Y as useDevicePixelRatio,
|
|
1586
|
+
pt as useEditMode,
|
|
1587
|
+
ee as useFullscreenPortal,
|
|
1588
|
+
kt as useGlobalClipboard,
|
|
1589
|
+
Kt as useId,
|
|
1590
|
+
Rt as useImperativeElement,
|
|
1591
|
+
q as useMouseDownAndHoldListener,
|
|
1558
1592
|
N as useNotifier,
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1593
|
+
G as useOnClickOrFocusAway,
|
|
1594
|
+
Z as useSynchronizedPointerHandler,
|
|
1595
|
+
Pt as useTraceUpdate,
|
|
1596
|
+
It as useUndoManager
|
|
1563
1597
|
};
|