@enya-learning/nova 0.6.0 → 0.7.1
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/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -1
- package/dist/chunks/dist-i6l6wqicjhnap81o.js +37 -0
- package/dist/chunks/{dist-o8x0ip0z71xkr2oh.js.map → dist-i6l6wqicjhnap81o.js.map} +1 -1
- package/dist/chunks/utils-chr77evsz8gs6wle.js +10 -0
- package/dist/chunks/{utils-kyb5nny4y41y7hd8.js.map → utils-chr77evsz8gs6wle.js.map} +1 -1
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js → vendor-styling-bq164a52kub0yzw7.js} +84 -81
- package/dist/chunks/{vendor-styling-eeiy57tyznmxsfky.js.map → vendor-styling-bq164a52kub0yzw7.js.map} +1 -1
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js → vendor-utils-dzqqqwem43r86lbz.js} +48 -48
- package/dist/chunks/{vendor-utils-egkaeebaqpft6cxj.js.map → vendor-utils-dzqqqwem43r86lbz.js.map} +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.js +1 -1
- package/dist/components/alert.js +2 -2
- package/dist/components/aspect-ratio.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +2 -2
- package/dist/components/box.js +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.js +2 -2
- package/dist/components/button.js +2 -2
- package/dist/components/calendar.js +59 -58
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +27 -26
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/chart.js +1460 -1455
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/combobox.js +7 -7
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.js +83 -83
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +1 -1
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +1 -1
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/empty.js +2 -2
- package/dist/components/enya-logo.js +88 -78
- package/dist/components/enya-logo.js.map +1 -1
- package/dist/components/field.js +2 -2
- package/dist/components/field.js.map +1 -1
- package/dist/components/heading.js +11 -11
- package/dist/components/heading.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.js +2 -2
- package/dist/components/input-otp.js +61 -60
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/item.js +2 -2
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.js +1 -1
- package/dist/components/menubar.js +1 -1
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/native-select.js +1 -1
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.js +2 -2
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/pagination.js +1 -1
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.js +119 -116
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/sidebar.js +10 -10
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.js +163 -165
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.js +2 -2
- package/dist/components/text.js +2 -2
- package/dist/components/textarea.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +2 -2
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/index.js +28 -21
- package/dist/src/index.d.ts +1 -0
- package/dist/styles/nova.css +1 -1
- package/dist/styles/shadcn-variants.css +98 -0
- package/dist/utils.js +1 -1
- package/package.json +15 -11
- package/src/eslint/no-primitive-colors.test.ts +1 -1
- package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +0 -37
- package/dist/chunks/utils-kyb5nny4y41y7hd8.js +0 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as He } from "../chunks/utils-
|
|
2
|
+
import { t as He } from "../chunks/utils-chr77evsz8gs6wle.js";
|
|
3
3
|
import { jsx as j } from "react/jsx-runtime";
|
|
4
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
5
|
function yt(e, t) {
|
|
@@ -147,7 +147,7 @@ function kt() {
|
|
|
147
147
|
}
|
|
148
148
|
function Je(e) {
|
|
149
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,
|
|
150
|
+
let s = !1, i = !1, l = -1, u = -1, c = 0, z, h = [];
|
|
151
151
|
{
|
|
152
152
|
let f = -1;
|
|
153
153
|
for (const p of a) p.hasAttribute("data-panel") && (f++, p.hasAttribute("data-disabled") || (c++, l === -1 && (l = f), u = f));
|
|
@@ -158,14 +158,14 @@ function Je(e) {
|
|
|
158
158
|
f++;
|
|
159
159
|
const m = o.find((g) => g.element === p);
|
|
160
160
|
if (m) {
|
|
161
|
-
if (
|
|
162
|
-
const g =
|
|
161
|
+
if (z) {
|
|
162
|
+
const g = z.element.getBoundingClientRect(), v = p.getBoundingClientRect();
|
|
163
163
|
let b;
|
|
164
164
|
if (i) {
|
|
165
|
-
const
|
|
165
|
+
const S = 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
166
|
switch (h.length) {
|
|
167
167
|
case 0:
|
|
168
|
-
b = [
|
|
168
|
+
b = [S, y];
|
|
169
169
|
break;
|
|
170
170
|
case 1: {
|
|
171
171
|
const k = h[0];
|
|
@@ -173,7 +173,7 @@ function Je(e) {
|
|
|
173
173
|
orientation: n,
|
|
174
174
|
rects: [g, v],
|
|
175
175
|
targetRect: k.element.getBoundingClientRect()
|
|
176
|
-
}) === g ? y :
|
|
176
|
+
}) === g ? y : S];
|
|
177
177
|
break;
|
|
178
178
|
}
|
|
179
179
|
default:
|
|
@@ -181,32 +181,32 @@ function Je(e) {
|
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
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
|
|
185
|
-
let y = "width" in
|
|
184
|
+
for (const S of b) {
|
|
185
|
+
let y = "width" in S ? S : S.element.getBoundingClientRect();
|
|
186
186
|
const k = kt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
187
187
|
if (y.width < k) {
|
|
188
|
-
const
|
|
189
|
-
y = new DOMRect(y.x -
|
|
188
|
+
const M = k - y.width;
|
|
189
|
+
y = new DOMRect(y.x - M / 2, y.y, y.width + M, y.height);
|
|
190
190
|
}
|
|
191
191
|
if (y.height < k) {
|
|
192
|
-
const
|
|
193
|
-
y = new DOMRect(y.x, y.y -
|
|
192
|
+
const M = k - y.height;
|
|
193
|
+
y = new DOMRect(y.x, y.y - M / 2, y.width, y.height + M);
|
|
194
194
|
}
|
|
195
195
|
!s && !(f <= l || f > u) && d.push({
|
|
196
196
|
group: e,
|
|
197
197
|
groupSize: te({ group: e }),
|
|
198
|
-
panels: [
|
|
199
|
-
separator: "width" in
|
|
198
|
+
panels: [z, m],
|
|
199
|
+
separator: "width" in S ? void 0 : S,
|
|
200
200
|
rect: y
|
|
201
201
|
}), s = !1;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
i = !1,
|
|
204
|
+
i = !1, z = m, h = [];
|
|
205
205
|
}
|
|
206
206
|
} else if (p.hasAttribute("data-separator")) {
|
|
207
207
|
p.ariaDisabled !== null && (s = !0);
|
|
208
208
|
const m = r.find((g) => g.element === p);
|
|
209
|
-
m ? h.push(m) : (
|
|
209
|
+
m ? h.push(m) : (z = void 0, h = []);
|
|
210
210
|
} else i = !0;
|
|
211
211
|
}
|
|
212
212
|
return d;
|
|
@@ -407,7 +407,7 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
407
407
|
if (R(e, 0)) return t;
|
|
408
408
|
const d = a === "imperative-api", s = Object.values(t), i = Object.values(r), l = [...s], [u, c] = o;
|
|
409
409
|
P(u != null, "Invalid first pivot index"), P(c != null, "Invalid second pivot index");
|
|
410
|
-
let
|
|
410
|
+
let z = 0;
|
|
411
411
|
switch (a) {
|
|
412
412
|
case "keyboard":
|
|
413
413
|
{
|
|
@@ -417,8 +417,8 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
417
417
|
if (g) {
|
|
418
418
|
const b = s[f];
|
|
419
419
|
if (P(b != null, `Previous layout not found for panel index ${f}`), R(b, m)) {
|
|
420
|
-
const
|
|
421
|
-
O(
|
|
420
|
+
const S = v - b;
|
|
421
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
424
|
}
|
|
@@ -429,8 +429,8 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
429
429
|
if (g) {
|
|
430
430
|
const b = s[f];
|
|
431
431
|
if (P(b != null, `Previous layout not found for panel index ${f}`), R(b, v)) {
|
|
432
|
-
const
|
|
433
|
-
O(
|
|
432
|
+
const S = b - m;
|
|
433
|
+
O(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
436
|
}
|
|
@@ -440,11 +440,11 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
440
440
|
P(p, `Panel constraints not found for index ${f}`);
|
|
441
441
|
const m = s[f], { collapsible: g, collapsedSize: v, minSize: b } = p;
|
|
442
442
|
if (g && O(m, b) < 0) if (e > 0) {
|
|
443
|
-
const
|
|
444
|
-
O(m + e, b) < 0 && (e = O(e, y) <= 0 ? 0 :
|
|
443
|
+
const S = b - v, y = S / 2;
|
|
444
|
+
O(m + e, b) < 0 && (e = O(e, y) <= 0 ? 0 : S);
|
|
445
445
|
} else {
|
|
446
|
-
const
|
|
447
|
-
O(m - e, b) < 0 && (e = O(100 + e, y) > 0 ? 0 : -
|
|
446
|
+
const S = b - v, y = 100 - S / 2;
|
|
447
|
+
O(m - e, b) < 0 && (e = O(100 + e, y) > 0 ? 0 : -S);
|
|
448
448
|
}
|
|
449
449
|
break;
|
|
450
450
|
}
|
|
@@ -469,7 +469,7 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
469
469
|
{
|
|
470
470
|
let f = e < 0 ? u : c;
|
|
471
471
|
for (; f >= 0 && f < n.length; ) {
|
|
472
|
-
const p = Math.abs(e) - Math.abs(
|
|
472
|
+
const p = Math.abs(e) - Math.abs(z), m = s[f];
|
|
473
473
|
P(m != null, `Previous layout not found for panel index ${f}`);
|
|
474
474
|
const g = m - p, v = Q({
|
|
475
475
|
overrideDisabledPanels: d,
|
|
@@ -477,7 +477,7 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
477
477
|
prevSize: m,
|
|
478
478
|
size: g
|
|
479
479
|
});
|
|
480
|
-
if (!R(m, v) && (
|
|
480
|
+
if (!R(m, v) && (z += m - v, l[f] = v, z.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, { numeric: !0 }) >= 0)) break;
|
|
481
481
|
e < 0 ? f-- : f++;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
@@ -485,7 +485,7 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
485
485
|
{
|
|
486
486
|
const f = e < 0 ? c : u, p = s[f];
|
|
487
487
|
P(p != null, `Previous layout not found for panel index ${f}`);
|
|
488
|
-
const m = p +
|
|
488
|
+
const m = p + z, g = Q({
|
|
489
489
|
overrideDisabledPanels: d,
|
|
490
490
|
panelConstraints: n[f],
|
|
491
491
|
prevSize: p,
|
|
@@ -494,15 +494,15 @@ function ie({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: o,
|
|
|
494
494
|
if (l[f] = g, !R(g, m)) {
|
|
495
495
|
let v = m - g, b = e < 0 ? c : u;
|
|
496
496
|
for (; b >= 0 && b < n.length; ) {
|
|
497
|
-
const
|
|
498
|
-
P(
|
|
499
|
-
const y =
|
|
497
|
+
const S = l[b];
|
|
498
|
+
P(S != null, `Previous layout not found for panel index ${b}`);
|
|
499
|
+
const y = S + v, k = Q({
|
|
500
500
|
overrideDisabledPanels: d,
|
|
501
501
|
panelConstraints: n[b],
|
|
502
|
-
prevSize:
|
|
502
|
+
prevSize: S,
|
|
503
503
|
size: y
|
|
504
504
|
});
|
|
505
|
-
if (R(
|
|
505
|
+
if (R(S, k) || (v -= k - S, l[b] = k), R(v, 0)) break;
|
|
506
506
|
e > 0 ? b-- : b++;
|
|
507
507
|
}
|
|
508
508
|
}
|
|
@@ -554,12 +554,12 @@ function X({ layout: e, panelConstraints: t }) {
|
|
|
554
554
|
function Qe({ groupId: e, panelId: t }) {
|
|
555
555
|
const n = () => {
|
|
556
556
|
const i = J();
|
|
557
|
-
for (const [l, { defaultLayoutDeferred: u, derivedPanelConstraints: c, layout:
|
|
557
|
+
for (const [l, { defaultLayoutDeferred: u, derivedPanelConstraints: c, layout: z, groupSize: h, separatorToPanels: f }] of i) if (l.id === e) return {
|
|
558
558
|
defaultLayoutDeferred: u,
|
|
559
559
|
derivedPanelConstraints: c,
|
|
560
560
|
group: l,
|
|
561
561
|
groupSize: h,
|
|
562
|
-
layout:
|
|
562
|
+
layout: z,
|
|
563
563
|
separatorToPanels: f
|
|
564
564
|
};
|
|
565
565
|
throw Error(`Group ${e} not found`);
|
|
@@ -576,8 +576,8 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
576
576
|
if (i !== void 0) return i;
|
|
577
577
|
throw Error(`Layout not found for Panel ${t}`);
|
|
578
578
|
}, d = ({ nextSize: i, panels: l, prevLayout: u, derivedPanelConstraints: c }) => {
|
|
579
|
-
const
|
|
580
|
-
if (p && i <
|
|
579
|
+
const z = a(), h = l.findIndex((m) => m.id === t), f = h === 0, p = h === l.length - 1;
|
|
580
|
+
if (p && i < z && (f || l.slice(0, h).every((m, g) => {
|
|
581
581
|
const v = c[g];
|
|
582
582
|
return v?.collapsible && R(v.collapsedSize, u[v.panelId]);
|
|
583
583
|
}))) {
|
|
@@ -588,7 +588,7 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
588
588
|
};
|
|
589
589
|
}
|
|
590
590
|
return ie({
|
|
591
|
-
delta: p ?
|
|
591
|
+
delta: p ? z - i : i - z,
|
|
592
592
|
initialLayout: u,
|
|
593
593
|
panelConstraints: c,
|
|
594
594
|
pivotIndices: p ? [h - 1, h] : [h, h + 1],
|
|
@@ -597,7 +597,7 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
597
597
|
});
|
|
598
598
|
}, s = (i) => {
|
|
599
599
|
if (i === a()) return;
|
|
600
|
-
const { defaultLayoutDeferred: l, derivedPanelConstraints: u, group: c, groupSize:
|
|
600
|
+
const { defaultLayoutDeferred: l, derivedPanelConstraints: u, group: c, groupSize: z, layout: h, separatorToPanels: f } = n(), p = X({
|
|
601
601
|
layout: d({
|
|
602
602
|
nextSize: i,
|
|
603
603
|
panels: c.panels,
|
|
@@ -609,7 +609,7 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
609
609
|
Y(h, p) || B(c, {
|
|
610
610
|
defaultLayoutDeferred: l,
|
|
611
611
|
derivedPanelConstraints: u,
|
|
612
|
-
groupSize:
|
|
612
|
+
groupSize: z,
|
|
613
613
|
layout: p,
|
|
614
614
|
separatorToPanels: f
|
|
615
615
|
});
|
|
@@ -620,8 +620,8 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
620
620
|
i && c !== l && (u.expandToSize = c, s(l));
|
|
621
621
|
},
|
|
622
622
|
expand: () => {
|
|
623
|
-
const { collapsible: i, collapsedSize: l, minSize: u } = o(), { mutableValues: c } = r(),
|
|
624
|
-
if (i &&
|
|
623
|
+
const { collapsible: i, collapsedSize: l, minSize: u } = o(), { mutableValues: c } = r(), z = a();
|
|
624
|
+
if (i && z === l) {
|
|
625
625
|
let h = c.expandToSize ?? u;
|
|
626
626
|
h === 0 && (h = 1), s(h);
|
|
627
627
|
}
|
|
@@ -638,12 +638,12 @@ function Qe({ groupId: e, panelId: t }) {
|
|
|
638
638
|
return i && R(l, u);
|
|
639
639
|
},
|
|
640
640
|
resize: (i) => {
|
|
641
|
-
const { group: l } = n(), { element: u } = r(), c = te({ group: l })
|
|
642
|
-
s(I(re({
|
|
641
|
+
const { group: l } = n(), { element: u } = r(), c = te({ group: l }), z = I(re({
|
|
643
642
|
groupSize: c,
|
|
644
643
|
panelElement: u,
|
|
645
644
|
styleProp: i
|
|
646
|
-
}) / c * 100)
|
|
645
|
+
}) / c * 100);
|
|
646
|
+
s(z);
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
649
|
}
|
|
@@ -874,14 +874,14 @@ function Se(e) {
|
|
|
874
874
|
function rt({ document: e, event: t, hitRegions: n, initialLayoutMap: o, mountedGroups: r, pointerDownAtPoint: a, prevCursorFlags: d }) {
|
|
875
875
|
let s = 0;
|
|
876
876
|
n.forEach((l) => {
|
|
877
|
-
const { group: u, groupSize: c } = l, { orientation:
|
|
877
|
+
const { group: u, groupSize: c } = l, { orientation: z, panels: h } = u, { disableCursor: f } = u.mutableState;
|
|
878
878
|
let p = 0;
|
|
879
|
-
a ?
|
|
879
|
+
a ? z === "horizontal" ? p = (t.clientX - a.x) / c * 100 : p = (t.clientY - a.y) / c * 100 : z === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
|
|
880
880
|
const m = o.get(u), g = r.get(u);
|
|
881
881
|
if (!m || !g) return;
|
|
882
|
-
const { defaultLayoutDeferred: v, derivedPanelConstraints: b, groupSize:
|
|
882
|
+
const { defaultLayoutDeferred: v, derivedPanelConstraints: b, groupSize: S, layout: y, separatorToPanels: k } = g;
|
|
883
883
|
if (b && y && k) {
|
|
884
|
-
const
|
|
884
|
+
const M = ie({
|
|
885
885
|
delta: p,
|
|
886
886
|
initialLayout: m,
|
|
887
887
|
panelConstraints: b,
|
|
@@ -889,8 +889,8 @@ function rt({ document: e, event: t, hitRegions: n, initialLayoutMap: o, mounted
|
|
|
889
889
|
prevLayout: y,
|
|
890
890
|
trigger: "mouse-or-touch"
|
|
891
891
|
});
|
|
892
|
-
if (Y(
|
|
893
|
-
if (p !== 0 && !f) switch (
|
|
892
|
+
if (Y(M, y)) {
|
|
893
|
+
if (p !== 0 && !f) switch (z) {
|
|
894
894
|
case "horizontal":
|
|
895
895
|
s |= p < 0 ? et : tt;
|
|
896
896
|
break;
|
|
@@ -901,8 +901,8 @@ function rt({ document: e, event: t, hitRegions: n, initialLayoutMap: o, mounted
|
|
|
901
901
|
} else B(l.group, {
|
|
902
902
|
defaultLayoutDeferred: v,
|
|
903
903
|
derivedPanelConstraints: b,
|
|
904
|
-
groupSize:
|
|
905
|
-
layout:
|
|
904
|
+
groupSize: S,
|
|
905
|
+
layout: M,
|
|
906
906
|
separatorToPanels: k
|
|
907
907
|
});
|
|
908
908
|
}
|
|
@@ -1016,22 +1016,22 @@ function Vt({ group: e, nextGroupSize: t, prevGroupSize: n, prevLayout: o }) {
|
|
|
1016
1016
|
let r = 0, a = 0, d = !1;
|
|
1017
1017
|
const s = /* @__PURE__ */ new Map(), i = [];
|
|
1018
1018
|
for (const c of e.panels) {
|
|
1019
|
-
const
|
|
1019
|
+
const z = o[c.id] ?? 0;
|
|
1020
1020
|
if (c.panelConstraints.groupResizeBehavior === "preserve-pixel-size") {
|
|
1021
1021
|
d = !0;
|
|
1022
|
-
const h = I(
|
|
1022
|
+
const h = I(z / 100 * n / t * 100);
|
|
1023
1023
|
s.set(c.id, h), r += h;
|
|
1024
1024
|
} else
|
|
1025
|
-
i.push(c.id), a +=
|
|
1025
|
+
i.push(c.id), a += z;
|
|
1026
1026
|
}
|
|
1027
1027
|
if (!d || i.length === 0) return o;
|
|
1028
1028
|
const l = 100 - r, u = { ...o };
|
|
1029
|
-
if (s.forEach((c,
|
|
1030
|
-
u[
|
|
1029
|
+
if (s.forEach((c, z) => {
|
|
1030
|
+
u[z] = c;
|
|
1031
1031
|
}), a > 0) for (const c of i) u[c] = I((o[c] ?? 0) / a * l);
|
|
1032
1032
|
else {
|
|
1033
1033
|
const c = I(l / i.length);
|
|
1034
|
-
for (const
|
|
1034
|
+
for (const z of i) u[z] = c;
|
|
1035
1035
|
}
|
|
1036
1036
|
return u;
|
|
1037
1037
|
}
|
|
@@ -1054,12 +1054,12 @@ function Xt(e) {
|
|
|
1054
1054
|
if (g === 0) return;
|
|
1055
1055
|
const v = H(e.id);
|
|
1056
1056
|
if (!v) return;
|
|
1057
|
-
const b = ve(e),
|
|
1057
|
+
const b = ve(e), S = v.defaultLayoutDeferred ? We(b) : v.layout, y = X({
|
|
1058
1058
|
layout: Vt({
|
|
1059
1059
|
group: e,
|
|
1060
1060
|
nextGroupSize: g,
|
|
1061
1061
|
prevGroupSize: v.groupSize,
|
|
1062
|
-
prevLayout:
|
|
1062
|
+
prevLayout: S
|
|
1063
1063
|
}),
|
|
1064
1064
|
panelConstraints: b
|
|
1065
1065
|
});
|
|
@@ -1086,15 +1086,15 @@ function Xt(e) {
|
|
|
1086
1086
|
panelConstraints: s
|
|
1087
1087
|
}), c = e.element.ownerDocument;
|
|
1088
1088
|
K.set(c, (K.get(c) ?? 0) + 1);
|
|
1089
|
-
const
|
|
1089
|
+
const z = /* @__PURE__ */ new Map();
|
|
1090
1090
|
return Je(e).forEach((h) => {
|
|
1091
|
-
h.separator &&
|
|
1091
|
+
h.separator && z.set(h.separator, h.panels);
|
|
1092
1092
|
}), B(e, {
|
|
1093
1093
|
defaultLayoutDeferred: d === 0,
|
|
1094
1094
|
derivedPanelConstraints: s,
|
|
1095
1095
|
groupSize: d,
|
|
1096
1096
|
layout: u,
|
|
1097
|
-
separatorToPanels:
|
|
1097
|
+
separatorToPanels: z
|
|
1098
1098
|
}), e.separators.forEach((h) => {
|
|
1099
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
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() {
|
|
@@ -1151,7 +1151,7 @@ function Jt(e, t) {
|
|
|
1151
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
1152
|
coarse: 20,
|
|
1153
1153
|
fine: 10
|
|
1154
|
-
}, style:
|
|
1154
|
+
}, style: z, ...h }) {
|
|
1155
1155
|
const f = F({
|
|
1156
1156
|
onLayoutChange: {},
|
|
1157
1157
|
onLayoutChanged: {}
|
|
@@ -1159,7 +1159,7 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1159
1159
|
Y(f.current.onLayoutChange, w) || (f.current.onLayoutChange = w, i?.(w));
|
|
1160
1160
|
}), m = ae((w) => {
|
|
1161
1161
|
Y(f.current.onLayoutChanged, w) || (f.current.onLayoutChanged = w, l?.(w));
|
|
1162
|
-
}), g = we(s), v = F(null), [b,
|
|
1162
|
+
}), g = we(s), v = F(null), [b, S] = qt(), y = F({
|
|
1163
1163
|
lastExpandedPanelSizes: {},
|
|
1164
1164
|
layouts: {},
|
|
1165
1165
|
panels: [],
|
|
@@ -1167,12 +1167,12 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1167
1167
|
separators: []
|
|
1168
1168
|
}), k = xe(v, a);
|
|
1169
1169
|
Jt(g, d);
|
|
1170
|
-
const
|
|
1171
|
-
const L = q(), C = ke(w),
|
|
1172
|
-
if (
|
|
1170
|
+
const M = ae((w, x) => {
|
|
1171
|
+
const L = q(), C = ke(w), E = H(w);
|
|
1172
|
+
if (E) {
|
|
1173
1173
|
let T = !1;
|
|
1174
1174
|
return L.state === "active" && (T = L.hitRegions.some((ne) => ne.group === C)), {
|
|
1175
|
-
flexGrow:
|
|
1175
|
+
flexGrow: E.layout[x] ?? 1,
|
|
1176
1176
|
pointerEvents: T ? "none" : void 0
|
|
1177
1177
|
};
|
|
1178
1178
|
}
|
|
@@ -1184,38 +1184,38 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1184
1184
|
get disableCursor() {
|
|
1185
1185
|
return !!D.disableCursor;
|
|
1186
1186
|
},
|
|
1187
|
-
getPanelStyles:
|
|
1187
|
+
getPanelStyles: M,
|
|
1188
1188
|
id: g,
|
|
1189
1189
|
orientation: u,
|
|
1190
1190
|
registerPanel: (w) => {
|
|
1191
1191
|
const x = y.current;
|
|
1192
|
-
return x.panels = me(u, [...x.panels, w]),
|
|
1193
|
-
x.panels = x.panels.filter((L) => L !== w),
|
|
1192
|
+
return x.panels = me(u, [...x.panels, w]), S(), () => {
|
|
1193
|
+
x.panels = x.panels.filter((L) => L !== w), S();
|
|
1194
1194
|
};
|
|
1195
1195
|
},
|
|
1196
1196
|
registerSeparator: (w) => {
|
|
1197
1197
|
const x = y.current;
|
|
1198
|
-
return x.separators = me(u, [...x.separators, w]),
|
|
1199
|
-
x.separators = x.separators.filter((L) => L !== w),
|
|
1198
|
+
return x.separators = me(u, [...x.separators, w]), S(), () => {
|
|
1199
|
+
x.separators = x.separators.filter((L) => L !== w), S();
|
|
1200
1200
|
};
|
|
1201
1201
|
},
|
|
1202
1202
|
updatePanelProps: (w, { disabled: x }) => {
|
|
1203
1203
|
const L = y.current.panels.find((T) => T.id === w);
|
|
1204
1204
|
L && (L.panelConstraints.disabled = x);
|
|
1205
|
-
const C = ke(g),
|
|
1206
|
-
C &&
|
|
1207
|
-
...
|
|
1205
|
+
const C = ke(g), E = H(g);
|
|
1206
|
+
C && E && B(C, {
|
|
1207
|
+
...E,
|
|
1208
1208
|
derivedPanelConstraints: ve(C)
|
|
1209
1209
|
});
|
|
1210
1210
|
},
|
|
1211
1211
|
updateSeparatorProps: (w, { disabled: x, disableDoubleClick: L }) => {
|
|
1212
|
-
const C = y.current.separators.find((
|
|
1212
|
+
const C = y.current.separators.find((E) => E.id === w);
|
|
1213
1213
|
C && (C.disabled = x, C.disableDoubleClick = L);
|
|
1214
1214
|
}
|
|
1215
1215
|
}), [
|
|
1216
|
-
|
|
1216
|
+
M,
|
|
1217
1217
|
g,
|
|
1218
|
-
|
|
1218
|
+
S,
|
|
1219
1219
|
u,
|
|
1220
1220
|
D
|
|
1221
1221
|
]), $ = F(null);
|
|
@@ -1247,7 +1247,7 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1247
1247
|
separators: x.separators
|
|
1248
1248
|
};
|
|
1249
1249
|
$.current = C;
|
|
1250
|
-
const
|
|
1250
|
+
const E = Xt(C), { defaultLayoutDeferred: T, derivedPanelConstraints: ne, layout: se } = H(C.id, !0);
|
|
1251
1251
|
!T && ne.length > 0 && (p(se), m(se));
|
|
1252
1252
|
const oe = be(g, (W) => {
|
|
1253
1253
|
const { defaultLayoutDeferred: Z, derivedPanelConstraints: Le, layout: le } = W.next;
|
|
@@ -1266,7 +1266,7 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1266
1266
|
p(le), dt && m(le);
|
|
1267
1267
|
});
|
|
1268
1268
|
return () => {
|
|
1269
|
-
$.current = null,
|
|
1269
|
+
$.current = null, E(), oe();
|
|
1270
1270
|
};
|
|
1271
1271
|
}, [
|
|
1272
1272
|
r,
|
|
@@ -1292,7 +1292,7 @@ function it({ children: e, className: t, defaultLayout: n, disableCursor: o, dis
|
|
|
1292
1292
|
height: "100%",
|
|
1293
1293
|
width: "100%",
|
|
1294
1294
|
overflow: "hidden",
|
|
1295
|
-
...
|
|
1295
|
+
...z,
|
|
1296
1296
|
display: "flex",
|
|
1297
1297
|
flexDirection: u === "horizontal" ? "row" : "column",
|
|
1298
1298
|
flexWrap: "nowrap",
|
|
@@ -1325,31 +1325,34 @@ function Ut(e, t) {
|
|
|
1325
1325
|
}));
|
|
1326
1326
|
});
|
|
1327
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:
|
|
1329
|
-
const p = !!i, m = we(i), g = Ce({ disabled: a }), v = F(null), b = xe(v, d), { getPanelStyles:
|
|
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: z, style: h, ...f }) {
|
|
1329
|
+
const p = !!i, m = we(i), g = Ce({ disabled: a }), v = F(null), b = xe(v, d), { getPanelStyles: S, id: y, orientation: k, registerPanel: M, updatePanelProps: D } = Pe(), N = c !== null, $ = ae((C, E, T) => {
|
|
1330
1330
|
c?.(C, i, T);
|
|
1331
1331
|
});
|
|
1332
1332
|
U(() => {
|
|
1333
1333
|
const C = v.current;
|
|
1334
|
-
if (C !== null)
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1334
|
+
if (C !== null) {
|
|
1335
|
+
const E = {
|
|
1336
|
+
element: C,
|
|
1337
|
+
id: m,
|
|
1338
|
+
idIsStable: p,
|
|
1339
|
+
mutableValues: {
|
|
1340
|
+
expandToSize: void 0,
|
|
1341
|
+
prevSize: void 0
|
|
1342
|
+
},
|
|
1343
|
+
onResize: N ? $ : void 0,
|
|
1344
|
+
panelConstraints: {
|
|
1345
|
+
groupResizeBehavior: s,
|
|
1346
|
+
collapsedSize: n,
|
|
1347
|
+
collapsible: o,
|
|
1348
|
+
defaultSize: r,
|
|
1349
|
+
disabled: g.disabled,
|
|
1350
|
+
maxSize: l,
|
|
1351
|
+
minSize: u
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
return M(E);
|
|
1355
|
+
}
|
|
1353
1356
|
}, [
|
|
1354
1357
|
s,
|
|
1355
1358
|
n,
|
|
@@ -1361,7 +1364,7 @@ function st({ children: e, className: t, collapsedSize: n = "0%", collapsible: o
|
|
|
1361
1364
|
l,
|
|
1362
1365
|
u,
|
|
1363
1366
|
$,
|
|
1364
|
-
|
|
1367
|
+
M,
|
|
1365
1368
|
g
|
|
1366
1369
|
]), pe(() => {
|
|
1367
1370
|
D(m, { disabled: a });
|
|
@@ -1369,9 +1372,9 @@ function st({ children: e, className: t, collapsedSize: n = "0%", collapsible: o
|
|
|
1369
1372
|
a,
|
|
1370
1373
|
m,
|
|
1371
1374
|
D
|
|
1372
|
-
]), Ut(m,
|
|
1375
|
+
]), Ut(m, z);
|
|
1373
1376
|
const w = () => {
|
|
1374
|
-
const C =
|
|
1377
|
+
const C = S(y, m);
|
|
1375
1378
|
if (C) return JSON.stringify(C);
|
|
1376
1379
|
}, x = bt((C) => be(y, C), w, w);
|
|
1377
1380
|
let L;
|
|
@@ -1457,7 +1460,7 @@ function lt({ children: e, className: t, disabled: n, disableDoubleClick: o, ele
|
|
|
1457
1460
|
const i = we(a), l = Ce({
|
|
1458
1461
|
disabled: n,
|
|
1459
1462
|
disableDoubleClick: o
|
|
1460
|
-
}), [u, c] = ce({}), [
|
|
1463
|
+
}), [u, c] = ce({}), [z, h] = ce("inactive"), [f, p] = ce(!1), m = F(null), g = xe(m, r), { disableCursor: v, id: b, orientation: S, registerSeparator: y, updateSeparatorProps: k } = Pe(), M = S === "horizontal" ? "vertical" : "horizontal";
|
|
1461
1464
|
U(() => {
|
|
1462
1465
|
const $ = m.current;
|
|
1463
1466
|
if ($ !== null) {
|
|
@@ -1466,10 +1469,10 @@ function lt({ children: e, className: t, disabled: n, disableDoubleClick: o, ele
|
|
|
1466
1469
|
disableDoubleClick: l.disableDoubleClick,
|
|
1467
1470
|
element: $,
|
|
1468
1471
|
id: i
|
|
1469
|
-
}, x = y(w), L = $t((
|
|
1470
|
-
h(
|
|
1471
|
-
}), C = be(b, (
|
|
1472
|
-
const { derivedPanelConstraints: T, layout: ne, separatorToPanels: se } =
|
|
1472
|
+
}, x = y(w), L = $t((E) => {
|
|
1473
|
+
h(E.next.state !== "inactive" && E.next.hitRegions.some((T) => T.separator === w) ? E.next.state : "inactive");
|
|
1474
|
+
}), C = be(b, (E) => {
|
|
1475
|
+
const { derivedPanelConstraints: T, layout: ne, separatorToPanels: se } = E.next, oe = se.get(w);
|
|
1473
1476
|
if (oe) {
|
|
1474
1477
|
const W = oe[0], Z = oe.indexOf(W);
|
|
1475
1478
|
c(Kt({
|
|
@@ -1503,11 +1506,11 @@ function lt({ children: e, className: t, disabled: n, disableDoubleClick: o, ele
|
|
|
1503
1506
|
let D;
|
|
1504
1507
|
n && !v && (D = "not-allowed");
|
|
1505
1508
|
let N;
|
|
1506
|
-
return n ? N = "disabled" :
|
|
1509
|
+
return n ? N = "disabled" : z === "active" ? N = "active" : f ? N = "focus" : N = z, /* @__PURE__ */ j("div", {
|
|
1507
1510
|
...s,
|
|
1508
1511
|
"aria-controls": u.valueControls,
|
|
1509
1512
|
"aria-disabled": n || void 0,
|
|
1510
|
-
"aria-orientation":
|
|
1513
|
+
"aria-orientation": M,
|
|
1511
1514
|
"aria-valuemax": u.valueMax,
|
|
1512
1515
|
"aria-valuemin": u.valueMin,
|
|
1513
1516
|
"aria-valuenow": u.valueNow,
|