@sheetxl/utils-react 0.7.11 → 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 +2 -2
- package/browser/esm/{BNW2XtDFq9P_SHHG.mjs → CNTtjTL9eZe9TQw2.mjs} +2 -2
- package/browser/esm/index.mjs +115 -114
- package/node/esm/{D5BveCGka6K1aPl8.mjs → i36M1qE9kUNw0xW3.mjs} +2 -2
- package/node/esm/index.mjs +38 -37
- package/package.json +2 -2
- package/browser/cjs/CBhk4XX3Jh-fMfEG.cjs +0 -6
package/browser/esm/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
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
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
|
|
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
4
|
import { unstable_batchedUpdates as _n, createPortal as gn } from "react-dom";
|
|
5
5
|
import { DefaultNotifier as yn, Notifier as ye, CommonUtils as q, InternalClipboard as Ze, ClipboardUtils as ot, MimeType as it } from "@sheetxl/utils";
|
|
6
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
|
|
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
14
|
function It(i) {
|
|
15
15
|
var e, t, n = "";
|
|
16
16
|
if (typeof i == "string" || typeof i == "number") n += i;
|
|
@@ -44,7 +44,7 @@ var $e = parseInt(hn.split(".")[0], 10) >= 19 ? function(i) {
|
|
|
44
44
|
for (const t of i) rt(t, e);
|
|
45
45
|
};
|
|
46
46
|
}, wn = function() {
|
|
47
|
-
}, Vt = typeof window < "u", bn = Vt ? _t :
|
|
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
48
|
const ve = Vt && window.ResizeObserver !== void 0 ? function() {
|
|
49
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) {
|
|
@@ -98,19 +98,19 @@ class xn extends yn {
|
|
|
98
98
|
return t?.showInputOptions ? t.showInputOptions(e) : Promise.resolve({ input: "", option: "" });
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
const Wt = un(new xn()),
|
|
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
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
|
|
108
|
-
const { threshold: e = En, stillnessThreshold: t = Sn, maxHierarchyDepth: n = Ln } = i, [o, r] = ve(), a = O(null), [h, s] =
|
|
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
109
|
a.current = _, typeof o == "function" && o(_);
|
|
110
110
|
}, [o]), [d, f] = F(r);
|
|
111
|
-
return
|
|
111
|
+
return N(() => {
|
|
112
112
|
r && !d && f(r);
|
|
113
|
-
}, [r, d]),
|
|
113
|
+
}, [r, d]), N(() => {
|
|
114
114
|
const _ = a.current;
|
|
115
115
|
if (!_) return;
|
|
116
116
|
let g = !1, M = 0;
|
|
@@ -141,9 +141,9 @@ const k = (i, e) => {
|
|
|
141
141
|
const o = V((...r) => n.current?.(...r), []);
|
|
142
142
|
if (n.current) return o;
|
|
143
143
|
};
|
|
144
|
-
function
|
|
144
|
+
function zo(i) {
|
|
145
145
|
const [e, t] = F(typeof window < "u" ? window.devicePixelRatio : 1), n = O(null);
|
|
146
|
-
return
|
|
146
|
+
return N(() => {
|
|
147
147
|
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
148
148
|
const o = () => {
|
|
149
149
|
const r = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
@@ -154,14 +154,14 @@ function Ao(i) {
|
|
|
154
154
|
};
|
|
155
155
|
}, [i]), e;
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Bo(i) {
|
|
158
158
|
if (typeof window > "u") return 1;
|
|
159
159
|
const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = i || {}, o = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
|
|
160
160
|
return Math.min(Math.max(1, n ? Math.floor(o) : o), t);
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function Oo(i, e, t) {
|
|
163
163
|
const n = k(e, [e]);
|
|
164
|
-
|
|
164
|
+
N(() => {
|
|
165
165
|
const o = (r) => {
|
|
166
166
|
i.current && !i.current.contains(r.target) && n(r);
|
|
167
167
|
};
|
|
@@ -181,7 +181,7 @@ function Mn(i) {
|
|
|
181
181
|
}), P(u);
|
|
182
182
|
}, E ?? c);
|
|
183
183
|
}, []);
|
|
184
|
-
|
|
184
|
+
N(() => () => M(), []);
|
|
185
185
|
const y = o ? "pointer" : "mouse", w = V((E) => {
|
|
186
186
|
E.stopPropagation(), E.stopImmediatePropagation(), E.preventDefault();
|
|
187
187
|
}, []), m = k((E) => {
|
|
@@ -205,7 +205,7 @@ function Mn(i) {
|
|
|
205
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)));
|
|
206
206
|
}, [c, o]);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function $o(i, e) {
|
|
209
209
|
return Mn({ onPointerDown: i, onPointerMoveOrWait: (t, n, o) => {
|
|
210
210
|
i?.(o);
|
|
211
211
|
}, ...e });
|
|
@@ -225,7 +225,7 @@ const Ye = [], Le = [], qe = () => {
|
|
|
225
225
|
Le.forEach((i) => i());
|
|
226
226
|
}, kn = ({ automaticContainerInternalUseOnly: i }) => {
|
|
227
227
|
const [e, t] = F([]), n = O([]);
|
|
228
|
-
return n.current = e, i || ut !== !1 || (Ft = !0),
|
|
228
|
+
return n.current = e, i || ut !== !1 || (Ft = !0), N(() => {
|
|
229
229
|
let o = !0;
|
|
230
230
|
function r() {
|
|
231
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]);
|
|
@@ -253,7 +253,7 @@ dt || (dt = (i, e, t = {}) => {
|
|
|
253
253
|
}, c = () => (a || (o = typeof i == "function" ? i() : i, a = !0), o);
|
|
254
254
|
return () => {
|
|
255
255
|
const [u, d] = F(c);
|
|
256
|
-
return
|
|
256
|
+
return N(() => (r || (r = !0, n = Pn({ initValue: i, useHookBody: e, applyStateChange: l })), h.push(d), o !== u && d(o), () => {
|
|
257
257
|
h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), r = !1);
|
|
258
258
|
}), []), u;
|
|
259
259
|
};
|
|
@@ -265,7 +265,7 @@ let Ut = () => {
|
|
|
265
265
|
const Dn = jt(null, () => {
|
|
266
266
|
const [i, e] = F(null);
|
|
267
267
|
return Ut = e, i;
|
|
268
|
-
}),
|
|
268
|
+
}), Ko = () => {
|
|
269
269
|
const i = Dn();
|
|
270
270
|
return R(() => ({ setMode: (e) => {
|
|
271
271
|
Ut((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
|
|
@@ -392,11 +392,11 @@ var te = typeof window < "u" ? window : { screen: {}, navigator: {} }, Te = (te.
|
|
|
392
392
|
};
|
|
393
393
|
te.addEventListener && te.addEventListener("p", Mt, An), te.removeEventListener && te.removeEventListener("p", Mt, !1);
|
|
394
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" })),
|
|
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
396
|
function mt() {
|
|
397
397
|
return Rn;
|
|
398
398
|
}
|
|
399
|
-
const Qt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : q.camelToPrettyCase(i),
|
|
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) {
|
|
400
400
|
return i;
|
|
401
401
|
}, createSyntheticEvent: (i) => {
|
|
402
402
|
let e = !1, t = !1;
|
|
@@ -406,7 +406,7 @@ const Qt = (i) => i === "BracketLeft" ? "[" : i === "BracketRight" ? "]" : q.cam
|
|
|
406
406
|
t = !0, i.stopPropagation();
|
|
407
407
|
}, isPropagationStopped: () => t, persist: () => {
|
|
408
408
|
}, timeStamp: i.timeStamp, type: i.type };
|
|
409
|
-
}, detectIt: mt, focusableNodeNames:
|
|
409
|
+
}, detectIt: mt, focusableNodeNames: Nn, toPrettyKeyCode: Qt }, Symbol.toStringTag, { value: "Module" }));
|
|
410
410
|
class Jt {
|
|
411
411
|
constructor(e, t) {
|
|
412
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();
|
|
@@ -561,17 +561,17 @@ class Jt {
|
|
|
561
561
|
}), e;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
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) => {
|
|
565
565
|
const t = {};
|
|
566
566
|
for (let o = 0; i.modifiers && o < i.modifiers.length; o++) t[i.modifiers[o]] = !0;
|
|
567
567
|
let n = "";
|
|
568
|
-
return (t?.[Y.Ctrl] || t?.[Y.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? In :
|
|
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;
|
|
569
569
|
};
|
|
570
|
-
function
|
|
570
|
+
function No(i, e = null) {
|
|
571
571
|
const t = O(e);
|
|
572
572
|
t.current = e;
|
|
573
|
-
const [n, o] =
|
|
574
|
-
return
|
|
573
|
+
const [n, o] = Ht((a) => a + 1, 0), r = R(() => Array.isArray(i) ? i : [i], [i]);
|
|
574
|
+
return N(() => {
|
|
575
575
|
if (!r || r.length === 0) return;
|
|
576
576
|
const a = (l, c) => {
|
|
577
577
|
t.current?.onChange?.(c), o();
|
|
@@ -604,7 +604,7 @@ function Ho(i, e = null, t = null, n) {
|
|
|
604
604
|
const o = O(t);
|
|
605
605
|
o.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
606
606
|
const [r, a] = F(Fe(i, e)), h = n ? [...n, i] : [i];
|
|
607
|
-
return
|
|
607
|
+
return N(() => {
|
|
608
608
|
const s = { onGroupChange: () => {
|
|
609
609
|
const d = Fe(i, e);
|
|
610
610
|
a(d), o.current?.onChange?.(this);
|
|
@@ -619,12 +619,12 @@ function Ho(i, e = null, t = null, n) {
|
|
|
619
619
|
};
|
|
620
620
|
}, h), r;
|
|
621
621
|
}
|
|
622
|
-
const
|
|
622
|
+
const Io = { Toolbar: "toolbar", Menuitem: "menuitem" }, Vn = jt({ setClipboard: (i) => {
|
|
623
623
|
throw new Error("This is only available via the useClipboard.");
|
|
624
624
|
}, getClipboard: () => Ze.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
625
625
|
const [i, e] = F(Ze.Global);
|
|
626
626
|
return { setClipboard: (t) => e(t), getClipboard: () => i, refNativeCopy: O(null), refNativeLastKey: O(null) };
|
|
627
|
-
}),
|
|
627
|
+
}), Vo = (i) => {
|
|
628
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
629
|
R(() => {
|
|
630
630
|
const y = e?.element, w = t?.element ?? e?.element;
|
|
@@ -697,7 +697,7 @@ const No = { Toolbar: "toolbar", Menuitem: "menuitem" }, Vn = jt({ setClipboard:
|
|
|
697
697
|
}, [M, t?.element, a]);
|
|
698
698
|
return k(async (y) => {
|
|
699
699
|
}, [e?.element]), k(async (y) => {
|
|
700
|
-
}, [t?.element, M, a]),
|
|
700
|
+
}, [t?.element, M, a]), N(() => {
|
|
701
701
|
if (!u) return;
|
|
702
702
|
const y = async (A) => {
|
|
703
703
|
const S = await u.readReference();
|
|
@@ -710,14 +710,14 @@ const No = { Toolbar: "toolbar", Menuitem: "menuitem" }, Vn = jt({ setClipboard:
|
|
|
710
710
|
return u.addEventListener("clipboardchange", y), u.addEventListener("clipboarderrorread", w), u.addEventListener("clipboarderrorwrite", m), () => {
|
|
711
711
|
u.removeEventListener("clipboardchange", y), u.removeEventListener("clipboarderrorread", w), u.removeEventListener("clipboarderrorwrite", m);
|
|
712
712
|
};
|
|
713
|
-
}, [u, a]),
|
|
714
|
-
}, [d, M, e, t]),
|
|
713
|
+
}, [u, a]), N(() => {
|
|
714
|
+
}, [d, M, e, t]), N(() => {
|
|
715
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
716
|
}, [e, t, r]), { paste: P, copy: f, clipboard: u };
|
|
717
717
|
};
|
|
718
|
-
function
|
|
718
|
+
function Wo(i, e = !0) {
|
|
719
719
|
const t = O(i);
|
|
720
|
-
|
|
720
|
+
N(() => {
|
|
721
721
|
if (e) {
|
|
722
722
|
const n = Object.entries(i).reduce((o, [r, a]) => (t.current[r] !== a && (o[r] = [t.current[r], a]), o), {});
|
|
723
723
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
@@ -726,8 +726,8 @@ function Vo(i, e = !0) {
|
|
|
726
726
|
});
|
|
727
727
|
}
|
|
728
728
|
let ct = !1, Wn = 0;
|
|
729
|
-
var Fn = typeof document < "u" ? _t :
|
|
730
|
-
const Tt = () => "sheetxl-ui-" + Wn++, kt = re.useId,
|
|
729
|
+
var Fn = typeof document < "u" ? _t : N;
|
|
730
|
+
const Tt = () => "sheetxl-ui-" + Wn++, kt = re.useId, Fo = kt ?? function() {
|
|
731
731
|
const [i, e] = re.useState(() => ct ? Tt() : void 0);
|
|
732
732
|
return Fn(() => {
|
|
733
733
|
i == null && e(Tt());
|
|
@@ -749,7 +749,7 @@ function yt(i, e, t = jn) {
|
|
|
749
749
|
return o;
|
|
750
750
|
}, t), n;
|
|
751
751
|
}
|
|
752
|
-
const Pt = "Undo the last action.", Dt = "Repeat the last action or undo the redo.", Un = (i) => `Redo ${i}`,
|
|
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
753
|
const n = Qe(), o = k((a) => {
|
|
754
754
|
try {
|
|
755
755
|
i?.undo(a);
|
|
@@ -768,7 +768,7 @@ const Pt = "Undo the last action.", Dt = "Repeat the last action or undo the red
|
|
|
768
768
|
const a = { contains: (s) => !0, focus() {
|
|
769
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)];
|
|
770
770
|
e?.addCommands(h, !0);
|
|
771
|
-
}, [e]),
|
|
771
|
+
}, [e]), N(() => {
|
|
772
772
|
if (!e) return;
|
|
773
773
|
const a = () => {
|
|
774
774
|
const s = i?.getTopUndoDescription(), l = {};
|
|
@@ -789,17 +789,17 @@ const Pt = "Undo the last action.", Dt = "Repeat the last action or undo the red
|
|
|
789
789
|
}, Qn = (i) => {
|
|
790
790
|
const { style: e, orientation: t = ae.Vertical, disabled: n, ...o } = i, r = t === ae.Vertical ? tn : nn;
|
|
791
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
|
-
},
|
|
792
|
+
}, Uo = (i) => {
|
|
793
793
|
const { style: e, orientation: t = ae.Vertical, ...n } = i, o = t === ae.Vertical;
|
|
794
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" }) }) });
|
|
795
795
|
};
|
|
796
796
|
let je = 0;
|
|
797
|
-
function
|
|
797
|
+
function Xo() {
|
|
798
798
|
const [i, e] = F(!!document.fullscreenElement), t = V(() => {
|
|
799
799
|
const n = document.fullscreenElement;
|
|
800
800
|
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
801
801
|
}, []);
|
|
802
|
-
return
|
|
802
|
+
return N(() => {
|
|
803
803
|
function n() {
|
|
804
804
|
const o = document.fullscreenElement;
|
|
805
805
|
if (e(!!o), !o) return;
|
|
@@ -826,9 +826,9 @@ const Jn = 24, eo = we(ke((i, e) => {
|
|
|
826
826
|
}, [s, o, n, z, m]), p = k((b) => {
|
|
827
827
|
A(L(b, o, n)), s?.(b, o, n), S.current = b;
|
|
828
828
|
}, [s, o, n]);
|
|
829
|
-
|
|
829
|
+
N(() => {
|
|
830
830
|
S.current !== t && z !== 0 && (S.current = -1, A(L(t, o, n)));
|
|
831
|
-
}, [t]),
|
|
831
|
+
}, [t]), N(() => {
|
|
832
832
|
z !== 0 && A(L(t, o, n));
|
|
833
833
|
}, [o, n, T, z]);
|
|
834
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) => {
|
|
@@ -850,25 +850,25 @@ const Jn = 24, eo = we(ke((i, e) => {
|
|
|
850
850
|
}, [T, m, o, n]), xe = k((b) => {
|
|
851
851
|
const $ = Math.max(1, Math.floor(0.9 * o));
|
|
852
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,
|
|
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
854
|
let b;
|
|
855
855
|
b = typeof u == "function" ? u(t, o, n) : t - u;
|
|
856
856
|
const $ = Math.max(0, b);
|
|
857
|
-
return p($),
|
|
857
|
+
return p($), Ne($), $;
|
|
858
858
|
}, [u, t, o, n]), Pe = k(() => {
|
|
859
859
|
let b;
|
|
860
860
|
b = typeof u == "function" ? u(t, o, n) : t + u;
|
|
861
861
|
const $ = Math.min(v, b);
|
|
862
|
-
return p($),
|
|
862
|
+
return p($), Ne($), $;
|
|
863
863
|
}, [u, t, v, o, n]), fe = O(null), Ee = O(null), se = V(() => {
|
|
864
864
|
fe.current && (clearTimeout(fe.current), fe.current = null, Ee.current = null);
|
|
865
865
|
}, []), De = V((b, $, U, me = d) => {
|
|
866
866
|
Ee.current = b, fe.current = setTimeout(() => {
|
|
867
|
-
const _e = U ?
|
|
867
|
+
const _e = U ? He() : Pe();
|
|
868
868
|
_e !== Ee.current ? De(_e, !1, U, f) : se();
|
|
869
869
|
}, $ ? 0 : me);
|
|
870
|
-
}, [
|
|
871
|
-
|
|
870
|
+
}, [He, Pe, se]);
|
|
871
|
+
N(() => () => se(), [se]);
|
|
872
872
|
const Je = R(() => {
|
|
873
873
|
if (!c) return null;
|
|
874
874
|
const b = { orientation: h, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => De(t, !0, !0) };
|
|
@@ -1071,7 +1071,7 @@ class io {
|
|
|
1071
1071
|
}
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
|
-
const Ke = (i, e) => C(eo, { ...i, ref: e }),
|
|
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) => {
|
|
1075
1075
|
for (let r = 0; r < t.length; r++) {
|
|
1076
1076
|
const a = t[r].getBoundingClientRect();
|
|
1077
1077
|
let h = a.left - e, s = h + a.width;
|
|
@@ -1082,7 +1082,7 @@ const Ke = (i, e) => C(eo, { ...i, ref: e }), Xo = Object.freeze(Object.definePr
|
|
|
1082
1082
|
return o;
|
|
1083
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
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
|
-
|
|
1085
|
+
N(() => {
|
|
1086
1086
|
y.current && (y.current.__scrollTop === n?.top && y.current.__scrollLeft === n?.left || y.current.__isDecelerating || y.current?.scrollTo(n?.left, n?.top, !1));
|
|
1087
1087
|
}, [n?.left, n?.top, u]);
|
|
1088
1088
|
const w = V((p, v) => {
|
|
@@ -1096,7 +1096,7 @@ const Ke = (i, e) => C(eo, { ...i, ref: e }), Xo = Object.freeze(Object.definePr
|
|
|
1096
1096
|
}, []), T = V(({ containerWidth: p, containerHeight: v, totalWidth: K, totalHeight: G }) => {
|
|
1097
1097
|
y.current.setDimensions(p, v, K, G);
|
|
1098
1098
|
}, []);
|
|
1099
|
-
|
|
1099
|
+
N(() => {
|
|
1100
1100
|
const p = u ?? P.current;
|
|
1101
1101
|
if (!d && mt().supportsTouchEvents && p && n) {
|
|
1102
1102
|
if (!y.current) {
|
|
@@ -1143,7 +1143,7 @@ const lo = 300, ao = 100, co = 1e6, ho = 100, uo = 50, po = we(ke((i, e) => {
|
|
|
1143
1143
|
return Ke({ style: s, ...M, offset: m.offset, totalSize: m.totalSize, viewportSize: m.viewportSize, onMouseDown: I, onScrollOffset: A }, e);
|
|
1144
1144
|
}));
|
|
1145
1145
|
po.displayName = "VirtualScrollbar";
|
|
1146
|
-
const
|
|
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) => {
|
|
1147
1147
|
const { refFocusStart: t, ...n } = i, o = O(null), r = V(() => {
|
|
1148
1148
|
if (t) return void t?.current?.focus();
|
|
1149
1149
|
const a = o.current.parentElement.children;
|
|
@@ -1158,7 +1158,7 @@ const Yo = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bott
|
|
|
1158
1158
|
}), h[0].child.focus());
|
|
1159
1159
|
}, [t]);
|
|
1160
1160
|
return C("div", { tabIndex: 0, ref: $e([o, e]), onFocus: r, ...n });
|
|
1161
|
-
})),
|
|
1161
|
+
})), qo = we(ke((i, e) => {
|
|
1162
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
1163
|
const w = P / 2, m = u - w + y;
|
|
1164
1164
|
return (function(A, S, T = !1) {
|
|
@@ -1221,7 +1221,7 @@ class fo extends mn {
|
|
|
1221
1221
|
return this.props.children;
|
|
1222
1222
|
}
|
|
1223
1223
|
}
|
|
1224
|
-
const
|
|
1224
|
+
const Qo = ({ children: i }) => {
|
|
1225
1225
|
const e = Qe(), t = V((n) => {
|
|
1226
1226
|
e.showError(n);
|
|
1227
1227
|
}, [e]);
|
|
@@ -1243,15 +1243,15 @@ class mo {
|
|
|
1243
1243
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
|
-
const
|
|
1246
|
+
const Jo = ({ children: i }) => {
|
|
1247
1247
|
const e = Qe();
|
|
1248
|
-
return
|
|
1248
|
+
return N(() => {
|
|
1249
1249
|
const t = new mo(e);
|
|
1250
1250
|
return () => {
|
|
1251
1251
|
t.cleanup();
|
|
1252
1252
|
};
|
|
1253
1253
|
}, [e]), C(Me, { children: i });
|
|
1254
|
-
},
|
|
1254
|
+
}, ei = () => null, _o = {}, go = (i) => {
|
|
1255
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;
|
|
1256
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);
|
|
1257
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) => {
|
|
@@ -1259,38 +1259,38 @@ const Qo = ({ children: i }) => {
|
|
|
1259
1259
|
const t = { percent: null, pixels: null };
|
|
1260
1260
|
let n = e;
|
|
1261
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);
|
|
1262
|
-
},
|
|
1262
|
+
}, yo = we(ke((i, e) => {
|
|
1263
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;
|
|
1264
1264
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
1265
1265
|
const I = R(() => re.isValidElement(n) && re.isValidElement(t), [n, t]), x = R(() => {
|
|
1266
1266
|
let B = null;
|
|
1267
1267
|
r && (r === "before" ? B = 0 : r === "after" && (B = 1));
|
|
1268
|
-
const
|
|
1269
|
-
return { fixedPaneOffset: B, isPercent:
|
|
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
1270
|
}, [s, l, c, u]), E = k(h, [h]), [z, L] = F(() => ue(a, r === null));
|
|
1271
|
-
|
|
1271
|
+
N(() => {
|
|
1272
1272
|
L(ue(a, r === null));
|
|
1273
1273
|
}, [a, r]);
|
|
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,
|
|
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
1275
|
const ce = [null, null], ie = [null, null];
|
|
1276
|
-
if (B || (B = { percent: X.fixedPaneOffset === null ? 50 : null, pixels: X.fixedPaneOffset === null ? null : 0 }),
|
|
1277
|
-
let he = ge(B,
|
|
1278
|
-
We = (ge(X.maxAfter,
|
|
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
1279
|
const cn = Math.max(0, Math.min(100, he / ne * 100));
|
|
1280
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),
|
|
1282
|
-
const
|
|
1283
|
-
L(
|
|
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
1284
|
}, [r]), Ie = k((B) => {
|
|
1285
1285
|
if (g || !oe) return;
|
|
1286
|
-
const
|
|
1286
|
+
const H = wt.current?.getBoundingClientRect();
|
|
1287
1287
|
let ee = 0;
|
|
1288
|
-
ee = o === "row" ? (B.clientX ?? B.touches?.[0]?.clientX) -
|
|
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
1289
|
}, [x, o, g, oe, z, Z]), vt = k((B) => {
|
|
1290
1290
|
if (document.removeEventListener("pointermove", Ie), document.removeEventListener("touchmove", Ie), document.removeEventListener("pointerup", vt), !!oe && (J(!1), !!z)) {
|
|
1291
1291
|
if (Se(z.pixels), !ue(a, r === null) || z.pixels !== a) {
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1292
|
+
const H = { ...z };
|
|
1293
|
+
H.percent === null && (H.percent = H.pixels / Z * 100), E(H);
|
|
1294
1294
|
}
|
|
1295
1295
|
B.stopPropagation(), B.preventDefault();
|
|
1296
1296
|
}
|
|
@@ -1303,11 +1303,11 @@ const Qo = ({ children: i }) => {
|
|
|
1303
1303
|
}, [t, m, A, x, W]), ln = R(() => {
|
|
1304
1304
|
if (!n) return null;
|
|
1305
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:
|
|
1306
|
+
return C("div", { ref: Ne, className: le("after", Pe, et), style: B, ...fe, ...b, children: n }, "after");
|
|
1307
1307
|
}, [n, m, S, x, W]);
|
|
1308
1308
|
return Ce("div", { ref: $e([D, wt]), className: le("splitPane", o === "row" ? "vertical" : "horizontal", { dragging: oe }, f), style: $, children: [sn, rn, ln] });
|
|
1309
1309
|
}));
|
|
1310
|
-
function
|
|
1310
|
+
function vo(i) {
|
|
1311
1311
|
if (typeof i == "function") return i;
|
|
1312
1312
|
if (typeof i == "string") {
|
|
1313
1313
|
const e = i.trim();
|
|
@@ -1371,7 +1371,7 @@ function Ot(i) {
|
|
|
1371
1371
|
return e ? e[1] ?? e[2] ?? null : null;
|
|
1372
1372
|
}
|
|
1373
1373
|
function $t(i) {
|
|
1374
|
-
if ("svg" in i) return { ...i, svg:
|
|
1374
|
+
if ("svg" in i) return { ...i, svg: vo(i.svg) };
|
|
1375
1375
|
if ("url" in i) {
|
|
1376
1376
|
const e = typeof i.url == "string" ? { src: i.url } : i.url;
|
|
1377
1377
|
return { ...i, url: e };
|
|
@@ -1427,7 +1427,7 @@ function Rt(i) {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
return n;
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function wo() {
|
|
1431
1431
|
const i = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
1432
1432
|
let t = "base", n = /* @__PURE__ */ new Map();
|
|
1433
1433
|
async function o(s) {
|
|
@@ -1533,9 +1533,10 @@ function vo() {
|
|
|
1533
1533
|
return n.set(s, c), c;
|
|
1534
1534
|
} };
|
|
1535
1535
|
}
|
|
1536
|
-
|
|
1537
|
-
Ge
|
|
1538
|
-
|
|
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) => {
|
|
1539
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);
|
|
1540
1541
|
re.useEffect(() => {
|
|
1541
1542
|
let L = !0, D = t, p = e;
|
|
@@ -1555,7 +1556,7 @@ const Ht = (i) => C("svg", { ...i, children: C("path", {}) }), wo = { Icon: "_Ic
|
|
|
1555
1556
|
}, [e, t]);
|
|
1556
1557
|
const _ = d?.pack, g = d?.glyph, M = d?.packKey;
|
|
1557
1558
|
let P = g ? g.svg : void 0;
|
|
1558
|
-
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(() => [
|
|
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(() => {
|
|
1559
1560
|
const L = { ...o };
|
|
1560
1561
|
return L["--icon-size"] = m, L;
|
|
1561
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 });
|
|
@@ -1568,8 +1569,8 @@ const Ht = (i) => C("svg", { ...i, children: C("path", {}) }), wo = { Icon: "_Ic
|
|
|
1568
1569
|
}
|
|
1569
1570
|
const E = { viewBox: P?.viewBox ?? _?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1570
1571
|
if (typeof P == "function")
|
|
1571
|
-
return x(P(E) ?? C(
|
|
1572
|
-
if (!P) return x(C(
|
|
1572
|
+
return x(P(E) ?? C(Nt, { ...E }));
|
|
1573
|
+
if (!P) return x(C(Nt, { ...E }));
|
|
1573
1574
|
const z = P.paths;
|
|
1574
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 }));
|
|
1575
1576
|
});
|
|
@@ -1579,59 +1580,59 @@ function ti(i) {
|
|
|
1579
1580
|
const f = { "--walk-duration": `${n * (o + r)}ms`, "--walk-dash-length": `${r}px`, "--walk-dash-gap": `${o}px` };
|
|
1580
1581
|
return t && t !== "accent" && (f["--icon-accent"] = `var(--icon-${t})`), f;
|
|
1581
1582
|
}, [e, n, o, r, t]), d = R(() => e ? l + " walking" : l, [e, l]);
|
|
1582
|
-
return C(
|
|
1583
|
+
return C(xo, { iconKey: a, packKey: h, className: d, style: { ...s, ...u }, ...c });
|
|
1583
1584
|
}
|
|
1584
1585
|
export {
|
|
1585
1586
|
pt as Command,
|
|
1586
|
-
|
|
1587
|
+
Io as CommandButtonType,
|
|
1587
1588
|
Jt as CommandGroup,
|
|
1588
1589
|
Ge as DefaultDynamicIconService,
|
|
1589
1590
|
xn as DefaultReactNotifier,
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1591
|
+
xo as DynamicIcon,
|
|
1592
|
+
ei as ErrorTestPanel,
|
|
1593
|
+
Zo as FocusKeyNavigation,
|
|
1594
|
+
To as HorizontalAlignment,
|
|
1595
|
+
ko as KeyCodes,
|
|
1595
1596
|
Y as KeyModifiers,
|
|
1596
|
-
|
|
1597
|
-
|
|
1597
|
+
Po as MouseButtonCodes,
|
|
1598
|
+
Do as NotifierProvider,
|
|
1598
1599
|
Lt as NotifierType,
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1600
|
+
Qo as ReactErrorBoundary,
|
|
1601
|
+
Ro as ReactUtils,
|
|
1602
|
+
qo as RoundedTab,
|
|
1602
1603
|
so as ScrollPane,
|
|
1603
|
-
|
|
1604
|
+
Yo as ScrollUtils,
|
|
1604
1605
|
eo as Scrollbar,
|
|
1605
1606
|
ae as ScrollbarOrientation,
|
|
1606
1607
|
at as SimpleCommand,
|
|
1607
|
-
|
|
1608
|
+
yo as SplitPane,
|
|
1608
1609
|
go as SplitPaneResizer,
|
|
1609
|
-
|
|
1610
|
-
|
|
1610
|
+
Go as ToolTipPlacement,
|
|
1611
|
+
Jo as UncaughtErrorBoundary,
|
|
1611
1612
|
po as VirtualScrollbar,
|
|
1612
1613
|
ti as WalkingIcon,
|
|
1613
|
-
|
|
1614
|
+
wo as createDynamicIconService,
|
|
1614
1615
|
ro as defaultCreateScrollCorner,
|
|
1615
|
-
|
|
1616
|
+
Uo as defaultCreateScrollEdgeButton,
|
|
1616
1617
|
Qn as defaultCreateScrollEndButton,
|
|
1617
1618
|
qn as defaultCreateScrollStartButton,
|
|
1618
|
-
|
|
1619
|
+
Bo as getDevicePixelRatio,
|
|
1619
1620
|
Be as toShortcutString,
|
|
1620
|
-
|
|
1621
|
+
Ao as useAnimatedMeasure,
|
|
1621
1622
|
k as useCallbackRef,
|
|
1622
|
-
|
|
1623
|
+
No as useCommand,
|
|
1623
1624
|
Ho as useCommands,
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1625
|
+
Vo as useCopyPaste,
|
|
1626
|
+
zo as useDevicePixelRatio,
|
|
1627
|
+
Ko as useEditMode,
|
|
1628
|
+
Xo as useFullscreenPortal,
|
|
1628
1629
|
Vn as useGlobalClipboard,
|
|
1629
|
-
|
|
1630
|
+
Fo as useId,
|
|
1630
1631
|
yt as useImperativeElement,
|
|
1631
|
-
|
|
1632
|
+
$o as useMouseDownAndHoldListener,
|
|
1632
1633
|
Qe as useNotifier,
|
|
1633
|
-
|
|
1634
|
+
Oo as useOnClickOrFocusAway,
|
|
1634
1635
|
Mn as useSynchronizedPointerHandler,
|
|
1635
|
-
|
|
1636
|
-
|
|
1636
|
+
Wo as useTraceUpdate,
|
|
1637
|
+
jo as useUndoManager
|
|
1637
1638
|
};
|