@sheetxl/utils-react 0.7.19 → 0.7.21
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/{CLRMmhKU4QmUR8pR.cjs → BA9O-cekHrH5qrOm.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{jq-rVm4UcR4Fif2C.mjs → DTq8GPy7DLZm2D6S.mjs} +1 -1
- package/browser/esm/index.mjs +282 -279
- package/node/esm/{CTZ4-ofCPbWO-0YG.mjs → 4mSSJ5fhNdMhHCE6.mjs} +1 -1
- package/node/esm/index.mjs +74 -71
- package/package.json +2 -2
- package/types/index.d.ts +129 -67
package/browser/esm/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._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: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_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_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_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_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_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_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}: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}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_gqxsx_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_gqxsx_24{display:flex;flex:1 1 100%;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_gqxsx_24 ._track_gqxsx_35{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_gqxsx_24 ._thumb_gqxsx_47{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_gqxsx_24 ._thumb_gqxsx_47:hover{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px);max-width:var(--scrollbar-width, 100%)}._scrollbar_gqxsx_24.vertical ._thumb_gqxsx_47{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.vertical ._track_gqxsx_35{width:100%}._scrollbar_gqxsx_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px);max-height:var(--scrollbar-height, 100%)}._scrollbar_gqxsx_24.horizontal ._thumb_gqxsx_47{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.horizontal ._track_gqxsx_35{height:100%}._scrollbar_gqxsx_24.dragging ._thumb_gqxsx_47{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.vertical{width:var(--scrollbar-width)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.horizontal{height:var(--scrollbar-height)}._touch-thumb_gqxsx_124{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_gqxsx_124:hover,._touch-thumb_gqxsx_124.dragging{opacity:1}._scrollpane_1fbi8_2{position:relative;display:flex}._vertical-container_1fbi8_7{display:flex;flex:0}._horizontal-corner-container_1fbi8_12{display:flex;flex:none;flex-direction:row;align-items:stretch;justify-content:center}._horizontal-container_1fbi8_20{display:flex;flex:1 1 100%;flex-direction:column}._scrollbar-sizer_1fbi8_26{display:flex;flex:1 1 100%;align-items:stretch;justify-content:stretch}._scrollpane-content_1fbi8_34{position:relative;width:100%;flex:1 1 100%;display:flex;flex-direction:column;box-sizing:border-box}._scrollpane-content-element_1fbi8_43{display:flex;flex:1 1 100%;overflow:hidden}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { CommonUtils as te, DefaultNotifier as vn, Notifier as
|
|
3
|
-
import ae, { useRef as K, useReducer as Yt, useMemo as R, useEffect as W, useState as q, version as bn, memo as
|
|
4
|
-
import { jsx as P, jsxs as
|
|
2
|
+
import { CommonUtils as te, DefaultNotifier as vn, Notifier as xe, InternalClipboard as rt, ClipboardUtils as pt, MimeType as ft } from "@sheetxl/utils";
|
|
3
|
+
import ae, { useRef as K, useReducer as Yt, useMemo as R, useEffect as W, useState as q, version as bn, memo as _e, forwardRef as Me, useCallback as U, useLayoutEffect as Lt, createContext as Gt, useContext as qt, createElement as wn, useImperativeHandle as xn, Component as Sn } from "react";
|
|
4
|
+
import { jsx as P, jsxs as fe, Fragment as me } from "react/jsx-runtime";
|
|
5
5
|
import { createRoot as En } from "react-dom/client";
|
|
6
6
|
import { unstable_batchedUpdates as Mn, createPortal as Ln } from "react-dom";
|
|
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.21
|
|
9
9
|
*
|
|
10
10
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
11
11
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
14
|
-
class
|
|
13
|
+
const $o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Q = { 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, Composition: 229 }, No = { Left: 1, Middle: 2, Right: 3 };
|
|
14
|
+
class bt {
|
|
15
15
|
constructor(e, t, n, r) {
|
|
16
16
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = r, r === void 0 && (this._callback = () => {
|
|
17
17
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
@@ -122,19 +122,19 @@ class vt {
|
|
|
122
122
|
}), t;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
class
|
|
125
|
+
class mt extends bt {
|
|
126
126
|
}
|
|
127
|
-
var re = typeof window < "u" ? window : { screen: {}, navigator: {} },
|
|
127
|
+
var re = typeof window < "u" ? window : { screen: {}, navigator: {} }, ze = (re.matchMedia || function() {
|
|
128
128
|
return { matches: !1 };
|
|
129
129
|
}).bind(re), Zt = !1, Cn = { get passive() {
|
|
130
130
|
return Zt = !0;
|
|
131
|
-
} },
|
|
131
|
+
} }, zt = function() {
|
|
132
132
|
};
|
|
133
|
-
re.addEventListener && re.addEventListener("p",
|
|
134
|
-
var Tn = Zt, kn = "PointerEvent" in re,
|
|
135
|
-
const
|
|
136
|
-
function
|
|
137
|
-
return
|
|
133
|
+
re.addEventListener && re.addEventListener("p", zt, Cn), re.removeEventListener && re.removeEventListener("p", zt, !1);
|
|
134
|
+
var Tn = Zt, kn = "PointerEvent" in re, Ct = "ontouchstart" in re, Jt = Ct || "TouchEvent" in re && ze("(any-pointer: coarse)").matches, At = (re.navigator.maxTouchPoints || 0) > 0 || Jt, Qt = re.navigator.userAgent || "", Pn = ze("(pointer: coarse)").matches && /iPad|Macintosh/.test(Qt) && Math.min(re.screen.width || 0, re.screen.height || 0) >= 768, en = (ze("(pointer: coarse)").matches || !ze("(pointer: fine)").matches && Ct) && !/Windows.*Firefox/.test(Qt), Dn = ze("(any-pointer: fine)").matches || ze("(any-hover: hover)").matches || Pn || !Ct, wt = !At || !Dn && en ? At ? "touchOnly" : "mouseOnly" : "hybrid", zn = wt === "mouseOnly" ? "mouse" : wt === "touchOnly" || en ? "touch" : "mouse";
|
|
135
|
+
const An = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: wt, primaryInput: zn, supportsPassiveEvents: Tn, supportsPointerEvents: kn, supportsTouchEvents: Jt }, Symbol.toStringTag, { value: "Module" })), Bn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), tn = {};
|
|
136
|
+
function Ke() {
|
|
137
|
+
return An;
|
|
138
138
|
}
|
|
139
139
|
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o), tt = (o, e) => {
|
|
140
140
|
let t = !1, n = !1;
|
|
@@ -146,9 +146,9 @@ const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.ca
|
|
|
146
146
|
}, timeStamp: o.timeStamp, type: o.type };
|
|
147
147
|
for (const i in o) i in r || typeof o[i] == "function" || (r[i] = o[i]);
|
|
148
148
|
return r;
|
|
149
|
-
},
|
|
149
|
+
}, Ro = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: tn, boundPixel: function(o, e = !1, t = 0) {
|
|
150
150
|
return o;
|
|
151
|
-
}, createSyntheticEvent: tt, detectIt:
|
|
151
|
+
}, createSyntheticEvent: tt, detectIt: Ke, focusableNodeNames: Bn, toPrettyKeyCode: nn }, Symbol.toStringTag, { value: "Module" }));
|
|
152
152
|
class on {
|
|
153
153
|
constructor(e, t) {
|
|
154
154
|
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = te.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();
|
|
@@ -208,7 +208,7 @@ class on {
|
|
|
208
208
|
if (!d) continue;
|
|
209
209
|
const f = Array.isArray(d) ? d : [d];
|
|
210
210
|
for (let m = 0; m < f.length; m++) {
|
|
211
|
-
const p =
|
|
211
|
+
const p = Ie(f[m]), x = r.get(p);
|
|
212
212
|
x && !t && t === void 0 && console.warn(`Shortcut already registered: ${p}, ${s}, ${x}.`), r.set(p, s);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
@@ -243,10 +243,10 @@ class on {
|
|
|
243
243
|
findCommandByEvent(e) {
|
|
244
244
|
const t = [];
|
|
245
245
|
e.altKey && t.push(Q.Alt), e.shiftKey && t.push(Q.Shift), e.ctrlKey && t.push(Q.Ctrl), e.metaKey && t.push(Q.Meta);
|
|
246
|
-
let n =
|
|
246
|
+
let n = Ie({ key: e.code, modifiers: t });
|
|
247
247
|
const r = this._commandsByShortcut;
|
|
248
248
|
let i = r.get(n);
|
|
249
|
-
i || (n =
|
|
249
|
+
i || (n = Ie({ key: e.key, modifiers: t }), i = r.get(n)), !i && e.code.startsWith("Digit") && (n = Ie({ key: e.code.substring(5, e.code.length), modifiers: t }), i = this._commandsByShortcut.get(n)), !i && e.code.startsWith("Key") && (i = Ie({ key: e.code.substring(3, e.code.length), modifiers: t }), i = r.get(n));
|
|
250
250
|
let a = null;
|
|
251
251
|
return i && (a = this._commandsByKey.get(i), a && a.disabled() && (a = null), !a || a.target() && a.target().contains(e.target) || (a = null)), a || (this._parent?.findCommandByEvent(e) ?? null);
|
|
252
252
|
}
|
|
@@ -303,13 +303,13 @@ class on {
|
|
|
303
303
|
}), e;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
const On = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd" : "Ctrl", In = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "⌘" : "^",
|
|
306
|
+
const On = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd" : "Ctrl", In = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "⌘" : "^", Ie = (o, e = !1) => {
|
|
307
307
|
const t = {};
|
|
308
308
|
for (let r = 0; o.modifiers && r < o.modifiers.length; r++) t[o.modifiers[r]] = !0;
|
|
309
309
|
let n = "";
|
|
310
310
|
return (t?.[Q.Ctrl] || t?.[Q.Meta]) && (n += (n.length > 0 ? "+" : "") + (e ? In : On)), t?.[Q.Alt] && (n += e ? "⌥" : "Alt"), t?.[Q.Shift] && (n += (n.length > 0 ? "+" : "") + (e ? "⇧" : "Shift")), n += (n.length > 0 ? "+" : "") + nn(o.key), n;
|
|
311
311
|
};
|
|
312
|
-
function
|
|
312
|
+
function Ho(o, e = null) {
|
|
313
313
|
const t = K(e);
|
|
314
314
|
t.current = e;
|
|
315
315
|
const [n, r] = Yt((a) => a + 1, 0), i = R(() => Array.isArray(o) ? o : [o], [o]);
|
|
@@ -342,7 +342,7 @@ const Ze = (o, e) => {
|
|
|
342
342
|
}
|
|
343
343
|
return n;
|
|
344
344
|
};
|
|
345
|
-
function
|
|
345
|
+
function Wo(o, e = null, t = null, n) {
|
|
346
346
|
const r = K(t);
|
|
347
347
|
r.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
348
348
|
const [i, a] = q(Ze(o, e)), u = n ? [...n, o] : [o];
|
|
@@ -361,8 +361,8 @@ function Yo(o, e = null, t = null, n) {
|
|
|
361
361
|
};
|
|
362
362
|
}, u), i;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
364
|
+
const Vo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Fo = { 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" };
|
|
365
|
+
function _t(o, e) {
|
|
366
366
|
if (typeof o == "function") return o(e);
|
|
367
367
|
o && (o.current = e);
|
|
368
368
|
}
|
|
@@ -370,8 +370,8 @@ var Ae = parseInt(bn.split(".")[0], 10) >= 19 ? function(o) {
|
|
|
370
370
|
return (e) => {
|
|
371
371
|
const t = [];
|
|
372
372
|
for (const n of o) {
|
|
373
|
-
const r =
|
|
374
|
-
t.push(i ? r : () =>
|
|
373
|
+
const r = _t(n, e), i = typeof r == "function";
|
|
374
|
+
t.push(i ? r : () => _t(n, null));
|
|
375
375
|
}
|
|
376
376
|
return () => {
|
|
377
377
|
for (const n of t) n();
|
|
@@ -379,10 +379,10 @@ var Ae = parseInt(bn.split(".")[0], 10) >= 19 ? function(o) {
|
|
|
379
379
|
};
|
|
380
380
|
} : function(o) {
|
|
381
381
|
return (e) => {
|
|
382
|
-
for (const t of o)
|
|
382
|
+
for (const t of o) _t(t, e);
|
|
383
383
|
};
|
|
384
384
|
};
|
|
385
|
-
const
|
|
385
|
+
const jo = _e(Me((o, e) => {
|
|
386
386
|
const { refFocusStart: t, ...n } = o, r = K(null), i = U(() => {
|
|
387
387
|
if (t) return void t?.current?.focus();
|
|
388
388
|
const a = r.current.parentElement.children;
|
|
@@ -399,9 +399,9 @@ const Zo = me(Ee((o, e) => {
|
|
|
399
399
|
return P("div", { tabIndex: 0, ref: Ae([r, e]), onFocus: i, ...n });
|
|
400
400
|
}));
|
|
401
401
|
var $n = function() {
|
|
402
|
-
}, rn = typeof window < "u", Kn = rn ?
|
|
403
|
-
const
|
|
404
|
-
var o = q(null), e = o[0], t = o[1], n = q(
|
|
402
|
+
}, rn = typeof window < "u", Kn = rn ? Lt : W, Bt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
403
|
+
const Ee = rn && window.ResizeObserver !== void 0 ? function() {
|
|
404
|
+
var o = q(null), e = o[0], t = o[1], n = q(Bt), r = n[0], i = n[1], a = R(function() {
|
|
405
405
|
return new window.ResizeObserver(function(u) {
|
|
406
406
|
if (u[0]) {
|
|
407
407
|
var l = u[0].contentRect, s = l.x, c = l.y, h = l.width, d = l.height, f = l.top, m = l.left, p = l.bottom, x = l.right;
|
|
@@ -415,18 +415,18 @@ const Se = rn && window.ResizeObserver !== void 0 ? function() {
|
|
|
415
415
|
};
|
|
416
416
|
}, [e]), [t, r];
|
|
417
417
|
} : function() {
|
|
418
|
-
return [$n,
|
|
419
|
-
},
|
|
420
|
-
const { className: t, style: n, children: r, radius: i = 4, strokeWidth: a = 1, strokeColor: u = "grey", ...l } = o, [s, { width: c, height: h }] =
|
|
418
|
+
return [$n, Bt];
|
|
419
|
+
}, Uo = _e(Me((o, e) => {
|
|
420
|
+
const { className: t, style: n, children: r, radius: i = 4, strokeWidth: a = 1, strokeColor: u = "grey", ...l } = o, [s, { width: c, height: h }] = Ee(), d = K(null), f = (L, y = 0) => {
|
|
421
421
|
const _ = L / 2, v = h - _ + y;
|
|
422
422
|
return (function(B, S, O = !1) {
|
|
423
423
|
if (S === 0) return B;
|
|
424
|
-
function I(T, g,
|
|
424
|
+
function I(T, g, z) {
|
|
425
425
|
let H = g.x - T.x, X = g.y - T.y, D = Math.sqrt(H * H + X * X);
|
|
426
|
-
return M(T, g, Math.min(1,
|
|
426
|
+
return M(T, g, Math.min(1, z / D));
|
|
427
427
|
}
|
|
428
|
-
function M(T, g,
|
|
429
|
-
return { x: T.x + (g.x - T.x) *
|
|
428
|
+
function M(T, g, z) {
|
|
429
|
+
return { x: T.x + (g.x - T.x) * z, y: T.y + (g.y - T.y) * z };
|
|
430
430
|
}
|
|
431
431
|
function b(T, g) {
|
|
432
432
|
T.length > 2 && (T[T.length - 2] = g.x, T[T.length - 1] = g.y);
|
|
@@ -435,26 +435,26 @@ const Se = rn && window.ResizeObserver !== void 0 ? function() {
|
|
|
435
435
|
return { x: parseFloat(T[T.length - 2]), y: parseFloat(T[T.length - 1]) };
|
|
436
436
|
}
|
|
437
437
|
let E = B.split(/[,\s]/).reduce(function(T, g) {
|
|
438
|
-
let
|
|
439
|
-
return
|
|
438
|
+
let z = g.match("([a-zA-Z])(.+)");
|
|
439
|
+
return z ? (T.push(z[1]), T.push(z[2])) : T.push(g), T;
|
|
440
440
|
}, []).reduce(function(T, g) {
|
|
441
441
|
return parseFloat(g) == g && T.length ? T[T.length - 1].push(g) : T.push([g]), T;
|
|
442
442
|
}, []), $ = [];
|
|
443
443
|
if (E.length > 1) {
|
|
444
444
|
let T = C(E[0]), g = null;
|
|
445
445
|
E[E.length - 1][0] === "Z" && E[0].length > 2 && (g = ["L", T.x, T.y], E[E.length - 1] = g), $.push(E[0]);
|
|
446
|
-
for (let
|
|
447
|
-
let H = $[$.length - 1], X = E[
|
|
446
|
+
for (let z = 1; z < E.length; z++) {
|
|
447
|
+
let H = $[$.length - 1], X = E[z], D = X === g ? E[1] : E[z + 1];
|
|
448
448
|
if (D && H && H.length > 2 && X[0] === "L" && D.length > 2 && D[0] === "L") {
|
|
449
|
-
let F, V, Y = C(H), ee = C(X),
|
|
450
|
-
O ? (F = M(ee, H.origPoint || Y, S), V = M(ee, D.origPoint ||
|
|
451
|
-
let
|
|
452
|
-
|
|
449
|
+
let F, V, Y = C(H), ee = C(X), Le = C(D);
|
|
450
|
+
O ? (F = M(ee, H.origPoint || Y, S), V = M(ee, D.origPoint || Le, S)) : (F = I(ee, Y, S), V = I(ee, Le, S)), b(X, F), X.origPoint = ee, $.push(X);
|
|
451
|
+
let ge = M(F, ee, 0.5), Ce = M(ee, V, 0.5), ye = ["C", ge.x, ge.y, Ce.x, Ce.y, V.x, V.y];
|
|
452
|
+
ye.origPoint = ee, $.push(ye);
|
|
453
453
|
} else $.push(X);
|
|
454
454
|
}
|
|
455
455
|
if (g) {
|
|
456
|
-
let
|
|
457
|
-
$.push(["Z"]), b($[0],
|
|
456
|
+
let z = C($[$.length - 1]);
|
|
457
|
+
$.push(["Z"]), b($[0], z);
|
|
458
458
|
}
|
|
459
459
|
} else $ = E;
|
|
460
460
|
return $.reduce(function(T, g) {
|
|
@@ -466,8 +466,8 @@ const Se = rn && window.ResizeObserver !== void 0 ? function() {
|
|
|
466
466
|
const L = i / 2;
|
|
467
467
|
return f(i) + `L ${c} 0 L 0 0 L 0 ${L}`;
|
|
468
468
|
}, [m, i, a]), x = R(() => ({ style: { clipPath: `path('${p}')` } }), [p]);
|
|
469
|
-
return
|
|
470
|
-
})),
|
|
469
|
+
return fe("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...l, ref: Ae([d, s, e]), children: [ae.isValidElement(r) ? ae.cloneElement(r, x) : P(me, {}), P("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: c, height: h, viewBox: `0 0 ${c} ${h}`, children: P("path", { d: m, stroke: u, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: a }) })] });
|
|
470
|
+
})), Ot = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
471
471
|
class Nn extends vn {
|
|
472
472
|
setOverrides(e) {
|
|
473
473
|
super.setOverrides(e);
|
|
@@ -478,7 +478,7 @@ class Nn extends vn {
|
|
|
478
478
|
showMessage(e, t) {
|
|
479
479
|
const n = this.getDelegate();
|
|
480
480
|
if (n?.showMessage) return n.showMessage(e, t);
|
|
481
|
-
t?.type !==
|
|
481
|
+
t?.type !== Ot.Warning ? t?.type !== Ot.Error ? xe.log(e) : xe.error(e) : xe.warn(e);
|
|
482
482
|
}
|
|
483
483
|
showBusy(e, t) {
|
|
484
484
|
const n = this.getDelegate();
|
|
@@ -493,7 +493,7 @@ class Nn extends vn {
|
|
|
493
493
|
}
|
|
494
494
|
showError(e) {
|
|
495
495
|
const t = this.getDelegate();
|
|
496
|
-
t?.showError ? t.showError(e) :
|
|
496
|
+
t?.showError ? t.showError(e) : xe.error(e);
|
|
497
497
|
}
|
|
498
498
|
showOptions(e) {
|
|
499
499
|
const t = this.getDelegate();
|
|
@@ -504,14 +504,14 @@ class Nn extends vn {
|
|
|
504
504
|
return t?.showInput ? t.showInput(e) : Promise.resolve({ input: "", option: "" });
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
const sn = Gt(new Nn()),
|
|
508
|
-
const t =
|
|
509
|
-
return
|
|
510
|
-
|
|
507
|
+
const sn = Gt(new Nn()), Xo = ({ children: o, notifier: e }) => (ae.useEffect(() => {
|
|
508
|
+
const t = xe.getOverrides();
|
|
509
|
+
return xe.setOverrides(e), () => {
|
|
510
|
+
xe.setOverrides(t);
|
|
511
511
|
};
|
|
512
|
-
}, [e]), ae.createElement(sn.Provider, { value: e }, o)),
|
|
512
|
+
}, [e]), ae.createElement(sn.Provider, { value: e }, o)), lt = () => qt(sn), Rn = 3, Hn = 0.5, Wn = 50, gt = (o) => ({ x: o.x, y: o.y, width: o.width, height: o.height, top: o.top, left: o.left, right: o.right, bottom: o.bottom });
|
|
513
513
|
function Vn(o = {}) {
|
|
514
|
-
const { threshold: e = Hn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Wn } = o, [r, i] =
|
|
514
|
+
const { threshold: e = Hn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Wn } = o, [r, i] = Ee(), a = K(null), [u, l] = Yt((m) => m + 1, 0), s = K(void 0), c = K({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), h = U((m) => {
|
|
515
515
|
a.current = m, typeof r == "function" && r(m);
|
|
516
516
|
}, [r]), [d, f] = q(i);
|
|
517
517
|
return W(() => {
|
|
@@ -523,7 +523,7 @@ function Vn(o = {}) {
|
|
|
523
523
|
const L = () => {
|
|
524
524
|
if (!m) return;
|
|
525
525
|
const S = m.getBoundingClientRect(), O = c.current;
|
|
526
|
-
Math.abs(S.x - O.x) > e || Math.abs(S.y - O.y) > e || Math.abs(S.width - O.width) > e || Math.abs(S.height - O.height) > e ? (p || (p = !0, f(
|
|
526
|
+
Math.abs(S.x - O.x) > e || Math.abs(S.y - O.y) > e || Math.abs(S.width - O.width) > e || Math.abs(S.height - O.height) > e ? (p || (p = !0, f(gt(S)), l()), x = 0) : x++, p && x >= t && (p = !1, f(gt(S)), l()), c.current = gt(S), s.current = requestAnimationFrame(L);
|
|
527
527
|
};
|
|
528
528
|
s.current = requestAnimationFrame(L);
|
|
529
529
|
const y = (S) => {
|
|
@@ -547,7 +547,7 @@ const k = (o, e) => {
|
|
|
547
547
|
const r = U((...i) => n.current?.(...i), []);
|
|
548
548
|
if (n.current) return r;
|
|
549
549
|
};
|
|
550
|
-
function
|
|
550
|
+
function Yo(o) {
|
|
551
551
|
const [e, t] = q(typeof window < "u" ? window.devicePixelRatio : 1), n = K(null);
|
|
552
552
|
return W(() => {
|
|
553
553
|
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
@@ -560,12 +560,12 @@ function er(o) {
|
|
|
560
560
|
};
|
|
561
561
|
}, [o]), e;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function Go(o) {
|
|
564
564
|
if (typeof window > "u") return 1;
|
|
565
565
|
const { defaultDpr: e = 1, maxDpr: t = 3, round: n = !0 } = o || {}, r = typeof window < "u" && typeof window.devicePixelRatio == "number" ? window.devicePixelRatio : e;
|
|
566
566
|
return Math.min(Math.max(1, n ? Math.floor(r) : r), t);
|
|
567
567
|
}
|
|
568
|
-
function
|
|
568
|
+
function qo(o, e, t) {
|
|
569
569
|
const n = k(e, [e]);
|
|
570
570
|
W(() => {
|
|
571
571
|
const r = (i) => {
|
|
@@ -638,7 +638,7 @@ function ln(o) {
|
|
|
638
638
|
b.isDefaultPrevented() || (m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, a(b, m.current) !== !1 && (d.current = b, f.current = b.nativeEvent, document.addEventListener(`${y}up`, v, { passive: !1 }), document.addEventListener(`${y}move`, O, { passive: !1 }), document.addEventListener("keydown", I, { passive: !1 }), document.addEventListener("keyup", M, { passive: !1 }), window.addEventListener("blur", B, { passive: !0 }), r && i && (document.addEventListener("touchstart", _, { passive: !1, capture: !0 }), document.addEventListener("touchmove", _, { passive: !1, capture: !0 })), s.current = !0, L(c)));
|
|
639
639
|
}, [c, r]);
|
|
640
640
|
}
|
|
641
|
-
function
|
|
641
|
+
function Zo(o, e) {
|
|
642
642
|
return ln({ onPointerDown: o, onPointerMoveOrWait: (t, n, r) => {
|
|
643
643
|
o?.(r);
|
|
644
644
|
}, ...e });
|
|
@@ -647,39 +647,39 @@ const jn = ({ initValue: o, useHookBody: e, applyStateChange: t }) => {
|
|
|
647
647
|
const n = K(o);
|
|
648
648
|
if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
|
|
649
649
|
const r = e();
|
|
650
|
-
return
|
|
650
|
+
return Lt(() => {
|
|
651
651
|
n.current !== r && (n.current = r, t(r));
|
|
652
652
|
}, [t, r]), null;
|
|
653
|
-
},
|
|
653
|
+
}, xt = (o) => {
|
|
654
654
|
console && console.warn && console.warn(o);
|
|
655
|
-
},
|
|
656
|
-
let Un = 1,
|
|
657
|
-
const nt = [],
|
|
658
|
-
|
|
655
|
+
}, yt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
656
|
+
let Un = 1, St = !1, an = !1;
|
|
657
|
+
const nt = [], De = [], it = () => {
|
|
658
|
+
De.forEach((o) => o());
|
|
659
659
|
}, Xn = ({ automaticContainerInternalUseOnly: o }) => {
|
|
660
660
|
const [e, t] = q([]), n = K([]);
|
|
661
|
-
return n.current = e, o ||
|
|
661
|
+
return n.current = e, o || St !== !1 || (an = !0), W(() => {
|
|
662
662
|
let r = !0;
|
|
663
663
|
function i() {
|
|
664
|
-
if (r) return
|
|
664
|
+
if (r) return De[0] !== i ? (o || St !== !0 || xt("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([...nt]);
|
|
665
665
|
}
|
|
666
|
-
return
|
|
667
|
-
r = !1, n.current?.length > 0 &&
|
|
666
|
+
return De.push(i), it(), () => {
|
|
667
|
+
r = !1, n.current?.length > 0 && xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), De.splice(De.indexOf(i), 1), it();
|
|
668
668
|
};
|
|
669
|
-
}, [o]), P(
|
|
669
|
+
}, [o]), P(me, { children: e.map(({ hook: r, key: i }) => wn(jn, { ...r, key: i })) });
|
|
670
670
|
}, Yn = (o) => {
|
|
671
671
|
const e = Un++;
|
|
672
|
-
return nt.push({ hook: o, key: e }),
|
|
673
|
-
if (
|
|
674
|
-
const n =
|
|
672
|
+
return nt.push({ hook: o, key: e }), De.length === 0 && an === !1 && (St = !0, ((t) => {
|
|
673
|
+
if (yt.document && yt.document.createElement) {
|
|
674
|
+
const n = yt.document.createElement("div");
|
|
675
675
|
En(n).render(P(t, { automaticContainerInternalUseOnly: !0 }));
|
|
676
|
-
} else
|
|
676
|
+
} else xt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
677
677
|
})(Xn)), it(), () => {
|
|
678
678
|
nt.splice(nt.findIndex((t) => t.key === e), 1), it();
|
|
679
679
|
};
|
|
680
680
|
};
|
|
681
|
-
let
|
|
682
|
-
|
|
681
|
+
let Et = null;
|
|
682
|
+
Et || (Et = (o, e, t = {}) => {
|
|
683
683
|
let n, r, i = !1, a = !1, u = [], { unmountIfNoConsumers: l = !1 } = t;
|
|
684
684
|
const s = (h) => {
|
|
685
685
|
r = h, Mn(() => u.forEach((d) => d(h)));
|
|
@@ -691,14 +691,14 @@ St || (St = (o, e, t = {}) => {
|
|
|
691
691
|
}), []), h;
|
|
692
692
|
};
|
|
693
693
|
});
|
|
694
|
-
const cn =
|
|
694
|
+
const cn = Et;
|
|
695
695
|
let un = () => {
|
|
696
696
|
console.warn("You must call useEditMode before setting its state.");
|
|
697
697
|
};
|
|
698
698
|
const Gn = cn(null, () => {
|
|
699
699
|
const [o, e] = q(null);
|
|
700
700
|
return un = e, o;
|
|
701
|
-
}),
|
|
701
|
+
}), Jo = () => {
|
|
702
702
|
const o = Gn();
|
|
703
703
|
return R(() => ({ setMode: (e) => {
|
|
704
704
|
un((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
|
|
@@ -708,12 +708,12 @@ const Gn = cn(null, () => {
|
|
|
708
708
|
}, getClipboard: () => rt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
709
709
|
const [o, e] = q(rt.Global);
|
|
710
710
|
return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy: K(null), refNativeLastKey: K(null) };
|
|
711
|
-
}),
|
|
712
|
-
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a =
|
|
711
|
+
}), Qo = (o) => {
|
|
712
|
+
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a = lt(), u = k(r, [r]), l = k(n, [n]), { getClipboard: s, refNativeCopy: c } = qn(), h = s();
|
|
713
713
|
R(() => {
|
|
714
714
|
const y = e?.element, _ = t?.element ?? e?.element;
|
|
715
715
|
if (!i) return;
|
|
716
|
-
const v = [new
|
|
716
|
+
const v = [new mt("cut", y, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [Q.Ctrl] } }), new mt("copy", y, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [Q.Ctrl] } }), new mt("paste", _, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Q.Ctrl] }, { key: "F8", modifiers: [Q.Ctrl] }] })];
|
|
717
717
|
i?.addCommands(v, !0);
|
|
718
718
|
}, [i]);
|
|
719
719
|
const d = k(async (y) => {
|
|
@@ -771,7 +771,7 @@ const Gn = cn(null, () => {
|
|
|
771
771
|
const _ = await h.readReference();
|
|
772
772
|
if (_) return void await x(null, _, y);
|
|
773
773
|
const v = [];
|
|
774
|
-
v[0] = await
|
|
774
|
+
v[0] = await pt.readStringFromClipboard(h, ft.plain), v[1] = await pt.readHTMLFromClipboard(h, ft.html), v[2] = await pt.readBlobFromClipboard(h, ft.png);
|
|
775
775
|
const B = { text: v[0] ?? null, html: v[1] ?? null, image: v[2] ?? null };
|
|
776
776
|
await x(B, null, y);
|
|
777
777
|
} catch (_) {
|
|
@@ -799,7 +799,7 @@ const Gn = cn(null, () => {
|
|
|
799
799
|
i?.getCommand("cut")?.updateCallback(m).update({ disabled: !e || !t }), i?.getCommand("copy")?.updateCallback(f).update({ disabled: !e }), i?.getCommand("paste")?.updateCallback(L).update({ disabled: !t });
|
|
800
800
|
}, [e, t, i]), { paste: L, copy: f, clipboard: h };
|
|
801
801
|
};
|
|
802
|
-
function
|
|
802
|
+
function er(o, e = !0) {
|
|
803
803
|
const t = K(o);
|
|
804
804
|
W(() => {
|
|
805
805
|
if (e) {
|
|
@@ -809,17 +809,17 @@ function sr(o, e = !0) {
|
|
|
809
809
|
t.current = o;
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
|
-
let
|
|
813
|
-
var Jn = typeof document < "u" ?
|
|
814
|
-
const
|
|
815
|
-
const [o, e] = ae.useState(() =>
|
|
812
|
+
let vt = !1, Zn = 0;
|
|
813
|
+
var Jn = typeof document < "u" ? Lt : W;
|
|
814
|
+
const It = () => "sheetxl-ui-" + Zn++, $t = ae.useId, tr = $t ?? function() {
|
|
815
|
+
const [o, e] = ae.useState(() => vt ? It() : void 0);
|
|
816
816
|
return Jn(() => {
|
|
817
|
-
o == null && e(
|
|
817
|
+
o == null && e(It());
|
|
818
818
|
}, []), ae.useEffect(() => {
|
|
819
|
-
|
|
819
|
+
vt || (vt = !0);
|
|
820
820
|
}, []), o;
|
|
821
821
|
}, Qn = [];
|
|
822
|
-
function
|
|
822
|
+
function Tt(o, e, t = Qn) {
|
|
823
823
|
const n = K(null);
|
|
824
824
|
return xn(o, () => {
|
|
825
825
|
if (!n.current) return;
|
|
@@ -833,8 +833,8 @@ function Ct(o, e, t = Qn) {
|
|
|
833
833
|
return r;
|
|
834
834
|
}, t), n;
|
|
835
835
|
}
|
|
836
|
-
const
|
|
837
|
-
const n =
|
|
836
|
+
const Kt = "Undo the last action.", Nt = "Repeat the last action or undo the redo.", eo = (o) => `Redo ${o}`, nr = ({ manager: o, commands: e, disabled: t }) => {
|
|
837
|
+
const n = lt(), r = k((a) => {
|
|
838
838
|
try {
|
|
839
839
|
o?.undo(a);
|
|
840
840
|
} catch (u) {
|
|
@@ -850,16 +850,16 @@ const $t = "Undo the last action.", Kt = "Repeat the last action or undo the red
|
|
|
850
850
|
return R(() => {
|
|
851
851
|
if (!e) return;
|
|
852
852
|
const a = { contains: (l) => !0, focus() {
|
|
853
|
-
} }, u = [new
|
|
853
|
+
} }, u = [new bt("undo", a, { label: "Undo", description: Kt, shortcut: { key: "z", modifiers: [Q.Ctrl] }, disabled: !0 }, r), new bt("redo", a, { label: "Redo", description: Nt, shortcut: [{ key: "y", modifiers: [Q.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Q.Alt] }], disabled: !0 }, i)];
|
|
854
854
|
e?.addCommands(u, !0);
|
|
855
855
|
}, [e]), W(() => {
|
|
856
856
|
if (!e) return;
|
|
857
857
|
const a = () => {
|
|
858
858
|
const l = o?.getTopUndoDescription(), s = {};
|
|
859
859
|
var c;
|
|
860
|
-
e.getCommand("undo").update({ disabled: t || !o || !o.hasUndo(), description: l ? (c = l, `Undo ${c}`) :
|
|
860
|
+
e.getCommand("undo").update({ disabled: t || !o || !o.hasUndo(), description: l ? (c = l, `Undo ${c}`) : Kt, state: s, context: { undoManager: o } });
|
|
861
861
|
const h = o?.getTopRedoDescription();
|
|
862
|
-
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: h ? eo(h) :
|
|
862
|
+
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: h ? eo(h) : Nt, state: s, context: { undoManager: o } });
|
|
863
863
|
};
|
|
864
864
|
if (a(), !o) return;
|
|
865
865
|
const u = o.addListener({ onStackChange() {
|
|
@@ -879,8 +879,8 @@ class to extends Sn {
|
|
|
879
879
|
return this.props.children;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
const
|
|
883
|
-
const e =
|
|
882
|
+
const or = ({ children: o }) => {
|
|
883
|
+
const e = lt(), t = U((n) => {
|
|
884
884
|
e.showError(n);
|
|
885
885
|
}, [e]);
|
|
886
886
|
return P(to, { onError: t, children: o });
|
|
@@ -901,15 +901,15 @@ class no {
|
|
|
901
901
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
const
|
|
905
|
-
const e =
|
|
904
|
+
const rr = ({ children: o }) => {
|
|
905
|
+
const e = lt();
|
|
906
906
|
return W(() => {
|
|
907
907
|
const t = new no(e);
|
|
908
908
|
return () => {
|
|
909
909
|
t.cleanup();
|
|
910
910
|
};
|
|
911
|
-
}, [e]), P(
|
|
912
|
-
},
|
|
911
|
+
}, [e]), P(me, { children: o });
|
|
912
|
+
}, ir = () => null;
|
|
913
913
|
function hn(o) {
|
|
914
914
|
var e, t, n = "";
|
|
915
915
|
if (typeof o == "string" || typeof o == "number") n += o;
|
|
@@ -924,60 +924,60 @@ function G() {
|
|
|
924
924
|
return n;
|
|
925
925
|
}
|
|
926
926
|
const oo = {}, ro = (o) => {
|
|
927
|
-
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u,
|
|
927
|
+
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u, propsHitArea: l = oo, ...s } = o, c = n === "row", { style: h, className: d, ...f } = l;
|
|
928
928
|
return P("div", { style: { ...t, position: "relative" }, ...s, children: P("div", { className: G("hit-box", d), style: { left: (c ? -r : 0) + "px", width: `calc(100% + ${c ? r + i : 0}px)`, top: (c ? 0 : -r) + "px", height: `calc(100% + ${c ? 0 : r + i}px)`, position: "absolute", ...h }, onPointerDown: a ? void 0 : e, ...f }) }, u);
|
|
929
|
-
}, Qe = {},
|
|
929
|
+
}, Qe = {}, we = (o, e, t = !0) => o === null ? null : o.pixels !== null ? t ? o.pixels : e - o.pixels : (t ? o.percent : 100 - o.percent) / 100 * e, et = (o, e = !0) => o?.percent ? `${e ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, he = (o, e) => {
|
|
930
930
|
if (o == null) return null;
|
|
931
931
|
const t = { percent: null, pixels: null };
|
|
932
932
|
let n = e;
|
|
933
933
|
return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? t.percent = o : t.pixels = o, Object.freeze(t);
|
|
934
|
-
}, io =
|
|
935
|
-
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: a, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: c, maxAfter: h, children: d, className: f, style: m, disabled: p = !1, onDragStart: x, onDragResize: L, onDragFinish: y,
|
|
934
|
+
}, io = _e(Me((o, e) => {
|
|
935
|
+
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: a, onPositionChange: u, minBefore: l, maxBefore: s, minAfter: c, maxAfter: h, children: d, className: f, style: m, disabled: p = !1, onDragStart: x, onDragResize: L, onDragFinish: y, propsResizer: _ = Qe, propsPane: v = Qe, propsPaneBefore: B = Qe, propsPaneAfter: S = Qe, renderResizer: O = ro } = o;
|
|
936
936
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
937
937
|
const I = R(() => ae.isValidElement(n) && ae.isValidElement(t), [n, t]), M = R(() => {
|
|
938
|
-
let
|
|
939
|
-
i && (i === "before" ?
|
|
940
|
-
const j =
|
|
941
|
-
return { fixedPaneOffset:
|
|
938
|
+
let A = null;
|
|
939
|
+
i && (i === "before" ? A = 0 : i === "after" && (A = 1));
|
|
940
|
+
const j = A === null;
|
|
941
|
+
return { fixedPaneOffset: A, isPercent: j, minBefore: he(l, j), maxBefore: he(s, j), minAfter: he(c, j), maxAfter: he(h, j) };
|
|
942
942
|
}, [l, s, c, h]), b = k(u, [u]), [C, E] = q(() => he(a, i === null));
|
|
943
943
|
W(() => {
|
|
944
944
|
E(he(a, i === null));
|
|
945
945
|
}, [a, i]);
|
|
946
|
-
const [$, { width: T, height: g }] =
|
|
946
|
+
const [$, { width: T, height: g }] = Ee(), [z, { width: H, height: X }] = Ee(), D = r === "row" ? H : X, F = r === "row" ? T : g, V = R(() => ((A, j, oe, J) => {
|
|
947
947
|
const ce = [null, null], le = [null, null];
|
|
948
|
-
if (
|
|
949
|
-
let ue =
|
|
950
|
-
qe = (
|
|
948
|
+
if (A || (A = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, le[1] = 100) : (ce[1] = A?.pixels - oe, le[0] = 100) : A?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = A?.percent, le[1] = 100 - A?.percent) : (le[1] = A?.percent, le[0] = 100 - A?.percent)), { percents: le, pixels: ce, minBefore: et(J.minBefore, !0), maxBefore: et(J.maxBefore, !0), minAfter: et(J.minAfter), maxAfter: et(J.maxAfter) };
|
|
949
|
+
let ue = we(A, j, J.fixedPaneOffset !== 1), ie = j - oe, kt = we(J.minBefore, ie, !0) ?? 0, gn = we(J.maxBefore, ie, !0) ?? ie, qe = 0, dt = 0, Pt = 0, Dt = ie;
|
|
950
|
+
qe = (we(J.maxAfter, j, !1) ?? oe) - oe, dt = we(J.minAfter, j, !1) ?? j, Pt = Math.max(kt, qe), Dt = Math.min(gn, dt), ue = Math.max(Pt, Math.min(ue, Dt)), dt = Math.min(ie - ue, we(J.maxAfter, ie - ue, !0) ?? ie), qe = Math.min(ie - ue, we(J.minAfter, ie - ue, !0) ?? ie), ce[0] = ue, ce[1] = ie - ce[0];
|
|
951
951
|
const yn = Math.max(0, Math.min(100, ue / ie * 100));
|
|
952
|
-
return le[0] = yn, le[1] = 100 - le[0], { percents: le, pixels: ce, minBefore: `${
|
|
953
|
-
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1),
|
|
954
|
-
const j = he(
|
|
952
|
+
return le[0] = yn, le[1] = 100 - le[0], { percents: le, pixels: ce, minBefore: `${kt}px`, minAfter: `${qe}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
|
|
953
|
+
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1), Le = k(x, [x]), ge = k(L, [L]), Ce = k(y, [y]), ye = K(null), at = K(null), Ne = K(null), { style: ct, className: Re, ...He } = v, We = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...ct }, { className: ut, style: Ve, ...Fe } = B, { className: je, style: Ue, ...Te } = S, Be = { flex: "1 1 100%", width: "100%", ...m, flexDirection: r, display: "flex" }, { className: se, style: ke, onPointerDown: Xe, ...Ye } = _, Oe = k((A) => {
|
|
954
|
+
const j = he(A, i === null);
|
|
955
955
|
E(j);
|
|
956
|
-
}, [i]), w = k((
|
|
956
|
+
}, [i]), w = k((A) => {
|
|
957
957
|
if (p || !Y) return;
|
|
958
|
-
const j =
|
|
958
|
+
const j = ve.current?.getBoundingClientRect();
|
|
959
959
|
let oe = 0;
|
|
960
|
-
oe = r === "row" ? (
|
|
961
|
-
}, [M, r, p, Y, C, F]), N = k((
|
|
960
|
+
oe = r === "row" ? (A.clientX ?? A.touches?.[0]?.clientX) - j.x : (A.clientY ?? A.touches?.[0]?.clientY) - j.y, oe = Math.max(0, Math.min(F, oe)), M.fixedPaneOffset === 1 && (oe = F - oe), a && C.pixels === oe || E({ pixels: oe, percent: null }), ge?.(oe), A.stopPropagation(), A.preventDefault();
|
|
961
|
+
}, [M, r, p, Y, C, F]), N = k((A) => {
|
|
962
962
|
if (document.removeEventListener("pointermove", w), document.removeEventListener("touchmove", w), document.removeEventListener("pointerup", N), !!Y && (ee(!1), !!C)) {
|
|
963
|
-
if (
|
|
963
|
+
if (Ce(C.pixels), !he(a, i === null) || C.pixels !== a) {
|
|
964
964
|
const j = { ...C };
|
|
965
965
|
j.percent === null && (j.percent = j.pixels / F * 100), b(j);
|
|
966
966
|
}
|
|
967
|
-
|
|
967
|
+
A.stopPropagation(), A.preventDefault();
|
|
968
968
|
}
|
|
969
|
-
}, [C, Y, a, i, F]), Z = k((
|
|
970
|
-
Xe?.(
|
|
971
|
-
}, [Xe]),
|
|
969
|
+
}, [C, Y, a, i, F]), Z = k((A) => {
|
|
970
|
+
Xe?.(A), A.defaultPrevented || p || Y || (ee(!0), Le(), document.addEventListener("pointermove", w, { passive: !1 }), document.addEventListener("touchmove", w, { passive: !1 }), document.addEventListener("pointerup", N, { passive: !1 }));
|
|
971
|
+
}, [Xe]), ve = Tt(e, () => ({ setPosition: Oe, isSplitPane: () => !0 }), []), Pe = R(() => I ? O?.({ key: "resizer", ref: Ae([z, at]), className: G("resizer", se), onPointerDownCapture: Z, style: { cursor: p ? void 0 : r === "row" ? "ew-resize" : "ns-resize", minWidth: r === "row" ? "2px" : void 0, minHeight: r !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ke }, splitDirection: r, disabled: p, ...Ye }) : null, [I, se, Ye, r, ke, p]), be = r === "row" ? "Width" : "Height", ht = R(() => {
|
|
972
972
|
if (!t) return null;
|
|
973
|
-
const
|
|
974
|
-
return P("div", { ref:
|
|
973
|
+
const A = { ...We, ...Ve, flex: M.fixedPaneOffset === 0 && V?.pixels[0] !== null ? `0 0 ${Math.round(V?.pixels[0])}px` : `1 1 ${Math.round(V?.percents[0] ?? 100)}%`, [`min${be}`]: V?.minBefore, [`max${be}`]: n ? V?.maxBefore : "100%" };
|
|
974
|
+
return P("div", { ref: ye, className: G("before", Re, ut), style: A, ...He, ...Fe, children: t }, "before");
|
|
975
975
|
}, [t, v, B, M, V]), Ge = R(() => {
|
|
976
976
|
if (!n) return null;
|
|
977
|
-
const
|
|
978
|
-
return P("div", { ref: Ne, className: G("after", Re, je), style:
|
|
977
|
+
const A = { ...We, ...Ue, flex: M.fixedPaneOffset === 1 && V?.pixels[1] !== null ? `0 0 ${Math.round(V?.pixels[1])}px` : `1 1 ${Math.round(V?.percents[1] ?? 100)}%`, [`min${be}`]: V?.minAfter, [`max${be}`]: t ? V?.maxAfter : "100%" };
|
|
978
|
+
return P("div", { ref: Ne, className: G("after", Re, je), style: A, ...He, ...Te, children: n }, "after");
|
|
979
979
|
}, [n, v, S, M, V]);
|
|
980
|
-
return
|
|
980
|
+
return fe("div", { ref: Ae([$, ve]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y }, f), style: Be, children: [ht, Pe, Ge] });
|
|
981
981
|
}));
|
|
982
982
|
function so(o) {
|
|
983
983
|
if (typeof o == "function") return o;
|
|
@@ -1013,12 +1013,12 @@ function so(o) {
|
|
|
1013
1013
|
return null;
|
|
1014
1014
|
}
|
|
1015
1015
|
})(e);
|
|
1016
|
-
if (t) return
|
|
1016
|
+
if (t) return Wt(t);
|
|
1017
1017
|
}
|
|
1018
1018
|
if (e.startsWith("<")) {
|
|
1019
|
-
if (/^<\s*svg\b/i.test(e)) return
|
|
1019
|
+
if (/^<\s*svg\b/i.test(e)) return Wt(e);
|
|
1020
1020
|
if (/^<\s*path\b/i.test(e)) {
|
|
1021
|
-
const t =
|
|
1021
|
+
const t = Rt(e);
|
|
1022
1022
|
if (t) return { paths: [{ d: t }] };
|
|
1023
1023
|
}
|
|
1024
1024
|
return { paths: [{ d: e }] };
|
|
@@ -1030,7 +1030,7 @@ function so(o) {
|
|
|
1030
1030
|
for (const t of o) if (typeof t == "string") {
|
|
1031
1031
|
const n = String(t).trim();
|
|
1032
1032
|
if (n.startsWith("<path")) {
|
|
1033
|
-
const r =
|
|
1033
|
+
const r = Rt(n);
|
|
1034
1034
|
r && e.push({ d: r });
|
|
1035
1035
|
} else e.push({ d: n });
|
|
1036
1036
|
} else t && typeof t == "object" && "d" in t && typeof t.d == "string" && e.push({ ...t });
|
|
@@ -1038,11 +1038,11 @@ function so(o) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
return o;
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Rt(o) {
|
|
1042
1042
|
const e = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);
|
|
1043
1043
|
return e ? e[1] ?? e[2] ?? null : null;
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function Ht(o) {
|
|
1046
1046
|
if ("svg" in o) return { ...o, svg: so(o.svg) };
|
|
1047
1047
|
if ("url" in o) {
|
|
1048
1048
|
const e = typeof o.url == "string" ? { src: o.url } : o.url;
|
|
@@ -1054,7 +1054,7 @@ function Rt(o) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
return o;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function Wt(o) {
|
|
1058
1058
|
try {
|
|
1059
1059
|
if (typeof DOMParser < "u") {
|
|
1060
1060
|
const a = new DOMParser().parseFromString(o, "image/svg+xml"), u = a.querySelector("svg"), l = u?.getAttribute("viewBox") ?? void 0, s = [];
|
|
@@ -1082,9 +1082,9 @@ function Ht(o) {
|
|
|
1082
1082
|
for (; i = r.exec(o); ) n.push({ d: i[1] });
|
|
1083
1083
|
return { viewBox: t, paths: n };
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function Vt(o) {
|
|
1086
1086
|
const e = {};
|
|
1087
|
-
for (const [i, a] of Object.entries(o.icons)) e[i] =
|
|
1087
|
+
for (const [i, a] of Object.entries(o.icons)) e[i] = Ht(a);
|
|
1088
1088
|
const t = { label: o.meta?.label ?? "Unnamed", version: o.meta?.version ?? "1.0.0", license: o.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: o.meta?.extends ?? [] };
|
|
1089
1089
|
t.extends.includes("base") || t.extends.push("base");
|
|
1090
1090
|
const n = { meta: t, icons: e }, r = o.overrides;
|
|
@@ -1092,7 +1092,7 @@ function Wt(o) {
|
|
|
1092
1092
|
const i = {};
|
|
1093
1093
|
for (const [a, u] of Object.entries(r)) {
|
|
1094
1094
|
const l = {};
|
|
1095
|
-
for (const [s, c] of Object.entries(u)) l[s] =
|
|
1095
|
+
for (const [s, c] of Object.entries(u)) l[s] = Ht(c);
|
|
1096
1096
|
i[a] = l;
|
|
1097
1097
|
}
|
|
1098
1098
|
n.__overrides = i;
|
|
@@ -1110,7 +1110,7 @@ function lo() {
|
|
|
1110
1110
|
if (!s.loader) throw new Error(`No loader for icon pack: ${l}`);
|
|
1111
1111
|
s.loading = s.loader().then((c) => {
|
|
1112
1112
|
const h = c && typeof c == "object" && "default" in c ? c.default : c;
|
|
1113
|
-
s.pack =
|
|
1113
|
+
s.pack = Vt(h);
|
|
1114
1114
|
}).catch((c) => {
|
|
1115
1115
|
throw s.loading = void 0, c;
|
|
1116
1116
|
});
|
|
@@ -1153,7 +1153,7 @@ function lo() {
|
|
|
1153
1153
|
}
|
|
1154
1154
|
return { register: function(l, s) {
|
|
1155
1155
|
const c = o.get(l) ?? {};
|
|
1156
|
-
typeof s == "function" ? c.loader = s : c.pack =
|
|
1156
|
+
typeof s == "function" ? c.loader = s : c.pack = Vt(s), o.set(l, c), t || (t = l);
|
|
1157
1157
|
}, prefetch: async function(l = t) {
|
|
1158
1158
|
const s = Array.isArray(l) ? l : [l];
|
|
1159
1159
|
await Promise.all(s.map(r));
|
|
@@ -1207,9 +1207,9 @@ function lo() {
|
|
|
1207
1207
|
}
|
|
1208
1208
|
io.displayName = "SplitPane";
|
|
1209
1209
|
const ot = lo();
|
|
1210
|
-
ot.register("base", () => import("./
|
|
1211
|
-
const
|
|
1212
|
-
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l,
|
|
1210
|
+
ot.register("base", () => import("./DTq8GPy7DLZm2D6S.mjs"));
|
|
1211
|
+
const Ft = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Icon_17dpm_10" }, co = _e((o) => {
|
|
1212
|
+
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l, propsSource: s, children: c, ...h } = o, [d, f] = ae.useState(null);
|
|
1213
1213
|
ae.useEffect(() => {
|
|
1214
1214
|
let E = !0, $ = t, T = e;
|
|
1215
1215
|
if (!T) {
|
|
@@ -1217,8 +1217,8 @@ const Vt = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Ic
|
|
|
1217
1217
|
return void f({ glyph: g ? { svg: te.EmptyArray } : void 0, pack: g ?? void 0, packKey: $ ?? ot.getActive() });
|
|
1218
1218
|
}
|
|
1219
1219
|
if (T.includes(":")) {
|
|
1220
|
-
const [g,
|
|
1221
|
-
$ = g, T =
|
|
1220
|
+
const [g, z] = T.split(":");
|
|
1221
|
+
$ = g, T = z;
|
|
1222
1222
|
}
|
|
1223
1223
|
return ot.resolve(T, { packKey: $ }).then((g) => {
|
|
1224
1224
|
E && f(g);
|
|
@@ -1241,12 +1241,12 @@ const Vt = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Ic
|
|
|
1241
1241
|
}
|
|
1242
1242
|
const b = { viewBox: L?.viewBox ?? m?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1243
1243
|
if (typeof L == "function")
|
|
1244
|
-
return M(L(b) ?? P(
|
|
1245
|
-
if (!L) return M(P(
|
|
1244
|
+
return M(L(b) ?? P(Ft, { ...b }));
|
|
1245
|
+
if (!L) return M(P(Ft, { ...b }));
|
|
1246
1246
|
const C = L.paths;
|
|
1247
1247
|
return M(P("svg", { ...b, children: C ? C.map((E, $) => P("path", { d: E.d, className: E.className, fill: E.fill, stroke: E.stroke, opacity: E.opacity, fillRule: E.fillRule, clipRule: E.clipRule }, $)) : null }));
|
|
1248
1248
|
});
|
|
1249
|
-
function
|
|
1249
|
+
function sr(o) {
|
|
1250
1250
|
const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: r = 3, dashLength: i = 5, iconKey: a, packKey: u, style: l, className: s, ...c } = o, h = R(() => {
|
|
1251
1251
|
if (!e) return;
|
|
1252
1252
|
const f = { "--walk-duration": `${n * (r + i)}ms`, "--walk-dash-length": `${i}px`, "--walk-dash-gap": `${r}px` };
|
|
@@ -1254,7 +1254,7 @@ function dr(o) {
|
|
|
1254
1254
|
}, [e, n, r, i, t]), d = R(() => e ? s + " walking" : s, [e, s]);
|
|
1255
1255
|
return P(co, { iconKey: a, packKey: u, className: d, style: { ...l, ...h }, ...c });
|
|
1256
1256
|
}
|
|
1257
|
-
class
|
|
1257
|
+
class Mt {
|
|
1258
1258
|
constructor() {
|
|
1259
1259
|
this.store = /* @__PURE__ */ new Map();
|
|
1260
1260
|
}
|
|
@@ -1268,10 +1268,10 @@ class Et {
|
|
|
1268
1268
|
this.store.delete(e);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
const dn = Gt(null), pn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, uo = { store: new
|
|
1271
|
+
const dn = Gt(null), pn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, uo = { store: new Mt(), namespace: "", serializer: pn, debounceMs: 0, crossTabSync: !1, notify: () => {
|
|
1272
1272
|
}, subscribeKey: () => () => {
|
|
1273
1273
|
} };
|
|
1274
|
-
function
|
|
1274
|
+
function lr(o, e, t = ho) {
|
|
1275
1275
|
const { store: n, namespace: r, serializer: i, debounceMs: a, subscribeKey: u } = qt(dn) || uo, l = t.serializer ?? i ?? pn, s = R(() => `${r}:${o}`, [r, o]), c = K(null), h = `${s}::v`, [d, f] = q(() => {
|
|
1276
1276
|
let p;
|
|
1277
1277
|
try {
|
|
@@ -1326,8 +1326,8 @@ function pr(o, e, t = ho) {
|
|
|
1326
1326
|
}];
|
|
1327
1327
|
}
|
|
1328
1328
|
const ho = {};
|
|
1329
|
-
function
|
|
1330
|
-
const { store: e, namespace: t = "", serializer: n = po, debounceMs: r = 0, crossTabSync: i = !0, children: a } = o, u = R(() => typeof window > "u" ? new
|
|
1329
|
+
function ar(o) {
|
|
1330
|
+
const { store: e, namespace: t = "", serializer: n = po, debounceMs: r = 0, crossTabSync: i = !0, children: a } = o, u = R(() => typeof window > "u" ? new Mt() : e ?? new Mt(), [e]), l = K(/* @__PURE__ */ new Map()), s = R(() => ({ store: u, namespace: t, serializer: n, debounceMs: r, crossTabSync: i, notify(c) {
|
|
1331
1331
|
const h = l.current.get(c);
|
|
1332
1332
|
h && h.forEach((d) => d());
|
|
1333
1333
|
}, subscribeKey(c, h) {
|
|
@@ -1346,7 +1346,7 @@ function fr(o) {
|
|
|
1346
1346
|
}, [s]), P(dn.Provider, { value: s, children: a });
|
|
1347
1347
|
}
|
|
1348
1348
|
const po = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
|
|
1349
|
-
class
|
|
1349
|
+
class cr {
|
|
1350
1350
|
constructor(e = window.localStorage) {
|
|
1351
1351
|
this.storage = e;
|
|
1352
1352
|
}
|
|
@@ -1376,16 +1376,16 @@ class mr {
|
|
|
1376
1376
|
return window.addEventListener("storage", t), () => window.removeEventListener("storage", t);
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
const ne = { Horizontal: "horizontal", Vertical: "vertical" },
|
|
1379
|
+
const ne = { Horizontal: "horizontal", Vertical: "vertical" }, Se = { scrollbar: "_scrollbar_gqxsx_24", track: "_track_gqxsx_35", thumb: "_thumb_gqxsx_47", "scrollbar-button": "_scrollbar-button_gqxsx_89", "touch-thumb": "_touch-thumb_gqxsx_124" }, fn = "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", mn = "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", fo = { transform: "rotate(180deg)" }, mo = (o) => {
|
|
1380
1380
|
const { style: e, orientation: t = ne.Vertical, disabled: n, ...r } = o, i = t === ne.Vertical ? fn : mn;
|
|
1381
|
-
return P("button", { style: e, className: G(
|
|
1381
|
+
return P("button", { style: e, className: G(Se["scrollbar-button"], t, "scroll-button"), disabled: n, ...r, children: P("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: P("path", { d: i }) }) });
|
|
1382
1382
|
}, _o = (o) => {
|
|
1383
1383
|
const { style: e, orientation: t = ne.Vertical, disabled: n, ...r } = o, i = t === ne.Vertical ? fn : mn;
|
|
1384
|
-
return P("button", { style: e, className: G(
|
|
1385
|
-
},
|
|
1384
|
+
return P("button", { style: e, className: G(Se["scrollbar-button"], t, "scroll-button"), disabled: n, ...r, children: P("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: fo, children: P("path", { d: i }) }) });
|
|
1385
|
+
}, ur = (o) => {
|
|
1386
1386
|
const { style: e, orientation: t = ne.Vertical, ...n } = o, r = t === ne.Vertical;
|
|
1387
1387
|
return P("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${r ? "vertical" : "horizontal"} edge`, ...n, children: P("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r ? "rotate(90) " : "", children: P("path", { style: { transition: "opacity 240ms ease 0s", opacity: o.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" }) }) });
|
|
1388
|
-
}, go =
|
|
1388
|
+
}, go = Ke().supportsTouchEvents, _n = _e(Me((o, e) => {
|
|
1389
1389
|
const { borderColor: t = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: n = "var(--sxl-app-color-background, white)", fillColor: r = "var(--sxl-app-color-grey, grey)", borderWidth: i = 3, size: a = 22, style: u, className: l, onPointerDown: s, onPointerMove: c, onPointerUp: h, orientation: d = ne.Vertical, offset: f = 0, currentTouchAnchor: m, elementParent: p, elementRoot: x, key: L, ...y } = o;
|
|
1390
1390
|
if (!go) return null;
|
|
1391
1391
|
const _ = k(s, [s]), v = k(c, [c]), B = k(h, [h]), S = d === ne.Vertical, [O, I] = q(!1), M = ln(R(() => ({ processTouch: !0, consumeTouch: !0, onPointerDown: (D, F) => {
|
|
@@ -1397,51 +1397,51 @@ const ne = { Horizontal: "horizontal", Vertical: "vertical" }, xe = { scrollbar:
|
|
|
1397
1397
|
} }), [])), b = R(() => {
|
|
1398
1398
|
const D = a / 2 + i / 2 + 6;
|
|
1399
1399
|
return { x: S ? -D : f + a, y: S ? f + a : -D, width: 0, height: 0 };
|
|
1400
|
-
}, [S, f, a]), [C, { y: E, x: $ }] = Vn(), T = K(null), { getPortalContainer: g, isFullscreen:
|
|
1400
|
+
}, [S, f, a]), [C, { y: E, x: $ }] = Vn(), T = K(null), { getPortalContainer: g, isFullscreen: z } = Fn(), [H, X] = q(null);
|
|
1401
1401
|
return W(() => {
|
|
1402
1402
|
const D = T.current?.getBoundingClientRect();
|
|
1403
1403
|
if (!D) return void X(null);
|
|
1404
1404
|
let F = 0, V = 0, Y = p;
|
|
1405
1405
|
for (; Y; ) F += Y.scrollLeft, V += Y.scrollTop, Y = x && Y === x.parentElement ? null : Y.parentElement;
|
|
1406
|
-
X(Ln(P("div", { className: G("touch-thumb",
|
|
1407
|
-
}, [E, O, t, n, r, $, b?.x, b?.y, b?.width, b?.height, l, m, n, a, i, t, p,
|
|
1406
|
+
X(Ln(P("div", { className: G("touch-thumb", Se["touch-thumb"], l, Se, { dragging: O }), ref: e, style: { left: F + (D?.x ?? 0) - (a + i) / 2, top: V + (D?.y ?? 0) - (a + i) / 2, width: S ? a : 1.8 * a, height: S ? 1.8 * a : a, borderWidth: `${i}px`, boxShadow: O ? `${n} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: t, backgroundColor: n, opacity: m ? 0 : void 0, transitionDuration: "160ms", backgroundImage: `url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${r}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`, backgroundRepeat: "no-repeat", backgroundPosition: "center center", ...u }, tabIndex: -1, onPointerDown: M, ...y }), x ?? g(), L));
|
|
1407
|
+
}, [E, O, t, n, r, $, b?.x, b?.y, b?.width, b?.height, l, m, n, a, i, t, p, z, L]), b ? fe(me, { children: [P("div", { ref: Ae([C, T]), style: { position: "absolute", left: b.x, top: b.y, opacity: 0 } }), H] }) : null;
|
|
1408
1408
|
}));
|
|
1409
1409
|
_n.displayName = "TouchThumbHandle";
|
|
1410
|
-
const yo = 24, vo =
|
|
1411
|
-
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u = ne.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: c, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: m = yo, maxThumbSize: p,
|
|
1410
|
+
const yo = 24, vo = _e(Me((o, e) => {
|
|
1411
|
+
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u = ne.Vertical, onScrollOffset: l, onScroll: s, showCustomScrollButtons: c, scrollButtonIncrement: h = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: f = 120, minThumbSize: m = yo, maxThumbSize: p, renderScrollButtonStart: x = mo, renderScrollButtonEnd: L = _o, propsTouchThumb: y, propsThumb: _, onMouseDown: v, ...B } = o, S = Ke().primaryInput === "touch", O = c ?? !S;
|
|
1412
1412
|
k(s, [s]);
|
|
1413
|
-
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C = u === ne.Vertical, [E, { width: $, height: T }] =
|
|
1413
|
+
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C = u === ne.Vertical, [E, { width: $, height: T }] = Ee(), g = C ? T : $, z = k((w, N, Z) => {
|
|
1414
1414
|
if (N === 0 || Z === 0) {
|
|
1415
1415
|
const Ge = { offset: 0, length: m, disabled: !0 };
|
|
1416
1416
|
return M(Ge), Ge;
|
|
1417
1417
|
}
|
|
1418
1418
|
if (N >= Z) return { offset: 0, length: g, disabled: !0 };
|
|
1419
|
-
const
|
|
1420
|
-
return { offset: Math.min(Math.max(0,
|
|
1419
|
+
const ve = Z / g, Pe = N / ve, be = Math.min(Math.max(m, Pe), Math.min(g, p ?? Number.MAX_SAFE_INTEGER)), ht = w / ve;
|
|
1420
|
+
return { offset: Math.min(Math.max(0, ht), g - be), length: be, disabled: !1 };
|
|
1421
1421
|
}, [g, m, p]), H = k((w) => {
|
|
1422
1422
|
const N = n / g, Z = Math.round(w * N);
|
|
1423
|
-
M(
|
|
1423
|
+
M(z(Z, r, n)), l?.(Z, r, n), b.current = w;
|
|
1424
1424
|
}, [l, r, n, g, I]), X = k((w) => {
|
|
1425
|
-
M(
|
|
1425
|
+
M(z(w, r, n)), l?.(w, r, n), b.current = w;
|
|
1426
1426
|
}, [l, r, n]);
|
|
1427
1427
|
W(() => {
|
|
1428
|
-
b.current !== t && g !== 0 && (b.current = -1, M(
|
|
1428
|
+
b.current !== t && g !== 0 && (b.current = -1, M(z(t, r, n)));
|
|
1429
1429
|
}, [t]), W(() => {
|
|
1430
|
-
g !== 0 && M(
|
|
1430
|
+
g !== 0 && M(z(t, r, n));
|
|
1431
1431
|
}, [r, n, C, g]);
|
|
1432
|
-
const D = Math.max(0, n - r), [F, V] = q(!1), Y = K(0), ee = K(0),
|
|
1432
|
+
const D = Math.max(0, n - r), [F, V] = q(!1), Y = K(0), ee = K(0), Le = Tt(e, () => ({ isScrollbar: () => !0 }), []), ge = k((w) => {
|
|
1433
1433
|
V(!0), Y.current = C ? w.clientY : w.clientX, ee.current = I.offset;
|
|
1434
|
-
}, [C, I]),
|
|
1435
|
-
w.currentTarget.setPointerCapture(w.pointerId),
|
|
1436
|
-
}, [v]),
|
|
1434
|
+
}, [C, I]), Ce = k((w) => {
|
|
1435
|
+
w.currentTarget.setPointerCapture(w.pointerId), ge(w), w.stopPropagation();
|
|
1436
|
+
}, [v]), ye = k((w) => {
|
|
1437
1437
|
if (!F) return;
|
|
1438
1438
|
const N = (C ? w.clientY : w.clientX) - Y.current, Z = ee.current + N;
|
|
1439
1439
|
H(Z);
|
|
1440
|
-
}, [F, C]),
|
|
1441
|
-
|
|
1440
|
+
}, [F, C]), at = k((w) => {
|
|
1441
|
+
ye(w);
|
|
1442
1442
|
}, []), Ne = k((w) => {
|
|
1443
1443
|
V(!1);
|
|
1444
|
-
}, []),
|
|
1444
|
+
}, []), ct = k((w) => {
|
|
1445
1445
|
try {
|
|
1446
1446
|
w.currentTarget.releasePointerCapture(w.pointerId);
|
|
1447
1447
|
} catch {
|
|
@@ -1454,11 +1454,11 @@ const yo = 24, vo = me(Ee((o, e) => {
|
|
|
1454
1454
|
}, [C, I, r, n]), He = k((w) => {
|
|
1455
1455
|
const N = Math.max(1, Math.floor(0.9 * r));
|
|
1456
1456
|
C ? (w.key === "ArrowDown" && H(Math.min(D, t + 1)), w.key === "ArrowUp" && H(Math.max(0, t - 1)), w.key === "PageDown" && H(Math.min(D, t + N)), w.key === "PageUp" && H(Math.max(0, t - N)), w.key === "Home" && H(0), w.key === "End" && H(D)) : (w.key === "ArrowRight" && H(Math.min(D, t + 1)), w.key === "ArrowLeft" && H(Math.max(0, t - 1)), w.key === "PageDown" && H(Math.min(D, t + N)), w.key === "PageUp" && H(Math.max(0, t - N)), w.key === "Home" && H(0), w.key === "End" && H(D));
|
|
1457
|
-
}, [C, r, n, t, D]), We = K(null),
|
|
1457
|
+
}, [C, r, n, t, D]), We = K(null), ut = R(() => {
|
|
1458
1458
|
const w = I.disabled;
|
|
1459
1459
|
if (w) return null;
|
|
1460
|
-
const N = P("div", { ..._, className: G(
|
|
1461
|
-
return !S || w ? N :
|
|
1460
|
+
const N = P("div", { ..._, className: G(Se.thumb, { disabled: w }), ref: We, role: "slider", "aria-label": C ? "Rows" : "Columns", "aria-orientation": C ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, style: { ..._?.style, position: "relative", [C ? "height" : "width"]: `${I.length}px`, [C ? "width" : "height"]: "100%", transform: C ? `translateY(${I.offset}px)` : `translateX(${I.offset}px)`, [C ? "minHeight" : "minWidth"]: `${m}px` }, onMouseDown: v, onPointerDown: Ce, onPointerMove: at, onPointerUp: ct });
|
|
1461
|
+
return !S || w ? N : fe(me, { children: [N, P(_n, { ...y, offset: I.offset, orientation: C ? ne.Vertical : ne.Horizontal, onPointerDown: ge, onPointerMove: ye, onPointerUp: Ne })] });
|
|
1462
1462
|
}, [I, m, D, t, C, S, v, y, _]), [Ve, Fe] = q(null), je = k(() => {
|
|
1463
1463
|
let w;
|
|
1464
1464
|
w = typeof h == "function" ? h(t, r, n) : t - h;
|
|
@@ -1469,45 +1469,45 @@ const yo = 24, vo = me(Ee((o, e) => {
|
|
|
1469
1469
|
w = typeof h == "function" ? h(t, r, n) : t + h;
|
|
1470
1470
|
const N = Math.min(D, w);
|
|
1471
1471
|
return X(N), Fe(N), N;
|
|
1472
|
-
}, [h, t, D, r, n]),
|
|
1473
|
-
|
|
1474
|
-
}, []),
|
|
1475
|
-
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1478
|
-
}, N ? 0 :
|
|
1472
|
+
}, [h, t, D, r, n]), Te = K(null), Be = K(null), se = U(() => {
|
|
1473
|
+
Te.current && (clearTimeout(Te.current), Te.current = null, Be.current = null);
|
|
1474
|
+
}, []), ke = U((w, N, Z, ve = d) => {
|
|
1475
|
+
Be.current = w, Te.current = setTimeout(() => {
|
|
1476
|
+
const Pe = Z ? je() : Ue();
|
|
1477
|
+
Pe !== Be.current ? ke(Pe, !1, Z, f) : se();
|
|
1478
|
+
}, N ? 0 : ve);
|
|
1479
1479
|
}, [je, Ue, se]);
|
|
1480
1480
|
W(() => () => se(), [se]);
|
|
1481
1481
|
const Xe = R(() => {
|
|
1482
1482
|
if (!O) return null;
|
|
1483
|
-
const w = { orientation: u, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () =>
|
|
1483
|
+
const w = { orientation: u, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !0) };
|
|
1484
1484
|
return x?.(w);
|
|
1485
1485
|
}, [O, u, t, Ve]), Ye = R(() => {
|
|
1486
1486
|
if (!O) return null;
|
|
1487
|
-
const w = { orientation: u, disabled: t >= D, onMouseUp: se, onMouseLeave: se, onMouseDown: () =>
|
|
1487
|
+
const w = { orientation: u, disabled: t >= D, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !1) };
|
|
1488
1488
|
return L?.(w);
|
|
1489
|
-
}, [O, u, t, D, Ve]),
|
|
1490
|
-
return
|
|
1489
|
+
}, [O, u, t, D, Ve]), Oe = C ? "vertical" : "horizontal";
|
|
1490
|
+
return fe("div", { ref: Ae([Le, e]), className: G(a, Se.scrollbar, Oe, { dragging: F, "has-touch-thumb": S }), style: i, ...B, children: [Xe, P("div", { ref: E, role: "scrollbar", "aria-orientation": Oe, "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, className: G(Se.track, "track", Oe), onMouseDown: v, onPointerDown: Re, onKeyDown: He, children: ut }), Ye] });
|
|
1491
1491
|
}));
|
|
1492
|
-
let
|
|
1493
|
-
const
|
|
1494
|
-
let e =
|
|
1495
|
-
return e && (
|
|
1496
|
-
},
|
|
1497
|
-
let i =
|
|
1492
|
+
let jt = Date.now, Ut = 1e3, pe = {}, bo = 1;
|
|
1493
|
+
const $e = (o) => {
|
|
1494
|
+
let e = pe[o] !== null;
|
|
1495
|
+
return e && (pe[o] = null), e;
|
|
1496
|
+
}, Xt = (o, e, t, n = 0, r) => {
|
|
1497
|
+
let i = jt(), a = i, u = 0, l = 0, s = 0, c = bo++;
|
|
1498
1498
|
if (c % 20 == 0) {
|
|
1499
1499
|
const d = {};
|
|
1500
|
-
for (let f in
|
|
1501
|
-
|
|
1500
|
+
for (let f in pe) d[f] = !0;
|
|
1501
|
+
pe = d;
|
|
1502
1502
|
}
|
|
1503
1503
|
const h = function(d) {
|
|
1504
|
-
let f = d !== !0, m =
|
|
1504
|
+
let f = d !== !0, m = jt(), p = !0;
|
|
1505
1505
|
try {
|
|
1506
1506
|
p = (!e || e(c)) ?? !0;
|
|
1507
1507
|
} catch {
|
|
1508
1508
|
p = !1;
|
|
1509
1509
|
}
|
|
1510
|
-
if (!
|
|
1510
|
+
if (!pe[c] || !p) return pe[c] = null, void t?.(60 - l / ((m - i) / Ut), c, !1);
|
|
1511
1511
|
if (f) {
|
|
1512
1512
|
s = Math.round((m - a) / 16.666666666666668) - 1;
|
|
1513
1513
|
for (let y = 0; y < Math.min(s, 4); y++) h(!0), l++;
|
|
@@ -1519,9 +1519,9 @@ const Ie = (o) => {
|
|
|
1519
1519
|
} catch {
|
|
1520
1520
|
L = !1;
|
|
1521
1521
|
}
|
|
1522
|
-
L !== !1 && u !== 1 || !f ? f && (a = m, requestAnimationFrame(h)) : (
|
|
1522
|
+
L !== !1 && u !== 1 || !f ? f && (a = m, requestAnimationFrame(h)) : (pe[c] = null, t?.(60 - l / ((m - i) / Ut), c, u === 1 || n == null));
|
|
1523
1523
|
};
|
|
1524
|
-
return
|
|
1524
|
+
return pe[c] = !0, requestAnimationFrame(h), c;
|
|
1525
1525
|
}, wo = function(o) {
|
|
1526
1526
|
return Math.pow(o - 1, 3) + 1;
|
|
1527
1527
|
}, xo = function(o) {
|
|
@@ -1552,7 +1552,7 @@ class So {
|
|
|
1552
1552
|
}
|
|
1553
1553
|
zoomTo(e, t = !1, n, r, i) {
|
|
1554
1554
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1555
|
-
i && (this.__zoomComplete = i), this.__isDecelerating && (
|
|
1555
|
+
i && (this.__zoomComplete = i), this.__isDecelerating && ($e(this.__isDecelerating), this.__isDecelerating = 0);
|
|
1556
1556
|
const a = this.__zoomLevel;
|
|
1557
1557
|
n === void 0 && (n = this.__clientWidth / 2), r === void 0 && (r = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
|
|
1558
1558
|
const u = e / a;
|
|
@@ -1563,7 +1563,7 @@ class So {
|
|
|
1563
1563
|
this.zoomTo(this.__zoomLevel * e, t, n, r, i);
|
|
1564
1564
|
}
|
|
1565
1565
|
scrollTo(e, t, n = !1, r = 1) {
|
|
1566
|
-
if (this.__isDecelerating && (
|
|
1566
|
+
if (this.__isDecelerating && ($e(this.__isDecelerating), this.__isDecelerating = 0), r !== void 0 && r !== this.__zoomLevel) {
|
|
1567
1567
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1568
1568
|
e *= r, t *= r, this.__computeScrollMax(r);
|
|
1569
1569
|
} else r = this.__zoomLevel;
|
|
@@ -1581,7 +1581,7 @@ class So {
|
|
|
1581
1581
|
if (e.length === void 0) throw new Error("Invalid touch list: " + e);
|
|
1582
1582
|
if (t instanceof Date && (t = t.valueOf()), typeof t != "number") throw new Error("Invalid timestamp value: " + t);
|
|
1583
1583
|
let n, r;
|
|
1584
|
-
this.__interruptedAnimation = !0, this.__isDecelerating && (
|
|
1584
|
+
this.__interruptedAnimation = !0, this.__isDecelerating && ($e(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = !0), this.__isAnimating && ($e(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = !0);
|
|
1585
1585
|
let i = e.length === 1;
|
|
1586
1586
|
i ? (n = e[0].pageX, r = e[0].pageY) : (n = Math.abs(e[0].pageX + e[1].pageX) / 2, r = Math.abs(e[0].pageY + e[1].pageY) / 2), this.__initialTouchLeft = n, this.__initialTouchTop = r, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n, this.__lastTouchTop = r, this.__lastTouchMove = t, this.__lastScale = 1, this.__enableScrollX = !i && this.options.scrollingX, this.__enableScrollY = !i && this.options.scrollingY, this.__isTracking = !0, this.__didDecelerationComplete = !1, this.__isDragging = !i, this.__isSingleTouch = i, this.__positions = [];
|
|
1587
1587
|
}
|
|
@@ -1636,7 +1636,7 @@ class So {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
__publish(e, t, n, r = !1) {
|
|
1638
1638
|
const i = this.__isAnimating;
|
|
1639
|
-
if (i && (
|
|
1639
|
+
if (i && ($e(i), this.__isAnimating = 0), r && this.options.animating) {
|
|
1640
1640
|
this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
|
|
1641
1641
|
const a = this.__scrollLeft, u = this.__scrollTop, l = this.__zoomLevel, s = e - a, c = t - u, h = n - l, d = function(p, x, L) {
|
|
1642
1642
|
L && (this.__scrollLeft = a + s * p, this.__scrollTop = u + c * p, this.__zoomLevel = l + h * p, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
@@ -1645,7 +1645,7 @@ class So {
|
|
|
1645
1645
|
}.bind(this), m = function(p, x, L) {
|
|
1646
1646
|
x === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || L) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1647
1647
|
}.bind(this);
|
|
1648
|
-
this.__isAnimating =
|
|
1648
|
+
this.__isAnimating = Xt(d, f, m, this.options.animationDuration, i ? wo : xo);
|
|
1649
1649
|
} else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1650
1650
|
}
|
|
1651
1651
|
__computeScrollMax(e = this.__zoomLevel) {
|
|
@@ -1664,7 +1664,7 @@ class So {
|
|
|
1664
1664
|
}.bind(this), i = function(a, u, l) {
|
|
1665
1665
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1666
1666
|
}.bind(this);
|
|
1667
|
-
this.__isDecelerating =
|
|
1667
|
+
this.__isDecelerating = Xt(t, r, i);
|
|
1668
1668
|
}
|
|
1669
1669
|
__stepThroughDeceleration(e) {
|
|
1670
1670
|
let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
@@ -1680,7 +1680,7 @@ class So {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
}
|
|
1682
1682
|
}
|
|
1683
|
-
const
|
|
1683
|
+
const st = (o) => P(vo, { ...o }), hr = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: st, getScrollTo: (o, e, t, n, r = 0) => {
|
|
1684
1684
|
for (let i = 0; i < t.length; i++) {
|
|
1685
1685
|
const a = t[i].getBoundingClientRect();
|
|
1686
1686
|
let u = a.left - e, l = u + a.width;
|
|
@@ -1689,53 +1689,56 @@ const Ke = (o, e) => P(vo, { ...o, ref: e }), gr = Object.freeze(Object.definePr
|
|
|
1689
1689
|
} else if (Math.ceil(l) > Math.ceil(o) + 2) return l;
|
|
1690
1690
|
}
|
|
1691
1691
|
return r;
|
|
1692
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1693
|
-
const
|
|
1692
|
+
} }, Symbol.toStringTag, { value: "Module" })), de = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Eo = (o) => {
|
|
1693
|
+
const e = o?.width, t = o?.height;
|
|
1694
|
+
return P("div", { className: "corner", style: { minWidth: `${e}px`, width: `${e}px`, minHeight: `${t}px`, height: `${t}px` } });
|
|
1695
|
+
}, Mo = _e(Me((o, e) => {
|
|
1696
|
+
const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: a = !0, createScrollCorner: u = Eo, renderScrollbarHorizontal: l = st, renderScrollbarVertical: s = st, style: c, className: h, touchElement: d, disableTouch: f, ...m } = o, p = i && l, x = a && s, L = k(r, [r]), y = Tt(e, () => ({ isScrollPane: () => !0 }), []), _ = K(null);
|
|
1694
1697
|
W(() => {
|
|
1695
1698
|
_.current && (_.current.__scrollTop === n?.top && _.current.__scrollLeft === n?.left || _.current.__isDecelerating || _.current?.scrollTo(n?.left, n?.top, !1));
|
|
1696
1699
|
}, [n?.left, n?.top, d]);
|
|
1697
|
-
const v = U((g,
|
|
1698
|
-
L?.({ left: g, top:
|
|
1700
|
+
const v = U((g, z) => {
|
|
1701
|
+
L?.({ left: g, top: z });
|
|
1699
1702
|
}, []), B = U((g) => {
|
|
1700
1703
|
_.current?.doTouchStart(g.touches, g.timeStamp);
|
|
1701
1704
|
}, []), S = U((g) => {
|
|
1702
1705
|
g.preventDefault(), _.current?.doTouchMove(g.touches, g.timeStamp);
|
|
1703
1706
|
}, []), O = U((g) => {
|
|
1704
1707
|
_.current?.doTouchEnd(g.timeStamp);
|
|
1705
|
-
}, []), I = U(({ containerWidth: g, containerHeight:
|
|
1706
|
-
_.current.setDimensions(g,
|
|
1708
|
+
}, []), I = U(({ containerWidth: g, containerHeight: z, totalWidth: H, totalHeight: X }) => {
|
|
1709
|
+
_.current.setDimensions(g, z, H, X);
|
|
1707
1710
|
}, []);
|
|
1708
1711
|
W(() => {
|
|
1709
1712
|
const g = d ?? y.current;
|
|
1710
|
-
if (!f &&
|
|
1713
|
+
if (!f && Ke().supportsTouchEvents && g && n) {
|
|
1711
1714
|
if (!_.current) {
|
|
1712
|
-
const
|
|
1713
|
-
_.current = new So(v,
|
|
1715
|
+
const z = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1716
|
+
_.current = new So(v, z);
|
|
1714
1717
|
}
|
|
1715
|
-
|
|
1718
|
+
Ke().supportsTouchEvents && (g.addEventListener("touchstart", B), g.addEventListener("touchend", O), g.addEventListener("touchmove", S)), I({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
1716
1719
|
}
|
|
1717
1720
|
return () => {
|
|
1718
1721
|
g?.removeEventListener("touchstart", B), g?.removeEventListener("touchend", O), g?.removeEventListener("touchmove", S);
|
|
1719
1722
|
};
|
|
1720
1723
|
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, f, d]);
|
|
1721
|
-
const [M, { width: b }] =
|
|
1724
|
+
const [M, { width: b }] = Ee(), [C, { height: E }] = Ee(), $ = R(() => {
|
|
1722
1725
|
if (!x) return null;
|
|
1723
|
-
const g = s({ orientation: ne.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (
|
|
1724
|
-
L?.({ top:
|
|
1726
|
+
const g = s({ orientation: ne.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (z) => {
|
|
1727
|
+
L?.({ top: z });
|
|
1725
1728
|
} });
|
|
1726
|
-
return P("div", { className: G("vertical-container",
|
|
1729
|
+
return P("div", { className: G("vertical-container", de["vertical-container"]), ref: M, children: g });
|
|
1727
1730
|
}, [s, n?.top, n?.height, n?.totalHeight]), T = R(() => {
|
|
1728
1731
|
if (!p) return null;
|
|
1729
|
-
const g = l({ orientation: ne.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (
|
|
1730
|
-
L?.({ left:
|
|
1732
|
+
const g = l({ orientation: ne.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (z) => {
|
|
1733
|
+
L?.({ left: z });
|
|
1731
1734
|
} });
|
|
1732
|
-
return
|
|
1735
|
+
return fe("div", { className: G("horizontal-corner-container", de["horizontal-corner-container"]), children: [P("div", { className: G("horizontal-sizer", de["horizontal-sizer"]), style: { width: `calc(100% - ${b}px)` }, children: P("div", { ref: C, className: G("scrollbar-sizer", de["scrollbar-sizer"]), children: g }) }), x ? u({ width: b, height: E }) : P(me, {})] });
|
|
1733
1736
|
}, [l, n?.left, n?.width, n?.totalWidth, x, u, b, E]);
|
|
1734
|
-
return P("div", { className: G(h, "scrollpane",
|
|
1737
|
+
return P("div", { className: G(h, "scrollpane", de.scrollpane), style: { minWidth: x ? `${b}px` : void 0, minHeight: p ? `${E}px` : void 0, ...c }, ...m, ref: y, children: fe("div", { className: G("scrollpane-content", de["scrollpane-content"]), children: [fe("div", { className: G("scrollpane-content-element", de["scrollpane-content-element"]), children: [P("div", { className: G("scrollpane-content-element", de["scrollpane-content-element"]), children: t }), x ? $ : P(me, {})] }), p ? T : P(me, {})] }) });
|
|
1735
1738
|
}));
|
|
1736
|
-
|
|
1737
|
-
const
|
|
1738
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a =
|
|
1739
|
+
Mo.displayName = "ScrollPane";
|
|
1740
|
+
const Lo = 300, Co = 100, To = 1e6, ko = 100, Po = 50, Do = _e(Me((o, e) => {
|
|
1741
|
+
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a = Lo, endScrollIncrement: u = Co, style: l = tn, onMouseDown: s, onScrollOffset: c, onScroll: h, scaleLimit: d = To, scaleFactor: f = ko, precisionFactor: m = Po, renderScrollbar: p = st, ...x } = o;
|
|
1739
1742
|
h && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1740
1743
|
const L = k(s, [s]), [y, _] = q(!1), v = R(() => {
|
|
1741
1744
|
const M = d === 0 ? r : Math.min(r ?? 0, Math.max(i ?? 0, (t ?? 0) + (n ?? 0)) + (a ?? 0)), b = d !== 0 && M > d ? f : 1, C = b / m, E = Math.ceil(M / b);
|
|
@@ -1749,64 +1752,64 @@ const Ao = 300, zo = 100, Bo = 1e6, Oo = 100, Io = 50, $o = me(Ee((o, e) => {
|
|
|
1749
1752
|
}, []), I = U((M) => {
|
|
1750
1753
|
_(!0), L?.(M), document.addEventListener("mousemove", S, { passive: !0 }), document.addEventListener("mouseup", O, { passive: !0 });
|
|
1751
1754
|
}, [S, O]);
|
|
1752
|
-
return
|
|
1755
|
+
return p({ style: l, ...x, offset: v.offset, totalSize: v.totalSize, viewportSize: v.viewportSize, onMouseDown: I, onScrollOffset: B, ref: e });
|
|
1753
1756
|
}));
|
|
1754
|
-
|
|
1757
|
+
Do.displayName = "VirtualScrollbar";
|
|
1755
1758
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1759
|
+
bt as Command,
|
|
1760
|
+
Vo as CommandButtonType,
|
|
1758
1761
|
on as CommandGroup,
|
|
1759
1762
|
ot as DefaultDynamicIconService,
|
|
1760
1763
|
Nn as DefaultReactNotifier,
|
|
1761
1764
|
co as DynamicIcon,
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1765
|
+
ir as ErrorTestPanel,
|
|
1766
|
+
jo as FocusKeyNavigation,
|
|
1767
|
+
$o as HorizontalAlignment,
|
|
1768
|
+
Mt as InMemoryStore,
|
|
1769
|
+
Ko as KeyCodes,
|
|
1767
1770
|
Q as KeyModifiers,
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1771
|
+
cr as LocalStorageStore,
|
|
1772
|
+
No as MouseButtonCodes,
|
|
1773
|
+
Xo as NotifierProvider,
|
|
1774
|
+
Ot as NotifierType,
|
|
1775
|
+
ar as PersistenceStateProvider,
|
|
1776
|
+
or as ReactErrorBoundary,
|
|
1777
|
+
Ro as ReactUtils,
|
|
1778
|
+
Uo as RoundedTab,
|
|
1779
|
+
Mo as ScrollPane,
|
|
1780
|
+
hr as ScrollUtils,
|
|
1778
1781
|
vo as Scrollbar,
|
|
1779
1782
|
ne as ScrollbarOrientation,
|
|
1780
|
-
|
|
1783
|
+
mt as SimpleCommand,
|
|
1781
1784
|
io as SplitPane,
|
|
1782
1785
|
ro as SplitPaneResizer,
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1786
|
+
Fo as ToolTipPlacement,
|
|
1787
|
+
rr as UncaughtErrorBoundary,
|
|
1788
|
+
Do as VirtualScrollbar,
|
|
1789
|
+
sr as WalkingIcon,
|
|
1787
1790
|
lo as createDynamicIconService,
|
|
1788
|
-
|
|
1789
|
-
|
|
1791
|
+
Eo as defaultCreateScrollCorner,
|
|
1792
|
+
ur as defaultCreateScrollEdgeButton,
|
|
1790
1793
|
_o as defaultCreateScrollEndButton,
|
|
1791
1794
|
mo as defaultCreateScrollStartButton,
|
|
1792
|
-
|
|
1793
|
-
|
|
1795
|
+
Go as getDevicePixelRatio,
|
|
1796
|
+
Ie as toShortcutString,
|
|
1794
1797
|
Vn as useAnimatedMeasure,
|
|
1795
1798
|
k as useCallbackRef,
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1799
|
+
Ho as useCommand,
|
|
1800
|
+
Wo as useCommands,
|
|
1801
|
+
Qo as useCopyPaste,
|
|
1802
|
+
Yo as useDevicePixelRatio,
|
|
1803
|
+
Jo as useEditMode,
|
|
1801
1804
|
Fn as useFullscreenPortal,
|
|
1802
1805
|
qn as useGlobalClipboard,
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1806
|
+
tr as useId,
|
|
1807
|
+
Tt as useImperativeElement,
|
|
1808
|
+
Zo as useMouseDownAndHoldListener,
|
|
1809
|
+
lt as useNotifier,
|
|
1810
|
+
qo as useOnClickOrFocusAway,
|
|
1811
|
+
lr as usePersistenceState,
|
|
1809
1812
|
ln as useSynchronizedPointerHandler,
|
|
1810
|
-
|
|
1811
|
-
|
|
1813
|
+
er as useTraceUpdate,
|
|
1814
|
+
nr as useUndoManager
|
|
1812
1815
|
};
|