@enya-learning/nova 0.4.2 → 0.5.0
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/README.md +7 -16
- package/dist/chunks/dist-fahbq1psobj0ox6s.js +1327 -0
- package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -0
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +37 -0
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js.map +1 -0
- package/dist/components/accordion.js +59 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.js +108 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.js +49 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.js +16 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.js +58 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.js +81 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.js +47 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.js +48 -3
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.js +3000 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.js +65 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.js +1191 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.js +10596 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.js +22 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.js +28 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.js +179 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.js +656 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.js +149 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/dialog.js +103 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/direction.js +6 -0
- package/dist/components/drawer.js +1042 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.js +153 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.js +67 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/enya-logo.js +42 -42
- package/dist/components/enya-logo.js.map +1 -1
- package/dist/components/field.js +119 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/hover-card.js +40 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.js +85 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.js +416 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.js +18 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.js +133 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.js +23 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.js +16 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.js +153 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/native-select.js +43 -0
- package/dist/components/native-select.js.map +1 -0
- package/dist/components/navigation-menu.js +93 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.js +95 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.js +62 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.js +50 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.js +30 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/resizable.js +1562 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.js +40 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.js +109 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.js +98 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.js +395 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.js +15 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.js +36 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.js +722 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.js +17 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/switch.js +21 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.js +76 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.js +51 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.js +55 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.js +39 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.js +46 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/index.js +17 -23241
- package/dist/src/components/badge/badge.d.ts +1 -1
- package/dist/src/components/button/button.d.ts +1 -1
- package/dist/src/components/item/item.d.ts +1 -1
- package/dist/src/components/tabs/tabs.d.ts +1 -1
- package/dist/src/index.d.ts +1 -53
- package/dist/styles/nova-binding.css +102 -0
- package/dist/styles/nova.css +106 -48
- package/dist/styles/theme-nova.css +77 -81
- package/dist/styles/typography.css +34 -22
- package/package.json +30 -9
- package/src/eslint/no-primitive-colors.test.ts +97 -0
- package/dist/chunks/button-kvgr8g13fe959ju0.js +0 -81
- package/dist/chunks/button-kvgr8g13fe959ju0.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/styles/globals.css +0 -77
|
@@ -0,0 +1,1562 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as He } from "../chunks/utils-kyb5nny4y41y7hd8.js";
|
|
3
|
+
import { jsx as j } from "react/jsx-runtime";
|
|
4
|
+
import { createContext as pt, useCallback as Ve, useContext as ht, useEffect as pe, useId as gt, useImperativeHandle as Ye, useLayoutEffect as vt, useMemo as mt, useRef as F, useState as ce, useSyncExternalStore as bt } from "react";
|
|
5
|
+
function yt(e, t) {
|
|
6
|
+
const n = getComputedStyle(e);
|
|
7
|
+
return t * parseFloat(n.fontSize);
|
|
8
|
+
}
|
|
9
|
+
function zt(e, t) {
|
|
10
|
+
const n = getComputedStyle(e.ownerDocument.documentElement);
|
|
11
|
+
return t * parseFloat(n.fontSize);
|
|
12
|
+
}
|
|
13
|
+
function St(e) {
|
|
14
|
+
return e / 100 * window.innerHeight;
|
|
15
|
+
}
|
|
16
|
+
function wt(e) {
|
|
17
|
+
return e / 100 * window.innerWidth;
|
|
18
|
+
}
|
|
19
|
+
function xt(e) {
|
|
20
|
+
switch (typeof e) {
|
|
21
|
+
case "number":
|
|
22
|
+
return [e, "px"];
|
|
23
|
+
case "string": {
|
|
24
|
+
const t = parseFloat(e);
|
|
25
|
+
return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function re({ groupSize: e, panelElement: t, styleProp: n }) {
|
|
30
|
+
let o;
|
|
31
|
+
const [r, a] = xt(n);
|
|
32
|
+
switch (a) {
|
|
33
|
+
case "%":
|
|
34
|
+
o = r / 100 * e;
|
|
35
|
+
break;
|
|
36
|
+
case "px":
|
|
37
|
+
o = r;
|
|
38
|
+
break;
|
|
39
|
+
case "rem":
|
|
40
|
+
o = zt(t, r);
|
|
41
|
+
break;
|
|
42
|
+
case "em":
|
|
43
|
+
o = yt(t, r);
|
|
44
|
+
break;
|
|
45
|
+
case "vh":
|
|
46
|
+
o = St(r);
|
|
47
|
+
break;
|
|
48
|
+
case "vw":
|
|
49
|
+
o = wt(r);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
return o;
|
|
53
|
+
}
|
|
54
|
+
function I(e) {
|
|
55
|
+
return parseFloat(e.toFixed(3));
|
|
56
|
+
}
|
|
57
|
+
function te({ group: e }) {
|
|
58
|
+
const { orientation: t, panels: n } = e;
|
|
59
|
+
return n.reduce((o, r) => (o += t === "horizontal" ? r.element.offsetWidth : r.element.offsetHeight, o), 0);
|
|
60
|
+
}
|
|
61
|
+
function ve(e) {
|
|
62
|
+
const { panels: t } = e, n = te({ group: e });
|
|
63
|
+
return n === 0 ? t.map((o) => ({
|
|
64
|
+
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
65
|
+
collapsedSize: 0,
|
|
66
|
+
collapsible: o.panelConstraints.collapsible === !0,
|
|
67
|
+
defaultSize: void 0,
|
|
68
|
+
disabled: o.panelConstraints.disabled,
|
|
69
|
+
minSize: 0,
|
|
70
|
+
maxSize: 100,
|
|
71
|
+
panelId: o.id
|
|
72
|
+
})) : t.map((o) => {
|
|
73
|
+
const { element: r, panelConstraints: a } = o;
|
|
74
|
+
let d = 0;
|
|
75
|
+
a.collapsedSize !== void 0 && (d = I(re({
|
|
76
|
+
groupSize: n,
|
|
77
|
+
panelElement: r,
|
|
78
|
+
styleProp: a.collapsedSize
|
|
79
|
+
}) / n * 100));
|
|
80
|
+
let s;
|
|
81
|
+
a.defaultSize !== void 0 && (s = I(re({
|
|
82
|
+
groupSize: n,
|
|
83
|
+
panelElement: r,
|
|
84
|
+
styleProp: a.defaultSize
|
|
85
|
+
}) / n * 100));
|
|
86
|
+
let i = 0;
|
|
87
|
+
a.minSize !== void 0 && (i = I(re({
|
|
88
|
+
groupSize: n,
|
|
89
|
+
panelElement: r,
|
|
90
|
+
styleProp: a.minSize
|
|
91
|
+
}) / n * 100));
|
|
92
|
+
let l = 100;
|
|
93
|
+
return a.maxSize !== void 0 && (l = I(re({
|
|
94
|
+
groupSize: n,
|
|
95
|
+
panelElement: r,
|
|
96
|
+
styleProp: a.maxSize
|
|
97
|
+
}) / n * 100)), {
|
|
98
|
+
groupResizeBehavior: a.groupResizeBehavior,
|
|
99
|
+
collapsedSize: d,
|
|
100
|
+
collapsible: a.collapsible === !0,
|
|
101
|
+
defaultSize: s,
|
|
102
|
+
disabled: a.disabled,
|
|
103
|
+
minSize: i,
|
|
104
|
+
maxSize: l,
|
|
105
|
+
panelId: o.id
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function P(e, t = "Assertion error") {
|
|
110
|
+
if (!e) throw Error(t);
|
|
111
|
+
}
|
|
112
|
+
function me(e, t) {
|
|
113
|
+
return Array.from(t).sort(e === "horizontal" ? Ct : Pt);
|
|
114
|
+
}
|
|
115
|
+
function Ct(e, t) {
|
|
116
|
+
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
117
|
+
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
118
|
+
}
|
|
119
|
+
function Pt(e, t) {
|
|
120
|
+
const n = e.element.offsetTop - t.element.offsetTop;
|
|
121
|
+
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
122
|
+
}
|
|
123
|
+
function Xe(e) {
|
|
124
|
+
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
125
|
+
}
|
|
126
|
+
function qe(e, t) {
|
|
127
|
+
return {
|
|
128
|
+
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(Math.abs(e.x - t.left), Math.abs(e.x - t.right)),
|
|
129
|
+
y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(Math.abs(e.y - t.top), Math.abs(e.y - t.bottom))
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function Lt({ orientation: e, rects: t, targetRect: n }) {
|
|
133
|
+
const o = {
|
|
134
|
+
x: n.x + n.width / 2,
|
|
135
|
+
y: n.y + n.height / 2
|
|
136
|
+
};
|
|
137
|
+
let r, a = Number.MAX_VALUE;
|
|
138
|
+
for (const d of t) {
|
|
139
|
+
const { x: s, y: i } = qe(o, d), l = e === "horizontal" ? s : i;
|
|
140
|
+
l < a && (a = l, r = d);
|
|
141
|
+
}
|
|
142
|
+
return P(r, "No rect found"), r;
|
|
143
|
+
}
|
|
144
|
+
var ue;
|
|
145
|
+
function kt() {
|
|
146
|
+
return ue === void 0 && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = !1), ue;
|
|
147
|
+
}
|
|
148
|
+
function Je(e) {
|
|
149
|
+
const { element: t, orientation: n, panels: o, separators: r } = e, a = me(n, Array.from(t.children).filter(Xe).map((f) => ({ element: f }))).map(({ element: f }) => f), d = [];
|
|
150
|
+
let s = !1, i = !1, l = -1, u = -1, c = 0, S, h = [];
|
|
151
|
+
{
|
|
152
|
+
let f = -1;
|
|
153
|
+
for (const p of a) p.hasAttribute("data-panel") && (f++, p.hasAttribute("data-disabled") || (c++, l === -1 && (l = f), u = f));
|
|
154
|
+
}
|
|
155
|
+
if (c > 1) {
|
|
156
|
+
let f = -1;
|
|
157
|
+
for (const p of a) if (p.hasAttribute("data-panel")) {
|
|
158
|
+
f++;
|
|
159
|
+
const m = o.find((g) => g.element === p);
|
|
160
|
+
if (m) {
|
|
161
|
+
if (S) {
|
|
162
|
+
const g = S.element.getBoundingClientRect(), v = p.getBoundingClientRect();
|
|
163
|
+
let b;
|
|
164
|
+
if (i) {
|
|
165
|
+
const z = n === "horizontal" ? new DOMRect(g.right, g.top, 0, g.height) : new DOMRect(g.left, g.bottom, g.width, 0), y = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
|
|
166
|
+
switch (h.length) {
|
|
167
|
+
case 0:
|
|
168
|
+
b = [z, y];
|
|
169
|
+
break;
|
|
170
|
+
case 1: {
|
|
171
|
+
const k = h[0];
|
|
172
|
+
b = [k, Lt({
|
|
173
|
+
orientation: n,
|
|
174
|
+
rects: [g, v],
|
|
175
|
+
targetRect: k.element.getBoundingClientRect()
|
|
176
|
+
}) === g ? y : z];
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
default:
|
|
180
|
+
b = h;
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
} else h.length ? b = h : b = [n === "horizontal" ? new DOMRect(g.right, v.top, v.left - g.right, v.height) : new DOMRect(v.left, g.bottom, v.width, v.top - g.bottom)];
|
|
184
|
+
for (const z of b) {
|
|
185
|
+
let y = "width" in z ? z : z.element.getBoundingClientRect();
|
|
186
|
+
const k = kt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
187
|
+
if (y.width < k) {
|
|
188
|
+
const E = k - y.width;
|
|
189
|
+
y = new DOMRect(y.x - E / 2, y.y, y.width + E, y.height);
|
|
190
|
+
}
|
|
191
|
+
if (y.height < k) {
|
|
192
|
+
const E = k - y.height;
|
|
193
|
+
y = new DOMRect(y.x, y.y - E / 2, y.width, y.height + E);
|
|
194
|
+
}
|
|
195
|
+
!s && !(f <= l || f > u) && d.push({
|
|
196
|
+
group: e,
|
|
197
|
+
groupSize: te({ group: e }),
|
|
198
|
+
panels: [S, m],
|
|
199
|
+
separator: "width" in z ? void 0 : z,
|
|
200
|
+
rect: y
|
|
201
|
+
}), s = !1;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
i = !1, S = m, h = [];
|
|
205
|
+
}
|
|
206
|
+
} else if (p.hasAttribute("data-separator")) {
|
|
207
|
+
p.ariaDisabled !== null && (s = !0);
|
|
208
|
+
const m = r.find((g) => g.element === p);
|
|
209
|
+
m ? h.push(m) : (S = void 0, h = []);
|
|
210
|
+
} else i = !0;
|
|
211
|
+
}
|
|
212
|
+
return d;
|
|
213
|
+
}
|
|
214
|
+
var Ue = class {
|
|
215
|
+
#e = {};
|
|
216
|
+
addListener(e, t) {
|
|
217
|
+
const n = this.#e[e];
|
|
218
|
+
return n === void 0 ? this.#e[e] = [t] : n.includes(t) || n.push(t), () => {
|
|
219
|
+
this.removeListener(e, t);
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
emit(e, t) {
|
|
223
|
+
const n = this.#e[e];
|
|
224
|
+
if (n !== void 0) if (n.length === 1) n[0].call(null, t);
|
|
225
|
+
else {
|
|
226
|
+
let o = !1, r = null;
|
|
227
|
+
const a = Array.from(n);
|
|
228
|
+
for (let d = 0; d < a.length; d++) {
|
|
229
|
+
const s = a[d];
|
|
230
|
+
try {
|
|
231
|
+
s.call(null, t);
|
|
232
|
+
} catch (i) {
|
|
233
|
+
r === null && (o = !0, r = i);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (o) throw r;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
removeAllListeners() {
|
|
240
|
+
this.#e = {};
|
|
241
|
+
}
|
|
242
|
+
removeListener(e, t) {
|
|
243
|
+
const n = this.#e[e];
|
|
244
|
+
if (n !== void 0) {
|
|
245
|
+
const o = n.indexOf(t);
|
|
246
|
+
o >= 0 && n.splice(o, 1);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}, A = /* @__PURE__ */ new Map(), Ze = new Ue();
|
|
250
|
+
function Et(e) {
|
|
251
|
+
A = new Map(A), A.delete(e);
|
|
252
|
+
}
|
|
253
|
+
function ke(e, t) {
|
|
254
|
+
for (const [n] of A) if (n.id === e) return n;
|
|
255
|
+
}
|
|
256
|
+
function H(e, t) {
|
|
257
|
+
for (const [n, o] of A) if (n.id === e) return o;
|
|
258
|
+
if (t) throw Error(`Could not find data for Group with id ${e}`);
|
|
259
|
+
}
|
|
260
|
+
function J() {
|
|
261
|
+
return A;
|
|
262
|
+
}
|
|
263
|
+
function be(e, t) {
|
|
264
|
+
return Ze.addListener("groupChange", (n) => {
|
|
265
|
+
n.group.id === e && t(n);
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
function B(e, t) {
|
|
269
|
+
const n = A.get(e);
|
|
270
|
+
A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
|
|
271
|
+
group: e,
|
|
272
|
+
prev: n,
|
|
273
|
+
next: t
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
function Mt(e, t, n) {
|
|
277
|
+
let o, r = {
|
|
278
|
+
x: 1 / 0,
|
|
279
|
+
y: 1 / 0
|
|
280
|
+
};
|
|
281
|
+
for (const a of t) {
|
|
282
|
+
const d = qe(n, a.rect);
|
|
283
|
+
switch (e) {
|
|
284
|
+
case "horizontal":
|
|
285
|
+
d.x <= r.x && (o = a, r = d);
|
|
286
|
+
break;
|
|
287
|
+
case "vertical":
|
|
288
|
+
d.y <= r.y && (o = a, r = d);
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return o ? {
|
|
293
|
+
distance: r,
|
|
294
|
+
hitRegion: o
|
|
295
|
+
} : void 0;
|
|
296
|
+
}
|
|
297
|
+
function Rt(e) {
|
|
298
|
+
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
299
|
+
}
|
|
300
|
+
function Dt(e, t) {
|
|
301
|
+
if (e === t) throw new Error("Cannot compare node with itself");
|
|
302
|
+
const n = {
|
|
303
|
+
a: Re(e),
|
|
304
|
+
b: Re(t)
|
|
305
|
+
};
|
|
306
|
+
let o;
|
|
307
|
+
for (; n.a.at(-1) === n.b.at(-1); ) o = n.a.pop(), n.b.pop();
|
|
308
|
+
P(o, "Stacking order can only be calculated for elements with a common ancestor");
|
|
309
|
+
const r = {
|
|
310
|
+
a: Me(Ee(n.a)),
|
|
311
|
+
b: Me(Ee(n.b))
|
|
312
|
+
};
|
|
313
|
+
if (r.a === r.b) {
|
|
314
|
+
const a = o.childNodes, d = {
|
|
315
|
+
a: n.a.at(-1),
|
|
316
|
+
b: n.b.at(-1)
|
|
317
|
+
};
|
|
318
|
+
let s = a.length;
|
|
319
|
+
for (; s--; ) {
|
|
320
|
+
const i = a[s];
|
|
321
|
+
if (i === d.a) return 1;
|
|
322
|
+
if (i === d.b) return -1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return Math.sign(r.a - r.b);
|
|
326
|
+
}
|
|
327
|
+
var It = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
328
|
+
function Tt(e) {
|
|
329
|
+
const t = getComputedStyle(Ke(e) ?? e).display;
|
|
330
|
+
return t === "flex" || t === "inline-flex";
|
|
331
|
+
}
|
|
332
|
+
function Nt(e) {
|
|
333
|
+
const t = getComputedStyle(e);
|
|
334
|
+
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || Tt(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || It.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
335
|
+
}
|
|
336
|
+
function Ee(e) {
|
|
337
|
+
let t = e.length;
|
|
338
|
+
for (; t--; ) {
|
|
339
|
+
const n = e[t];
|
|
340
|
+
if (P(n, "Missing node"), Nt(n)) return n;
|
|
341
|
+
}
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
function Me(e) {
|
|
345
|
+
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
346
|
+
}
|
|
347
|
+
function Re(e) {
|
|
348
|
+
const t = [];
|
|
349
|
+
for (; e; ) t.push(e), e = Ke(e);
|
|
350
|
+
return t;
|
|
351
|
+
}
|
|
352
|
+
function Ke(e) {
|
|
353
|
+
const { parentNode: t } = e;
|
|
354
|
+
return Rt(t) ? t.host : t;
|
|
355
|
+
}
|
|
356
|
+
function Ot(e, t) {
|
|
357
|
+
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
358
|
+
}
|
|
359
|
+
function Ft({ groupElement: e, hitRegion: t, pointerEventTarget: n }) {
|
|
360
|
+
if (!Xe(n) || n.contains(e) || e.contains(n)) return !0;
|
|
361
|
+
if (Dt(n, e) > 0) {
|
|
362
|
+
let o = n;
|
|
363
|
+
for (; o; ) {
|
|
364
|
+
if (o.contains(e)) return !0;
|
|
365
|
+
if (Ot(o.getBoundingClientRect(), t)) return !1;
|
|
366
|
+
o = o.parentElement;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
return !0;
|
|
370
|
+
}
|
|
371
|
+
function ye(e, t) {
|
|
372
|
+
const n = [];
|
|
373
|
+
return t.forEach((o, r) => {
|
|
374
|
+
if (r.disabled) return;
|
|
375
|
+
const a = Je(r), d = Mt(r.orientation, a, {
|
|
376
|
+
x: e.clientX,
|
|
377
|
+
y: e.clientY
|
|
378
|
+
});
|
|
379
|
+
d && d.distance.x <= 0 && d.distance.y <= 0 && Ft({
|
|
380
|
+
groupElement: r.element,
|
|
381
|
+
hitRegion: d.hitRegion.rect,
|
|
382
|
+
pointerEventTarget: e.target
|
|
383
|
+
}) && n.push(d.hitRegion);
|
|
384
|
+
}), n;
|
|
385
|
+
}
|
|
386
|
+
function At(e, t) {
|
|
387
|
+
if (e.length !== t.length) return !1;
|
|
388
|
+
for (let n = 0; n < e.length; n++) if (e[n] != t[n]) return !1;
|
|
389
|
+
return !0;
|
|
390
|
+
}
|
|
391
|
+
function R(e, t, n = 0) {
|
|
392
|
+
return Math.abs(I(e) - I(t)) <= n;
|
|
393
|
+
}
|
|
394
|
+
function O(e, t) {
|
|
395
|
+
return R(e, t) ? 0 : e > t ? 1 : -1;
|
|
396
|
+
}
|
|
397
|
+
function Q({ overrideDisabledPanels: e, panelConstraints: t, prevSize: n, size: o }) {
|
|
398
|
+
const { collapsedSize: r = 0, collapsible: a, disabled: d, maxSize: s = 100, minSize: i = 0 } = t;
|
|
399
|
+
if (d && !e) return n;
|
|
400
|
+
if (O(o, i) < 0) if (a) {
|
|
401
|
+
const l = (r + i) / 2;
|
|
402
|
+
O(o, l) < 0 ? o = r : o = i;
|
|
403
|
+
} else o = i;
|
|
404
|
+
return o = Math.min(s, o), o = I(o), o;
|
|
405
|
+
}
|
|
406
|
+
function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o, prevLayout: r, trigger: a }) {
|
|
407
|
+
if (R(e, 0)) return t;
|
|
408
|
+
const d = a === "imperative-api", s = Object.values(t), i = Object.values(r), l = [...s], [u, c] = o;
|
|
409
|
+
P(u != null, "Invalid first pivot index"), P(c != null, "Invalid second pivot index");
|
|
410
|
+
let S = 0;
|
|
411
|
+
switch (a) {
|
|
412
|
+
case "keyboard":
|
|
413
|
+
{
|
|
414
|
+
const f = e < 0 ? c : u, p = n[f];
|
|
415
|
+
P(p, `Panel constraints not found for index ${f}`);
|
|
416
|
+
const { collapsedSize: m = 0, collapsible: g, minSize: v = 0 } = p;
|
|
417
|
+
if (g) {
|
|
418
|
+
const b = s[f];
|
|
419
|
+
if (P(b != null, `Previous layout not found for panel index ${f}`), R(b, m)) {
|
|
420
|
+
const z = v - b;
|
|
421
|
+
O(z, Math.abs(e)) > 0 && (e = e < 0 ? 0 - z : z);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
{
|
|
426
|
+
const f = e < 0 ? u : c, p = n[f];
|
|
427
|
+
P(p, `No panel constraints found for index ${f}`);
|
|
428
|
+
const { collapsedSize: m = 0, collapsible: g, minSize: v = 0 } = p;
|
|
429
|
+
if (g) {
|
|
430
|
+
const b = s[f];
|
|
431
|
+
if (P(b != null, `Previous layout not found for panel index ${f}`), R(b, v)) {
|
|
432
|
+
const z = b - m;
|
|
433
|
+
O(z, Math.abs(e)) > 0 && (e = e < 0 ? 0 - z : z);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
break;
|
|
438
|
+
default: {
|
|
439
|
+
const f = e < 0 ? c : u, p = n[f];
|
|
440
|
+
P(p, `Panel constraints not found for index ${f}`);
|
|
441
|
+
const m = s[f], { collapsible: g, collapsedSize: v, minSize: b } = p;
|
|
442
|
+
if (g && O(m, b) < 0) if (e > 0) {
|
|
443
|
+
const z = b - v, y = z / 2;
|
|
444
|
+
O(m + e, b) < 0 && (e = O(e, y) <= 0 ? 0 : z);
|
|
445
|
+
} else {
|
|
446
|
+
const z = b - v, y = 100 - z / 2;
|
|
447
|
+
O(m - e, b) < 0 && (e = O(100 + e, y) > 0 ? 0 : -z);
|
|
448
|
+
}
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
{
|
|
453
|
+
const f = e < 0 ? 1 : -1;
|
|
454
|
+
let p = e < 0 ? c : u, m = 0;
|
|
455
|
+
for (; ; ) {
|
|
456
|
+
const v = s[p];
|
|
457
|
+
P(v != null, `Previous layout not found for panel index ${p}`);
|
|
458
|
+
const b = Q({
|
|
459
|
+
overrideDisabledPanels: d,
|
|
460
|
+
panelConstraints: n[p],
|
|
461
|
+
prevSize: v,
|
|
462
|
+
size: 100
|
|
463
|
+
}) - v;
|
|
464
|
+
if (m += b, p += f, p < 0 || p >= n.length) break;
|
|
465
|
+
}
|
|
466
|
+
const g = Math.min(Math.abs(e), Math.abs(m));
|
|
467
|
+
e = e < 0 ? 0 - g : g;
|
|
468
|
+
}
|
|
469
|
+
{
|
|
470
|
+
let f = e < 0 ? u : c;
|
|
471
|
+
for (; f >= 0 && f < n.length; ) {
|
|
472
|
+
const p = Math.abs(e) - Math.abs(S), m = s[f];
|
|
473
|
+
P(m != null, `Previous layout not found for panel index ${f}`);
|
|
474
|
+
const g = m - p, v = Q({
|
|
475
|
+
overrideDisabledPanels: d,
|
|
476
|
+
panelConstraints: n[f],
|
|
477
|
+
prevSize: m,
|
|
478
|
+
size: g
|
|
479
|
+
});
|
|
480
|
+
if (!R(m, v) && (S += m - v, l[f] = v, S.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, { numeric: !0 }) >= 0)) break;
|
|
481
|
+
e < 0 ? f-- : f++;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (At(i, l)) return r;
|
|
485
|
+
{
|
|
486
|
+
const f = e < 0 ? c : u, p = s[f];
|
|
487
|
+
P(p != null, `Previous layout not found for panel index ${f}`);
|
|
488
|
+
const m = p + S, g = Q({
|
|
489
|
+
overrideDisabledPanels: d,
|
|
490
|
+
panelConstraints: n[f],
|
|
491
|
+
prevSize: p,
|
|
492
|
+
size: m
|
|
493
|
+
});
|
|
494
|
+
if (l[f] = g, !R(g, m)) {
|
|
495
|
+
let v = m - g, b = e < 0 ? c : u;
|
|
496
|
+
for (; b >= 0 && b < n.length; ) {
|
|
497
|
+
const z = l[b];
|
|
498
|
+
P(z != null, `Previous layout not found for panel index ${b}`);
|
|
499
|
+
const y = z + v, k = Q({
|
|
500
|
+
overrideDisabledPanels: d,
|
|
501
|
+
panelConstraints: n[b],
|
|
502
|
+
prevSize: z,
|
|
503
|
+
size: y
|
|
504
|
+
});
|
|
505
|
+
if (R(z, k) || (v -= k - z, l[b] = k), R(v, 0)) break;
|
|
506
|
+
e > 0 ? b-- : b++;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (!R(Object.values(l).reduce((f, p) => p + f, 0), 100, 0.1)) return r;
|
|
511
|
+
const h = Object.keys(r);
|
|
512
|
+
return l.reduce((f, p, m) => (f[h[m]] = p, f), {});
|
|
513
|
+
}
|
|
514
|
+
function Y(e, t) {
|
|
515
|
+
if (Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
516
|
+
for (const n in e) if (t[n] === void 0 || O(e[n], t[n]) !== 0) return !1;
|
|
517
|
+
return !0;
|
|
518
|
+
}
|
|
519
|
+
function X({ layout: e, panelConstraints: t }) {
|
|
520
|
+
const n = Object.values(e), o = [...n], r = o.reduce((s, i) => s + i, 0);
|
|
521
|
+
if (o.length !== t.length) throw Error(`Invalid ${t.length} panel layout: ${o.map((s) => `${s}%`).join(", ")}`);
|
|
522
|
+
if (!R(r, 100) && o.length > 0) for (let s = 0; s < t.length; s++) {
|
|
523
|
+
const i = o[s];
|
|
524
|
+
P(i != null, `No layout data found for index ${s}`), o[s] = 100 / r * i;
|
|
525
|
+
}
|
|
526
|
+
let a = 0;
|
|
527
|
+
for (let s = 0; s < t.length; s++) {
|
|
528
|
+
const i = n[s];
|
|
529
|
+
P(i != null, `No layout data found for index ${s}`);
|
|
530
|
+
const l = o[s];
|
|
531
|
+
P(l != null, `No layout data found for index ${s}`);
|
|
532
|
+
const u = Q({
|
|
533
|
+
overrideDisabledPanels: !0,
|
|
534
|
+
panelConstraints: t[s],
|
|
535
|
+
prevSize: i,
|
|
536
|
+
size: l
|
|
537
|
+
});
|
|
538
|
+
l != u && (a += l - u, o[s] = u);
|
|
539
|
+
}
|
|
540
|
+
if (!R(a, 0)) for (let s = 0; s < t.length; s++) {
|
|
541
|
+
const i = o[s];
|
|
542
|
+
P(i != null, `No layout data found for index ${s}`);
|
|
543
|
+
const l = i + a, u = Q({
|
|
544
|
+
overrideDisabledPanels: !0,
|
|
545
|
+
panelConstraints: t[s],
|
|
546
|
+
prevSize: i,
|
|
547
|
+
size: l
|
|
548
|
+
});
|
|
549
|
+
if (i !== u && (a -= u - i, o[s] = u, R(a, 0))) break;
|
|
550
|
+
}
|
|
551
|
+
const d = Object.keys(e);
|
|
552
|
+
return o.reduce((s, i, l) => (s[d[l]] = i, s), {});
|
|
553
|
+
}
|
|
554
|
+
function Qe({ groupId: e, panelId: t }) {
|
|
555
|
+
const n = () => {
|
|
556
|
+
const i = J();
|
|
557
|
+
for (const [l, { defaultLayoutDeferred: u, derivedPanelConstraints: c, layout: S, groupSize: h, separatorToPanels: f }] of i) if (l.id === e) return {
|
|
558
|
+
defaultLayoutDeferred: u,
|
|
559
|
+
derivedPanelConstraints: c,
|
|
560
|
+
group: l,
|
|
561
|
+
groupSize: h,
|
|
562
|
+
layout: S,
|
|
563
|
+
separatorToPanels: f
|
|
564
|
+
};
|
|
565
|
+
throw Error(`Group ${e} not found`);
|
|
566
|
+
}, o = () => {
|
|
567
|
+
const i = n().derivedPanelConstraints.find((l) => l.panelId === t);
|
|
568
|
+
if (i !== void 0) return i;
|
|
569
|
+
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
570
|
+
}, r = () => {
|
|
571
|
+
const i = n().group.panels.find((l) => l.id === t);
|
|
572
|
+
if (i !== void 0) return i;
|
|
573
|
+
throw Error(`Layout not found for Panel ${t}`);
|
|
574
|
+
}, a = () => {
|
|
575
|
+
const i = n().layout[t];
|
|
576
|
+
if (i !== void 0) return i;
|
|
577
|
+
throw Error(`Layout not found for Panel ${t}`);
|
|
578
|
+
}, d = ({ nextSize: i, panels: l, prevLayout: u, derivedPanelConstraints: c }) => {
|
|
579
|
+
const S = a(), h = l.findIndex((m) => m.id === t), f = h === 0, p = h === l.length - 1;
|
|
580
|
+
if (p && i < S && (f || l.slice(0, h).every((m, g) => {
|
|
581
|
+
const v = c[g];
|
|
582
|
+
return v?.collapsible && R(v.collapsedSize, u[v.panelId]);
|
|
583
|
+
}))) {
|
|
584
|
+
const m = l.slice(0, h).reduce((g, v) => g + u[v.id], 0);
|
|
585
|
+
return {
|
|
586
|
+
...u,
|
|
587
|
+
[t]: I(100 - m)
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
return ie({
|
|
591
|
+
delta: p ? S - i : i - S,
|
|
592
|
+
initialLayout: u,
|
|
593
|
+
panelConstraints: c,
|
|
594
|
+
pivotIndices: p ? [h - 1, h] : [h, h + 1],
|
|
595
|
+
prevLayout: u,
|
|
596
|
+
trigger: "imperative-api"
|
|
597
|
+
});
|
|
598
|
+
}, s = (i) => {
|
|
599
|
+
if (i === a()) return;
|
|
600
|
+
const { defaultLayoutDeferred: l, derivedPanelConstraints: u, group: c, groupSize: S, layout: h, separatorToPanels: f } = n(), p = X({
|
|
601
|
+
layout: d({
|
|
602
|
+
nextSize: i,
|
|
603
|
+
panels: c.panels,
|
|
604
|
+
prevLayout: h,
|
|
605
|
+
derivedPanelConstraints: u
|
|
606
|
+
}),
|
|
607
|
+
panelConstraints: u
|
|
608
|
+
});
|
|
609
|
+
Y(h, p) || B(c, {
|
|
610
|
+
defaultLayoutDeferred: l,
|
|
611
|
+
derivedPanelConstraints: u,
|
|
612
|
+
groupSize: S,
|
|
613
|
+
layout: p,
|
|
614
|
+
separatorToPanels: f
|
|
615
|
+
});
|
|
616
|
+
};
|
|
617
|
+
return {
|
|
618
|
+
collapse: () => {
|
|
619
|
+
const { collapsible: i, collapsedSize: l } = o(), { mutableValues: u } = r(), c = a();
|
|
620
|
+
i && c !== l && (u.expandToSize = c, s(l));
|
|
621
|
+
},
|
|
622
|
+
expand: () => {
|
|
623
|
+
const { collapsible: i, collapsedSize: l, minSize: u } = o(), { mutableValues: c } = r(), S = a();
|
|
624
|
+
if (i && S === l) {
|
|
625
|
+
let h = c.expandToSize ?? u;
|
|
626
|
+
h === 0 && (h = 1), s(h);
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
getSize: () => {
|
|
630
|
+
const { group: i } = n(), l = a(), { element: u } = r();
|
|
631
|
+
return {
|
|
632
|
+
asPercentage: l,
|
|
633
|
+
inPixels: i.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight
|
|
634
|
+
};
|
|
635
|
+
},
|
|
636
|
+
isCollapsed: () => {
|
|
637
|
+
const { collapsible: i, collapsedSize: l } = o(), u = a();
|
|
638
|
+
return i && R(l, u);
|
|
639
|
+
},
|
|
640
|
+
resize: (i) => {
|
|
641
|
+
const { group: l } = n(), { element: u } = r(), c = te({ group: l });
|
|
642
|
+
s(I(re({
|
|
643
|
+
groupSize: c,
|
|
644
|
+
panelElement: u,
|
|
645
|
+
styleProp: i
|
|
646
|
+
}) / c * 100));
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function De(e) {
|
|
651
|
+
e.defaultPrevented || ye(e, J()).forEach((t) => {
|
|
652
|
+
if (t.separator && !t.separator.disableDoubleClick) {
|
|
653
|
+
const n = t.panels.find((o) => o.panelConstraints.defaultSize !== void 0);
|
|
654
|
+
if (n) {
|
|
655
|
+
const o = n.panelConstraints.defaultSize, r = Qe({
|
|
656
|
+
groupId: t.group.id,
|
|
657
|
+
panelId: n.id
|
|
658
|
+
});
|
|
659
|
+
r && o !== void 0 && (r.resize(o), e.preventDefault());
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
function fe(e) {
|
|
665
|
+
const t = J();
|
|
666
|
+
for (const [n] of t) if (n.separators.some((o) => o.element === e)) return n;
|
|
667
|
+
throw Error("Could not find parent Group for separator element");
|
|
668
|
+
}
|
|
669
|
+
function _e({ groupId: e }) {
|
|
670
|
+
const t = () => {
|
|
671
|
+
const n = J();
|
|
672
|
+
for (const [o, r] of n) if (o.id === e) return {
|
|
673
|
+
group: o,
|
|
674
|
+
...r
|
|
675
|
+
};
|
|
676
|
+
throw Error(`Could not find Group with id "${e}"`);
|
|
677
|
+
};
|
|
678
|
+
return {
|
|
679
|
+
getLayout() {
|
|
680
|
+
const { defaultLayoutDeferred: n, layout: o } = t();
|
|
681
|
+
return n ? {} : o;
|
|
682
|
+
},
|
|
683
|
+
setLayout(n) {
|
|
684
|
+
const { defaultLayoutDeferred: o, derivedPanelConstraints: r, group: a, groupSize: d, layout: s, separatorToPanels: i } = t(), l = X({
|
|
685
|
+
layout: n,
|
|
686
|
+
panelConstraints: r
|
|
687
|
+
});
|
|
688
|
+
return o ? s : (Y(s, l) || B(a, {
|
|
689
|
+
defaultLayoutDeferred: o,
|
|
690
|
+
derivedPanelConstraints: r,
|
|
691
|
+
groupSize: d,
|
|
692
|
+
layout: l,
|
|
693
|
+
separatorToPanels: i
|
|
694
|
+
}), l);
|
|
695
|
+
}
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
function V(e, t) {
|
|
699
|
+
const n = fe(e), o = H(n.id, !0), r = n.separators.find((l) => l.element === e);
|
|
700
|
+
P(r, "Matching separator not found");
|
|
701
|
+
const a = o.separatorToPanels.get(r);
|
|
702
|
+
P(a, "Matching panels not found");
|
|
703
|
+
const d = a.map((l) => n.panels.indexOf(l)), s = _e({ groupId: n.id }).getLayout(), i = X({
|
|
704
|
+
layout: ie({
|
|
705
|
+
delta: t,
|
|
706
|
+
initialLayout: s,
|
|
707
|
+
panelConstraints: o.derivedPanelConstraints,
|
|
708
|
+
pivotIndices: d,
|
|
709
|
+
prevLayout: s,
|
|
710
|
+
trigger: "keyboard"
|
|
711
|
+
}),
|
|
712
|
+
panelConstraints: o.derivedPanelConstraints
|
|
713
|
+
});
|
|
714
|
+
Y(s, i) || B(n, {
|
|
715
|
+
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
716
|
+
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
717
|
+
groupSize: o.groupSize,
|
|
718
|
+
layout: i,
|
|
719
|
+
separatorToPanels: o.separatorToPanels
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
function Ie(e) {
|
|
723
|
+
if (e.defaultPrevented) return;
|
|
724
|
+
const t = e.currentTarget, n = fe(t);
|
|
725
|
+
if (!n.disabled) switch (e.key) {
|
|
726
|
+
case "ArrowDown":
|
|
727
|
+
e.preventDefault(), n.orientation === "vertical" && V(t, 5);
|
|
728
|
+
break;
|
|
729
|
+
case "ArrowLeft":
|
|
730
|
+
e.preventDefault(), n.orientation === "horizontal" && V(t, -5);
|
|
731
|
+
break;
|
|
732
|
+
case "ArrowRight":
|
|
733
|
+
e.preventDefault(), n.orientation === "horizontal" && V(t, 5);
|
|
734
|
+
break;
|
|
735
|
+
case "ArrowUp":
|
|
736
|
+
e.preventDefault(), n.orientation === "vertical" && V(t, -5);
|
|
737
|
+
break;
|
|
738
|
+
case "End":
|
|
739
|
+
e.preventDefault(), V(t, 100);
|
|
740
|
+
break;
|
|
741
|
+
case "Enter": {
|
|
742
|
+
e.preventDefault();
|
|
743
|
+
const o = fe(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: d } = H(o.id, !0), s = o.separators.find((c) => c.element === t);
|
|
744
|
+
P(s, "Matching separator not found");
|
|
745
|
+
const i = d.get(s);
|
|
746
|
+
P(i, "Matching panels not found");
|
|
747
|
+
const l = i[0], u = r.find((c) => c.panelId === l.id);
|
|
748
|
+
if (P(u, "Panel metadata not found"), u.collapsible) {
|
|
749
|
+
const c = a[l.id];
|
|
750
|
+
V(t, (u.collapsedSize === c ? o.mutableState.expandedPanelSizes[l.id] ?? u.minSize : u.collapsedSize) - c);
|
|
751
|
+
}
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
case "F6": {
|
|
755
|
+
e.preventDefault();
|
|
756
|
+
const o = fe(t).separators.map((a) => a.element), r = Array.from(o).findIndex((a) => a === e.currentTarget);
|
|
757
|
+
P(r !== null, "Index not found"), o[e.shiftKey ? r > 0 ? r - 1 : o.length - 1 : r + 1 < o.length ? r + 1 : 0].focus({ preventScroll: !0 });
|
|
758
|
+
break;
|
|
759
|
+
}
|
|
760
|
+
case "Home":
|
|
761
|
+
e.preventDefault(), V(t, -100);
|
|
762
|
+
break;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
var _ = {
|
|
766
|
+
cursorFlags: 0,
|
|
767
|
+
state: "inactive"
|
|
768
|
+
}, ze = new Ue();
|
|
769
|
+
function q() {
|
|
770
|
+
return _;
|
|
771
|
+
}
|
|
772
|
+
function $t(e) {
|
|
773
|
+
return ze.addListener("change", e);
|
|
774
|
+
}
|
|
775
|
+
function Gt(e) {
|
|
776
|
+
const t = _, n = { ..._ };
|
|
777
|
+
n.cursorFlags = e, _ = n, ze.emit("change", {
|
|
778
|
+
prev: t,
|
|
779
|
+
next: n
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
function ee(e) {
|
|
783
|
+
const t = _;
|
|
784
|
+
_ = e, ze.emit("change", {
|
|
785
|
+
prev: t,
|
|
786
|
+
next: e
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
function Te(e) {
|
|
790
|
+
if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0) return;
|
|
791
|
+
const t = J(), n = ye(e, t), o = /* @__PURE__ */ new Map();
|
|
792
|
+
let r = !1;
|
|
793
|
+
n.forEach((a) => {
|
|
794
|
+
a.separator && (r || (r = !0, a.separator.element.focus({
|
|
795
|
+
focusVisible: !1,
|
|
796
|
+
preventScroll: !0
|
|
797
|
+
})));
|
|
798
|
+
const d = t.get(a.group);
|
|
799
|
+
d && o.set(a.group, d.layout);
|
|
800
|
+
}), ee({
|
|
801
|
+
cursorFlags: 0,
|
|
802
|
+
hitRegions: n,
|
|
803
|
+
initialLayoutMap: o,
|
|
804
|
+
pointerDownAtPoint: {
|
|
805
|
+
x: e.clientX,
|
|
806
|
+
y: e.clientY
|
|
807
|
+
},
|
|
808
|
+
state: "active"
|
|
809
|
+
}), n.length && e.preventDefault();
|
|
810
|
+
}
|
|
811
|
+
var jt = (e) => e, ge = () => {
|
|
812
|
+
}, et = 1, tt = 2, nt = 4, ot = 8, Ne = 3, Oe = 12, de;
|
|
813
|
+
function Fe() {
|
|
814
|
+
return de === void 0 && (de = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (de = !0)), de;
|
|
815
|
+
}
|
|
816
|
+
function Bt({ cursorFlags: e, groups: t, state: n }) {
|
|
817
|
+
let o = 0, r = 0;
|
|
818
|
+
switch (n) {
|
|
819
|
+
case "active":
|
|
820
|
+
case "hover":
|
|
821
|
+
t.forEach((a) => {
|
|
822
|
+
if (!a.mutableState.disableCursor) switch (a.orientation) {
|
|
823
|
+
case "horizontal":
|
|
824
|
+
o++;
|
|
825
|
+
break;
|
|
826
|
+
case "vertical":
|
|
827
|
+
r++;
|
|
828
|
+
break;
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
if (!(o === 0 && r === 0)) {
|
|
833
|
+
switch (n) {
|
|
834
|
+
case "active":
|
|
835
|
+
if (e && Fe()) {
|
|
836
|
+
const a = (e & et) !== 0, d = (e & tt) !== 0, s = (e & nt) !== 0, i = (e & ot) !== 0;
|
|
837
|
+
if (a) return s ? "se-resize" : i ? "ne-resize" : "e-resize";
|
|
838
|
+
if (d) return s ? "sw-resize" : i ? "nw-resize" : "w-resize";
|
|
839
|
+
if (s) return "s-resize";
|
|
840
|
+
if (i) return "n-resize";
|
|
841
|
+
}
|
|
842
|
+
break;
|
|
843
|
+
}
|
|
844
|
+
return Fe() ? o > 0 && r > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && r > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
var Ae = /* @__PURE__ */ new WeakMap();
|
|
848
|
+
function Se(e) {
|
|
849
|
+
if (e.defaultView === null || e.defaultView === void 0) return;
|
|
850
|
+
let { prevStyle: t, styleSheet: n } = Ae.get(e) ?? {};
|
|
851
|
+
n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [...e.adoptedStyleSheets, n]));
|
|
852
|
+
const o = q();
|
|
853
|
+
switch (o.state) {
|
|
854
|
+
case "active":
|
|
855
|
+
case "hover": {
|
|
856
|
+
const r = Bt({
|
|
857
|
+
cursorFlags: o.cursorFlags,
|
|
858
|
+
groups: o.hitRegions.map((d) => d.group),
|
|
859
|
+
state: o.state
|
|
860
|
+
}), a = `*, *:hover {cursor: ${r} !important; }`;
|
|
861
|
+
if (t === a) return;
|
|
862
|
+
t = a, r ? n.cssRules.length === 0 ? n.insertRule(a) : n.replaceSync(a) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
case "inactive":
|
|
866
|
+
t = void 0, n.cssRules.length === 1 && n.deleteRule(0);
|
|
867
|
+
break;
|
|
868
|
+
}
|
|
869
|
+
Ae.set(e, {
|
|
870
|
+
prevStyle: t,
|
|
871
|
+
styleSheet: n
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
function rt({ document: e, event: t, hitRegions: n, initialLayoutMap: o, mountedGroups: r, pointerDownAtPoint: a, prevCursorFlags: d }) {
|
|
875
|
+
let s = 0;
|
|
876
|
+
n.forEach((l) => {
|
|
877
|
+
const { group: u, groupSize: c } = l, { orientation: S, panels: h } = u, { disableCursor: f } = u.mutableState;
|
|
878
|
+
let p = 0;
|
|
879
|
+
a ? S === "horizontal" ? p = (t.clientX - a.x) / c * 100 : p = (t.clientY - a.y) / c * 100 : S === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
880
|
+
const m = o.get(u), g = r.get(u);
|
|
881
|
+
if (!m || !g) return;
|
|
882
|
+
const { defaultLayoutDeferred: v, derivedPanelConstraints: b, groupSize: z, layout: y, separatorToPanels: k } = g;
|
|
883
|
+
if (b && y && k) {
|
|
884
|
+
const E = ie({
|
|
885
|
+
delta: p,
|
|
886
|
+
initialLayout: m,
|
|
887
|
+
panelConstraints: b,
|
|
888
|
+
pivotIndices: l.panels.map((D) => h.indexOf(D)),
|
|
889
|
+
prevLayout: y,
|
|
890
|
+
trigger: "mouse-or-touch"
|
|
891
|
+
});
|
|
892
|
+
if (Y(E, y)) {
|
|
893
|
+
if (p !== 0 && !f) switch (S) {
|
|
894
|
+
case "horizontal":
|
|
895
|
+
s |= p < 0 ? et : tt;
|
|
896
|
+
break;
|
|
897
|
+
case "vertical":
|
|
898
|
+
s |= p < 0 ? nt : ot;
|
|
899
|
+
break;
|
|
900
|
+
}
|
|
901
|
+
} else B(l.group, {
|
|
902
|
+
defaultLayoutDeferred: v,
|
|
903
|
+
derivedPanelConstraints: b,
|
|
904
|
+
groupSize: z,
|
|
905
|
+
layout: E,
|
|
906
|
+
separatorToPanels: k
|
|
907
|
+
});
|
|
908
|
+
}
|
|
909
|
+
});
|
|
910
|
+
let i = 0;
|
|
911
|
+
t.movementX === 0 ? i |= d & Ne : i |= s & Ne, t.movementY === 0 ? i |= d & Oe : i |= s & Oe, Gt(i), Se(e);
|
|
912
|
+
}
|
|
913
|
+
function $e(e) {
|
|
914
|
+
const t = J(), n = q();
|
|
915
|
+
n.state === "active" && rt({
|
|
916
|
+
document: e.currentTarget,
|
|
917
|
+
event: e,
|
|
918
|
+
hitRegions: n.hitRegions,
|
|
919
|
+
initialLayoutMap: n.initialLayoutMap,
|
|
920
|
+
mountedGroups: t,
|
|
921
|
+
prevCursorFlags: n.cursorFlags
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
function Ge(e) {
|
|
925
|
+
if (e.defaultPrevented) return;
|
|
926
|
+
const t = q(), n = J();
|
|
927
|
+
switch (t.state) {
|
|
928
|
+
case "active":
|
|
929
|
+
if (e.buttons === 0) {
|
|
930
|
+
ee({
|
|
931
|
+
cursorFlags: 0,
|
|
932
|
+
state: "inactive"
|
|
933
|
+
}), t.hitRegions.forEach((o) => {
|
|
934
|
+
const r = H(o.group.id, !0);
|
|
935
|
+
B(o.group, r);
|
|
936
|
+
});
|
|
937
|
+
return;
|
|
938
|
+
}
|
|
939
|
+
for (const o of t.hitRegions) if (o.separator) {
|
|
940
|
+
const { element: r } = o.separator;
|
|
941
|
+
r.hasPointerCapture?.(e.pointerId) || r.setPointerCapture?.(e.pointerId);
|
|
942
|
+
}
|
|
943
|
+
rt({
|
|
944
|
+
document: e.currentTarget,
|
|
945
|
+
event: e,
|
|
946
|
+
hitRegions: t.hitRegions,
|
|
947
|
+
initialLayoutMap: t.initialLayoutMap,
|
|
948
|
+
mountedGroups: n,
|
|
949
|
+
pointerDownAtPoint: t.pointerDownAtPoint,
|
|
950
|
+
prevCursorFlags: t.cursorFlags
|
|
951
|
+
});
|
|
952
|
+
break;
|
|
953
|
+
default: {
|
|
954
|
+
const o = ye(e, n);
|
|
955
|
+
o.length === 0 ? t.state !== "inactive" && ee({
|
|
956
|
+
cursorFlags: 0,
|
|
957
|
+
state: "inactive"
|
|
958
|
+
}) : ee({
|
|
959
|
+
cursorFlags: 0,
|
|
960
|
+
hitRegions: o,
|
|
961
|
+
state: "hover"
|
|
962
|
+
}), Se(e.currentTarget);
|
|
963
|
+
break;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
function je(e) {
|
|
968
|
+
e.relatedTarget instanceof HTMLIFrameElement && q().state === "hover" && ee({
|
|
969
|
+
cursorFlags: 0,
|
|
970
|
+
state: "inactive"
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
function Be(e) {
|
|
974
|
+
if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0) return;
|
|
975
|
+
const t = q();
|
|
976
|
+
t.state === "active" && (ee({
|
|
977
|
+
cursorFlags: 0,
|
|
978
|
+
state: "inactive"
|
|
979
|
+
}), t.hitRegions.length > 0 && (Se(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
980
|
+
const o = H(n.group.id, !0);
|
|
981
|
+
B(n.group, o);
|
|
982
|
+
}), e.preventDefault()));
|
|
983
|
+
}
|
|
984
|
+
function We(e) {
|
|
985
|
+
let t = 0, n = 0;
|
|
986
|
+
const o = {};
|
|
987
|
+
for (const a of e) if (a.defaultSize !== void 0) {
|
|
988
|
+
t++;
|
|
989
|
+
const d = I(a.defaultSize);
|
|
990
|
+
n += d, o[a.panelId] = d;
|
|
991
|
+
} else o[a.panelId] = void 0;
|
|
992
|
+
const r = e.length - t;
|
|
993
|
+
if (r !== 0) {
|
|
994
|
+
const a = I((100 - n) / r);
|
|
995
|
+
for (const d of e) d.defaultSize === void 0 && (o[d.panelId] = a);
|
|
996
|
+
}
|
|
997
|
+
return o;
|
|
998
|
+
}
|
|
999
|
+
function Wt(e, t, n) {
|
|
1000
|
+
if (!n[0]) return;
|
|
1001
|
+
const o = e.panels.find((i) => i.element === t);
|
|
1002
|
+
if (!o || !o.onResize) return;
|
|
1003
|
+
const r = te({ group: e }), a = e.orientation === "horizontal" ? o.element.offsetWidth : o.element.offsetHeight, d = o.mutableValues.prevSize, s = {
|
|
1004
|
+
asPercentage: I(a / r * 100),
|
|
1005
|
+
inPixels: a
|
|
1006
|
+
};
|
|
1007
|
+
o.mutableValues.prevSize = s, o.onResize(s, o.id, d);
|
|
1008
|
+
}
|
|
1009
|
+
function Ht(e, t) {
|
|
1010
|
+
if (Object.keys(e).length !== Object.keys(t).length) return !1;
|
|
1011
|
+
for (const n in e) if (e[n] !== t[n]) return !1;
|
|
1012
|
+
return !0;
|
|
1013
|
+
}
|
|
1014
|
+
function Vt({ group: e, nextGroupSize: t, prevGroupSize: n, prevLayout: o }) {
|
|
1015
|
+
if (n <= 0 || t <= 0 || n === t) return o;
|
|
1016
|
+
let r = 0, a = 0, d = !1;
|
|
1017
|
+
const s = /* @__PURE__ */ new Map(), i = [];
|
|
1018
|
+
for (const c of e.panels) {
|
|
1019
|
+
const S = o[c.id] ?? 0;
|
|
1020
|
+
if (c.panelConstraints.groupResizeBehavior === "preserve-pixel-size") {
|
|
1021
|
+
d = !0;
|
|
1022
|
+
const h = I(S / 100 * n / t * 100);
|
|
1023
|
+
s.set(c.id, h), r += h;
|
|
1024
|
+
} else
|
|
1025
|
+
i.push(c.id), a += S;
|
|
1026
|
+
}
|
|
1027
|
+
if (!d || i.length === 0) return o;
|
|
1028
|
+
const l = 100 - r, u = { ...o };
|
|
1029
|
+
if (s.forEach((c, S) => {
|
|
1030
|
+
u[S] = c;
|
|
1031
|
+
}), a > 0) for (const c of i) u[c] = I((o[c] ?? 0) / a * l);
|
|
1032
|
+
else {
|
|
1033
|
+
const c = I(l / i.length);
|
|
1034
|
+
for (const S of i) u[S] = c;
|
|
1035
|
+
}
|
|
1036
|
+
return u;
|
|
1037
|
+
}
|
|
1038
|
+
function Yt(e, t) {
|
|
1039
|
+
const n = e.map((r) => r.id), o = Object.keys(t);
|
|
1040
|
+
if (n.length !== o.length) return !1;
|
|
1041
|
+
for (const r of n) if (!o.includes(r)) return !1;
|
|
1042
|
+
return !0;
|
|
1043
|
+
}
|
|
1044
|
+
var K = /* @__PURE__ */ new Map();
|
|
1045
|
+
function Xt(e) {
|
|
1046
|
+
let t = !0;
|
|
1047
|
+
P(e.element.ownerDocument.defaultView, "Cannot register an unmounted Group");
|
|
1048
|
+
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = new n((h) => {
|
|
1049
|
+
for (const f of h) {
|
|
1050
|
+
const { borderBoxSize: p, target: m } = f;
|
|
1051
|
+
if (m === e.element) {
|
|
1052
|
+
if (t) {
|
|
1053
|
+
const g = te({ group: e });
|
|
1054
|
+
if (g === 0) return;
|
|
1055
|
+
const v = H(e.id);
|
|
1056
|
+
if (!v) return;
|
|
1057
|
+
const b = ve(e), z = v.defaultLayoutDeferred ? We(b) : v.layout, y = X({
|
|
1058
|
+
layout: Vt({
|
|
1059
|
+
group: e,
|
|
1060
|
+
nextGroupSize: g,
|
|
1061
|
+
prevGroupSize: v.groupSize,
|
|
1062
|
+
prevLayout: z
|
|
1063
|
+
}),
|
|
1064
|
+
panelConstraints: b
|
|
1065
|
+
});
|
|
1066
|
+
if (!v.defaultLayoutDeferred && Y(v.layout, y) && Ht(v.derivedPanelConstraints, b) && v.groupSize === g) return;
|
|
1067
|
+
B(e, {
|
|
1068
|
+
defaultLayoutDeferred: !1,
|
|
1069
|
+
derivedPanelConstraints: b,
|
|
1070
|
+
groupSize: g,
|
|
1071
|
+
layout: y,
|
|
1072
|
+
separatorToPanels: v.separatorToPanels
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
} else Wt(e, m, p);
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
a.observe(e.element), e.panels.forEach((h) => {
|
|
1079
|
+
P(!o.has(h.id), `Panel ids must be unique; id "${h.id}" was used more than once`), o.add(h.id), h.onResize && a.observe(h.element);
|
|
1080
|
+
});
|
|
1081
|
+
const d = te({ group: e }), s = ve(e), i = e.panels.map(({ id: h }) => h).join(",");
|
|
1082
|
+
let l = e.mutableState.defaultLayout;
|
|
1083
|
+
l && (Yt(e.panels, l) || (l = void 0));
|
|
1084
|
+
const u = X({
|
|
1085
|
+
layout: e.mutableState.layouts[i] ?? l ?? We(s),
|
|
1086
|
+
panelConstraints: s
|
|
1087
|
+
}), c = e.element.ownerDocument;
|
|
1088
|
+
K.set(c, (K.get(c) ?? 0) + 1);
|
|
1089
|
+
const S = /* @__PURE__ */ new Map();
|
|
1090
|
+
return Je(e).forEach((h) => {
|
|
1091
|
+
h.separator && S.set(h.separator, h.panels);
|
|
1092
|
+
}), B(e, {
|
|
1093
|
+
defaultLayoutDeferred: d === 0,
|
|
1094
|
+
derivedPanelConstraints: s,
|
|
1095
|
+
groupSize: d,
|
|
1096
|
+
layout: u,
|
|
1097
|
+
separatorToPanels: S
|
|
1098
|
+
}), e.separators.forEach((h) => {
|
|
1099
|
+
P(!r.has(h.id), `Separator ids must be unique; id "${h.id}" was used more than once`), r.add(h.id), h.element.addEventListener("keydown", Ie);
|
|
1100
|
+
}), K.get(c) === 1 && (c.addEventListener("dblclick", De, !0), c.addEventListener("pointerdown", Te, !0), c.addEventListener("pointerleave", $e), c.addEventListener("pointermove", Ge), c.addEventListener("pointerout", je), c.addEventListener("pointerup", Be, !0)), function() {
|
|
1101
|
+
t = !1, K.set(c, Math.max(0, (K.get(c) ?? 0) - 1)), Et(e), e.separators.forEach((h) => {
|
|
1102
|
+
h.element.removeEventListener("keydown", Ie);
|
|
1103
|
+
}), K.get(c) || (c.removeEventListener("dblclick", De, !0), c.removeEventListener("pointerdown", Te, !0), c.removeEventListener("pointerleave", $e), c.removeEventListener("pointermove", Ge), c.removeEventListener("pointerout", je), c.removeEventListener("pointerup", Be, !0)), a.disconnect();
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
function qt() {
|
|
1107
|
+
const [e, t] = ce({});
|
|
1108
|
+
return [e, Ve(() => t({}), [])];
|
|
1109
|
+
}
|
|
1110
|
+
function we(e) {
|
|
1111
|
+
const t = gt();
|
|
1112
|
+
return `${e ?? t}`;
|
|
1113
|
+
}
|
|
1114
|
+
var U = typeof window < "u" ? vt : pe;
|
|
1115
|
+
function ae(e) {
|
|
1116
|
+
const t = F(e);
|
|
1117
|
+
return U(() => {
|
|
1118
|
+
t.current = e;
|
|
1119
|
+
}, [e]), Ve((...n) => t.current?.(...n), [t]);
|
|
1120
|
+
}
|
|
1121
|
+
function xe(...e) {
|
|
1122
|
+
return ae((t) => {
|
|
1123
|
+
e.forEach((n) => {
|
|
1124
|
+
if (n) switch (typeof n) {
|
|
1125
|
+
case "function":
|
|
1126
|
+
n(t);
|
|
1127
|
+
break;
|
|
1128
|
+
case "object":
|
|
1129
|
+
n.current = t;
|
|
1130
|
+
break;
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
function Ce(e) {
|
|
1136
|
+
const t = F({ ...e });
|
|
1137
|
+
return U(() => {
|
|
1138
|
+
for (const n in e) t.current[n] = e[n];
|
|
1139
|
+
}, [e]), t.current;
|
|
1140
|
+
}
|
|
1141
|
+
var at = pt(null);
|
|
1142
|
+
function Jt(e, t) {
|
|
1143
|
+
const n = F({
|
|
1144
|
+
getLayout: () => ({}),
|
|
1145
|
+
setLayout: jt
|
|
1146
|
+
});
|
|
1147
|
+
Ye(t, () => n.current, []), U(() => {
|
|
1148
|
+
Object.assign(n.current, _e({ groupId: e }));
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1151
|
+
function it({ children: e, className: t, defaultLayout: n, disableCursor: o, disabled: r, elementRef: a, groupRef: d, id: s, onLayoutChange: i, onLayoutChanged: l, orientation: u = "horizontal", resizeTargetMinimumSize: c = {
|
|
1152
|
+
coarse: 20,
|
|
1153
|
+
fine: 10
|
|
1154
|
+
}, style: S, ...h }) {
|
|
1155
|
+
const f = F({
|
|
1156
|
+
onLayoutChange: {},
|
|
1157
|
+
onLayoutChanged: {}
|
|
1158
|
+
}), p = ae((w) => {
|
|
1159
|
+
Y(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, i?.(w));
|
|
1160
|
+
}), m = ae((w) => {
|
|
1161
|
+
Y(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, l?.(w));
|
|
1162
|
+
}), g = we(s), v = F(null), [b, z] = qt(), y = F({
|
|
1163
|
+
lastExpandedPanelSizes: {},
|
|
1164
|
+
layouts: {},
|
|
1165
|
+
panels: [],
|
|
1166
|
+
resizeTargetMinimumSize: c,
|
|
1167
|
+
separators: []
|
|
1168
|
+
}), k = xe(v, a);
|
|
1169
|
+
Jt(g, d);
|
|
1170
|
+
const E = ae((w, x) => {
|
|
1171
|
+
const L = q(), C = ke(w), M = H(w);
|
|
1172
|
+
if (M) {
|
|
1173
|
+
let T = !1;
|
|
1174
|
+
return L.state === "active" && (T = L.hitRegions.some((ne) => ne.group === C)), {
|
|
1175
|
+
flexGrow: M.layout[x] ?? 1,
|
|
1176
|
+
pointerEvents: T ? "none" : void 0
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
if (n?.[x]) return { flexGrow: n?.[x] };
|
|
1180
|
+
}), D = Ce({
|
|
1181
|
+
defaultLayout: n,
|
|
1182
|
+
disableCursor: o
|
|
1183
|
+
}), N = mt(() => ({
|
|
1184
|
+
get disableCursor() {
|
|
1185
|
+
return !!D.disableCursor;
|
|
1186
|
+
},
|
|
1187
|
+
getPanelStyles: E,
|
|
1188
|
+
id: g,
|
|
1189
|
+
orientation: u,
|
|
1190
|
+
registerPanel: (w) => {
|
|
1191
|
+
const x = y.current;
|
|
1192
|
+
return x.panels = me(u, [...x.panels, w]), z(), () => {
|
|
1193
|
+
x.panels = x.panels.filter((L) => L !== w), z();
|
|
1194
|
+
};
|
|
1195
|
+
},
|
|
1196
|
+
registerSeparator: (w) => {
|
|
1197
|
+
const x = y.current;
|
|
1198
|
+
return x.separators = me(u, [...x.separators, w]), z(), () => {
|
|
1199
|
+
x.separators = x.separators.filter((L) => L !== w), z();
|
|
1200
|
+
};
|
|
1201
|
+
},
|
|
1202
|
+
updatePanelProps: (w, { disabled: x }) => {
|
|
1203
|
+
const L = y.current.panels.find((T) => T.id === w);
|
|
1204
|
+
L && (L.panelConstraints.disabled = x);
|
|
1205
|
+
const C = ke(g), M = H(g);
|
|
1206
|
+
C && M && B(C, {
|
|
1207
|
+
...M,
|
|
1208
|
+
derivedPanelConstraints: ve(C)
|
|
1209
|
+
});
|
|
1210
|
+
},
|
|
1211
|
+
updateSeparatorProps: (w, { disabled: x, disableDoubleClick: L }) => {
|
|
1212
|
+
const C = y.current.separators.find((M) => M.id === w);
|
|
1213
|
+
C && (C.disabled = x, C.disableDoubleClick = L);
|
|
1214
|
+
}
|
|
1215
|
+
}), [
|
|
1216
|
+
E,
|
|
1217
|
+
g,
|
|
1218
|
+
z,
|
|
1219
|
+
u,
|
|
1220
|
+
D
|
|
1221
|
+
]), $ = F(null);
|
|
1222
|
+
return U(() => {
|
|
1223
|
+
const w = v.current;
|
|
1224
|
+
if (w === null) return;
|
|
1225
|
+
const x = y.current;
|
|
1226
|
+
let L;
|
|
1227
|
+
if (D.defaultLayout !== void 0 && Object.keys(D.defaultLayout).length === x.panels.length) {
|
|
1228
|
+
L = {};
|
|
1229
|
+
for (const W of x.panels) {
|
|
1230
|
+
const Z = D.defaultLayout[W.id];
|
|
1231
|
+
Z !== void 0 && (L[W.id] = Z);
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
const C = {
|
|
1235
|
+
disabled: !!r,
|
|
1236
|
+
element: w,
|
|
1237
|
+
id: g,
|
|
1238
|
+
mutableState: {
|
|
1239
|
+
defaultLayout: L,
|
|
1240
|
+
disableCursor: !!D.disableCursor,
|
|
1241
|
+
expandedPanelSizes: y.current.lastExpandedPanelSizes,
|
|
1242
|
+
layouts: y.current.layouts
|
|
1243
|
+
},
|
|
1244
|
+
orientation: u,
|
|
1245
|
+
panels: x.panels,
|
|
1246
|
+
resizeTargetMinimumSize: x.resizeTargetMinimumSize,
|
|
1247
|
+
separators: x.separators
|
|
1248
|
+
};
|
|
1249
|
+
$.current = C;
|
|
1250
|
+
const M = Xt(C), { defaultLayoutDeferred: T, derivedPanelConstraints: ne, layout: se } = H(C.id, !0);
|
|
1251
|
+
!T && ne.length > 0 && (p(se), m(se));
|
|
1252
|
+
const oe = be(g, (W) => {
|
|
1253
|
+
const { defaultLayoutDeferred: Z, derivedPanelConstraints: Le, layout: le } = W.next;
|
|
1254
|
+
if (Z || Le.length === 0) return;
|
|
1255
|
+
const ut = C.panels.map(({ id: G }) => G).join(",");
|
|
1256
|
+
C.mutableState.layouts[ut] = le, Le.forEach((G) => {
|
|
1257
|
+
if (G.collapsible) {
|
|
1258
|
+
const { layout: he } = W.prev ?? {};
|
|
1259
|
+
if (he) {
|
|
1260
|
+
const ct = R(G.collapsedSize, le[G.panelId]), ft = R(G.collapsedSize, he[G.panelId]);
|
|
1261
|
+
ct && !ft && (C.mutableState.expandedPanelSizes[G.panelId] = he[G.panelId]);
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
const dt = q().state !== "active";
|
|
1266
|
+
p(le), dt && m(le);
|
|
1267
|
+
});
|
|
1268
|
+
return () => {
|
|
1269
|
+
$.current = null, M(), oe();
|
|
1270
|
+
};
|
|
1271
|
+
}, [
|
|
1272
|
+
r,
|
|
1273
|
+
g,
|
|
1274
|
+
m,
|
|
1275
|
+
p,
|
|
1276
|
+
u,
|
|
1277
|
+
b,
|
|
1278
|
+
D
|
|
1279
|
+
]), pe(() => {
|
|
1280
|
+
const w = $.current;
|
|
1281
|
+
w && (w.mutableState.defaultLayout = n, w.mutableState.disableCursor = !!o);
|
|
1282
|
+
}), /* @__PURE__ */ j(at.Provider, {
|
|
1283
|
+
value: N,
|
|
1284
|
+
children: /* @__PURE__ */ j("div", {
|
|
1285
|
+
...h,
|
|
1286
|
+
className: t,
|
|
1287
|
+
"data-group": !0,
|
|
1288
|
+
"data-testid": g,
|
|
1289
|
+
id: g,
|
|
1290
|
+
ref: k,
|
|
1291
|
+
style: {
|
|
1292
|
+
height: "100%",
|
|
1293
|
+
width: "100%",
|
|
1294
|
+
overflow: "hidden",
|
|
1295
|
+
...S,
|
|
1296
|
+
display: "flex",
|
|
1297
|
+
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1298
|
+
flexWrap: "nowrap",
|
|
1299
|
+
touchAction: u === "horizontal" ? "pan-y" : "pan-x"
|
|
1300
|
+
},
|
|
1301
|
+
children: e
|
|
1302
|
+
})
|
|
1303
|
+
});
|
|
1304
|
+
}
|
|
1305
|
+
it.displayName = "Group";
|
|
1306
|
+
function Pe() {
|
|
1307
|
+
const e = ht(at);
|
|
1308
|
+
return P(e, "Group Context not found; did you render a Panel or Separator outside of a Group?"), e;
|
|
1309
|
+
}
|
|
1310
|
+
function Ut(e, t) {
|
|
1311
|
+
const { id: n } = Pe(), o = F({
|
|
1312
|
+
collapse: ge,
|
|
1313
|
+
expand: ge,
|
|
1314
|
+
getSize: () => ({
|
|
1315
|
+
asPercentage: 0,
|
|
1316
|
+
inPixels: 0
|
|
1317
|
+
}),
|
|
1318
|
+
isCollapsed: () => !1,
|
|
1319
|
+
resize: ge
|
|
1320
|
+
});
|
|
1321
|
+
Ye(t, () => o.current, []), U(() => {
|
|
1322
|
+
Object.assign(o.current, Qe({
|
|
1323
|
+
groupId: n,
|
|
1324
|
+
panelId: e
|
|
1325
|
+
}));
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
function st({ children: e, className: t, collapsedSize: n = "0%", collapsible: o = !1, defaultSize: r, disabled: a, elementRef: d, groupResizeBehavior: s = "preserve-relative-size", id: i, maxSize: l = "100%", minSize: u = "0%", onResize: c, panelRef: S, style: h, ...f }) {
|
|
1329
|
+
const p = !!i, m = we(i), g = Ce({ disabled: a }), v = F(null), b = xe(v, d), { getPanelStyles: z, id: y, orientation: k, registerPanel: E, updatePanelProps: D } = Pe(), N = c !== null, $ = ae((C, M, T) => {
|
|
1330
|
+
c?.(C, i, T);
|
|
1331
|
+
});
|
|
1332
|
+
U(() => {
|
|
1333
|
+
const C = v.current;
|
|
1334
|
+
if (C !== null) return E({
|
|
1335
|
+
element: C,
|
|
1336
|
+
id: m,
|
|
1337
|
+
idIsStable: p,
|
|
1338
|
+
mutableValues: {
|
|
1339
|
+
expandToSize: void 0,
|
|
1340
|
+
prevSize: void 0
|
|
1341
|
+
},
|
|
1342
|
+
onResize: N ? $ : void 0,
|
|
1343
|
+
panelConstraints: {
|
|
1344
|
+
groupResizeBehavior: s,
|
|
1345
|
+
collapsedSize: n,
|
|
1346
|
+
collapsible: o,
|
|
1347
|
+
defaultSize: r,
|
|
1348
|
+
disabled: g.disabled,
|
|
1349
|
+
maxSize: l,
|
|
1350
|
+
minSize: u
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
}, [
|
|
1354
|
+
s,
|
|
1355
|
+
n,
|
|
1356
|
+
o,
|
|
1357
|
+
r,
|
|
1358
|
+
N,
|
|
1359
|
+
m,
|
|
1360
|
+
p,
|
|
1361
|
+
l,
|
|
1362
|
+
u,
|
|
1363
|
+
$,
|
|
1364
|
+
E,
|
|
1365
|
+
g
|
|
1366
|
+
]), pe(() => {
|
|
1367
|
+
D(m, { disabled: a });
|
|
1368
|
+
}, [
|
|
1369
|
+
a,
|
|
1370
|
+
m,
|
|
1371
|
+
D
|
|
1372
|
+
]), Ut(m, S);
|
|
1373
|
+
const w = () => {
|
|
1374
|
+
const C = z(y, m);
|
|
1375
|
+
if (C) return JSON.stringify(C);
|
|
1376
|
+
}, x = bt((C) => be(y, C), w, w);
|
|
1377
|
+
let L;
|
|
1378
|
+
return x ? L = JSON.parse(x) : r !== void 0 ? L = {
|
|
1379
|
+
flexGrow: void 0,
|
|
1380
|
+
flexShrink: void 0,
|
|
1381
|
+
flexBasis: r
|
|
1382
|
+
} : L = { flexGrow: 1 }, /* @__PURE__ */ j("div", {
|
|
1383
|
+
...f,
|
|
1384
|
+
"data-disabled": a || void 0,
|
|
1385
|
+
"data-panel": !0,
|
|
1386
|
+
"data-testid": m,
|
|
1387
|
+
id: m,
|
|
1388
|
+
ref: b,
|
|
1389
|
+
style: {
|
|
1390
|
+
...Zt,
|
|
1391
|
+
display: "flex",
|
|
1392
|
+
flexBasis: 0,
|
|
1393
|
+
flexShrink: 1,
|
|
1394
|
+
overflow: "visible",
|
|
1395
|
+
...L
|
|
1396
|
+
},
|
|
1397
|
+
children: /* @__PURE__ */ j("div", {
|
|
1398
|
+
className: t,
|
|
1399
|
+
style: {
|
|
1400
|
+
maxHeight: "100%",
|
|
1401
|
+
maxWidth: "100%",
|
|
1402
|
+
flexGrow: 1,
|
|
1403
|
+
overflow: "auto",
|
|
1404
|
+
...h,
|
|
1405
|
+
touchAction: k === "horizontal" ? "pan-y" : "pan-x"
|
|
1406
|
+
},
|
|
1407
|
+
children: e
|
|
1408
|
+
})
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
st.displayName = "Panel";
|
|
1412
|
+
var Zt = {
|
|
1413
|
+
minHeight: 0,
|
|
1414
|
+
maxHeight: "100%",
|
|
1415
|
+
height: "auto",
|
|
1416
|
+
minWidth: 0,
|
|
1417
|
+
maxWidth: "100%",
|
|
1418
|
+
width: "auto",
|
|
1419
|
+
border: "none",
|
|
1420
|
+
borderWidth: 0,
|
|
1421
|
+
padding: 0,
|
|
1422
|
+
margin: 0
|
|
1423
|
+
};
|
|
1424
|
+
function Kt({ layout: e, panelConstraints: t, panelId: n, panelIndex: o }) {
|
|
1425
|
+
let r, a;
|
|
1426
|
+
const d = e[n], s = t.find((i) => i.panelId === n);
|
|
1427
|
+
if (s) {
|
|
1428
|
+
const i = s.maxSize, l = s.collapsible ? s.collapsedSize : s.minSize, u = [o, o + 1];
|
|
1429
|
+
a = X({
|
|
1430
|
+
layout: ie({
|
|
1431
|
+
delta: l - d,
|
|
1432
|
+
initialLayout: e,
|
|
1433
|
+
panelConstraints: t,
|
|
1434
|
+
pivotIndices: u,
|
|
1435
|
+
prevLayout: e
|
|
1436
|
+
}),
|
|
1437
|
+
panelConstraints: t
|
|
1438
|
+
})[n], r = X({
|
|
1439
|
+
layout: ie({
|
|
1440
|
+
delta: i - d,
|
|
1441
|
+
initialLayout: e,
|
|
1442
|
+
panelConstraints: t,
|
|
1443
|
+
pivotIndices: u,
|
|
1444
|
+
prevLayout: e
|
|
1445
|
+
}),
|
|
1446
|
+
panelConstraints: t
|
|
1447
|
+
})[n];
|
|
1448
|
+
}
|
|
1449
|
+
return {
|
|
1450
|
+
valueControls: n,
|
|
1451
|
+
valueMax: r,
|
|
1452
|
+
valueMin: a,
|
|
1453
|
+
valueNow: d
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
function lt({ children: e, className: t, disabled: n, disableDoubleClick: o, elementRef: r, id: a, style: d, ...s }) {
|
|
1457
|
+
const i = we(a), l = Ce({
|
|
1458
|
+
disabled: n,
|
|
1459
|
+
disableDoubleClick: o
|
|
1460
|
+
}), [u, c] = ce({}), [S, h] = ce("inactive"), [f, p] = ce(!1), m = F(null), g = xe(m, r), { disableCursor: v, id: b, orientation: z, registerSeparator: y, updateSeparatorProps: k } = Pe(), E = z === "horizontal" ? "vertical" : "horizontal";
|
|
1461
|
+
U(() => {
|
|
1462
|
+
const $ = m.current;
|
|
1463
|
+
if ($ !== null) {
|
|
1464
|
+
const w = {
|
|
1465
|
+
disabled: l.disabled,
|
|
1466
|
+
disableDoubleClick: l.disableDoubleClick,
|
|
1467
|
+
element: $,
|
|
1468
|
+
id: i
|
|
1469
|
+
}, x = y(w), L = $t((M) => {
|
|
1470
|
+
h(M.next.state !== "inactive" && M.next.hitRegions.some((T) => T.separator === w) ? M.next.state : "inactive");
|
|
1471
|
+
}), C = be(b, (M) => {
|
|
1472
|
+
const { derivedPanelConstraints: T, layout: ne, separatorToPanels: se } = M.next, oe = se.get(w);
|
|
1473
|
+
if (oe) {
|
|
1474
|
+
const W = oe[0], Z = oe.indexOf(W);
|
|
1475
|
+
c(Kt({
|
|
1476
|
+
layout: ne,
|
|
1477
|
+
panelConstraints: T,
|
|
1478
|
+
panelId: W.id,
|
|
1479
|
+
panelIndex: Z
|
|
1480
|
+
}));
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
return () => {
|
|
1484
|
+
L(), C(), x();
|
|
1485
|
+
};
|
|
1486
|
+
}
|
|
1487
|
+
}, [
|
|
1488
|
+
b,
|
|
1489
|
+
i,
|
|
1490
|
+
y,
|
|
1491
|
+
l
|
|
1492
|
+
]), pe(() => {
|
|
1493
|
+
k(i, {
|
|
1494
|
+
disabled: n,
|
|
1495
|
+
disableDoubleClick: o
|
|
1496
|
+
});
|
|
1497
|
+
}, [
|
|
1498
|
+
n,
|
|
1499
|
+
o,
|
|
1500
|
+
i,
|
|
1501
|
+
k
|
|
1502
|
+
]);
|
|
1503
|
+
let D;
|
|
1504
|
+
n && !v && (D = "not-allowed");
|
|
1505
|
+
let N;
|
|
1506
|
+
return n ? N = "disabled" : S === "active" ? N = "active" : f ? N = "focus" : N = S, /* @__PURE__ */ j("div", {
|
|
1507
|
+
...s,
|
|
1508
|
+
"aria-controls": u.valueControls,
|
|
1509
|
+
"aria-disabled": n || void 0,
|
|
1510
|
+
"aria-orientation": E,
|
|
1511
|
+
"aria-valuemax": u.valueMax,
|
|
1512
|
+
"aria-valuemin": u.valueMin,
|
|
1513
|
+
"aria-valuenow": u.valueNow,
|
|
1514
|
+
children: e,
|
|
1515
|
+
className: t,
|
|
1516
|
+
"data-separator": N,
|
|
1517
|
+
"data-testid": i,
|
|
1518
|
+
id: i,
|
|
1519
|
+
onBlur: () => p(!1),
|
|
1520
|
+
onFocus: () => p(!0),
|
|
1521
|
+
ref: g,
|
|
1522
|
+
role: "separator",
|
|
1523
|
+
style: {
|
|
1524
|
+
flexBasis: "auto",
|
|
1525
|
+
cursor: D,
|
|
1526
|
+
...d,
|
|
1527
|
+
flexGrow: 0,
|
|
1528
|
+
flexShrink: 0,
|
|
1529
|
+
touchAction: "none"
|
|
1530
|
+
},
|
|
1531
|
+
tabIndex: n ? void 0 : 0
|
|
1532
|
+
});
|
|
1533
|
+
}
|
|
1534
|
+
lt.displayName = "Separator";
|
|
1535
|
+
function tn({ className: e, ...t }) {
|
|
1536
|
+
return /* @__PURE__ */ j(it, {
|
|
1537
|
+
"data-slot": "resizable-panel-group",
|
|
1538
|
+
className: He("flex h-full w-full aria-[orientation=vertical]:flex-col", e),
|
|
1539
|
+
...t
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
function nn({ ...e }) {
|
|
1543
|
+
return /* @__PURE__ */ j(st, {
|
|
1544
|
+
"data-slot": "resizable-panel",
|
|
1545
|
+
...e
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
function on({ withHandle: e, className: t, ...n }) {
|
|
1549
|
+
return /* @__PURE__ */ j(lt, {
|
|
1550
|
+
"data-slot": "resizable-handle",
|
|
1551
|
+
className: He("relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:start-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:start-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 rtl:after:translate-x-1/2 rtl:aria-[orientation=horizontal]:after:-translate-x-0 [&[aria-orientation=horizontal]>div]:rotate-90", t),
|
|
1552
|
+
...n,
|
|
1553
|
+
children: e && /* @__PURE__ */ j("div", { className: "z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border" })
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
export {
|
|
1557
|
+
on as ResizableHandle,
|
|
1558
|
+
nn as ResizablePanel,
|
|
1559
|
+
tn as ResizablePanelGroup
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
//# sourceMappingURL=resizable.js.map
|