@sheetxl/utils-react 0.7.13 → 0.7.15
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/{C2UpOWov5hxZw0Mu.cjs → DR4nVOJkx8rs4k4Z.cjs} +2 -2
- package/browser/cjs/index.cjs +3 -3
- package/browser/esm/{BGxm64YWS34jS1Mw.mjs → Bjn3Ya_2XTU4VReT.mjs} +2 -2
- package/browser/esm/index.mjs +1204 -1165
- package/node/assets/style.css +1 -1
- package/node/esm/{BUbqNRja31CtMjD9.mjs → B3XB5fOsmcQHIMOW.mjs} +2 -2
- package/node/esm/index.mjs +1076 -1037
- package/package.json +2 -2
- package/types/index.d.ts +68 -5
package/node/esm/index.mjs
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.
|
|
2
|
+
* @license @sheetxl/utils-react - Utils React - Utilities for React capabilities needed for all SheetXL components. - v0.7.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
import { CommonUtils as
|
|
7
|
+
import { CommonUtils as t, DefaultNotifier as e, Notifier as n, InternalClipboard as o, ClipboardUtils as i, MimeType as r } from "@sheetxl/utils";
|
|
8
8
|
import * as s from "detect-it";
|
|
9
9
|
import l, { useRef as a, useReducer as c, useMemo as h, useEffect as u, useState as d, memo as p, forwardRef as f, useCallback as m, createContext as _, useContext as g, useLayoutEffect as y, createElement as v, useImperativeHandle as w, Component as b } from "react";
|
|
10
10
|
import { jsx as x, jsxs as S, Fragment as E } from "react/jsx-runtime";
|
|
11
11
|
import { mergeRefs as L } from "react-merge-refs";
|
|
12
12
|
import { useMeasure as M } from "react-use";
|
|
13
13
|
import T from "clsx";
|
|
14
|
-
import { createRoot as
|
|
15
|
-
import { unstable_batchedUpdates as
|
|
16
|
-
const
|
|
14
|
+
import { createRoot as C } from "react-dom/client";
|
|
15
|
+
import { unstable_batchedUpdates as k, createPortal as P } from "react-dom";
|
|
16
|
+
const D = { General: "general", Left: "left", Right: "right", Center: "center", Justify: "justify", Fill: "fill", Distributed: "distributed", CenterContinuous: "centerContinuous" }, A = { Shift: "shift", Alt: "alt", Ctrl: "ctrl", Meta: "meta" }, z = { BackSpace: 8, Tab: 9, Clear: 12, Enter: 13, Shift: 16, Control: 17, Alt: 18, Pause: 19, CapsLock: 20, Escape: 27, Space: 32, PageUp: 33, PageDown: 34, End: 35, Home: 36, Left: 37, Up: 38, Right: 39, Down: 40, Insert: 45, Delete: 46, Digit_8: 56, Y: 89, Z: 90, Meta: 91, F1: 112, F2: 113, F3: 114, F4: 115, F5: 116, F6: 117, F7: 118, F8: 119, F9: 120, F10: 121, F11: 122, F12: 123, NumLock: 144, ScrollLock: 145, BackSlash: 220, Slash: 191, BracketRight: 221, BracketLeft: 219 }, B = { Left: 1, Middle: 2, Right: 3 };
|
|
17
17
|
class $ {
|
|
18
|
-
constructor(
|
|
19
|
-
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key =
|
|
18
|
+
constructor(t2, e2, n2, o2) {
|
|
19
|
+
this._listenersProperties = /* @__PURE__ */ new Set(), this._listenersExecute = /* @__PURE__ */ new Set(), this._key = t2, this._target = e2, this._applyProps(n2 || {}), this._callback = o2, void 0 === o2 && (this._callback = () => {
|
|
20
20
|
console.log(`implement: ${this.label()} : ${this.description()}`);
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
key() {
|
|
24
24
|
return this._key;
|
|
25
25
|
}
|
|
26
|
-
_resolve(
|
|
27
|
-
if ("function" == typeof
|
|
28
|
-
const n2 =
|
|
29
|
-
return
|
|
26
|
+
_resolve(t2, e2) {
|
|
27
|
+
if ("function" == typeof t2) {
|
|
28
|
+
const n2 = e2 ?? this._context;
|
|
29
|
+
return t2("function" == typeof n2 ? n2() : n2);
|
|
30
30
|
}
|
|
31
|
-
return
|
|
31
|
+
return t2;
|
|
32
32
|
}
|
|
33
33
|
target() {
|
|
34
34
|
return "function" == typeof this._target ? this._target() : this._target;
|
|
35
35
|
}
|
|
36
|
-
label(
|
|
37
|
-
const n2 = this._scopedLabels?.[
|
|
36
|
+
label(t2, e2) {
|
|
37
|
+
const n2 = this._scopedLabels?.[t2] || this._label;
|
|
38
38
|
let o2 = null;
|
|
39
39
|
if ("function" == typeof n2) {
|
|
40
|
-
const
|
|
41
|
-
o2 = n2("function" == typeof
|
|
40
|
+
const t3 = e2 ?? this._context;
|
|
41
|
+
o2 = n2("function" == typeof t3 ? t3() : t3);
|
|
42
42
|
} else o2 = n2;
|
|
43
43
|
return o2;
|
|
44
44
|
}
|
|
45
|
-
description(
|
|
46
|
-
return this._resolve(this._description,
|
|
45
|
+
description(t2) {
|
|
46
|
+
return this._resolve(this._description, t2);
|
|
47
47
|
}
|
|
48
|
-
tags(
|
|
49
|
-
return this._resolve(this._tags,
|
|
48
|
+
tags(t2) {
|
|
49
|
+
return this._resolve(this._tags, t2);
|
|
50
50
|
}
|
|
51
|
-
icon(
|
|
52
|
-
return this._resolve(this._icon,
|
|
51
|
+
icon(t2) {
|
|
52
|
+
return this._resolve(this._icon, t2);
|
|
53
53
|
}
|
|
54
54
|
shortcut() {
|
|
55
55
|
return this._resolve(this._shortcut);
|
|
@@ -63,135 +63,137 @@ class $ {
|
|
|
63
63
|
context() {
|
|
64
64
|
return "function" == typeof this._context ? this._context() : this._context;
|
|
65
65
|
}
|
|
66
|
-
async execute(
|
|
66
|
+
async execute(t2, e2) {
|
|
67
67
|
if (!this.disabled() && this._callback) {
|
|
68
68
|
try {
|
|
69
69
|
let n2 = true;
|
|
70
|
-
|
|
70
|
+
e2?.beforeExecute && (n2 = e2?.beforeExecute(this, t2));
|
|
71
71
|
if (false === await Promise.resolve(n2)) return false;
|
|
72
|
-
const o2 = this._callback.bind(this)(
|
|
72
|
+
const o2 = this._callback.bind(this)(t2, this);
|
|
73
73
|
if (false === await Promise.resolve(o2)) return false;
|
|
74
|
-
|
|
74
|
+
e2?.onExecute?.(this, t2), this._notifyExecute(t2);
|
|
75
75
|
} catch (n2) {
|
|
76
|
-
return console.warn(n2),
|
|
76
|
+
return console.warn(n2), e2?.onError(this, n2, t2), this._notifyError(t2, n2), false;
|
|
77
77
|
}
|
|
78
78
|
return true;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
addPropertyListener(
|
|
82
|
-
if (!
|
|
81
|
+
addPropertyListener(t2, e2 = false) {
|
|
82
|
+
if (!t2) throw new Error("listener must be specified");
|
|
83
83
|
const n2 = this._listenersProperties;
|
|
84
|
-
return n2.add(
|
|
85
|
-
n2.delete(
|
|
84
|
+
return n2.add(t2), e2 && t2({}, this), () => {
|
|
85
|
+
n2.delete(t2);
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
|
-
addExecuteListener(
|
|
89
|
-
if (!
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
|
|
88
|
+
addExecuteListener(t2) {
|
|
89
|
+
if (!t2) throw new Error("listener must be specified");
|
|
90
|
+
const e2 = this._listenersExecute;
|
|
91
|
+
return e2.add(t2), function() {
|
|
92
|
+
e2.delete(t2);
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
_notifyExecute(
|
|
96
|
-
const
|
|
95
|
+
_notifyExecute(t2) {
|
|
96
|
+
const e2 = this;
|
|
97
97
|
this._listenersExecute.forEach((n2) => {
|
|
98
|
-
n2.onExecute(
|
|
98
|
+
n2.onExecute(e2, t2);
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
-
_notifyError(
|
|
101
|
+
_notifyError(t2, e2) {
|
|
102
102
|
const n2 = this;
|
|
103
103
|
this._listenersExecute.forEach((o2) => {
|
|
104
|
-
o2.onError?.(n2,
|
|
104
|
+
o2.onError?.(n2, t2, e2);
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
updateCallback(
|
|
108
|
-
return this._callback =
|
|
107
|
+
updateCallback(t2) {
|
|
108
|
+
return this._callback = t2 || null, this;
|
|
109
109
|
}
|
|
110
|
-
update(
|
|
111
|
-
if (!
|
|
112
|
-
const
|
|
113
|
-
return Object.keys(
|
|
110
|
+
update(t2) {
|
|
111
|
+
if (!t2) return;
|
|
112
|
+
const e2 = this._applyProps(t2);
|
|
113
|
+
return Object.keys(e2).length > 0 && this._notifyPropertyChange(e2), this;
|
|
114
114
|
}
|
|
115
|
-
_notifyPropertyChange(
|
|
116
|
-
const
|
|
115
|
+
_notifyPropertyChange(t2) {
|
|
116
|
+
const e2 = this;
|
|
117
117
|
this._listenersProperties.forEach((n2) => {
|
|
118
|
-
n2(
|
|
118
|
+
n2(t2, e2);
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
-
_applyProps(
|
|
122
|
-
let
|
|
123
|
-
return Object.keys(
|
|
124
|
-
let i2 =
|
|
125
|
-
n2["_" + o2] !== i2 && (n2["_" + o2] =
|
|
126
|
-
}),
|
|
121
|
+
_applyProps(t2) {
|
|
122
|
+
let e2 = {}, n2 = this;
|
|
123
|
+
return Object.keys(t2).forEach((o2) => {
|
|
124
|
+
let i2 = t2[o2];
|
|
125
|
+
n2["_" + o2] !== i2 && (n2["_" + o2] = e2[o2] = i2);
|
|
126
|
+
}), e2;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
class
|
|
129
|
+
class I extends $ {
|
|
130
130
|
}
|
|
131
|
-
const
|
|
131
|
+
const K = /* @__PURE__ */ new Set(["INPUT", "TEXTAREA", "SELECT"]), O = {};
|
|
132
132
|
function N() {
|
|
133
133
|
return s;
|
|
134
134
|
}
|
|
135
|
-
const H = (
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
135
|
+
const H = (e2) => "BracketLeft" === e2 ? "[" : "BracketRight" === e2 ? "]" : t.camelToPrettyCase(e2), R = (t2, e2) => {
|
|
136
|
+
let n2 = false, o2 = false;
|
|
137
|
+
const i2 = { nativeEvent: t2, currentTarget: e2 || t2.currentTarget, target: t2.target, bubbles: t2.bubbles, cancelable: t2.cancelable, defaultPrevented: t2.defaultPrevented, eventPhase: t2.eventPhase, isTrusted: t2.isTrusted, preventDefault: () => {
|
|
138
|
+
n2 = true, t2.preventDefault();
|
|
139
|
+
}, isDefaultPrevented: () => n2, stopPropagation: () => {
|
|
140
|
+
o2 = true, t2.stopPropagation();
|
|
141
|
+
}, isPropagationStopped: () => o2, persist: () => {
|
|
142
|
+
}, timeStamp: t2.timeStamp, type: t2.type };
|
|
143
|
+
for (const e3 in t2) e3 in i2 || "function" == typeof t2[e3] || (i2[e3] = t2[e3]);
|
|
144
|
+
return i2;
|
|
145
|
+
}, W = Object.freeze(Object.defineProperty({ __proto__: null, EmptyCssProperties: O, boundPixel: function(t2, e2 = false, n2 = 0) {
|
|
146
|
+
return t2;
|
|
147
|
+
}, createSyntheticEvent: R, detectIt: N, focusableNodeNames: K, toPrettyKeyCode: H }, Symbol.toStringTag, { value: "Module" }));
|
|
148
|
+
class V {
|
|
149
|
+
constructor(e2, n2) {
|
|
150
|
+
this._target = null, this._groupKey = null, this._root = null, this._parent = null, this._uuid = t.uuidV4(), this._target = e2, this._groupKey = n2 ?? null, this._root = this, this._nodes = /* @__PURE__ */ new Map(), this._nodes.set(n2, this), this._children = /* @__PURE__ */ new Map(), this._listeners = /* @__PURE__ */ new Set(), this._commandsByKey = /* @__PURE__ */ new Map(), this._commandsByShortcut = /* @__PURE__ */ new Map();
|
|
149
151
|
const o2 = this;
|
|
150
|
-
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (
|
|
151
|
-
const n3 = o2._root._listenersByKey, i2 =
|
|
152
|
-
r2 && o2._notifyCommands(r2, "onCommandChange",
|
|
152
|
+
this._unListenersByCommand = /* @__PURE__ */ new Map(), this._listenersByKey = /* @__PURE__ */ new Map(), this._commandsPropertyListener = (t2, e3) => {
|
|
153
|
+
const n3 = o2._root._listenersByKey, i2 = e3.key(), r2 = n3.get(i2);
|
|
154
|
+
r2 && o2._notifyCommands(r2, "onCommandChange", e3);
|
|
153
155
|
};
|
|
154
156
|
}
|
|
155
|
-
_getCommand(
|
|
156
|
-
const
|
|
157
|
-
return
|
|
157
|
+
_getCommand(t2) {
|
|
158
|
+
const e2 = this._commandsByKey.get(t2);
|
|
159
|
+
return e2 || (this._parent?._getCommand(t2) ?? null);
|
|
158
160
|
}
|
|
159
|
-
getCommand(
|
|
161
|
+
getCommand(t2, e2 = false) {
|
|
160
162
|
const n2 = this._root._focused;
|
|
161
163
|
let o2 = n2, i2 = n2 === this;
|
|
162
164
|
for (; !i2 && o2; ) o2 === this && (i2 = true), o2 = o2._parent;
|
|
163
|
-
return (i2 ? n2 : this)._getCommand(
|
|
165
|
+
return (i2 ? n2 : this)._getCommand(t2);
|
|
164
166
|
}
|
|
165
|
-
createChildGroup(
|
|
167
|
+
createChildGroup(t2, e2, n2) {
|
|
166
168
|
let o2;
|
|
167
169
|
if (!n2) {
|
|
168
|
-
let
|
|
169
|
-
for (;
|
|
170
|
-
let n3 =
|
|
171
|
-
n3 && (o2 = n3),
|
|
170
|
+
let t3 = this;
|
|
171
|
+
for (; t3 && !o2; ) {
|
|
172
|
+
let n3 = t3._nodes.get(e2);
|
|
173
|
+
n3 && (o2 = n3), t3 = t3._parent;
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
|
-
o2 || (o2 = new
|
|
175
|
-
const i2 = (
|
|
176
|
-
!
|
|
176
|
+
o2 || (o2 = new V(t2, e2), o2._parent = this, o2._root = this._root, o2._unListenersByCommand = null, o2._listenersByKey = null, o2._commandsPropertyListener = null);
|
|
177
|
+
const i2 = (t3, o3) => {
|
|
178
|
+
!t3.has(e2) || n2 ? t3.set(e2, o3) : void 0 === n2 && console.warn("commandGroup already registered", e2);
|
|
177
179
|
};
|
|
178
180
|
i2(this._root._nodes, o2);
|
|
179
181
|
let r2 = this._parent;
|
|
180
182
|
for (; r2; ) i2(this._nodes, o2), r2 = r2._parent;
|
|
181
|
-
return this._children.set(
|
|
183
|
+
return this._children.set(e2, o2), this._notify("onGroupChange"), o2;
|
|
182
184
|
}
|
|
183
185
|
getKey() {
|
|
184
186
|
return this._groupKey;
|
|
185
187
|
}
|
|
186
|
-
getGroup(
|
|
187
|
-
return this._nodes.get(
|
|
188
|
+
getGroup(t2) {
|
|
189
|
+
return this._nodes.get(t2);
|
|
188
190
|
}
|
|
189
|
-
_addCommands(
|
|
191
|
+
_addCommands(t2, e2 = void 0) {
|
|
190
192
|
const n2 = this._commandsByKey, o2 = this._commandsByShortcut, i2 = this._root._commandsPropertyListener, r2 = this._root._unListenersByCommand;
|
|
191
|
-
for (let s2 = 0; s2 <
|
|
192
|
-
const l2 =
|
|
193
|
-
if (n2.has(a2) && !
|
|
194
|
-
void 0 ===
|
|
193
|
+
for (let s2 = 0; s2 < t2.length; s2++) {
|
|
194
|
+
const l2 = t2[s2], a2 = l2.key();
|
|
195
|
+
if (n2.has(a2) && !e2) {
|
|
196
|
+
void 0 === e2 && console.warn("command already registered", a2);
|
|
195
197
|
continue;
|
|
196
198
|
}
|
|
197
199
|
n2.set(a2, l2);
|
|
@@ -202,55 +204,55 @@ class W {
|
|
|
202
204
|
const u2 = l2.shortcut();
|
|
203
205
|
if (!u2) continue;
|
|
204
206
|
const d2 = Array.isArray(u2) ? u2 : [u2];
|
|
205
|
-
for (let
|
|
206
|
-
const n3 =
|
|
207
|
-
i3 && !
|
|
207
|
+
for (let t3 = 0; t3 < d2.length; t3++) {
|
|
208
|
+
const n3 = X(d2[t3]), i3 = o2.get(n3);
|
|
209
|
+
i3 && !e2 && void 0 === e2 && console.warn(`Shortcut already registered: ${n3}, ${a2}, ${i3}.`), o2.set(n3, a2);
|
|
208
210
|
}
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
213
|
removeFromParent() {
|
|
212
214
|
if (!this._parent) return;
|
|
213
|
-
let
|
|
215
|
+
let t2 = this._parent, e2 = [];
|
|
214
216
|
const n2 = this._groupKey;
|
|
215
|
-
for (;
|
|
216
|
-
|
|
217
|
-
const o2 = (
|
|
218
|
-
|
|
219
|
-
for (let n3 = 0; n3 <
|
|
220
|
-
o2(
|
|
217
|
+
for (; t2; ) e2.push(t2._nodes), t2._nodes.delete(n2), t2 = t2._parent;
|
|
218
|
+
t2 = this._parent;
|
|
219
|
+
const o2 = (t3) => {
|
|
220
|
+
t3._children.forEach((t4) => {
|
|
221
|
+
for (let n3 = 0; n3 < e2.length; n3++) t4._nodes.delete(e2[n3]);
|
|
222
|
+
o2(t4);
|
|
221
223
|
});
|
|
222
224
|
};
|
|
223
225
|
o2(this), this._parent = null, this._notify("onGroupChange");
|
|
224
226
|
}
|
|
225
|
-
addCommands(
|
|
226
|
-
this._addCommands(
|
|
227
|
+
addCommands(t2, e2) {
|
|
228
|
+
this._addCommands(t2, e2), this._notify("onGroupChange");
|
|
227
229
|
}
|
|
228
230
|
getActive() {
|
|
229
231
|
return this._root._focused ?? this._root;
|
|
230
232
|
}
|
|
231
|
-
activate(
|
|
232
|
-
let
|
|
233
|
-
if (
|
|
233
|
+
activate(t2) {
|
|
234
|
+
let e2 = this;
|
|
235
|
+
if (t2 && (e2 = this._nodes.get(t2), !e2)) return void console.warn("group not found", t2);
|
|
234
236
|
let n2 = this._root._focused ?? this._root;
|
|
235
237
|
for (; n2; ) n2 = n2._parent;
|
|
236
|
-
this._root._focused !==
|
|
238
|
+
this._root._focused !== e2 && (this._root._focused = e2, this._notify("onGroupChange"), this._notify("onActiveChange"));
|
|
237
239
|
}
|
|
238
|
-
findCommandByEvent(
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
let n2 =
|
|
240
|
+
findCommandByEvent(t2) {
|
|
241
|
+
const e2 = [];
|
|
242
|
+
t2.altKey && e2.push(A.Alt), t2.shiftKey && e2.push(A.Shift), t2.ctrlKey && e2.push(A.Ctrl), t2.metaKey && e2.push(A.Meta);
|
|
243
|
+
let n2 = X({ key: t2.code, modifiers: e2 });
|
|
242
244
|
const o2 = this._commandsByShortcut;
|
|
243
245
|
let i2 = o2.get(n2);
|
|
244
|
-
i2 || (n2 =
|
|
246
|
+
i2 || (n2 = X({ key: t2.key, modifiers: e2 }), i2 = o2.get(n2)), !i2 && t2.code.startsWith("Digit") && (n2 = X({ key: t2.code.substring(5, t2.code.length), modifiers: e2 }), i2 = this._commandsByShortcut.get(n2)), !i2 && t2.code.startsWith("Key") && (i2 = X({ key: t2.code.substring(3, t2.code.length), modifiers: e2 }), i2 = o2.get(n2));
|
|
245
247
|
let r2 = null;
|
|
246
|
-
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(
|
|
248
|
+
return i2 && (r2 = this._commandsByKey.get(i2), r2 && r2.disabled() && (r2 = null), !r2 || r2.target() && r2.target().contains(t2.target) || (r2 = null)), r2 || (this._parent?.findCommandByEvent(t2) ?? null);
|
|
247
249
|
}
|
|
248
|
-
dispatchToFocusedCommand(
|
|
249
|
-
const
|
|
250
|
-
if (!
|
|
251
|
-
if (
|
|
252
|
-
const n2 =
|
|
253
|
-
return !!n2 && (n2.execute(),
|
|
250
|
+
dispatchToFocusedCommand(t2) {
|
|
251
|
+
const e2 = this.getActive();
|
|
252
|
+
if (!e2) return false;
|
|
253
|
+
if (t2.isDefaultPrevented()) return false;
|
|
254
|
+
const n2 = e2.findCommandByEvent?.(t2);
|
|
255
|
+
return !!n2 && (n2.execute(), t2.preventDefault(), true);
|
|
254
256
|
}
|
|
255
257
|
getRoot() {
|
|
256
258
|
return this._parent ? this._parent.getRoot() : this;
|
|
@@ -258,575 +260,602 @@ class W {
|
|
|
258
260
|
getParent() {
|
|
259
261
|
return this._parent;
|
|
260
262
|
}
|
|
261
|
-
addListener(
|
|
262
|
-
const n2 = this._listeners, o2 =
|
|
263
|
-
if (o2 && !
|
|
263
|
+
addListener(t2, e2) {
|
|
264
|
+
const n2 = this._listeners, o2 = e2?.keys, i2 = this._root._listenersByKey;
|
|
265
|
+
if (o2 && !t2.onCommandChange) throw new Error("keys were provided but the listener does not contain 'onCommandChange'.");
|
|
264
266
|
let r2 = null;
|
|
265
|
-
if (o2) for (let
|
|
266
|
-
const n3 = o2[
|
|
267
|
+
if (o2) for (let e3 = 0; e3 < o2.length; e3++) {
|
|
268
|
+
const n3 = o2[e3];
|
|
267
269
|
if (!n3) continue;
|
|
268
270
|
let s2 = i2.get(n3);
|
|
269
|
-
s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(
|
|
271
|
+
s2 || (s2 = /* @__PURE__ */ new Set(), i2.set(n3, s2)), r2 || (r2 = []), r2.push(s2), s2.add(t2);
|
|
270
272
|
}
|
|
271
|
-
return n2.add(
|
|
272
|
-
if (r2) for (let
|
|
273
|
-
r2[
|
|
273
|
+
return n2.add(t2), () => {
|
|
274
|
+
if (r2) for (let e3 = 0; e3 < r2.length; e3++) {
|
|
275
|
+
r2[e3].delete(t2);
|
|
274
276
|
}
|
|
275
|
-
n2.delete(
|
|
277
|
+
n2.delete(t2);
|
|
276
278
|
};
|
|
277
279
|
}
|
|
278
|
-
_notifyCommands(
|
|
280
|
+
_notifyCommands(t2, e2, n2) {
|
|
279
281
|
const o2 = this;
|
|
280
282
|
setTimeout(() => {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
+
t2.forEach((t3) => {
|
|
284
|
+
t3[e2]?.(o2, n2);
|
|
283
285
|
});
|
|
284
286
|
}, 0);
|
|
285
287
|
}
|
|
286
|
-
_notify(
|
|
288
|
+
_notify(t2, e2) {
|
|
287
289
|
const n2 = this;
|
|
288
290
|
setTimeout(() => {
|
|
289
291
|
n2._listeners.forEach((o2) => {
|
|
290
|
-
o2[
|
|
291
|
-
}), n2._parent && n2._parent._notify(
|
|
292
|
+
o2[t2]?.(n2, e2);
|
|
293
|
+
}), n2._parent && n2._parent._notify(t2, e2);
|
|
292
294
|
}, 0);
|
|
293
295
|
}
|
|
294
296
|
getAllCommands() {
|
|
295
|
-
const
|
|
297
|
+
const t2 = [], e2 = this._groupKey;
|
|
296
298
|
return this._commandsByKey.forEach((n2) => {
|
|
297
|
-
|
|
298
|
-
}), this._children.forEach((
|
|
299
|
-
|
|
300
|
-
}),
|
|
299
|
+
t2.push({ command: n2, groupKey: e2 });
|
|
300
|
+
}), this._children.forEach((e3) => {
|
|
301
|
+
t2.push(...e3.getAllCommands());
|
|
302
|
+
}), t2;
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
|
-
const
|
|
305
|
+
const F = t.getOS() === t.OSType.MacOS || t.getOS() === t.OSType.IOS ? "Cmd" : "Ctrl", j = t.getOS() === t.OSType.MacOS || t.getOS() === t.OSType.IOS ? "⌘" : "^", X = (t2, e2 = false) => {
|
|
304
306
|
const n2 = {};
|
|
305
|
-
for (let
|
|
307
|
+
for (let e3 = 0; t2.modifiers && e3 < t2.modifiers.length; e3++) n2[t2.modifiers[e3]] = true;
|
|
306
308
|
let o2 = "";
|
|
307
|
-
return (n2?.[A.Ctrl] || n2?.[A.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (
|
|
309
|
+
return (n2?.[A.Ctrl] || n2?.[A.Meta]) && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? j : F)), n2?.[A.Alt] && (o2 += e2 ? "⌥" : "Alt"), n2?.[A.Shift] && (o2 += (o2.length > 0 ? "+" : "") + (e2 ? "⇧" : "Shift")), o2 += (o2.length > 0 ? "+" : "") + H(t2.key), o2;
|
|
308
310
|
};
|
|
309
|
-
function
|
|
311
|
+
function Y(e2, n2 = null) {
|
|
310
312
|
const o2 = a(n2);
|
|
311
313
|
o2.current = n2;
|
|
312
|
-
const [i2, r2] = c((
|
|
314
|
+
const [i2, r2] = c((t2) => t2 + 1, 0), s2 = h(() => Array.isArray(e2) ? e2 : [e2], [e2]);
|
|
313
315
|
return u(() => {
|
|
314
316
|
if (!s2 || 0 === s2.length) return;
|
|
315
|
-
const
|
|
316
|
-
o2.current?.onChange?.(
|
|
317
|
+
const e3 = (t2, e4) => {
|
|
318
|
+
o2.current?.onChange?.(e4), r2();
|
|
317
319
|
};
|
|
318
320
|
let i3 = null;
|
|
319
|
-
n2 && (i3 = { onExecute(
|
|
320
|
-
o2.current?.onExecute?.(
|
|
321
|
-
}, onError(
|
|
322
|
-
o2.current?.onError?.(
|
|
321
|
+
n2 && (i3 = { onExecute(t2, e4) {
|
|
322
|
+
o2.current?.onExecute?.(t2, e4);
|
|
323
|
+
}, onError(t2, e4, n3) {
|
|
324
|
+
o2.current?.onError?.(t2, e4, n3);
|
|
323
325
|
} });
|
|
324
326
|
const l2 = /* @__PURE__ */ new Set();
|
|
325
|
-
for (let o3 = 0; o3 < s2.length; o3++) l2.add(s2[o3]?.addPropertyListener(
|
|
327
|
+
for (let o3 = 0; o3 < s2.length; o3++) l2.add(s2[o3]?.addPropertyListener(t.debounce(e3, 0), true)), n2 && l2.add(s2[o3]?.addExecuteListener(i3));
|
|
326
328
|
return () => {
|
|
327
|
-
l2.forEach((
|
|
328
|
-
|
|
329
|
+
l2.forEach((t2) => {
|
|
330
|
+
t2?.();
|
|
329
331
|
});
|
|
330
332
|
};
|
|
331
|
-
}, [
|
|
333
|
+
}, [e2]), i2;
|
|
332
334
|
}
|
|
333
|
-
const
|
|
334
|
-
if (!n2 || !
|
|
335
|
+
const U = (e2, n2) => {
|
|
336
|
+
if (!n2 || !e2 || 0 === n2.length) return t.EmptyArray;
|
|
335
337
|
const o2 = n2.length, i2 = new Array(o2);
|
|
336
|
-
for (let
|
|
337
|
-
const o3 = n2[
|
|
338
|
-
i2[
|
|
338
|
+
for (let t2 = 0; t2 < o2; t2++) {
|
|
339
|
+
const o3 = n2[t2], r2 = o3 ? e2.getCommand(o3) : null;
|
|
340
|
+
i2[t2] = r2;
|
|
339
341
|
}
|
|
340
342
|
return i2;
|
|
341
343
|
};
|
|
342
|
-
function
|
|
344
|
+
function G(t2, e2 = null, n2 = null, o2) {
|
|
343
345
|
const i2 = a(n2);
|
|
344
|
-
i2.current = n2,
|
|
345
|
-
const [r2, s2] = d(
|
|
346
|
+
i2.current = n2, e2 && !Array.isArray(e2) && (e2 = [e2]);
|
|
347
|
+
const [r2, s2] = d(U(t2, e2)), l2 = o2 ? [...o2, t2] : [t2];
|
|
346
348
|
return u(() => {
|
|
347
349
|
const n3 = { onGroupChange: () => {
|
|
348
|
-
const n4 =
|
|
350
|
+
const n4 = U(t2, e2);
|
|
349
351
|
s2(n4), i2.current?.onChange?.(this);
|
|
350
352
|
} };
|
|
351
353
|
let o3;
|
|
352
|
-
|
|
353
|
-
i2.current?.onChange?.(
|
|
354
|
+
e2 && e2.length > 0 && (o3 = { keys: e2 }, n3.onCommandChange = (n4, o4) => {
|
|
355
|
+
i2.current?.onChange?.(t2), s2(U(t2, e2));
|
|
354
356
|
});
|
|
355
|
-
const r3 =
|
|
356
|
-
return s2(l3), i2.current?.onChange && i2.current?.onChange(
|
|
357
|
+
const r3 = t2?.addListener(n3, o3), l3 = U(t2, e2);
|
|
358
|
+
return s2(l3), i2.current?.onChange && i2.current?.onChange(t2), () => {
|
|
357
359
|
r3?.();
|
|
358
360
|
};
|
|
359
361
|
}, l2), r2;
|
|
360
362
|
}
|
|
361
|
-
const
|
|
362
|
-
const { refFocusStart: n2, ...o2 } =
|
|
363
|
+
const q = { Toolbar: "toolbar", Menuitem: "menuitem" }, Z = { 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" }, J = p(f((t2, e2) => {
|
|
364
|
+
const { refFocusStart: n2, ...o2 } = t2, i2 = a(null), r2 = m(() => {
|
|
363
365
|
if (n2) return void n2?.current?.focus();
|
|
364
|
-
const
|
|
365
|
-
let
|
|
366
|
-
const o3 =
|
|
367
|
-
for (let n3 = 0; n3 < o3 &&
|
|
368
|
-
const o4 =
|
|
366
|
+
const t3 = i2.current.parentElement.children;
|
|
367
|
+
let e3 = [];
|
|
368
|
+
const o3 = t3.length;
|
|
369
|
+
for (let n3 = 0; n3 < o3 && t3[n3] !== i2.current; n3++) {
|
|
370
|
+
const o4 = t3[n3], i3 = o4.getAttribute("tabindex");
|
|
369
371
|
if (null == i3 || "-1" === i3) continue;
|
|
370
|
-
"true" !== o4.getAttribute("disabled") && (o4.focus &&
|
|
372
|
+
"true" !== o4.getAttribute("disabled") && (o4.focus && e3.push({ tabindex: parseInt(i3), child: o4 }));
|
|
371
373
|
}
|
|
372
|
-
0 !==
|
|
373
|
-
return
|
|
374
|
-
}),
|
|
374
|
+
0 !== e3.length && (e3.sort(function(t4, e4) {
|
|
375
|
+
return t4.tabindex - e4.tabindex;
|
|
376
|
+
}), e3[0].child.focus());
|
|
375
377
|
}, [n2]);
|
|
376
|
-
return x("div", { tabIndex: 0, ref: L([i2,
|
|
378
|
+
return x("div", { tabIndex: 0, ref: L([i2, e2]), onFocus: r2, ...o2 });
|
|
377
379
|
}));
|
|
378
|
-
const
|
|
379
|
-
const { className: n2, style: o2, children: i2, radius: r2 = 4, strokeWidth: s2 = 1, strokeColor: c2 = "grey", ...u2 } =
|
|
380
|
-
const n3 =
|
|
381
|
-
return (function(
|
|
382
|
-
if (0 ===
|
|
383
|
-
function o4(
|
|
384
|
-
let o5 =
|
|
385
|
-
return i3(
|
|
380
|
+
const Q = p(f((t2, e2) => {
|
|
381
|
+
const { className: n2, style: o2, children: i2, radius: r2 = 4, strokeWidth: s2 = 1, strokeColor: c2 = "grey", ...u2 } = t2, [d2, { width: p2, height: f2 }] = M(), m2 = a(null), _2 = (t3, e3 = 0) => {
|
|
382
|
+
const n3 = t3 / 2, o3 = f2 - n3 + e3;
|
|
383
|
+
return (function(t4, e4, n4 = false) {
|
|
384
|
+
if (0 === e4) return t4;
|
|
385
|
+
function o4(t5, e5, n5) {
|
|
386
|
+
let o5 = e5.x - t5.x, r4 = e5.y - t5.y, s4 = Math.sqrt(o5 * o5 + r4 * r4);
|
|
387
|
+
return i3(t5, e5, Math.min(1, n5 / s4));
|
|
386
388
|
}
|
|
387
|
-
function i3(
|
|
388
|
-
return { x:
|
|
389
|
+
function i3(t5, e5, n5) {
|
|
390
|
+
return { x: t5.x + (e5.x - t5.x) * n5, y: t5.y + (e5.y - t5.y) * n5 };
|
|
389
391
|
}
|
|
390
|
-
function r3(
|
|
391
|
-
|
|
392
|
+
function r3(t5, e5) {
|
|
393
|
+
t5.length > 2 && (t5[t5.length - 2] = e5.x, t5[t5.length - 1] = e5.y);
|
|
392
394
|
}
|
|
393
|
-
function s3(
|
|
394
|
-
return { x: parseFloat(
|
|
395
|
+
function s3(t5) {
|
|
396
|
+
return { x: parseFloat(t5[t5.length - 2]), y: parseFloat(t5[t5.length - 1]) };
|
|
395
397
|
}
|
|
396
|
-
let l2 =
|
|
397
|
-
let n5 =
|
|
398
|
-
return n5 ? (
|
|
399
|
-
}, []).reduce(function(
|
|
400
|
-
return parseFloat(
|
|
398
|
+
let l2 = t4.split(/[,\s]/).reduce(function(t5, e5) {
|
|
399
|
+
let n5 = e5.match("([a-zA-Z])(.+)");
|
|
400
|
+
return n5 ? (t5.push(n5[1]), t5.push(n5[2])) : t5.push(e5), t5;
|
|
401
|
+
}, []).reduce(function(t5, e5) {
|
|
402
|
+
return parseFloat(e5) == e5 && t5.length ? t5[t5.length - 1].push(e5) : t5.push([e5]), t5;
|
|
401
403
|
}, []), a2 = [];
|
|
402
404
|
if (l2.length > 1) {
|
|
403
|
-
let
|
|
404
|
-
"Z" === l2[l2.length - 1][0] && l2[0].length > 2 && (c3 = ["L",
|
|
405
|
-
for (let
|
|
406
|
-
let h2 = a2[a2.length - 1], u3 = l2[
|
|
405
|
+
let t5 = s3(l2[0]), c3 = null;
|
|
406
|
+
"Z" === l2[l2.length - 1][0] && l2[0].length > 2 && (c3 = ["L", t5.x, t5.y], l2[l2.length - 1] = c3), a2.push(l2[0]);
|
|
407
|
+
for (let t6 = 1; t6 < l2.length; t6++) {
|
|
408
|
+
let h2 = a2[a2.length - 1], u3 = l2[t6], d3 = u3 === c3 ? l2[1] : l2[t6 + 1];
|
|
407
409
|
if (d3 && h2 && h2.length > 2 && "L" === u3[0] && d3.length > 2 && "L" === d3[0]) {
|
|
408
|
-
let
|
|
409
|
-
n4 ? (
|
|
410
|
-
let m3 = i3(
|
|
410
|
+
let t7, l3, c4 = s3(h2), p3 = s3(u3), f3 = s3(d3);
|
|
411
|
+
n4 ? (t7 = i3(p3, h2.origPoint || c4, e4), l3 = i3(p3, d3.origPoint || f3, e4)) : (t7 = o4(p3, c4, e4), l3 = o4(p3, f3, e4)), r3(u3, t7), u3.origPoint = p3, a2.push(u3);
|
|
412
|
+
let m3 = i3(t7, p3, 0.5), _3 = i3(p3, l3, 0.5), g3 = ["C", m3.x, m3.y, _3.x, _3.y, l3.x, l3.y];
|
|
411
413
|
g3.origPoint = p3, a2.push(g3);
|
|
412
414
|
} else a2.push(u3);
|
|
413
415
|
}
|
|
414
416
|
if (c3) {
|
|
415
|
-
let
|
|
416
|
-
a2.push(["Z"]), r3(a2[0],
|
|
417
|
+
let t6 = s3(a2[a2.length - 1]);
|
|
418
|
+
a2.push(["Z"]), r3(a2[0], t6);
|
|
417
419
|
}
|
|
418
420
|
} else a2 = l2;
|
|
419
|
-
return a2.reduce(function(
|
|
420
|
-
return
|
|
421
|
+
return a2.reduce(function(t5, e5) {
|
|
422
|
+
return t5 + e5.join(" ") + " ";
|
|
421
423
|
}, "");
|
|
422
424
|
})(`${`M 0 ${n3} L ${r2 - 0.5} ${n3} L ${r2 - 0.5} ${o3} L ${2 * r2} ${o3}`} ${`L ${p2 - 2 * r2} ${o3}`} ${`M ${p2 - 2 * r2} ${o3} L ${p2 - r2} ${o3} L ${p2 - r2} ${n3} L ${p2} ${n3}`}`, r2);
|
|
423
425
|
}, g2 = h(() => _2(s2), [p2, f2, r2, s2]), y2 = h(() => {
|
|
424
426
|
if (0 === r2) return;
|
|
425
|
-
const
|
|
426
|
-
return _2(r2) + `L ${p2} 0 L 0 0 L 0 ${
|
|
427
|
+
const t3 = r2 / 2;
|
|
428
|
+
return _2(r2) + `L ${p2} 0 L 0 0 L 0 ${t3}`;
|
|
427
429
|
}, [g2, r2, s2]), v2 = h(() => ({ style: { clipPath: `path('${y2}')` } }), [y2]);
|
|
428
|
-
return S("div", { className: n2, style: { display: "flex", flexDirection: "row", ...o2 }, ...u2, ref: L([m2, d2,
|
|
429
|
-
})),
|
|
430
|
-
class
|
|
431
|
-
setOverrides(
|
|
432
|
-
super.setOverrides(
|
|
430
|
+
return S("div", { className: n2, style: { display: "flex", flexDirection: "row", ...o2 }, ...u2, ref: L([m2, d2, e2]), children: [l.isValidElement(i2) ? l.cloneElement(i2, v2) : x(E, {}), x("svg", { style: { position: "absolute", top: 0, left: 0, pointerEvents: "none" }, width: p2, height: f2, viewBox: `0 0 ${p2} ${f2}`, children: x("path", { d: g2, stroke: c2, fill: "none", vectorEffect: "non-scaling-stroke", strokeWidth: s2 }) })] });
|
|
431
|
+
})), tt = { Default: "default", Error: "error", Success: "success", Warning: "warning", Info: "info" };
|
|
432
|
+
class et extends e {
|
|
433
|
+
setOverrides(t2) {
|
|
434
|
+
super.setOverrides(t2);
|
|
433
435
|
}
|
|
434
436
|
getDelegate() {
|
|
435
437
|
return this._overrides;
|
|
436
438
|
}
|
|
437
|
-
showMessage(
|
|
439
|
+
showMessage(t2, e2) {
|
|
438
440
|
const o2 = this.getDelegate();
|
|
439
|
-
if (o2?.showMessage) return o2.showMessage(
|
|
440
|
-
|
|
441
|
+
if (o2?.showMessage) return o2.showMessage(t2, e2);
|
|
442
|
+
e2?.type !== tt.Warning ? e2?.type !== tt.Error ? n.log(t2) : n.error(t2) : n.warn(t2);
|
|
441
443
|
}
|
|
442
|
-
showBusy(
|
|
444
|
+
showBusy(t2, e2) {
|
|
443
445
|
const n2 = this.getDelegate();
|
|
444
|
-
return n2?.showBusy ? n2.showBusy(
|
|
445
|
-
|
|
446
|
+
return n2?.showBusy ? n2.showBusy(t2, e2) : new Promise((t3) => {
|
|
447
|
+
t3(() => {
|
|
446
448
|
});
|
|
447
449
|
});
|
|
448
450
|
}
|
|
449
|
-
showWindow(
|
|
451
|
+
showWindow(t2, e2) {
|
|
450
452
|
const n2 = this.getDelegate();
|
|
451
|
-
if (n2?.showWindow) return n2.showWindow(
|
|
453
|
+
if (n2?.showWindow) return n2.showWindow(t2, e2);
|
|
452
454
|
}
|
|
453
|
-
showError(
|
|
454
|
-
const
|
|
455
|
-
|
|
455
|
+
showError(t2) {
|
|
456
|
+
const e2 = this.getDelegate();
|
|
457
|
+
e2?.showError ? e2.showError(t2) : n.error(t2);
|
|
456
458
|
}
|
|
457
|
-
showOptions(
|
|
458
|
-
const
|
|
459
|
-
return
|
|
459
|
+
showOptions(t2) {
|
|
460
|
+
const e2 = this.getDelegate();
|
|
461
|
+
return e2?.showOptions ? e2.showOptions(t2) : Promise.resolve("");
|
|
460
462
|
}
|
|
461
|
-
showInput(
|
|
462
|
-
const
|
|
463
|
-
return
|
|
463
|
+
showInput(t2) {
|
|
464
|
+
const e2 = this.getDelegate();
|
|
465
|
+
return e2?.showInput ? e2.showInput(t2) : Promise.resolve({ input: "", option: "" });
|
|
464
466
|
}
|
|
465
467
|
}
|
|
466
|
-
const
|
|
467
|
-
const
|
|
468
|
-
return n.setOverrides(
|
|
469
|
-
n.setOverrides(
|
|
468
|
+
const nt = _(new et()), ot = ({ children: t2, notifier: e2 }) => (l.useEffect(() => {
|
|
469
|
+
const t3 = n.getOverrides();
|
|
470
|
+
return n.setOverrides(e2), () => {
|
|
471
|
+
n.setOverrides(t3);
|
|
470
472
|
};
|
|
471
|
-
}, [
|
|
472
|
-
function
|
|
473
|
-
const { threshold:
|
|
474
|
-
s2.current =
|
|
473
|
+
}, [e2]), l.createElement(nt.Provider, { value: e2 }, t2)), it = () => g(nt), rt = 3, st = 0.5, lt = 50, at = (t2) => ({ x: t2.x, y: t2.y, width: t2.width, height: t2.height, top: t2.top, left: t2.left, right: t2.right, bottom: t2.bottom });
|
|
474
|
+
function ct(t2 = {}) {
|
|
475
|
+
const { threshold: e2 = st, stillnessThreshold: n2 = rt, maxHierarchyDepth: o2 = lt } = t2, [i2, r2] = M(), s2 = a(null), [l2, h2] = c((t3) => t3 + 1, 0), p2 = a(void 0), f2 = a({ x: 0, y: 0, width: 0, height: 0, top: 0, left: 0, right: 0, bottom: 0 }), _2 = m((t3) => {
|
|
476
|
+
s2.current = t3, "function" == typeof i2 && i2(t3);
|
|
475
477
|
}, [i2]), [g2, y2] = d(r2);
|
|
476
478
|
return u(() => {
|
|
477
479
|
r2 && !g2 && y2(r2);
|
|
478
480
|
}, [r2, g2]), u(() => {
|
|
479
|
-
const
|
|
480
|
-
if (!
|
|
481
|
+
const t3 = s2.current;
|
|
482
|
+
if (!t3) return;
|
|
481
483
|
let i3 = false, r3 = 0;
|
|
482
484
|
const l3 = () => {
|
|
483
|
-
if (!
|
|
484
|
-
const o3 =
|
|
485
|
-
Math.abs(o3.x - s3.x) >
|
|
485
|
+
if (!t3) return;
|
|
486
|
+
const o3 = t3.getBoundingClientRect(), s3 = f2.current;
|
|
487
|
+
Math.abs(o3.x - s3.x) > e2 || Math.abs(o3.y - s3.y) > e2 || Math.abs(o3.width - s3.width) > e2 || Math.abs(o3.height - s3.height) > e2 ? (i3 || (i3 = true, y2(at(o3)), h2()), r3 = 0) : r3++, i3 && r3 >= n2 && (i3 = false, y2(at(o3)), h2()), f2.current = at(o3), p2.current = requestAnimationFrame(l3);
|
|
486
488
|
};
|
|
487
489
|
p2.current = requestAnimationFrame(l3);
|
|
488
|
-
const a2 = (
|
|
490
|
+
const a2 = (t4) => {
|
|
489
491
|
i3 = true, h2();
|
|
490
|
-
}, c2 = (
|
|
492
|
+
}, c2 = (t4) => {
|
|
491
493
|
i3 = false, r3 = n2, h2();
|
|
492
494
|
};
|
|
493
|
-
let u2 =
|
|
495
|
+
let u2 = t3;
|
|
494
496
|
const d2 = [];
|
|
495
497
|
for (; u2 && u2 !== document.documentElement && (u2.addEventListener("animationstart", a2, true), u2.addEventListener("animationend", c2, true), u2.addEventListener("transitionstart", a2, true), u2.addEventListener("transitionend", c2, true), d2.push(u2), u2 = u2.parentElement, !(d2.length > o2)); ) ;
|
|
496
498
|
return () => {
|
|
497
|
-
p2.current && cancelAnimationFrame(p2.current), d2.forEach((
|
|
498
|
-
|
|
499
|
+
p2.current && cancelAnimationFrame(p2.current), d2.forEach((t4) => {
|
|
500
|
+
t4.removeEventListener("animationstart", a2, true), t4.removeEventListener("animationend", c2, true), t4.removeEventListener("transitionstart", a2, true), t4.removeEventListener("transitionend", c2, true);
|
|
499
501
|
});
|
|
500
502
|
};
|
|
501
|
-
}, [l2, r2,
|
|
503
|
+
}, [l2, r2, e2, n2, o2]), [_2, g2];
|
|
502
504
|
}
|
|
503
|
-
const
|
|
504
|
-
const n2 = m((...
|
|
505
|
+
const ht = (t2, e2) => {
|
|
506
|
+
const n2 = m((...e3) => t2?.(...e3), e2), o2 = a(null);
|
|
505
507
|
o2.current = n2;
|
|
506
|
-
const i2 = m((...
|
|
508
|
+
const i2 = m((...t3) => o2.current?.(...t3), []);
|
|
507
509
|
if (o2.current) return i2;
|
|
508
510
|
};
|
|
509
|
-
function
|
|
510
|
-
const [
|
|
511
|
+
function ut(t2) {
|
|
512
|
+
const [e2, n2] = d("undefined" != typeof window ? window.devicePixelRatio : 1), o2 = a(null);
|
|
511
513
|
return u(() => {
|
|
512
514
|
if (!("undefined" != typeof window && "matchMedia" in window)) return;
|
|
513
|
-
const
|
|
514
|
-
const
|
|
515
|
-
|
|
515
|
+
const t3 = () => {
|
|
516
|
+
const e3 = window.matchMedia(`screen and (resolution: ${window.devicePixelRatio}dppx)`);
|
|
517
|
+
e3.addEventListener("change", t3, { once: true, passive: true }), n2(window.devicePixelRatio), o2.current = { mediaMatcher: e3, listener: t3 };
|
|
516
518
|
};
|
|
517
|
-
return
|
|
519
|
+
return t3(), () => {
|
|
518
520
|
o2.current && o2.current.mediaMatcher.removeEventListener("change", o2.current.listener);
|
|
519
521
|
};
|
|
520
|
-
}, [
|
|
522
|
+
}, [t2]), e2;
|
|
521
523
|
}
|
|
522
|
-
function
|
|
524
|
+
function dt(t2) {
|
|
523
525
|
if ("undefined" == typeof window) return 1;
|
|
524
|
-
const { defaultDpr:
|
|
526
|
+
const { defaultDpr: e2 = 1, maxDpr: n2 = 3, round: o2 = true } = t2 || {}, i2 = "undefined" != typeof window && "number" == typeof window.devicePixelRatio ? window.devicePixelRatio : e2;
|
|
525
527
|
return Math.min(Math.max(1, o2 ? Math.floor(i2) : i2), n2);
|
|
526
528
|
}
|
|
527
|
-
function
|
|
528
|
-
const o2 =
|
|
529
|
+
function pt(t2, e2, n2) {
|
|
530
|
+
const o2 = ht(e2, [e2]);
|
|
529
531
|
u(() => {
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
+
const e3 = (e4) => {
|
|
533
|
+
t2.current && !t2.current.contains(e4.target) && o2(e4);
|
|
532
534
|
};
|
|
533
|
-
return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown",
|
|
534
|
-
document.removeEventListener("mousedown",
|
|
535
|
+
return n2 && false === n2.mouseEvents || (document.addEventListener("mousedown", e3), document.addEventListener("touchstart", e3)), n2 && false === n2.focusEvents || document.addEventListener("focus", e3), () => {
|
|
536
|
+
document.removeEventListener("mousedown", e3), document.removeEventListener("touchstart", e3), document.removeEventListener("focus", e3);
|
|
535
537
|
};
|
|
536
|
-
}, [
|
|
538
|
+
}, [t2]);
|
|
539
|
+
}
|
|
540
|
+
let ft = 0;
|
|
541
|
+
function mt() {
|
|
542
|
+
const [t2, e2] = d(!!document.fullscreenElement), n2 = m(() => {
|
|
543
|
+
const t3 = document.fullscreenElement;
|
|
544
|
+
return t3 ? t3.querySelector(".fullscreen-portal-root") || t3 : document.body;
|
|
545
|
+
}, []);
|
|
546
|
+
return u(() => {
|
|
547
|
+
function t3() {
|
|
548
|
+
const t4 = document.fullscreenElement;
|
|
549
|
+
if (e2(!!t4), !t4) return;
|
|
550
|
+
let n3 = t4.querySelector(".fullscreen-portal-root");
|
|
551
|
+
n3 || (n3 = document.createElement("div"), n3.className = "fullscreen-portal-root _fullscreen-portal-root_1mjsr_4", t4.appendChild(n3));
|
|
552
|
+
}
|
|
553
|
+
return ft++, t3(), document.addEventListener("fullscreenchange", t3), () => {
|
|
554
|
+
document.removeEventListener("fullscreenchange", t3), ft--, ft <= 0 && (document.querySelectorAll(".fullscreen-portal-root").forEach((t4) => {
|
|
555
|
+
t4.parentNode && t4.parentNode.removeChild(t4);
|
|
556
|
+
}), ft = 0);
|
|
557
|
+
};
|
|
558
|
+
}, []), { getPortalContainer: n2, isFullscreen: t2 };
|
|
537
559
|
}
|
|
538
|
-
function
|
|
539
|
-
if (!
|
|
540
|
-
const { onPointerDown:
|
|
560
|
+
function _t(t2) {
|
|
561
|
+
if (!t2) throw new Error("must have a PointerHandlerOptions");
|
|
562
|
+
const { onPointerDown: e2, onPointerUp: n2, onPointerMoveOrWait: o2, processTouch: i2 = false, consumeTouch: r2 = true } = t2, s2 = ht(e2, [e2]), l2 = ht(n2, [n2]), c2 = ht(o2, [o2]), h2 = a(false), d2 = t2?.timerInitial ?? 230, p2 = t2?.timerContinuous ?? d2 / 2, f2 = a(null), _2 = a(null), g2 = a(null), y2 = a(null), v2 = m(() => {
|
|
541
563
|
y2.current && (clearTimeout(y2.current), y2.current = null);
|
|
542
|
-
}, []), w2 = m((
|
|
564
|
+
}, []), w2 = m((t3) => {
|
|
543
565
|
y2.current = setTimeout(() => {
|
|
544
566
|
window.requestAnimationFrame(() => {
|
|
545
|
-
false
|
|
567
|
+
if (false === h2.current) return;
|
|
568
|
+
const t4 = _2.current, e3 = f2.current, n3 = R(t4, e3.currentTarget);
|
|
569
|
+
c2?.(n3, g2.current, e3);
|
|
546
570
|
}), w2(p2);
|
|
547
|
-
},
|
|
571
|
+
}, t3 ?? d2);
|
|
548
572
|
}, []);
|
|
549
573
|
u(() => () => v2(), []);
|
|
550
|
-
const b2 = i2 ? "pointer" : "mouse", x2 = m((
|
|
551
|
-
|
|
552
|
-
}, []), S2 =
|
|
553
|
-
document.removeEventListener(`${b2}move`, M2), document.removeEventListener(`${b2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup",
|
|
554
|
-
|
|
574
|
+
const b2 = i2 ? "pointer" : "mouse", x2 = m((t3) => {
|
|
575
|
+
t3.stopPropagation(), t3.stopImmediatePropagation(), t3.preventDefault();
|
|
576
|
+
}, []), S2 = ht((t3) => {
|
|
577
|
+
document.removeEventListener(`${b2}move`, M2), document.removeEventListener(`${b2}up`, S2), document.removeEventListener("keydown", T2), document.removeEventListener("keyup", C2), document.removeEventListener("touchstart", x2, { capture: true }), document.removeEventListener("touchmove", x2, { capture: true }), window.removeEventListener("blur", E2), v2(), window.requestAnimationFrame(() => {
|
|
578
|
+
if (false === h2.current) return;
|
|
579
|
+
h2.current = false;
|
|
580
|
+
const e3 = t3, n3 = f2.current, o3 = R(e3, n3.currentTarget);
|
|
581
|
+
l2?.(o3, g2.current, n3), g2.current = null;
|
|
555
582
|
});
|
|
556
583
|
}, []), E2 = m(() => {
|
|
557
584
|
false !== h2.current && (h2.current = false, S2(_2.current));
|
|
558
|
-
}, []), L2 =
|
|
585
|
+
}, []), L2 = ht(() => {
|
|
559
586
|
v2(), w2(p2), window.requestAnimationFrame(() => {
|
|
560
|
-
false
|
|
587
|
+
if (false === h2.current) return;
|
|
588
|
+
const t3 = _2.current, e3 = f2.current, n3 = R(t3, e3.currentTarget);
|
|
589
|
+
c2?.(n3, g2.current, e3);
|
|
561
590
|
});
|
|
562
|
-
}, [p2]), M2 =
|
|
563
|
-
_2.current =
|
|
564
|
-
}, []), T2 =
|
|
565
|
-
g2.current = { ctrlKey:
|
|
566
|
-
}, []),
|
|
567
|
-
g2.current = { ctrlKey:
|
|
591
|
+
}, [p2]), M2 = ht((t3) => {
|
|
592
|
+
_2.current = t3, L2();
|
|
593
|
+
}, []), T2 = ht((t3) => {
|
|
594
|
+
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
595
|
+
}, []), C2 = ht((t3) => {
|
|
596
|
+
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey }, L2();
|
|
568
597
|
}, [p2]);
|
|
569
|
-
return
|
|
570
|
-
if (
|
|
571
|
-
g2.current = { ctrlKey:
|
|
572
|
-
false !== s2(
|
|
598
|
+
return ht((t3) => {
|
|
599
|
+
if (t3.isDefaultPrevented()) return;
|
|
600
|
+
g2.current = { ctrlKey: t3.ctrlKey, shiftKey: t3.shiftKey, altKey: t3.altKey, metaKey: t3.metaKey };
|
|
601
|
+
false !== s2(t3, g2.current) && (f2.current = t3, _2.current = t3.nativeEvent, document.addEventListener(`${b2}up`, S2, { passive: false }), document.addEventListener(`${b2}move`, M2, { passive: false }), document.addEventListener("keydown", T2, { passive: false }), document.addEventListener("keyup", C2, { passive: false }), window.addEventListener("blur", E2, { passive: true }), i2 && r2 && (document.addEventListener("touchstart", x2, { passive: false, capture: true }), document.addEventListener("touchmove", x2, { passive: false, capture: true })), h2.current = true, w2(d2));
|
|
573
602
|
}, [d2, i2]);
|
|
574
603
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
577
|
-
|
|
578
|
-
}, ...
|
|
604
|
+
function gt(t2, e2) {
|
|
605
|
+
return _t({ onPointerDown: t2, onPointerMoveOrWait: (e3, n2, o2) => {
|
|
606
|
+
t2?.(o2);
|
|
607
|
+
}, ...e2 });
|
|
579
608
|
}
|
|
580
|
-
const
|
|
581
|
-
const o2 = a(
|
|
582
|
-
if ("function" != typeof
|
|
583
|
-
const i2 =
|
|
609
|
+
const yt = ({ initValue: t2, useHookBody: e2, applyStateChange: n2 }) => {
|
|
610
|
+
const o2 = a(t2);
|
|
611
|
+
if ("function" != typeof e2) throw new Error("function expected as hook body parameter. got " + typeof e2);
|
|
612
|
+
const i2 = e2();
|
|
584
613
|
return y(() => {
|
|
585
614
|
o2.current !== i2 && (o2.current = i2, n2(i2));
|
|
586
615
|
}, [n2, i2]), null;
|
|
587
|
-
},
|
|
588
|
-
console && console.warn && console.warn(
|
|
589
|
-
},
|
|
590
|
-
let
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
},
|
|
594
|
-
const [
|
|
595
|
-
return o2.current =
|
|
596
|
-
let
|
|
616
|
+
}, vt = (t2) => {
|
|
617
|
+
console && console.warn && console.warn(t2);
|
|
618
|
+
}, wt = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || void 0;
|
|
619
|
+
let bt = 1, xt = false, St = false;
|
|
620
|
+
const Et = [], Lt = [], Mt = () => {
|
|
621
|
+
Lt.forEach((t2) => t2());
|
|
622
|
+
}, Tt = ({ automaticContainerInternalUseOnly: t2 }) => {
|
|
623
|
+
const [e2, n2] = d([]), o2 = a([]);
|
|
624
|
+
return o2.current = e2, t2 || false !== xt || (St = true), u(() => {
|
|
625
|
+
let e3 = true;
|
|
597
626
|
function i2() {
|
|
598
|
-
if (
|
|
627
|
+
if (e3) return Lt[0] !== i2 ? (t2 || true !== xt || vt("SingletonHooksContainer is mounted after some singleton hook has been used.Your SingletonHooksContainer will not be used in favor of internal one."), void n2((t3) => [])) : void n2([...Et]);
|
|
599
628
|
}
|
|
600
|
-
return
|
|
601
|
-
|
|
629
|
+
return Lt.push(i2), Mt(), () => {
|
|
630
|
+
e3 = false, o2.current?.length > 0 && vt("SingletonHooksContainer is unmounted, but it has active singleton hooks. They will be reevaluated once SingletonHooksContainer is mounted again"), Lt.splice(Lt.indexOf(i2), 1), Mt();
|
|
602
631
|
};
|
|
603
|
-
}, [
|
|
604
|
-
},
|
|
605
|
-
const
|
|
606
|
-
return
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
|
|
610
|
-
} else
|
|
611
|
-
})(
|
|
612
|
-
|
|
632
|
+
}, [t2]), x(E, { children: e2.map(({ hook: t3, key: e3 }) => v(yt, { ...t3, key: e3 })) });
|
|
633
|
+
}, Ct = (t2) => {
|
|
634
|
+
const e2 = bt++;
|
|
635
|
+
return Et.push({ hook: t2, key: e2 }), 0 === Lt.length && false === St && (xt = true, ((t3) => {
|
|
636
|
+
if (wt.document && wt.document.createElement) {
|
|
637
|
+
const e3 = wt.document.createElement("div");
|
|
638
|
+
C(e3).render(x(t3, { automaticContainerInternalUseOnly: true }));
|
|
639
|
+
} else vt("Can not mount SingletonHooksContainer on server side. Did you manage to run useEffect on server? Please mount SingletonHooksContainer into your components tree manually.");
|
|
640
|
+
})(Tt)), Mt(), () => {
|
|
641
|
+
Et.splice(Et.findIndex((t3) => t3.key === e2), 1), Mt();
|
|
613
642
|
};
|
|
614
643
|
};
|
|
615
|
-
let
|
|
616
|
-
|
|
644
|
+
let kt = null;
|
|
645
|
+
kt || (kt = (t2, e2, n2 = {}) => {
|
|
617
646
|
let o2, i2, r2 = false, s2 = false, l2 = [], { unmountIfNoConsumers: a2 = false } = n2;
|
|
618
|
-
const c2 = (
|
|
619
|
-
i2 =
|
|
620
|
-
}, h2 = () => (s2 || (i2 = "function" == typeof
|
|
647
|
+
const c2 = (t3) => {
|
|
648
|
+
i2 = t3, k(() => l2.forEach((e3) => e3(t3)));
|
|
649
|
+
}, h2 = () => (s2 || (i2 = "function" == typeof t2 ? t2() : t2, s2 = true), i2);
|
|
621
650
|
return () => {
|
|
622
651
|
const [n3, s3] = d(h2);
|
|
623
|
-
return u(() => (r2 || (r2 = true, o2 =
|
|
652
|
+
return u(() => (r2 || (r2 = true, o2 = Ct({ initValue: t2, useHookBody: e2, applyStateChange: c2 })), l2.push(s3), i2 !== n3 && s3(i2), () => {
|
|
624
653
|
l2.splice(l2.indexOf(s3), 1), 0 === l2.length && a2 && (o2(), r2 = false);
|
|
625
654
|
}), []), n3;
|
|
626
655
|
};
|
|
627
656
|
});
|
|
628
|
-
const
|
|
629
|
-
let
|
|
657
|
+
const Pt = kt;
|
|
658
|
+
let Dt = () => {
|
|
630
659
|
console.warn("You must call useEditMode before setting its state.");
|
|
631
660
|
};
|
|
632
|
-
const
|
|
633
|
-
const [
|
|
634
|
-
return
|
|
635
|
-
}),
|
|
636
|
-
const
|
|
637
|
-
return h(() => ({ setMode: (
|
|
638
|
-
|
|
639
|
-
}, getMode: () =>
|
|
640
|
-
},
|
|
661
|
+
const At = Pt(null, () => {
|
|
662
|
+
const [t2, e2] = d(null);
|
|
663
|
+
return Dt = e2, t2;
|
|
664
|
+
}), zt = () => {
|
|
665
|
+
const t2 = At();
|
|
666
|
+
return h(() => ({ setMode: (t3) => {
|
|
667
|
+
Dt((e2) => ("function" == typeof t3 && (t3 = t3(e2)), t3?.onModeChange?.(t3 ?? null), t3));
|
|
668
|
+
}, getMode: () => t2 }), [t2]);
|
|
669
|
+
}, Bt = Pt({ setClipboard: (t2) => {
|
|
641
670
|
throw new Error("This is only available via the useClipboard.");
|
|
642
671
|
}, getClipboard: () => o.Global, refNativeCopy: { current: null }, refNativeLastKey: { current: null } }, () => {
|
|
643
|
-
const [
|
|
644
|
-
return { setClipboard: (
|
|
645
|
-
}),
|
|
646
|
-
const { source: n2, target: s2, onPaste: l2, onClipboardUpdate: a2, commands: c2 } =
|
|
672
|
+
const [t2, e2] = d(o.Global);
|
|
673
|
+
return { setClipboard: (t3) => e2(t3), getClipboard: () => t2, refNativeCopy: a(null), refNativeLastKey: a(null) };
|
|
674
|
+
}), $t = (e2) => {
|
|
675
|
+
const { source: n2, target: s2, onPaste: l2, onClipboardUpdate: a2, commands: c2 } = e2, d2 = it(), p2 = ht(a2, [a2]), f2 = ht(l2, [l2]), { getClipboard: _2, refNativeCopy: g2 } = Bt(), y2 = _2();
|
|
647
676
|
h(() => {
|
|
648
|
-
const
|
|
677
|
+
const t2 = n2?.element, e3 = s2?.element ?? n2?.element;
|
|
649
678
|
if (!c2) return;
|
|
650
|
-
const o2 = [new
|
|
679
|
+
const o2 = [new I("cut", t2, { label: "Cut", description: "Remove the selection and put it on the clipboard so you can paste it somewhere else.", icon: "cut", shortcut: { key: "X", modifiers: [A.Ctrl] } }), new I("copy", t2, { label: "Copy", description: "Put a copy of the selection on the clipboard so you can paste it somewhere else.", icon: "copy", shortcut: { key: "C", modifiers: [A.Ctrl] } }), new I("paste", e3, { label: "Paste", description: "Add content on the clipboard to your document.", icon: "paste.yellow", shortcut: [{ key: "V", modifiers: [A.Ctrl] }, { key: "F8", modifiers: [A.Ctrl] }] })];
|
|
651
680
|
c2?.addCommands(o2, true);
|
|
652
681
|
}, [c2]);
|
|
653
|
-
const v2 =
|
|
682
|
+
const v2 = ht(async (t2) => {
|
|
654
683
|
if (!n2?.element) return;
|
|
655
|
-
let
|
|
684
|
+
let e3 = null;
|
|
656
685
|
try {
|
|
657
|
-
|
|
658
|
-
} catch (
|
|
659
|
-
throw
|
|
686
|
+
e3 = n2.doCopy?.(t2), "string" == typeof e3 ? await y2.writeText(e3) : await y2.writeReference(e3);
|
|
687
|
+
} catch (t3) {
|
|
688
|
+
throw t3;
|
|
660
689
|
}
|
|
661
|
-
}, [n2, d2]), w2 =
|
|
662
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
g2.current = { sourceElement:
|
|
690
|
+
}, [n2, d2]), w2 = ht(async (t2) => {
|
|
691
|
+
const e3 = n2?.element?.();
|
|
692
|
+
if (e3) {
|
|
693
|
+
g2.current = { sourceElement: e3, args: t2 };
|
|
665
694
|
try {
|
|
666
|
-
await v2(
|
|
667
|
-
} catch (
|
|
668
|
-
d2.showError?.(
|
|
695
|
+
await v2(t2);
|
|
696
|
+
} catch (t3) {
|
|
697
|
+
d2.showError?.(t3);
|
|
669
698
|
}
|
|
670
699
|
}
|
|
671
700
|
}, [n2?.element, d2]), b2 = m(() => {
|
|
672
701
|
w2({ isCut: true });
|
|
673
|
-
}, []), x2 =
|
|
702
|
+
}, []), x2 = ht(async (t2, e3, n3) => {
|
|
674
703
|
try {
|
|
675
|
-
if (false === await
|
|
676
|
-
f2?.(
|
|
677
|
-
} catch (
|
|
678
|
-
d2.showError?.(
|
|
704
|
+
if (false === await t2.doPaste(e3, n3)) return;
|
|
705
|
+
f2?.(e3, n3);
|
|
706
|
+
} catch (t3) {
|
|
707
|
+
d2.showError?.(t3);
|
|
679
708
|
}
|
|
680
|
-
}, [f2]), S2 =
|
|
709
|
+
}, [f2]), S2 = ht(async (e3, n3, o2) => {
|
|
681
710
|
const i2 = s2?.element?.();
|
|
682
|
-
if (i2 && await
|
|
711
|
+
if (i2 && await t.whenFocus(i2), !e3 && !n3) return;
|
|
683
712
|
const r2 = await d2.showBusy?.("Pasting...");
|
|
684
713
|
if (n3) try {
|
|
685
714
|
return await x2(s2, n3, o2), void r2?.();
|
|
686
|
-
} catch (
|
|
687
|
-
r2?.(), d2.showError?.(
|
|
715
|
+
} catch (t2) {
|
|
716
|
+
r2?.(), d2.showError?.(t2);
|
|
688
717
|
}
|
|
689
718
|
let l3, a3 = s2.importFromExternal;
|
|
690
|
-
a3 || (a3 = (
|
|
719
|
+
a3 || (a3 = (t2, n4) => ({ getItemType: () => "text", toText: () => e3.text, isClipboardItem: true }));
|
|
691
720
|
try {
|
|
692
|
-
l3 = await a3(
|
|
693
|
-
} catch (
|
|
694
|
-
r2?.(), d2.showError?.(
|
|
721
|
+
l3 = await a3(e3, { isCut: false });
|
|
722
|
+
} catch (t2) {
|
|
723
|
+
r2?.(), d2.showError?.(t2);
|
|
695
724
|
}
|
|
696
725
|
if (l3) try {
|
|
697
|
-
const
|
|
698
|
-
await x2(s2,
|
|
699
|
-
} catch (
|
|
700
|
-
r2?.(), d2.showError?.(
|
|
726
|
+
const t2 = await Promise.resolve(l3);
|
|
727
|
+
await x2(s2, t2, o2), r2?.();
|
|
728
|
+
} catch (t2) {
|
|
729
|
+
r2?.(), d2.showError?.(t2);
|
|
701
730
|
}
|
|
702
731
|
else r2?.();
|
|
703
|
-
}, [x2, s2, d2]), E2 =
|
|
732
|
+
}, [x2, s2, d2]), E2 = ht(async (t2) => {
|
|
704
733
|
if (s2?.element) try {
|
|
705
|
-
const
|
|
706
|
-
if (
|
|
734
|
+
const e3 = await y2.readReference();
|
|
735
|
+
if (e3) return void await S2(null, e3, t2);
|
|
707
736
|
const n3 = [];
|
|
708
737
|
n3[0] = await i.readStringFromClipboard(y2, r.plain), n3[1] = await i.readHTMLFromClipboard(y2, r.html), n3[2] = await i.readBlobFromClipboard(y2, r.png);
|
|
709
738
|
const o2 = { text: n3[0] ?? null, html: n3[1] ?? null, image: n3[2] ?? null };
|
|
710
|
-
await S2(o2, null,
|
|
711
|
-
} catch (
|
|
712
|
-
if ("Document is not focused." ===
|
|
713
|
-
d2.showError?.(
|
|
739
|
+
await S2(o2, null, t2);
|
|
740
|
+
} catch (t3) {
|
|
741
|
+
if ("Document is not focused." === t3?.message) return;
|
|
742
|
+
d2.showError?.(t3);
|
|
714
743
|
}
|
|
715
744
|
}, [S2, s2?.element, d2]);
|
|
716
|
-
return
|
|
717
|
-
}, [n2?.element]),
|
|
745
|
+
return ht(async (t2) => {
|
|
746
|
+
}, [n2?.element]), ht(async (t2) => {
|
|
718
747
|
}, [s2?.element, S2, d2]), u(() => {
|
|
719
748
|
if (!y2) return;
|
|
720
|
-
const
|
|
721
|
-
const
|
|
722
|
-
p2?.(
|
|
723
|
-
},
|
|
749
|
+
const t2 = async (t3) => {
|
|
750
|
+
const e4 = await y2.readReference();
|
|
751
|
+
p2?.(e4);
|
|
752
|
+
}, e3 = (t3) => {
|
|
724
753
|
d2.showMessage?.(o.ErrorMessages.PermsRead, { onceKey: "clipboard.features" });
|
|
725
|
-
}, n3 = (
|
|
754
|
+
}, n3 = (t3) => {
|
|
726
755
|
d2.showMessage?.(o.ErrorMessages.PermsWrite, { onceKey: "clipboard.features" });
|
|
727
756
|
};
|
|
728
|
-
return y2.addEventListener("clipboardchange",
|
|
729
|
-
y2.removeEventListener("clipboardchange",
|
|
757
|
+
return y2.addEventListener("clipboardchange", t2), y2.addEventListener("clipboarderrorread", e3), y2.addEventListener("clipboarderrorwrite", n3), () => {
|
|
758
|
+
y2.removeEventListener("clipboardchange", t2), y2.removeEventListener("clipboarderrorread", e3), y2.removeEventListener("clipboarderrorwrite", n3);
|
|
730
759
|
};
|
|
731
760
|
}, [y2, d2]), u(() => {
|
|
732
761
|
}, [v2, S2, n2, s2]), u(() => {
|
|
733
762
|
c2?.getCommand("cut")?.updateCallback(b2).update({ disabled: !n2 || !s2 }), c2?.getCommand("copy")?.updateCallback(w2).update({ disabled: !n2 }), c2?.getCommand("paste")?.updateCallback(E2).update({ disabled: !s2 });
|
|
734
763
|
}, [n2, s2, c2]), { paste: E2, copy: w2, clipboard: y2 };
|
|
735
764
|
};
|
|
736
|
-
function
|
|
737
|
-
const n2 = a(
|
|
765
|
+
function It(t2, e2 = true) {
|
|
766
|
+
const n2 = a(t2);
|
|
738
767
|
u(() => {
|
|
739
|
-
if (
|
|
740
|
-
const
|
|
741
|
-
Object.keys(
|
|
768
|
+
if (e2) {
|
|
769
|
+
const e3 = Object.entries(t2).reduce((t3, [e4, o2]) => (n2.current[e4] !== o2 && (t3[e4] = [n2.current[e4], o2]), t3), {});
|
|
770
|
+
Object.keys(e3).length > 0 && console.log("Changed props:", e3);
|
|
742
771
|
}
|
|
743
|
-
n2.current =
|
|
772
|
+
n2.current = t2;
|
|
744
773
|
});
|
|
745
774
|
}
|
|
746
|
-
let
|
|
747
|
-
var
|
|
748
|
-
const
|
|
749
|
-
const
|
|
750
|
-
const [
|
|
751
|
-
return
|
|
752
|
-
null ==
|
|
775
|
+
let Kt = false, Ot = 0;
|
|
776
|
+
var Nt = "undefined" != typeof document ? y : u;
|
|
777
|
+
const Ht = () => "sheetxl-ui-" + Ot++;
|
|
778
|
+
const Rt = l["useId".toString()], Wt = null != Rt ? Rt : function() {
|
|
779
|
+
const [t2, e2] = l.useState(() => Kt ? Ht() : void 0);
|
|
780
|
+
return Nt(() => {
|
|
781
|
+
null == t2 && e2(Ht());
|
|
753
782
|
}, []), l.useEffect(() => {
|
|
754
|
-
|
|
755
|
-
}, []),
|
|
756
|
-
},
|
|
757
|
-
function
|
|
783
|
+
Kt || (Kt = true);
|
|
784
|
+
}, []), t2;
|
|
785
|
+
}, Vt = [];
|
|
786
|
+
function Ft(t2, e2, n2 = Vt) {
|
|
758
787
|
const o2 = a(null);
|
|
759
|
-
return w(
|
|
788
|
+
return w(t2, () => {
|
|
760
789
|
if (!o2.current) return;
|
|
761
|
-
const
|
|
790
|
+
const t3 = o2.current, n3 = e2?.();
|
|
762
791
|
if (!n3 || "object" != typeof n3) throw new Error("attributes must return a plain object of values");
|
|
763
792
|
const i2 = Object.keys(n3), r2 = i2.length;
|
|
764
|
-
for (let
|
|
765
|
-
const o3 = i2[
|
|
766
|
-
Object.defineProperty(
|
|
793
|
+
for (let e3 = 0; e3 < r2; e3++) {
|
|
794
|
+
const o3 = i2[e3], r3 = n3[o3];
|
|
795
|
+
Object.defineProperty(t3, o3, { value: r3, writable: true, configurable: true, enumerable: true });
|
|
767
796
|
}
|
|
768
|
-
return
|
|
797
|
+
return t3;
|
|
769
798
|
}, n2), o2;
|
|
770
799
|
}
|
|
771
|
-
const
|
|
772
|
-
const o2 =
|
|
800
|
+
const jt = "Undo the last action.", Xt = "Repeat the last action or undo the redo.", Yt = (t2) => `Redo ${t2}`, Ut = ({ manager: t2, commands: e2, disabled: n2 }) => {
|
|
801
|
+
const o2 = it(), i2 = ht((e3) => {
|
|
773
802
|
try {
|
|
774
|
-
|
|
775
|
-
} catch (
|
|
776
|
-
o2.error(
|
|
803
|
+
t2?.undo(e3);
|
|
804
|
+
} catch (t3) {
|
|
805
|
+
o2.error(t3);
|
|
777
806
|
}
|
|
778
|
-
}, [
|
|
807
|
+
}, [t2]), r2 = ht((e3) => {
|
|
779
808
|
try {
|
|
780
|
-
|
|
781
|
-
} catch (
|
|
782
|
-
o2.error(
|
|
809
|
+
t2?.redo(e3);
|
|
810
|
+
} catch (t3) {
|
|
811
|
+
o2.error(t3);
|
|
783
812
|
}
|
|
784
|
-
}, [
|
|
813
|
+
}, [t2]);
|
|
785
814
|
return h(() => {
|
|
786
|
-
if (!
|
|
787
|
-
const
|
|
788
|
-
} }, n3 = [new $("undo",
|
|
789
|
-
|
|
790
|
-
}, [
|
|
791
|
-
if (!
|
|
815
|
+
if (!e2) return;
|
|
816
|
+
const t3 = { contains: (t4) => true, focus() {
|
|
817
|
+
} }, n3 = [new $("undo", t3, { label: "Undo", description: jt, shortcut: { key: "z", modifiers: [A.Ctrl] }, disabled: true }, i2), new $("redo", t3, { label: "Redo", description: Xt, shortcut: [{ key: "y", modifiers: [A.Ctrl] }, { key: "F4" }, { key: "Enter", modifiers: [A.Alt] }], disabled: true }, r2)];
|
|
818
|
+
e2?.addCommands(n3, true);
|
|
819
|
+
}, [e2]), u(() => {
|
|
820
|
+
if (!e2) return;
|
|
792
821
|
const o3 = () => {
|
|
793
|
-
const o4 =
|
|
822
|
+
const o4 = t2?.getTopUndoDescription(), i4 = {};
|
|
794
823
|
var r3;
|
|
795
|
-
|
|
796
|
-
const s2 =
|
|
797
|
-
|
|
824
|
+
e2.getCommand("undo").update({ disabled: n2 || !t2 || !t2.hasUndo(), description: o4 ? (r3 = o4, `Undo ${r3}`) : jt, state: i4, context: { undoManager: t2 } });
|
|
825
|
+
const s2 = t2?.getTopRedoDescription();
|
|
826
|
+
e2.getCommand("redo").update({ disabled: n2 || !t2 || !t2.hasRedo(), description: s2 ? Yt(s2) : Xt, state: i4, context: { undoManager: t2 } });
|
|
798
827
|
};
|
|
799
|
-
if (o3(), !
|
|
800
|
-
const i3 =
|
|
828
|
+
if (o3(), !t2) return;
|
|
829
|
+
const i3 = t2.addListener({ onStackChange() {
|
|
801
830
|
o3();
|
|
802
831
|
} });
|
|
803
832
|
return () => i3?.();
|
|
804
|
-
}, [
|
|
833
|
+
}, [t2, e2, n2]), { undo: i2, redo: r2 };
|
|
805
834
|
};
|
|
806
|
-
class
|
|
835
|
+
class Gt extends b {
|
|
807
836
|
static getDerivedStateFromError() {
|
|
808
837
|
return { hasError: true };
|
|
809
838
|
}
|
|
810
|
-
componentDidCatch(
|
|
811
|
-
this.props.onError?.(
|
|
839
|
+
componentDidCatch(t2) {
|
|
840
|
+
this.props.onError?.(t2);
|
|
812
841
|
}
|
|
813
842
|
render() {
|
|
814
843
|
return this.props.children;
|
|
815
844
|
}
|
|
816
845
|
}
|
|
817
|
-
const
|
|
818
|
-
const
|
|
819
|
-
|
|
820
|
-
}, [
|
|
821
|
-
return x(
|
|
846
|
+
const qt = ({ children: t2 }) => {
|
|
847
|
+
const e2 = it(), n2 = m((t3) => {
|
|
848
|
+
e2.showError(t3);
|
|
849
|
+
}, [e2]);
|
|
850
|
+
return x(Gt, { onError: n2, children: t2 });
|
|
822
851
|
};
|
|
823
|
-
class
|
|
824
|
-
constructor(
|
|
825
|
-
this.notifier =
|
|
826
|
-
const
|
|
827
|
-
|
|
828
|
-
}, this.handleGlobalError = (
|
|
829
|
-
this.notifier.showError(
|
|
852
|
+
class Zt {
|
|
853
|
+
constructor(t2) {
|
|
854
|
+
this.notifier = t2, this.handleUnhandledRejection = (t3) => {
|
|
855
|
+
const e2 = t3.reason;
|
|
856
|
+
e2 instanceof DOMException && "AbortError" === e2.name || this.notifier.showError(e2);
|
|
857
|
+
}, this.handleGlobalError = (t3) => {
|
|
858
|
+
this.notifier.showError(t3.error);
|
|
830
859
|
}, this.setupGlobalHandlers();
|
|
831
860
|
}
|
|
832
861
|
setupGlobalHandlers() {
|
|
@@ -836,92 +865,92 @@ class Ue {
|
|
|
836
865
|
window.removeEventListener("unhandledrejection", this.handleUnhandledRejection), window.removeEventListener("error", this.handleGlobalError);
|
|
837
866
|
}
|
|
838
867
|
}
|
|
839
|
-
const
|
|
840
|
-
const
|
|
868
|
+
const Jt = ({ children: t2 }) => {
|
|
869
|
+
const e2 = it();
|
|
841
870
|
return u(() => {
|
|
842
|
-
const
|
|
871
|
+
const t3 = new Zt(e2);
|
|
843
872
|
return () => {
|
|
844
|
-
|
|
873
|
+
t3.cleanup();
|
|
845
874
|
};
|
|
846
|
-
}, [
|
|
847
|
-
},
|
|
848
|
-
const { onPointerDown:
|
|
849
|
-
return x("div", { style: { ...n2, position: "relative" }, ...c2, children: x("div", { className: T("hit-box", d2), style: { left: (h2 ? -i2 : 0) + "px", width: `calc(100% + ${h2 ? i2 + r2 : 0}px)`, top: (h2 ? 0 : -i2) + "px", height: `calc(100% + ${h2 ? 0 : i2 + r2}px)`, position: "absolute", ...u2 }, onPointerDown: s2 ? void 0 :
|
|
850
|
-
},
|
|
851
|
-
if (null ==
|
|
875
|
+
}, [e2]), x(E, { children: t2 });
|
|
876
|
+
}, Qt = () => null, te = {}, ee = (t2) => {
|
|
877
|
+
const { onPointerDown: e2, style: n2, splitDirection: o2, paddingBefore: i2 = 0, paddingAfter: r2 = 0, disabled: s2, key: l2, hitAreaProps: a2 = te, ...c2 } = t2, h2 = "row" === o2, { style: u2, className: d2, ...p2 } = a2;
|
|
878
|
+
return x("div", { style: { ...n2, position: "relative" }, ...c2, children: x("div", { className: T("hit-box", d2), style: { left: (h2 ? -i2 : 0) + "px", width: `calc(100% + ${h2 ? i2 + r2 : 0}px)`, top: (h2 ? 0 : -i2) + "px", height: `calc(100% + ${h2 ? 0 : i2 + r2}px)`, position: "absolute", ...u2 }, onPointerDown: s2 ? void 0 : e2, ...p2 }) }, l2);
|
|
879
|
+
}, ne = {}, oe = (t2, e2, n2 = true) => null === t2 ? null : null !== t2.pixels ? n2 ? t2.pixels : e2 - t2.pixels : (n2 ? t2.percent : 100 - t2.percent) / 100 * e2, ie = (t2, e2 = true) => t2?.percent ? `${e2 ? t2.percent : 100 - t2.percent}%` : t2?.pixels ? `${t2.pixels}px` : void 0, re = (t2, e2) => {
|
|
880
|
+
if (null == t2) return null;
|
|
852
881
|
const n2 = { percent: null, pixels: null };
|
|
853
|
-
let o2 =
|
|
854
|
-
return "string" == typeof
|
|
855
|
-
},
|
|
856
|
-
const { elementBefore: n2, elementAfter: o2, splitDirection: i2 = "row", fixedPane: r2 = null, position: s2, onPositionChange: c2, minBefore: p2, maxBefore: f2, minAfter: m2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish:
|
|
882
|
+
let o2 = e2;
|
|
883
|
+
return "string" == typeof t2 && ((t2 = t2.trim().toLowerCase()).endsWith("px") ? (t2 = t2.substring(0, t2.length - 2), o2 = false) : t2.endsWith("%") && (t2 = t2.substring(0, t2.length - 1), o2 = true), t2 = parseFloat(t2)), o2 ? n2.percent = t2 : n2.pixels = t2, Object.freeze(n2);
|
|
884
|
+
}, se = p(f((t2, e2) => {
|
|
885
|
+
const { elementBefore: n2, elementAfter: o2, splitDirection: i2 = "row", fixedPane: r2 = null, position: s2, onPositionChange: c2, minBefore: p2, maxBefore: f2, minAfter: m2, maxAfter: _2, children: g2, className: y2, style: v2, disabled: w2 = false, onDragStart: b2, onDragResize: E2, onDragFinish: C2, resizerProps: k2 = ne, paneProps: P2 = ne, paneBeforeProps: D2 = ne, paneAfterProps: A2 = ne, createResizer: z2 = ee } = t2;
|
|
857
886
|
if (g2) throw new Error("Use elementBefore and elementAfter instead of children.");
|
|
858
887
|
const B2 = h(() => l.isValidElement(o2) && l.isValidElement(n2), [o2, n2]), $2 = h(() => {
|
|
859
|
-
let
|
|
860
|
-
r2 && ("before" === r2 ?
|
|
861
|
-
const
|
|
862
|
-
return { fixedPaneOffset:
|
|
863
|
-
}, [p2, f2, m2, _2]),
|
|
888
|
+
let t3 = null;
|
|
889
|
+
r2 && ("before" === r2 ? t3 = 0 : "after" === r2 && (t3 = 1));
|
|
890
|
+
const e3 = null === t3;
|
|
891
|
+
return { fixedPaneOffset: t3, isPercent: e3, minBefore: re(p2, e3), maxBefore: re(f2, e3), minAfter: re(m2, e3), maxAfter: re(_2, e3) };
|
|
892
|
+
}, [p2, f2, m2, _2]), I2 = ht(c2, [c2]), [K2, O2] = d(() => re(s2, null === r2));
|
|
864
893
|
u(() => {
|
|
865
|
-
|
|
894
|
+
O2(re(s2, null === r2));
|
|
866
895
|
}, [s2, r2]);
|
|
867
|
-
const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" === i2 ? V2 : F2, X2 = "row" === i2 ? H2 : R2, Y2 = h(() => ((
|
|
896
|
+
const [N2, { width: H2, height: R2 }] = M(), [W2, { width: V2, height: F2 }] = M(), j2 = "row" === i2 ? V2 : F2, X2 = "row" === i2 ? H2 : R2, Y2 = h(() => ((t3, e3, n3, o3) => {
|
|
868
897
|
const i3 = [null, null], r3 = [null, null];
|
|
869
|
-
if (
|
|
870
|
-
let s3 =
|
|
871
|
-
h2 = (
|
|
898
|
+
if (t3 || (t3 = { percent: null === o3.fixedPaneOffset ? 50 : null, pixels: null === o3.fixedPaneOffset ? null : 0 }), 0 === e3) return null != t3?.pixels ? 1 !== o3.fixedPaneOffset ? (i3[0] = t3?.pixels, r3[1] = 100) : (i3[1] = t3?.pixels - n3, r3[0] = 100) : null != t3?.percent && (1 !== o3.fixedPaneOffset ? (r3[0] = t3?.percent, r3[1] = 100 - t3?.percent) : (r3[1] = t3?.percent, r3[0] = 100 - t3?.percent)), { percents: r3, pixels: i3, minBefore: ie(o3.minBefore, true), maxBefore: ie(o3.maxBefore, true), minAfter: ie(o3.minAfter), maxAfter: ie(o3.maxAfter) };
|
|
899
|
+
let s3 = oe(t3, e3, 1 !== o3.fixedPaneOffset), l2 = e3 - n3, a2 = oe(o3.minBefore, l2, true) ?? 0, c3 = oe(o3.maxBefore, l2, true) ?? l2, h2 = 0, u2 = 0, d2 = 0, p3 = l2;
|
|
900
|
+
h2 = (oe(o3.maxAfter, e3, false) ?? n3) - n3, u2 = oe(o3.minAfter, e3, false) ?? e3, d2 = Math.max(a2, h2), p3 = Math.min(c3, u2), s3 = Math.max(d2, Math.min(s3, p3)), u2 = Math.min(l2 - s3, oe(o3.maxAfter, l2 - s3, true) ?? l2), h2 = Math.min(l2 - s3, oe(o3.minAfter, l2 - s3, true) ?? l2), i3[0] = s3, i3[1] = l2 - i3[0];
|
|
872
901
|
const f3 = Math.max(0, Math.min(100, s3 / l2 * 100));
|
|
873
902
|
return r3[0] = f3, r3[1] = 100 - r3[0], { percents: r3, pixels: i3, minBefore: `${a2}px`, minAfter: `${h2}px`, maxBefore: `${i3[0]}px`, maxAfter: `${i3[1]}px` };
|
|
874
|
-
})(
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
}, [r2]),
|
|
903
|
+
})(K2, X2, j2, $2), [$2, K2, X2, j2, i2]), [U2, G2] = d(false), q2 = ht(b2, [b2]), Z2 = ht(E2, [E2]), J2 = ht(C2, [C2]), Q2 = a(null), tt2 = a(null), et2 = a(null), { style: nt2, className: ot2, ...it2 } = P2, rt2 = { minWidth: 0, minHeight: 0, maxWidth: "100%", maxHeight: "100%", height: "100%", widthResizer: "100%", display: "flex", overflow: "hidden", position: "relative", ...nt2 }, { className: st2, style: lt2, ...at2 } = D2, { className: ct2, style: ut2, ...dt2 } = A2, pt2 = { flex: "1 1 100%", width: "100%", ...v2, flexDirection: i2, display: "flex" }, { className: ft2, style: mt2, onPointerDown: _t2, ...gt2 } = k2, yt2 = ht((t3) => {
|
|
904
|
+
const e3 = re(t3, null === r2);
|
|
905
|
+
O2(e3);
|
|
906
|
+
}, [r2]), vt2 = ht((t3) => {
|
|
878
907
|
if (w2 || !U2) return;
|
|
879
|
-
const
|
|
908
|
+
const e3 = xt2.current?.getBoundingClientRect();
|
|
880
909
|
let n3 = 0;
|
|
881
|
-
n3 = "row" === i2 ? (
|
|
882
|
-
}, [$2, i2, w2, U2,
|
|
883
|
-
if (document.removeEventListener("pointermove",
|
|
884
|
-
if (G2(false), !
|
|
885
|
-
J2(
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
888
|
-
null ===
|
|
910
|
+
n3 = "row" === i2 ? (t3.clientX ?? t3.touches?.[0]?.clientX) - e3.x : (t3.clientY ?? t3.touches?.[0]?.clientY) - e3.y, n3 = Math.max(0, Math.min(X2, n3)), 1 === $2.fixedPaneOffset && (n3 = X2 - n3), s2 && K2.pixels === n3 || O2({ pixels: n3, percent: null }), Z2?.(n3), t3.stopPropagation(), t3.preventDefault();
|
|
911
|
+
}, [$2, i2, w2, U2, K2, X2]), wt2 = ht((t3) => {
|
|
912
|
+
if (document.removeEventListener("pointermove", vt2), document.removeEventListener("touchmove", vt2), document.removeEventListener("pointerup", wt2), !U2) return;
|
|
913
|
+
if (G2(false), !K2) return;
|
|
914
|
+
J2(K2.pixels);
|
|
915
|
+
if (!re(s2, null === r2) || K2.pixels !== s2) {
|
|
916
|
+
const t4 = { ...K2 };
|
|
917
|
+
null === t4.percent && (t4.percent = t4.pixels / X2 * 100), I2(t4);
|
|
889
918
|
}
|
|
890
|
-
|
|
891
|
-
}, [
|
|
892
|
-
|
|
893
|
-
}, [
|
|
919
|
+
t3.stopPropagation(), t3.preventDefault();
|
|
920
|
+
}, [K2, U2, s2, r2, X2]), bt2 = ht((t3) => {
|
|
921
|
+
_t2?.(t3), t3.defaultPrevented || w2 || U2 || (G2(true), q2(), document.addEventListener("pointermove", vt2, { passive: false }), document.addEventListener("touchmove", vt2, { passive: false }), document.addEventListener("pointerup", wt2, { passive: false }));
|
|
922
|
+
}, [_t2]), xt2 = Ft(e2, () => ({ setPosition: yt2, isSplitPane: () => true }), []), St2 = h(() => B2 ? z2?.({ key: "resizer", ref: L([W2, tt2]), className: T("resizer", ft2), onPointerDownCapture: bt2, style: { cursor: w2 ? void 0 : "row" === i2 ? "ew-resize" : "ns-resize", minWidth: "row" === i2 ? "2px" : void 0, minHeight: "row" !== i2 ? "2px" : void 0, boxSizing: "border-box", pointerEvents: "all", zIndex: 1, ...mt2 }, splitDirection: i2, disabled: w2, ...gt2 }) : null, [B2, ft2, gt2, i2, mt2, w2]), Et2 = "row" === i2 ? "Width" : "Height", Lt2 = h(() => {
|
|
894
923
|
if (!n2) return null;
|
|
895
|
-
const
|
|
896
|
-
return x("div", { ref: Q2, className: T("before",
|
|
897
|
-
}, [n2,
|
|
924
|
+
const t3 = { ...rt2, ...lt2, flex: 0 === $2.fixedPaneOffset && null !== Y2?.pixels[0] ? `0 0 ${Math.round(Y2?.pixels[0])}px` : `1 1 ${Math.round(Y2?.percents[0] ?? 100)}%`, [`min${Et2}`]: Y2?.minBefore, [`max${Et2}`]: o2 ? Y2?.maxBefore : "100%" };
|
|
925
|
+
return x("div", { ref: Q2, className: T("before", ot2, st2), style: t3, ...it2, ...at2, children: n2 }, "before");
|
|
926
|
+
}, [n2, P2, D2, $2, Y2]), Mt2 = h(() => {
|
|
898
927
|
if (!o2) return null;
|
|
899
|
-
const
|
|
900
|
-
return x("div", { ref:
|
|
901
|
-
}, [o2,
|
|
902
|
-
return S("div", { ref: L([N2,
|
|
928
|
+
const t3 = { ...rt2, ...ut2, flex: 1 === $2.fixedPaneOffset && null !== Y2?.pixels[1] ? `0 0 ${Math.round(Y2?.pixels[1])}px` : `1 1 ${Math.round(Y2?.percents[1] ?? 100)}%`, [`min${Et2}`]: Y2?.minAfter, [`max${Et2}`]: n2 ? Y2?.maxAfter : "100%" };
|
|
929
|
+
return x("div", { ref: et2, className: T("after", ot2, ct2), style: t3, ...it2, ...dt2, children: o2 }, "after");
|
|
930
|
+
}, [o2, P2, A2, $2, Y2]);
|
|
931
|
+
return S("div", { ref: L([N2, xt2]), className: T("splitPane", "row" === i2 ? "vertical" : "horizontal", { dragging: U2 }, y2), style: pt2, children: [Lt2, St2, Mt2] });
|
|
903
932
|
}));
|
|
904
|
-
function
|
|
905
|
-
if ("function" == typeof
|
|
906
|
-
if ("string" == typeof
|
|
907
|
-
const
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
910
|
-
const
|
|
911
|
-
if (!
|
|
912
|
-
const n2 =
|
|
933
|
+
function le(t2) {
|
|
934
|
+
if ("function" == typeof t2) return t2;
|
|
935
|
+
if ("string" == typeof t2) {
|
|
936
|
+
const e2 = t2.trim();
|
|
937
|
+
if (e2.startsWith("data:image/svg+xml")) {
|
|
938
|
+
const t3 = (function(t4) {
|
|
939
|
+
const e3 = /^data:image\/svg\+xml(;[^,]*)?,(.*)$/i.exec(t4.trim());
|
|
940
|
+
if (!e3) return null;
|
|
941
|
+
const n2 = e3[1] || "", o2 = e3[2] || "";
|
|
913
942
|
try {
|
|
914
943
|
if (/;base64/i.test(n2)) {
|
|
915
944
|
if ("undefined" != typeof atob) {
|
|
916
|
-
const
|
|
945
|
+
const t5 = atob(o2), e4 = t5.length;
|
|
917
946
|
if ("undefined" != typeof TextDecoder) {
|
|
918
|
-
const n4 = new Uint8Array(
|
|
919
|
-
for (let o3 = 0; o3 <
|
|
947
|
+
const n4 = new Uint8Array(e4);
|
|
948
|
+
for (let o3 = 0; o3 < e4; o3++) n4[o3] = t5.charCodeAt(o3);
|
|
920
949
|
return new TextDecoder("utf-8").decode(n4);
|
|
921
950
|
}
|
|
922
951
|
let n3 = "";
|
|
923
|
-
for (let o3 = 0; o3 <
|
|
924
|
-
n3 += `%${
|
|
952
|
+
for (let o3 = 0; o3 < e4; o3++) {
|
|
953
|
+
n3 += `%${t5.charCodeAt(o3).toString(16).padStart(2, "0")}`;
|
|
925
954
|
}
|
|
926
955
|
return decodeURIComponent(n3);
|
|
927
956
|
}
|
|
@@ -935,284 +964,284 @@ function it(e2) {
|
|
|
935
964
|
} catch {
|
|
936
965
|
return null;
|
|
937
966
|
}
|
|
938
|
-
})(
|
|
939
|
-
if (
|
|
967
|
+
})(e2);
|
|
968
|
+
if (t3) return he(t3);
|
|
940
969
|
}
|
|
941
|
-
if (
|
|
942
|
-
if (/^<\s*svg\b/i.test(
|
|
943
|
-
if (/^<\s*path\b/i.test(
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
970
|
+
if (e2.startsWith("<")) {
|
|
971
|
+
if (/^<\s*svg\b/i.test(e2)) return he(e2);
|
|
972
|
+
if (/^<\s*path\b/i.test(e2)) {
|
|
973
|
+
const t3 = ae(e2);
|
|
974
|
+
if (t3) return { paths: [{ d: t3 }] };
|
|
946
975
|
}
|
|
947
|
-
return { paths: [{ d:
|
|
976
|
+
return { paths: [{ d: e2 }] };
|
|
948
977
|
}
|
|
949
|
-
return { paths: [{ d:
|
|
950
|
-
}
|
|
951
|
-
if (Array.isArray(
|
|
952
|
-
const
|
|
953
|
-
for (const n2 of
|
|
954
|
-
const
|
|
955
|
-
if (
|
|
956
|
-
const n3 =
|
|
957
|
-
n3 &&
|
|
958
|
-
} else
|
|
959
|
-
} else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d &&
|
|
960
|
-
return { paths:
|
|
961
|
-
}
|
|
962
|
-
return
|
|
978
|
+
return { paths: [{ d: e2 }] };
|
|
979
|
+
}
|
|
980
|
+
if (Array.isArray(t2)) {
|
|
981
|
+
const e2 = [];
|
|
982
|
+
for (const n2 of t2) if ("string" == typeof n2) {
|
|
983
|
+
const t3 = String(n2).trim();
|
|
984
|
+
if (t3.startsWith("<path")) {
|
|
985
|
+
const n3 = ae(t3);
|
|
986
|
+
n3 && e2.push({ d: n3 });
|
|
987
|
+
} else e2.push({ d: t3 });
|
|
988
|
+
} else n2 && "object" == typeof n2 && "d" in n2 && "string" == typeof n2.d && e2.push({ ...n2 });
|
|
989
|
+
return { paths: e2 };
|
|
990
|
+
}
|
|
991
|
+
return t2;
|
|
963
992
|
}
|
|
964
|
-
function
|
|
965
|
-
const
|
|
966
|
-
return
|
|
993
|
+
function ae(t2) {
|
|
994
|
+
const e2 = /\bd\s*=\s*(?:"([^"]+)"|'([^']+)')/i.exec(t2);
|
|
995
|
+
return e2 ? e2[1] ?? e2[2] ?? null : null;
|
|
967
996
|
}
|
|
968
|
-
function
|
|
969
|
-
if ("svg" in
|
|
970
|
-
if ("url" in
|
|
971
|
-
const
|
|
972
|
-
return { ...
|
|
997
|
+
function ce(t2) {
|
|
998
|
+
if ("svg" in t2) return { ...t2, svg: le(t2.svg) };
|
|
999
|
+
if ("url" in t2) {
|
|
1000
|
+
const e2 = "string" == typeof t2.url ? { src: t2.url } : t2.url;
|
|
1001
|
+
return { ...t2, url: e2 };
|
|
973
1002
|
}
|
|
974
|
-
if ("emoji" in
|
|
975
|
-
const
|
|
976
|
-
return { ...
|
|
1003
|
+
if ("emoji" in t2) {
|
|
1004
|
+
const e2 = "string" == typeof t2.emoji ? t2.emoji : t2.emoji.text;
|
|
1005
|
+
return { ...t2, emoji: e2 };
|
|
977
1006
|
}
|
|
978
|
-
return
|
|
1007
|
+
return t2;
|
|
979
1008
|
}
|
|
980
|
-
function
|
|
1009
|
+
function he(t2) {
|
|
981
1010
|
try {
|
|
982
1011
|
if ("undefined" != typeof DOMParser) {
|
|
983
|
-
const
|
|
984
|
-
return
|
|
985
|
-
const
|
|
986
|
-
if (!
|
|
987
|
-
const n4 = { d:
|
|
1012
|
+
const e3 = new DOMParser().parseFromString(t2, "image/svg+xml"), n3 = e3.querySelector("svg"), o3 = n3?.getAttribute("viewBox") ?? void 0, i3 = [];
|
|
1013
|
+
return e3.querySelectorAll("path").forEach((t3) => {
|
|
1014
|
+
const e4 = t3.getAttribute("d");
|
|
1015
|
+
if (!e4) return;
|
|
1016
|
+
const n4 = { d: e4 }, o4 = t3.getAttribute("class");
|
|
988
1017
|
o4 && (n4.className = o4);
|
|
989
|
-
const r3 =
|
|
1018
|
+
const r3 = t3.getAttribute("fill");
|
|
990
1019
|
r3 && "none" !== r3 && (n4.fill = r3);
|
|
991
|
-
const s2 =
|
|
1020
|
+
const s2 = t3.getAttribute("stroke");
|
|
992
1021
|
s2 && (n4.stroke = s2);
|
|
993
|
-
const l2 =
|
|
1022
|
+
const l2 = t3.getAttribute("opacity");
|
|
994
1023
|
l2 && (n4.opacity = Number(l2));
|
|
995
|
-
const a2 =
|
|
1024
|
+
const a2 = t3.getAttribute("fill-rule");
|
|
996
1025
|
a2 && (n4.fillRule = a2);
|
|
997
|
-
const c2 =
|
|
1026
|
+
const c2 = t3.getAttribute("clip-rule");
|
|
998
1027
|
c2 && (n4.clipRule = c2), i3.push(n4);
|
|
999
1028
|
}), { viewBox: o3, paths: i3 };
|
|
1000
1029
|
}
|
|
1001
1030
|
} catch {
|
|
1002
1031
|
}
|
|
1003
|
-
const
|
|
1032
|
+
const e2 = t2.match(/viewBox="([^"]+)"/i), n2 = e2 ? e2[1] : void 0, o2 = [], i2 = /<path\b[^>]*\sd="([^"]+)"[^>]*>/gi;
|
|
1004
1033
|
let r2;
|
|
1005
|
-
for (; r2 = i2.exec(
|
|
1034
|
+
for (; r2 = i2.exec(t2); ) o2.push({ d: r2[1] });
|
|
1006
1035
|
return { viewBox: n2, paths: o2 };
|
|
1007
1036
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const
|
|
1010
|
-
for (const [n3, o3] of Object.entries(
|
|
1011
|
-
const n2 = { label:
|
|
1037
|
+
function ue(t2) {
|
|
1038
|
+
const e2 = {};
|
|
1039
|
+
for (const [n3, o3] of Object.entries(t2.icons)) e2[n3] = ce(o3);
|
|
1040
|
+
const n2 = { label: t2.meta?.label ?? "Unnamed", version: t2.meta?.version ?? "1.0.0", license: t2.meta?.license ?? "MIT", defaultViewBox: "0 0 24 24", extends: t2.meta?.extends ?? [] };
|
|
1012
1041
|
n2.extends.includes("base") || n2.extends.push("base");
|
|
1013
|
-
const o2 = { meta: n2, icons:
|
|
1042
|
+
const o2 = { meta: n2, icons: e2 }, i2 = t2.overrides;
|
|
1014
1043
|
if (i2) {
|
|
1015
|
-
const
|
|
1016
|
-
for (const [
|
|
1044
|
+
const t3 = {};
|
|
1045
|
+
for (const [e3, n3] of Object.entries(i2)) {
|
|
1017
1046
|
const o3 = {};
|
|
1018
|
-
for (const [
|
|
1019
|
-
e3
|
|
1047
|
+
for (const [t4, e4] of Object.entries(n3)) o3[t4] = ce(e4);
|
|
1048
|
+
t3[e3] = o3;
|
|
1020
1049
|
}
|
|
1021
|
-
o2.__overrides =
|
|
1050
|
+
o2.__overrides = t3;
|
|
1022
1051
|
}
|
|
1023
1052
|
return o2;
|
|
1024
1053
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const
|
|
1054
|
+
function de() {
|
|
1055
|
+
const t2 = /* @__PURE__ */ new Map(), e2 = /* @__PURE__ */ new Map();
|
|
1027
1056
|
let n2 = "base", o2 = /* @__PURE__ */ new Map();
|
|
1028
|
-
async function i2(
|
|
1029
|
-
const o3 =
|
|
1030
|
-
if (!o3) throw new Error(`Icon pack not registered: ${
|
|
1057
|
+
async function i2(e3) {
|
|
1058
|
+
const o3 = t2.get(e3 ?? n2);
|
|
1059
|
+
if (!o3) throw new Error(`Icon pack not registered: ${e3}`);
|
|
1031
1060
|
if (!o3.pack) {
|
|
1032
1061
|
if (!o3.loading) {
|
|
1033
|
-
if (!o3.loader) throw new Error(`No loader for icon pack: ${
|
|
1034
|
-
o3.loading = o3.loader().then((
|
|
1035
|
-
const
|
|
1036
|
-
o3.pack =
|
|
1037
|
-
}).catch((
|
|
1038
|
-
throw o3.loading = void 0,
|
|
1062
|
+
if (!o3.loader) throw new Error(`No loader for icon pack: ${e3}`);
|
|
1063
|
+
o3.loading = o3.loader().then((t3) => {
|
|
1064
|
+
const e4 = t3 && "object" == typeof t3 && "default" in t3 ? t3.default : t3;
|
|
1065
|
+
o3.pack = ue(e4);
|
|
1066
|
+
}).catch((t3) => {
|
|
1067
|
+
throw o3.loading = void 0, t3;
|
|
1039
1068
|
});
|
|
1040
1069
|
}
|
|
1041
1070
|
await o3.loading;
|
|
1042
1071
|
}
|
|
1043
1072
|
}
|
|
1044
|
-
function r2(
|
|
1045
|
-
const
|
|
1046
|
-
return
|
|
1073
|
+
function r2(t3) {
|
|
1074
|
+
const e3 = t3.indexOf(":");
|
|
1075
|
+
return e3 > 0 ? { ns: t3.slice(0, e3), key: t3.slice(e3 + 1) } : { key: t3 };
|
|
1047
1076
|
}
|
|
1048
1077
|
function s2(n3, o3) {
|
|
1049
|
-
const i3 = [n3, ...
|
|
1078
|
+
const i3 = [n3, ...t2.get(n3)?.pack?.meta.extends ?? []];
|
|
1050
1079
|
for (const n4 of i3) {
|
|
1051
|
-
const i4 =
|
|
1080
|
+
const i4 = t2.get(n4);
|
|
1052
1081
|
if (!i4?.pack) continue;
|
|
1053
|
-
const { icons: r3 } = i4.pack, s3 = r3[
|
|
1082
|
+
const { icons: r3 } = i4.pack, s3 = r3[e2.get(n4)?.get(o3) ?? o3] ?? r3[o3];
|
|
1054
1083
|
if (s3) return { glyph: s3, pack: i4.pack, packKey: n4 };
|
|
1055
1084
|
}
|
|
1056
1085
|
return null;
|
|
1057
1086
|
}
|
|
1058
|
-
function l2(
|
|
1087
|
+
function l2(e3, o3) {
|
|
1059
1088
|
const i3 = o3?.packKey ?? n2;
|
|
1060
|
-
if (o3?.packKey) return s2(o3.packKey,
|
|
1061
|
-
if (!
|
|
1062
|
-
const { ns: l3, key: a2 } = r2(
|
|
1089
|
+
if (o3?.packKey) return s2(o3.packKey, e3);
|
|
1090
|
+
if (!e3) return null;
|
|
1091
|
+
const { ns: l3, key: a2 } = r2(e3);
|
|
1063
1092
|
if (l3) {
|
|
1064
|
-
const
|
|
1065
|
-
if (
|
|
1066
|
-
if (!!
|
|
1067
|
-
const
|
|
1068
|
-
if (o5) return { glyph: o5, pack:
|
|
1093
|
+
const e4 = t2.get(l3)?.pack;
|
|
1094
|
+
if (e4) {
|
|
1095
|
+
if (!!t2.get(n2)?.pack) {
|
|
1096
|
+
const t3 = e4.__overrides, o5 = t3?.[n2]?.[a2];
|
|
1097
|
+
if (o5) return { glyph: o5, pack: e4, packKey: l3 };
|
|
1069
1098
|
}
|
|
1070
1099
|
const o4 = s2(l3, a2);
|
|
1071
1100
|
if (o4) return o4;
|
|
1072
1101
|
}
|
|
1073
1102
|
return null;
|
|
1074
1103
|
}
|
|
1075
|
-
return s2(i3,
|
|
1076
|
-
}
|
|
1077
|
-
return { register: function(
|
|
1078
|
-
const i3 =
|
|
1079
|
-
"function" == typeof o3 ? i3.loader = o3 : i3.pack =
|
|
1080
|
-
}, prefetch: async function(
|
|
1081
|
-
const
|
|
1082
|
-
await Promise.all(
|
|
1083
|
-
}, setActive: function(
|
|
1084
|
-
n2 =
|
|
1085
|
-
for (const
|
|
1086
|
-
t3
|
|
1087
|
-
} catch (
|
|
1104
|
+
return s2(i3, e3);
|
|
1105
|
+
}
|
|
1106
|
+
return { register: function(e3, o3) {
|
|
1107
|
+
const i3 = t2.get(e3) ?? {};
|
|
1108
|
+
"function" == typeof o3 ? i3.loader = o3 : i3.pack = ue(o3), t2.set(e3, i3), n2 || (n2 = e3);
|
|
1109
|
+
}, prefetch: async function(t3 = n2) {
|
|
1110
|
+
const e3 = Array.isArray(t3) ? t3 : [t3];
|
|
1111
|
+
await Promise.all(e3.map(i2));
|
|
1112
|
+
}, setActive: function(t3) {
|
|
1113
|
+
n2 = t3;
|
|
1114
|
+
for (const e3 of o2.keys()) try {
|
|
1115
|
+
e3(t3);
|
|
1116
|
+
} catch (t4) {
|
|
1088
1117
|
}
|
|
1089
1118
|
}, getActive: function() {
|
|
1090
1119
|
return n2;
|
|
1091
|
-
}, resolve: async function(
|
|
1092
|
-
let s3 = l2(
|
|
1120
|
+
}, resolve: async function(e3, o3) {
|
|
1121
|
+
let s3 = l2(e3, o3);
|
|
1093
1122
|
if (s3) return s3;
|
|
1094
|
-
const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(
|
|
1123
|
+
const a2 = o3?.packKey ?? n2, { ns: c2 } = r2(e3);
|
|
1095
1124
|
if (o3?.packKey) {
|
|
1096
|
-
if (await i2(a2), s3 = l2(
|
|
1097
|
-
const n3 =
|
|
1098
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(
|
|
1125
|
+
if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
|
|
1126
|
+
const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
|
|
1127
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
1099
1128
|
} else if (c2) {
|
|
1100
|
-
if (await i2(c2), s3 = l2(
|
|
1101
|
-
const n3 =
|
|
1102
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(
|
|
1129
|
+
if (await i2(c2), s3 = l2(e3, o3), s3) return s3;
|
|
1130
|
+
const n3 = t2.get(c2)?.pack?.meta?.extends ?? [];
|
|
1131
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
1103
1132
|
} else {
|
|
1104
|
-
if (await i2(a2), s3 = l2(
|
|
1105
|
-
const n3 =
|
|
1106
|
-
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(
|
|
1133
|
+
if (await i2(a2), s3 = l2(e3, o3), s3) return s3;
|
|
1134
|
+
const n3 = t2.get(a2)?.pack?.meta?.extends ?? [];
|
|
1135
|
+
if (n3.length && (await Promise.all(n3.map(i2)), s3 = l2(e3, o3), s3)) return s3;
|
|
1107
1136
|
}
|
|
1108
1137
|
return null;
|
|
1109
|
-
}, registerAlias: function(
|
|
1110
|
-
|
|
1111
|
-
}, has: function(
|
|
1112
|
-
return !!l2(
|
|
1113
|
-
}, getPack: function(
|
|
1114
|
-
return
|
|
1115
|
-
}, hasPack: function(
|
|
1116
|
-
return !!
|
|
1138
|
+
}, registerAlias: function(t3, n3, o3) {
|
|
1139
|
+
e2.has(t3) || e2.set(t3, /* @__PURE__ */ new Map()), e2.get(t3).set(n3, o3);
|
|
1140
|
+
}, has: function(t3, e3) {
|
|
1141
|
+
return !!l2(t3, e3);
|
|
1142
|
+
}, getPack: function(e3) {
|
|
1143
|
+
return t2.get(e3 ?? n2)?.pack;
|
|
1144
|
+
}, hasPack: function(e3) {
|
|
1145
|
+
return !!t2.get(e3)?.pack;
|
|
1117
1146
|
}, listPacks: function() {
|
|
1118
|
-
return Array.from(
|
|
1119
|
-
}, listIcons: function(
|
|
1120
|
-
const n3 =
|
|
1147
|
+
return Array.from(t2.keys());
|
|
1148
|
+
}, listIcons: function(e3) {
|
|
1149
|
+
const n3 = t2.get(e3)?.pack;
|
|
1121
1150
|
return n3 ? Object.keys(n3.icons) : [];
|
|
1122
|
-
}, addActiveListener: function(
|
|
1123
|
-
const
|
|
1124
|
-
if (
|
|
1151
|
+
}, addActiveListener: function(t3) {
|
|
1152
|
+
const e3 = o2.get(t3);
|
|
1153
|
+
if (e3) return e3;
|
|
1125
1154
|
const n3 = () => {
|
|
1126
|
-
o2.delete(
|
|
1155
|
+
o2.delete(t3);
|
|
1127
1156
|
};
|
|
1128
|
-
return o2.set(
|
|
1157
|
+
return o2.set(t3, n3), n3;
|
|
1129
1158
|
} };
|
|
1130
1159
|
}
|
|
1131
|
-
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
const { iconKey: n2, packKey: o2, className: i2, style: r2, role: s2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } =
|
|
1160
|
+
se.displayName = "SplitPane";
|
|
1161
|
+
const pe = de();
|
|
1162
|
+
pe.register("base", () => import("./B3XB5fOsmcQHIMOW.mjs"));
|
|
1163
|
+
const fe = (t2) => x("svg", { ...t2, children: x("path", {}) }), me = { Icon: "_Icon_17dpm_10" }, _e = p((e2) => {
|
|
1164
|
+
const { iconKey: n2, packKey: o2, className: i2, style: r2, role: s2, title: a2, size: c2, ariaHidden: u2, sourceProps: d2, children: p2, ...f2 } = e2, [m2, _2] = l.useState(null);
|
|
1136
1165
|
l.useEffect(() => {
|
|
1137
|
-
let
|
|
1166
|
+
let e3 = true, i3 = o2, r3 = n2;
|
|
1138
1167
|
if (!r3) {
|
|
1139
|
-
const
|
|
1140
|
-
return void _2({ glyph:
|
|
1168
|
+
const e4 = pe.getPack(i3);
|
|
1169
|
+
return void _2({ glyph: e4 ? { svg: t.EmptyArray } : void 0, pack: e4 ?? void 0, packKey: i3 ?? pe.getActive() });
|
|
1141
1170
|
}
|
|
1142
1171
|
if (r3.includes(":")) {
|
|
1143
|
-
const [
|
|
1144
|
-
i3 =
|
|
1172
|
+
const [t2, e4] = r3.split(":");
|
|
1173
|
+
i3 = t2, r3 = e4;
|
|
1145
1174
|
}
|
|
1146
|
-
return
|
|
1147
|
-
|
|
1175
|
+
return pe.resolve(r3, { packKey: i3 }).then((t2) => {
|
|
1176
|
+
e3 && _2(t2);
|
|
1148
1177
|
}), () => {
|
|
1149
|
-
|
|
1178
|
+
e3 = false;
|
|
1150
1179
|
};
|
|
1151
1180
|
}, [n2, o2]);
|
|
1152
1181
|
const g2 = m2?.pack, y2 = m2?.glyph, v2 = m2?.packKey;
|
|
1153
1182
|
let w2 = y2 ? y2.svg : void 0;
|
|
1154
|
-
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 = h(() => [
|
|
1155
|
-
const
|
|
1156
|
-
return
|
|
1157
|
-
}, [r2, E2]), T2 = s2 ?? (a2 ? "img" : "presentation"),
|
|
1158
|
-
if (p2) return
|
|
1159
|
-
if (S2) return
|
|
1160
|
-
if (b2) return
|
|
1183
|
+
const b2 = y2 && !w2 ? y2.url : void 0, S2 = !y2 || w2 || b2 ? void 0 : y2.emoji, E2 = null != c2 ? "number" == typeof c2 ? `${c2}px` : c2 : void 0, L2 = h(() => [me.Icon, "icon", i2].filter(Boolean).join(" "), [i2]), M2 = h(() => {
|
|
1184
|
+
const t2 = { ...r2 };
|
|
1185
|
+
return t2["--icon-size"] = E2, t2;
|
|
1186
|
+
}, [r2, E2]), T2 = s2 ?? (a2 ? "img" : "presentation"), C2 = u2 ?? (!a2 || void 0), k2 = (t2) => x("span", { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, "data-icon-glyph": n2, "data-icon-pack": v2, ...f2, children: t2 });
|
|
1187
|
+
if (p2) return k2(p2);
|
|
1188
|
+
if (S2) return k2(x("span", { children: "string" == typeof S2 ? S2 : S2.text }));
|
|
1189
|
+
if (b2) return k2(x("img", { src: b2.src, alt: a2 ?? "" }));
|
|
1161
1190
|
if (y2 && "react" in y2) {
|
|
1162
|
-
const
|
|
1163
|
-
return
|
|
1191
|
+
const t2 = y2.react, e3 = { className: L2, style: M2, role: T2, "aria-hidden": C2, title: a2, ...f2, ...d2 };
|
|
1192
|
+
return k2(x(t2, { ...e3 }));
|
|
1164
1193
|
}
|
|
1165
|
-
const
|
|
1194
|
+
const P2 = { viewBox: w2?.viewBox ?? g2?.meta.defaultViewBox ?? "0 0 24 24" };
|
|
1166
1195
|
if ("function" == typeof w2) {
|
|
1167
|
-
return
|
|
1196
|
+
return k2(w2(P2) ?? x(fe, { ...P2 }));
|
|
1168
1197
|
}
|
|
1169
|
-
if (!w2) return
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1198
|
+
if (!w2) return k2(x(fe, { ...P2 }));
|
|
1199
|
+
const D2 = w2.paths;
|
|
1200
|
+
return k2(x("svg", { ...P2, children: D2 ? D2.map((t2, e3) => x("path", { d: t2.d, className: t2.className, fill: t2.fill, stroke: t2.stroke, opacity: t2.opacity, fillRule: t2.fillRule, clipRule: t2.clipRule }, e3)) : null }));
|
|
1172
1201
|
});
|
|
1173
|
-
function
|
|
1174
|
-
const { isWalking:
|
|
1175
|
-
if (!
|
|
1176
|
-
const
|
|
1177
|
-
return n2 && "accent" !== n2 && (
|
|
1178
|
-
}, [
|
|
1179
|
-
return x(
|
|
1202
|
+
function ge(t2) {
|
|
1203
|
+
const { isWalking: e2 = false, themedType: n2 = "info", speed: o2 = 120, dashGap: i2 = 3, dashLength: r2 = 5, iconKey: s2, packKey: l2, style: a2, className: c2, ...u2 } = t2, d2 = h(() => {
|
|
1204
|
+
if (!e2) return;
|
|
1205
|
+
const t3 = { "--walk-duration": `${o2 * (i2 + r2)}ms`, "--walk-dash-length": `${r2}px`, "--walk-dash-gap": `${i2}px` };
|
|
1206
|
+
return n2 && "accent" !== n2 && (t3["--icon-accent"] = `var(--icon-${n2})`), t3;
|
|
1207
|
+
}, [e2, o2, i2, r2, n2]), p2 = h(() => e2 ? c2 + " walking" : c2, [e2, c2]);
|
|
1208
|
+
return x(_e, { iconKey: s2, packKey: l2, className: p2, style: { ...a2, ...d2 }, ...u2 });
|
|
1180
1209
|
}
|
|
1181
|
-
class
|
|
1210
|
+
class ye {
|
|
1182
1211
|
constructor() {
|
|
1183
1212
|
this.store = /* @__PURE__ */ new Map();
|
|
1184
1213
|
}
|
|
1185
|
-
async getItem(
|
|
1186
|
-
return this.store.get(
|
|
1214
|
+
async getItem(t2) {
|
|
1215
|
+
return this.store.get(t2) ?? null;
|
|
1187
1216
|
}
|
|
1188
|
-
async setItem(
|
|
1189
|
-
this.store.set(
|
|
1217
|
+
async setItem(t2, e2) {
|
|
1218
|
+
this.store.set(t2, e2);
|
|
1190
1219
|
}
|
|
1191
|
-
async removeItem(
|
|
1192
|
-
this.store.delete(
|
|
1220
|
+
async removeItem(t2) {
|
|
1221
|
+
this.store.delete(t2);
|
|
1193
1222
|
}
|
|
1194
1223
|
}
|
|
1195
|
-
const
|
|
1224
|
+
const ve = _(null), we = { parse: (t2) => t2 ? JSON.parse(t2) : null, stringify: JSON.stringify }, be = { store: new ye(), namespace: "", serializer: we, debounceMs: 0, crossTabSync: false, notify: () => {
|
|
1196
1225
|
}, subscribeKey: () => () => {
|
|
1197
1226
|
} };
|
|
1198
|
-
function
|
|
1199
|
-
const { store: o2, namespace: i2, serializer: r2, debounceMs: s2, subscribeKey: l2 } = g(
|
|
1200
|
-
let
|
|
1227
|
+
function xe(t2, e2, n2 = Se) {
|
|
1228
|
+
const { store: o2, namespace: i2, serializer: r2, debounceMs: s2, subscribeKey: l2 } = g(ve) || be, c2 = n2.serializer ?? r2 ?? we, p2 = h(() => `${i2}:${t2}`, [i2, t2]), f2 = a(null), m2 = `${p2}::v`, [_2, y2] = d(() => {
|
|
1229
|
+
let t3;
|
|
1201
1230
|
try {
|
|
1202
1231
|
if ("undefined" != typeof window && "localStorage" in window && p2.startsWith(i2)) {
|
|
1203
|
-
const
|
|
1204
|
-
null !=
|
|
1232
|
+
const e3 = window.localStorage?.getItem(p2) ?? null;
|
|
1233
|
+
null != e3 && (t3 = c2.parse(e3));
|
|
1205
1234
|
}
|
|
1206
1235
|
} catch {
|
|
1207
1236
|
}
|
|
1208
|
-
if (void 0 ===
|
|
1209
|
-
const
|
|
1210
|
-
return "function" == typeof
|
|
1237
|
+
if (void 0 === t3) {
|
|
1238
|
+
const t4 = e2;
|
|
1239
|
+
return "function" == typeof t4 ? t4() : t4;
|
|
1211
1240
|
}
|
|
1212
|
-
return
|
|
1241
|
+
return t3;
|
|
1213
1242
|
});
|
|
1214
1243
|
u(() => {
|
|
1215
|
-
let
|
|
1244
|
+
let t3 = true;
|
|
1216
1245
|
return (async () => {
|
|
1217
1246
|
const [i3, r3] = await Promise.all([o2.getItem(p2), o2.getItem(m2)]);
|
|
1218
1247
|
let s3;
|
|
@@ -1222,510 +1251,520 @@ function vt(e2, t2, n2 = wt) {
|
|
|
1222
1251
|
}
|
|
1223
1252
|
const l3 = null == r3 ? void 0 : Number.parseInt(r3, 10);
|
|
1224
1253
|
if (void 0 === s3) {
|
|
1225
|
-
if (!n2.lazy && void 0 !==
|
|
1226
|
-
s3 = "function" == typeof
|
|
1254
|
+
if (!n2.lazy && void 0 !== e2) {
|
|
1255
|
+
s3 = "function" == typeof e2 ? e2() : e2, await o2.setItem(p2, c2.stringify(s3)), null != n2.version && await o2.setItem(m2, String(n2.version));
|
|
1227
1256
|
}
|
|
1228
1257
|
} else if (null != n2.version && void 0 !== l3 && l3 !== n2.version && n2.migrate) {
|
|
1229
1258
|
s3 = n2.migrate(s3, l3), await o2.setItem(p2, c2.stringify(s3)), await o2.setItem(m2, String(n2.version));
|
|
1230
1259
|
}
|
|
1231
|
-
|
|
1260
|
+
t3 && void 0 !== s3 && y2(s3);
|
|
1232
1261
|
})(), () => {
|
|
1233
|
-
|
|
1262
|
+
t3 = false;
|
|
1234
1263
|
};
|
|
1235
|
-
}, [o2, p2, m2, n2.version, n2.migrate, n2.lazy]), u(() => l2(
|
|
1236
|
-
const
|
|
1237
|
-
if (null !=
|
|
1238
|
-
y2(c2.parse(
|
|
1264
|
+
}, [o2, p2, m2, n2.version, n2.migrate, n2.lazy]), u(() => l2(t2, async () => {
|
|
1265
|
+
const t3 = await o2.getItem(p2);
|
|
1266
|
+
if (null != t3) try {
|
|
1267
|
+
y2(c2.parse(t3));
|
|
1239
1268
|
} catch {
|
|
1240
1269
|
}
|
|
1241
|
-
}), [o2, p2, l2,
|
|
1242
|
-
const v2 = async (
|
|
1243
|
-
await o2.setItem(p2, c2.stringify(
|
|
1270
|
+
}), [o2, p2, l2, t2]);
|
|
1271
|
+
const v2 = async (t3) => {
|
|
1272
|
+
await o2.setItem(p2, c2.stringify(t3)), null != n2.version && await o2.setItem(m2, String(n2.version));
|
|
1244
1273
|
};
|
|
1245
|
-
return [_2, (
|
|
1246
|
-
y2((
|
|
1247
|
-
const n3 = "function" == typeof
|
|
1274
|
+
return [_2, (t3) => {
|
|
1275
|
+
y2((e3) => {
|
|
1276
|
+
const n3 = "function" == typeof t3 ? t3(e3) : t3;
|
|
1248
1277
|
return f2.current && clearTimeout(f2.current), s2 > 0 ? f2.current = setTimeout(() => {
|
|
1249
1278
|
v2(n3);
|
|
1250
1279
|
}, s2) : v2(n3), n3;
|
|
1251
1280
|
});
|
|
1252
1281
|
}, () => {
|
|
1253
|
-
if (f2.current && clearTimeout(f2.current), o2.removeItem(p2), o2.removeItem(m2), void 0 !==
|
|
1254
|
-
const
|
|
1255
|
-
y2(
|
|
1282
|
+
if (f2.current && clearTimeout(f2.current), o2.removeItem(p2), o2.removeItem(m2), void 0 !== e2) {
|
|
1283
|
+
const t3 = "function" == typeof e2 ? e2() : e2;
|
|
1284
|
+
y2(t3);
|
|
1256
1285
|
} else y2(void 0);
|
|
1257
1286
|
}];
|
|
1258
1287
|
}
|
|
1259
|
-
const
|
|
1260
|
-
function
|
|
1261
|
-
const { store:
|
|
1262
|
-
const
|
|
1263
|
-
|
|
1264
|
-
}, subscribeKey(
|
|
1265
|
-
const n3 = c2.current, o3 = n3.get(
|
|
1266
|
-
return o3.add(
|
|
1267
|
-
const o4 = n3.get(
|
|
1268
|
-
o4 && (o4.delete(
|
|
1288
|
+
const Se = {};
|
|
1289
|
+
function Ee(t2) {
|
|
1290
|
+
const { store: e2, namespace: n2 = "", serializer: o2 = Le, debounceMs: i2 = 0, crossTabSync: r2 = true, children: s2 } = t2, l2 = h(() => "undefined" == typeof window ? new ye() : e2 ?? new ye(), [e2]), c2 = a(/* @__PURE__ */ new Map()), d2 = h(() => ({ store: l2, namespace: n2, serializer: o2, debounceMs: i2, crossTabSync: r2, notify(t3) {
|
|
1291
|
+
const e3 = c2.current.get(t3);
|
|
1292
|
+
e3 && e3.forEach((t4) => t4());
|
|
1293
|
+
}, subscribeKey(t3, e3) {
|
|
1294
|
+
const n3 = c2.current, o3 = n3.get(t3) ?? /* @__PURE__ */ new Set();
|
|
1295
|
+
return o3.add(e3), n3.set(t3, o3), () => {
|
|
1296
|
+
const o4 = n3.get(t3);
|
|
1297
|
+
o4 && (o4.delete(e3), 0 === o4.size && n3.delete(t3));
|
|
1269
1298
|
};
|
|
1270
1299
|
} }), [l2, n2, o2, i2, r2]);
|
|
1271
1300
|
return u(() => {
|
|
1272
|
-
if (d2.crossTabSync && d2.store.subscribe) return d2.store.subscribe((
|
|
1273
|
-
if (!
|
|
1274
|
-
const
|
|
1275
|
-
d2.notify(
|
|
1301
|
+
if (d2.crossTabSync && d2.store.subscribe) return d2.store.subscribe((t3) => {
|
|
1302
|
+
if (!t3.startsWith(d2.namespace + ":")) return;
|
|
1303
|
+
const e3 = t3.slice(d2.namespace.length + 1);
|
|
1304
|
+
d2.notify(e3);
|
|
1276
1305
|
});
|
|
1277
|
-
}, [d2]), x(
|
|
1306
|
+
}, [d2]), x(ve.Provider, { value: d2, children: s2 });
|
|
1278
1307
|
}
|
|
1279
|
-
const
|
|
1280
|
-
class
|
|
1281
|
-
constructor(
|
|
1282
|
-
this.storage =
|
|
1308
|
+
const Le = { parse: (t2) => null == t2 ? null : JSON.parse(t2), stringify: JSON.stringify };
|
|
1309
|
+
class Me {
|
|
1310
|
+
constructor(t2 = window.localStorage) {
|
|
1311
|
+
this.storage = t2;
|
|
1283
1312
|
}
|
|
1284
|
-
async getItem(
|
|
1313
|
+
async getItem(t2) {
|
|
1285
1314
|
try {
|
|
1286
|
-
return this.storage.getItem(
|
|
1315
|
+
return this.storage.getItem(t2);
|
|
1287
1316
|
} catch {
|
|
1288
1317
|
return null;
|
|
1289
1318
|
}
|
|
1290
1319
|
}
|
|
1291
|
-
async setItem(
|
|
1320
|
+
async setItem(t2, e2) {
|
|
1292
1321
|
try {
|
|
1293
|
-
this.storage.setItem(
|
|
1322
|
+
this.storage.setItem(t2, e2);
|
|
1294
1323
|
} catch {
|
|
1295
1324
|
}
|
|
1296
1325
|
}
|
|
1297
|
-
async removeItem(
|
|
1326
|
+
async removeItem(t2) {
|
|
1298
1327
|
try {
|
|
1299
|
-
this.storage.removeItem(
|
|
1328
|
+
this.storage.removeItem(t2);
|
|
1300
1329
|
} catch {
|
|
1301
1330
|
}
|
|
1302
1331
|
}
|
|
1303
|
-
subscribe(
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1332
|
+
subscribe(t2) {
|
|
1333
|
+
const e2 = (e3) => {
|
|
1334
|
+
e3.storageArea === this.storage && e3.key && t2(e3.key);
|
|
1306
1335
|
};
|
|
1307
|
-
return window.addEventListener("storage",
|
|
1336
|
+
return window.addEventListener("storage", e2), () => window.removeEventListener("storage", e2);
|
|
1308
1337
|
}
|
|
1309
1338
|
}
|
|
1310
|
-
const
|
|
1311
|
-
const { style:
|
|
1312
|
-
return x("button", { style:
|
|
1313
|
-
},
|
|
1314
|
-
const { style:
|
|
1315
|
-
return x("button", { style:
|
|
1316
|
-
},
|
|
1317
|
-
const { style:
|
|
1318
|
-
return x("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
const [
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1339
|
+
const Te = { Horizontal: "horizontal", Vertical: "vertical" }, Ce = { scrollbar: "_scrollbar_15caq_24", track: "_track_15caq_34", thumb: "_thumb_15caq_46", "scrollbar-button": "_scrollbar-button_15caq_86", "touch-thumb": "_touch-thumb_15caq_121" }, ke = "M 5.4951012,0.62494002 7.1746358,3.4734472 8.8557603,6.3226744 c 0.13425,0.2277477 0.18228,0.4945506 0.1356,0.7535218 -0.04665,0.2589712 -0.18504,0.4935661 -0.3908099,0.6625402 C 8.3948254,7.9076371 8.1348905,8.0001761 7.8664506,7.9999997 H 1.1503225 c -0.30278993,0 -0.59312985,-0.117841 -0.80720983,-0.3275159 -0.2140799,-0.2097042 -0.3343649,-0.4941244 -0.3343649,-0.7907107 -4.5e-4,-0.1955399 0.05205,-0.3876855 0.152205,-0.55688 L 1.8390472,3.4734031 3.5178618,0.62488125 C 3.7217717,0.27898385 4.0986166,0.0658413 4.5064365,0.0658413 c 0.4078199,0 0.7846648,0.21314255 0.9885747,0.55903995 z", Pe = "M 0.6632643,3.5136438 3.5117715,1.8341092 6.3609987,0.15298466 c 0.2277477,-0.13425 0.4945506,-0.18228 0.7535218,-0.1356 0.2589712,0.04665 0.4935661,0.18504 0.6625402,0.3908099 0.1689007,0.205725 0.2614397,0.4656599 0.2612633,0.73409984 v 6.7161281 c 0,0.3027899 -0.117841,0.5931298 -0.3275159,0.8072098 -0.2097042,0.2140799 -0.4941244,0.3343649 -0.7907107,0.3343649 -0.1955399,4.5e-4 -0.3876855,-0.05205 -0.55688,-0.152205 L 3.5117274,7.1696978 0.6632056,5.4908832 C 0.31730817,5.2869733 0.10416562,4.9101284 0.10416562,4.5023085 c 0,-0.4078199 0.21314255,-0.7846648 0.55903998,-0.9885747 z", De = { transform: "rotate(180deg)" }, Ae = (t2) => {
|
|
1340
|
+
const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...i2 } = t2, r2 = n2 === Te.Vertical ? ke : Pe;
|
|
1341
|
+
return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...i2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", children: x("path", { d: r2 }) }) });
|
|
1342
|
+
}, ze = (t2) => {
|
|
1343
|
+
const { style: e2, orientation: n2 = Te.Vertical, disabled: o2, ...i2 } = t2, r2 = n2 === Te.Vertical ? ke : Pe;
|
|
1344
|
+
return x("button", { style: e2, className: T(Ce["scrollbar-button"], n2, "scroll-button"), disabled: o2, ...i2, children: x("svg", { width: "9", height: "9", viewBox: "0 0 9 9", style: De, children: x("path", { d: r2 }) }) });
|
|
1345
|
+
}, Be = (t2) => {
|
|
1346
|
+
const { style: e2, orientation: n2 = Te.Vertical, ...o2 } = t2, i2 = n2 === Te.Vertical;
|
|
1347
|
+
return x("div", { style: { display: "flex", justifyContent: "center", alignItems: "end", transition: "fill-opacity 1s", zIndex: 1, width: "24px", height: "24px", ...e2 }, className: `scrollbar-button ${i2 ? "vertical" : "horizontal"} edge`, ...o2, children: x("svg", { width: "24", height: "24", viewBox: "0 0 24 24", transform: i2 ? "rotate(90) " : "", children: x("path", { style: { transition: "opacity 240ms ease 0s", opacity: t2.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" }) }) });
|
|
1348
|
+
}, $e = N().supportsTouchEvents, Ie = p(f((t2, e2) => {
|
|
1349
|
+
const { borderColor: n2 = "var(--sxl-app-color-primary, rgb(33, 115, 70))", backgroundColor: o2 = "var(--sxl-app-color-background, white)", fillColor: i2 = "var(--sxl-app-color-grey, grey)", borderWidth: r2 = 3, size: s2 = 22, style: l2, className: c2, onPointerDown: p2, onPointerMove: f2, onPointerUp: m2, orientation: _2 = Te.Vertical, offset: g2 = 0, currentTouchAnchor: y2, elementParent: v2, elementRoot: w2, key: b2, ...M2 } = t2;
|
|
1350
|
+
if (!$e) return null;
|
|
1351
|
+
const C2 = ht(p2, [p2]), k2 = ht(f2, [f2]), D2 = ht(m2, [m2]), A2 = _2 === Te.Vertical, [z2, B2] = d(false), $2 = _t(h(() => ({ processTouch: true, consumeTouch: true, onPointerDown: (t3, e3) => {
|
|
1352
|
+
B2(true), C2?.(t3), t3.preventDefault(), t3.stopPropagation();
|
|
1353
|
+
}, onPointerMoveOrWait: (t3, e3, n3) => {
|
|
1354
|
+
k2?.(t3);
|
|
1355
|
+
}, onPointerUp: (t3, e3, n3) => {
|
|
1356
|
+
B2(false), D2?.(n3), t3.preventDefault(), t3.stopPropagation();
|
|
1357
|
+
} }), [])), I2 = h(() => {
|
|
1358
|
+
const t3 = s2 / 2 + r2 / 2 + 6;
|
|
1359
|
+
return { x: A2 ? -t3 : g2 + s2, y: A2 ? g2 + s2 : -t3, width: 0, height: 0 };
|
|
1360
|
+
}, [A2, g2, s2]), [K2, { y: O2, x: N2 }] = ct(), H2 = a(null), { getPortalContainer: R2, isFullscreen: W2 } = mt(), [V2, F2] = d(null);
|
|
1326
1361
|
return u(() => {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
}
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
}, [I2, v2, w2]), H2 = ce((e3) => {
|
|
1348
|
-
const t3 = o2 / I2, n3 = Math.round(e3 * t3);
|
|
1349
|
-
A2(N2(n3, i2, o2)), c2?.(n3, i2, o2), z2.current = e3;
|
|
1350
|
-
}, [c2, i2, o2, I2, P2]), R2 = ce((e3) => {
|
|
1351
|
-
A2(N2(e3, i2, o2)), c2?.(e3, i2, o2), z2.current = e3;
|
|
1362
|
+
const t3 = H2.current?.getBoundingClientRect();
|
|
1363
|
+
if (!t3) return void F2(null);
|
|
1364
|
+
let a2 = 0, h2 = 0, u2 = v2;
|
|
1365
|
+
for (; u2; ) a2 += u2.scrollLeft, h2 += u2.scrollTop, u2 = w2 && u2 === w2.parentElement ? null : u2.parentElement;
|
|
1366
|
+
F2(P(x("div", { className: T("touch-thumb", Ce["touch-thumb"], c2, Ce, { dragging: z2 }), ref: e2, style: { left: a2 + (t3?.x ?? 0) - (s2 + r2) / 2, top: h2 + (t3?.y ?? 0) - (s2 + r2) / 2, width: A2 ? s2 : 1.8 * s2, height: A2 ? 1.8 * s2 : s2, borderWidth: `${r2}px`, boxShadow: z2 ? `${o2} 0px 0px 0px 1.5px` : void 0, borderStyle: "solid", borderColor: n2, backgroundColor: o2, opacity: y2 ? 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='${i2}' 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", ...l2 }, tabIndex: -1, onPointerDown: $2, ...M2 }), w2 ?? R2(), b2));
|
|
1367
|
+
}, [O2, z2, n2, o2, i2, N2, I2?.x, I2?.y, I2?.width, I2?.height, c2, y2, o2, s2, r2, n2, v2, W2, b2]), I2 ? S(E, { children: [x("div", { ref: L([K2, H2]), style: { position: "absolute", left: I2.x, top: I2.y, opacity: 0 } }), V2] }) : null;
|
|
1368
|
+
}));
|
|
1369
|
+
Ie.displayName = "TouchThumbHandle";
|
|
1370
|
+
const Ke = 24, Oe = p(f((t2, e2) => {
|
|
1371
|
+
const { offset: n2 = 0, totalSize: o2 = 0, viewportSize: i2 = 0, style: r2, className: s2, orientation: l2 = Te.Vertical, onScrollOffset: c2, onScroll: p2, showCustomScrollButtons: f2, scrollButtonIncrement: _2 = 200, scrollButtonInitialRepeatDelay: g2 = 260, scrollButtonAdditionalRepeatDelay: y2 = 120, minThumbSize: v2 = Ke, maxThumbSize: w2, createScrollStartButton: b2 = Ae, createScrollEndButton: C2 = ze, touchThumbProps: k2, thumbProps: P2, onMouseDown: D2, ...A2 } = t2, z2 = "touch" === N().primaryInput, B2 = f2 ?? !z2;
|
|
1372
|
+
ht(p2, [p2]);
|
|
1373
|
+
const [$2, I2] = d({ offset: 0, length: 0 }), K2 = a(-1), O2 = l2 === Te.Vertical, [H2, { width: R2, height: W2 }] = M(), V2 = O2 ? W2 : R2, F2 = ht((t3, e3, n3) => {
|
|
1374
|
+
if (0 === e3 || 0 === n3) return void I2({ offset: 0, length: v2 });
|
|
1375
|
+
const o3 = n3 / V2, i3 = e3 / o3, r3 = Math.min(Math.max(v2, i3), Math.min(V2, w2 ?? Number.MAX_SAFE_INTEGER)), s3 = t3 / o3;
|
|
1376
|
+
return { offset: Math.min(Math.max(0, s3), V2 - r3), length: r3 };
|
|
1377
|
+
}, [V2, v2, w2]), j2 = ht((t3) => {
|
|
1378
|
+
const e3 = o2 / V2, n3 = Math.round(t3 * e3);
|
|
1379
|
+
I2(F2(n3, i2, o2)), c2?.(n3, i2, o2), K2.current = t3;
|
|
1380
|
+
}, [c2, i2, o2, V2, $2]), X2 = ht((t3) => {
|
|
1381
|
+
I2(F2(t3, i2, o2)), c2?.(t3, i2, o2), K2.current = t3;
|
|
1352
1382
|
}, [c2, i2, o2]);
|
|
1353
1383
|
u(() => {
|
|
1354
|
-
|
|
1384
|
+
K2.current !== n2 && 0 !== V2 && (K2.current = -1, I2(F2(n2, i2, o2)));
|
|
1355
1385
|
}, [n2]), u(() => {
|
|
1356
|
-
0 !==
|
|
1357
|
-
}, [i2, o2,
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1360
|
-
}, [
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1386
|
+
0 !== V2 && I2(F2(n2, i2, o2));
|
|
1387
|
+
}, [i2, o2, O2, V2]);
|
|
1388
|
+
const Y2 = Math.max(0, o2 - i2), [U2, G2] = d(false), q2 = a(0), Z2 = a(0), J2 = Ft(e2, () => ({ isScrollbar: () => true }), []), Q2 = ht((t3) => {
|
|
1389
|
+
G2(true), q2.current = O2 ? t3.clientY : t3.clientX, Z2.current = $2.offset;
|
|
1390
|
+
}, [O2, $2]), tt2 = ht((t3) => {
|
|
1391
|
+
t3.currentTarget.setPointerCapture(t3.pointerId), Q2(t3), t3.stopPropagation();
|
|
1392
|
+
}, [D2]), et2 = ht((t3) => {
|
|
1393
|
+
if (!U2) return;
|
|
1394
|
+
const e3 = (O2 ? t3.clientY : t3.clientX) - q2.current, n3 = Z2.current + e3;
|
|
1395
|
+
j2(n3);
|
|
1396
|
+
}, [U2, O2]), nt2 = ht((t3) => {
|
|
1397
|
+
et2(t3);
|
|
1398
|
+
}, []), ot2 = ht((t3) => {
|
|
1399
|
+
G2(false);
|
|
1400
|
+
}, []), it2 = ht((t3) => {
|
|
1365
1401
|
try {
|
|
1366
|
-
|
|
1402
|
+
t3.currentTarget.releasePointerCapture(t3.pointerId);
|
|
1367
1403
|
} catch {
|
|
1368
1404
|
}
|
|
1369
|
-
|
|
1370
|
-
}, []),
|
|
1371
|
-
if (!
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1374
|
-
}, [
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1377
|
-
}, [
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1405
|
+
ot2(t3);
|
|
1406
|
+
}, []), rt2 = ht((t3) => {
|
|
1407
|
+
if (!t3.currentTarget) return;
|
|
1408
|
+
const e3 = t3.currentTarget.getBoundingClientRect(), n3 = O2 ? t3.clientY - e3.top : t3.clientX - e3.left;
|
|
1409
|
+
j2(n3);
|
|
1410
|
+
}, [O2, $2, i2, o2]), st2 = ht((t3) => {
|
|
1411
|
+
const e3 = Math.max(1, Math.floor(0.9 * i2));
|
|
1412
|
+
O2 ? ("ArrowDown" === t3.key && j2(Math.min(Y2, n2 + 1)), "ArrowUp" === t3.key && j2(Math.max(0, n2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, n2 + e3)), "PageUp" === t3.key && j2(Math.max(0, n2 - e3)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2)) : ("ArrowRight" === t3.key && j2(Math.min(Y2, n2 + 1)), "ArrowLeft" === t3.key && j2(Math.max(0, n2 - 1)), "PageDown" === t3.key && j2(Math.min(Y2, n2 + e3)), "PageUp" === t3.key && j2(Math.max(0, n2 - e3)), "Home" === t3.key && j2(0), "End" === t3.key && j2(Y2));
|
|
1413
|
+
}, [O2, i2, o2, n2, Y2]), lt2 = a(null), at2 = h(() => {
|
|
1414
|
+
const t3 = x("div", { ...P2, className: T(Ce.thumb), ref: lt2, role: "slider", "aria-label": O2 ? "Rows" : "Columns", "aria-orientation": O2 ? "vertical" : "horizontal", "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, style: { ...P2?.style, position: "relative", [O2 ? "height" : "width"]: `${$2.length}px`, [O2 ? "width" : "height"]: "100%", transform: O2 ? `translateY(${$2.offset}px)` : `translateX(${$2.offset}px)`, [O2 ? "minHeight" : "minWidth"]: `${v2}px` }, onMouseDown: D2, onPointerDown: tt2, onPointerMove: nt2, onPointerUp: it2 });
|
|
1415
|
+
return z2 ? S(E, { children: [t3, x(Ie, { ...k2, offset: $2.offset, orientation: O2 ? Te.Vertical : Te.Horizontal, onPointerDown: Q2, onPointerMove: et2, onPointerUp: ot2 })] }) : t3;
|
|
1416
|
+
}, [$2, v2, Y2, n2, O2, z2, D2, k2, P2]), [ct2, ut2] = d(null), dt2 = ht(() => {
|
|
1417
|
+
let t3;
|
|
1418
|
+
t3 = "function" == typeof _2 ? _2(n2, i2, o2) : n2 - _2;
|
|
1419
|
+
const e3 = Math.max(0, t3);
|
|
1420
|
+
return X2(e3), ut2(e3), e3;
|
|
1421
|
+
}, [_2, n2, i2, o2]), pt2 = ht(() => {
|
|
1422
|
+
let t3;
|
|
1423
|
+
t3 = "function" == typeof _2 ? _2(n2, i2, o2) : n2 + _2;
|
|
1424
|
+
const e3 = Math.min(Y2, t3);
|
|
1425
|
+
return X2(e3), ut2(e3), e3;
|
|
1426
|
+
}, [_2, n2, Y2, i2, o2]), ft2 = a(null), mt2 = a(null), _t2 = m(() => {
|
|
1427
|
+
ft2.current && (clearTimeout(ft2.current), ft2.current = null, mt2.current = null);
|
|
1428
|
+
}, []), gt2 = m((t3, e3, n3, o3 = g2) => {
|
|
1429
|
+
mt2.current = t3, ft2.current = setTimeout(() => {
|
|
1430
|
+
const t4 = n3 ? dt2() : pt2();
|
|
1431
|
+
t4 !== mt2.current ? gt2(t4, false, n3, y2) : _t2();
|
|
1432
|
+
}, e3 ? 0 : o3);
|
|
1433
|
+
}, [dt2, pt2, _t2]);
|
|
1434
|
+
u(() => () => _t2(), [_t2]);
|
|
1435
|
+
const yt2 = h(() => {
|
|
1436
|
+
if (!B2) return null;
|
|
1437
|
+
const t3 = { orientation: l2, disabled: n2 <= 0, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(n2, true, true) };
|
|
1438
|
+
return b2?.(t3);
|
|
1439
|
+
}, [B2, l2, n2, ct2]), vt2 = h(() => {
|
|
1440
|
+
if (!B2) return null;
|
|
1441
|
+
const t3 = { orientation: l2, disabled: n2 >= Y2, onMouseUp: _t2, onMouseLeave: _t2, onMouseDown: () => gt2(n2, true, false) };
|
|
1442
|
+
return C2?.(t3);
|
|
1443
|
+
}, [B2, l2, n2, Y2, ct2]), wt2 = O2 ? "vertical" : "horizontal";
|
|
1444
|
+
return S("div", { ref: L([J2, e2]), className: T(s2, Ce.scrollbar, wt2, { dragging: U2, "has-touch-thumb": z2 }), style: r2, ...A2, children: [yt2, x("div", { ref: H2, role: "scrollbar", "aria-orientation": wt2, "aria-valuemin": 0, "aria-valuemax": Y2, "aria-valuenow": n2, tabIndex: 0, className: T(Ce.track, "track", wt2), onMouseDown: D2, onPointerDown: rt2, onKeyDown: st2, children: at2 }), vt2] });
|
|
1406
1445
|
}));
|
|
1407
|
-
let
|
|
1408
|
-
const
|
|
1409
|
-
let
|
|
1410
|
-
return
|
|
1411
|
-
},
|
|
1412
|
-
let r2 =
|
|
1446
|
+
let Ne = Date.now, He = 1e3, Re = {}, We = 1;
|
|
1447
|
+
const Ve = (t2) => {
|
|
1448
|
+
let e2 = null !== Re[t2];
|
|
1449
|
+
return e2 && (Re[t2] = null), e2;
|
|
1450
|
+
}, Fe = (t2, e2, n2, o2 = 0, i2) => {
|
|
1451
|
+
let r2 = Ne(), s2 = r2, l2 = 0, a2 = 0, c2 = 0, h2 = We++;
|
|
1413
1452
|
if (h2 % 20 == 0) {
|
|
1414
|
-
const
|
|
1415
|
-
for (let
|
|
1416
|
-
|
|
1453
|
+
const t3 = {};
|
|
1454
|
+
for (let e3 in Re) t3[e3] = true;
|
|
1455
|
+
Re = t3;
|
|
1417
1456
|
}
|
|
1418
1457
|
const u2 = function(d2) {
|
|
1419
|
-
let p2 = true !== d2, f2 =
|
|
1458
|
+
let p2 = true !== d2, f2 = Ne(), m2 = true;
|
|
1420
1459
|
try {
|
|
1421
|
-
m2 = (!
|
|
1422
|
-
} catch (
|
|
1460
|
+
m2 = (!e2 || e2(h2)) ?? true;
|
|
1461
|
+
} catch (t3) {
|
|
1423
1462
|
m2 = false;
|
|
1424
1463
|
}
|
|
1425
|
-
if (!
|
|
1464
|
+
if (!Re[h2] || !m2) return Re[h2] = null, void n2?.(60 - a2 / ((f2 - r2) / He), h2, false);
|
|
1426
1465
|
if (p2) {
|
|
1427
1466
|
c2 = Math.round((f2 - s2) / 16.666666666666668) - 1;
|
|
1428
|
-
for (let
|
|
1467
|
+
for (let t3 = 0; t3 < Math.min(c2, 4); t3++) u2(true), a2++;
|
|
1429
1468
|
}
|
|
1430
1469
|
o2 && (l2 = (f2 - r2) / o2, l2 > 1 && (l2 = 1));
|
|
1431
1470
|
let _2 = i2 ? i2(l2) : l2, g2 = false;
|
|
1432
1471
|
try {
|
|
1433
|
-
g2 =
|
|
1434
|
-
} catch (
|
|
1472
|
+
g2 = t2(_2, f2, p2);
|
|
1473
|
+
} catch (t3) {
|
|
1435
1474
|
g2 = false;
|
|
1436
1475
|
}
|
|
1437
|
-
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (
|
|
1476
|
+
false !== g2 && 1 !== l2 || !p2 ? p2 && (s2 = f2, requestAnimationFrame(u2)) : (Re[h2] = null, n2?.(60 - a2 / ((f2 - r2) / He), h2, 1 === l2 || null == o2));
|
|
1438
1477
|
};
|
|
1439
|
-
return
|
|
1440
|
-
},
|
|
1441
|
-
return Math.pow(
|
|
1442
|
-
},
|
|
1443
|
-
return (
|
|
1478
|
+
return Re[h2] = true, requestAnimationFrame(u2), h2;
|
|
1479
|
+
}, je = function(t2) {
|
|
1480
|
+
return Math.pow(t2 - 1, 3) + 1;
|
|
1481
|
+
}, Xe = function(t2) {
|
|
1482
|
+
return (t2 /= 0.5) < 1 ? 0.5 * Math.pow(t2, 3) : 0.5 * (Math.pow(t2 - 2, 3) + 2);
|
|
1444
1483
|
};
|
|
1445
|
-
class
|
|
1446
|
-
constructor(
|
|
1447
|
-
this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback =
|
|
1484
|
+
class Ye {
|
|
1485
|
+
constructor(t2, e2) {
|
|
1486
|
+
this.__isSingleTouch = false, this.__isTracking = false, this.__didDecelerationComplete = false, this.__isGesturing = false, this.__isDragging = false, this.__isDecelerating = 0, this.__isAnimating = 0, this.__interruptedAnimation = false, this.__lastScale = 1, this.__enableScrollX = true, this.__enableScrollY = true, this.__clientLeft = 0, this.__clientTop = 0, this.__clientWidth = 0, this.__clientHeight = 0, this.__contentWidth = 0, this.__contentHeight = 0, this.__snapWidth = 100, this.__snapHeight = 100, this.__zoomLevel = 1, this.__scrollLeft = 0, this.__scrollTop = 0, this.__maxScrollLeft = 0, this.__maxScrollTop = 0, this.__scheduledLeft = 0, this.__scheduledTop = 0, this.__scheduledZoom = 0, this.__lastTouchLeft = 0, this.__lastTouchTop = 0, this.__lastTouchMove = 0, this.__positions = [], this.__initialTouchLeft = 0, this.__initialTouchTop = 0, this.__zoomLevelStart = 1, this.__minDecelerationScrollLeft = null, this.__minDecelerationScrollTop = null, this.__maxDecelerationScrollLeft = null, this.__maxDecelerationScrollTop = null, this.__decelerationVelocityX = null, this.__decelerationVelocityY = 0, this.__callback = t2, this.options = { scrollingX: true, scrollingY: true, animating: true, animationDuration: 250, bouncing: true, locking: true, paging: false, snapping: false, zooming: false, minZoom: 0.5, maxZoom: 3, speedMultiplier: 1, scrollingComplete: void 0, penetrationDeceleration: 0.03, penetrationAcceleration: 0.08, ...e2 };
|
|
1448
1487
|
}
|
|
1449
|
-
setDimensions(
|
|
1450
|
-
null !==
|
|
1488
|
+
setDimensions(t2, e2, n2, o2) {
|
|
1489
|
+
null !== t2 && (this.__clientWidth = t2), null !== e2 && (this.__clientHeight = e2), null !== n2 && (this.__contentWidth = n2), null !== o2 && (this.__contentHeight = o2), this.__computeScrollMax(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true);
|
|
1451
1490
|
}
|
|
1452
|
-
setPosition(
|
|
1453
|
-
this.__clientLeft =
|
|
1491
|
+
setPosition(t2, e2) {
|
|
1492
|
+
this.__clientLeft = t2 || 0, this.__clientTop = e2 || 0;
|
|
1454
1493
|
}
|
|
1455
|
-
setSnapSize(
|
|
1456
|
-
this.__snapWidth =
|
|
1494
|
+
setSnapSize(t2, e2) {
|
|
1495
|
+
this.__snapWidth = t2, this.__snapHeight = e2;
|
|
1457
1496
|
}
|
|
1458
1497
|
getValues() {
|
|
1459
1498
|
return { left: this.__scrollLeft, top: this.__scrollTop, right: this.__scrollLeft + this.__clientWidth / this.__zoomLevel, bottom: this.__scrollTop + this.__clientHeight / this.__zoomLevel, zoom: this.__zoomLevel };
|
|
1460
1499
|
}
|
|
1461
|
-
getPoint(
|
|
1500
|
+
getPoint(t2, e2) {
|
|
1462
1501
|
const n2 = this.getValues();
|
|
1463
|
-
return { left:
|
|
1502
|
+
return { left: t2 / n2.zoom, top: e2 / n2.zoom };
|
|
1464
1503
|
}
|
|
1465
1504
|
getScrollMax() {
|
|
1466
1505
|
return { left: this.__maxScrollLeft, top: this.__maxScrollTop };
|
|
1467
1506
|
}
|
|
1468
|
-
zoomTo(
|
|
1507
|
+
zoomTo(t2, e2 = false, n2, o2, i2) {
|
|
1469
1508
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1470
|
-
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (
|
|
1509
|
+
i2 && (this.__zoomComplete = i2), this.__isDecelerating && (Ve(this.__isDecelerating), this.__isDecelerating = 0);
|
|
1471
1510
|
const r2 = this.__zoomLevel;
|
|
1472
|
-
void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2),
|
|
1473
|
-
const s2 =
|
|
1511
|
+
void 0 === n2 && (n2 = this.__clientWidth / 2), void 0 === o2 && (o2 = this.__clientHeight / 2), t2 = Math.max(Math.min(t2, this.options.maxZoom), this.options.minZoom), this.__computeScrollMax(t2);
|
|
1512
|
+
const s2 = t2 / r2;
|
|
1474
1513
|
let l2 = s2 * (this.__scrollLeft + n2) - n2, a2 = s2 * (this.__scrollTop + o2) - o2;
|
|
1475
|
-
l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2,
|
|
1514
|
+
l2 > this.__maxScrollLeft ? l2 = this.__maxScrollLeft : l2 < 0 && (l2 = 0), a2 > this.__maxScrollTop ? a2 = this.__maxScrollTop : a2 < 0 && (a2 = 0), this.__publish(l2, a2, t2, e2);
|
|
1476
1515
|
}
|
|
1477
|
-
zoomBy(
|
|
1478
|
-
this.zoomTo(this.__zoomLevel *
|
|
1516
|
+
zoomBy(t2, e2 = false, n2 = 0, o2 = 0, i2) {
|
|
1517
|
+
this.zoomTo(this.__zoomLevel * t2, e2, n2, o2, i2);
|
|
1479
1518
|
}
|
|
1480
|
-
scrollTo(
|
|
1481
|
-
if (this.__isDecelerating && (
|
|
1519
|
+
scrollTo(t2, e2, n2 = false, o2 = 1) {
|
|
1520
|
+
if (this.__isDecelerating && (Ve(this.__isDecelerating), this.__isDecelerating = 0), void 0 !== o2 && o2 !== this.__zoomLevel) {
|
|
1482
1521
|
if (!this.options.zooming) throw new Error("Zooming is not enabled!");
|
|
1483
|
-
|
|
1522
|
+
t2 *= o2, e2 *= o2, this.__computeScrollMax(o2);
|
|
1484
1523
|
} else o2 = this.__zoomLevel;
|
|
1485
|
-
this.options.scrollingX ? this.options.paging ?
|
|
1524
|
+
this.options.scrollingX ? this.options.paging ? t2 = Math.round(t2 / this.__clientWidth) * this.__clientWidth : this.options.snapping && (t2 = Math.round(t2 / this.__snapWidth) * this.__snapWidth) : t2 = this.__scrollLeft, this.options.scrollingY ? this.options.paging ? e2 = Math.round(e2 / this.__clientHeight) * this.__clientHeight : this.options.snapping && (e2 = Math.round(e2 / this.__snapHeight) * this.__snapHeight) : e2 = this.__scrollTop, t2 = Math.max(Math.min(this.__maxScrollLeft, t2), 0), e2 = Math.max(Math.min(this.__maxScrollTop, e2), 0), t2 === this.__scrollLeft && e2 === this.__scrollTop && (n2 = false), this.__publish(t2, e2, o2, n2);
|
|
1486
1525
|
}
|
|
1487
|
-
scrollBy(
|
|
1526
|
+
scrollBy(t2 = 0, e2 = 0, n2 = false) {
|
|
1488
1527
|
const o2 = this.__isAnimating ? this.__scheduledLeft : this.__scrollLeft, i2 = this.__isAnimating ? this.__scheduledTop : this.__scrollTop;
|
|
1489
|
-
this.scrollTo(o2 + (
|
|
1528
|
+
this.scrollTo(o2 + (t2 || 0), i2 + (e2 || 0), n2);
|
|
1490
1529
|
}
|
|
1491
|
-
doMouseZoom(
|
|
1492
|
-
const i2 =
|
|
1530
|
+
doMouseZoom(t2, e2, n2, o2) {
|
|
1531
|
+
const i2 = t2 > 0 ? 0.97 : 1.03;
|
|
1493
1532
|
return this.zoomTo(this.__zoomLevel * i2, false, n2 - this.__clientLeft, o2 - this.__clientTop);
|
|
1494
1533
|
}
|
|
1495
|
-
doTouchStart(
|
|
1496
|
-
if (void 0 ===
|
|
1497
|
-
if (
|
|
1534
|
+
doTouchStart(t2, e2) {
|
|
1535
|
+
if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
|
|
1536
|
+
if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
|
|
1498
1537
|
let n2, o2;
|
|
1499
|
-
this.__interruptedAnimation = true, this.__isDecelerating && (
|
|
1500
|
-
let i2 = 1 ===
|
|
1501
|
-
i2 ? (n2 =
|
|
1538
|
+
this.__interruptedAnimation = true, this.__isDecelerating && (Ve(this.__isDecelerating), this.__isDecelerating = 0, this.__interruptedAnimation = true), this.__isAnimating && (Ve(this.__isAnimating), this.__isAnimating = 0, this.__interruptedAnimation = true);
|
|
1539
|
+
let i2 = 1 === t2.length;
|
|
1540
|
+
i2 ? (n2 = t2[0].pageX, o2 = t2[0].pageY) : (n2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, o2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2), this.__initialTouchLeft = n2, this.__initialTouchTop = o2, this.__zoomLevelStart = this.__zoomLevel, this.__lastTouchLeft = n2, this.__lastTouchTop = o2, this.__lastTouchMove = e2, this.__lastScale = 1, this.__enableScrollX = !i2 && this.options.scrollingX, this.__enableScrollY = !i2 && this.options.scrollingY, this.__isTracking = true, this.__didDecelerationComplete = false, this.__isDragging = !i2, this.__isSingleTouch = i2, this.__positions = [];
|
|
1502
1541
|
}
|
|
1503
|
-
doTouchMove(
|
|
1504
|
-
if (void 0 ===
|
|
1505
|
-
if (
|
|
1542
|
+
doTouchMove(t2, e2, n2 = 1) {
|
|
1543
|
+
if (void 0 === t2.length) throw new Error("Invalid touch list: " + t2);
|
|
1544
|
+
if (e2 instanceof Date && (e2 = e2.valueOf()), "number" != typeof e2) throw new Error("Invalid timestamp value: " + e2);
|
|
1506
1545
|
if (!this.__isTracking) return;
|
|
1507
1546
|
let o2, i2;
|
|
1508
|
-
2 ===
|
|
1547
|
+
2 === t2.length ? (o2 = Math.abs(t2[0].pageX + t2[1].pageX) / 2, i2 = Math.abs(t2[0].pageY + t2[1].pageY) / 2) : (o2 = t2[0].pageX, i2 = t2[0].pageY);
|
|
1509
1548
|
let r2 = this.__positions;
|
|
1510
1549
|
if (this.__isDragging) {
|
|
1511
|
-
let
|
|
1550
|
+
let t3 = o2 - this.__lastTouchLeft, s2 = i2 - this.__lastTouchTop, l2 = this.__scrollLeft, a2 = this.__scrollTop, c2 = this.__zoomLevel;
|
|
1512
1551
|
if (void 0 !== n2 && this.options.zooming) {
|
|
1513
|
-
let
|
|
1514
|
-
if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom),
|
|
1515
|
-
let
|
|
1516
|
-
l2 = (
|
|
1552
|
+
let t4 = c2;
|
|
1553
|
+
if (c2 = c2 / this.__lastScale * n2, c2 = Math.max(Math.min(c2, this.options.maxZoom), this.options.minZoom), t4 !== c2) {
|
|
1554
|
+
let e3 = o2 - this.__clientLeft, n3 = i2 - this.__clientTop;
|
|
1555
|
+
l2 = (e3 + l2) * c2 / t4 - e3, a2 = (n3 + a2) * c2 / t4 - n3, this.__computeScrollMax(c2);
|
|
1517
1556
|
}
|
|
1518
1557
|
}
|
|
1519
1558
|
if (this.__enableScrollX) {
|
|
1520
|
-
l2 -=
|
|
1521
|
-
let
|
|
1522
|
-
(l2 >
|
|
1559
|
+
l2 -= t3 * this.options.speedMultiplier;
|
|
1560
|
+
let e3 = this.__maxScrollLeft;
|
|
1561
|
+
(l2 > e3 || l2 < 0) && (this.options.bouncing ? l2 += t3 / 2 * this.options.speedMultiplier : l2 = l2 > e3 ? e3 : 0);
|
|
1523
1562
|
}
|
|
1524
1563
|
if (this.__enableScrollY) {
|
|
1525
1564
|
a2 -= s2 * this.options.speedMultiplier;
|
|
1526
|
-
const
|
|
1527
|
-
(a2 >
|
|
1565
|
+
const t4 = this.__maxScrollTop;
|
|
1566
|
+
(a2 > t4 || a2 < 0) && (this.options.bouncing ? a2 += s2 / 2 * this.options.speedMultiplier : a2 = a2 > t4 ? t4 : 0);
|
|
1528
1567
|
}
|
|
1529
|
-
r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2,
|
|
1568
|
+
r2.length > 60 && r2.splice(0, 30), r2.push(l2, a2, e2), this.__publish(l2, a2, c2);
|
|
1530
1569
|
} else {
|
|
1531
|
-
let
|
|
1532
|
-
this.__enableScrollX = this.options.scrollingX && s2 >=
|
|
1570
|
+
let t3 = this.options.locking ? 3 : 0, n3 = 5, s2 = Math.abs(o2 - this.__initialTouchLeft), l2 = Math.abs(i2 - this.__initialTouchTop);
|
|
1571
|
+
this.__enableScrollX = this.options.scrollingX && s2 >= t3, this.__enableScrollY = this.options.scrollingY && l2 >= t3, r2.push(this.__scrollLeft, this.__scrollTop, e2), this.__isDragging = (this.__enableScrollX || this.__enableScrollY) && (s2 >= n3 || l2 >= n3), this.__isDragging && (this.__interruptedAnimation = false);
|
|
1533
1572
|
}
|
|
1534
|
-
this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove =
|
|
1573
|
+
this.__lastTouchLeft = o2, this.__lastTouchTop = i2, this.__lastTouchMove = e2, this.__lastScale = n2;
|
|
1535
1574
|
}
|
|
1536
|
-
doTouchEnd(
|
|
1537
|
-
if (
|
|
1575
|
+
doTouchEnd(t2) {
|
|
1576
|
+
if (t2 instanceof Date && (t2 = t2.valueOf()), "number" != typeof t2) throw new Error("Invalid timestamp value: " + t2);
|
|
1538
1577
|
if (this.__isTracking) {
|
|
1539
|
-
if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating &&
|
|
1540
|
-
let
|
|
1541
|
-
for (let
|
|
1578
|
+
if (this.__isTracking = false, this.__isDragging) if (this.__isDragging = false, this.__isSingleTouch && this.options.animating && t2 - this.__lastTouchMove <= 100) {
|
|
1579
|
+
let e2 = this.__positions, n2 = e2.length - 1, o2 = n2;
|
|
1580
|
+
for (let t3 = n2; t3 > 0 && e2[t3] > this.__lastTouchMove - 100; t3 -= 3) o2 = t3;
|
|
1542
1581
|
if (o2 !== n2) {
|
|
1543
|
-
const i2 =
|
|
1582
|
+
const i2 = e2[n2] - e2[o2], r2 = this.__scrollLeft - e2[o2 - 2], s2 = this.__scrollTop - e2[o2 - 1];
|
|
1544
1583
|
this.__decelerationVelocityX = r2 / i2 * (1e3 / 60), this.__decelerationVelocityY = s2 / i2 * (1e3 / 60);
|
|
1545
1584
|
const l2 = this.options.paging || this.options.snapping ? 4 : 1;
|
|
1546
|
-
(Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(
|
|
1585
|
+
(Math.abs(this.__decelerationVelocityX) > l2 || Math.abs(this.__decelerationVelocityY) > l2) && this.__startDeceleration(t2);
|
|
1547
1586
|
} else this.options.scrollingComplete?.();
|
|
1548
|
-
} else
|
|
1587
|
+
} else t2 - this.__lastTouchMove > 100 && this.options.scrollingComplete?.();
|
|
1549
1588
|
this.__isDecelerating || ((this.__interruptedAnimation || this.__isDragging) && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, true, this.__zoomLevel)), this.__positions.length = 0;
|
|
1550
1589
|
}
|
|
1551
1590
|
}
|
|
1552
|
-
__publish(
|
|
1591
|
+
__publish(t2, e2, n2, o2 = false) {
|
|
1553
1592
|
const i2 = this.__isAnimating;
|
|
1554
|
-
if (i2 && (
|
|
1555
|
-
this.__scheduledLeft =
|
|
1556
|
-
const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 =
|
|
1557
|
-
n3 && (this.__scrollLeft = o3 + l2 *
|
|
1558
|
-
}.bind(this), u2 = function(
|
|
1559
|
-
return this.__isAnimating ===
|
|
1560
|
-
}.bind(this), d2 = function(
|
|
1561
|
-
|
|
1593
|
+
if (i2 && (Ve(i2), this.__isAnimating = 0), o2 && this.options.animating) {
|
|
1594
|
+
this.__scheduledLeft = t2, this.__scheduledTop = e2, this.__scheduledZoom = n2;
|
|
1595
|
+
const o3 = this.__scrollLeft, r2 = this.__scrollTop, s2 = this.__zoomLevel, l2 = t2 - o3, a2 = e2 - r2, c2 = n2 - s2, h2 = function(t3, e3, n3) {
|
|
1596
|
+
n3 && (this.__scrollLeft = o3 + l2 * t3, this.__scrollTop = r2 + a2 * t3, this.__zoomLevel = s2 + c2 * t3, this.__callback && this.__callback(this.__scrollLeft, this.__scrollTop, this.__zoomLevel));
|
|
1597
|
+
}.bind(this), u2 = function(t3) {
|
|
1598
|
+
return this.__isAnimating === t3;
|
|
1599
|
+
}.bind(this), d2 = function(t3, e3, n3) {
|
|
1600
|
+
e3 === this.__isAnimating && (this.__isAnimating = false), (this.__didDecelerationComplete || n3) && this.options.scrollingComplete?.(), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1562
1601
|
}.bind(this);
|
|
1563
|
-
this.__isAnimating =
|
|
1564
|
-
} else this.__scheduledLeft = this.__scrollLeft =
|
|
1602
|
+
this.__isAnimating = Fe(h2, u2, d2, this.options.animationDuration, i2 ? je : Xe);
|
|
1603
|
+
} else this.__scheduledLeft = this.__scrollLeft = t2, this.__scheduledTop = this.__scrollTop = e2, this.__scheduledZoom = this.__zoomLevel = n2, this.__callback && this.__callback(t2, e2, n2), this.options.zooming && (this.__computeScrollMax(), this.__zoomComplete && (this.__zoomComplete(), this.__zoomComplete = null));
|
|
1565
1604
|
}
|
|
1566
|
-
__computeScrollMax(
|
|
1567
|
-
this.__maxScrollLeft = Math.max(this.__contentWidth *
|
|
1605
|
+
__computeScrollMax(t2 = this.__zoomLevel) {
|
|
1606
|
+
this.__maxScrollLeft = Math.max(this.__contentWidth * t2 - this.__clientWidth, 0), this.__maxScrollTop = Math.max(this.__contentHeight * t2 - this.__clientHeight, 0);
|
|
1568
1607
|
}
|
|
1569
|
-
__startDeceleration(
|
|
1608
|
+
__startDeceleration(t2) {
|
|
1570
1609
|
if (this.options.paging) {
|
|
1571
|
-
const
|
|
1572
|
-
this.__minDecelerationScrollLeft = Math.floor(
|
|
1610
|
+
const t3 = Math.max(Math.min(this.__scrollLeft, this.__maxScrollLeft), 0), e3 = Math.max(Math.min(this.__scrollTop, this.__maxScrollTop), 0), n3 = this.__clientWidth, o3 = this.__clientHeight;
|
|
1611
|
+
this.__minDecelerationScrollLeft = Math.floor(t3 / n3) * n3, this.__minDecelerationScrollTop = Math.floor(e3 / o3) * o3, this.__maxDecelerationScrollLeft = Math.ceil(t3 / n3) * n3, this.__maxDecelerationScrollTop = Math.ceil(e3 / o3) * o3;
|
|
1573
1612
|
} else this.__minDecelerationScrollLeft = 0, this.__minDecelerationScrollTop = 0, this.__maxDecelerationScrollLeft = this.__maxScrollLeft, this.__maxDecelerationScrollTop = this.__maxScrollTop;
|
|
1574
|
-
const
|
|
1613
|
+
const e2 = function(t3, e3, n3) {
|
|
1575
1614
|
this.__stepThroughDeceleration(n3);
|
|
1576
1615
|
}.bind(this), n2 = this.options.snapping ? 4 : 0.1, o2 = function() {
|
|
1577
|
-
const
|
|
1578
|
-
return
|
|
1579
|
-
}.bind(this), i2 = function(
|
|
1616
|
+
const t3 = Math.abs(this.__decelerationVelocityX) >= n2 || Math.abs(this.__decelerationVelocityY) >= n2;
|
|
1617
|
+
return t3 || (this.__didDecelerationComplete = true), t3;
|
|
1618
|
+
}.bind(this), i2 = function(t3, e3, n3) {
|
|
1580
1619
|
this.__isDecelerating = 0, this.__didDecelerationComplete && this.options.scrollingComplete?.(), this.scrollTo(this.__scrollLeft, this.__scrollTop, this.options.snapping);
|
|
1581
1620
|
}.bind(this);
|
|
1582
|
-
this.__isDecelerating =
|
|
1621
|
+
this.__isDecelerating = Fe(e2, o2, i2);
|
|
1583
1622
|
}
|
|
1584
|
-
__stepThroughDeceleration(
|
|
1585
|
-
let
|
|
1623
|
+
__stepThroughDeceleration(t2) {
|
|
1624
|
+
let e2 = this.__scrollLeft + this.__decelerationVelocityX, n2 = this.__scrollTop + this.__decelerationVelocityY;
|
|
1586
1625
|
if (!this.options.bouncing) {
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1626
|
+
const t3 = Math.max(Math.min(this.__maxDecelerationScrollLeft, e2), this.__minDecelerationScrollLeft);
|
|
1627
|
+
t3 !== e2 && (e2 = t3, this.__decelerationVelocityX = 0);
|
|
1589
1628
|
const o2 = Math.max(Math.min(this.__maxDecelerationScrollTop, n2), this.__minDecelerationScrollTop);
|
|
1590
1629
|
o2 !== n2 && (n2 = o2, this.__decelerationVelocityY = 0);
|
|
1591
1630
|
}
|
|
1592
|
-
if (
|
|
1593
|
-
const
|
|
1594
|
-
this.__decelerationVelocityX *=
|
|
1631
|
+
if (t2 ? this.__publish(e2, n2, this.__zoomLevel) : (this.__scrollLeft = e2, this.__scrollTop = n2), !this.options.paging) {
|
|
1632
|
+
const t3 = 0.95;
|
|
1633
|
+
this.__decelerationVelocityX *= t3, this.__decelerationVelocityY *= t3;
|
|
1595
1634
|
}
|
|
1596
1635
|
if (this.options.bouncing) {
|
|
1597
|
-
let
|
|
1598
|
-
|
|
1636
|
+
let t3 = 0, o2 = 0, i2 = this.options.penetrationDeceleration, r2 = this.options.penetrationAcceleration;
|
|
1637
|
+
e2 < this.__minDecelerationScrollLeft ? t3 = this.__minDecelerationScrollLeft - e2 : e2 > this.__maxDecelerationScrollLeft && (t3 = this.__maxDecelerationScrollLeft - e2), n2 < this.__minDecelerationScrollTop ? o2 = this.__minDecelerationScrollTop - n2 : n2 > this.__maxDecelerationScrollTop && (o2 = this.__maxDecelerationScrollTop - n2), 0 !== t3 && (t3 * this.__decelerationVelocityX <= 0 ? this.__decelerationVelocityX += t3 * i2 : this.__decelerationVelocityX = t3 * r2), 0 !== o2 && (o2 * this.__decelerationVelocityY <= 0 ? this.__decelerationVelocityY += o2 * i2 : this.__decelerationVelocityY = o2 * r2);
|
|
1599
1638
|
}
|
|
1600
1639
|
}
|
|
1601
1640
|
}
|
|
1602
|
-
const
|
|
1641
|
+
const Ue = (t2, e2) => x(Oe, { ...t2, ref: e2 }), Ge = Object.freeze(Object.defineProperty({ __proto__: null, defaultCreateScrollbar: Ue, getScrollTo: (t2, e2, n2, o2, i2 = 0) => {
|
|
1603
1642
|
for (let i3 = 0; i3 < n2.length; i3++) {
|
|
1604
1643
|
const r2 = n2[i3].getBoundingClientRect();
|
|
1605
|
-
let s2 = r2.left -
|
|
1644
|
+
let s2 = r2.left - e2, l2 = s2 + r2.width;
|
|
1606
1645
|
if (o2) {
|
|
1607
|
-
if (s2 <
|
|
1608
|
-
} else if (Math.ceil(l2) > Math.ceil(
|
|
1646
|
+
if (s2 < t2 && l2 >= t2) return s2;
|
|
1647
|
+
} else if (Math.ceil(l2) > Math.ceil(t2) + 2) return l2;
|
|
1609
1648
|
}
|
|
1610
1649
|
return i2;
|
|
1611
|
-
} }, Symbol.toStringTag, { value: "Module" })),
|
|
1612
|
-
const { children: n2, viewport: o2, onScrollViewport: i2, showHorizontalScrollbar: r2 = true, showVerticalScrollbar: s2 = true, createScrollCorner: l2 =
|
|
1650
|
+
} }, Symbol.toStringTag, { value: "Module" })), qe = ({ width: t2, height: e2 }) => x("div", { className: "corner", style: { minWidth: `${t2}px`, width: `${t2}px`, minHeight: `${e2}px`, height: `${e2}px` } }), Ze = p(f((t2, e2) => {
|
|
1651
|
+
const { children: n2, viewport: o2, onScrollViewport: i2, showHorizontalScrollbar: r2 = true, showVerticalScrollbar: s2 = true, createScrollCorner: l2 = qe, createHorizontalScrollbar: c2 = Ue, createVerticalScrollbar: d2 = Ue, style: p2, touchElement: f2, disableTouch: _2, ...g2 } = t2, y2 = r2 && c2, v2 = s2 && d2, w2 = ht(i2, [i2]), b2 = Ft(e2, () => ({ isScrollPane: () => true }), []), L2 = a(null);
|
|
1613
1652
|
u(() => {
|
|
1614
1653
|
L2.current && (L2.current.__scrollTop === o2?.top && L2.current.__scrollLeft === o2?.left || L2.current.__isDecelerating || L2.current?.scrollTo(o2?.left, o2?.top, false));
|
|
1615
1654
|
}, [o2?.left, o2?.top, f2]);
|
|
1616
|
-
const T2 = m((
|
|
1617
|
-
w2?.({ left:
|
|
1618
|
-
}, []),
|
|
1619
|
-
L2.current?.doTouchStart(
|
|
1620
|
-
}, []),
|
|
1621
|
-
|
|
1622
|
-
}, []),
|
|
1623
|
-
L2.current?.doTouchEnd(
|
|
1624
|
-
}, []),
|
|
1625
|
-
L2.current.setDimensions(
|
|
1655
|
+
const T2 = m((t3, e3) => {
|
|
1656
|
+
w2?.({ left: t3, top: e3 });
|
|
1657
|
+
}, []), C2 = m((t3) => {
|
|
1658
|
+
L2.current?.doTouchStart(t3.touches, t3.timeStamp);
|
|
1659
|
+
}, []), k2 = m((t3) => {
|
|
1660
|
+
t3.preventDefault(), L2.current?.doTouchMove(t3.touches, t3.timeStamp);
|
|
1661
|
+
}, []), P2 = m((t3) => {
|
|
1662
|
+
L2.current?.doTouchEnd(t3.timeStamp);
|
|
1663
|
+
}, []), D2 = m(({ containerWidth: t3, containerHeight: e3, totalWidth: n3, totalHeight: o3 }) => {
|
|
1664
|
+
L2.current.setDimensions(t3, e3, n3, o3);
|
|
1626
1665
|
}, []);
|
|
1627
1666
|
u(() => {
|
|
1628
|
-
const
|
|
1629
|
-
if (!_2 && N().supportsTouchEvents &&
|
|
1667
|
+
const t3 = f2 ?? b2.current;
|
|
1668
|
+
if (!_2 && N().supportsTouchEvents && t3 && o2) {
|
|
1630
1669
|
if (!L2.current) {
|
|
1631
|
-
const
|
|
1632
|
-
L2.current = new
|
|
1670
|
+
const t4 = { scrollingX: true, scrollingY: true, decelerationRate: 0.95, penetrationAcceleration: 0.08 };
|
|
1671
|
+
L2.current = new Ye(T2, t4);
|
|
1633
1672
|
}
|
|
1634
|
-
N().supportsTouchEvents && (
|
|
1673
|
+
N().supportsTouchEvents && (t3.addEventListener("touchstart", C2), t3.addEventListener("touchend", P2), t3.addEventListener("touchmove", k2)), D2({ containerWidth: o2?.width, containerHeight: o2?.height, totalWidth: o2?.totalWidth, totalHeight: o2?.totalHeight });
|
|
1635
1674
|
}
|
|
1636
1675
|
return () => {
|
|
1637
|
-
|
|
1676
|
+
t3?.removeEventListener("touchstart", C2), t3?.removeEventListener("touchend", P2), t3?.removeEventListener("touchmove", k2);
|
|
1638
1677
|
};
|
|
1639
1678
|
}, [o2?.width, o2?.height, o2?.totalWidth, o2?.totalHeight, _2, f2]);
|
|
1640
|
-
const [A2, { width: z2 }] = M(), [B2, { height: $2 }] = M(),
|
|
1679
|
+
const [A2, { width: z2 }] = M(), [B2, { height: $2 }] = M(), I2 = h(() => {
|
|
1641
1680
|
if (!v2) return null;
|
|
1642
|
-
const
|
|
1643
|
-
w2?.({ top:
|
|
1681
|
+
const t3 = d2({ orientation: Te.Vertical, offset: o2?.top, viewportSize: o2?.height, totalSize: o2?.totalHeight, onScrollOffset: (t4) => {
|
|
1682
|
+
w2?.({ top: t4 });
|
|
1644
1683
|
} });
|
|
1645
|
-
return x("div", { style: { display: "flex", flex: "0" }, ref: A2, children:
|
|
1646
|
-
}, [d2, o2?.top, o2?.height, o2?.totalHeight]),
|
|
1684
|
+
return x("div", { style: { display: "flex", flex: "0" }, ref: A2, children: t3 });
|
|
1685
|
+
}, [d2, o2?.top, o2?.height, o2?.totalHeight]), K2 = h(() => {
|
|
1647
1686
|
if (!y2) return null;
|
|
1648
|
-
const
|
|
1649
|
-
w2?.({ left:
|
|
1687
|
+
const t3 = c2({ orientation: Te.Horizontal, offset: o2?.left, viewportSize: o2?.width, totalSize: o2?.totalWidth, onScrollOffset: (t4) => {
|
|
1688
|
+
w2?.({ left: t4 });
|
|
1650
1689
|
} });
|
|
1651
|
-
return S("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [x("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${z2}px)` }, children: x("div", { ref: B2, className: "sizer", children:
|
|
1690
|
+
return S("div", { style: { display: "flex", flex: "none", flexDirection: "row", alignItems: "stretch", justifyContent: "center" }, children: [x("div", { style: { display: "flex", flex: "1 1 100%", flexDirection: "column", width: `calc(100% - ${z2}px)` }, children: x("div", { ref: B2, className: "sizer", children: t3 }) }), v2 ? l2({ width: z2, height: $2 }) : x(E, {})] });
|
|
1652
1691
|
}, [c2, o2?.left, o2?.width, o2?.totalWidth, v2, l2, z2, $2]);
|
|
1653
|
-
return x("div", { style: { position: "relative", display: "flex", minWidth: v2 ? `${z2}px` : void 0, minHeight: y2 ? `${$2}px` : void 0, ...p2 }, ...g2, ref: b2, children: S("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [S("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [x("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: n2 }), v2 ?
|
|
1692
|
+
return x("div", { style: { position: "relative", display: "flex", minWidth: v2 ? `${z2}px` : void 0, minHeight: y2 ? `${$2}px` : void 0, ...p2 }, ...g2, ref: b2, children: S("div", { style: { position: "relative", width: "100%", flex: "1 1 100%", display: "flex", flexDirection: "column", boxSizing: "border-box" }, children: [S("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: [x("div", { style: { display: "flex", flex: "1 1 100%", overflow: "hidden" }, children: n2 }), v2 ? I2 : x(E, {})] }), y2 ? K2 : x(E, {})] }) });
|
|
1654
1693
|
}));
|
|
1655
|
-
|
|
1656
|
-
const
|
|
1657
|
-
const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: i2 = 0, minSize: r2 = 0, endGap: s2 =
|
|
1694
|
+
Ze.displayName = "ScrollPane";
|
|
1695
|
+
const Je = 300, Qe = 100, tn = 1e6, en = 100, nn = 50, on = p(f((t2, e2) => {
|
|
1696
|
+
const { offset: n2 = 0, viewportSize: o2 = 0, totalSize: i2 = 0, minSize: r2 = 0, endGap: s2 = Je, endScrollIncrement: l2 = Qe, style: a2 = O, onMouseDown: c2, onScrollOffset: u2, onScroll: p2, scaleLimit: f2 = tn, scaleFactor: _2 = en, precisionFactor: g2 = nn, createScrollbar: y2 = Ue, ...v2 } = t2;
|
|
1658
1697
|
p2 && console.warn("onScroll not supported for VirtualScrollbar. Use onScrollOffset instead");
|
|
1659
|
-
const w2 =
|
|
1660
|
-
const
|
|
1661
|
-
return { offset: Math.ceil(n2 /
|
|
1662
|
-
}, [n2, i2, o2, b2, r2, s2, l2]), E2 =
|
|
1698
|
+
const w2 = ht(c2, [c2]), [b2, x2] = d(false), S2 = h(() => {
|
|
1699
|
+
const t3 = 0 === f2 ? i2 : Math.min(i2 ?? 0, Math.max(r2 ?? 0, (n2 ?? 0) + (o2 ?? 0)) + (s2 ?? 0)), e3 = 0 !== f2 && t3 > f2 ? _2 : 1, l3 = e3 / g2, a3 = Math.ceil(t3 / e3);
|
|
1700
|
+
return { offset: Math.ceil(n2 / e3), totalSize: a3, viewportSize: Math.ceil(o2 / e3), scaledOffset: n2, scaledTotalSize: i2, scaledViewportSize: o2, factor: e3, precision: l3 };
|
|
1701
|
+
}, [n2, i2, o2, b2, r2, s2, l2]), E2 = ht((t3, e3, n3) => {
|
|
1663
1702
|
const o3 = S2.offset;
|
|
1664
|
-
Math.abs(
|
|
1665
|
-
}, [u2, S2]), L2 = m((
|
|
1666
|
-
}, []), M2 = m((
|
|
1703
|
+
Math.abs(t3 - o3) < S2.precision && (t3 = o3), u2?.(t3 * S2.factor, o3, S2.viewportSize);
|
|
1704
|
+
}, [u2, S2]), L2 = m((t3) => {
|
|
1705
|
+
}, []), M2 = m((t3) => {
|
|
1667
1706
|
document.removeEventListener("mousemove", L2), document.removeEventListener("mouseup", M2), x2(false);
|
|
1668
|
-
}, []), T2 = m((
|
|
1669
|
-
x2(true), w2?.(
|
|
1707
|
+
}, []), T2 = m((t3) => {
|
|
1708
|
+
x2(true), w2?.(t3), document.addEventListener("mousemove", L2, { passive: true }), document.addEventListener("mouseup", M2, { passive: true });
|
|
1670
1709
|
}, [L2, M2]);
|
|
1671
|
-
return
|
|
1710
|
+
return Ue({ style: a2, ...v2, offset: S2.offset, totalSize: S2.totalSize, viewportSize: S2.viewportSize, onMouseDown: T2, onScrollOffset: E2 }, e2);
|
|
1672
1711
|
}));
|
|
1673
1712
|
on.displayName = "VirtualScrollbar";
|
|
1674
1713
|
export {
|
|
1675
1714
|
$ as Command,
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1715
|
+
q as CommandButtonType,
|
|
1716
|
+
V as CommandGroup,
|
|
1717
|
+
pe as DefaultDynamicIconService,
|
|
1718
|
+
et as DefaultReactNotifier,
|
|
1719
|
+
_e as DynamicIcon,
|
|
1720
|
+
Qt as ErrorTestPanel,
|
|
1721
|
+
J as FocusKeyNavigation,
|
|
1722
|
+
D as HorizontalAlignment,
|
|
1723
|
+
ye as InMemoryStore,
|
|
1685
1724
|
z as KeyCodes,
|
|
1686
1725
|
A as KeyModifiers,
|
|
1687
|
-
|
|
1726
|
+
Me as LocalStorageStore,
|
|
1688
1727
|
B as MouseButtonCodes,
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1728
|
+
ot as NotifierProvider,
|
|
1729
|
+
tt as NotifierType,
|
|
1730
|
+
Ee as PersistenceStateProvider,
|
|
1731
|
+
qt as ReactErrorBoundary,
|
|
1732
|
+
W as ReactUtils,
|
|
1733
|
+
Q as RoundedTab,
|
|
1734
|
+
Ze as ScrollPane,
|
|
1735
|
+
Ge as ScrollUtils,
|
|
1736
|
+
Oe as Scrollbar,
|
|
1737
|
+
Te as ScrollbarOrientation,
|
|
1738
|
+
I as SimpleCommand,
|
|
1739
|
+
se as SplitPane,
|
|
1740
|
+
ee as SplitPaneResizer,
|
|
1702
1741
|
Z as ToolTipPlacement,
|
|
1703
|
-
|
|
1742
|
+
Jt as UncaughtErrorBoundary,
|
|
1704
1743
|
on as VirtualScrollbar,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1744
|
+
ge as WalkingIcon,
|
|
1745
|
+
de as createDynamicIconService,
|
|
1746
|
+
qe as defaultCreateScrollCorner,
|
|
1747
|
+
Be as defaultCreateScrollEdgeButton,
|
|
1748
|
+
ze as defaultCreateScrollEndButton,
|
|
1749
|
+
Ae as defaultCreateScrollStartButton,
|
|
1750
|
+
dt as getDevicePixelRatio,
|
|
1751
|
+
X as toShortcutString,
|
|
1752
|
+
ct as useAnimatedMeasure,
|
|
1753
|
+
ht as useCallbackRef,
|
|
1754
|
+
Y as useCommand,
|
|
1755
|
+
G as useCommands,
|
|
1756
|
+
$t as useCopyPaste,
|
|
1757
|
+
ut as useDevicePixelRatio,
|
|
1758
|
+
zt as useEditMode,
|
|
1759
|
+
mt as useFullscreenPortal,
|
|
1760
|
+
Bt as useGlobalClipboard,
|
|
1761
|
+
Wt as useId,
|
|
1762
|
+
Ft as useImperativeElement,
|
|
1763
|
+
gt as useMouseDownAndHoldListener,
|
|
1764
|
+
it as useNotifier,
|
|
1765
|
+
pt as useOnClickOrFocusAway,
|
|
1766
|
+
xe as usePersistenceState,
|
|
1767
|
+
_t as useSynchronizedPointerHandler,
|
|
1768
|
+
It as useTraceUpdate,
|
|
1769
|
+
Ut as useUndoManager
|
|
1731
1770
|
};
|