@sheetxl/utils-react 0.7.20 → 0.7.22
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/{BL4s9szmq3x4oxSh.cjs → O75UN37bxYdOt58p.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/index.mjs +685 -672
- package/browser/esm/{kV2Jq18kvUd9pmz5.mjs → r7vPXPCC6zFI-B4m.mjs} +1 -1
- package/node/esm/{DIUtMpFEGWd4fFvO.mjs → CJ8rg6a2gULy0991.mjs} +1 -1
- package/node/esm/index.mjs +623 -610
- package/package.json +2 -2
- package/types/index.d.ts +259 -183
package/browser/esm/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode("._fullscreen-portal-root_1mjsr_4{pointer-events:none;position:absolute;inset:0;width:100%;height:100%;z-index:1200}._fullscreen-portal-root_1mjsr_4>*{pointer-events:auto}:root{--icon-size-sm: calc(var(--icon-size, 1rem), * .875);--icon-size-md: var(--icon-size, 1rem);--icon-size-lg: calc(var(--icon-size, 1rem) * 1.25);--icon-size-xl: calc(var(--icon-size, 1rem) * 1.5)}._Icon_17dpm_10{font-size:var(--icon-size, var(--icon-size-md));min-width:var(--icon-size, var(--icon-size-md));min-height:var(--icon-size, var(--icon-size-md));--icon-stroke-em: .085em;--icon-color: currentColor;--icon-secondary-color: color-mix(in oklab, currentColor 65%, transparent);--icon-tertiary-color: color-mix(in oklab, currentColor 40%, transparent);--icon-line-color: currentColor;--icon-main-opacity: 1;--icon-secondary-opacity: .45;--icon-tertiary-opacity: .25;--icon-line-opacity: 1;--icon-filter: none;filter:var(--icon-filter);display:inline-flex;align-items:center;justify-content:center;line-height:1;vertical-align:middle;flex:0 0 auto}._Icon_17dpm_10 .sm{--font-size: var(--icon-size-sm)}._Icon_17dpm_10 .md{--font-size: var(--icon-size-md)}._Icon_17dpm_10 .lg{--font-size: var(--icon-size-lg)}._Icon_17dpm_10 .xl{--font-size: var(--icon-size-xl)}._Icon_17dpm_10>svg{width:var(--icon-size);height:var(--icon-size)}._Icon_17dpm_10>img{aspect-ratio:1 / 1;display:block;line-height:1}._Icon_17dpm_10 .fill,._Icon_17dpm_10 .line{--layer-color: var(--icon-color);--layer-opacity: var(--icon-main-opacity)}._Icon_17dpm_10 .secondary{--layer-color: var(--icon-secondary-color)}._Icon_17dpm_10 .tertiary{--layer-color: var(--icon-tertiary-color)}._Icon_17dpm_10 .primary{--layer-color: var(--sxl-app-color-primary, var(--icon-primary, #595b5e))}._Icon_17dpm_10 .secondary{--layer-color: var(--sxl-app-color-secondary, #9c27b0)}._Icon_17dpm_10 .secondary.light{--layer-color: var(--sxl-app-color-secondary-light, #a060ac)}._Icon_17dpm_10 .success{--layer-color: var(--sxl-app-color-success, #22c55e)}._Icon_17dpm_10 .success.light{--layer-color: var(--sxl-app-color-success-light, #22c55e)}._Icon_17dpm_10 .info{--layer-color: var(--sxl-app-color-info, #3b82f6)}._Icon_17dpm_10 .warn{--layer-color: var(--sxl-app-color-warn, #f59e0b)}._Icon_17dpm_10 .error{--layer-color: var(--sxl-app-color-error, #ef4444)}._Icon_17dpm_10 .error.light{--layer-color: var(--sxl-app-color-error-light, #f87171)}._Icon_17dpm_10 .grey{--layer-color: var(--sxl-app-color-grey, #cccccc)}._Icon_17dpm_10 .shadow{--layer-color: var(--sxl-app-color-shadow, #cccccc)}._Icon_17dpm_10 .fill:not(.fixed):not([fill]){fill:var(--layer-color);opacity:var(--layer-opacity);stroke:none}._Icon_17dpm_10 .line:not(.fixed):not([stroke]){fill:none;stroke:var(--layer-color, var(--icon-line-color));stroke-width:var(--icon-stroke-em);opacity:var(--layer-opacity, var(--icon-line-opacity));vector-effect:non-scaling-stroke;pointer-events:none;stroke-linecap:var(--icon-linecap, round);stroke-linejoin:var(--icon-linejoin, round);stroke-miterlimit:var(--icon-miter, 4)}@media (prefers-color-scheme: dark){._Icon_17dpm_10 .invert-dark{filter:invert(1) hue-rotate(180deg)}}._Icon_17dpm_10 .muted{opacity:calc(var(--layer-opacity, 1) * .6)}@keyframes _sxl-walk_17dpm_1{to{stroke-dashoffset:0}}.icon.walking .walkable.line{stroke-dasharray:var(--walk-dash-length, 5px) var(--walk-dash-gap, 2px);stroke-dashoffset:calc(var(--walk-dash-length, 5px) + var(--walk-dash-gap, 2px));animation:_sxl-walk_17dpm_1 var(--walk-duration, .96s) linear infinite;will-change:stroke-dashoffset}:root{--scrollbar-track-color: rgba(0,0,0,.06);--scrollbar-thumb-color: rgba(0,0,0,.35);--scrollbar-button-color: var(--scrollbar-thumb-color);--scrollbar-active-color: rgba(0,0,0,.55);--scrollbar-corner-color: transparent;--scrollbar-border-color: transparent}:root .has-touch-thumb,:root .has-touch-thumb *{--scrollbar-size: 4px;--scrollbar-border-width: 0px;--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size)}:root{--scrollbar-width: var(--scrollbar-size);--scrollbar-height: var(--scrollbar-size);--scrollbar-border-radius: 9999px;--scrollbar-border-width: 2px;--scrollbar-min-thumb-size: 24px}._scrollbar_gqxsx_24 ::-webkit-scrollbar-button{background:transparent}._scrollbar_gqxsx_24{display:flex;flex:1 1 100%;overflow:hidden;border-radius:var(--scrollbar-border-radius);align-items:center;border:var(--scrollbar-border-width) solid transparent}._scrollbar_gqxsx_24 ._track_gqxsx_35{background:var(--scrollbar-track-color);border-radius:var(--scrollbar-border-radius);position:relative;flex:1 1 100%;border:var(--scrollbar-border-width) solid transparent;touch-action:none;box-sizing:border-box;overflow:hidden}._scrollbar_gqxsx_24 ._thumb_gqxsx_47{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-border-radius);transition:background .12s;touch-action:none}._scrollbar_gqxsx_24 ._thumb_gqxsx_47:hover{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24.vertical{flex-direction:column;min-width:var(--scrollbar-width, 0px);max-width:var(--scrollbar-width, 100%)}._scrollbar_gqxsx_24.vertical ._thumb_gqxsx_47{min-height:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.vertical ._track_gqxsx_35{width:100%}._scrollbar_gqxsx_24.horizontal{flex-direction:row;min-height:var(--scrollbar-height, 0px);max-height:var(--scrollbar-height, 100%)}._scrollbar_gqxsx_24.horizontal ._thumb_gqxsx_47{min-width:var(--scrollbar-min-thumb-size)}._scrollbar_gqxsx_24.horizontal ._track_gqxsx_35{height:100%}._scrollbar_gqxsx_24.dragging ._thumb_gqxsx_47{background:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89{display:flex;align-items:center;justify-content:center;border:none;background:transparent;padding:0}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89>*{fill:var(--scrollbar-button-color);transition:fill .12s ease}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89:hover:not([disabled])>*{fill:var(--scrollbar-active-color)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89[disabled]>*{fill:var(--scrollbar-button-color);opacity:.5}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.vertical{width:var(--scrollbar-width)}._scrollbar_gqxsx_24 ._scrollbar-button_gqxsx_89.horizontal{height:var(--scrollbar-height)}._touch-thumb_gqxsx_124{position:absolute;cursor:grab;pointer-events:all;transition-property:opacity;border-radius:9999px;will-change:opacity;opacity:.7}._touch-thumb_gqxsx_124:hover,._touch-thumb_gqxsx_124.dragging{opacity:1}._scrollpane_1fbi8_2{position:relative;display:flex}._vertical-container_1fbi8_7{display:flex;flex:0}._horizontal-corner-container_1fbi8_12{display:flex;flex:none;flex-direction:row;align-items:stretch;justify-content:center}._horizontal-container_1fbi8_20{display:flex;flex:1 1 100%;flex-direction:column}._scrollbar-sizer_1fbi8_26{display:flex;flex:1 1 100%;align-items:stretch;justify-content:stretch}._scrollpane-content_1fbi8_34{position:relative;width:100%;flex:1 1 100%;display:flex;flex-direction:column;box-sizing:border-box}._scrollpane-content-element_1fbi8_43{display:flex;flex:1 1 100%;overflow:hidden}")),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import ae, { useRef as K, useReducer as Yt, useMemo as R, useEffect as W, useState as q, version as vn, memo as _e, forwardRef as Le, useCallback as U, useLayoutEffect as Mt, createContext as Gt, useContext as qt, createElement as bn, useImperativeHandle as wn, Component as xn } from "react";
|
|
3
|
+
import { CommonUtils as te, DefaultNotifier as Sn, Notifier as xe, InternalClipboard as rt, ClipboardUtils as pt, MimeType as ft } from "@sheetxl/utils";
|
|
4
4
|
import { jsx as P, jsxs as fe, Fragment as me } from "react/jsx-runtime";
|
|
5
5
|
import { createRoot as En } from "react-dom/client";
|
|
6
|
-
import { unstable_batchedUpdates as
|
|
6
|
+
import { unstable_batchedUpdates as Ln, createPortal as Mn } 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.22
|
|
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 $o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Q = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Ko = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, No = { Left: 1, Middle: 2, Right: 3 };
|
|
13
|
+
const $o = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, Q = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, Ko = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219, Composition: 229 }, No = { Left: 1, Middle: 2, Right: 3 };
|
|
14
14
|
class bt {
|
|
15
15
|
constructor(e, t, n, r) {
|
|
16
16
|
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = e, this._target = t, this._applyProps(n || {}), this._callback = r, r === void 0 && (this._callback = () => {
|
|
17
|
-
console.log(`implement: ${this.
|
|
17
|
+
console.log(`implement: ${this.getLabel()} : ${this.getDescription()}`);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
getKey() {
|
|
21
21
|
return this._key;
|
|
22
22
|
}
|
|
23
23
|
_resolve(e, t) {
|
|
@@ -27,10 +27,10 @@ class bt {
|
|
|
27
27
|
}
|
|
28
28
|
return e;
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
getTarget() {
|
|
31
31
|
return typeof this._target == "function" ? this._target() : this._target;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
getLabel(e, t) {
|
|
34
34
|
const n = this._scopedLabels?.[e] || this._label;
|
|
35
35
|
let r = null;
|
|
36
36
|
if (typeof n == "function") {
|
|
@@ -39,25 +39,25 @@ class bt {
|
|
|
39
39
|
} else r = n;
|
|
40
40
|
return r;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
getDescription(e) {
|
|
43
43
|
return this._resolve(this._description, e);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
getTags(e) {
|
|
46
46
|
return this._resolve(this._tags, e);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
getIcon(e) {
|
|
49
49
|
return this._resolve(this._icon, e);
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
getShortcut() {
|
|
52
52
|
return this._resolve(this._shortcut);
|
|
53
53
|
}
|
|
54
54
|
disabled() {
|
|
55
55
|
return this._resolve(this._disabled) || !this._callback;
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
getState() {
|
|
58
58
|
return this._resolve(this._state);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
getContext() {
|
|
61
61
|
return typeof this._context == "function" ? this._context() : this._context;
|
|
62
62
|
}
|
|
63
63
|
async execute(e, t) {
|
|
@@ -124,6 +124,34 @@ class bt {
|
|
|
124
124
|
}
|
|
125
125
|
class mt extends bt {
|
|
126
126
|
}
|
|
127
|
+
function Ro(o, e = null) {
|
|
128
|
+
const t = K(e);
|
|
129
|
+
t.current = e;
|
|
130
|
+
const [n, r] = Yt((c) => c + 1, 0), i = R(() => Array.isArray(o) ? o : [o], [o]);
|
|
131
|
+
return W(() => {
|
|
132
|
+
const c = i ? i.length : 0;
|
|
133
|
+
if (c === 0) return;
|
|
134
|
+
const h = (a, u) => {
|
|
135
|
+
t.current?.onChange?.(u), r();
|
|
136
|
+
};
|
|
137
|
+
let s = null;
|
|
138
|
+
e && (s = { onExecute(a, u) {
|
|
139
|
+
t.current?.onExecute?.(a, u);
|
|
140
|
+
}, onError(a, u, d) {
|
|
141
|
+
t.current?.onError?.(a, u, d);
|
|
142
|
+
} });
|
|
143
|
+
const l = /* @__PURE__ */ new Set();
|
|
144
|
+
for (let a = 0; a < c; a++) {
|
|
145
|
+
const u = i[a];
|
|
146
|
+
u && (l.add(u.addPropertyListener(te.debounce(h, 0), !0)), e && l.add(u.addExecuteListener(s)));
|
|
147
|
+
}
|
|
148
|
+
return () => {
|
|
149
|
+
l.forEach((a) => {
|
|
150
|
+
a?.();
|
|
151
|
+
});
|
|
152
|
+
};
|
|
153
|
+
}, [o]), n;
|
|
154
|
+
}
|
|
127
155
|
var re = typeof window < "u" ? window : { screen: {}, navigator: {} }, ze = (re.matchMedia || function() {
|
|
128
156
|
return { matches: !1 };
|
|
129
157
|
}).bind(re), Zt = !1, Cn = { get passive() {
|
|
@@ -136,7 +164,7 @@ const An = Object.freeze(Object.defineProperty({ __proto__: null, deviceType: wt
|
|
|
136
164
|
function Ke() {
|
|
137
165
|
return An;
|
|
138
166
|
}
|
|
139
|
-
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o),
|
|
167
|
+
const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.camelToPrettyCase(o), tt = (o, e) => {
|
|
140
168
|
let t = !1, n = !1;
|
|
141
169
|
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
170
|
t = !0, o.preventDefault();
|
|
@@ -146,16 +174,16 @@ const nn = (o) => o === "BracketLeft" ? "[" : o === "BracketRight" ? "]" : te.ca
|
|
|
146
174
|
}, timeStamp: o.timeStamp, type: o.type };
|
|
147
175
|
for (const i in o) i in r || typeof o[i] == "function" || (r[i] = o[i]);
|
|
148
176
|
return r;
|
|
149
|
-
},
|
|
177
|
+
}, Ho = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: tn, boundPixel: function(o, e = !1, t = 0) {
|
|
150
178
|
return o;
|
|
151
|
-
}, createSyntheticEvent:
|
|
179
|
+
}, createSyntheticEvent: tt, detectIt: Ke, focusableNodeNames: Bn, toPrettyKeyCode: nn }, Symbol.toStringTag, { value: "Module" }));
|
|
152
180
|
class on {
|
|
153
181
|
constructor(e, t) {
|
|
154
182
|
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
183
|
const n = this;
|
|
156
184
|
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (r, i) => {
|
|
157
|
-
const
|
|
158
|
-
|
|
185
|
+
const c = n._root._listenersByKey, h = i.getKey(), s = c.get(h);
|
|
186
|
+
s && n._notifyCommands(s, "onCommandChange", i);
|
|
159
187
|
};
|
|
160
188
|
}
|
|
161
189
|
_getCommand(e) {
|
|
@@ -170,19 +198,19 @@ class on {
|
|
|
170
198
|
createChildGroup(e, t, n) {
|
|
171
199
|
let r;
|
|
172
200
|
if (!n) {
|
|
173
|
-
let
|
|
174
|
-
for (;
|
|
175
|
-
let
|
|
176
|
-
|
|
201
|
+
let h = this;
|
|
202
|
+
for (; h && !r; ) {
|
|
203
|
+
let s = h._nodes.get(t);
|
|
204
|
+
s && (r = s), h = h._parent;
|
|
177
205
|
}
|
|
178
206
|
}
|
|
179
207
|
r || (r = new on(e, t), r._parent = this, r._root = this._root, r._unListenersByCommand = null, r._listenersByKey = null, r._commandsPropertyListener = null);
|
|
180
|
-
const i = (
|
|
181
|
-
!
|
|
208
|
+
const i = (h, s) => {
|
|
209
|
+
!h.has(t) || n ? h.set(t, s) : n === void 0 && console.warn("commandGroup already registered", t);
|
|
182
210
|
};
|
|
183
211
|
i(this._root._nodes, r);
|
|
184
|
-
let
|
|
185
|
-
for (;
|
|
212
|
+
let c = this._parent;
|
|
213
|
+
for (; c; ) i(this._nodes, r), c = c._parent;
|
|
186
214
|
return this._children.set(t, r), this._notify("onGroupChange"), r;
|
|
187
215
|
}
|
|
188
216
|
getKey() {
|
|
@@ -192,24 +220,24 @@ class on {
|
|
|
192
220
|
return this._nodes.get(e);
|
|
193
221
|
}
|
|
194
222
|
_addCommands(e, t = void 0) {
|
|
195
|
-
const n = this._commandsByKey, r = this._commandsByShortcut, i = this._root._commandsPropertyListener,
|
|
196
|
-
for (let
|
|
197
|
-
const l = e[
|
|
198
|
-
if (n.has(
|
|
199
|
-
t === void 0 && console.warn("command already registered",
|
|
223
|
+
const n = this._commandsByKey, r = this._commandsByShortcut, i = this._root._commandsPropertyListener, c = this._root._unListenersByCommand, h = e.length;
|
|
224
|
+
for (let s = 0; s < h; s++) {
|
|
225
|
+
const l = e[s], a = l.getKey();
|
|
226
|
+
if (n.has(a) && !t) {
|
|
227
|
+
t === void 0 && console.warn("command already registered", a);
|
|
200
228
|
continue;
|
|
201
229
|
}
|
|
202
|
-
n.set(
|
|
203
|
-
let
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
if (!
|
|
209
|
-
const
|
|
210
|
-
for (let
|
|
211
|
-
const
|
|
212
|
-
|
|
230
|
+
n.set(a, l);
|
|
231
|
+
let u = c.get(l);
|
|
232
|
+
u && (u(), c.delete(l));
|
|
233
|
+
const d = l.addPropertyListener(i);
|
|
234
|
+
c.set(l, d);
|
|
235
|
+
const p = l.getShortcut();
|
|
236
|
+
if (!p) continue;
|
|
237
|
+
const m = Array.isArray(p) ? p : [p], f = m.length;
|
|
238
|
+
for (let x = 0; x < f; x++) {
|
|
239
|
+
const S = Ie(m[x]), g = r.get(S);
|
|
240
|
+
g && !t && t === void 0 && console.warn(`Shortcut already registered: ${S}, ${a}, ${g}.`), r.set(S, a);
|
|
213
241
|
}
|
|
214
242
|
}
|
|
215
243
|
}
|
|
@@ -220,9 +248,10 @@ class on {
|
|
|
220
248
|
for (; e; ) t.push(e._nodes), e._nodes.delete(n), e = e._parent;
|
|
221
249
|
e = this._parent;
|
|
222
250
|
const r = (i) => {
|
|
223
|
-
i._children.forEach((
|
|
224
|
-
|
|
225
|
-
|
|
251
|
+
i._children.forEach((c) => {
|
|
252
|
+
const h = t.length, s = c._nodes;
|
|
253
|
+
for (let l = 0; l < h; l++) s.delete(t[l]);
|
|
254
|
+
r(c);
|
|
226
255
|
});
|
|
227
256
|
};
|
|
228
257
|
r(this), this._parent = null, this._notify("onGroupChange");
|
|
@@ -247,8 +276,8 @@ class on {
|
|
|
247
276
|
const r = this._commandsByShortcut;
|
|
248
277
|
let i = r.get(n);
|
|
249
278
|
i || (n = Ie({ key: e.key, modifiers: t }), i = r.get(n)), !i && e.code.startsWith("Digit") && (n = Ie({ key: e.code.substring(5, e.code.length), modifiers: t }), i = this._commandsByShortcut.get(n)), !i && e.code.startsWith("Key") && (i = Ie({ key: e.code.substring(3, e.code.length), modifiers: t }), i = r.get(n));
|
|
250
|
-
let
|
|
251
|
-
return i && (
|
|
279
|
+
let c = null;
|
|
280
|
+
return i && (c = this._commandsByKey.get(i), c && c.disabled() && (c = null), !c || c.getTarget() && c.getTarget().contains(e.target) || (c = null)), c || (this._parent?.findCommandByEvent(e) ?? null);
|
|
252
281
|
}
|
|
253
282
|
dispatchToFocusedCommand(e) {
|
|
254
283
|
const t = this.getActive();
|
|
@@ -265,16 +294,22 @@ class on {
|
|
|
265
294
|
addListener(e, t) {
|
|
266
295
|
const n = this._listeners, r = t?.keys, i = this._root._listenersByKey;
|
|
267
296
|
if (r && !e.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
268
|
-
let
|
|
269
|
-
if (r)
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
297
|
+
let c = null;
|
|
298
|
+
if (r) {
|
|
299
|
+
const h = r.length;
|
|
300
|
+
for (let s = 0; s < h; s++) {
|
|
301
|
+
const l = r[s];
|
|
302
|
+
if (!l) continue;
|
|
303
|
+
let a = i.get(l);
|
|
304
|
+
a || (a = /* @__PURE__ */ new Set(), i.set(l, a)), c || (c = []), c.push(a), a.add(e);
|
|
305
|
+
}
|
|
274
306
|
}
|
|
275
307
|
return n.add(e), () => {
|
|
276
|
-
if (
|
|
277
|
-
|
|
308
|
+
if (c) {
|
|
309
|
+
const h = c.length;
|
|
310
|
+
for (let s = 0; s < h; s++)
|
|
311
|
+
c[s].delete(e);
|
|
312
|
+
}
|
|
278
313
|
n.delete(e);
|
|
279
314
|
};
|
|
280
315
|
}
|
|
@@ -308,65 +343,40 @@ const On = te.getOS() === te.OSType.MacOS || te.getOS() === te.OSType.IOS ? "Cmd
|
|
|
308
343
|
for (let r = 0; o.modifiers && r < o.modifiers.length; r++) t[o.modifiers[r]] = !0;
|
|
309
344
|
let n = "";
|
|
310
345
|
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
|
-
}
|
|
312
|
-
function Ho(o, e = null) {
|
|
313
|
-
const t = K(e);
|
|
314
|
-
t.current = e;
|
|
315
|
-
const [n, r] = Yt((a) => a + 1, 0), i = R(() => Array.isArray(o) ? o : [o], [o]);
|
|
316
|
-
return W(() => {
|
|
317
|
-
if (!i || i.length === 0) return;
|
|
318
|
-
const a = (s, c) => {
|
|
319
|
-
t.current?.onChange?.(c), r();
|
|
320
|
-
};
|
|
321
|
-
let u = null;
|
|
322
|
-
e && (u = { onExecute(s, c) {
|
|
323
|
-
t.current?.onExecute?.(s, c);
|
|
324
|
-
}, onError(s, c, h) {
|
|
325
|
-
t.current?.onError?.(s, c, h);
|
|
326
|
-
} });
|
|
327
|
-
const l = /* @__PURE__ */ new Set();
|
|
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
|
-
return () => {
|
|
330
|
-
l.forEach((s) => {
|
|
331
|
-
s?.();
|
|
332
|
-
});
|
|
333
|
-
};
|
|
334
|
-
}, [o]), n;
|
|
335
|
-
}
|
|
336
|
-
const Je = (o, e) => {
|
|
346
|
+
}, Ze = (o, e) => {
|
|
337
347
|
if (!e || !o || e.length === 0) return te.EmptyArray;
|
|
338
348
|
const t = e.length, n = new Array(t);
|
|
339
349
|
for (let r = 0; r < t; r++) {
|
|
340
|
-
const i = e[r],
|
|
341
|
-
n[r] =
|
|
350
|
+
const i = e[r], c = i ? o.getCommand(i) : null;
|
|
351
|
+
n[r] = c;
|
|
342
352
|
}
|
|
343
353
|
return n;
|
|
344
354
|
};
|
|
345
355
|
function Wo(o, e = null, t = null, n) {
|
|
346
356
|
const r = K(t);
|
|
347
357
|
r.current = t, e && !Array.isArray(e) && (e = [e]);
|
|
348
|
-
const [i,
|
|
358
|
+
const [i, c] = q(Ze(o, e)), h = n ? [...n, o] : [o];
|
|
349
359
|
return W(() => {
|
|
350
|
-
const
|
|
351
|
-
const d =
|
|
352
|
-
|
|
360
|
+
const s = { onGroupChange: () => {
|
|
361
|
+
const d = Ze(o, e);
|
|
362
|
+
c(d), r.current?.onChange?.(this);
|
|
353
363
|
} };
|
|
354
|
-
let
|
|
355
|
-
e && e.length > 0 && (
|
|
356
|
-
r.current?.onChange?.(o),
|
|
364
|
+
let l;
|
|
365
|
+
e && e.length > 0 && (l = { keys: e }, s.onCommandChange = (d, p) => {
|
|
366
|
+
r.current?.onChange?.(o), c(Ze(o, e));
|
|
357
367
|
});
|
|
358
|
-
const
|
|
359
|
-
return
|
|
360
|
-
|
|
368
|
+
const a = o?.addListener(s, l), u = Ze(o, e);
|
|
369
|
+
return c(u), r.current?.onChange && r.current?.onChange(o), () => {
|
|
370
|
+
a?.();
|
|
361
371
|
};
|
|
362
|
-
},
|
|
372
|
+
}, h), i;
|
|
363
373
|
}
|
|
364
374
|
const Vo = { Toolbar: "toolbar", Menuitem: "menuitem" }, Fo = { BottomEnd: "bottom-end", BottomStart: "bottom-start", Bottom: "bottom", LeftEnd: "left-end", LeftStart: "left-start", Left: "left", RightEnd: "right-end", RightStart: "right-start", Right: "right", TopEnd: "top-end", TopStart: "top-start", Top: "top" };
|
|
365
375
|
function _t(o, e) {
|
|
366
376
|
if (typeof o == "function") return o(e);
|
|
367
377
|
o && (o.current = e);
|
|
368
378
|
}
|
|
369
|
-
var Ae = parseInt(
|
|
379
|
+
var Ae = parseInt(vn.split(".")[0], 10) >= 19 ? function(o) {
|
|
370
380
|
return (e) => {
|
|
371
381
|
const t = [];
|
|
372
382
|
for (const n of o) {
|
|
@@ -382,93 +392,93 @@ var Ae = parseInt(bn.split(".")[0], 10) >= 19 ? function(o) {
|
|
|
382
392
|
for (const t of o) _t(t, e);
|
|
383
393
|
};
|
|
384
394
|
};
|
|
385
|
-
const jo = _e(
|
|
395
|
+
const jo = _e(Le((o, e) => {
|
|
386
396
|
const { refFocusStart: t, ...n } = o, r = K(null), i = U(() => {
|
|
387
397
|
if (t) return void t?.current?.focus();
|
|
388
|
-
const
|
|
389
|
-
let
|
|
390
|
-
const
|
|
391
|
-
for (let
|
|
392
|
-
const
|
|
393
|
-
|
|
398
|
+
const c = r.current.parentElement.children;
|
|
399
|
+
let h = [];
|
|
400
|
+
const s = c.length;
|
|
401
|
+
for (let l = 0; l < s && c[l] !== r.current; l++) {
|
|
402
|
+
const a = c[l], u = a.getAttribute("tabindex");
|
|
403
|
+
u == null || u === "-1" || a.getAttribute("disabled") !== "true" && a.focus && h.push({ tabindex: parseInt(u), child: a });
|
|
394
404
|
}
|
|
395
|
-
|
|
396
|
-
return
|
|
397
|
-
}),
|
|
405
|
+
h.length !== 0 && (h.sort(function(l, a) {
|
|
406
|
+
return l.tabindex - a.tabindex;
|
|
407
|
+
}), h[0].child.focus());
|
|
398
408
|
}, [t]);
|
|
399
409
|
return P("div", { tabIndex: 0, ref: Ae([r, e]), onFocus: i, ...n });
|
|
400
410
|
}));
|
|
401
411
|
var $n = function() {
|
|
402
|
-
}, rn = typeof window < "u", Kn = rn ?
|
|
412
|
+
}, rn = typeof window < "u", Kn = rn ? Mt : W, Bt = { x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, bottom: 0, right: 0 };
|
|
403
413
|
const Ee = rn && window.ResizeObserver !== void 0 ? function() {
|
|
404
|
-
var o = q(null), e = o[0], t = o[1], n = q(Bt), r = n[0], i = n[1],
|
|
405
|
-
return new window.ResizeObserver(function(
|
|
406
|
-
if (
|
|
407
|
-
var
|
|
408
|
-
i({ x:
|
|
414
|
+
var o = q(null), e = o[0], t = o[1], n = q(Bt), r = n[0], i = n[1], c = R(function() {
|
|
415
|
+
return new window.ResizeObserver(function(h) {
|
|
416
|
+
if (h[0]) {
|
|
417
|
+
var s = h[0].contentRect, l = s.x, a = s.y, u = s.width, d = s.height, p = s.top, m = s.left, f = s.bottom, x = s.right;
|
|
418
|
+
i({ x: l, y: a, width: u, height: d, top: p, left: m, bottom: f, right: x });
|
|
409
419
|
}
|
|
410
420
|
});
|
|
411
421
|
}, []);
|
|
412
422
|
return Kn(function() {
|
|
413
|
-
if (e) return
|
|
414
|
-
|
|
423
|
+
if (e) return c.observe(e), function() {
|
|
424
|
+
c.disconnect();
|
|
415
425
|
};
|
|
416
426
|
}, [e]), [t, r];
|
|
417
427
|
} : function() {
|
|
418
428
|
return [$n, Bt];
|
|
419
|
-
}, Uo = _e(
|
|
420
|
-
const { className: t, style: n, children: r, radius: i = 4, strokeWidth:
|
|
421
|
-
const _ =
|
|
422
|
-
return (function(B,
|
|
423
|
-
if (
|
|
424
|
-
function I(T,
|
|
425
|
-
let H =
|
|
426
|
-
return M(T,
|
|
429
|
+
}, Uo = _e(Le((o, e) => {
|
|
430
|
+
const { className: t, style: n, children: r, radius: i = 4, strokeWidth: c = 1, strokeColor: h = "grey", ...s } = o, [l, { width: a, height: u }] = Ee(), d = K(null), p = (S, g = 0) => {
|
|
431
|
+
const _ = S / 2, v = u - _ + g;
|
|
432
|
+
return (function(B, E, O = !1) {
|
|
433
|
+
if (E === 0) return B;
|
|
434
|
+
function I(T, y, z) {
|
|
435
|
+
let H = y.x - T.x, X = y.y - T.y, D = Math.sqrt(H * H + X * X);
|
|
436
|
+
return M(T, y, Math.min(1, z / D));
|
|
427
437
|
}
|
|
428
|
-
function M(T,
|
|
429
|
-
return { x: T.x + (
|
|
438
|
+
function M(T, y, z) {
|
|
439
|
+
return { x: T.x + (y.x - T.x) * z, y: T.y + (y.y - T.y) * z };
|
|
430
440
|
}
|
|
431
|
-
function b(T,
|
|
432
|
-
T.length > 2 && (T[T.length - 2] =
|
|
441
|
+
function b(T, y) {
|
|
442
|
+
T.length > 2 && (T[T.length - 2] = y.x, T[T.length - 1] = y.y);
|
|
433
443
|
}
|
|
434
444
|
function C(T) {
|
|
435
445
|
return { x: parseFloat(T[T.length - 2]), y: parseFloat(T[T.length - 1]) };
|
|
436
446
|
}
|
|
437
|
-
let
|
|
438
|
-
let z =
|
|
439
|
-
return z ? (T.push(z[1]), T.push(z[2])) : T.push(
|
|
440
|
-
}, []).reduce(function(T,
|
|
441
|
-
return parseFloat(
|
|
447
|
+
let L = B.split(/[,\s]/).reduce(function(T, y) {
|
|
448
|
+
let z = y.match("([a-zA-Z])(.+)");
|
|
449
|
+
return z ? (T.push(z[1]), T.push(z[2])) : T.push(y), T;
|
|
450
|
+
}, []).reduce(function(T, y) {
|
|
451
|
+
return parseFloat(y) == y && T.length ? T[T.length - 1].push(y) : T.push([y]), T;
|
|
442
452
|
}, []), $ = [];
|
|
443
|
-
if (
|
|
444
|
-
let T = C(
|
|
445
|
-
|
|
446
|
-
for (let z = 1; z <
|
|
447
|
-
let H = $[$.length - 1], X =
|
|
453
|
+
if (L.length > 1) {
|
|
454
|
+
let T = C(L[0]), y = null;
|
|
455
|
+
L[L.length - 1][0] === "Z" && L[0].length > 2 && (y = ["L", T.x, T.y], L[L.length - 1] = y), $.push(L[0]);
|
|
456
|
+
for (let z = 1; z < L.length; z++) {
|
|
457
|
+
let H = $[$.length - 1], X = L[z], D = X === y ? L[1] : L[z + 1];
|
|
448
458
|
if (D && H && H.length > 2 && X[0] === "L" && D.length > 2 && D[0] === "L") {
|
|
449
|
-
let F, V, Y = C(H), ee = C(X),
|
|
450
|
-
O ? (F = M(ee, H.origPoint || Y,
|
|
459
|
+
let F, V, Y = C(H), ee = C(X), Me = C(D);
|
|
460
|
+
O ? (F = M(ee, H.origPoint || Y, E), V = M(ee, D.origPoint || Me, E)) : (F = I(ee, Y, E), V = I(ee, Me, E)), b(X, F), X.origPoint = ee, $.push(X);
|
|
451
461
|
let ge = M(F, ee, 0.5), Ce = M(ee, V, 0.5), ye = ["C", ge.x, ge.y, Ce.x, Ce.y, V.x, V.y];
|
|
452
462
|
ye.origPoint = ee, $.push(ye);
|
|
453
463
|
} else $.push(X);
|
|
454
464
|
}
|
|
455
|
-
if (
|
|
465
|
+
if (y) {
|
|
456
466
|
let z = C($[$.length - 1]);
|
|
457
467
|
$.push(["Z"]), b($[0], z);
|
|
458
468
|
}
|
|
459
|
-
} else $ =
|
|
460
|
-
return $.reduce(function(T,
|
|
461
|
-
return T +
|
|
469
|
+
} else $ = L;
|
|
470
|
+
return $.reduce(function(T, y) {
|
|
471
|
+
return T + y.join(" ") + " ";
|
|
462
472
|
}, "");
|
|
463
|
-
})(`${`M 0 ${_} L ${i - 0.5} ${_} L ${i - 0.5} ${v} L ${2 * i} ${v}`} ${`L ${
|
|
464
|
-
}, m = R(() =>
|
|
473
|
+
})(`${`M 0 ${_} L ${i - 0.5} ${_} L ${i - 0.5} ${v} L ${2 * i} ${v}`} ${`L ${a - 2 * i} ${v}`} ${`M ${a - 2 * i} ${v} L ${a - i} ${v} L ${a - i} ${_} L ${a} ${_}`}`, i);
|
|
474
|
+
}, m = R(() => p(c), [a, u, i, c]), f = R(() => {
|
|
465
475
|
if (i === 0) return;
|
|
466
|
-
const
|
|
467
|
-
return
|
|
468
|
-
}, [m, i,
|
|
469
|
-
return fe("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...
|
|
476
|
+
const S = i / 2;
|
|
477
|
+
return p(i) + `L ${a} 0 L 0 0 L 0 ${S}`;
|
|
478
|
+
}, [m, i, c]), x = R(() => ({ style: { clipPath: `path('${f}')` } }), [f]);
|
|
479
|
+
return fe("div", { className: t, style: { display: "flex", flexDirection: "row", ...n }, ...s, ref: Ae([d, l, e]), children: [ae.isValidElement(r) ? ae.cloneElement(r, x) : P(me, {}), P("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: a, height: u, viewBox: `0 0 ${a} ${u}`, children: P("path", { d: m, stroke: h, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: c }) })] });
|
|
470
480
|
})), Ot = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
471
|
-
class Nn extends
|
|
481
|
+
class Nn extends Sn {
|
|
472
482
|
setOverrides(e) {
|
|
473
483
|
super.setOverrides(e);
|
|
474
484
|
}
|
|
@@ -511,35 +521,35 @@ const sn = Gt(new Nn()), Xo = ({ children: o, notifier: e }) => (ae.useEffect(()
|
|
|
511
521
|
};
|
|
512
522
|
}, [e]), ae.createElement(sn.Provider, { value: e }, o)), lt = () => qt(sn), Rn = 3, Hn = 0.5, Wn = 50, gt = (o) => ({ x: o.x, y: o.y, width: o.width, height: o.height, top: o.top, left: o.left, right: o.right, bottom: o.bottom });
|
|
513
523
|
function Vn(o = {}) {
|
|
514
|
-
const { threshold: e = Hn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Wn } = o, [r, i] = Ee(),
|
|
515
|
-
|
|
516
|
-
}, [r]), [d,
|
|
524
|
+
const { threshold: e = Hn, stillnessThreshold: t = Rn, maxHierarchyDepth: n = Wn } = o, [r, i] = Ee(), c = K(null), [h, s] = Yt((m) => m + 1, 0), l = K(void 0), a = K({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), u = U((m) => {
|
|
525
|
+
c.current = m, typeof r == "function" && r(m);
|
|
526
|
+
}, [r]), [d, p] = q(i);
|
|
517
527
|
return W(() => {
|
|
518
|
-
i && !d &&
|
|
528
|
+
i && !d && p(i);
|
|
519
529
|
}, [i, d]), W(() => {
|
|
520
|
-
const m =
|
|
530
|
+
const m = c.current;
|
|
521
531
|
if (!m) return;
|
|
522
|
-
let
|
|
523
|
-
const
|
|
532
|
+
let f = !1, x = 0;
|
|
533
|
+
const S = () => {
|
|
524
534
|
if (!m) return;
|
|
525
|
-
const
|
|
526
|
-
Math.abs(
|
|
535
|
+
const E = m.getBoundingClientRect(), O = a.current;
|
|
536
|
+
Math.abs(E.x - O.x) > e || Math.abs(E.y - O.y) > e || Math.abs(E.width - O.width) > e || Math.abs(E.height - O.height) > e ? (f || (f = !0, p(gt(E)), s()), x = 0) : x++, f && x >= t && (f = !1, p(gt(E)), s()), a.current = gt(E), l.current = requestAnimationFrame(S);
|
|
527
537
|
};
|
|
528
|
-
|
|
529
|
-
const
|
|
530
|
-
|
|
531
|
-
}, _ = (
|
|
532
|
-
|
|
538
|
+
l.current = requestAnimationFrame(S);
|
|
539
|
+
const g = (E) => {
|
|
540
|
+
f = !0, s();
|
|
541
|
+
}, _ = (E) => {
|
|
542
|
+
f = !1, x = t, s();
|
|
533
543
|
};
|
|
534
544
|
let v = m;
|
|
535
545
|
const B = [];
|
|
536
|
-
for (; v && v !== document.documentElement && (v.addEventListener("animationstart",
|
|
546
|
+
for (; v && v !== document.documentElement && (v.addEventListener("animationstart", g, !0), v.addEventListener("animationend", _, !0), v.addEventListener("transitionstart", g, !0), v.addEventListener("transitionend", _, !0), B.push(v), v = v.parentElement, !(B.length > n)); ) ;
|
|
537
547
|
return () => {
|
|
538
|
-
|
|
539
|
-
|
|
548
|
+
l.current && cancelAnimationFrame(l.current), B.forEach((E) => {
|
|
549
|
+
E.removeEventListener("animationstart", g, !0), E.removeEventListener("animationend", _, !0), E.removeEventListener("transitionstart", g, !0), E.removeEventListener("transitionend", _, !0);
|
|
540
550
|
});
|
|
541
551
|
};
|
|
542
|
-
}, [
|
|
552
|
+
}, [h, i, e, t, n]), [u, d];
|
|
543
553
|
}
|
|
544
554
|
const k = (o, e) => {
|
|
545
555
|
const t = U((...i) => o?.(...i), e), n = K(null);
|
|
@@ -576,7 +586,7 @@ function qo(o, e, t) {
|
|
|
576
586
|
};
|
|
577
587
|
}, [o]);
|
|
578
588
|
}
|
|
579
|
-
let
|
|
589
|
+
let Je = 0;
|
|
580
590
|
function Fn() {
|
|
581
591
|
const [o, e] = q(!!document.fullscreenElement), t = U(() => {
|
|
582
592
|
const n = document.fullscreenElement;
|
|
@@ -589,54 +599,54 @@ function Fn() {
|
|
|
589
599
|
let i = r.querySelector(".fullscreen-portal-root");
|
|
590
600
|
i || (i = document.createElement("div"), i.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", r.appendChild(i));
|
|
591
601
|
}
|
|
592
|
-
return
|
|
593
|
-
document.removeEventListener("fullscreenchange", n),
|
|
602
|
+
return Je++, n(), document.addEventListener("fullscreenchange", n), () => {
|
|
603
|
+
document.removeEventListener("fullscreenchange", n), Je--, Je <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((r) => {
|
|
594
604
|
r.parentNode && r.parentNode.removeChild(r);
|
|
595
|
-
}),
|
|
605
|
+
}), Je = 0);
|
|
596
606
|
};
|
|
597
607
|
}, []), { getPortalContainer: t, isFullscreen: o };
|
|
598
608
|
}
|
|
599
609
|
function ln(o) {
|
|
600
610
|
if (!o) throw new Error("must have a PointerHandlerOptions");
|
|
601
|
-
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: r = !1, consumeTouch: i = !0 } = o,
|
|
602
|
-
|
|
603
|
-
}, []),
|
|
604
|
-
|
|
611
|
+
const { onPointerDown: e, onPointerUp: t, onPointerMoveOrWait: n, processTouch: r = !1, consumeTouch: i = !0 } = o, c = k(e, [e]), h = k(t, [t]), s = k(n, [n]), l = K(!1), a = o?.timerInitial ?? 230, u = o?.timerContinuous ?? a / 2, d = K(null), p = K(null), m = K(null), f = K(null), x = U(() => {
|
|
612
|
+
f.current && (clearTimeout(f.current), f.current = null);
|
|
613
|
+
}, []), S = U((b) => {
|
|
614
|
+
f.current = setTimeout(() => {
|
|
605
615
|
window.requestAnimationFrame(() => {
|
|
606
|
-
if (
|
|
607
|
-
const C =
|
|
608
|
-
|
|
609
|
-
}),
|
|
610
|
-
}, b ??
|
|
616
|
+
if (l.current === !1) return;
|
|
617
|
+
const C = p.current, L = d.current, $ = tt(C, L.currentTarget);
|
|
618
|
+
s?.($, m.current, L);
|
|
619
|
+
}), S(u);
|
|
620
|
+
}, b ?? a);
|
|
611
621
|
}, []);
|
|
612
622
|
W(() => () => x(), []);
|
|
613
|
-
const
|
|
623
|
+
const g = r ? "pointer" : "mouse", _ = U((b) => {
|
|
614
624
|
b.stopPropagation(), b.stopImmediatePropagation(), b.preventDefault();
|
|
615
625
|
}, []), v = k((b) => {
|
|
616
|
-
document.removeEventListener(`${
|
|
617
|
-
if (
|
|
618
|
-
|
|
619
|
-
const C = b,
|
|
620
|
-
|
|
626
|
+
document.removeEventListener(`${g}move`, O), document.removeEventListener(`${g}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(() => {
|
|
627
|
+
if (l.current === !1) return;
|
|
628
|
+
l.current = !1;
|
|
629
|
+
const C = b, L = d.current, $ = tt(C, L.currentTarget);
|
|
630
|
+
h?.($, m.current, L), m.current = null;
|
|
621
631
|
});
|
|
622
632
|
}, []), B = U(() => {
|
|
623
|
-
|
|
624
|
-
}, []),
|
|
625
|
-
x(),
|
|
626
|
-
if (
|
|
627
|
-
const b =
|
|
628
|
-
|
|
633
|
+
l.current !== !1 && (l.current = !1, v(p.current));
|
|
634
|
+
}, []), E = k(() => {
|
|
635
|
+
x(), S(u), window.requestAnimationFrame(() => {
|
|
636
|
+
if (l.current === !1) return;
|
|
637
|
+
const b = p.current, C = d.current, L = tt(b, C.currentTarget);
|
|
638
|
+
s?.(L, m.current, C);
|
|
629
639
|
});
|
|
630
|
-
}, [
|
|
631
|
-
|
|
640
|
+
}, [u]), O = k((b) => {
|
|
641
|
+
p.current = b, E();
|
|
632
642
|
}, []), I = k((b) => {
|
|
633
|
-
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey },
|
|
643
|
+
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, E();
|
|
634
644
|
}, []), M = k((b) => {
|
|
635
|
-
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey },
|
|
636
|
-
}, [
|
|
645
|
+
m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, E();
|
|
646
|
+
}, [u]);
|
|
637
647
|
return k((b) => {
|
|
638
|
-
b.isDefaultPrevented() || (m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey },
|
|
639
|
-
}, [
|
|
648
|
+
b.isDefaultPrevented() || (m.current = { ctrlKey: b.ctrlKey, shiftKey: b.shiftKey, altKey: b.altKey, metaKey: b.metaKey }, c(b, m.current) !== !1 && (d.current = b, p.current = b.nativeEvent, document.addEventListener(`${g}up`, v, { passive: !1 }), document.addEventListener(`${g}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 })), l.current = !0, S(a)));
|
|
649
|
+
}, [a, r]);
|
|
640
650
|
}
|
|
641
651
|
function Zo(o, e) {
|
|
642
652
|
return ln({ onPointerDown: o, onPointerMoveOrWait: (t, n, r) => {
|
|
@@ -647,48 +657,48 @@ const jn = ({ initValue: o, useHookBody: e, applyStateChange: t }) => {
|
|
|
647
657
|
const n = K(o);
|
|
648
658
|
if (typeof e != "function") throw new Error("function expected as hook body parameter. got " + typeof e);
|
|
649
659
|
const r = e();
|
|
650
|
-
return
|
|
660
|
+
return Mt(() => {
|
|
651
661
|
n.current !== r && (n.current = r, t(r));
|
|
652
662
|
}, [t, r]), null;
|
|
653
663
|
}, xt = (o) => {
|
|
654
664
|
console && console.warn && console.warn(o);
|
|
655
665
|
}, yt = typeof self == "object" && self.self === self && self || typeof global == "object" && global.global === global && global || void 0;
|
|
656
666
|
let Un = 1, St = !1, an = !1;
|
|
657
|
-
const
|
|
667
|
+
const nt = [], De = [], it = () => {
|
|
658
668
|
De.forEach((o) => o());
|
|
659
669
|
}, Xn = ({ automaticContainerInternalUseOnly: o }) => {
|
|
660
670
|
const [e, t] = q([]), n = K([]);
|
|
661
671
|
return n.current = e, o || St !== !1 || (an = !0), W(() => {
|
|
662
672
|
let r = !0;
|
|
663
673
|
function i() {
|
|
664
|
-
if (r) return De[0] !== i ? (o || St !== !0 || xt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((
|
|
674
|
+
if (r) return De[0] !== i ? (o || St !== !0 || xt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void t((c) => [])) : void t([...nt]);
|
|
665
675
|
}
|
|
666
|
-
return De.push(i),
|
|
667
|
-
r = !1, n.current?.length > 0 && xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), De.splice(De.indexOf(i), 1),
|
|
676
|
+
return De.push(i), it(), () => {
|
|
677
|
+
r = !1, n.current?.length > 0 && xt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), De.splice(De.indexOf(i), 1), it();
|
|
668
678
|
};
|
|
669
|
-
}, [o]), P(me, { children: e.map(({ hook: r, key: i }) =>
|
|
679
|
+
}, [o]), P(me, { children: e.map(({ hook: r, key: i }) => bn(jn, { ...r, key: i })) });
|
|
670
680
|
}, Yn = (o) => {
|
|
671
681
|
const e = Un++;
|
|
672
|
-
return
|
|
682
|
+
return nt.push({ hook: o, key: e }), De.length === 0 && an === !1 && (St = !0, ((t) => {
|
|
673
683
|
if (yt.document && yt.document.createElement) {
|
|
674
684
|
const n = yt.document.createElement("div");
|
|
675
685
|
En(n).render(P(t, { automaticContainerInternalUseOnly: !0 }));
|
|
676
686
|
} else xt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
677
|
-
})(Xn)),
|
|
678
|
-
|
|
687
|
+
})(Xn)), it(), () => {
|
|
688
|
+
nt.splice(nt.findIndex((t) => t.key === e), 1), it();
|
|
679
689
|
};
|
|
680
690
|
};
|
|
681
691
|
let Et = null;
|
|
682
692
|
Et || (Et = (o, e, t = {}) => {
|
|
683
|
-
let n, r, i = !1,
|
|
684
|
-
const
|
|
685
|
-
r =
|
|
686
|
-
},
|
|
693
|
+
let n, r, i = !1, c = !1, h = [], { unmountIfNoConsumers: s = !1 } = t;
|
|
694
|
+
const l = (u) => {
|
|
695
|
+
r = u, Ln(() => h.forEach((d) => d(u)));
|
|
696
|
+
}, a = () => (c || (r = typeof o == "function" ? o() : o, c = !0), r);
|
|
687
697
|
return () => {
|
|
688
|
-
const [
|
|
689
|
-
return W(() => (i || (i = !0, n = Yn({ initValue: o, useHookBody: e, applyStateChange:
|
|
690
|
-
|
|
691
|
-
}), []),
|
|
698
|
+
const [u, d] = q(a);
|
|
699
|
+
return W(() => (i || (i = !0, n = Yn({ initValue: o, useHookBody: e, applyStateChange: l })), h.push(d), r !== u && d(r), () => {
|
|
700
|
+
h.splice(h.indexOf(d), 1), h.length === 0 && s && (n(), i = !1);
|
|
701
|
+
}), []), u;
|
|
692
702
|
};
|
|
693
703
|
});
|
|
694
704
|
const cn = Et;
|
|
@@ -705,112 +715,112 @@ const Gn = cn(null, () => {
|
|
|
705
715
|
}, getMode: () => o }), [o]);
|
|
706
716
|
}, qn = cn({ setClipboard: (o) => {
|
|
707
717
|
throw new Error("This is only available via the useClipboard.");
|
|
708
|
-
}, getClipboard: () =>
|
|
709
|
-
const [o, e] = q(
|
|
718
|
+
}, getClipboard: () => rt.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
719
|
+
const [o, e] = q(rt.Global);
|
|
710
720
|
return { setClipboard: (t) => e(t), getClipboard: () => o, refNativeCopy: K(null), refNativeLastKey: K(null) };
|
|
711
721
|
}), Qo = (o) => {
|
|
712
|
-
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o,
|
|
722
|
+
const { source: e, target: t, onPaste: n, onClipboardUpdate: r, commands: i } = o, c = lt(), h = k(r, [r]), s = k(n, [n]), { getClipboard: l, refNativeCopy: a } = qn(), u = l();
|
|
713
723
|
R(() => {
|
|
714
|
-
const
|
|
724
|
+
const g = e?.element, _ = t?.element ?? e?.element;
|
|
715
725
|
if (!i) return;
|
|
716
|
-
const v = [new mt("cut",
|
|
726
|
+
const v = [new mt("cut", g, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [Q.Ctrl] } }), new mt("copy", g, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [Q.Ctrl] } }), new mt("paste", _, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [Q.Ctrl] }, { key: "F8", modifiers: [Q.Ctrl] }] })];
|
|
717
727
|
i?.addCommands(v, !0);
|
|
718
728
|
}, [i]);
|
|
719
|
-
const d = k(async (
|
|
729
|
+
const d = k(async (g) => {
|
|
720
730
|
if (!e?.element) return;
|
|
721
731
|
let _ = null;
|
|
722
732
|
try {
|
|
723
|
-
_ = e.doCopy?.(
|
|
733
|
+
_ = e.doCopy?.(g), typeof _ == "string" ? await u.writeText(_) : await u.writeReference(_);
|
|
724
734
|
} catch (v) {
|
|
725
735
|
throw v;
|
|
726
736
|
}
|
|
727
|
-
}, [e,
|
|
737
|
+
}, [e, c]), p = k(async (g) => {
|
|
728
738
|
const _ = e?.element?.();
|
|
729
739
|
if (_) {
|
|
730
|
-
|
|
740
|
+
a.current = { sourceElement: _, args: g };
|
|
731
741
|
try {
|
|
732
|
-
await d(
|
|
742
|
+
await d(g);
|
|
733
743
|
} catch (v) {
|
|
734
|
-
|
|
744
|
+
c.showError?.(v);
|
|
735
745
|
}
|
|
736
746
|
}
|
|
737
|
-
}, [e?.element,
|
|
738
|
-
|
|
739
|
-
}, []),
|
|
747
|
+
}, [e?.element, c]), m = U(() => {
|
|
748
|
+
p({ isCut: !0 });
|
|
749
|
+
}, []), f = k(async (g, _, v) => {
|
|
740
750
|
try {
|
|
741
|
-
if (await
|
|
742
|
-
|
|
751
|
+
if (await g.doPaste(_, v) === !1) return;
|
|
752
|
+
s?.(_, v);
|
|
743
753
|
} catch (B) {
|
|
744
|
-
|
|
754
|
+
c.showError?.(B);
|
|
745
755
|
}
|
|
746
|
-
}, [
|
|
756
|
+
}, [s]), x = k(async (g, _, v) => {
|
|
747
757
|
const B = t?.element?.();
|
|
748
|
-
if (B && await te.whenFocus(B), !
|
|
749
|
-
const
|
|
758
|
+
if (B && await te.whenFocus(B), !g && !_) return;
|
|
759
|
+
const E = await c.showBusy?.("Pasting...");
|
|
750
760
|
if (_) try {
|
|
751
|
-
return await
|
|
761
|
+
return await f(t, _, v), void E?.();
|
|
752
762
|
} catch (M) {
|
|
753
|
-
|
|
763
|
+
E?.(), c.showError?.(M);
|
|
754
764
|
}
|
|
755
765
|
let O, I = t.importFromExternal;
|
|
756
|
-
I || (I = (M, b) => ({ getItemType: () => "text", toText: () =>
|
|
766
|
+
I || (I = (M, b) => ({ getItemType: () => "text", toText: () => g.text, isClipboardItem: !0 }));
|
|
757
767
|
try {
|
|
758
|
-
O = await I(
|
|
768
|
+
O = await I(g, { isCut: !1 });
|
|
759
769
|
} catch (M) {
|
|
760
|
-
|
|
770
|
+
E?.(), c.showError?.(M);
|
|
761
771
|
}
|
|
762
772
|
if (O) try {
|
|
763
773
|
const M = await Promise.resolve(O);
|
|
764
|
-
await
|
|
774
|
+
await f(t, M, v), E?.();
|
|
765
775
|
} catch (M) {
|
|
766
|
-
|
|
776
|
+
E?.(), c.showError?.(M);
|
|
767
777
|
}
|
|
768
|
-
else
|
|
769
|
-
}, [
|
|
778
|
+
else E?.();
|
|
779
|
+
}, [f, t, c]), S = k(async (g) => {
|
|
770
780
|
if (t?.element) try {
|
|
771
|
-
const _ = await
|
|
772
|
-
if (_) return void await x(null, _,
|
|
781
|
+
const _ = await u.readReference();
|
|
782
|
+
if (_) return void await x(null, _, g);
|
|
773
783
|
const v = [];
|
|
774
|
-
v[0] = await pt.readStringFromClipboard(
|
|
784
|
+
v[0] = await pt.readStringFromClipboard(u, ft.plain), v[1] = await pt.readHTMLFromClipboard(u, ft.html), v[2] = await pt.readBlobFromClipboard(u, ft.png);
|
|
775
785
|
const B = { text: v[0] ?? null, html: v[1] ?? null, image: v[2] ?? null };
|
|
776
|
-
await x(B, null,
|
|
786
|
+
await x(B, null, g);
|
|
777
787
|
} catch (_) {
|
|
778
788
|
if (_?.message === "Document is not focused.") return;
|
|
779
|
-
|
|
789
|
+
c.showError?.(_);
|
|
780
790
|
}
|
|
781
|
-
}, [x, t?.element,
|
|
782
|
-
return k(async (
|
|
783
|
-
}, [e?.element]), k(async (
|
|
784
|
-
}, [t?.element, x,
|
|
785
|
-
if (!
|
|
786
|
-
const
|
|
787
|
-
const
|
|
788
|
-
|
|
791
|
+
}, [x, t?.element, c]);
|
|
792
|
+
return k(async (g) => {
|
|
793
|
+
}, [e?.element]), k(async (g) => {
|
|
794
|
+
}, [t?.element, x, c]), W(() => {
|
|
795
|
+
if (!u) return;
|
|
796
|
+
const g = async (B) => {
|
|
797
|
+
const E = await u.readReference();
|
|
798
|
+
h?.(E);
|
|
789
799
|
}, _ = (B) => {
|
|
790
|
-
|
|
800
|
+
c.showMessage?.(rt.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
791
801
|
}, v = (B) => {
|
|
792
|
-
|
|
802
|
+
c.showMessage?.(rt.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
793
803
|
};
|
|
794
|
-
return
|
|
795
|
-
|
|
804
|
+
return u.addEventListener("clipboardchange", g), u.addEventListener("clipboarderrorread", _), u.addEventListener("clipboarderrorwrite", v), () => {
|
|
805
|
+
u.removeEventListener("clipboardchange", g), u.removeEventListener("clipboarderrorread", _), u.removeEventListener("clipboarderrorwrite", v);
|
|
796
806
|
};
|
|
797
|
-
}, [
|
|
807
|
+
}, [u, c]), W(() => {
|
|
798
808
|
}, [d, x, e, t]), W(() => {
|
|
799
|
-
i?.getCommand("cut")?.updateCallback(m).update({ disabled: !e || !t }), i?.getCommand("copy")?.updateCallback(
|
|
800
|
-
}, [e, t, i]), { paste:
|
|
809
|
+
i?.getCommand("cut")?.updateCallback(m).update({ disabled: !e || !t }), i?.getCommand("copy")?.updateCallback(p).update({ disabled: !e }), i?.getCommand("paste")?.updateCallback(S).update({ disabled: !t });
|
|
810
|
+
}, [e, t, i]), { paste: S, copy: p, clipboard: u };
|
|
801
811
|
};
|
|
802
812
|
function er(o, e = !0) {
|
|
803
813
|
const t = K(o);
|
|
804
814
|
W(() => {
|
|
805
815
|
if (e) {
|
|
806
|
-
const n = Object.entries(o).reduce((r, [i,
|
|
816
|
+
const n = Object.entries(o).reduce((r, [i, c]) => (t.current[i] !== c && (r[i] = [t.current[i], c]), r), {});
|
|
807
817
|
Object.keys(n).length > 0 && console.log("Changed props:", n);
|
|
808
818
|
}
|
|
809
819
|
t.current = o;
|
|
810
820
|
});
|
|
811
821
|
}
|
|
812
822
|
let vt = !1, Zn = 0;
|
|
813
|
-
var Jn = typeof document < "u" ?
|
|
823
|
+
var Jn = typeof document < "u" ? Mt : W;
|
|
814
824
|
const It = () => "sheetxl-ui-" + Zn++, $t = ae.useId, tr = $t ?? function() {
|
|
815
825
|
const [o, e] = ae.useState(() => vt ? It() : void 0);
|
|
816
826
|
return Jn(() => {
|
|
@@ -821,54 +831,54 @@ const It = () => "sheetxl-ui-" + Zn++, $t = ae.useId, tr = $t ?? function() {
|
|
|
821
831
|
}, Qn = [];
|
|
822
832
|
function Tt(o, e, t = Qn) {
|
|
823
833
|
const n = K(null);
|
|
824
|
-
return
|
|
834
|
+
return wn(o, () => {
|
|
825
835
|
if (!n.current) return;
|
|
826
836
|
const r = n.current, i = e?.();
|
|
827
837
|
if (!i || typeof i != "object") throw new Error("attributes must return a plain object of values");
|
|
828
|
-
const
|
|
829
|
-
for (let
|
|
830
|
-
const
|
|
831
|
-
Object.defineProperty(r,
|
|
838
|
+
const c = Object.keys(i), h = c.length;
|
|
839
|
+
for (let s = 0; s < h; s++) {
|
|
840
|
+
const l = c[s], a = i[l];
|
|
841
|
+
Object.defineProperty(r, l, { value: a, writable: !0, configurable: !0, enumerable: !0 });
|
|
832
842
|
}
|
|
833
843
|
return r;
|
|
834
844
|
}, t), n;
|
|
835
845
|
}
|
|
836
846
|
const Kt = "Undo the last action.", Nt = "Repeat the last action or undo the redo.", eo = (o) => `Redo ${o}`, nr = ({ manager: o, commands: e, disabled: t }) => {
|
|
837
|
-
const n = lt(), r = k((
|
|
847
|
+
const n = lt(), r = k((c) => {
|
|
838
848
|
try {
|
|
839
|
-
o?.undo(
|
|
840
|
-
} catch (
|
|
841
|
-
n.error(
|
|
849
|
+
o?.undo(c);
|
|
850
|
+
} catch (h) {
|
|
851
|
+
n.error(h);
|
|
842
852
|
}
|
|
843
|
-
}, [o]), i = k((
|
|
853
|
+
}, [o]), i = k((c) => {
|
|
844
854
|
try {
|
|
845
|
-
o?.redo(
|
|
846
|
-
} catch (
|
|
847
|
-
n.error(
|
|
855
|
+
o?.redo(c);
|
|
856
|
+
} catch (h) {
|
|
857
|
+
n.error(h);
|
|
848
858
|
}
|
|
849
859
|
}, [o]);
|
|
850
860
|
return R(() => {
|
|
851
861
|
if (!e) return;
|
|
852
|
-
const
|
|
853
|
-
} },
|
|
854
|
-
e?.addCommands(
|
|
862
|
+
const c = { contains: (s) => !0, focus() {
|
|
863
|
+
} }, h = [new bt("undo", c, { label: "Undo", description: Kt, shortcut: { key: "z", modifiers: [Q.Ctrl] }, disabled: !0 }, r), new bt("redo", c, { label: "Redo", description: Nt, shortcut: [{ key: "y", modifiers: [Q.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [Q.Alt] }], disabled: !0 }, i)];
|
|
864
|
+
e?.addCommands(h, !0);
|
|
855
865
|
}, [e]), W(() => {
|
|
856
866
|
if (!e) return;
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
var
|
|
860
|
-
e.getCommand("undo").update({ disabled: t || !o || !o.hasUndo(), description:
|
|
861
|
-
const
|
|
862
|
-
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description:
|
|
867
|
+
const c = () => {
|
|
868
|
+
const s = o?.getTopUndoDescription(), l = {};
|
|
869
|
+
var a;
|
|
870
|
+
e.getCommand("undo").update({ disabled: t || !o || !o.hasUndo(), description: s ? (a = s, `Undo ${a}`) : Kt, state: l, context: { undoManager: o } });
|
|
871
|
+
const u = o?.getTopRedoDescription();
|
|
872
|
+
e.getCommand("redo").update({ disabled: t || !o || !o.hasRedo(), description: u ? eo(u) : Nt, state: l, context: { undoManager: o } });
|
|
863
873
|
};
|
|
864
|
-
if (
|
|
865
|
-
const
|
|
866
|
-
|
|
874
|
+
if (c(), !o) return;
|
|
875
|
+
const h = o.addListener({ onStackChange() {
|
|
876
|
+
c();
|
|
867
877
|
} });
|
|
868
|
-
return () =>
|
|
878
|
+
return () => h?.();
|
|
869
879
|
}, [o, e, t]), { undo: r, redo: i };
|
|
870
880
|
};
|
|
871
|
-
class to extends
|
|
881
|
+
class to extends xn {
|
|
872
882
|
static getDerivedStateFromError() {
|
|
873
883
|
return { hasError: !0 };
|
|
874
884
|
}
|
|
@@ -924,60 +934,60 @@ function G() {
|
|
|
924
934
|
return n;
|
|
925
935
|
}
|
|
926
936
|
const oo = {}, ro = (o) => {
|
|
927
|
-
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled:
|
|
928
|
-
return P("div", { style: { ...t, position: "relative" }, ...
|
|
929
|
-
},
|
|
937
|
+
const { onPointerDown: e, style: t, splitDirection: n, paddingBefore: r = 0, paddingAfter: i = 0, disabled: c, key: h, propsHitArea: s = oo, ...l } = o, a = n === "row", { style: u, className: d, ...p } = s;
|
|
938
|
+
return P("div", { style: { ...t, position: "relative" }, ...l, children: P("div", { className: G("hit-box", d), style: { left: (a ? -r : 0) + "px", width: `calc(100% + ${a ? r + i : 0}px)`, top: (a ? 0 : -r) + "px", height: `calc(100% + ${a ? 0 : r + i}px)`, position: "absolute", ...u }, onPointerDown: c ? void 0 : e, ...p }) }, h);
|
|
939
|
+
}, Qe = {}, we = (o, e, t = !0) => o === null ? null : o.pixels !== null ? t ? o.pixels : e - o.pixels : (t ? o.percent : 100 - o.percent) / 100 * e, et = (o, e = !0) => o?.percent ? `${e ? o.percent : 100 - o.percent}%` : o?.pixels ? `${o.pixels}px` : void 0, he = (o, e) => {
|
|
930
940
|
if (o == null) return null;
|
|
931
941
|
const t = { percent: null, pixels: null };
|
|
932
942
|
let n = e;
|
|
933
943
|
return typeof o == "string" && ((o = o.trim().toLowerCase()).endsWith("px") ? (o = o.substring(0, o.length - 2), n = !1) : o.endsWith("%") && (o = o.substring(0, o.length - 1), n = !0), o = parseFloat(o)), n ? t.percent = o : t.pixels = o, Object.freeze(t);
|
|
934
|
-
}, io = _e(
|
|
935
|
-
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position:
|
|
944
|
+
}, io = _e(Le((o, e) => {
|
|
945
|
+
const { elementBefore: t, elementAfter: n, splitDirection: r = "row", fixedPane: i = null, position: c, onPositionChange: h, minBefore: s, maxBefore: l, minAfter: a, maxAfter: u, children: d, className: p, style: m, disabled: f = !1, onDragStart: x, onDragResize: S, onDragFinish: g, propsResizer: _ = Qe, propsPane: v = Qe, propsPaneBefore: B = Qe, propsPaneAfter: E = Qe, renderResizer: O = ro } = o;
|
|
936
946
|
if (d) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
937
947
|
const I = R(() => ae.isValidElement(n) && ae.isValidElement(t), [n, t]), M = R(() => {
|
|
938
948
|
let A = null;
|
|
939
949
|
i && (i === "before" ? A = 0 : i === "after" && (A = 1));
|
|
940
950
|
const j = A === null;
|
|
941
|
-
return { fixedPaneOffset: A, isPercent: j, minBefore: he(
|
|
942
|
-
}, [
|
|
951
|
+
return { fixedPaneOffset: A, isPercent: j, minBefore: he(s, j), maxBefore: he(l, j), minAfter: he(a, j), maxAfter: he(u, j) };
|
|
952
|
+
}, [s, l, a, u]), b = k(h, [h]), [C, L] = q(() => he(c, i === null));
|
|
943
953
|
W(() => {
|
|
944
|
-
|
|
945
|
-
}, [
|
|
946
|
-
const [$, { width: T, height:
|
|
954
|
+
L(he(c, i === null));
|
|
955
|
+
}, [c, i]);
|
|
956
|
+
const [$, { width: T, height: y }] = Ee(), [z, { width: H, height: X }] = Ee(), D = r === "row" ? H : X, F = r === "row" ? T : y, V = R(() => ((A, j, oe, J) => {
|
|
947
957
|
const ce = [null, null], le = [null, null];
|
|
948
|
-
if (A || (A = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, le[1] = 100) : (ce[1] = A?.pixels - oe, le[0] = 100) : A?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = A?.percent, le[1] = 100 - A?.percent) : (le[1] = A?.percent, le[0] = 100 - A?.percent)), { percents: le, pixels: ce, minBefore:
|
|
949
|
-
let ue = we(A, j, J.fixedPaneOffset !== 1), ie = j - oe, kt = we(J.minBefore, ie, !0) ?? 0, gn = we(J.maxBefore, ie, !0) ?? ie,
|
|
950
|
-
|
|
958
|
+
if (A || (A = { percent: J.fixedPaneOffset === null ? 50 : null, pixels: J.fixedPaneOffset === null ? null : 0 }), j === 0) return A?.pixels != null ? J.fixedPaneOffset !== 1 ? (ce[0] = A?.pixels, le[1] = 100) : (ce[1] = A?.pixels - oe, le[0] = 100) : A?.percent != null && (J.fixedPaneOffset !== 1 ? (le[0] = A?.percent, le[1] = 100 - A?.percent) : (le[1] = A?.percent, le[0] = 100 - A?.percent)), { percents: le, pixels: ce, minBefore: et(J.minBefore, !0), maxBefore: et(J.maxBefore, !0), minAfter: et(J.minAfter), maxAfter: et(J.maxAfter) };
|
|
959
|
+
let ue = we(A, j, J.fixedPaneOffset !== 1), ie = j - oe, kt = we(J.minBefore, ie, !0) ?? 0, gn = we(J.maxBefore, ie, !0) ?? ie, qe = 0, dt = 0, Pt = 0, Dt = ie;
|
|
960
|
+
qe = (we(J.maxAfter, j, !1) ?? oe) - oe, dt = we(J.minAfter, j, !1) ?? j, Pt = Math.max(kt, qe), Dt = Math.min(gn, dt), ue = Math.max(Pt, Math.min(ue, Dt)), dt = Math.min(ie - ue, we(J.maxAfter, ie - ue, !0) ?? ie), qe = Math.min(ie - ue, we(J.minAfter, ie - ue, !0) ?? ie), ce[0] = ue, ce[1] = ie - ce[0];
|
|
951
961
|
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: `${kt}px`, minAfter: `${
|
|
953
|
-
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1),
|
|
962
|
+
return le[0] = yn, le[1] = 100 - le[0], { percents: le, pixels: ce, minBefore: `${kt}px`, minAfter: `${qe}px`, maxBefore: `${ce[0]}px`, maxAfter: `${ce[1]}px` };
|
|
963
|
+
})(C, F, D, M), [M, C, F, D, r]), [Y, ee] = q(!1), Me = k(x, [x]), ge = k(S, [S]), Ce = k(g, [g]), ye = K(null), at = K(null), Ne = K(null), { style: ct, className: Re, ...He } = v, We = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...ct }, { className: ut, style: Ve, ...Fe } = B, { className: je, style: Ue, ...Te } = E, Be = { flex: "1 1 100%", width: "100%", ...m, flexDirection: r, display: "flex" }, { className: se, style: ke, onPointerDown: Xe, ...Ye } = _, Oe = k((A) => {
|
|
954
964
|
const j = he(A, i === null);
|
|
955
|
-
|
|
965
|
+
L(j);
|
|
956
966
|
}, [i]), w = k((A) => {
|
|
957
|
-
if (
|
|
967
|
+
if (f || !Y) return;
|
|
958
968
|
const j = ve.current?.getBoundingClientRect();
|
|
959
969
|
let oe = 0;
|
|
960
|
-
oe = r === "row" ? (A.clientX ?? A.touches?.[0]?.clientX) - j.x : (A.clientY ?? A.touches?.[0]?.clientY) - j.y, oe = Math.max(0, Math.min(F, oe)), M.fixedPaneOffset === 1 && (oe = F - oe),
|
|
961
|
-
}, [M, r,
|
|
970
|
+
oe = r === "row" ? (A.clientX ?? A.touches?.[0]?.clientX) - j.x : (A.clientY ?? A.touches?.[0]?.clientY) - j.y, oe = Math.max(0, Math.min(F, oe)), M.fixedPaneOffset === 1 && (oe = F - oe), c && C.pixels === oe || L({ pixels: oe, percent: null }), ge?.(oe), A.stopPropagation(), A.preventDefault();
|
|
971
|
+
}, [M, r, f, Y, C, F]), N = k((A) => {
|
|
962
972
|
if (document.removeEventListener("pointermove", w), document.removeEventListener("touchmove", w), document.removeEventListener("pointerup", N), !!Y && (ee(!1), !!C)) {
|
|
963
|
-
if (Ce(C.pixels), !he(
|
|
973
|
+
if (Ce(C.pixels), !he(c, i === null) || C.pixels !== c) {
|
|
964
974
|
const j = { ...C };
|
|
965
975
|
j.percent === null && (j.percent = j.pixels / F * 100), b(j);
|
|
966
976
|
}
|
|
967
977
|
A.stopPropagation(), A.preventDefault();
|
|
968
978
|
}
|
|
969
|
-
}, [C, Y,
|
|
970
|
-
|
|
971
|
-
}, [
|
|
979
|
+
}, [C, Y, c, i, F]), Z = k((A) => {
|
|
980
|
+
Xe?.(A), A.defaultPrevented || f || Y || (ee(!0), Me(), document.addEventListener("pointermove", w, { passive: !1 }), document.addEventListener("touchmove", w, { passive: !1 }), document.addEventListener("pointerup", N, { passive: !1 }));
|
|
981
|
+
}, [Xe]), ve = Tt(e, () => ({ setPosition: Oe, isSplitPane: () => !0 }), []), Pe = R(() => I ? O?.({ key: "resizer", ref: Ae([z, at]), className: G("resizer", se), onPointerDownCapture: Z, style: { cursor: f ? void 0 : r === "row" ? "ew-resize" : "ns-resize", minWidth: r === "row" ? "2px" : void 0, minHeight: r !== "row" ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...ke }, splitDirection: r, disabled: f, ...Ye }) : null, [I, se, Ye, r, ke, f]), be = r === "row" ? "Width" : "Height", ht = R(() => {
|
|
972
982
|
if (!t) return null;
|
|
973
|
-
const A = { ...
|
|
974
|
-
return P("div", { ref: ye, className: G("before",
|
|
975
|
-
}, [t, v, B, M, V]),
|
|
983
|
+
const A = { ...We, ...Ve, flex: M.fixedPaneOffset === 0 && V?.pixels[0] !== null ? `0 0 ${Math.round(V?.pixels[0])}px` : `1 1 ${Math.round(V?.percents[0] ?? 100)}%`, [`min${be}`]: V?.minBefore, [`max${be}`]: n ? V?.maxBefore : "100%" };
|
|
984
|
+
return P("div", { ref: ye, className: G("before", Re, ut), style: A, ...He, ...Fe, children: t }, "before");
|
|
985
|
+
}, [t, v, B, M, V]), Ge = R(() => {
|
|
976
986
|
if (!n) return null;
|
|
977
|
-
const A = { ...
|
|
978
|
-
return P("div", { ref:
|
|
979
|
-
}, [n, v,
|
|
980
|
-
return fe("div", { ref: Ae([$, ve]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y },
|
|
987
|
+
const A = { ...We, ...Ue, flex: M.fixedPaneOffset === 1 && V?.pixels[1] !== null ? `0 0 ${Math.round(V?.pixels[1])}px` : `1 1 ${Math.round(V?.percents[1] ?? 100)}%`, [`min${be}`]: V?.minAfter, [`max${be}`]: t ? V?.maxAfter : "100%" };
|
|
988
|
+
return P("div", { ref: Ne, className: G("after", Re, je), style: A, ...He, ...Te, children: n }, "after");
|
|
989
|
+
}, [n, v, E, M, V]);
|
|
990
|
+
return fe("div", { ref: Ae([$, ve]), className: G("splitPane", r === "row" ? "vertical" : "horizontal", { dragging: Y }, p), style: Be, children: [ht, Pe, Ge] });
|
|
981
991
|
}));
|
|
982
992
|
function so(o) {
|
|
983
993
|
if (typeof o == "function") return o;
|
|
@@ -987,27 +997,27 @@ function so(o) {
|
|
|
987
997
|
const t = (function(n) {
|
|
988
998
|
const r = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(n.trim());
|
|
989
999
|
if (!r) return null;
|
|
990
|
-
const i = r[1] || "",
|
|
1000
|
+
const i = r[1] || "", c = r[2] || "";
|
|
991
1001
|
try {
|
|
992
1002
|
if (/;base64/i.test(i)) {
|
|
993
1003
|
if (typeof atob < "u") {
|
|
994
|
-
const
|
|
1004
|
+
const h = atob(c), s = h.length;
|
|
995
1005
|
if (typeof TextDecoder < "u") {
|
|
996
|
-
const
|
|
997
|
-
for (let
|
|
998
|
-
return new TextDecoder("utf-8").decode(
|
|
1006
|
+
const a = new Uint8Array(s);
|
|
1007
|
+
for (let u = 0; u < s; u++) a[u] = h.charCodeAt(u);
|
|
1008
|
+
return new TextDecoder("utf-8").decode(a);
|
|
999
1009
|
}
|
|
1000
|
-
let
|
|
1001
|
-
for (let
|
|
1002
|
-
|
|
1003
|
-
return decodeURIComponent(
|
|
1010
|
+
let l = "";
|
|
1011
|
+
for (let a = 0; a < s; a++)
|
|
1012
|
+
l += `%${h.charCodeAt(a).toString(16).padStart(2, "0")}`;
|
|
1013
|
+
return decodeURIComponent(l);
|
|
1004
1014
|
}
|
|
1005
|
-
return (globalThis.Buffer ? globalThis.Buffer.from(
|
|
1015
|
+
return (globalThis.Buffer ? globalThis.Buffer.from(c, "base64") : require("buffer").Buffer.from(c, "base64")).toString("utf-8");
|
|
1006
1016
|
}
|
|
1007
1017
|
try {
|
|
1008
|
-
return decodeURIComponent(
|
|
1018
|
+
return decodeURIComponent(c);
|
|
1009
1019
|
} catch {
|
|
1010
|
-
return
|
|
1020
|
+
return c;
|
|
1011
1021
|
}
|
|
1012
1022
|
} catch {
|
|
1013
1023
|
return null;
|
|
@@ -1057,23 +1067,23 @@ function Ht(o) {
|
|
|
1057
1067
|
function Wt(o) {
|
|
1058
1068
|
try {
|
|
1059
1069
|
if (typeof DOMParser < "u") {
|
|
1060
|
-
const
|
|
1061
|
-
return
|
|
1062
|
-
const
|
|
1063
|
-
if (!
|
|
1064
|
-
const d = { d:
|
|
1065
|
-
|
|
1066
|
-
const m =
|
|
1070
|
+
const c = new DOMParser().parseFromString(o, "image/svg+xml"), h = c.querySelector("svg"), s = h?.getAttribute("viewBox") ?? void 0, l = [];
|
|
1071
|
+
return c.querySelectorAll("path").forEach((a) => {
|
|
1072
|
+
const u = a.getAttribute("d");
|
|
1073
|
+
if (!u) return;
|
|
1074
|
+
const d = { d: u }, p = a.getAttribute("class");
|
|
1075
|
+
p && (d.className = p);
|
|
1076
|
+
const m = a.getAttribute("fill");
|
|
1067
1077
|
m && m !== "none" && (d.fill = m);
|
|
1068
|
-
const
|
|
1069
|
-
|
|
1070
|
-
const x =
|
|
1078
|
+
const f = a.getAttribute("stroke");
|
|
1079
|
+
f && (d.stroke = f);
|
|
1080
|
+
const x = a.getAttribute("opacity");
|
|
1071
1081
|
x && (d.opacity = Number(x));
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1075
|
-
|
|
1076
|
-
}), { viewBox:
|
|
1082
|
+
const S = a.getAttribute("fill-rule");
|
|
1083
|
+
S && (d.fillRule = S);
|
|
1084
|
+
const g = a.getAttribute("clip-rule");
|
|
1085
|
+
g && (d.clipRule = g), l.push(d);
|
|
1086
|
+
}), { viewBox: s, paths: l };
|
|
1077
1087
|
}
|
|
1078
1088
|
} catch {
|
|
1079
1089
|
}
|
|
@@ -1084,16 +1094,16 @@ function Wt(o) {
|
|
|
1084
1094
|
}
|
|
1085
1095
|
function Vt(o) {
|
|
1086
1096
|
const e = {};
|
|
1087
|
-
for (const [i,
|
|
1097
|
+
for (const [i, c] of Object.entries(o.icons)) e[i] = Ht(c);
|
|
1088
1098
|
const t = { label: o.meta?.label ?? "Unnamed", version: o.meta?.version ?? "1.0.0", license: o.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: o.meta?.extends ?? [] };
|
|
1089
1099
|
t.extends.includes("base") || t.extends.push("base");
|
|
1090
1100
|
const n = { meta: t, icons: e }, r = o.overrides;
|
|
1091
1101
|
if (r) {
|
|
1092
1102
|
const i = {};
|
|
1093
|
-
for (const [
|
|
1094
|
-
const
|
|
1095
|
-
for (const [
|
|
1096
|
-
i[
|
|
1103
|
+
for (const [c, h] of Object.entries(r)) {
|
|
1104
|
+
const s = {};
|
|
1105
|
+
for (const [l, a] of Object.entries(h)) s[l] = Ht(a);
|
|
1106
|
+
i[c] = s;
|
|
1097
1107
|
}
|
|
1098
1108
|
n.__overrides = i;
|
|
1099
1109
|
}
|
|
@@ -1102,159 +1112,159 @@ function Vt(o) {
|
|
|
1102
1112
|
function lo() {
|
|
1103
1113
|
const o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
|
|
1104
1114
|
let t = "base", n = /* @__PURE__ */ new Map();
|
|
1105
|
-
async function r(
|
|
1106
|
-
const
|
|
1107
|
-
if (!
|
|
1108
|
-
if (!
|
|
1109
|
-
if (!
|
|
1110
|
-
if (!
|
|
1111
|
-
|
|
1112
|
-
const
|
|
1113
|
-
|
|
1114
|
-
}).catch((
|
|
1115
|
-
throw
|
|
1115
|
+
async function r(s) {
|
|
1116
|
+
const l = o.get(s ?? t);
|
|
1117
|
+
if (!l) throw new Error(`Icon pack not registered: ${s}`);
|
|
1118
|
+
if (!l.pack) {
|
|
1119
|
+
if (!l.loading) {
|
|
1120
|
+
if (!l.loader) throw new Error(`No loader for icon pack: ${s}`);
|
|
1121
|
+
l.loading = l.loader().then((a) => {
|
|
1122
|
+
const u = a && typeof a == "object" && "default" in a ? a.default : a;
|
|
1123
|
+
l.pack = Vt(u);
|
|
1124
|
+
}).catch((a) => {
|
|
1125
|
+
throw l.loading = void 0, a;
|
|
1116
1126
|
});
|
|
1117
1127
|
}
|
|
1118
|
-
await
|
|
1128
|
+
await l.loading;
|
|
1119
1129
|
}
|
|
1120
1130
|
}
|
|
1121
|
-
function i(
|
|
1122
|
-
const
|
|
1123
|
-
return
|
|
1131
|
+
function i(s) {
|
|
1132
|
+
const l = s.indexOf(":");
|
|
1133
|
+
return l > 0 ? { ns: s.slice(0, l), key: s.slice(l + 1) } : { key: s };
|
|
1124
1134
|
}
|
|
1125
|
-
function
|
|
1126
|
-
const
|
|
1127
|
-
for (const
|
|
1128
|
-
const d = o.get(
|
|
1135
|
+
function c(s, l) {
|
|
1136
|
+
const a = [s, ...o.get(s)?.pack?.meta.extends ?? []];
|
|
1137
|
+
for (const u of a) {
|
|
1138
|
+
const d = o.get(u);
|
|
1129
1139
|
if (!d?.pack) continue;
|
|
1130
|
-
const { icons:
|
|
1131
|
-
if (m) return { glyph: m, pack: d.pack, packKey:
|
|
1140
|
+
const { icons: p } = d.pack, m = p[e.get(u)?.get(l) ?? l] ?? p[l];
|
|
1141
|
+
if (m) return { glyph: m, pack: d.pack, packKey: u };
|
|
1132
1142
|
}
|
|
1133
1143
|
return null;
|
|
1134
1144
|
}
|
|
1135
|
-
function
|
|
1136
|
-
const
|
|
1137
|
-
if (
|
|
1138
|
-
if (!
|
|
1139
|
-
const { ns:
|
|
1140
|
-
if (
|
|
1141
|
-
const
|
|
1142
|
-
if (
|
|
1145
|
+
function h(s, l) {
|
|
1146
|
+
const a = l?.packKey ?? t;
|
|
1147
|
+
if (l?.packKey) return c(l.packKey, s);
|
|
1148
|
+
if (!s) return null;
|
|
1149
|
+
const { ns: u, key: d } = i(s);
|
|
1150
|
+
if (u) {
|
|
1151
|
+
const p = o.get(u)?.pack;
|
|
1152
|
+
if (p) {
|
|
1143
1153
|
if (o.get(t)?.pack) {
|
|
1144
|
-
const
|
|
1145
|
-
if (x) return { glyph: x, pack:
|
|
1154
|
+
const f = p.__overrides, x = f?.[t]?.[d];
|
|
1155
|
+
if (x) return { glyph: x, pack: p, packKey: u };
|
|
1146
1156
|
}
|
|
1147
|
-
const m =
|
|
1157
|
+
const m = c(u, d);
|
|
1148
1158
|
if (m) return m;
|
|
1149
1159
|
}
|
|
1150
1160
|
return null;
|
|
1151
1161
|
}
|
|
1152
|
-
return a
|
|
1153
|
-
}
|
|
1154
|
-
return { register: function(
|
|
1155
|
-
const
|
|
1156
|
-
typeof
|
|
1157
|
-
}, prefetch: async function(
|
|
1158
|
-
const
|
|
1159
|
-
await Promise.all(
|
|
1160
|
-
}, setActive: function(
|
|
1161
|
-
t =
|
|
1162
|
-
for (const
|
|
1163
|
-
s
|
|
1162
|
+
return c(a, s);
|
|
1163
|
+
}
|
|
1164
|
+
return { register: function(s, l) {
|
|
1165
|
+
const a = o.get(s) ?? {};
|
|
1166
|
+
typeof l == "function" ? a.loader = l : a.pack = Vt(l), o.set(s, a), t || (t = s);
|
|
1167
|
+
}, prefetch: async function(s = t) {
|
|
1168
|
+
const l = Array.isArray(s) ? s : [s];
|
|
1169
|
+
await Promise.all(l.map(r));
|
|
1170
|
+
}, setActive: function(s) {
|
|
1171
|
+
t = s;
|
|
1172
|
+
for (const l of n.keys()) try {
|
|
1173
|
+
l(s);
|
|
1164
1174
|
} catch {
|
|
1165
1175
|
}
|
|
1166
1176
|
}, getActive: function() {
|
|
1167
1177
|
return t;
|
|
1168
|
-
}, resolve: async function(
|
|
1169
|
-
let
|
|
1170
|
-
if (
|
|
1171
|
-
const
|
|
1172
|
-
if (
|
|
1173
|
-
if (await r(
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1178
|
+
}, resolve: async function(s, l) {
|
|
1179
|
+
let a = h(s, l);
|
|
1180
|
+
if (a) return a;
|
|
1181
|
+
const u = l?.packKey ?? t, { ns: d } = i(s);
|
|
1182
|
+
if (l?.packKey) {
|
|
1183
|
+
if (await r(u), a = h(s, l), a) return a;
|
|
1184
|
+
const p = o.get(u)?.pack?.meta?.extends ?? [];
|
|
1185
|
+
if (p.length && (await Promise.all(p.map(r)), a = h(s, l), a)) return a;
|
|
1176
1186
|
} else if (d) {
|
|
1177
|
-
if (await r(d),
|
|
1178
|
-
const
|
|
1179
|
-
if (
|
|
1187
|
+
if (await r(d), a = h(s, l), a) return a;
|
|
1188
|
+
const p = o.get(d)?.pack?.meta?.extends ?? [];
|
|
1189
|
+
if (p.length && (await Promise.all(p.map(r)), a = h(s, l), a)) return a;
|
|
1180
1190
|
} else {
|
|
1181
|
-
if (await r(
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1191
|
+
if (await r(u), a = h(s, l), a) return a;
|
|
1192
|
+
const p = o.get(u)?.pack?.meta?.extends ?? [];
|
|
1193
|
+
if (p.length && (await Promise.all(p.map(r)), a = h(s, l), a)) return a;
|
|
1184
1194
|
}
|
|
1185
1195
|
return null;
|
|
1186
|
-
}, registerAlias: function(
|
|
1187
|
-
e.has(
|
|
1188
|
-
}, has: function(
|
|
1189
|
-
return !!
|
|
1190
|
-
}, getPack: function(
|
|
1191
|
-
return o.get(
|
|
1192
|
-
}, hasPack: function(
|
|
1193
|
-
return !!o.get(
|
|
1196
|
+
}, registerAlias: function(s, l, a) {
|
|
1197
|
+
e.has(s) || e.set(s, /* @__PURE__ */ new Map()), e.get(s).set(l, a);
|
|
1198
|
+
}, has: function(s, l) {
|
|
1199
|
+
return !!h(s, l);
|
|
1200
|
+
}, getPack: function(s) {
|
|
1201
|
+
return o.get(s ?? t)?.pack;
|
|
1202
|
+
}, hasPack: function(s) {
|
|
1203
|
+
return !!o.get(s)?.pack;
|
|
1194
1204
|
}, listPacks: function() {
|
|
1195
1205
|
return Array.from(o.keys());
|
|
1196
|
-
}, listIcons: function(
|
|
1197
|
-
const
|
|
1198
|
-
return
|
|
1199
|
-
}, addActiveListener: function(
|
|
1200
|
-
const
|
|
1201
|
-
if (
|
|
1202
|
-
const
|
|
1203
|
-
n.delete(
|
|
1206
|
+
}, listIcons: function(s) {
|
|
1207
|
+
const l = o.get(s)?.pack;
|
|
1208
|
+
return l ? Object.keys(l.icons) : [];
|
|
1209
|
+
}, addActiveListener: function(s) {
|
|
1210
|
+
const l = n.get(s);
|
|
1211
|
+
if (l) return l;
|
|
1212
|
+
const a = () => {
|
|
1213
|
+
n.delete(s);
|
|
1204
1214
|
};
|
|
1205
|
-
return n.set(
|
|
1215
|
+
return n.set(s, a), a;
|
|
1206
1216
|
} };
|
|
1207
1217
|
}
|
|
1208
1218
|
io.displayName = "SplitPane";
|
|
1209
|
-
const
|
|
1210
|
-
|
|
1219
|
+
const ot = lo();
|
|
1220
|
+
ot.register("base", () => import("./r7vPXPCC6zFI-B4m.mjs"));
|
|
1211
1221
|
const Ft = (o) => P("svg", { ...o, children: P("path", {}) }), ao = { Icon: "_Icon_17dpm_10" }, co = _e((o) => {
|
|
1212
|
-
const { iconKey: e, packKey: t, className: n, style: r, role: i, title:
|
|
1222
|
+
const { iconKey: e, packKey: t, className: n, style: r, role: i, title: c, size: h, ariaHidden: s, propsSource: l, children: a, ...u } = o, [d, p] = ae.useState(null);
|
|
1213
1223
|
ae.useEffect(() => {
|
|
1214
|
-
let
|
|
1224
|
+
let L = !0, $ = t, T = e;
|
|
1215
1225
|
if (!T) {
|
|
1216
|
-
const
|
|
1217
|
-
return void
|
|
1226
|
+
const y = ot.getPack($);
|
|
1227
|
+
return void p({ glyph: y ? { svg: te.EmptyArray } : void 0, pack: y ?? void 0, packKey: $ ?? ot.getActive() });
|
|
1218
1228
|
}
|
|
1219
1229
|
if (T.includes(":")) {
|
|
1220
|
-
const [
|
|
1221
|
-
$ =
|
|
1230
|
+
const [y, z] = T.split(":");
|
|
1231
|
+
$ = y, T = z;
|
|
1222
1232
|
}
|
|
1223
|
-
return
|
|
1224
|
-
|
|
1233
|
+
return ot.resolve(T, { packKey: $ }).then((y) => {
|
|
1234
|
+
L && p(y);
|
|
1225
1235
|
}), () => {
|
|
1226
|
-
|
|
1236
|
+
L = !1;
|
|
1227
1237
|
};
|
|
1228
1238
|
}, [e, t]);
|
|
1229
|
-
const m = d?.pack,
|
|
1230
|
-
let
|
|
1231
|
-
const
|
|
1232
|
-
const
|
|
1233
|
-
return
|
|
1234
|
-
}, [r, v]), O = i ?? (
|
|
1235
|
-
if (
|
|
1239
|
+
const m = d?.pack, f = d?.glyph, x = d?.packKey;
|
|
1240
|
+
let S = f ? f.svg : void 0;
|
|
1241
|
+
const g = f && !S ? f.url : void 0, _ = !f || S || g ? void 0 : f.emoji, v = h != null ? typeof h == "number" ? `${h}px` : h : void 0, B = R(() => [ao.Icon, "icon", n].filter(Boolean).join(" "), [n]), E = R(() => {
|
|
1242
|
+
const L = { ...r };
|
|
1243
|
+
return L["--icon-size"] = v, L;
|
|
1244
|
+
}, [r, v]), O = i ?? (c ? "img" : "presentation"), I = s ?? (!c || void 0), M = (L) => P("span", { className: B, style: E, role: O, "aria-hidden": I, title: c, "data-icon-glyph": e, "data-icon-pack": x, ...u, children: L });
|
|
1245
|
+
if (a) return M(a);
|
|
1236
1246
|
if (_) return M(P("span", { children: typeof _ == "string" ? _ : _.text }));
|
|
1237
|
-
if (
|
|
1238
|
-
if (
|
|
1239
|
-
const
|
|
1240
|
-
return M(P(
|
|
1241
|
-
}
|
|
1242
|
-
const b = { viewBox:
|
|
1243
|
-
if (typeof
|
|
1244
|
-
return M(
|
|
1245
|
-
if (!
|
|
1246
|
-
const C =
|
|
1247
|
-
return M(P("svg", { ...b, children: C ? C.map((
|
|
1247
|
+
if (g) return M(P("img", { src: g.src, alt: c ?? "" }));
|
|
1248
|
+
if (f && "react" in f) {
|
|
1249
|
+
const L = f.react, $ = { className: B, style: E, role: O, "aria-hidden": I, title: c, ...u, ...l };
|
|
1250
|
+
return M(P(L, { ...$ }));
|
|
1251
|
+
}
|
|
1252
|
+
const b = { viewBox: S?.viewBox ?? m?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1253
|
+
if (typeof S == "function")
|
|
1254
|
+
return M(S(b) ?? P(Ft, { ...b }));
|
|
1255
|
+
if (!S) return M(P(Ft, { ...b }));
|
|
1256
|
+
const C = S.paths;
|
|
1257
|
+
return M(P("svg", { ...b, children: C ? C.map((L, $) => P("path", { d: L.d, className: L.className, fill: L.fill, stroke: L.stroke, opacity: L.opacity, fillRule: L.fillRule, clipRule: L.clipRule }, $)) : null }));
|
|
1248
1258
|
});
|
|
1249
1259
|
function sr(o) {
|
|
1250
|
-
const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: r = 3, dashLength: i = 5, iconKey:
|
|
1260
|
+
const { isWalking: e = !1, themedType: t = "info", speed: n = 120, dashGap: r = 3, dashLength: i = 5, iconKey: c, packKey: h, style: s, className: l, ...a } = o, u = R(() => {
|
|
1251
1261
|
if (!e) return;
|
|
1252
|
-
const
|
|
1253
|
-
return t && t !== "accent" && (
|
|
1254
|
-
}, [e, n, r, i, t]), d = R(() => e ?
|
|
1255
|
-
return P(co, { iconKey:
|
|
1262
|
+
const p = { "--walk-duration": `${n * (r + i)}ms`, "--walk-dash-length": `${i}px`, "--walk-dash-gap": `${r}px` };
|
|
1263
|
+
return t && t !== "accent" && (p["--icon-accent"] = `var(--icon-${t})`), p;
|
|
1264
|
+
}, [e, n, r, i, t]), d = R(() => e ? l + " walking" : l, [e, l]);
|
|
1265
|
+
return P(co, { iconKey: c, packKey: h, className: d, style: { ...s, ...u }, ...a });
|
|
1256
1266
|
}
|
|
1257
|
-
class
|
|
1267
|
+
class Lt {
|
|
1258
1268
|
constructor() {
|
|
1259
1269
|
this.store = /* @__PURE__ */ new Map();
|
|
1260
1270
|
}
|
|
@@ -1268,82 +1278,82 @@ class Mt {
|
|
|
1268
1278
|
this.store.delete(e);
|
|
1269
1279
|
}
|
|
1270
1280
|
}
|
|
1271
|
-
const dn = Gt(null), pn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, uo = { store: new
|
|
1281
|
+
const dn = Gt(null), pn = { parse: (o) => o ? JSON.parse(o) : null, stringify: JSON.stringify }, uo = { store: new Lt(), namespace: "", serializer: pn, debounceMs: 0, crossTabSync: !1, notify: () => {
|
|
1272
1282
|
}, subscribeKey: () => () => {
|
|
1273
1283
|
} };
|
|
1274
1284
|
function lr(o, e, t = ho) {
|
|
1275
|
-
const { store: n, namespace: r, serializer: i, debounceMs:
|
|
1276
|
-
let
|
|
1285
|
+
const { store: n, namespace: r, serializer: i, debounceMs: c, subscribeKey: h } = qt(dn) || uo, s = t.serializer ?? i ?? pn, l = R(() => `${r}:${o}`, [r, o]), a = K(null), u = `${l}::v`, [d, p] = q(() => {
|
|
1286
|
+
let f;
|
|
1277
1287
|
try {
|
|
1278
|
-
if (typeof window < "u" && "localStorage" in window &&
|
|
1279
|
-
const x = window.localStorage?.getItem(
|
|
1280
|
-
x != null && (
|
|
1288
|
+
if (typeof window < "u" && "localStorage" in window && l.startsWith(r)) {
|
|
1289
|
+
const x = window.localStorage?.getItem(l) ?? null;
|
|
1290
|
+
x != null && (f = s.parse(x));
|
|
1281
1291
|
}
|
|
1282
1292
|
} catch {
|
|
1283
1293
|
}
|
|
1284
|
-
if (
|
|
1294
|
+
if (f === void 0) {
|
|
1285
1295
|
const x = e;
|
|
1286
1296
|
return typeof x == "function" ? x() : x;
|
|
1287
1297
|
}
|
|
1288
|
-
return
|
|
1298
|
+
return f;
|
|
1289
1299
|
});
|
|
1290
1300
|
W(() => {
|
|
1291
|
-
let
|
|
1301
|
+
let f = !0;
|
|
1292
1302
|
return (async () => {
|
|
1293
|
-
const [x,
|
|
1294
|
-
let
|
|
1303
|
+
const [x, S] = await Promise.all([n.getItem(l), n.getItem(u)]);
|
|
1304
|
+
let g;
|
|
1295
1305
|
try {
|
|
1296
|
-
|
|
1306
|
+
g = x == null ? void 0 : s.parse(x);
|
|
1297
1307
|
} catch {
|
|
1298
1308
|
}
|
|
1299
|
-
const _ =
|
|
1300
|
-
|
|
1309
|
+
const _ = S == null ? void 0 : Number.parseInt(S, 10);
|
|
1310
|
+
g === void 0 ? !t.lazy && e !== void 0 && (g = typeof e == "function" ? e() : e, await n.setItem(l, s.stringify(g)), t.version != null && await n.setItem(u, String(t.version))) : t.version != null && _ !== void 0 && _ !== t.version && t.migrate && (g = t.migrate(g, _), await n.setItem(l, s.stringify(g)), await n.setItem(u, String(t.version))), f && g !== void 0 && p(g);
|
|
1301
1311
|
})(), () => {
|
|
1302
|
-
|
|
1312
|
+
f = !1;
|
|
1303
1313
|
};
|
|
1304
|
-
}, [n,
|
|
1305
|
-
const
|
|
1306
|
-
if (
|
|
1307
|
-
|
|
1314
|
+
}, [n, l, u, t.version, t.migrate, t.lazy]), W(() => h(o, async () => {
|
|
1315
|
+
const f = await n.getItem(l);
|
|
1316
|
+
if (f != null) try {
|
|
1317
|
+
p(s.parse(f));
|
|
1308
1318
|
} catch {
|
|
1309
1319
|
}
|
|
1310
|
-
}), [n,
|
|
1311
|
-
const m = async (
|
|
1312
|
-
await n.setItem(
|
|
1320
|
+
}), [n, l, h, o]);
|
|
1321
|
+
const m = async (f) => {
|
|
1322
|
+
await n.setItem(l, s.stringify(f)), t.version != null && await n.setItem(u, String(t.version));
|
|
1313
1323
|
};
|
|
1314
|
-
return [d, (
|
|
1315
|
-
|
|
1316
|
-
const
|
|
1317
|
-
return
|
|
1318
|
-
m(
|
|
1319
|
-
},
|
|
1324
|
+
return [d, (f) => {
|
|
1325
|
+
p((x) => {
|
|
1326
|
+
const S = typeof f == "function" ? f(x) : f;
|
|
1327
|
+
return a.current && clearTimeout(a.current), c > 0 ? a.current = setTimeout(() => {
|
|
1328
|
+
m(S);
|
|
1329
|
+
}, c) : m(S), S;
|
|
1320
1330
|
});
|
|
1321
1331
|
}, () => {
|
|
1322
|
-
if (
|
|
1323
|
-
const
|
|
1324
|
-
f
|
|
1325
|
-
} else
|
|
1332
|
+
if (a.current && clearTimeout(a.current), n.removeItem(l), n.removeItem(u), e !== void 0) {
|
|
1333
|
+
const f = typeof e == "function" ? e() : e;
|
|
1334
|
+
p(f);
|
|
1335
|
+
} else p(void 0);
|
|
1326
1336
|
}];
|
|
1327
1337
|
}
|
|
1328
1338
|
const ho = {};
|
|
1329
1339
|
function ar(o) {
|
|
1330
|
-
const { store: e, namespace: t = "", serializer: n = po, debounceMs: r = 0, crossTabSync: i = !0, children:
|
|
1331
|
-
const
|
|
1332
|
-
|
|
1333
|
-
}, subscribeKey(
|
|
1334
|
-
const d =
|
|
1335
|
-
return
|
|
1336
|
-
const m = d.get(
|
|
1337
|
-
m && (m.delete(
|
|
1340
|
+
const { store: e, namespace: t = "", serializer: n = po, debounceMs: r = 0, crossTabSync: i = !0, children: c } = o, h = R(() => typeof window > "u" ? new Lt() : e ?? new Lt(), [e]), s = K(/* @__PURE__ */ new Map()), l = R(() => ({ store: h, namespace: t, serializer: n, debounceMs: r, crossTabSync: i, notify(a) {
|
|
1341
|
+
const u = s.current.get(a);
|
|
1342
|
+
u && u.forEach((d) => d());
|
|
1343
|
+
}, subscribeKey(a, u) {
|
|
1344
|
+
const d = s.current, p = d.get(a) ?? /* @__PURE__ */ new Set();
|
|
1345
|
+
return p.add(u), d.set(a, p), () => {
|
|
1346
|
+
const m = d.get(a);
|
|
1347
|
+
m && (m.delete(u), m.size === 0 && d.delete(a));
|
|
1338
1348
|
};
|
|
1339
|
-
} }), [
|
|
1349
|
+
} }), [h, t, n, r, i]);
|
|
1340
1350
|
return W(() => {
|
|
1341
|
-
if (
|
|
1342
|
-
if (!
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1351
|
+
if (l.crossTabSync && l.store.subscribe) return l.store.subscribe((a) => {
|
|
1352
|
+
if (!a.startsWith(l.namespace + ":")) return;
|
|
1353
|
+
const u = a.slice(l.namespace.length + 1);
|
|
1354
|
+
l.notify(u);
|
|
1345
1355
|
});
|
|
1346
|
-
}, [
|
|
1356
|
+
}, [l]), P(dn.Provider, { value: l, children: c });
|
|
1347
1357
|
}
|
|
1348
1358
|
const po = { parse: (o) => o == null ? null : JSON.parse(o), stringify: JSON.stringify };
|
|
1349
1359
|
class cr {
|
|
@@ -1385,51 +1395,51 @@ const ne = { Horizontal: "horizontal", Vertical: "vertical" }, Se = { scrollbar:
|
|
|
1385
1395
|
}, ur = (o) => {
|
|
1386
1396
|
const { style: e, orientation: t = ne.Vertical, ...n } = o, r = t === ne.Vertical;
|
|
1387
1397
|
return P("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e }, className: `scrollbar-button ${r ? "vertical" : "horizontal"} edge`, ...n, children: P("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: r ? "rotate(90) " : "", children: P("path", { style: { transition: "opacity 240ms ease 0s", opacity: o.disabled ? 0 : 1 }, d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }) }) });
|
|
1388
|
-
}, go = Ke().supportsTouchEvents, _n = _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:
|
|
1398
|
+
}, go = Ke().supportsTouchEvents, _n = _e(Le((o, e) => {
|
|
1399
|
+
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: c = 22, style: h, className: s, onPointerDown: l, onPointerMove: a, onPointerUp: u, orientation: d = ne.Vertical, offset: p = 0, currentTouchAnchor: m, elementParent: f, elementRoot: x, key: S, ...g } = o;
|
|
1390
1400
|
if (!go) return null;
|
|
1391
|
-
const _ = k(
|
|
1401
|
+
const _ = k(l, [l]), v = k(a, [a]), B = k(u, [u]), E = d === ne.Vertical, [O, I] = q(!1), M = ln(R(() => ({ processTouch: !0, consumeTouch: !0, onPointerDown: (D, F) => {
|
|
1392
1402
|
I(!0), _?.(D), D.preventDefault(), D.stopPropagation();
|
|
1393
1403
|
}, onPointerMoveOrWait: (D, F, V) => {
|
|
1394
1404
|
v?.(D);
|
|
1395
1405
|
}, onPointerUp: (D, F, V) => {
|
|
1396
1406
|
I(!1), B?.(V), D.preventDefault(), D.stopPropagation();
|
|
1397
1407
|
} }), [])), b = R(() => {
|
|
1398
|
-
const D =
|
|
1399
|
-
return { x:
|
|
1400
|
-
}, [
|
|
1408
|
+
const D = c / 2 + i / 2 + 6;
|
|
1409
|
+
return { x: E ? -D : p + c, y: E ? p + c : -D, width: 0, height: 0 };
|
|
1410
|
+
}, [E, p, c]), [C, { y: L, x: $ }] = Vn(), T = K(null), { getPortalContainer: y, isFullscreen: z } = Fn(), [H, X] = q(null);
|
|
1401
1411
|
return W(() => {
|
|
1402
1412
|
const D = T.current?.getBoundingClientRect();
|
|
1403
1413
|
if (!D) return void X(null);
|
|
1404
|
-
let F = 0, V = 0, Y =
|
|
1414
|
+
let F = 0, V = 0, Y = f;
|
|
1405
1415
|
for (; Y; ) F += Y.scrollLeft, V += Y.scrollTop, Y = x && Y === x.parentElement ? null : Y.parentElement;
|
|
1406
|
-
X(
|
|
1407
|
-
}, [
|
|
1416
|
+
X(Mn(P("div", { className: G("touch-thumb", Se["touch-thumb"], s, Se, { dragging: O }), ref: e, style: { left: F + (D?.x ?? 0) - (c + i) / 2, top: V + (D?.y ?? 0) - (c + i) / 2, width: E ? c : 1.8 * c, height: E ? 1.8 * c : c, 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", ...h }, tabIndex: -1, onPointerDown: M, ...g }), x ?? y(), S));
|
|
1417
|
+
}, [L, O, t, n, r, $, b?.x, b?.y, b?.width, b?.height, s, m, n, c, i, t, f, z, S]), b ? fe(me, { children: [P("div", { ref: Ae([C, T]), style: { position: "absolute", left: b.x, top: b.y, opacity: 0 } }), H] }) : null;
|
|
1408
1418
|
}));
|
|
1409
1419
|
_n.displayName = "TouchThumbHandle";
|
|
1410
|
-
const yo = 24, vo = _e(
|
|
1411
|
-
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className:
|
|
1412
|
-
k(
|
|
1413
|
-
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C =
|
|
1420
|
+
const yo = 24, vo = _e(Le((o, e) => {
|
|
1421
|
+
const { offset: t = 0, totalSize: n = 0, viewportSize: r = 0, style: i, className: c, orientation: h = ne.Vertical, onScrollOffset: s, onScroll: l, showCustomScrollButtons: a, scrollButtonIncrement: u = 200, scrollButtonInitialRepeatDelay: d = 260, scrollButtonAdditionalRepeatDelay: p = 120, minThumbSize: m = yo, maxThumbSize: f, renderScrollButtonStart: x = mo, renderScrollButtonEnd: S = _o, propsTouchThumb: g, propsThumb: _, onMouseDown: v, ...B } = o, E = Ke().primaryInput === "touch", O = a ?? !E;
|
|
1422
|
+
k(l, [l]);
|
|
1423
|
+
const [I, M] = q({ offset: 0, length: 0, disabled: !1 }), b = K(-1), C = h === ne.Vertical, [L, { width: $, height: T }] = Ee(), y = C ? T : $, z = k((w, N, Z) => {
|
|
1414
1424
|
if (N === 0 || Z === 0) {
|
|
1415
|
-
const
|
|
1416
|
-
return M(
|
|
1425
|
+
const Ge = { offset: 0, length: m, disabled: !0 };
|
|
1426
|
+
return M(Ge), Ge;
|
|
1417
1427
|
}
|
|
1418
|
-
if (N >= Z) return { offset: 0, length:
|
|
1419
|
-
const ve = Z /
|
|
1420
|
-
return { offset: Math.min(Math.max(0, ht),
|
|
1421
|
-
}, [
|
|
1422
|
-
const N = n /
|
|
1423
|
-
M(z(Z, r, n)),
|
|
1424
|
-
}, [
|
|
1425
|
-
M(z(w, r, n)),
|
|
1426
|
-
}, [
|
|
1428
|
+
if (N >= Z) return { offset: 0, length: y, disabled: !0 };
|
|
1429
|
+
const ve = Z / y, Pe = N / ve, be = Math.min(Math.max(m, Pe), Math.min(y, f ?? Number.MAX_SAFE_INTEGER)), ht = w / ve;
|
|
1430
|
+
return { offset: Math.min(Math.max(0, ht), y - be), length: be, disabled: !1 };
|
|
1431
|
+
}, [y, m, f]), H = k((w) => {
|
|
1432
|
+
const N = n / y, Z = Math.round(w * N);
|
|
1433
|
+
M(z(Z, r, n)), s?.(Z, r, n), b.current = w;
|
|
1434
|
+
}, [s, r, n, y, I]), X = k((w) => {
|
|
1435
|
+
M(z(w, r, n)), s?.(w, r, n), b.current = w;
|
|
1436
|
+
}, [s, r, n]);
|
|
1427
1437
|
W(() => {
|
|
1428
|
-
b.current !== t &&
|
|
1438
|
+
b.current !== t && y !== 0 && (b.current = -1, M(z(t, r, n)));
|
|
1429
1439
|
}, [t]), W(() => {
|
|
1430
|
-
|
|
1431
|
-
}, [r, n, C,
|
|
1432
|
-
const D = Math.max(0, n - r), [F, V] = q(!1), Y = K(0), ee = K(0),
|
|
1440
|
+
y !== 0 && M(z(t, r, n));
|
|
1441
|
+
}, [r, n, C, y]);
|
|
1442
|
+
const D = Math.max(0, n - r), [F, V] = q(!1), Y = K(0), ee = K(0), Me = Tt(e, () => ({ isScrollbar: () => !0 }), []), ge = k((w) => {
|
|
1433
1443
|
V(!0), Y.current = C ? w.clientY : w.clientX, ee.current = I.offset;
|
|
1434
1444
|
}, [C, I]), Ce = k((w) => {
|
|
1435
1445
|
w.currentTarget.setPointerCapture(w.pointerId), ge(w), w.stopPropagation();
|
|
@@ -1439,89 +1449,89 @@ const yo = 24, vo = _e(Me((o, e) => {
|
|
|
1439
1449
|
H(Z);
|
|
1440
1450
|
}, [F, C]), at = k((w) => {
|
|
1441
1451
|
ye(w);
|
|
1442
|
-
}, []),
|
|
1452
|
+
}, []), Ne = k((w) => {
|
|
1443
1453
|
V(!1);
|
|
1444
1454
|
}, []), ct = k((w) => {
|
|
1445
1455
|
try {
|
|
1446
1456
|
w.currentTarget.releasePointerCapture(w.pointerId);
|
|
1447
1457
|
} catch {
|
|
1448
1458
|
}
|
|
1449
|
-
|
|
1450
|
-
}, []),
|
|
1459
|
+
Ne(w);
|
|
1460
|
+
}, []), Re = k((w) => {
|
|
1451
1461
|
if (!w.currentTarget) return;
|
|
1452
1462
|
const N = w.currentTarget.getBoundingClientRect(), Z = C ? w.clientY - N.top : w.clientX - N.left;
|
|
1453
1463
|
H(Z);
|
|
1454
|
-
}, [C, I, r, n]),
|
|
1464
|
+
}, [C, I, r, n]), He = k((w) => {
|
|
1455
1465
|
const N = Math.max(1, Math.floor(0.9 * r));
|
|
1456
1466
|
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]),
|
|
1467
|
+
}, [C, r, n, t, D]), We = K(null), ut = R(() => {
|
|
1458
1468
|
const w = I.disabled;
|
|
1459
1469
|
if (w) return null;
|
|
1460
|
-
const N = P("div", { ..._, className: G(Se.thumb, { disabled: w }), ref:
|
|
1461
|
-
return !
|
|
1462
|
-
}, [I, m, D, t, C,
|
|
1470
|
+
const N = P("div", { ..._, className: G(Se.thumb, { disabled: w }), ref: We, role: "slider", "aria-label": C ? "Rows" : "Columns", "aria-orientation": C ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, style: { ..._?.style, position: "relative", [C ? "height" : "width"]: `${I.length}px`, [C ? "width" : "height"]: "100%", transform: C ? `translateY(${I.offset}px)` : `translateX(${I.offset}px)`, [C ? "minHeight" : "minWidth"]: `${m}px` }, onMouseDown: v, onPointerDown: Ce, onPointerMove: at, onPointerUp: ct });
|
|
1471
|
+
return !E || w ? N : fe(me, { children: [N, P(_n, { ...g, offset: I.offset, orientation: C ? ne.Vertical : ne.Horizontal, onPointerDown: ge, onPointerMove: ye, onPointerUp: Ne })] });
|
|
1472
|
+
}, [I, m, D, t, C, E, v, g, _]), [Ve, Fe] = q(null), je = k(() => {
|
|
1463
1473
|
let w;
|
|
1464
|
-
w = typeof
|
|
1474
|
+
w = typeof u == "function" ? u(t, r, n) : t - u;
|
|
1465
1475
|
const N = Math.max(0, w);
|
|
1466
|
-
return X(N),
|
|
1467
|
-
}, [
|
|
1476
|
+
return X(N), Fe(N), N;
|
|
1477
|
+
}, [u, t, r, n]), Ue = k(() => {
|
|
1468
1478
|
let w;
|
|
1469
|
-
w = typeof
|
|
1479
|
+
w = typeof u == "function" ? u(t, r, n) : t + u;
|
|
1470
1480
|
const N = Math.min(D, w);
|
|
1471
|
-
return X(N),
|
|
1472
|
-
}, [
|
|
1481
|
+
return X(N), Fe(N), N;
|
|
1482
|
+
}, [u, t, D, r, n]), Te = K(null), Be = K(null), se = U(() => {
|
|
1473
1483
|
Te.current && (clearTimeout(Te.current), Te.current = null, Be.current = null);
|
|
1474
1484
|
}, []), ke = U((w, N, Z, ve = d) => {
|
|
1475
1485
|
Be.current = w, Te.current = setTimeout(() => {
|
|
1476
|
-
const Pe = Z ?
|
|
1477
|
-
Pe !== Be.current ? ke(Pe, !1, Z,
|
|
1486
|
+
const Pe = Z ? je() : Ue();
|
|
1487
|
+
Pe !== Be.current ? ke(Pe, !1, Z, p) : se();
|
|
1478
1488
|
}, N ? 0 : ve);
|
|
1479
|
-
}, [
|
|
1489
|
+
}, [je, Ue, se]);
|
|
1480
1490
|
W(() => () => se(), [se]);
|
|
1481
|
-
const
|
|
1491
|
+
const Xe = R(() => {
|
|
1482
1492
|
if (!O) return null;
|
|
1483
|
-
const w = { orientation:
|
|
1493
|
+
const w = { orientation: h, disabled: t <= 0, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !0) };
|
|
1484
1494
|
return x?.(w);
|
|
1485
|
-
}, [O,
|
|
1495
|
+
}, [O, h, t, Ve]), Ye = R(() => {
|
|
1486
1496
|
if (!O) return null;
|
|
1487
|
-
const w = { orientation:
|
|
1488
|
-
return
|
|
1489
|
-
}, [O,
|
|
1490
|
-
return fe("div", { ref: Ae([
|
|
1497
|
+
const w = { orientation: h, disabled: t >= D, onMouseUp: se, onMouseLeave: se, onMouseDown: () => ke(t, !0, !1) };
|
|
1498
|
+
return S?.(w);
|
|
1499
|
+
}, [O, h, t, D, Ve]), Oe = C ? "vertical" : "horizontal";
|
|
1500
|
+
return fe("div", { ref: Ae([Me, e]), className: G(c, Se.scrollbar, Oe, { dragging: F, "has-touch-thumb": E }), style: i, ...B, children: [Xe, P("div", { ref: L, role: "scrollbar", "aria-orientation": Oe, "aria-valuemin": 0, "aria-valuemax": D, "aria-valuenow": t, tabIndex: 0, className: G(Se.track, "track", Oe), onMouseDown: v, onPointerDown: Re, onKeyDown: He, children: ut }), Ye] });
|
|
1491
1501
|
}));
|
|
1492
1502
|
let jt = Date.now, Ut = 1e3, pe = {}, bo = 1;
|
|
1493
1503
|
const $e = (o) => {
|
|
1494
1504
|
let e = pe[o] !== null;
|
|
1495
1505
|
return e && (pe[o] = null), e;
|
|
1496
1506
|
}, Xt = (o, e, t, n = 0, r) => {
|
|
1497
|
-
let i = jt(),
|
|
1498
|
-
if (
|
|
1507
|
+
let i = jt(), c = i, h = 0, s = 0, l = 0, a = bo++;
|
|
1508
|
+
if (a % 20 == 0) {
|
|
1499
1509
|
const d = {};
|
|
1500
|
-
for (let
|
|
1510
|
+
for (let p in pe) d[p] = !0;
|
|
1501
1511
|
pe = d;
|
|
1502
1512
|
}
|
|
1503
|
-
const
|
|
1504
|
-
let
|
|
1513
|
+
const u = function(d) {
|
|
1514
|
+
let p = d !== !0, m = jt(), f = !0;
|
|
1505
1515
|
try {
|
|
1506
|
-
|
|
1516
|
+
f = (!e || e(a)) ?? !0;
|
|
1507
1517
|
} catch {
|
|
1508
|
-
|
|
1518
|
+
f = !1;
|
|
1509
1519
|
}
|
|
1510
|
-
if (!pe[
|
|
1511
|
-
if (
|
|
1512
|
-
|
|
1513
|
-
for (let
|
|
1520
|
+
if (!pe[a] || !f) return pe[a] = null, void t?.(60 - s / ((m - i) / Ut), a, !1);
|
|
1521
|
+
if (p) {
|
|
1522
|
+
l = Math.round((m - c) / 16.666666666666668) - 1;
|
|
1523
|
+
for (let g = 0; g < Math.min(l, 4); g++) u(!0), s++;
|
|
1514
1524
|
}
|
|
1515
|
-
n && (
|
|
1516
|
-
let x = r ? r(
|
|
1525
|
+
n && (h = (m - i) / n, h > 1 && (h = 1));
|
|
1526
|
+
let x = r ? r(h) : h, S = !1;
|
|
1517
1527
|
try {
|
|
1518
|
-
|
|
1528
|
+
S = o(x, m, p);
|
|
1519
1529
|
} catch {
|
|
1520
|
-
|
|
1530
|
+
S = !1;
|
|
1521
1531
|
}
|
|
1522
|
-
|
|
1532
|
+
S !== !1 && h !== 1 || !p ? p && (c = m, requestAnimationFrame(u)) : (pe[a] = null, t?.(60 - s / ((m - i) / Ut), a, h === 1 || n == null));
|
|
1523
1533
|
};
|
|
1524
|
-
return pe[
|
|
1534
|
+
return pe[a] = !0, requestAnimationFrame(u), a;
|
|
1525
1535
|
}, wo = function(o) {
|
|
1526
1536
|
return Math.pow(o - 1, 3) + 1;
|
|
1527
1537
|
}, xo = function(o) {
|
|
@@ -1553,11 +1563,11 @@ class So {
|
|
|
1553
1563
|
zoomTo(e, t = !1, n, r, i) {
|
|
1554
1564
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1555
1565
|
i && (this.__zoomComplete = i), this.__isDecelerating && ($e(this.__isDecelerating), this.__isDecelerating = 0);
|
|
1556
|
-
const
|
|
1566
|
+
const c = this.__zoomLevel;
|
|
1557
1567
|
n === void 0 && (n = this.__clientWidth / 2), r === void 0 && (r = this.__clientHeight / 2), e = Math.max(Math.min(e, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(e);
|
|
1558
|
-
const
|
|
1559
|
-
let
|
|
1560
|
-
|
|
1568
|
+
const h = e / c;
|
|
1569
|
+
let s = h * (this.__scrollLeft + n) - n, l = h * (this.__scrollTop + r) - r;
|
|
1570
|
+
s > this.__maxScrollLeft ? s = this.__maxScrollLeft : s < 0 && (s = 0), l > this.__maxScrollTop ? l = this.__maxScrollTop : l < 0 && (l = 0), this.__publish(s, l, e, t);
|
|
1561
1571
|
}
|
|
1562
1572
|
zoomBy(e, t = !1, n = 0, r = 0, i) {
|
|
1563
1573
|
this.zoomTo(this.__zoomLevel * e, t, n, r, i);
|
|
@@ -1591,30 +1601,30 @@ class So {
|
|
|
1591
1601
|
if (!this.__isTracking) return;
|
|
1592
1602
|
let r, i;
|
|
1593
1603
|
e.length === 2 ? (r = Math.abs(e[0].pageX + e[1].pageX) / 2, i = Math.abs(e[0].pageY + e[1].pageY) / 2) : (r = e[0].pageX, i = e[0].pageY);
|
|
1594
|
-
let
|
|
1604
|
+
let c = this.__positions;
|
|
1595
1605
|
if (this.__isDragging) {
|
|
1596
|
-
let
|
|
1606
|
+
let h = r - this.__lastTouchLeft, s = i - this.__lastTouchTop, l = this.__scrollLeft, a = this.__scrollTop, u = this.__zoomLevel;
|
|
1597
1607
|
if (n !== void 0 && this.options.zooming) {
|
|
1598
|
-
let d =
|
|
1599
|
-
if (
|
|
1600
|
-
let
|
|
1601
|
-
|
|
1608
|
+
let d = u;
|
|
1609
|
+
if (u = u / this.__lastScale * n, u = Math.max(Math.min(u, this.options.maxZoom), this.options.minZoom), d !== u) {
|
|
1610
|
+
let p = r - this.__clientLeft, m = i - this.__clientTop;
|
|
1611
|
+
l = (p + l) * u / d - p, a = (m + a) * u / d - m, this.__computeScrollMax(u);
|
|
1602
1612
|
}
|
|
1603
1613
|
}
|
|
1604
1614
|
if (this.__enableScrollX) {
|
|
1605
|
-
|
|
1615
|
+
l -= h * this.options.speedMultiplier;
|
|
1606
1616
|
let d = this.__maxScrollLeft;
|
|
1607
|
-
(
|
|
1617
|
+
(l > d || l < 0) && (this.options.bouncing ? l += h / 2 * this.options.speedMultiplier : l = l > d ? d : 0);
|
|
1608
1618
|
}
|
|
1609
1619
|
if (this.__enableScrollY) {
|
|
1610
|
-
|
|
1620
|
+
a -= s * this.options.speedMultiplier;
|
|
1611
1621
|
const d = this.__maxScrollTop;
|
|
1612
|
-
(
|
|
1622
|
+
(a > d || a < 0) && (this.options.bouncing ? a += s / 2 * this.options.speedMultiplier : a = a > d ? d : 0);
|
|
1613
1623
|
}
|
|
1614
|
-
|
|
1624
|
+
c.length > 60 && c.splice(0, 30), c.push(l, a, t), this.__publish(l, a, u);
|
|
1615
1625
|
} else {
|
|
1616
|
-
let
|
|
1617
|
-
this.__enableScrollX = this.options.scrollingX &&
|
|
1626
|
+
let h = this.options.locking ? 3 : 0, s = 5, l = Math.abs(r - this.__initialTouchLeft), a = Math.abs(i - this.__initialTouchTop);
|
|
1627
|
+
this.__enableScrollX = this.options.scrollingX && l >= h, this.__enableScrollY = this.options.scrollingY && a >= h, c.push(this.__scrollLeft, this.__scrollTop, t), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (l >= s || a >= s), this.__isDragging && (this.__interruptedAnimation = !1);
|
|
1618
1628
|
}
|
|
1619
1629
|
this.__lastTouchLeft = r, this.__lastTouchTop = i, this.__lastTouchMove = t, this.__lastScale = n;
|
|
1620
1630
|
}
|
|
@@ -1625,10 +1635,10 @@ class So {
|
|
|
1625
1635
|
let t = this.__positions, n = t.length - 1, r = n;
|
|
1626
1636
|
for (let i = n; i > 0 && t[i] > this.__lastTouchMove - 100; i -= 3) r = i;
|
|
1627
1637
|
if (r !== n) {
|
|
1628
|
-
const i = t[n] - t[r],
|
|
1629
|
-
this.__decelerationVelocityX =
|
|
1630
|
-
const
|
|
1631
|
-
(Math.abs(this.__decelerationVelocityX) >
|
|
1638
|
+
const i = t[n] - t[r], c = this.__scrollLeft - t[r - 2], h = this.__scrollTop - t[r - 1];
|
|
1639
|
+
this.__decelerationVelocityX = c / i * (1e3 / 60), this.__decelerationVelocityY = h / i * (1e3 / 60);
|
|
1640
|
+
const s = this.options.paging || this.options.snapping ? 4 : 1;
|
|
1641
|
+
(Math.abs(this.__decelerationVelocityX) > s || Math.abs(this.__decelerationVelocityY) > s) && this.__startDeceleration(e);
|
|
1632
1642
|
} else this.options.scrollingComplete?.();
|
|
1633
1643
|
} else e - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
1634
1644
|
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, !0, this.__zoomLevel)), this.__positions.length = 0;
|
|
@@ -1638,14 +1648,14 @@ class So {
|
|
|
1638
1648
|
const i = this.__isAnimating;
|
|
1639
1649
|
if (i && ($e(i), this.__isAnimating = 0), r && this.options.animating) {
|
|
1640
1650
|
this.__scheduledLeft = e, this.__scheduledTop = t, this.__scheduledZoom = n;
|
|
1641
|
-
const
|
|
1642
|
-
|
|
1643
|
-
}.bind(this),
|
|
1644
|
-
return this.__isAnimating ===
|
|
1645
|
-
}.bind(this), m = function(
|
|
1646
|
-
x === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete ||
|
|
1651
|
+
const c = this.__scrollLeft, h = this.__scrollTop, s = this.__zoomLevel, l = e - c, a = t - h, u = n - s, d = function(f, x, S) {
|
|
1652
|
+
S && (this.__scrollLeft = c + l * f, this.__scrollTop = h + a * f, this.__zoomLevel = s + u * f, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
1653
|
+
}.bind(this), p = function(f) {
|
|
1654
|
+
return this.__isAnimating === f;
|
|
1655
|
+
}.bind(this), m = function(f, x, S) {
|
|
1656
|
+
x === this.__isAnimating && (this.__isAnimating = !1), (this.__didDecelerationComplete || S) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1647
1657
|
}.bind(this);
|
|
1648
|
-
this.__isAnimating = Xt(d,
|
|
1658
|
+
this.__isAnimating = Xt(d, p, m, this.options.animationDuration, i ? wo : xo);
|
|
1649
1659
|
} else this.__scheduledLeft = this.__scrollLeft = e, this.__scheduledTop = this.__scrollTop = t, this.__scheduledZoom = this.__zoomLevel = n, this.__callback && this.__callback(e, t, n), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1650
1660
|
}
|
|
1651
1661
|
__computeScrollMax(e = this.__zoomLevel) {
|
|
@@ -1653,15 +1663,15 @@ class So {
|
|
|
1653
1663
|
}
|
|
1654
1664
|
__startDeceleration(e) {
|
|
1655
1665
|
if (this.options.paging) {
|
|
1656
|
-
const
|
|
1657
|
-
this.__minDecelerationScrollLeft = Math.floor(
|
|
1666
|
+
const c = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), h = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), s = this.__clientWidth, l = this.__clientHeight;
|
|
1667
|
+
this.__minDecelerationScrollLeft = Math.floor(c / s) * s, this.__minDecelerationScrollTop = Math.floor(h / l) * l, this.__maxDecelerationScrollLeft = Math.ceil(c / s) * s, this.__maxDecelerationScrollTop = Math.ceil(h / l) * l;
|
|
1658
1668
|
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
1659
|
-
const t = function(
|
|
1660
|
-
this.__stepThroughDeceleration(
|
|
1669
|
+
const t = function(c, h, s) {
|
|
1670
|
+
this.__stepThroughDeceleration(s);
|
|
1661
1671
|
}.bind(this), n = this.options.snapping ? 4 : 0.1, r = function() {
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1664
|
-
}.bind(this), i = function(
|
|
1672
|
+
const c = Math.abs(this.__decelerationVelocityX) >= n || Math.abs(this.__decelerationVelocityY) >= n;
|
|
1673
|
+
return c || (this.__didDecelerationComplete = !0), c;
|
|
1674
|
+
}.bind(this), i = function(c, h, s) {
|
|
1665
1675
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1666
1676
|
}.bind(this);
|
|
1667
1677
|
this.__isDecelerating = Xt(t, r, i);
|
|
@@ -1675,94 +1685,97 @@ class So {
|
|
|
1675
1685
|
i !== n && (n = i, this.__decelerationVelocityY = 0);
|
|
1676
1686
|
}
|
|
1677
1687
|
if (e ? this.__publish(t, n, this.__zoomLevel) : (this.__scrollLeft = t, this.__scrollTop = n), !this.options.paging && (this.__decelerationVelocityX *= 0.95, this.__decelerationVelocityY *= 0.95), this.options.bouncing) {
|
|
1678
|
-
let r = 0, i = 0,
|
|
1679
|
-
t < this.__minDecelerationScrollLeft ? r = this.__minDecelerationScrollLeft - t : t > this.__maxDecelerationScrollLeft && (r = this.__maxDecelerationScrollLeft - t), n < this.__minDecelerationScrollTop ? i = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (i = this.__maxDecelerationScrollTop - n), r !== 0 && (r * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += r *
|
|
1688
|
+
let r = 0, i = 0, c = this.options.penetrationDeceleration, h = this.options.penetrationAcceleration;
|
|
1689
|
+
t < this.__minDecelerationScrollLeft ? r = this.__minDecelerationScrollLeft - t : t > this.__maxDecelerationScrollLeft && (r = this.__maxDecelerationScrollLeft - t), n < this.__minDecelerationScrollTop ? i = this.__minDecelerationScrollTop - n : n > this.__maxDecelerationScrollTop && (i = this.__maxDecelerationScrollTop - n), r !== 0 && (r * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += r * c : this.__decelerationVelocityX = r * h), i !== 0 && (i * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += i * c : this.__decelerationVelocityY = i * h);
|
|
1680
1690
|
}
|
|
1681
1691
|
}
|
|
1682
1692
|
}
|
|
1683
|
-
const
|
|
1693
|
+
const st = (o) => P(vo, { ...o }), hr = Object.freeze(Object.defineProperty({ __proto__: null, defaultRenderScrollbar: st, getScrollTo: (o, e, t, n, r = 0) => {
|
|
1684
1694
|
for (let i = 0; i < t.length; i++) {
|
|
1685
|
-
const
|
|
1686
|
-
let
|
|
1695
|
+
const c = t[i].getBoundingClientRect();
|
|
1696
|
+
let h = c.left - e, s = h + c.width;
|
|
1687
1697
|
if (n) {
|
|
1688
|
-
if (
|
|
1689
|
-
} else if (Math.ceil(
|
|
1698
|
+
if (h < o && s >= o) return h;
|
|
1699
|
+
} else if (Math.ceil(s) > Math.ceil(o) + 2) return s;
|
|
1690
1700
|
}
|
|
1691
1701
|
return r;
|
|
1692
|
-
} }, Symbol.toStringTag, { value: "Module" })), de = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Eo = (
|
|
1693
|
-
const
|
|
1702
|
+
} }, Symbol.toStringTag, { value: "Module" })), de = { scrollpane: "_scrollpane_1fbi8_2", "vertical-container": "_vertical-container_1fbi8_7", "horizontal-corner-container": "_horizontal-corner-container_1fbi8_12", "scrollbar-sizer": "_scrollbar-sizer_1fbi8_26", "scrollpane-content": "_scrollpane-content_1fbi8_34", "scrollpane-content-element": "_scrollpane-content-element_1fbi8_43" }, Eo = (o) => {
|
|
1703
|
+
const e = o?.width, t = o?.height;
|
|
1704
|
+
return P("div", { className: "corner", style: { minWidth: `${e}px`, width: `${e}px`, minHeight: `${t}px`, height: `${t}px` } });
|
|
1705
|
+
}, Lo = _e(Le((o, e) => {
|
|
1706
|
+
const { children: t, viewport: n, onScrollViewport: r, showHorizontalScrollbar: i = !0, showVerticalScrollbar: c = !0, createScrollCorner: h = Eo, renderScrollbarHorizontal: s = st, renderScrollbarVertical: l = st, style: a, className: u, touchElement: d, disableTouch: p, ...m } = o, f = i && s, x = c && l, S = k(r, [r]), g = Tt(e, () => ({ isScrollPane: () => !0 }), []), _ = K(null);
|
|
1694
1707
|
W(() => {
|
|
1695
1708
|
_.current && (_.current.__scrollTop === n?.top && _.current.__scrollLeft === n?.left || _.current.__isDecelerating || _.current?.scrollTo(n?.left, n?.top, !1));
|
|
1696
1709
|
}, [n?.left, n?.top, d]);
|
|
1697
|
-
const v = U((
|
|
1698
|
-
|
|
1699
|
-
}, []), B = U((
|
|
1700
|
-
_.current?.doTouchStart(
|
|
1701
|
-
}, []),
|
|
1702
|
-
|
|
1703
|
-
}, []), O = U((
|
|
1704
|
-
_.current?.doTouchEnd(
|
|
1705
|
-
}, []), I = U(({ containerWidth:
|
|
1706
|
-
_.current.setDimensions(
|
|
1710
|
+
const v = U((y, z) => {
|
|
1711
|
+
S?.({ left: y, top: z });
|
|
1712
|
+
}, []), B = U((y) => {
|
|
1713
|
+
_.current?.doTouchStart(y.touches, y.timeStamp);
|
|
1714
|
+
}, []), E = U((y) => {
|
|
1715
|
+
y.preventDefault(), _.current?.doTouchMove(y.touches, y.timeStamp);
|
|
1716
|
+
}, []), O = U((y) => {
|
|
1717
|
+
_.current?.doTouchEnd(y.timeStamp);
|
|
1718
|
+
}, []), I = U(({ containerWidth: y, containerHeight: z, totalWidth: H, totalHeight: X }) => {
|
|
1719
|
+
_.current.setDimensions(y, z, H, X);
|
|
1707
1720
|
}, []);
|
|
1708
1721
|
W(() => {
|
|
1709
|
-
const
|
|
1710
|
-
if (!
|
|
1722
|
+
const y = d ?? g.current;
|
|
1723
|
+
if (!p && Ke().supportsTouchEvents && y && n) {
|
|
1711
1724
|
if (!_.current) {
|
|
1712
1725
|
const z = { scrollingX: !0, scrollingY: !0, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1713
1726
|
_.current = new So(v, z);
|
|
1714
1727
|
}
|
|
1715
|
-
Ke().supportsTouchEvents && (
|
|
1728
|
+
Ke().supportsTouchEvents && (y.addEventListener("touchstart", B), y.addEventListener("touchend", O), y.addEventListener("touchmove", E)), I({ containerWidth: n?.width, containerHeight: n?.height, totalWidth: n?.totalWidth, totalHeight: n?.totalHeight });
|
|
1716
1729
|
}
|
|
1717
1730
|
return () => {
|
|
1718
|
-
|
|
1731
|
+
y?.removeEventListener("touchstart", B), y?.removeEventListener("touchend", O), y?.removeEventListener("touchmove", E);
|
|
1719
1732
|
};
|
|
1720
|
-
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight,
|
|
1721
|
-
const [M, { width: b }] = Ee(), [C, { height:
|
|
1733
|
+
}, [n?.width, n?.height, n?.totalWidth, n?.totalHeight, p, d]);
|
|
1734
|
+
const [M, { width: b }] = Ee(), [C, { height: L }] = Ee(), $ = R(() => {
|
|
1722
1735
|
if (!x) return null;
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1736
|
+
const y = l({ orientation: ne.Vertical, offset: n?.top, viewportSize: n?.height, totalSize: n?.totalHeight, onScrollOffset: (z) => {
|
|
1737
|
+
S?.({ top: z });
|
|
1725
1738
|
} });
|
|
1726
|
-
return P("div", { className: G("vertical-container", de["vertical-container"]), ref: M, children:
|
|
1727
|
-
}, [
|
|
1728
|
-
if (!
|
|
1729
|
-
const
|
|
1730
|
-
|
|
1739
|
+
return P("div", { className: G("vertical-container", de["vertical-container"]), ref: M, children: y });
|
|
1740
|
+
}, [l, n?.top, n?.height, n?.totalHeight]), T = R(() => {
|
|
1741
|
+
if (!f) return null;
|
|
1742
|
+
const y = s({ orientation: ne.Horizontal, offset: n?.left, viewportSize: n?.width, totalSize: n?.totalWidth, onScrollOffset: (z) => {
|
|
1743
|
+
S?.({ left: z });
|
|
1731
1744
|
} });
|
|
1732
|
-
return fe("div", { className: G("horizontal-corner-container", de["horizontal-corner-container"]), children: [P("div", { className: G("horizontal-sizer", de["horizontal-sizer"]), style: { width: `calc(100% - ${b}px)` }, children: P("div", { ref: C, className: G("scrollbar-sizer", de["scrollbar-sizer"]), children:
|
|
1733
|
-
}, [
|
|
1734
|
-
return P("div", { className: G(
|
|
1745
|
+
return fe("div", { className: G("horizontal-corner-container", de["horizontal-corner-container"]), children: [P("div", { className: G("horizontal-sizer", de["horizontal-sizer"]), style: { width: `calc(100% - ${b}px)` }, children: P("div", { ref: C, className: G("scrollbar-sizer", de["scrollbar-sizer"]), children: y }) }), x ? h({ width: b, height: L }) : P(me, {})] });
|
|
1746
|
+
}, [s, n?.left, n?.width, n?.totalWidth, x, h, b, L]);
|
|
1747
|
+
return P("div", { className: G(u, "scrollpane", de.scrollpane), style: { minWidth: x ? `${b}px` : void 0, minHeight: f ? `${L}px` : void 0, ...a }, ...m, ref: g, children: fe("div", { className: G("scrollpane-content", de["scrollpane-content"]), children: [fe("div", { className: G("scrollpane-content-element", de["scrollpane-content-element"]), children: [P("div", { className: G("scrollpane-content-element", de["scrollpane-content-element"]), children: t }), x ? $ : P(me, {})] }), f ? T : P(me, {})] }) });
|
|
1735
1748
|
}));
|
|
1736
|
-
|
|
1737
|
-
const
|
|
1738
|
-
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap:
|
|
1739
|
-
|
|
1740
|
-
const
|
|
1741
|
-
const M = d === 0 ? r : Math.min(r ?? 0, Math.max(i ?? 0, (t ?? 0) + (n ?? 0)) + (
|
|
1742
|
-
return { offset: Math.ceil(t / b), totalSize:
|
|
1743
|
-
}, [t, r, n,
|
|
1744
|
-
const
|
|
1745
|
-
Math.abs(M -
|
|
1746
|
-
}, [
|
|
1749
|
+
Lo.displayName = "ScrollPane";
|
|
1750
|
+
const Mo = 300, Co = 100, To = 1e6, ko = 100, Po = 50, Do = _e(Le((o, e) => {
|
|
1751
|
+
const { offset: t = 0, viewportSize: n = 0, totalSize: r = 0, minSize: i = 0, endGap: c = Mo, endScrollIncrement: h = Co, style: s = tn, onMouseDown: l, onScrollOffset: a, onScroll: u, scaleLimit: d = To, scaleFactor: p = ko, precisionFactor: m = Po, renderScrollbar: f = st, ...x } = o;
|
|
1752
|
+
u && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1753
|
+
const S = k(l, [l]), [g, _] = q(!1), v = R(() => {
|
|
1754
|
+
const M = d === 0 ? r : Math.min(r ?? 0, Math.max(i ?? 0, (t ?? 0) + (n ?? 0)) + (c ?? 0)), b = d !== 0 && M > d ? p : 1, C = b / m, L = Math.ceil(M / b);
|
|
1755
|
+
return { offset: Math.ceil(t / b), totalSize: L, viewportSize: Math.ceil(n / b), scaledOffset: t, scaledTotalSize: r, scaledViewportSize: n, factor: b, precision: C };
|
|
1756
|
+
}, [t, r, n, g, i, c, h]), B = k((M, b, C) => {
|
|
1757
|
+
const L = v.offset;
|
|
1758
|
+
Math.abs(M - L) < v.precision && (M = L), a?.(M * v.factor, L, v.viewportSize);
|
|
1759
|
+
}, [a, v]), E = U((M) => {
|
|
1747
1760
|
}, []), O = U((M) => {
|
|
1748
|
-
document.removeEventListener("mousemove",
|
|
1761
|
+
document.removeEventListener("mousemove", E), document.removeEventListener("mouseup", O), _(!1);
|
|
1749
1762
|
}, []), I = U((M) => {
|
|
1750
|
-
_(!0),
|
|
1751
|
-
}, [
|
|
1752
|
-
return
|
|
1763
|
+
_(!0), S?.(M), document.addEventListener("mousemove", E, { passive: !0 }), document.addEventListener("mouseup", O, { passive: !0 });
|
|
1764
|
+
}, [E, O]);
|
|
1765
|
+
return f({ style: s, ...x, offset: v.offset, totalSize: v.totalSize, viewportSize: v.viewportSize, onMouseDown: I, onScrollOffset: B, ref: e });
|
|
1753
1766
|
}));
|
|
1754
1767
|
Do.displayName = "VirtualScrollbar";
|
|
1755
1768
|
export {
|
|
1756
1769
|
bt as Command,
|
|
1757
1770
|
Vo as CommandButtonType,
|
|
1758
1771
|
on as CommandGroup,
|
|
1759
|
-
|
|
1772
|
+
ot as DefaultDynamicIconService,
|
|
1760
1773
|
Nn as DefaultReactNotifier,
|
|
1761
1774
|
co as DynamicIcon,
|
|
1762
1775
|
ir as ErrorTestPanel,
|
|
1763
1776
|
jo as FocusKeyNavigation,
|
|
1764
1777
|
$o as HorizontalAlignment,
|
|
1765
|
-
|
|
1778
|
+
Lt as InMemoryStore,
|
|
1766
1779
|
Ko as KeyCodes,
|
|
1767
1780
|
Q as KeyModifiers,
|
|
1768
1781
|
cr as LocalStorageStore,
|
|
@@ -1771,9 +1784,9 @@ export {
|
|
|
1771
1784
|
Ot as NotifierType,
|
|
1772
1785
|
ar as PersistenceStateProvider,
|
|
1773
1786
|
or as ReactErrorBoundary,
|
|
1774
|
-
|
|
1787
|
+
Ho as ReactUtils,
|
|
1775
1788
|
Uo as RoundedTab,
|
|
1776
|
-
|
|
1789
|
+
Lo as ScrollPane,
|
|
1777
1790
|
hr as ScrollUtils,
|
|
1778
1791
|
vo as Scrollbar,
|
|
1779
1792
|
ne as ScrollbarOrientation,
|
|
@@ -1793,7 +1806,7 @@ export {
|
|
|
1793
1806
|
Ie as toShortcutString,
|
|
1794
1807
|
Vn as useAnimatedMeasure,
|
|
1795
1808
|
k as useCallbackRef,
|
|
1796
|
-
|
|
1809
|
+
Ro as useCommand,
|
|
1797
1810
|
Wo as useCommands,
|
|
1798
1811
|
Qo as useCopyPaste,
|
|
1799
1812
|
Yo as useDevicePixelRatio,
|