@sheetxl/utils-react 0.7.17 → 0.7.18
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/{BfVchbirCkmA3HCq.cjs → CS0WCQs7Ln5sMjk8.cjs} +1 -1
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/{DQXf4a-Nh3ZMvJdj.mjs → Du8tayDoOWvYYmxJ.mjs} +1 -1
- package/browser/esm/index.mjs +639 -633
- package/node/assets/style.css +1 -1
- package/node/esm/{Cy9MGJ5ivkJxyauG.mjs → C_7-Y_1zhHsxTW9L.mjs} +1 -1
- package/node/esm/index.mjs +420 -414
- package/package.json +2 -2
package/browser/esm/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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}.
|
|
2
|
-
import { CommonUtils as
|
|
3
|
-
import ae, { useRef as
|
|
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 we, InternalClipboard as rt, ClipboardUtils as dt, MimeType as pt } 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 me, forwardRef as Ee, useCallback as U, useLayoutEffect as Mt, createContext as Gt, useContext as qt, createElement as wn, useImperativeHandle as xn, Component as Sn } from "react";
|
|
4
4
|
import { jsx as P, jsxs as pe, Fragment as fe } from "react/jsx-runtime";
|
|
5
|
-
import { createRoot as
|
|
6
|
-
import { unstable_batchedUpdates as
|
|
5
|
+
import { createRoot as En } from "react-dom/client";
|
|
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.18
|
|
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 Vo = { 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" }, Fo = { 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 }, jo = { Left: 1, Middle: 2, Right: 3 };
|
|
14
|
+
class vt {
|
|
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,21 +122,21 @@ class yt {
|
|
|
122
122
|
}), t;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
class
|
|
125
|
+
class ft extends vt {
|
|
126
126
|
}
|
|
127
|
-
var
|
|
127
|
+
var re = typeof window < "u" ? window : { screen: {}, navigator: {} }, De = (re.matchMedia || function() {
|
|
128
128
|
return { matches: !1 };
|
|
129
|
-
}).bind(
|
|
130
|
-
return
|
|
131
|
-
} },
|
|
129
|
+
}).bind(re), Zt = !1, Cn = { get passive() {
|
|
130
|
+
return Zt = !0;
|
|
131
|
+
} }, Dt = function() {
|
|
132
132
|
};
|
|
133
|
-
|
|
134
|
-
var
|
|
135
|
-
const
|
|
133
|
+
re.addEventListener && re.addEventListener("p", Dt, Cn), re.removeEventListener && re.removeEventListener("p", Dt, !1);
|
|
134
|
+
var Tn = Zt, kn = "PointerEvent" in re, Lt = "ontouchstart" in re, Jt = Lt || "TouchEvent" in re && De("(any-pointer: coarse)").matches, At = (re.navigator.maxTouchPoints || 0) > 0 || Jt, Qt = re.navigator.userAgent || "", Pn = De("(pointer: coarse)").matches && /iPad|Macintosh/.test(Qt) && Math.min(re.screen.width || 0, re.screen.height || 0) >= 768, en = (De("(pointer: coarse)").matches || !De("(pointer: fine)").matches && Lt) && !/Windows.*Firefox/.test(Qt), Dn = De("(any-pointer: fine)").matches || De("(any-hover: hover)").matches || Pn || !Lt, bt = !At || !Dn && en ? At ? "touchOnly" : "mouseOnly" : "hybrid", An = bt === "mouseOnly" ? "mouse" : bt === "touchOnly" || en ? "touch" : "mouse";
|
|
135
|
+
const zn = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: bt, primaryInput: An, supportsPassiveEvents: Tn, supportsPointerEvents: kn, supportsTouchEvents: Jt }, Symbol.toStringTag, { value: "Module" })), Bn = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), tn = {};
|
|
136
136
|
function $e() {
|
|
137
|
-
return
|
|
137
|
+
return zn;
|
|
138
138
|
}
|
|
139
|
-
const
|
|
139
|
+
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o), tt = (o, e) => {
|
|
140
140
|
let t = !1, n = !1;
|
|
141
141
|
const r = { nativeEvent: o, currentTarget: e || o.currentTarget, target: o.target, bubbles: o.bubbles, cancelable: o.cancelable, defaultPrevented: o.defaultPrevented, eventPhase: o.eventPhase, isTrusted: o.isTrusted, preventDefault: () => {
|
|
142
142
|
t = !0, o.preventDefault();
|
|
@@ -146,12 +146,12 @@ const en = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : ee.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
|
+
}, Uo = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: tn, boundPixel: function(o, e = !1, t = 0) {
|
|
150
150
|
return o;
|
|
151
|
-
}, createSyntheticEvent:
|
|
152
|
-
class
|
|
151
|
+
}, createSyntheticEvent: tt, detectIt: $e, focusableNodeNames: Bn, toPrettyKeyCode: nn }, Symbol.toStringTag, { value: "Module" }));
|
|
152
|
+
class on {
|
|
153
153
|
constructor(e, t) {
|
|
154
|
-
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid =
|
|
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();
|
|
155
155
|
const n = this;
|
|
156
156
|
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (r, i) => {
|
|
157
157
|
const a = n._root._listenersByKey, u = i.key(), l = a.get(u);
|
|
@@ -176,7 +176,7 @@ class tn {
|
|
|
176
176
|
l && (r = l), u = u._parent;
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
|
-
r || (r = new
|
|
179
|
+
r || (r = new on(e, t), r._parent = this, r._root = this._root, r._unListenersByCommand = null, r._listenersByKey = null, r._commandsPropertyListener = null);
|
|
180
180
|
const i = (u, l) => {
|
|
181
181
|
!u.has(t) || n ? u.set(t, l) : n === void 0 && console.warn("commandGroup already registered", t);
|
|
182
182
|
};
|
|
@@ -242,7 +242,7 @@ class tn {
|
|
|
242
242
|
}
|
|
243
243
|
findCommandByEvent(e) {
|
|
244
244
|
const t = [];
|
|
245
|
-
e.altKey && t.push(
|
|
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
246
|
let n = Oe({ key: e.code, modifiers: t });
|
|
247
247
|
const r = this._commandsByShortcut;
|
|
248
248
|
let i = r.get(n);
|
|
@@ -303,17 +303,17 @@ class tn {
|
|
|
303
303
|
}), e;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
const
|
|
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 ? "⌘" : "^", Oe = (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
|
-
return (t?.[
|
|
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
|
|
313
|
-
const t =
|
|
312
|
+
function Xo(o, e = null) {
|
|
313
|
+
const t = K(e);
|
|
314
314
|
t.current = e;
|
|
315
|
-
const [n, r] =
|
|
316
|
-
return
|
|
315
|
+
const [n, r] = Yt((a) => a + 1, 0), i = R(() => Array.isArray(o) ? o : [o], [o]);
|
|
316
|
+
return W(() => {
|
|
317
317
|
if (!i || i.length === 0) return;
|
|
318
318
|
const a = (s, c) => {
|
|
319
319
|
t.current?.onChange?.(c), r();
|
|
@@ -325,7 +325,7 @@ function No(o, e = null) {
|
|
|
325
325
|
t.current?.onError?.(s, c, h);
|
|
326
326
|
} });
|
|
327
327
|
const l = /* @__PURE__ */ new Set();
|
|
328
|
-
for (let s = 0; s < i.length; s++) l.add(i[s]?.addPropertyListener(
|
|
328
|
+
for (let s = 0; s < i.length; s++) l.add(i[s]?.addPropertyListener(te.debounce(a, 0), !0)), e && l.add(i[s]?.addExecuteListener(u));
|
|
329
329
|
return () => {
|
|
330
330
|
l.forEach((s) => {
|
|
331
331
|
s?.();
|
|
@@ -333,8 +333,8 @@ function No(o, e = null) {
|
|
|
333
333
|
};
|
|
334
334
|
}, [o]), n;
|
|
335
335
|
}
|
|
336
|
-
const
|
|
337
|
-
if (!e || !o || e.length === 0) return
|
|
336
|
+
const Ze = (o, e) => {
|
|
337
|
+
if (!e || !o || e.length === 0) return te.EmptyArray;
|
|
338
338
|
const t = e.length, n = new Array(t);
|
|
339
339
|
for (let r = 0; r < t; r++) {
|
|
340
340
|
const i = e[r], a = i ? o.getCommand(i) : null;
|
|
@@ -342,36 +342,36 @@ const qe = (o, e) => {
|
|
|
342
342
|
}
|
|
343
343
|
return n;
|
|
344
344
|
};
|
|
345
|
-
function
|
|
346
|
-
const r =
|
|
345
|
+
function Yo(o, e = null, t = null, n) {
|
|
346
|
+
const r = K(t);
|
|
347
347
|
r.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
348
|
-
const [i, a] =
|
|
349
|
-
return
|
|
348
|
+
const [i, a] = q(Ze(o, e)), u = n ? [...n, o] : [o];
|
|
349
|
+
return W(() => {
|
|
350
350
|
const l = { onGroupChange: () => {
|
|
351
|
-
const d =
|
|
351
|
+
const d = Ze(o, e);
|
|
352
352
|
a(d), r.current?.onChange?.(this);
|
|
353
353
|
} };
|
|
354
354
|
let s;
|
|
355
355
|
e && e.length > 0 && (s = { keys: e }, l.onCommandChange = (d, f) => {
|
|
356
|
-
r.current?.onChange?.(o), a(
|
|
356
|
+
r.current?.onChange?.(o), a(Ze(o, e));
|
|
357
357
|
});
|
|
358
|
-
const c = o?.addListener(l, s), h =
|
|
358
|
+
const c = o?.addListener(l, s), h = Ze(o, e);
|
|
359
359
|
return a(h), r.current?.onChange && r.current?.onChange(o), () => {
|
|
360
360
|
c?.();
|
|
361
361
|
};
|
|
362
362
|
}, u), i;
|
|
363
363
|
}
|
|
364
|
-
const
|
|
365
|
-
function
|
|
364
|
+
const Go = { Toolbar: "toolbar", Menuitem: "menuitem" }, qo = { 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 mt(o, e) {
|
|
366
366
|
if (typeof o == "function") return o(e);
|
|
367
367
|
o && (o.current = e);
|
|
368
368
|
}
|
|
369
|
-
var Ae = parseInt(
|
|
369
|
+
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 = mt(n, e), i = typeof r == "function";
|
|
374
|
+
t.push(i ? r : () => mt(n, null));
|
|
375
375
|
}
|
|
376
376
|
return () => {
|
|
377
377
|
for (const n of t) n();
|
|
@@ -379,11 +379,11 @@ var Ae = parseInt(vn.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) mt(t, e);
|
|
383
383
|
};
|
|
384
384
|
};
|
|
385
|
-
const
|
|
386
|
-
const { refFocusStart: t, ...n } = o, r =
|
|
385
|
+
const Zo = me(Ee((o, e) => {
|
|
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;
|
|
389
389
|
let u = [];
|
|
@@ -398,10 +398,10 @@ const Fo = me(Ee((o, e) => {
|
|
|
398
398
|
}, [t]);
|
|
399
399
|
return P("div", { tabIndex: 0, ref: Ae([r, e]), onFocus: i, ...n });
|
|
400
400
|
}));
|
|
401
|
-
var
|
|
402
|
-
},
|
|
403
|
-
const Se =
|
|
404
|
-
var o =
|
|
401
|
+
var $n = function() {
|
|
402
|
+
}, rn = typeof window < "u", Kn = rn ? Mt : W, zt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
403
|
+
const Se = rn && window.ResizeObserver !== void 0 ? function() {
|
|
404
|
+
var o = q(null), e = o[0], t = o[1], n = q(zt), 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;
|
|
@@ -409,66 +409,66 @@ const Se = nn && window.ResizeObserver !== void 0 ? function() {
|
|
|
409
409
|
}
|
|
410
410
|
});
|
|
411
411
|
}, []);
|
|
412
|
-
return
|
|
412
|
+
return Kn(function() {
|
|
413
413
|
if (e) return a.observe(e), function() {
|
|
414
414
|
a.disconnect();
|
|
415
415
|
};
|
|
416
416
|
}, [e]), [t, r];
|
|
417
417
|
} : function() {
|
|
418
|
-
return [
|
|
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 }] = Se(), d =
|
|
421
|
-
const
|
|
422
|
-
return (function(
|
|
423
|
-
if (
|
|
424
|
-
function
|
|
425
|
-
let
|
|
426
|
-
return
|
|
418
|
+
return [$n, zt];
|
|
419
|
+
}, Jo = me(Ee((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 }] = Se(), d = K(null), f = (L, y = 0) => {
|
|
421
|
+
const _ = L / 2, v = h - _ + y;
|
|
422
|
+
return (function(B, S, O = !1) {
|
|
423
|
+
if (S === 0) return B;
|
|
424
|
+
function I(T, g, A) {
|
|
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, A / D));
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
return { x:
|
|
428
|
+
function M(T, g, A) {
|
|
429
|
+
return { x: T.x + (g.x - T.x) * A, y: T.y + (g.y - T.y) * A };
|
|
430
430
|
}
|
|
431
|
-
function b(
|
|
432
|
-
|
|
431
|
+
function b(T, g) {
|
|
432
|
+
T.length > 2 && (T[T.length - 2] = g.x, T[T.length - 1] = g.y);
|
|
433
433
|
}
|
|
434
|
-
function C(
|
|
435
|
-
return { x: parseFloat(
|
|
434
|
+
function C(T) {
|
|
435
|
+
return { x: parseFloat(T[T.length - 2]), y: parseFloat(T[T.length - 1]) };
|
|
436
436
|
}
|
|
437
|
-
let
|
|
438
|
-
let
|
|
439
|
-
return
|
|
440
|
-
}, []).reduce(function(
|
|
441
|
-
return parseFloat(
|
|
442
|
-
}, []),
|
|
443
|
-
if (
|
|
444
|
-
let
|
|
445
|
-
|
|
446
|
-
for (let
|
|
447
|
-
let
|
|
448
|
-
if (D &&
|
|
449
|
-
let F,
|
|
450
|
-
|
|
451
|
-
let _e =
|
|
452
|
-
ge.origPoint =
|
|
453
|
-
} else
|
|
437
|
+
let E = B.split(/[,\s]/).reduce(function(T, g) {
|
|
438
|
+
let A = g.match("([a-zA-Z])(.+)");
|
|
439
|
+
return A ? (T.push(A[1]), T.push(A[2])) : T.push(g), T;
|
|
440
|
+
}, []).reduce(function(T, g) {
|
|
441
|
+
return parseFloat(g) == g && T.length ? T[T.length - 1].push(g) : T.push([g]), T;
|
|
442
|
+
}, []), $ = [];
|
|
443
|
+
if (E.length > 1) {
|
|
444
|
+
let T = C(E[0]), g = null;
|
|
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 A = 1; A < E.length; A++) {
|
|
447
|
+
let H = $[$.length - 1], X = E[A], D = X === g ? E[1] : E[A + 1];
|
|
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), Me = C(D);
|
|
450
|
+
O ? (F = M(ee, H.origPoint || Y, S), V = M(ee, D.origPoint || Me, S)) : (F = I(ee, Y, S), V = I(ee, Me, S)), b(X, F), X.origPoint = ee, $.push(X);
|
|
451
|
+
let _e = M(F, ee, 0.5), Le = M(ee, V, 0.5), ge = ["C", _e.x, _e.y, Le.x, Le.y, V.x, V.y];
|
|
452
|
+
ge.origPoint = ee, $.push(ge);
|
|
453
|
+
} else $.push(X);
|
|
454
454
|
}
|
|
455
|
-
if (
|
|
456
|
-
let
|
|
457
|
-
|
|
455
|
+
if (g) {
|
|
456
|
+
let A = C($[$.length - 1]);
|
|
457
|
+
$.push(["Z"]), b($[0], A);
|
|
458
458
|
}
|
|
459
|
-
} else
|
|
460
|
-
return
|
|
461
|
-
return
|
|
459
|
+
} else $ = E;
|
|
460
|
+
return $.reduce(function(T, g) {
|
|
461
|
+
return T + g.join(" ") + " ";
|
|
462
462
|
}, "");
|
|
463
|
-
})(`${`M 0 ${
|
|
464
|
-
}, m =
|
|
463
|
+
})(`${`M 0 ${_} L ${i - 0.5} ${_} L ${i - 0.5} ${v} L ${2 * i} ${v}`} ${`L ${c - 2 * i} ${v}`} ${`M ${c - 2 * i} ${v} L ${c - i} ${v} L ${c - i} ${_} L ${c} ${_}`}`, i);
|
|
464
|
+
}, m = R(() => f(a), [c, h, i, a]), p = R(() => {
|
|
465
465
|
if (i === 0) return;
|
|
466
|
-
const
|
|
467
|
-
return f(i) + `L ${c} 0 L 0 0 L 0 ${
|
|
468
|
-
}, [m, i, a]), x =
|
|
466
|
+
const L = i / 2;
|
|
467
|
+
return f(i) + `L ${c} 0 L 0 0 L 0 ${L}`;
|
|
468
|
+
}, [m, i, a]), x = R(() => ({ style: { clipPath: `path('${p}')` } }), [p]);
|
|
469
469
|
return pe("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...l, ref: Ae([d, s, e]), children: [ae.isValidElement(r) ? ae.cloneElement(r, x) : P(fe, {}), 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
|
-
})),
|
|
471
|
-
class
|
|
470
|
+
})), Bt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
471
|
+
class Nn extends vn {
|
|
472
472
|
setOverrides(e) {
|
|
473
473
|
super.setOverrides(e);
|
|
474
474
|
}
|
|
@@ -478,7 +478,7 @@ class Kn extends yn {
|
|
|
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 !== Bt.Warning ? t?.type !== Bt.Error ? we.log(e) : we.error(e) : we.warn(e);
|
|
482
482
|
}
|
|
483
483
|
showBusy(e, t) {
|
|
484
484
|
const n = this.getDelegate();
|
|
@@ -493,7 +493,7 @@ class Kn extends yn {
|
|
|
493
493
|
}
|
|
494
494
|
showError(e) {
|
|
495
495
|
const t = this.getDelegate();
|
|
496
|
-
t?.showError ? t.showError(e) :
|
|
496
|
+
t?.showError ? t.showError(e) : we.error(e);
|
|
497
497
|
}
|
|
498
498
|
showOptions(e) {
|
|
499
499
|
const t = this.getDelegate();
|
|
@@ -504,52 +504,52 @@ class Kn extends yn {
|
|
|
504
504
|
return t?.showInput ? t.showInput(e) : Promise.resolve({ input: "", option: "" });
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
const
|
|
508
|
-
const t =
|
|
509
|
-
return
|
|
510
|
-
|
|
507
|
+
const sn = Gt(new Nn()), Qo = ({ children: o, notifier: e }) => (ae.useEffect(() => {
|
|
508
|
+
const t = we.getOverrides();
|
|
509
|
+
return we.setOverrides(e), () => {
|
|
510
|
+
we.setOverrides(t);
|
|
511
511
|
};
|
|
512
|
-
}, [e]), ae.createElement(
|
|
513
|
-
function
|
|
514
|
-
const { threshold: e =
|
|
512
|
+
}, [e]), ae.createElement(sn.Provider, { value: e }, o)), st = () => qt(sn), Rn = 3, Hn = 0.5, Wn = 50, _t = (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
|
+
function Vn(o = {}) {
|
|
514
|
+
const { threshold: e = Hn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Wn } = o, [r, i] = Se(), 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
|
-
}, [r]), [d, f] =
|
|
517
|
-
return
|
|
516
|
+
}, [r]), [d, f] = q(i);
|
|
517
|
+
return W(() => {
|
|
518
518
|
i && !d && f(i);
|
|
519
|
-
}, [i, d]),
|
|
519
|
+
}, [i, d]), W(() => {
|
|
520
520
|
const m = a.current;
|
|
521
521
|
if (!m) return;
|
|
522
522
|
let p = !1, x = 0;
|
|
523
|
-
const
|
|
523
|
+
const L = () => {
|
|
524
524
|
if (!m) return;
|
|
525
|
-
const
|
|
526
|
-
Math.abs(
|
|
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(_t(S)), l()), x = 0) : x++, p && x >= t && (p = !1, f(_t(S)), l()), c.current = _t(S), s.current = requestAnimationFrame(L);
|
|
527
527
|
};
|
|
528
|
-
s.current = requestAnimationFrame(
|
|
529
|
-
const
|
|
528
|
+
s.current = requestAnimationFrame(L);
|
|
529
|
+
const y = (S) => {
|
|
530
530
|
p = !0, l();
|
|
531
|
-
},
|
|
531
|
+
}, _ = (S) => {
|
|
532
532
|
p = !1, x = t, l();
|
|
533
533
|
};
|
|
534
|
-
let
|
|
535
|
-
const
|
|
536
|
-
for (;
|
|
534
|
+
let v = m;
|
|
535
|
+
const B = [];
|
|
536
|
+
for (; v && v !== document.documentElement && (v.addEventListener("animationstart", y, !0), v.addEventListener("animationend", _, !0), v.addEventListener("transitionstart", y, !0), v.addEventListener("transitionend", _, !0), B.push(v), v = v.parentElement, !(B.length > n)); ) ;
|
|
537
537
|
return () => {
|
|
538
|
-
s.current && cancelAnimationFrame(s.current),
|
|
539
|
-
|
|
538
|
+
s.current && cancelAnimationFrame(s.current), B.forEach((S) => {
|
|
539
|
+
S.removeEventListener("animationstart", y, !0), S.removeEventListener("animationend", _, !0), S.removeEventListener("transitionstart", y, !0), S.removeEventListener("transitionend", _, !0);
|
|
540
540
|
});
|
|
541
541
|
};
|
|
542
542
|
}, [u, i, e, t, n]), [h, d];
|
|
543
543
|
}
|
|
544
544
|
const k = (o, e) => {
|
|
545
|
-
const t = U((...i) => o?.(...i), e), n =
|
|
545
|
+
const t = U((...i) => o?.(...i), e), n = K(null);
|
|
546
546
|
n.current = t;
|
|
547
547
|
const r = U((...i) => n.current?.(...i), []);
|
|
548
548
|
if (n.current) return r;
|
|
549
549
|
};
|
|
550
|
-
function
|
|
551
|
-
const [e, t] =
|
|
552
|
-
return
|
|
550
|
+
function er(o) {
|
|
551
|
+
const [e, t] = q(typeof window < "u" ? window.devicePixelRatio : 1), n = K(null);
|
|
552
|
+
return W(() => {
|
|
553
553
|
if (!(typeof window < "u" && "matchMedia" in window)) return;
|
|
554
554
|
const r = () => {
|
|
555
555
|
const i = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
@@ -560,14 +560,14 @@ function Xo(o) {
|
|
|
560
560
|
};
|
|
561
561
|
}, [o]), e;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function tr(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 nr(o, e, t) {
|
|
569
569
|
const n = k(e, [e]);
|
|
570
|
-
|
|
570
|
+
W(() => {
|
|
571
571
|
const r = (i) => {
|
|
572
572
|
o.current && !o.current.contains(i.target) && n(i);
|
|
573
573
|
};
|
|
@@ -576,232 +576,232 @@ function Go(o, e, t) {
|
|
|
576
576
|
};
|
|
577
577
|
}, [o]);
|
|
578
578
|
}
|
|
579
|
-
let
|
|
580
|
-
function
|
|
581
|
-
const [o, e] =
|
|
579
|
+
let Je = 0;
|
|
580
|
+
function Fn() {
|
|
581
|
+
const [o, e] = q(!!document.fullscreenElement), t = U(() => {
|
|
582
582
|
const n = document.fullscreenElement;
|
|
583
583
|
return n ? n.querySelector(".fullscreen-portal-root") || n : document.body;
|
|
584
584
|
}, []);
|
|
585
|
-
return
|
|
585
|
+
return W(() => {
|
|
586
586
|
function n() {
|
|
587
587
|
const r = document.fullscreenElement;
|
|
588
588
|
if (e(!!r), !r) return;
|
|
589
589
|
let i = r.querySelector(".fullscreen-portal-root");
|
|
590
590
|
i || (i = document.createElement("div"), i.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", r.appendChild(i));
|
|
591
591
|
}
|
|
592
|
-
return
|
|
593
|
-
document.removeEventListener("fullscreenchange", n),
|
|
592
|
+
return Je++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
593
|
+
document.removeEventListener("fullscreenchange", n), Je--, Je <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((r) => {
|
|
594
594
|
r.parentNode && r.parentNode.removeChild(r);
|
|
595
|
-
}),
|
|
595
|
+
}), Je = 0);
|
|
596
596
|
};
|
|
597
597
|
}, []), { getPortalContainer: t, isFullscreen: o };
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function ln(o) {
|
|
600
600
|
if (!o) throw new Error("must have a PointerHandlerOptions");
|
|
601
|
-
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: r = !1, consumeTouch: i = !0 } = o, a = k(e, [e]), u = k(t, [t]), l = k(n, [n]), s =
|
|
601
|
+
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: r = !1, consumeTouch: i = !0 } = o, a = k(e, [e]), u = k(t, [t]), l = k(n, [n]), s = K(!1), c = o?.timerInitial ?? 230, h = o?.timerContinuous ?? c / 2, d = K(null), f = K(null), m = K(null), p = K(null), x = U(() => {
|
|
602
602
|
p.current && (clearTimeout(p.current), p.current = null);
|
|
603
|
-
}, []),
|
|
603
|
+
}, []), L = U((b) => {
|
|
604
604
|
p.current = setTimeout(() => {
|
|
605
605
|
window.requestAnimationFrame(() => {
|
|
606
606
|
if (s.current === !1) return;
|
|
607
|
-
const C = f.current,
|
|
608
|
-
l?.(
|
|
609
|
-
}),
|
|
607
|
+
const C = f.current, E = d.current, $ = tt(C, E.currentTarget);
|
|
608
|
+
l?.($, m.current, E);
|
|
609
|
+
}), L(h);
|
|
610
610
|
}, b ?? c);
|
|
611
611
|
}, []);
|
|
612
|
-
|
|
613
|
-
const
|
|
612
|
+
W(() => () => x(), []);
|
|
613
|
+
const y = r ? "pointer" : "mouse", _ = U((b) => {
|
|
614
614
|
b.stopPropagation(), b.stopImmediatePropagation(), b.preventDefault();
|
|
615
|
-
}, []),
|
|
616
|
-
document.removeEventListener(`${
|
|
615
|
+
}, []), v = k((b) => {
|
|
616
|
+
document.removeEventListener(`${y}move`, O), document.removeEventListener(`${y}up`, v), document.removeEventListener("keydown", I), document.removeEventListener("keyup", M), document.removeEventListener("touchstart", _, { capture: !0 }), document.removeEventListener("touchmove", _, { capture: !0 }), window.removeEventListener("blur", B), x(), window.requestAnimationFrame(() => {
|
|
617
617
|
if (s.current === !1) return;
|
|
618
618
|
s.current = !1;
|
|
619
|
-
const C = b,
|
|
620
|
-
u?.(
|
|
619
|
+
const C = b, E = d.current, $ = tt(C, E.currentTarget);
|
|
620
|
+
u?.($, m.current, E), m.current = null;
|
|
621
621
|
});
|
|
622
|
-
}, []),
|
|
623
|
-
s.current !== !1 && (s.current = !1,
|
|
624
|
-
}, []),
|
|
625
|
-
x(),
|
|
622
|
+
}, []), B = U(() => {
|
|
623
|
+
s.current !== !1 && (s.current = !1, v(f.current));
|
|
624
|
+
}, []), S = k(() => {
|
|
625
|
+
x(), L(h), window.requestAnimationFrame(() => {
|
|
626
626
|
if (s.current === !1) return;
|
|
627
|
-
const b = f.current, C = d.current,
|
|
628
|
-
l?.(
|
|
627
|
+
const b = f.current, C = d.current, E = tt(b, C.currentTarget);
|
|
628
|
+
l?.(E, m.current, C);
|
|
629
629
|
});
|
|
630
|
-
}, [h]),
|
|
631
|
-
f.current = b,
|
|
632
|
-
}, []),
|
|
633
|
-
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey },
|
|
634
|
-
}, []),
|
|
635
|
-
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey },
|
|
630
|
+
}, [h]), O = k((b) => {
|
|
631
|
+
f.current = b, S();
|
|
632
|
+
}, []), I = k((b) => {
|
|
633
|
+
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, S();
|
|
634
|
+
}, []), M = k((b) => {
|
|
635
|
+
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, S();
|
|
636
636
|
}, [h]);
|
|
637
637
|
return k((b) => {
|
|
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(`${
|
|
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
|
|
642
|
-
return
|
|
641
|
+
function or(o, e) {
|
|
642
|
+
return ln({ onPointerDown: o, onPointerMoveOrWait: (t, n, r) => {
|
|
643
643
|
o?.(r);
|
|
644
644
|
}, ...e });
|
|
645
645
|
}
|
|
646
|
-
const
|
|
647
|
-
const n =
|
|
646
|
+
const jn = ({ initValue: o, useHookBody: e, applyStateChange: t }) => {
|
|
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 Mt(() => {
|
|
651
651
|
n.current !== r && (n.current = r, t(r));
|
|
652
652
|
}, [t, r]), null;
|
|
653
653
|
}, wt = (o) => {
|
|
654
654
|
console && console.warn && console.warn(o);
|
|
655
|
-
},
|
|
656
|
-
let
|
|
657
|
-
const
|
|
655
|
+
}, gt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
656
|
+
let Un = 1, xt = !1, an = !1;
|
|
657
|
+
const nt = [], Pe = [], it = () => {
|
|
658
658
|
Pe.forEach((o) => o());
|
|
659
|
-
},
|
|
660
|
-
const [e, t] =
|
|
661
|
-
return n.current = e, o ||
|
|
659
|
+
}, Xn = ({ automaticContainerInternalUseOnly: o }) => {
|
|
660
|
+
const [e, t] = q([]), n = K([]);
|
|
661
|
+
return n.current = e, o || xt !== !1 || (an = !0), W(() => {
|
|
662
662
|
let r = !0;
|
|
663
663
|
function i() {
|
|
664
|
-
if (r) return Pe[0] !== i ? (o ||
|
|
664
|
+
if (r) return Pe[0] !== i ? (o || xt !== !0 || wt("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 Pe.push(i),
|
|
667
|
-
r = !1, n.current?.length > 0 && wt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Pe.splice(Pe.indexOf(i), 1),
|
|
666
|
+
return Pe.push(i), it(), () => {
|
|
667
|
+
r = !1, n.current?.length > 0 && wt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Pe.splice(Pe.indexOf(i), 1), it();
|
|
668
668
|
};
|
|
669
|
-
}, [o]), P(fe, { children: e.map(({ hook: r, key: i }) => wn(
|
|
670
|
-
},
|
|
671
|
-
const e =
|
|
672
|
-
return
|
|
673
|
-
if (
|
|
674
|
-
const n =
|
|
675
|
-
|
|
669
|
+
}, [o]), P(fe, { children: e.map(({ hook: r, key: i }) => wn(jn, { ...r, key: i })) });
|
|
670
|
+
}, Yn = (o) => {
|
|
671
|
+
const e = Un++;
|
|
672
|
+
return nt.push({ hook: o, key: e }), Pe.length === 0 && an === !1 && (xt = !0, ((t) => {
|
|
673
|
+
if (gt.document && gt.document.createElement) {
|
|
674
|
+
const n = gt.document.createElement("div");
|
|
675
|
+
En(n).render(P(t, { automaticContainerInternalUseOnly: !0 }));
|
|
676
676
|
} else wt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
677
|
-
})(
|
|
678
|
-
|
|
677
|
+
})(Xn)), it(), () => {
|
|
678
|
+
nt.splice(nt.findIndex((t) => t.key === e), 1), it();
|
|
679
679
|
};
|
|
680
680
|
};
|
|
681
|
-
let
|
|
682
|
-
|
|
681
|
+
let St = null;
|
|
682
|
+
St || (St = (o, e, t = {}) => {
|
|
683
683
|
let n, r, i = !1, a = !1, u = [], { unmountIfNoConsumers: l = !1 } = t;
|
|
684
684
|
const s = (h) => {
|
|
685
|
-
r = h,
|
|
685
|
+
r = h, Mn(() => u.forEach((d) => d(h)));
|
|
686
686
|
}, c = () => (a || (r = typeof o == "function" ? o() : o, a = !0), r);
|
|
687
687
|
return () => {
|
|
688
|
-
const [h, d] =
|
|
689
|
-
return
|
|
688
|
+
const [h, d] = q(c);
|
|
689
|
+
return W(() => (i || (i = !0, n = Yn({ initValue: o, useHookBody: e, applyStateChange: s })), u.push(d), r !== h && d(r), () => {
|
|
690
690
|
u.splice(u.indexOf(d), 1), u.length === 0 && l && (n(), i = !1);
|
|
691
691
|
}), []), h;
|
|
692
692
|
};
|
|
693
693
|
});
|
|
694
|
-
const
|
|
695
|
-
let
|
|
694
|
+
const cn = St;
|
|
695
|
+
let un = () => {
|
|
696
696
|
console.warn("You must call useEditMode before setting its state.");
|
|
697
697
|
};
|
|
698
|
-
const
|
|
699
|
-
const [o, e] =
|
|
700
|
-
return
|
|
701
|
-
}),
|
|
702
|
-
const o =
|
|
703
|
-
return
|
|
704
|
-
|
|
698
|
+
const Gn = cn(null, () => {
|
|
699
|
+
const [o, e] = q(null);
|
|
700
|
+
return un = e, o;
|
|
701
|
+
}), rr = () => {
|
|
702
|
+
const o = Gn();
|
|
703
|
+
return R(() => ({ setMode: (e) => {
|
|
704
|
+
un((t) => (typeof e == "function" && (e = e(t)), e?.onModeChange?.(e ?? null), e));
|
|
705
705
|
}, getMode: () => o }), [o]);
|
|
706
|
-
},
|
|
706
|
+
}, qn = cn({ setClipboard: (o) => {
|
|
707
707
|
throw new Error("This is only available via the useClipboard.");
|
|
708
|
-
}, getClipboard: () =>
|
|
709
|
-
const [o, e] =
|
|
710
|
-
return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy:
|
|
711
|
-
}),
|
|
712
|
-
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a =
|
|
713
|
-
|
|
714
|
-
const
|
|
708
|
+
}, getClipboard: () => rt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
709
|
+
const [o, e] = q(rt.Global);
|
|
710
|
+
return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy: K(null), refNativeLastKey: K(null) };
|
|
711
|
+
}), ir = (o) => {
|
|
712
|
+
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, a = st(), u = k(r, [r]), l = k(n, [n]), { getClipboard: s, refNativeCopy: c } = qn(), h = s();
|
|
713
|
+
R(() => {
|
|
714
|
+
const y = e?.element, _ = t?.element ?? e?.element;
|
|
715
715
|
if (!i) return;
|
|
716
|
-
const
|
|
717
|
-
i?.addCommands(
|
|
716
|
+
const v = [new ft("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 ft("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 ft("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
|
+
i?.addCommands(v, !0);
|
|
718
718
|
}, [i]);
|
|
719
|
-
const d = k(async (
|
|
719
|
+
const d = k(async (y) => {
|
|
720
720
|
if (!e?.element) return;
|
|
721
|
-
let
|
|
721
|
+
let _ = null;
|
|
722
722
|
try {
|
|
723
|
-
|
|
724
|
-
} catch (
|
|
725
|
-
throw
|
|
723
|
+
_ = e.doCopy?.(y), typeof _ == "string" ? await h.writeText(_) : await h.writeReference(_);
|
|
724
|
+
} catch (v) {
|
|
725
|
+
throw v;
|
|
726
726
|
}
|
|
727
|
-
}, [e, a]), f = k(async (
|
|
728
|
-
const
|
|
729
|
-
if (
|
|
730
|
-
c.current = { sourceElement:
|
|
727
|
+
}, [e, a]), f = k(async (y) => {
|
|
728
|
+
const _ = e?.element?.();
|
|
729
|
+
if (_) {
|
|
730
|
+
c.current = { sourceElement: _, args: y };
|
|
731
731
|
try {
|
|
732
|
-
await d(
|
|
733
|
-
} catch (
|
|
734
|
-
a.showError?.(
|
|
732
|
+
await d(y);
|
|
733
|
+
} catch (v) {
|
|
734
|
+
a.showError?.(v);
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
737
|
}, [e?.element, a]), m = U(() => {
|
|
738
738
|
f({ isCut: !0 });
|
|
739
|
-
}, []), p = k(async (
|
|
739
|
+
}, []), p = k(async (y, _, v) => {
|
|
740
740
|
try {
|
|
741
|
-
if (await
|
|
742
|
-
l?.(
|
|
743
|
-
} catch (
|
|
744
|
-
a.showError?.(
|
|
741
|
+
if (await y.doPaste(_, v) === !1) return;
|
|
742
|
+
l?.(_, v);
|
|
743
|
+
} catch (B) {
|
|
744
|
+
a.showError?.(B);
|
|
745
745
|
}
|
|
746
|
-
}, [l]), x = k(async (
|
|
747
|
-
const
|
|
748
|
-
if (
|
|
749
|
-
const
|
|
750
|
-
if (
|
|
751
|
-
return await p(t,
|
|
752
|
-
} catch (
|
|
753
|
-
|
|
746
|
+
}, [l]), x = k(async (y, _, v) => {
|
|
747
|
+
const B = t?.element?.();
|
|
748
|
+
if (B && await te.whenFocus(B), !y && !_) return;
|
|
749
|
+
const S = await a.showBusy?.("Pasting...");
|
|
750
|
+
if (_) try {
|
|
751
|
+
return await p(t, _, v), void S?.();
|
|
752
|
+
} catch (M) {
|
|
753
|
+
S?.(), a.showError?.(M);
|
|
754
754
|
}
|
|
755
|
-
let
|
|
756
|
-
|
|
755
|
+
let O, I = t.importFromExternal;
|
|
756
|
+
I || (I = (M, b) => ({ getItemType: () => "text", toText: () => y.text, isClipboardItem: !0 }));
|
|
757
757
|
try {
|
|
758
|
-
|
|
759
|
-
} catch (
|
|
760
|
-
|
|
758
|
+
O = await I(y, { isCut: !1 });
|
|
759
|
+
} catch (M) {
|
|
760
|
+
S?.(), a.showError?.(M);
|
|
761
761
|
}
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
await p(t,
|
|
765
|
-
} catch (
|
|
766
|
-
|
|
762
|
+
if (O) try {
|
|
763
|
+
const M = await Promise.resolve(O);
|
|
764
|
+
await p(t, M, v), S?.();
|
|
765
|
+
} catch (M) {
|
|
766
|
+
S?.(), a.showError?.(M);
|
|
767
767
|
}
|
|
768
|
-
else
|
|
769
|
-
}, [p, t, a]),
|
|
768
|
+
else S?.();
|
|
769
|
+
}, [p, t, a]), L = k(async (y) => {
|
|
770
770
|
if (t?.element) try {
|
|
771
|
-
const
|
|
772
|
-
if (
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
await x(
|
|
777
|
-
} catch (
|
|
778
|
-
if (
|
|
779
|
-
a.showError?.(
|
|
771
|
+
const _ = await h.readReference();
|
|
772
|
+
if (_) return void await x(null, _, y);
|
|
773
|
+
const v = [];
|
|
774
|
+
v[0] = await dt.readStringFromClipboard(h, pt.plain), v[1] = await dt.readHTMLFromClipboard(h, pt.html), v[2] = await dt.readBlobFromClipboard(h, pt.png);
|
|
775
|
+
const B = { text: v[0] ?? null, html: v[1] ?? null, image: v[2] ?? null };
|
|
776
|
+
await x(B, null, y);
|
|
777
|
+
} catch (_) {
|
|
778
|
+
if (_?.message === "Document is not focused.") return;
|
|
779
|
+
a.showError?.(_);
|
|
780
780
|
}
|
|
781
781
|
}, [x, t?.element, a]);
|
|
782
|
-
return k(async (
|
|
783
|
-
}, [e?.element]), k(async (
|
|
784
|
-
}, [t?.element, x, a]),
|
|
782
|
+
return k(async (y) => {
|
|
783
|
+
}, [e?.element]), k(async (y) => {
|
|
784
|
+
}, [t?.element, x, a]), W(() => {
|
|
785
785
|
if (!h) return;
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
u?.(
|
|
789
|
-
},
|
|
790
|
-
a.showMessage?.(
|
|
791
|
-
},
|
|
792
|
-
a.showMessage?.(
|
|
786
|
+
const y = async (B) => {
|
|
787
|
+
const S = await h.readReference();
|
|
788
|
+
u?.(S);
|
|
789
|
+
}, _ = (B) => {
|
|
790
|
+
a.showMessage?.(rt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
791
|
+
}, v = (B) => {
|
|
792
|
+
a.showMessage?.(rt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
793
793
|
};
|
|
794
|
-
return h.addEventListener("clipboardchange",
|
|
795
|
-
h.removeEventListener("clipboardchange",
|
|
794
|
+
return h.addEventListener("clipboardchange", y), h.addEventListener("clipboarderrorread", _), h.addEventListener("clipboarderrorwrite", v), () => {
|
|
795
|
+
h.removeEventListener("clipboardchange", y), h.removeEventListener("clipboarderrorread", _), h.removeEventListener("clipboarderrorwrite", v);
|
|
796
796
|
};
|
|
797
|
-
}, [h, a]),
|
|
798
|
-
}, [d, x, e, t]),
|
|
799
|
-
i?.getCommand("cut")?.updateCallback(m).update({ disabled: !e || !t }), i?.getCommand("copy")?.updateCallback(f).update({ disabled: !e }), i?.getCommand("paste")?.updateCallback(
|
|
800
|
-
}, [e, t, i]), { paste:
|
|
797
|
+
}, [h, a]), W(() => {
|
|
798
|
+
}, [d, x, e, t]), W(() => {
|
|
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
|
+
}, [e, t, i]), { paste: L, copy: f, clipboard: h };
|
|
801
801
|
};
|
|
802
|
-
function
|
|
803
|
-
const t =
|
|
804
|
-
|
|
802
|
+
function sr(o, e = !0) {
|
|
803
|
+
const t = K(o);
|
|
804
|
+
W(() => {
|
|
805
805
|
if (e) {
|
|
806
806
|
const n = Object.entries(o).reduce((r, [i, a]) => (t.current[i] !== a && (r[i] = [t.current[i], a]), r), {});
|
|
807
807
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
@@ -809,19 +809,19 @@ function Qo(o, e = !0) {
|
|
|
809
809
|
t.current = o;
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
|
-
let
|
|
813
|
-
var
|
|
814
|
-
const
|
|
815
|
-
const [o, e] = ae.useState(() =>
|
|
816
|
-
return
|
|
817
|
-
o == null && e(
|
|
812
|
+
let yt = !1, Zn = 0;
|
|
813
|
+
var Jn = typeof document < "u" ? Mt : W;
|
|
814
|
+
const Ot = () => "sheetxl-ui-" + Zn++, It = ae.useId, lr = It ?? function() {
|
|
815
|
+
const [o, e] = ae.useState(() => yt ? Ot() : void 0);
|
|
816
|
+
return Jn(() => {
|
|
817
|
+
o == null && e(Ot());
|
|
818
818
|
}, []), ae.useEffect(() => {
|
|
819
|
-
|
|
819
|
+
yt || (yt = !0);
|
|
820
820
|
}, []), o;
|
|
821
|
-
},
|
|
822
|
-
function
|
|
823
|
-
const n =
|
|
824
|
-
return
|
|
821
|
+
}, Qn = [];
|
|
822
|
+
function Ct(o, e, t = Qn) {
|
|
823
|
+
const n = K(null);
|
|
824
|
+
return xn(o, () => {
|
|
825
825
|
if (!n.current) return;
|
|
826
826
|
const r = n.current, i = e?.();
|
|
827
827
|
if (!i || typeof i != "object") throw new Error("attributes must return a plain object of values");
|
|
@@ -833,8 +833,8 @@ function Lt(o, e, t = Jn) {
|
|
|
833
833
|
return r;
|
|
834
834
|
}, t), n;
|
|
835
835
|
}
|
|
836
|
-
const
|
|
837
|
-
const n =
|
|
836
|
+
const $t = "Undo the last action.", Kt = "Repeat the last action or undo the redo.", eo = (o) => `Redo ${o}`, ar = ({ manager: o, commands: e, disabled: t }) => {
|
|
837
|
+
const n = st(), r = k((a) => {
|
|
838
838
|
try {
|
|
839
839
|
o?.undo(a);
|
|
840
840
|
} catch (u) {
|
|
@@ -847,19 +847,19 @@ const It = "Undo the last action.", $t = "Repeat the last action or undo the red
|
|
|
847
847
|
n.error(u);
|
|
848
848
|
}
|
|
849
849
|
}, [o]);
|
|
850
|
-
return
|
|
850
|
+
return R(() => {
|
|
851
851
|
if (!e) return;
|
|
852
852
|
const a = { contains: (l) => !0, focus() {
|
|
853
|
-
} }, u = [new
|
|
853
|
+
} }, u = [new vt("undo", a, { label: "Undo", description: $t, shortcut: { key: "z", modifiers: [Q.Ctrl] }, disabled: !0 }, r), new vt("redo", a, { label: "Redo", description: Kt, shortcut: [{ key: "y", modifiers: [Q.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Q.Alt] }], disabled: !0 }, i)];
|
|
854
854
|
e?.addCommands(u, !0);
|
|
855
|
-
}, [e]),
|
|
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}`) : $t, state: s, context: { undoManager: o } });
|
|
861
861
|
const h = o?.getTopRedoDescription();
|
|
862
|
-
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: h ?
|
|
862
|
+
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: h ? eo(h) : Kt, state: s, context: { undoManager: o } });
|
|
863
863
|
};
|
|
864
864
|
if (a(), !o) return;
|
|
865
865
|
const u = o.addListener({ onStackChange() {
|
|
@@ -868,7 +868,7 @@ const It = "Undo the last action.", $t = "Repeat the last action or undo the red
|
|
|
868
868
|
return () => u?.();
|
|
869
869
|
}, [o, e, t]), { undo: r, redo: i };
|
|
870
870
|
};
|
|
871
|
-
class
|
|
871
|
+
class to extends Sn {
|
|
872
872
|
static getDerivedStateFromError() {
|
|
873
873
|
return { hasError: !0 };
|
|
874
874
|
}
|
|
@@ -879,13 +879,13 @@ class eo extends xn {
|
|
|
879
879
|
return this.props.children;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
|
-
const
|
|
883
|
-
const e =
|
|
882
|
+
const cr = ({ children: o }) => {
|
|
883
|
+
const e = st(), t = U((n) => {
|
|
884
884
|
e.showError(n);
|
|
885
885
|
}, [e]);
|
|
886
|
-
return P(
|
|
886
|
+
return P(to, { onError: t, children: o });
|
|
887
887
|
};
|
|
888
|
-
class
|
|
888
|
+
class no {
|
|
889
889
|
constructor(e) {
|
|
890
890
|
this.notifier = e, this.handleUnhandledRejection = (t) => {
|
|
891
891
|
const n = t.reason;
|
|
@@ -901,85 +901,85 @@ class to {
|
|
|
901
901
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
const
|
|
905
|
-
const e =
|
|
906
|
-
return
|
|
907
|
-
const t = new
|
|
904
|
+
const ur = ({ children: o }) => {
|
|
905
|
+
const e = st();
|
|
906
|
+
return W(() => {
|
|
907
|
+
const t = new no(e);
|
|
908
908
|
return () => {
|
|
909
909
|
t.cleanup();
|
|
910
910
|
};
|
|
911
911
|
}, [e]), P(fe, { children: o });
|
|
912
|
-
},
|
|
913
|
-
function
|
|
912
|
+
}, hr = () => null;
|
|
913
|
+
function hn(o) {
|
|
914
914
|
var e, t, n = "";
|
|
915
915
|
if (typeof o == "string" || typeof o == "number") n += o;
|
|
916
916
|
else if (typeof o == "object") if (Array.isArray(o)) {
|
|
917
917
|
var r = o.length;
|
|
918
|
-
for (e = 0; e < r; e++) o[e] && (t =
|
|
918
|
+
for (e = 0; e < r; e++) o[e] && (t = hn(o[e])) && (n && (n += " "), n += t);
|
|
919
919
|
} else for (t in o) o[t] && (n && (n += " "), n += t);
|
|
920
920
|
return n;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
923
|
-
for (var o, e, t = 0, n = "", r = arguments.length; t < r; t++) (o = arguments[t]) && (e =
|
|
922
|
+
function G() {
|
|
923
|
+
for (var o, e, t = 0, n = "", r = arguments.length; t < r; t++) (o = arguments[t]) && (e = hn(o)) && (n && (n += " "), n += e);
|
|
924
924
|
return n;
|
|
925
925
|
}
|
|
926
|
-
const
|
|
927
|
-
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u, hitAreaProps: l =
|
|
928
|
-
return P("div", { style: { ...t, position: "relative" }, ...s, children: P("div", { className:
|
|
929
|
-
},
|
|
926
|
+
const oo = {}, ro = (o) => {
|
|
927
|
+
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: a, key: u, hitAreaProps: l = oo, ...s } = o, c = n === "row", { style: h, className: d, ...f } = l;
|
|
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 = {}, be = (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
|
-
},
|
|
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:
|
|
934
|
+
}, io = me(Ee((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, resizerProps: _ = Qe, paneProps: v = Qe, paneBeforeProps: B = Qe, paneAfterProps: S = Qe, createResizer: O = ro } = o;
|
|
936
936
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
937
|
-
const
|
|
938
|
-
let
|
|
939
|
-
i && (i === "before" ?
|
|
940
|
-
const j =
|
|
941
|
-
return { fixedPaneOffset:
|
|
942
|
-
}, [l, s, c, h]), b = k(u, [u]), [C,
|
|
943
|
-
|
|
944
|
-
|
|
937
|
+
const I = R(() => ae.isValidElement(n) && ae.isValidElement(t), [n, t]), M = R(() => {
|
|
938
|
+
let z = null;
|
|
939
|
+
i && (i === "before" ? z = 0 : i === "after" && (z = 1));
|
|
940
|
+
const j = z === null;
|
|
941
|
+
return { fixedPaneOffset: z, isPercent: j, minBefore: he(l, j), maxBefore: he(s, j), minAfter: he(c, j), maxAfter: he(h, j) };
|
|
942
|
+
}, [l, s, c, h]), b = k(u, [u]), [C, E] = q(() => he(a, i === null));
|
|
943
|
+
W(() => {
|
|
944
|
+
E(he(a, i === null));
|
|
945
945
|
}, [a, i]);
|
|
946
|
-
const [
|
|
947
|
-
const ce = [null, null],
|
|
948
|
-
if (
|
|
949
|
-
let ue =
|
|
950
|
-
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
})(C, F, D,
|
|
954
|
-
const j = he(
|
|
955
|
-
|
|
956
|
-
}, [i]),
|
|
957
|
-
if (p || !
|
|
946
|
+
const [$, { width: T, height: g }] = Se(), [A, { width: H, height: X }] = Se(), D = r === "row" ? H : X, F = r === "row" ? T : g, V = R(() => ((z, j, oe, J) => {
|
|
947
|
+
const ce = [null, null], le = [null, null];
|
|
948
|
+
if (z || (z = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return z?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = z?.pixels, le[1] = 100) : (ce[1] = z?.pixels - oe, le[0] = 100) : z?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = z?.percent, le[1] = 100 - z?.percent) : (le[1] = z?.percent, le[0] = 100 - z?.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 = be(z, j, J.fixedPaneOffset !== 1), ie = j - oe, Tt = be(J.minBefore, ie, !0) ?? 0, gn = be(J.maxBefore, ie, !0) ?? ie, qe = 0, ht = 0, kt = 0, Pt = ie;
|
|
950
|
+
qe = (be(J.maxAfter, j, !1) ?? oe) - oe, ht = be(J.minAfter, j, !1) ?? j, kt = Math.max(Tt, qe), Pt = Math.min(gn, ht), ue = Math.max(kt, Math.min(ue, Pt)), ht = Math.min(ie - ue, be(J.maxAfter, ie - ue, !0) ?? ie), qe = Math.min(ie - ue, be(J.minAfter, ie - ue, !0) ?? ie), ce[0] = ue, ce[1] = ie - ce[0];
|
|
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: `${Tt}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), Me = k(x, [x]), _e = k(L, [L]), Le = k(y, [y]), ge = K(null), lt = K(null), Ne = K(null), { style: at, className: Re, ...He } = v, We = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...at }, { className: ct, style: Ve, ...Fe } = B, { className: je, style: Ue, ...Ce } = S, ze = { flex: "1 1 100%", width: "100%", ...m, flexDirection: r, display: "flex" }, { className: se, style: Te, onPointerDown: Xe, ...Ye } = _, Be = k((z) => {
|
|
954
|
+
const j = he(z, i === null);
|
|
955
|
+
E(j);
|
|
956
|
+
}, [i]), w = k((z) => {
|
|
957
|
+
if (p || !Y) return;
|
|
958
958
|
const j = ye.current?.getBoundingClientRect();
|
|
959
|
-
let
|
|
960
|
-
|
|
961
|
-
}, [
|
|
962
|
-
if (document.removeEventListener("pointermove",
|
|
959
|
+
let oe = 0;
|
|
960
|
+
oe = r === "row" ? (z.clientX ?? z.touches?.[0]?.clientX) - j.x : (z.clientY ?? z.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 }), _e?.(oe), z.stopPropagation(), z.preventDefault();
|
|
961
|
+
}, [M, r, p, Y, C, F]), N = k((z) => {
|
|
962
|
+
if (document.removeEventListener("pointermove", w), document.removeEventListener("touchmove", w), document.removeEventListener("pointerup", N), !!Y && (ee(!1), !!C)) {
|
|
963
963
|
if (Le(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
|
+
z.stopPropagation(), z.preventDefault();
|
|
968
968
|
}
|
|
969
|
-
}, [C,
|
|
970
|
-
Xe?.(
|
|
971
|
-
}, [Xe]), ye =
|
|
969
|
+
}, [C, Y, a, i, F]), Z = k((z) => {
|
|
970
|
+
Xe?.(z), z.defaultPrevented || p || Y || (ee(!0), Me(), document.addEventListener("pointermove", w, { passive: !1 }), document.addEventListener("touchmove", w, { passive: !1 }), document.addEventListener("pointerup", N, { passive: !1 }));
|
|
971
|
+
}, [Xe]), ye = Ct(e, () => ({ setPosition: Be, isSplitPane: () => !0 }), []), ke = R(() => I ? O?.({ key: "resizer", ref: Ae([A, lt]), 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, ...Te }, splitDirection: r, disabled: p, ...Ye }) : null, [I, se, Ye, r, Te, p]), ve = r === "row" ? "Width" : "Height", ut = R(() => {
|
|
972
972
|
if (!t) return null;
|
|
973
|
-
const
|
|
974
|
-
return P("div", { ref: ge, className:
|
|
975
|
-
}, [t,
|
|
973
|
+
const z = { ...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${ve}`]: V?.minBefore, [`max${ve}`]: n ? V?.maxBefore : "100%" };
|
|
974
|
+
return P("div", { ref: ge, className: G("before", Re, ct), style: z, ...He, ...Fe, children: t }, "before");
|
|
975
|
+
}, [t, v, B, M, V]), Ge = R(() => {
|
|
976
976
|
if (!n) return null;
|
|
977
|
-
const
|
|
978
|
-
return P("div", { ref:
|
|
979
|
-
}, [n,
|
|
980
|
-
return pe("div", { ref: Ae([
|
|
977
|
+
const z = { ...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${ve}`]: V?.minAfter, [`max${ve}`]: t ? V?.maxAfter : "100%" };
|
|
978
|
+
return P("div", { ref: Ne, className: G("after", Re, je), style: z, ...He, ...Ce, children: n }, "after");
|
|
979
|
+
}, [n, v, S, M, V]);
|
|
980
|
+
return pe("div", { ref: Ae([$, ye]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y }, f), style: ze, children: [ut, ke, Ge] });
|
|
981
981
|
}));
|
|
982
|
-
function
|
|
982
|
+
function so(o) {
|
|
983
983
|
if (typeof o == "function") return o;
|
|
984
984
|
if (typeof o == "string") {
|
|
985
985
|
const e = o.trim();
|
|
@@ -1013,12 +1013,12 @@ function io(o) {
|
|
|
1013
1013
|
return null;
|
|
1014
1014
|
}
|
|
1015
1015
|
})(e);
|
|
1016
|
-
if (t) return
|
|
1016
|
+
if (t) return Ht(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 Ht(e);
|
|
1020
1020
|
if (/^<\s*path\b/i.test(e)) {
|
|
1021
|
-
const t =
|
|
1021
|
+
const t = Nt(e);
|
|
1022
1022
|
if (t) return { paths: [{ d: t }] };
|
|
1023
1023
|
}
|
|
1024
1024
|
return { paths: [{ d: e }] };
|
|
@@ -1030,7 +1030,7 @@ function io(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 = Nt(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,12 +1038,12 @@ function io(o) {
|
|
|
1038
1038
|
}
|
|
1039
1039
|
return o;
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Nt(o) {
|
|
1042
1042
|
const e = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(o);
|
|
1043
1043
|
return e ? e[1] ?? e[2] ?? null : null;
|
|
1044
1044
|
}
|
|
1045
1045
|
function Rt(o) {
|
|
1046
|
-
if ("svg" in o) return { ...o, svg:
|
|
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;
|
|
1049
1049
|
return { ...o, url: e };
|
|
@@ -1054,7 +1054,7 @@ function Rt(o) {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
return o;
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function Ht(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 = [];
|
|
@@ -1069,10 +1069,10 @@ function Nt(o) {
|
|
|
1069
1069
|
p && (d.stroke = p);
|
|
1070
1070
|
const x = c.getAttribute("opacity");
|
|
1071
1071
|
x && (d.opacity = Number(x));
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1072
|
+
const L = c.getAttribute("fill-rule");
|
|
1073
|
+
L && (d.fillRule = L);
|
|
1074
|
+
const y = c.getAttribute("clip-rule");
|
|
1075
|
+
y && (d.clipRule = y), s.push(d);
|
|
1076
1076
|
}), { viewBox: l, paths: s };
|
|
1077
1077
|
}
|
|
1078
1078
|
} catch {
|
|
@@ -1082,7 +1082,7 @@ function Nt(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 Wt(o) {
|
|
1086
1086
|
const e = {};
|
|
1087
1087
|
for (const [i, a] of Object.entries(o.icons)) e[i] = Rt(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 ?? [] };
|
|
@@ -1099,7 +1099,7 @@ function Ht(o) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
return n;
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function lo() {
|
|
1103
1103
|
const o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
1104
1104
|
let t = "base", n = /* @__PURE__ */ new Map();
|
|
1105
1105
|
async function r(l) {
|
|
@@ -1110,7 +1110,7 @@ function so() {
|
|
|
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 = Wt(h);
|
|
1114
1114
|
}).catch((c) => {
|
|
1115
1115
|
throw s.loading = void 0, c;
|
|
1116
1116
|
});
|
|
@@ -1153,7 +1153,7 @@ function so() {
|
|
|
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 = Wt(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));
|
|
@@ -1205,56 +1205,56 @@ function so() {
|
|
|
1205
1205
|
return n.set(l, c), c;
|
|
1206
1206
|
} };
|
|
1207
1207
|
}
|
|
1208
|
-
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1211
|
-
const
|
|
1208
|
+
io.displayName = "SplitPane";
|
|
1209
|
+
const ot = lo();
|
|
1210
|
+
ot.register("base", () => import("./Du8tayDoOWvYYmxJ.mjs"));
|
|
1211
|
+
const Vt = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Icon_17dpm_10" }, co = me((o) => {
|
|
1212
1212
|
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: a, size: u, ariaHidden: l, sourceProps: s, children: c, ...h } = o, [d, f] = ae.useState(null);
|
|
1213
1213
|
ae.useEffect(() => {
|
|
1214
|
-
let
|
|
1215
|
-
if (!
|
|
1216
|
-
const
|
|
1217
|
-
return void f({ glyph:
|
|
1214
|
+
let E = !0, $ = t, T = e;
|
|
1215
|
+
if (!T) {
|
|
1216
|
+
const g = ot.getPack($);
|
|
1217
|
+
return void f({ glyph: g ? { svg: te.EmptyArray } : void 0, pack: g ?? void 0, packKey: $ ?? ot.getActive() });
|
|
1218
1218
|
}
|
|
1219
|
-
if (
|
|
1220
|
-
const [
|
|
1221
|
-
|
|
1219
|
+
if (T.includes(":")) {
|
|
1220
|
+
const [g, A] = T.split(":");
|
|
1221
|
+
$ = g, T = A;
|
|
1222
1222
|
}
|
|
1223
|
-
return
|
|
1224
|
-
|
|
1223
|
+
return ot.resolve(T, { packKey: $ }).then((g) => {
|
|
1224
|
+
E && f(g);
|
|
1225
1225
|
}), () => {
|
|
1226
|
-
|
|
1226
|
+
E = !1;
|
|
1227
1227
|
};
|
|
1228
1228
|
}, [e, t]);
|
|
1229
1229
|
const m = d?.pack, p = d?.glyph, x = d?.packKey;
|
|
1230
|
-
let
|
|
1231
|
-
const
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1234
|
-
}, [r,
|
|
1235
|
-
if (c) return
|
|
1236
|
-
if (
|
|
1237
|
-
if (
|
|
1230
|
+
let L = p ? p.svg : void 0;
|
|
1231
|
+
const y = p && !L ? p.url : void 0, _ = !p || L || y ? void 0 : p.emoji, v = u != null ? typeof u == "number" ? `${u}px` : u : void 0, B = R(() => [ao.Icon, "icon", n].filter(Boolean).join(" "), [n]), S = R(() => {
|
|
1232
|
+
const E = { ...r };
|
|
1233
|
+
return E["--icon-size"] = v, E;
|
|
1234
|
+
}, [r, v]), O = i ?? (a ? "img" : "presentation"), I = l ?? (!a || void 0), M = (E) => P("span", { className: B, style: S, role: O, "aria-hidden": I, title: a, "data-icon-glyph": e, "data-icon-pack": x, ...h, children: E });
|
|
1235
|
+
if (c) return M(c);
|
|
1236
|
+
if (_) return M(P("span", { children: typeof _ == "string" ? _ : _.text }));
|
|
1237
|
+
if (y) return M(P("img", { src: y.src, alt: a ?? "" }));
|
|
1238
1238
|
if (p && "react" in p) {
|
|
1239
|
-
const
|
|
1240
|
-
return
|
|
1241
|
-
}
|
|
1242
|
-
const b = { viewBox:
|
|
1243
|
-
if (typeof
|
|
1244
|
-
return
|
|
1245
|
-
if (!
|
|
1246
|
-
const C =
|
|
1247
|
-
return
|
|
1239
|
+
const E = p.react, $ = { className: B, style: S, role: O, "aria-hidden": I, title: a, ...h, ...s };
|
|
1240
|
+
return M(P(E, { ...$ }));
|
|
1241
|
+
}
|
|
1242
|
+
const b = { viewBox: L?.viewBox ?? m?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1243
|
+
if (typeof L == "function")
|
|
1244
|
+
return M(L(b) ?? P(Vt, { ...b }));
|
|
1245
|
+
if (!L) return M(P(Vt, { ...b }));
|
|
1246
|
+
const C = L.paths;
|
|
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
|
|
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 =
|
|
1249
|
+
function dr(o) {
|
|
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` };
|
|
1253
1253
|
return t && t !== "accent" && (f["--icon-accent"] = `var(--icon-${t})`), f;
|
|
1254
|
-
}, [e, n, r, i, t]), d =
|
|
1255
|
-
return P(
|
|
1254
|
+
}, [e, n, r, i, t]), d = R(() => e ? s + " walking" : s, [e, s]);
|
|
1255
|
+
return P(co, { iconKey: a, packKey: u, className: d, style: { ...l, ...h }, ...c });
|
|
1256
1256
|
}
|
|
1257
|
-
class
|
|
1257
|
+
class Et {
|
|
1258
1258
|
constructor() {
|
|
1259
1259
|
this.store = /* @__PURE__ */ new Map();
|
|
1260
1260
|
}
|
|
@@ -1268,11 +1268,11 @@ class St {
|
|
|
1268
1268
|
this.store.delete(e);
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1271
|
+
const dn = Gt(null), pn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, uo = { store: new Et(), namespace: "", serializer: pn, debounceMs: 0, crossTabSync: !1, notify: () => {
|
|
1272
1272
|
}, subscribeKey: () => () => {
|
|
1273
1273
|
} };
|
|
1274
|
-
function
|
|
1275
|
-
const { store: n, namespace: r, serializer: i, debounceMs: a, subscribeKey: u } =
|
|
1274
|
+
function pr(o, e, t = ho) {
|
|
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 {
|
|
1278
1278
|
if (typeof window < "u" && "localStorage" in window && s.startsWith(r)) {
|
|
@@ -1287,21 +1287,21 @@ function sr(o, e, t = uo) {
|
|
|
1287
1287
|
}
|
|
1288
1288
|
return p;
|
|
1289
1289
|
});
|
|
1290
|
-
|
|
1290
|
+
W(() => {
|
|
1291
1291
|
let p = !0;
|
|
1292
1292
|
return (async () => {
|
|
1293
|
-
const [x,
|
|
1294
|
-
let
|
|
1293
|
+
const [x, L] = await Promise.all([n.getItem(s), n.getItem(h)]);
|
|
1294
|
+
let y;
|
|
1295
1295
|
try {
|
|
1296
|
-
|
|
1296
|
+
y = x == null ? void 0 : l.parse(x);
|
|
1297
1297
|
} catch {
|
|
1298
1298
|
}
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1299
|
+
const _ = L == null ? void 0 : Number.parseInt(L, 10);
|
|
1300
|
+
y === void 0 ? !t.lazy && e !== void 0 && (y = typeof e == "function" ? e() : e, await n.setItem(s, l.stringify(y)), t.version != null && await n.setItem(h, String(t.version))) : t.version != null && _ !== void 0 && _ !== t.version && t.migrate && (y = t.migrate(y, _), await n.setItem(s, l.stringify(y)), await n.setItem(h, String(t.version))), p && y !== void 0 && f(y);
|
|
1301
1301
|
})(), () => {
|
|
1302
1302
|
p = !1;
|
|
1303
1303
|
};
|
|
1304
|
-
}, [n, s, h, t.version, t.migrate, t.lazy]),
|
|
1304
|
+
}, [n, s, h, t.version, t.migrate, t.lazy]), W(() => u(o, async () => {
|
|
1305
1305
|
const p = await n.getItem(s);
|
|
1306
1306
|
if (p != null) try {
|
|
1307
1307
|
f(l.parse(p));
|
|
@@ -1313,10 +1313,10 @@ function sr(o, e, t = uo) {
|
|
|
1313
1313
|
};
|
|
1314
1314
|
return [d, (p) => {
|
|
1315
1315
|
f((x) => {
|
|
1316
|
-
const
|
|
1316
|
+
const L = typeof p == "function" ? p(x) : p;
|
|
1317
1317
|
return c.current && clearTimeout(c.current), a > 0 ? c.current = setTimeout(() => {
|
|
1318
|
-
m(
|
|
1319
|
-
}, a) : m(
|
|
1318
|
+
m(L);
|
|
1319
|
+
}, a) : m(L), L;
|
|
1320
1320
|
});
|
|
1321
1321
|
}, () => {
|
|
1322
1322
|
if (c.current && clearTimeout(c.current), n.removeItem(s), n.removeItem(h), e !== void 0) {
|
|
@@ -1325,9 +1325,9 @@ function sr(o, e, t = uo) {
|
|
|
1325
1325
|
} else f(void 0);
|
|
1326
1326
|
}];
|
|
1327
1327
|
}
|
|
1328
|
-
const
|
|
1329
|
-
function
|
|
1330
|
-
const { store: e, namespace: t = "", serializer: n =
|
|
1328
|
+
const ho = {};
|
|
1329
|
+
function fr(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 Et() : e ?? new Et(), [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) {
|
|
@@ -1337,16 +1337,16 @@ function lr(o) {
|
|
|
1337
1337
|
m && (m.delete(h), m.size === 0 && d.delete(c));
|
|
1338
1338
|
};
|
|
1339
1339
|
} }), [u, t, n, r, i]);
|
|
1340
|
-
return
|
|
1340
|
+
return W(() => {
|
|
1341
1341
|
if (s.crossTabSync && s.store.subscribe) return s.store.subscribe((c) => {
|
|
1342
1342
|
if (!c.startsWith(s.namespace + ":")) return;
|
|
1343
1343
|
const h = c.slice(s.namespace.length + 1);
|
|
1344
1344
|
s.notify(h);
|
|
1345
1345
|
});
|
|
1346
|
-
}, [s]), P(
|
|
1346
|
+
}, [s]), P(dn.Provider, { value: s, children: a });
|
|
1347
1347
|
}
|
|
1348
|
-
const
|
|
1349
|
-
class
|
|
1348
|
+
const po = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
|
|
1349
|
+
class mr {
|
|
1350
1350
|
constructor(e = window.localStorage) {
|
|
1351
1351
|
this.storage = e;
|
|
1352
1352
|
}
|
|
@@ -1376,152 +1376,158 @@ class ar {
|
|
|
1376
1376
|
return window.addEventListener("storage", t), () => window.removeEventListener("storage", t);
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
|
-
const
|
|
1380
|
-
const { style: e, orientation: t =
|
|
1381
|
-
return P("button", { style: e, className:
|
|
1382
|
-
},
|
|
1383
|
-
const { style: e, orientation: t =
|
|
1384
|
-
return P("button", { style: e, className:
|
|
1385
|
-
},
|
|
1386
|
-
const { style: e, orientation: t =
|
|
1379
|
+
const ne = { Horizontal: "horizontal", Vertical: "vertical" }, xe = { 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
|
+
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(xe["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
|
+
}, _o = (o) => {
|
|
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(xe["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
|
+
}, _r = (o) => {
|
|
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
|
-
},
|
|
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 =
|
|
1390
|
-
if (!
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1393
|
-
}, onPointerMoveOrWait: (D, F,
|
|
1394
|
-
|
|
1395
|
-
}, onPointerUp: (D, F,
|
|
1396
|
-
|
|
1397
|
-
} }), [])), b =
|
|
1388
|
+
}, go = $e().supportsTouchEvents, _n = me(Ee((o, e) => {
|
|
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
|
+
if (!go) return null;
|
|
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) => {
|
|
1392
|
+
I(!0), _?.(D), D.preventDefault(), D.stopPropagation();
|
|
1393
|
+
}, onPointerMoveOrWait: (D, F, V) => {
|
|
1394
|
+
v?.(D);
|
|
1395
|
+
}, onPointerUp: (D, F, V) => {
|
|
1396
|
+
I(!1), B?.(V), D.preventDefault(), D.stopPropagation();
|
|
1397
|
+
} }), [])), b = R(() => {
|
|
1398
1398
|
const D = a / 2 + i / 2 + 6;
|
|
1399
|
-
return { x:
|
|
1400
|
-
}, [
|
|
1401
|
-
return
|
|
1402
|
-
const D =
|
|
1403
|
-
if (!D) return void
|
|
1404
|
-
let F = 0,
|
|
1405
|
-
for (;
|
|
1406
|
-
|
|
1407
|
-
}, [
|
|
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: A } = Fn(), [H, X] = q(null);
|
|
1401
|
+
return W(() => {
|
|
1402
|
+
const D = T.current?.getBoundingClientRect();
|
|
1403
|
+
if (!D) return void X(null);
|
|
1404
|
+
let F = 0, V = 0, Y = p;
|
|
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", xe["touch-thumb"], l, xe, { 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, A, L]), b ? pe(fe, { children: [P("div", { ref: Ae([C, T]), style: { position: "absolute", left: b.x, top: b.y, opacity: 0 } }), H] }) : null;
|
|
1408
1408
|
}));
|
|
1409
|
-
|
|
1410
|
-
const
|
|
1411
|
-
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: a, orientation: u =
|
|
1409
|
+
_n.displayName = "TouchThumbHandle";
|
|
1410
|
+
const yo = 24, vo = me(Ee((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, createScrollStartButton: x = mo, createScrollEndButton: L = _o, touchThumbProps: y, thumbProps: _, onMouseDown: v, ...B } = o, S = $e().primaryInput === "touch", O = c ?? !S;
|
|
1412
1412
|
k(s, [s]);
|
|
1413
|
-
const [
|
|
1414
|
-
if (
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1413
|
+
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C = u === ne.Vertical, [E, { width: $, height: T }] = Se(), g = C ? T : $, A = k((w, N, Z) => {
|
|
1414
|
+
if (N === 0 || Z === 0) {
|
|
1415
|
+
const Ge = { offset: 0, length: m, disabled: !0 };
|
|
1416
|
+
return M(Ge), Ge;
|
|
1417
|
+
}
|
|
1418
|
+
if (N >= Z) return { offset: 0, length: g, disabled: !0 };
|
|
1419
|
+
const ye = Z / g, ke = N / ye, ve = Math.min(Math.max(m, ke), Math.min(g, p ?? Number.MAX_SAFE_INTEGER)), ut = w / ye;
|
|
1420
|
+
return { offset: Math.min(Math.max(0, ut), g - ve), length: ve, disabled: !1 };
|
|
1421
|
+
}, [g, m, p]), H = k((w) => {
|
|
1422
|
+
const N = n / g, Z = Math.round(w * N);
|
|
1423
|
+
M(A(Z, r, n)), l?.(Z, r, n), b.current = w;
|
|
1424
|
+
}, [l, r, n, g, I]), X = k((w) => {
|
|
1425
|
+
M(A(w, r, n)), l?.(w, r, n), b.current = w;
|
|
1422
1426
|
}, [l, r, n]);
|
|
1423
|
-
|
|
1424
|
-
b.current !== t &&
|
|
1425
|
-
}, [t]),
|
|
1426
|
-
|
|
1427
|
-
}, [r, n, C,
|
|
1428
|
-
const D = Math.max(0, n - r), [F,
|
|
1429
|
-
|
|
1430
|
-
}, [C,
|
|
1431
|
-
|
|
1432
|
-
}, [
|
|
1427
|
+
W(() => {
|
|
1428
|
+
b.current !== t && g !== 0 && (b.current = -1, M(A(t, r, n)));
|
|
1429
|
+
}, [t]), W(() => {
|
|
1430
|
+
g !== 0 && M(A(t, r, n));
|
|
1431
|
+
}, [r, n, C, g]);
|
|
1432
|
+
const D = Math.max(0, n - r), [F, V] = q(!1), Y = K(0), ee = K(0), Me = Ct(e, () => ({ isScrollbar: () => !0 }), []), _e = k((w) => {
|
|
1433
|
+
V(!0), Y.current = C ? w.clientY : w.clientX, ee.current = I.offset;
|
|
1434
|
+
}, [C, I]), Le = k((w) => {
|
|
1435
|
+
w.currentTarget.setPointerCapture(w.pointerId), _e(w), w.stopPropagation();
|
|
1436
|
+
}, [v]), ge = k((w) => {
|
|
1433
1437
|
if (!F) return;
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
}, [F, C]),
|
|
1437
|
-
ge(
|
|
1438
|
-
}, []),
|
|
1439
|
-
|
|
1440
|
-
}, []),
|
|
1438
|
+
const N = (C ? w.clientY : w.clientX) - Y.current, Z = ee.current + N;
|
|
1439
|
+
H(Z);
|
|
1440
|
+
}, [F, C]), lt = k((w) => {
|
|
1441
|
+
ge(w);
|
|
1442
|
+
}, []), Ne = k((w) => {
|
|
1443
|
+
V(!1);
|
|
1444
|
+
}, []), at = k((w) => {
|
|
1441
1445
|
try {
|
|
1442
|
-
|
|
1446
|
+
w.currentTarget.releasePointerCapture(w.pointerId);
|
|
1443
1447
|
} catch {
|
|
1444
1448
|
}
|
|
1445
|
-
|
|
1446
|
-
}, []),
|
|
1447
|
-
if (!
|
|
1448
|
-
const
|
|
1449
|
-
|
|
1450
|
-
}, [C,
|
|
1451
|
-
const
|
|
1452
|
-
C ? (
|
|
1453
|
-
}, [C, r, n, t, D]), We =
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1449
|
+
Ne(w);
|
|
1450
|
+
}, []), Re = k((w) => {
|
|
1451
|
+
if (!w.currentTarget) return;
|
|
1452
|
+
const N = w.currentTarget.getBoundingClientRect(), Z = C ? w.clientY - N.top : w.clientX - N.left;
|
|
1453
|
+
H(Z);
|
|
1454
|
+
}, [C, I, r, n]), He = k((w) => {
|
|
1455
|
+
const N = Math.max(1, Math.floor(0.9 * r));
|
|
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), ct = R(() => {
|
|
1458
|
+
const w = I.disabled;
|
|
1459
|
+
if (w) return null;
|
|
1460
|
+
const N = P("div", { ..._, className: G(xe.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: Le, onPointerMove: lt, onPointerUp: at });
|
|
1461
|
+
return !S || w ? N : pe(fe, { children: [N, P(_n, { ...y, offset: I.offset, orientation: C ? ne.Vertical : ne.Horizontal, onPointerDown: _e, onPointerMove: ge, onPointerUp: Ne })] });
|
|
1462
|
+
}, [I, m, D, t, C, S, v, y, _]), [Ve, Fe] = q(null), je = k(() => {
|
|
1463
|
+
let w;
|
|
1464
|
+
w = typeof h == "function" ? h(t, r, n) : t - h;
|
|
1465
|
+
const N = Math.max(0, w);
|
|
1466
|
+
return X(N), Fe(N), N;
|
|
1461
1467
|
}, [h, t, r, n]), Ue = k(() => {
|
|
1462
|
-
let
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
return
|
|
1466
|
-
}, [h, t, D, r, n]), Ce =
|
|
1468
|
+
let w;
|
|
1469
|
+
w = typeof h == "function" ? h(t, r, n) : t + h;
|
|
1470
|
+
const N = Math.min(D, w);
|
|
1471
|
+
return X(N), Fe(N), N;
|
|
1472
|
+
}, [h, t, D, r, n]), Ce = K(null), ze = K(null), se = U(() => {
|
|
1467
1473
|
Ce.current && (clearTimeout(Ce.current), Ce.current = null, ze.current = null);
|
|
1468
|
-
}, []), Te = U((
|
|
1469
|
-
ze.current =
|
|
1470
|
-
const ke =
|
|
1471
|
-
ke !== ze.current ? Te(ke, !1,
|
|
1472
|
-
},
|
|
1473
|
-
}, [je, Ue,
|
|
1474
|
-
|
|
1475
|
-
const Xe =
|
|
1476
|
-
if (!
|
|
1477
|
-
const
|
|
1478
|
-
return x?.(
|
|
1479
|
-
}, [
|
|
1480
|
-
if (!
|
|
1481
|
-
const
|
|
1482
|
-
return
|
|
1483
|
-
}, [
|
|
1484
|
-
return pe("div", { ref: Ae([Me, e]), className:
|
|
1474
|
+
}, []), Te = U((w, N, Z, ye = d) => {
|
|
1475
|
+
ze.current = w, Ce.current = setTimeout(() => {
|
|
1476
|
+
const ke = Z ? je() : Ue();
|
|
1477
|
+
ke !== ze.current ? Te(ke, !1, Z, f) : se();
|
|
1478
|
+
}, N ? 0 : ye);
|
|
1479
|
+
}, [je, Ue, se]);
|
|
1480
|
+
W(() => () => se(), [se]);
|
|
1481
|
+
const Xe = R(() => {
|
|
1482
|
+
if (!O) return null;
|
|
1483
|
+
const w = { orientation: u, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => Te(t, !0, !0) };
|
|
1484
|
+
return x?.(w);
|
|
1485
|
+
}, [O, u, t, Ve]), Ye = R(() => {
|
|
1486
|
+
if (!O) return null;
|
|
1487
|
+
const w = { orientation: u, disabled: t >= D, onMouseUp: se, onMouseLeave: se, onMouseDown: () => Te(t, !0, !1) };
|
|
1488
|
+
return L?.(w);
|
|
1489
|
+
}, [O, u, t, D, Ve]), Be = C ? "vertical" : "horizontal";
|
|
1490
|
+
return pe("div", { ref: Ae([Me, e]), className: G(a, xe.scrollbar, Be, { dragging: F, "has-touch-thumb": S }), style: i, ...B, children: [Xe, P("div", { ref: E, role: "scrollbar", "aria-orientation": Be, "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, className: G(xe.track, "track", Be), onMouseDown: v, onPointerDown: Re, onKeyDown: He, children: ct }), Ye] });
|
|
1485
1491
|
}));
|
|
1486
|
-
let
|
|
1492
|
+
let Ft = Date.now, jt = 1e3, de = {}, bo = 1;
|
|
1487
1493
|
const Ie = (o) => {
|
|
1488
1494
|
let e = de[o] !== null;
|
|
1489
1495
|
return e && (de[o] = null), e;
|
|
1490
|
-
},
|
|
1491
|
-
let i =
|
|
1496
|
+
}, Ut = (o, e, t, n = 0, r) => {
|
|
1497
|
+
let i = Ft(), a = i, u = 0, l = 0, s = 0, c = bo++;
|
|
1492
1498
|
if (c % 20 == 0) {
|
|
1493
1499
|
const d = {};
|
|
1494
1500
|
for (let f in de) d[f] = !0;
|
|
1495
1501
|
de = d;
|
|
1496
1502
|
}
|
|
1497
1503
|
const h = function(d) {
|
|
1498
|
-
let f = d !== !0, m =
|
|
1504
|
+
let f = d !== !0, m = Ft(), p = !0;
|
|
1499
1505
|
try {
|
|
1500
1506
|
p = (!e || e(c)) ?? !0;
|
|
1501
1507
|
} catch {
|
|
1502
1508
|
p = !1;
|
|
1503
1509
|
}
|
|
1504
|
-
if (!de[c] || !p) return de[c] = null, void t?.(60 - l / ((m - i) /
|
|
1510
|
+
if (!de[c] || !p) return de[c] = null, void t?.(60 - l / ((m - i) / jt), c, !1);
|
|
1505
1511
|
if (f) {
|
|
1506
1512
|
s = Math.round((m - a) / 16.666666666666668) - 1;
|
|
1507
|
-
for (let
|
|
1513
|
+
for (let y = 0; y < Math.min(s, 4); y++) h(!0), l++;
|
|
1508
1514
|
}
|
|
1509
1515
|
n && (u = (m - i) / n, u > 1 && (u = 1));
|
|
1510
|
-
let x = r ? r(u) : u,
|
|
1516
|
+
let x = r ? r(u) : u, L = !1;
|
|
1511
1517
|
try {
|
|
1512
|
-
|
|
1518
|
+
L = o(x, m, f);
|
|
1513
1519
|
} catch {
|
|
1514
|
-
|
|
1520
|
+
L = !1;
|
|
1515
1521
|
}
|
|
1516
|
-
|
|
1522
|
+
L !== !1 && u !== 1 || !f ? f && (a = m, requestAnimationFrame(h)) : (de[c] = null, t?.(60 - l / ((m - i) / jt), c, u === 1 || n == null));
|
|
1517
1523
|
};
|
|
1518
1524
|
return de[c] = !0, requestAnimationFrame(h), c;
|
|
1519
1525
|
}, wo = function(o) {
|
|
1520
1526
|
return Math.pow(o - 1, 3) + 1;
|
|
1521
|
-
},
|
|
1527
|
+
}, xo = function(o) {
|
|
1522
1528
|
return (o /= 0.5) < 1 ? 0.5 * Math.pow(o, 3) : 0.5 * (Math.pow(o - 2, 3) + 2);
|
|
1523
1529
|
};
|
|
1524
|
-
class
|
|
1530
|
+
class So {
|
|
1525
1531
|
constructor(e, t) {
|
|
1526
1532
|
this.__isSingleTouch = !1, this.__isTracking = !1, this.__didDecelerationComplete = !1, this.__isGesturing = !1, this.__isDragging = !1, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = !1, this.__lastScale = 1, this.__enableScrollX = !0, this.__enableScrollY = !0, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = e, this.options = { scrollingX: !0, scrollingY: !0, animating: !0, animationDuration: 250, bouncing: !0, locking: !0, paging: !1, snapping: !1, zooming: !1, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...t };
|
|
1527
1533
|
}
|
|
@@ -1632,14 +1638,14 @@ class xo {
|
|
|
1632
1638
|
const i = this.__isAnimating;
|
|
1633
1639
|
if (i && (Ie(i), this.__isAnimating = 0), r && this.options.animating) {
|
|
1634
1640
|
this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
|
|
1635
|
-
const a = this.__scrollLeft, u = this.__scrollTop, l = this.__zoomLevel, s = e - a, c = t - u, h = n - l, d = function(p, x,
|
|
1636
|
-
|
|
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
|
+
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));
|
|
1637
1643
|
}.bind(this), f = function(p) {
|
|
1638
1644
|
return this.__isAnimating === p;
|
|
1639
|
-
}.bind(this), m = function(p, x,
|
|
1640
|
-
x === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete ||
|
|
1645
|
+
}.bind(this), m = function(p, x, L) {
|
|
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));
|
|
1641
1647
|
}.bind(this);
|
|
1642
|
-
this.__isAnimating =
|
|
1648
|
+
this.__isAnimating = Ut(d, f, m, this.options.animationDuration, i ? wo : xo);
|
|
1643
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));
|
|
1644
1650
|
}
|
|
1645
1651
|
__computeScrollMax(e = this.__zoomLevel) {
|
|
@@ -1658,7 +1664,7 @@ class xo {
|
|
|
1658
1664
|
}.bind(this), i = function(a, u, l) {
|
|
1659
1665
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1660
1666
|
}.bind(this);
|
|
1661
|
-
this.__isDecelerating =
|
|
1667
|
+
this.__isDecelerating = Ut(t, r, i);
|
|
1662
1668
|
}
|
|
1663
1669
|
__stepThroughDeceleration(e) {
|
|
1664
1670
|
let t = this.__scrollLeft + this.__decelerationVelocityX, n = this.__scrollTop + this.__decelerationVelocityY;
|
|
@@ -1674,7 +1680,7 @@ class xo {
|
|
|
1674
1680
|
}
|
|
1675
1681
|
}
|
|
1676
1682
|
}
|
|
1677
|
-
const Ke = (o, e) => P(
|
|
1683
|
+
const Ke = (o, e) => P(vo, { ...o, ref: e }), gr = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ke, getScrollTo: (o, e, t, n, r = 0) => {
|
|
1678
1684
|
for (let i = 0; i < t.length; i++) {
|
|
1679
1685
|
const a = t[i].getBoundingClientRect();
|
|
1680
1686
|
let u = a.left - e, l = u + a.width;
|
|
@@ -1683,124 +1689,124 @@ const Ke = (o, e) => P(yo, { ...o, ref: e }), ur = Object.freeze(Object.definePr
|
|
|
1683
1689
|
} else if (Math.ceil(l) > Math.ceil(o) + 2) return l;
|
|
1684
1690
|
}
|
|
1685
1691
|
return r;
|
|
1686
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1687
|
-
const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: a = !0, createScrollCorner: u =
|
|
1688
|
-
|
|
1692
|
+
} }, Symbol.toStringTag, { value: "Module" })), Eo = "_scrollpane_1fbi8_2", Mo = "_vertical-container_1fbi8_7", Lo = "_horizontal-corner-container_1fbi8_12", Co = "_horizontal-container_1fbi8_20", To = "_scrollbar-sizer_1fbi8_26", ko = "_scrollpane-content_1fbi8_34", Xt = "_scrollpane-content-element_1fbi8_43", Po = ({ width: o, height: e }) => P("div", { className: "corner", style: { minWidth: `${o}px`, width: `${o}px`, minHeight: `${e}px`, height: `${e}px` } }), Do = me(Ee((o, e) => {
|
|
1693
|
+
const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: a = !0, createScrollCorner: u = Po, createHorizontalScrollbar: l = Ke, createVerticalScrollbar: s = Ke, style: c, className: h, touchElement: d, disableTouch: f, ...m } = o, p = i && l, x = a && s, L = k(r, [r]), y = Ct(e, () => ({ isScrollPane: () => !0 }), []), _ = K(null);
|
|
1694
|
+
W(() => {
|
|
1689
1695
|
_.current && (_.current.__scrollTop === n?.top && _.current.__scrollLeft === n?.left || _.current.__isDecelerating || _.current?.scrollTo(n?.left, n?.top, !1));
|
|
1690
|
-
}, [n?.left, n?.top,
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1693
|
-
}, []),
|
|
1696
|
+
}, [n?.left, n?.top, d]);
|
|
1697
|
+
const v = U((g, A) => {
|
|
1698
|
+
L?.({ left: g, top: A });
|
|
1699
|
+
}, []), B = U((g) => {
|
|
1694
1700
|
_.current?.doTouchStart(g.touches, g.timeStamp);
|
|
1695
|
-
}, []),
|
|
1701
|
+
}, []), S = U((g) => {
|
|
1696
1702
|
g.preventDefault(), _.current?.doTouchMove(g.touches, g.timeStamp);
|
|
1697
|
-
}, []),
|
|
1703
|
+
}, []), O = U((g) => {
|
|
1698
1704
|
_.current?.doTouchEnd(g.timeStamp);
|
|
1699
|
-
}, []),
|
|
1700
|
-
_.current.setDimensions(g,
|
|
1705
|
+
}, []), I = U(({ containerWidth: g, containerHeight: A, totalWidth: H, totalHeight: X }) => {
|
|
1706
|
+
_.current.setDimensions(g, A, H, X);
|
|
1701
1707
|
}, []);
|
|
1702
|
-
|
|
1703
|
-
const g =
|
|
1704
|
-
if (!
|
|
1708
|
+
W(() => {
|
|
1709
|
+
const g = d ?? y.current;
|
|
1710
|
+
if (!f && $e().supportsTouchEvents && g && n) {
|
|
1705
1711
|
if (!_.current) {
|
|
1706
|
-
const
|
|
1707
|
-
_.current = new
|
|
1712
|
+
const A = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1713
|
+
_.current = new So(v, A);
|
|
1708
1714
|
}
|
|
1709
|
-
$e().supportsTouchEvents && (g.addEventListener("touchstart",
|
|
1715
|
+
$e().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 });
|
|
1710
1716
|
}
|
|
1711
1717
|
return () => {
|
|
1712
|
-
g?.removeEventListener("touchstart",
|
|
1718
|
+
g?.removeEventListener("touchstart", B), g?.removeEventListener("touchend", O), g?.removeEventListener("touchmove", S);
|
|
1713
1719
|
};
|
|
1714
|
-
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight,
|
|
1715
|
-
const [
|
|
1716
|
-
if (!
|
|
1717
|
-
const g = s({ orientation:
|
|
1718
|
-
|
|
1720
|
+
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, f, d]);
|
|
1721
|
+
const [M, { width: b }] = Se(), [C, { height: E }] = Se(), $ = R(() => {
|
|
1722
|
+
if (!x) return null;
|
|
1723
|
+
const g = s({ orientation: ne.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (A) => {
|
|
1724
|
+
L?.({ top: A });
|
|
1719
1725
|
} });
|
|
1720
|
-
return P("div", {
|
|
1721
|
-
}, [s, n?.top, n?.height, n?.totalHeight]),
|
|
1722
|
-
if (!
|
|
1723
|
-
const g = l({ orientation:
|
|
1724
|
-
|
|
1726
|
+
return P("div", { className: G("vertical-container", Mo), ref: M, children: g });
|
|
1727
|
+
}, [s, n?.top, n?.height, n?.totalHeight]), T = R(() => {
|
|
1728
|
+
if (!p) return null;
|
|
1729
|
+
const g = l({ orientation: ne.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (A) => {
|
|
1730
|
+
L?.({ left: A });
|
|
1725
1731
|
} });
|
|
1726
|
-
return pe("div", {
|
|
1727
|
-
}, [l, n?.left, n?.width, n?.totalWidth,
|
|
1728
|
-
return P("div", {
|
|
1732
|
+
return pe("div", { className: G("horizontal-corner-container", Lo), children: [P("div", { className: G("horizontal-container", Co), style: { width: `calc(100% - ${b}px)` }, children: P("div", { ref: C, className: G("scrollbar-sizer", To), children: g }) }), x ? u({ width: b, height: E }) : P(fe, {})] });
|
|
1733
|
+
}, [l, n?.left, n?.width, n?.totalWidth, x, u, b, E]);
|
|
1734
|
+
return P("div", { className: G(h, "scrollpane", Eo), style: { minWidth: x ? `${b}px` : void 0, minHeight: p ? `${E}px` : void 0, ...c }, ...m, ref: y, children: pe("div", { className: G("scrollpane-content", ko), children: [pe("div", { className: G("scrollpane-content-element", Xt), children: [P("div", { className: G("scrollpane-content-element", Xt), children: t }), x ? $ : P(fe, {})] }), p ? T : P(fe, {})] }) });
|
|
1729
1735
|
}));
|
|
1730
|
-
|
|
1731
|
-
const
|
|
1732
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a =
|
|
1736
|
+
Do.displayName = "ScrollPane";
|
|
1737
|
+
const Ao = 300, zo = 100, Bo = 1e6, Oo = 100, Io = 50, $o = me(Ee((o, e) => {
|
|
1738
|
+
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: a = Ao, endScrollIncrement: u = zo, style: l = tn, onMouseDown: s, onScrollOffset: c, onScroll: h, scaleLimit: d = Bo, scaleFactor: f = Oo, precisionFactor: m = Io, createScrollbar: p = Ke, ...x } = o;
|
|
1733
1739
|
h && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1734
|
-
const
|
|
1735
|
-
const
|
|
1736
|
-
return { offset: Math.ceil(t / b), totalSize:
|
|
1737
|
-
}, [t, r, n,
|
|
1738
|
-
const
|
|
1739
|
-
Math.abs(
|
|
1740
|
-
}, [c,
|
|
1741
|
-
}, []),
|
|
1742
|
-
document.removeEventListener("mousemove",
|
|
1743
|
-
}, []),
|
|
1744
|
-
|
|
1745
|
-
}, [
|
|
1746
|
-
return Ke({ style: l, ...x, offset:
|
|
1740
|
+
const L = k(s, [s]), [y, _] = q(!1), v = R(() => {
|
|
1741
|
+
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);
|
|
1742
|
+
return { offset: Math.ceil(t / b), totalSize: E, viewportSize: Math.ceil(n / b), scaledOffset: t, scaledTotalSize: r, scaledViewportSize: n, factor: b, precision: C };
|
|
1743
|
+
}, [t, r, n, y, i, a, u]), B = k((M, b, C) => {
|
|
1744
|
+
const E = v.offset;
|
|
1745
|
+
Math.abs(M - E) < v.precision && (M = E), c?.(M * v.factor, E, v.viewportSize);
|
|
1746
|
+
}, [c, v]), S = U((M) => {
|
|
1747
|
+
}, []), O = U((M) => {
|
|
1748
|
+
document.removeEventListener("mousemove", S), document.removeEventListener("mouseup", O), _(!1);
|
|
1749
|
+
}, []), I = U((M) => {
|
|
1750
|
+
_(!0), L?.(M), document.addEventListener("mousemove", S, { passive: !0 }), document.addEventListener("mouseup", O, { passive: !0 });
|
|
1751
|
+
}, [S, O]);
|
|
1752
|
+
return Ke({ style: l, ...x, offset: v.offset, totalSize: v.totalSize, viewportSize: v.viewportSize, onMouseDown: I, onScrollOffset: B }, e);
|
|
1747
1753
|
}));
|
|
1748
|
-
|
|
1754
|
+
$o.displayName = "VirtualScrollbar";
|
|
1749
1755
|
export {
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1756
|
+
vt as Command,
|
|
1757
|
+
Go as CommandButtonType,
|
|
1758
|
+
on as CommandGroup,
|
|
1759
|
+
ot as DefaultDynamicIconService,
|
|
1760
|
+
Nn as DefaultReactNotifier,
|
|
1761
|
+
co as DynamicIcon,
|
|
1762
|
+
hr as ErrorTestPanel,
|
|
1763
|
+
Zo as FocusKeyNavigation,
|
|
1764
|
+
Vo as HorizontalAlignment,
|
|
1765
|
+
Et as InMemoryStore,
|
|
1766
|
+
Fo as KeyCodes,
|
|
1767
|
+
Q as KeyModifiers,
|
|
1768
|
+
mr as LocalStorageStore,
|
|
1769
|
+
jo as MouseButtonCodes,
|
|
1770
|
+
Qo as NotifierProvider,
|
|
1771
|
+
Bt as NotifierType,
|
|
1772
|
+
fr as PersistenceStateProvider,
|
|
1773
|
+
cr as ReactErrorBoundary,
|
|
1774
|
+
Uo as ReactUtils,
|
|
1775
|
+
Jo as RoundedTab,
|
|
1776
|
+
Do as ScrollPane,
|
|
1777
|
+
gr as ScrollUtils,
|
|
1778
|
+
vo as Scrollbar,
|
|
1779
|
+
ne as ScrollbarOrientation,
|
|
1780
|
+
ft as SimpleCommand,
|
|
1781
|
+
io as SplitPane,
|
|
1782
|
+
ro as SplitPaneResizer,
|
|
1783
|
+
qo as ToolTipPlacement,
|
|
1784
|
+
ur as UncaughtErrorBoundary,
|
|
1785
|
+
$o as VirtualScrollbar,
|
|
1786
|
+
dr as WalkingIcon,
|
|
1787
|
+
lo as createDynamicIconService,
|
|
1788
|
+
Po as defaultCreateScrollCorner,
|
|
1789
|
+
_r as defaultCreateScrollEdgeButton,
|
|
1790
|
+
_o as defaultCreateScrollEndButton,
|
|
1791
|
+
mo as defaultCreateScrollStartButton,
|
|
1792
|
+
tr as getDevicePixelRatio,
|
|
1787
1793
|
Oe as toShortcutString,
|
|
1788
|
-
|
|
1794
|
+
Vn as useAnimatedMeasure,
|
|
1789
1795
|
k as useCallbackRef,
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1796
|
+
Xo as useCommand,
|
|
1797
|
+
Yo as useCommands,
|
|
1798
|
+
ir as useCopyPaste,
|
|
1799
|
+
er as useDevicePixelRatio,
|
|
1800
|
+
rr as useEditMode,
|
|
1801
|
+
Fn as useFullscreenPortal,
|
|
1802
|
+
qn as useGlobalClipboard,
|
|
1803
|
+
lr as useId,
|
|
1804
|
+
Ct as useImperativeElement,
|
|
1805
|
+
or as useMouseDownAndHoldListener,
|
|
1806
|
+
st as useNotifier,
|
|
1807
|
+
nr as useOnClickOrFocusAway,
|
|
1808
|
+
pr as usePersistenceState,
|
|
1809
|
+
ln as useSynchronizedPointerHandler,
|
|
1810
|
+
sr as useTraceUpdate,
|
|
1811
|
+
ar as useUndoManager
|
|
1806
1812
|
};
|