@industry-theme/xterm-terminal-panel 0.5.13 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1191,8 +1191,28 @@ var TabButton = ({
|
|
|
1191
1191
|
const showCloseButton = isHovered || isActive;
|
|
1192
1192
|
const closable = tab.closable !== false;
|
|
1193
1193
|
const handleDragStart = useCallback2((e) => {
|
|
1194
|
+
const target = e.currentTarget;
|
|
1194
1195
|
e.dataTransfer.setData("application/x-tab-association", tab.id);
|
|
1195
1196
|
e.dataTransfer.effectAllowed = "move";
|
|
1197
|
+
if (target) {
|
|
1198
|
+
const clone = target.cloneNode(true);
|
|
1199
|
+
clone.style.position = "fixed";
|
|
1200
|
+
clone.style.top = "-9999px";
|
|
1201
|
+
clone.style.left = "-9999px";
|
|
1202
|
+
clone.style.width = `${target.offsetWidth}px`;
|
|
1203
|
+
clone.style.height = `${target.offsetHeight}px`;
|
|
1204
|
+
clone.style.opacity = "0.8";
|
|
1205
|
+
clone.style.pointerEvents = "none";
|
|
1206
|
+
clone.style.transform = "none";
|
|
1207
|
+
clone.style.zIndex = "99999";
|
|
1208
|
+
document.body.appendChild(clone);
|
|
1209
|
+
e.dataTransfer.setDragImage(clone, target.offsetWidth / 2, target.offsetHeight / 2);
|
|
1210
|
+
setTimeout(() => {
|
|
1211
|
+
if (clone.parentNode) {
|
|
1212
|
+
clone.parentNode.removeChild(clone);
|
|
1213
|
+
}
|
|
1214
|
+
}, 100);
|
|
1215
|
+
}
|
|
1196
1216
|
onDragStart?.(tab.id);
|
|
1197
1217
|
}, [tab.id, onDragStart]);
|
|
1198
1218
|
const handleDragEnd = useCallback2(() => {
|
|
@@ -1249,6 +1269,8 @@ var TabButton = ({
|
|
|
1249
1269
|
padding: "6px 8px",
|
|
1250
1270
|
backgroundColor: isActive ? theme.colors.background : theme.colors.backgroundSecondary,
|
|
1251
1271
|
cursor: draggable ? "grab" : "pointer",
|
|
1272
|
+
userSelect: "none",
|
|
1273
|
+
WebkitUserSelect: "none",
|
|
1252
1274
|
fontSize: theme.fontSizes[1],
|
|
1253
1275
|
fontWeight: isActive ? theme.fontWeights.semibold : theme.fontWeights.body,
|
|
1254
1276
|
fontFamily: theme.fonts.body,
|
|
@@ -1296,7 +1318,7 @@ var TabButton = ({
|
|
|
1296
1318
|
const icon = renderIcon ? renderIcon(tab) : undefined;
|
|
1297
1319
|
const displayIcon = icon !== undefined ? icon : tab.icon;
|
|
1298
1320
|
return displayIcon ? /* @__PURE__ */ jsx4("div", {
|
|
1299
|
-
style: { flexShrink: 0, display: "flex", alignItems: "center" },
|
|
1321
|
+
style: { flexShrink: 0, display: "flex", alignItems: "center", pointerEvents: "none" },
|
|
1300
1322
|
children: displayIcon
|
|
1301
1323
|
}) : null;
|
|
1302
1324
|
})(),
|
|
@@ -1307,7 +1329,8 @@ var TabButton = ({
|
|
|
1307
1329
|
style: {
|
|
1308
1330
|
overflow: "hidden",
|
|
1309
1331
|
textOverflow: "ellipsis",
|
|
1310
|
-
whiteSpace: "nowrap"
|
|
1332
|
+
whiteSpace: "nowrap",
|
|
1333
|
+
pointerEvents: "none"
|
|
1311
1334
|
},
|
|
1312
1335
|
title: typeof displayLabel === "string" ? displayLabel : tab.label,
|
|
1313
1336
|
children: displayLabel
|
|
@@ -1880,7 +1903,7 @@ import { useTheme as useTheme6 } from "@principal-ade/industry-theme";
|
|
|
1880
1903
|
|
|
1881
1904
|
// node_modules/@principal-ade/panels/dist/index.esm.js
|
|
1882
1905
|
import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
|
|
1883
|
-
import r, { useState as o, useRef as
|
|
1906
|
+
import r, { useState as o, useRef as l, useCallback as i, useEffect as a, createContext as s, useContext as c, forwardRef as d, useImperativeHandle as u, useMemo as p, useLayoutEffect as h, memo as g, useReducer as v } from "react";
|
|
1884
1907
|
|
|
1885
1908
|
// node_modules/react-resizable-panels/dist/react-resizable-panels.js
|
|
1886
1909
|
import { jsx as ie } from "react/jsx-runtime";
|
|
@@ -3025,6 +3048,11 @@ function $e(e) {
|
|
|
3025
3048
|
});
|
|
3026
3049
|
return;
|
|
3027
3050
|
}
|
|
3051
|
+
for (const o of t.hitRegions)
|
|
3052
|
+
if (o.separator) {
|
|
3053
|
+
const { element: i } = o.separator;
|
|
3054
|
+
i.hasPointerCapture?.(e.pointerId) || i.setPointerCapture?.(e.pointerId);
|
|
3055
|
+
}
|
|
3028
3056
|
st({
|
|
3029
3057
|
document: e.currentTarget,
|
|
3030
3058
|
event: e,
|
|
@@ -3702,92 +3730,194 @@ function Zt({
|
|
|
3702
3730
|
Zt.displayName = "Separator";
|
|
3703
3731
|
|
|
3704
3732
|
// node_modules/@principal-ade/panels/dist/index.esm.js
|
|
3705
|
-
import {
|
|
3706
|
-
import { useTheme as
|
|
3707
|
-
function
|
|
3733
|
+
import { unstable_batchedUpdates as y, createPortal as w } from "react-dom";
|
|
3734
|
+
import { useTheme as x } from "@principal-ade/industry-theme";
|
|
3735
|
+
function C(e2) {
|
|
3708
3736
|
return { "--panel-background": e2.colors.background, "--panel-border": e2.colors.border, "--panel-handle": e2.colors.backgroundSecondary, "--panel-handle-hover": e2.colors.backgroundHover, "--panel-handle-active": e2.colors.primary, "--panel-button-bg": e2.colors.surface, "--panel-button-hover": e2.colors.backgroundHover, "--panel-button-border": e2.colors.border, "--panel-button-icon": e2.colors.textSecondary, "--panel-accent-bg": e2.colors.primary + "15" };
|
|
3709
3737
|
}
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3738
|
+
function N(e2) {
|
|
3739
|
+
return { "--tab-list-bg": e2.colors.backgroundSecondary, "--tab-border": e2.colors.border, "--tab-bg": e2.colors.surface, "--tab-bg-hover": e2.colors.backgroundHover, "--tab-bg-active": e2.colors.primary, "--tab-text": e2.colors.textSecondary, "--tab-text-hover": e2.colors.text, "--tab-text-active": e2.colors.background, "--tab-icon-color": e2.colors.textTertiary, "--tab-icon-active": e2.colors.background, "--tab-border-hover": e2.colors.textSecondary, "--tab-border-active": e2.colors.primary, "--tab-focus": e2.colors.primary, "--tab-content-bg": e2.colors.background, "--tab-empty-text": e2.colors.textMuted, "--tab-font-family": e2.fonts.body, "--tab-font-size": "11px", "--tab-font-weight": String(e2.fontWeights.medium), "--mobile-tab-text-active": e2.colors.primary, "--mobile-tab-icon-active": e2.colors.primary };
|
|
3740
|
+
}
|
|
3741
|
+
var D2 = ({ primaryContent: t2, secondaryContent: n2, collapsedHeader: r2, collapsed: o2 = true, onCollapsedChange: l2, ratio: i2 = 0.3, onRatioChange: a2, maxRatio: s2 = 0.8, collapsedHeight: c2 = 28, hideHeader: d2 = false, theme: u2, className: p2 = "", style: h2, animationDuration: g2 = 200, onCollapseStart: v2, onCollapseComplete: m, onExpandStart: f, onExpandComplete: b }) => {
|
|
3742
|
+
const y2 = C(u2);
|
|
3743
|
+
return n2 ? /* @__PURE__ */ e(R, { primaryContent: t2, secondaryContent: n2, collapsedHeader: r2 ?? { title: "Content" }, collapsed: o2, onCollapsedChange: l2 ?? (() => {}), ratio: i2, onRatioChange: a2 ?? (() => {}), maxRatio: s2, collapsedHeight: c2, hideHeader: d2, theme: u2, className: p2, style: h2, animationDuration: g2, onCollapseStart: v2, onCollapseComplete: m, onExpandStart: f, onExpandComplete: b }) : /* @__PURE__ */ e("div", { className: `collapsible-split-pane ${p2}`, style: { ...y2, ...h2 }, children: /* @__PURE__ */ e("div", { className: "csp-primary-content-full", children: t2 }) });
|
|
3713
3744
|
};
|
|
3714
|
-
var
|
|
3715
|
-
const [
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
}, [c2]),
|
|
3745
|
+
var R = ({ primaryContent: n2, secondaryContent: r2, collapsedHeader: s2, collapsed: c2, onCollapsedChange: d2, ratio: u2, onRatioChange: p2, maxRatio: h2 = 0.8, collapsedHeight: g2 = 28, hideHeader: v2 = false, theme: y2, className: w2 = "", style: x2, animationDuration: N2 = 200, onCollapseStart: S, onCollapseComplete: E, onExpandStart: D3, onExpandComplete: R2 }) => {
|
|
3746
|
+
const [z, k] = o(false), [L2, M] = o(false), P = l(null), A2 = l(undefined), T2 = l(undefined), $2 = l(u2), B2 = l(false), O = l(c2), F = (e2) => 100 * e2;
|
|
3747
|
+
a(() => {
|
|
3748
|
+
O.current = c2;
|
|
3749
|
+
}, [c2]), a(() => {
|
|
3719
3750
|
!c2 && u2 > 0 && ($2.current = u2);
|
|
3720
3751
|
}, [c2, u2]);
|
|
3721
|
-
const
|
|
3722
|
-
if (!
|
|
3752
|
+
const I2 = i((e2, t2, n3) => {
|
|
3753
|
+
if (!P.current)
|
|
3723
3754
|
return;
|
|
3724
|
-
|
|
3755
|
+
A2.current && cancelAnimationFrame(A2.current), T2.current = performance.now();
|
|
3725
3756
|
const r3 = (o2) => {
|
|
3726
|
-
if (!
|
|
3757
|
+
if (!T2.current || !P.current)
|
|
3727
3758
|
return;
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3759
|
+
const l2 = o2 - T2.current, i2 = Math.min(l2 / N2, 1), a2 = i2 < 0.5 ? 4 * i2 * i2 * i2 : 1 - Math.pow(-2 * i2 + 2, 3) / 2, s3 = e2 + (t2 - e2) * a2;
|
|
3760
|
+
P.current.resize(`${s3}%`), i2 < 1 ? A2.current = requestAnimationFrame(r3) : (P.current.resize(`${t2}%`), n3 && n3(), B2.current = false, k(false));
|
|
3730
3761
|
};
|
|
3731
|
-
|
|
3732
|
-
}, [
|
|
3733
|
-
if (
|
|
3762
|
+
A2.current = requestAnimationFrame(r3);
|
|
3763
|
+
}, [N2]), H = i(() => {
|
|
3764
|
+
if (z || L2 || !P.current)
|
|
3734
3765
|
return;
|
|
3735
|
-
u2 > 0 && ($2.current = u2),
|
|
3736
|
-
const e2 =
|
|
3737
|
-
|
|
3738
|
-
|
|
3766
|
+
u2 > 0 && ($2.current = u2), B2.current = true, k(true), S?.();
|
|
3767
|
+
const e2 = F(u2);
|
|
3768
|
+
I2(e2, 0, () => {
|
|
3769
|
+
O.current = true, d2(true), E?.();
|
|
3739
3770
|
});
|
|
3740
|
-
}, [
|
|
3741
|
-
if (
|
|
3771
|
+
}, [z, L2, u2, I2, d2, S, E]), W2 = i(() => {
|
|
3772
|
+
if (z || L2 || !P.current)
|
|
3742
3773
|
return;
|
|
3743
|
-
|
|
3744
|
-
const e2 = $2.current || u2 || 0.3, t2 =
|
|
3745
|
-
|
|
3746
|
-
|
|
3774
|
+
B2.current = true, k(true), D3?.();
|
|
3775
|
+
const e2 = $2.current || u2 || 0.3, t2 = F(e2);
|
|
3776
|
+
I2(0, t2, () => {
|
|
3777
|
+
O.current = false, d2(false), p2(e2), R2?.();
|
|
3747
3778
|
});
|
|
3748
|
-
}, [
|
|
3749
|
-
c2 ?
|
|
3750
|
-
}, [c2,
|
|
3751
|
-
if (
|
|
3779
|
+
}, [z, L2, u2, I2, d2, p2, D3, R2]), j2 = i(() => {
|
|
3780
|
+
c2 ? W2() : H();
|
|
3781
|
+
}, [c2, H, W2]), K2 = i((e2) => {
|
|
3782
|
+
if (B2.current)
|
|
3752
3783
|
return;
|
|
3753
3784
|
const t2 = e2.asPercentage / 100;
|
|
3754
|
-
t2 <= 0.01 && !
|
|
3755
|
-
}, [p2, d2]),
|
|
3756
|
-
|
|
3757
|
-
}, [
|
|
3758
|
-
|
|
3785
|
+
t2 <= 0.01 && !O.current ? ($2.current = 0.4, O.current = true, d2(true)) : t2 > 0.01 && O.current && (O.current = false, d2(false)), O.current || p2(t2);
|
|
3786
|
+
}, [p2, d2]), q2 = i(() => {
|
|
3787
|
+
z || M(true);
|
|
3788
|
+
}, [z]), U2 = i(() => {
|
|
3789
|
+
M(false);
|
|
3759
3790
|
}, []);
|
|
3760
|
-
|
|
3761
|
-
if (c2 && !
|
|
3762
|
-
|
|
3763
|
-
} else if (!c2 && !
|
|
3764
|
-
|
|
3791
|
+
a(() => {
|
|
3792
|
+
if (c2 && !z && P.current) {
|
|
3793
|
+
P.current.getSize().asPercentage > 0 && H();
|
|
3794
|
+
} else if (!c2 && !z && P.current) {
|
|
3795
|
+
P.current.getSize().asPercentage === 0 && W2();
|
|
3765
3796
|
}
|
|
3766
|
-
}, [c2]),
|
|
3767
|
-
|
|
3797
|
+
}, [c2]), a(() => () => {
|
|
3798
|
+
A2.current && cancelAnimationFrame(A2.current);
|
|
3768
3799
|
}, []);
|
|
3769
|
-
const
|
|
3770
|
-
return t("div", { className: `collapsible-split-pane ${
|
|
3771
|
-
/* @__PURE__ */ t("div", { className: "csp-header " + (c2 ? "csp-header-collapsed" : ""), style: { height:
|
|
3772
|
-
e2.key !== "Enter" && e2.key !== " " || (e2.preventDefault(),
|
|
3800
|
+
const X2 = C(y2), Y2 = ["csp-secondary-panel", z && !L2 ? "csp-animating" : "", c2 ? "csp-collapsed" : ""].filter(Boolean).join(" ");
|
|
3801
|
+
return t("div", { className: `collapsible-split-pane ${w2}`, style: { ...X2, ...x2 }, children: [
|
|
3802
|
+
!v2 && /* @__PURE__ */ t("div", { className: "csp-header " + (c2 ? "csp-header-collapsed" : ""), style: { height: g2, backgroundColor: y2.colors.backgroundSecondary, borderBottom: `1px solid ${y2.colors.border}` }, onClick: c2 ? j2 : undefined, role: c2 ? "button" : undefined, tabIndex: c2 ? 0 : undefined, onKeyDown: c2 ? (e2) => {
|
|
3803
|
+
e2.key !== "Enter" && e2.key !== " " || (e2.preventDefault(), j2());
|
|
3773
3804
|
} : undefined, "aria-expanded": !c2, "aria-label": c2 ? `Expand ${s2.title}` : s2.title, children: [
|
|
3774
|
-
s2.icon && /* @__PURE__ */ e("span", { className: "csp-header-icon", style: { color:
|
|
3775
|
-
/* @__PURE__ */ e("span", { className: "csp-header-title", style: { color:
|
|
3776
|
-
/* @__PURE__ */ e("button", { className: "csp-header-toggle", style: { color:
|
|
3777
|
-
e2.stopPropagation(),
|
|
3805
|
+
s2.icon && /* @__PURE__ */ e("span", { className: "csp-header-icon", style: { color: y2.colors.textSecondary }, children: s2.icon }),
|
|
3806
|
+
/* @__PURE__ */ e("span", { className: "csp-header-title", style: { color: y2.colors.text, fontFamily: y2.fonts.body, fontSize: y2.fontSizes[1], fontWeight: y2.fontWeights.medium }, children: s2.title }),
|
|
3807
|
+
/* @__PURE__ */ e("button", { className: "csp-header-toggle", style: { color: y2.colors.textSecondary }, onClick: (e2) => {
|
|
3808
|
+
e2.stopPropagation(), j2();
|
|
3778
3809
|
}, "aria-label": c2 ? `Expand ${s2.title}` : `Collapse ${s2.title}`, children: /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ e("path", { d: c2 ? "M3 5L6 8L9 5" : "M3 7L6 4L9 7" }) }) })
|
|
3779
3810
|
] }),
|
|
3780
|
-
/* @__PURE__ */ e("div", { className: "csp-content-area", children: /* @__PURE__ */ t(Ut, { orientation: "vertical", onLayoutChange:
|
|
3781
|
-
/* @__PURE__ */ e(qt, { panelRef:
|
|
3811
|
+
/* @__PURE__ */ e("div", { className: "csp-content-area", children: /* @__PURE__ */ t(Ut, { orientation: "vertical", onLayoutChange: q2, onLayoutChanged: U2, children: [
|
|
3812
|
+
/* @__PURE__ */ e(qt, { panelRef: P, defaultSize: c2 ? "0%" : `${F(u2)}%`, minSize: "0%", maxSize: `${F(h2)}%`, onResize: K2, className: Y2, children: /* @__PURE__ */ e("div", { className: "csp-secondary-body", children: r2 }) }),
|
|
3782
3813
|
/* @__PURE__ */ e(Zt, { className: "csp-resize-handle", children: /* @__PURE__ */ e("div", { className: "csp-resize-handle-bar" }) }),
|
|
3783
3814
|
/* @__PURE__ */ e(qt, { className: "csp-primary-panel", minSize: "20%", children: /* @__PURE__ */ e("div", { className: "csp-panel-content", children: n2 }) })
|
|
3784
3815
|
] }) })
|
|
3785
3816
|
] });
|
|
3786
3817
|
};
|
|
3787
|
-
var
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3818
|
+
var z = ({ panelIds: r2, panels: l2, config: i2 = {}, className: s2 = "", theme: c2 }) => {
|
|
3819
|
+
const { defaultActiveTab: d2 = 0, tabPosition: u2 = "top", centered: p2 = true, hideTabList: h2 = false, activeTabIndex: g2, onTabChange: v2 } = i2, [m, f] = o(d2), b = g2 !== undefined, y2 = b ? g2 : m;
|
|
3820
|
+
a(() => {
|
|
3821
|
+
b || f(d2);
|
|
3822
|
+
}, [d2, b]);
|
|
3823
|
+
const w2 = N(c2), x2 = r2.map((e2) => l2.find((t2) => t2.id === e2)).filter((e2) => e2 !== undefined), C2 = Math.min(y2, x2.length - 1), S = x2[C2];
|
|
3824
|
+
if (x2.length === 0)
|
|
3825
|
+
return e("div", { className: "tab-group-empty", children: "No panels available" });
|
|
3826
|
+
const E = /* @__PURE__ */ e("div", { className: "tab-list " + (u2 === "top" || u2 === "bottom" || p2 ? "centered" : ""), role: "tablist", children: x2.map((r3, o2) => /* @__PURE__ */ e("button", { role: "tab", "aria-selected": o2 === C2, "aria-controls": `tabpanel-${r3.id}`, id: `tab-${r3.id}`, className: "tab-button " + (o2 === C2 ? "active" : ""), onClick: () => ((e2) => {
|
|
3827
|
+
b || f(e2), v2?.(e2);
|
|
3828
|
+
})(o2), title: r3.icon ? r3.label : undefined, children: r3.icon ? /* @__PURE__ */ t(n, { children: [
|
|
3829
|
+
/* @__PURE__ */ e("span", { className: "tab-icon", children: r3.icon }),
|
|
3830
|
+
/* @__PURE__ */ e("span", { className: "tab-label", children: r3.label })
|
|
3831
|
+
] }) : r3.label }, r3.id)) }), D3 = S ? /* @__PURE__ */ e("div", { className: "tab-content", role: "tabpanel", id: `tabpanel-${S.id}`, "aria-labelledby": `tab-${S.id}`, children: S.content }) : null;
|
|
3832
|
+
return t("div", { className: `tab-group tab-position-${u2} ${s2}`, style: w2, children: [!h2 && (u2 === "top" || u2 === "left") && E, D3, !h2 && (u2 === "bottom" || u2 === "right") && E] });
|
|
3833
|
+
};
|
|
3834
|
+
var k = { x: 0, y: 0, width: 0, height: 0 };
|
|
3835
|
+
var L2 = s(null);
|
|
3836
|
+
var M = ({ slot: t2, children: n2 }) => {
|
|
3837
|
+
const r2 = l(null), [s2, c2] = o(k), d2 = i(() => {
|
|
3838
|
+
if (r2.current) {
|
|
3839
|
+
const e2 = r2.current.getBoundingClientRect();
|
|
3840
|
+
c2({ x: e2.left, y: e2.top, width: e2.width, height: e2.height });
|
|
3841
|
+
}
|
|
3842
|
+
}, []);
|
|
3843
|
+
a(() => {
|
|
3844
|
+
const e2 = r2.current;
|
|
3845
|
+
if (!e2)
|
|
3846
|
+
return;
|
|
3847
|
+
d2();
|
|
3848
|
+
const t3 = new ResizeObserver(() => {
|
|
3849
|
+
d2();
|
|
3850
|
+
});
|
|
3851
|
+
return t3.observe(e2), window.addEventListener("resize", d2), window.addEventListener("scroll", d2, true), () => {
|
|
3852
|
+
t3.disconnect(), window.removeEventListener("resize", d2), window.removeEventListener("scroll", d2, true);
|
|
3853
|
+
};
|
|
3854
|
+
}, [d2]);
|
|
3855
|
+
const u2 = { slot: t2, bounds: s2 };
|
|
3856
|
+
return e(L2.Provider, { value: u2, children: /* @__PURE__ */ e("div", { ref: r2, className: "panel-bounds-container", style: { width: "100%", height: "100%", minWidth: 0 }, children: n2 }) });
|
|
3857
|
+
};
|
|
3858
|
+
var T2 = d(({ panels: n2, layout: r2, slotDataAttributes: a2 = {}, collapsiblePanels: s2 = { left: true, middle: false, right: true }, defaultSizes: c2 = { left: 20, middle: 60, right: 20 }, className: d2 = "", collapsed: p2 = { left: false, middle: false, right: false }, style: h2, showCollapseButtons: g2 = false, animationDuration: v2 = 300, animationEasing: y2 = "cubic-bezier(0.4, 0, 0.2, 1)", theme: w2, onLeftCollapseStart: x2, onLeftCollapseComplete: N2, onLeftExpandStart: S, onLeftExpandComplete: E, onMiddleCollapseStart: D3, onMiddleCollapseComplete: R2, onMiddleExpandStart: k2, onMiddleExpandComplete: L3, onRightCollapseStart: P, onRightCollapseComplete: A2, onRightExpandStart: T3, onRightExpandComplete: $2, onPanelResize: B2 }, O) => {
|
|
3859
|
+
const F = r2.left !== null && r2.left !== undefined, I2 = r2.middle !== null && r2.middle !== undefined, H = r2.right !== null && r2.right !== undefined, W2 = [F, I2, H].filter(Boolean).length, j2 = { left: F ? c2?.left ?? (W2 === 2 ? 50 : W2 === 3 ? 20 : 100) : 0, middle: I2 ? c2?.middle ?? (W2 === 2 ? 50 : W2 === 3 ? 60 : 100) : 0, right: H ? c2?.right ?? (W2 === 2 ? 50 : W2 === 3 ? 20 : 100) : 0 }, [K2, q2] = o(p2.left || !F), [U2, X2] = o(p2.middle || !I2), [Y2, V2] = o(p2.right || !H), [J2, G2] = o(false), _2 = i((e2) => {
|
|
3860
|
+
if (!e2)
|
|
3861
|
+
return null;
|
|
3862
|
+
const t2 = n2.find((t3) => t3.id === e2);
|
|
3863
|
+
return t2?.content || null;
|
|
3864
|
+
}, [n2]), Q2 = i((t2) => {
|
|
3865
|
+
if (t2 === null)
|
|
3866
|
+
return null;
|
|
3867
|
+
if (typeof t2 == "object" && "type" in t2) {
|
|
3868
|
+
const r3 = t2;
|
|
3869
|
+
return r3.type === "tabs" ? /* @__PURE__ */ e(z, { panelIds: r3.panels, panels: n2, config: r3.config, theme: w2 }) : null;
|
|
3870
|
+
}
|
|
3871
|
+
return _2(t2);
|
|
3872
|
+
}, [n2, _2, w2]), Z2 = Q2(r2.left ?? null), ee = Q2(r2.middle ?? null), te2 = Q2(r2.right ?? null), [ne2, re2] = o(p2.left || !F ? 0 : j2.left), [oe2, le] = o(p2.middle || !I2 ? 0 : j2.middle), [ie2, ae] = o(p2.right || !H ? 0 : j2.right), [se2, ce2] = o(j2.left), [de2, ue2] = o(j2.middle), [pe, he2] = o(j2.right), ge2 = l(null), ve2 = l(null), me = l(null), fe2 = l(null);
|
|
3873
|
+
u(O, () => ({ setLayout: (e2) => {
|
|
3874
|
+
ge2.current && ge2.current.setLayout(e2);
|
|
3875
|
+
}, getLayout: () => ({ left: ne2, middle: oe2, right: ie2 }) }), [ne2, oe2, ie2]);
|
|
3876
|
+
const be2 = i(() => {
|
|
3877
|
+
!J2 && s2.left && (x2?.(), ve2.current?.collapse(), q2(true), N2?.());
|
|
3878
|
+
}, [J2, s2.left, x2, N2]), ye2 = i(() => {
|
|
3879
|
+
!J2 && s2.left && (S?.(), ve2.current?.expand(), q2(false), E?.());
|
|
3880
|
+
}, [J2, s2.left, S, E]), we2 = i(() => {
|
|
3881
|
+
!J2 && s2.right && (P?.(), fe2.current?.collapse(), V2(true), A2?.());
|
|
3882
|
+
}, [J2, s2.right, P, A2]), xe2 = i(() => {
|
|
3883
|
+
!J2 && s2.right && (T3?.(), fe2.current?.expand(), V2(false), $2?.());
|
|
3884
|
+
}, [J2, s2.right, T3, $2]), Ce = i(() => {
|
|
3885
|
+
K2 ? ye2() : be2();
|
|
3886
|
+
}, [K2, be2, ye2]), Ne2 = i(() => {
|
|
3887
|
+
Y2 ? xe2() : we2();
|
|
3888
|
+
}, [Y2, we2, xe2]), Se2 = i((e2) => {
|
|
3889
|
+
const t2 = e2.asPercentage;
|
|
3890
|
+
re2(t2), t2 > 0 ? (ce2(t2), q2(false)) : q2(true);
|
|
3891
|
+
}, []), Ee2 = i((e2) => {
|
|
3892
|
+
const t2 = e2.asPercentage;
|
|
3893
|
+
le(t2), t2 > 0 ? (ue2(t2), X2(false)) : X2(true);
|
|
3894
|
+
}, []), De2 = i((e2) => {
|
|
3895
|
+
const t2 = e2.asPercentage;
|
|
3896
|
+
ae(t2), t2 > 0 ? (he2(t2), V2(false)) : V2(true);
|
|
3897
|
+
}, []), Re = i(() => {
|
|
3898
|
+
if (B2) {
|
|
3899
|
+
B2({ left: K2 ? se2 : ne2, middle: U2 ? de2 : oe2, right: Y2 ? pe : ie2 });
|
|
3900
|
+
}
|
|
3901
|
+
}, [ne2, oe2, ie2, K2, U2, Y2, se2, de2, pe, B2]), ze2 = i(() => {
|
|
3902
|
+
G2(true);
|
|
3903
|
+
}, []), ke2 = i(() => {
|
|
3904
|
+
G2(false), Re();
|
|
3905
|
+
}, [Re]), Le2 = (e2) => {
|
|
3906
|
+
let t2 = "three-panel-item";
|
|
3907
|
+
return e2 === "left" ? !s2.left && F || (t2 += " collapsible-panel", K2 && (t2 += " collapsed")) : e2 === "middle" ? (t2 += " middle-panel", !s2.middle && I2 || (t2 += " collapsible-panel", U2 && (t2 += " collapsed"))) : e2 === "right" && (!s2.right && H || (t2 += " collapsible-panel", Y2 && (t2 += " collapsed"))), t2;
|
|
3908
|
+
}, Me2 = C(w2);
|
|
3909
|
+
return e("div", { className: `three-panel-layout ${d2} ${J2 ? "is-dragging" : ""}`, style: { ...Me2, ...h2, "--panel-transition-duration": `${v2}ms`, "--panel-transition-easing": y2 }, children: /* @__PURE__ */ t(Ut, { groupRef: ge2, orientation: "horizontal", onLayoutChange: ze2, onLayoutChanged: ke2, children: [
|
|
3910
|
+
/* @__PURE__ */ e(qt, { id: "left", panelRef: ve2, collapsible: s2.left || !F, defaultSize: p2.left || !F ? "0%" : `${j2.left}%`, minSize: "0%", collapsedSize: "0%", onResize: Se2, className: Le2("left"), ...a2.left || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: K2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "left", children: Z2 }) }) }),
|
|
3911
|
+
/* @__PURE__ */ e(Zt, { className: "resize-handle left-handle " + (!K2 && F && I2 ? "" : "collapsed"), disabled: K2 || !F || !I2, children: g2 && s2.left && /* @__PURE__ */ e("div", { className: "handle-bar", children: /* @__PURE__ */ e("button", { onClick: Ce, className: "collapse-toggle", "aria-label": K2 ? "Expand left panel" : "Collapse left panel", children: K2 ? "▸" : "◂" }) }) }),
|
|
3912
|
+
/* @__PURE__ */ e(qt, { id: "middle", panelRef: me, collapsible: s2.middle || !I2, defaultSize: p2.middle || !I2 ? "0%" : `${j2.middle}%`, minSize: "0%", collapsedSize: "0%", onResize: Ee2, className: Le2("middle"), ...a2.middle || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: U2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "middle", children: ee }) }) }),
|
|
3913
|
+
/* @__PURE__ */ e(Zt, { className: "resize-handle right-handle " + (Y2 || !H || !I2 && !F ? "collapsed" : ""), disabled: Y2 || !H || !I2 && !F, children: g2 && s2.right && /* @__PURE__ */ e("div", { className: "handle-bar", children: /* @__PURE__ */ e("button", { onClick: Ne2, className: "collapse-toggle", "aria-label": Y2 ? "Expand right panel" : "Collapse right panel", children: Y2 ? "◂" : "▸" }) }) }),
|
|
3914
|
+
/* @__PURE__ */ e(qt, { id: "right", panelRef: fe2, collapsible: s2.right || !H, defaultSize: p2.right || !H ? "0%" : `${j2.right}%`, minSize: "0%", collapsedSize: "0%", onResize: De2, className: Le2("right"), ...a2.right || {}, children: /* @__PURE__ */ e("div", { className: "panel-content-wrapper", style: { opacity: Y2 ? 0 : 1 }, children: /* @__PURE__ */ e(M, { slot: "right", children: te2 }) }) })
|
|
3915
|
+
] }) });
|
|
3916
|
+
});
|
|
3917
|
+
T2.displayName = "ConfigurablePanelLayout";
|
|
3918
|
+
var $2 = d(({ panels: o2, className: i2 = "", style: s2, theme: c2, minPanelWidth: d2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: g2, preventKeyboardScroll: v2 = true, disableSwipe: m = false }, f) => {
|
|
3919
|
+
const b = l(null), y2 = l(false), w2 = l(null), x2 = C(c2);
|
|
3920
|
+
u(f, () => ({ scrollToPanel: (e2) => {
|
|
3791
3921
|
if (!b.current)
|
|
3792
3922
|
return;
|
|
3793
3923
|
const t2 = b.current, n2 = t2.children[e2];
|
|
@@ -3804,13 +3934,13 @@ var F = d(({ panels: o2, className: a2 = "", style: s2, theme: c2, minPanelWidth
|
|
|
3804
3934
|
const e2 = b.current, t2 = e2.getBoundingClientRect().left;
|
|
3805
3935
|
let n2 = 0, r2 = 1 / 0;
|
|
3806
3936
|
for (let o3 = 0;o3 < e2.children.length; o3++) {
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3937
|
+
const l2 = e2.children[o3].getBoundingClientRect(), i3 = Math.abs(l2.left - t2);
|
|
3938
|
+
i3 < r2 && (r2 = i3, n2 = o3);
|
|
3809
3939
|
}
|
|
3810
3940
|
return n2;
|
|
3811
3941
|
} }));
|
|
3812
|
-
|
|
3813
|
-
if (!
|
|
3942
|
+
a(() => {
|
|
3943
|
+
if (!v2 || !b.current)
|
|
3814
3944
|
return;
|
|
3815
3945
|
const e2 = b.current, t2 = (e3) => {
|
|
3816
3946
|
const t3 = e3.target;
|
|
@@ -3821,92 +3951,138 @@ var F = d(({ panels: o2, className: a2 = "", style: s2, theme: c2, minPanelWidth
|
|
|
3821
3951
|
return e2.addEventListener("keydown", t2), () => {
|
|
3822
3952
|
e2.removeEventListener("keydown", t2);
|
|
3823
3953
|
};
|
|
3824
|
-
}, [
|
|
3954
|
+
}, [v2]), a(() => () => {
|
|
3825
3955
|
w2.current && clearTimeout(w2.current);
|
|
3826
3956
|
}, []);
|
|
3827
|
-
const
|
|
3828
|
-
let
|
|
3829
|
-
|
|
3830
|
-
const
|
|
3957
|
+
const N2 = o2.length, S = 2 * d2;
|
|
3958
|
+
let E;
|
|
3959
|
+
E = N2 === 1 || N2 === 2 ? "100%" : `max(${d2}px, ${100 * p2}%)`;
|
|
3960
|
+
const D3 = r.useId().replace(/:/g, "_");
|
|
3831
3961
|
return t(n, { children: [
|
|
3832
|
-
|
|
3833
|
-
.snap-carousel-container[data-carousel-id="${
|
|
3962
|
+
N2 === 2 && /* @__PURE__ */ e("style", { children: `
|
|
3963
|
+
.snap-carousel-container[data-carousel-id="${D3}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3834
3964
|
width: 100%;
|
|
3835
3965
|
}
|
|
3836
|
-
@container (min-width: ${
|
|
3837
|
-
.snap-carousel-container[data-carousel-id="${
|
|
3966
|
+
@container (min-width: ${S}px) {
|
|
3967
|
+
.snap-carousel-container[data-carousel-id="${D3}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3838
3968
|
width: 50%;
|
|
3839
3969
|
}
|
|
3840
3970
|
}
|
|
3841
3971
|
` }),
|
|
3842
|
-
/* @__PURE__ */ e("div", { ref: b, className: `snap-carousel-container ${
|
|
3843
|
-
if (!
|
|
3972
|
+
/* @__PURE__ */ e("div", { ref: b, className: `snap-carousel-container ${m ? "swipe-disabled" : ""} ${i2}`, style: { ...x2, ...s2, "--snap-carousel-min-width": `${d2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": E, "--snap-carousel-panel-count": N2, "--snap-carousel-two-panel-threshold": `${S}px` }, onScroll: (e2) => {
|
|
3973
|
+
if (!g2 || !b.current || b.current.children.length === 0)
|
|
3844
3974
|
return;
|
|
3845
3975
|
if (y2.current)
|
|
3846
3976
|
return;
|
|
3847
3977
|
const t2 = b.current, n2 = t2.getBoundingClientRect().left;
|
|
3848
3978
|
let r2 = 0, o3 = 1 / 0;
|
|
3849
|
-
for (let
|
|
3850
|
-
const e3 = t2.children[
|
|
3851
|
-
|
|
3979
|
+
for (let l2 = 0;l2 < t2.children.length; l2++) {
|
|
3980
|
+
const e3 = t2.children[l2].getBoundingClientRect(), i3 = Math.abs(e3.left - n2);
|
|
3981
|
+
i3 < o3 && (o3 = i3, r2 = l2);
|
|
3852
3982
|
}
|
|
3853
|
-
|
|
3854
|
-
}, "data-panel-count":
|
|
3983
|
+
g2(r2);
|
|
3984
|
+
}, "data-panel-count": N2, "data-carousel-id": D3, children: o2.map((t2, n2) => /* @__PURE__ */ e("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
3855
3985
|
] });
|
|
3856
3986
|
});
|
|
3857
|
-
|
|
3858
|
-
var
|
|
3859
|
-
function
|
|
3987
|
+
$2.displayName = "SnapCarousel";
|
|
3988
|
+
var F = typeof window != "undefined" && window.document !== undefined && window.document.createElement !== undefined;
|
|
3989
|
+
function I2(e2) {
|
|
3860
3990
|
const t2 = Object.prototype.toString.call(e2);
|
|
3861
3991
|
return t2 === "[object Window]" || t2 === "[object global]";
|
|
3862
3992
|
}
|
|
3863
|
-
function
|
|
3993
|
+
function H(e2) {
|
|
3864
3994
|
return "nodeType" in e2;
|
|
3865
3995
|
}
|
|
3866
|
-
function
|
|
3996
|
+
function W2(e2) {
|
|
3867
3997
|
var t2, n2;
|
|
3868
|
-
return e2 ?
|
|
3998
|
+
return e2 ? I2(e2) ? e2 : H(e2) && (t2 = (n2 = e2.ownerDocument) == null ? undefined : n2.defaultView) != null ? t2 : window : window;
|
|
3869
3999
|
}
|
|
3870
4000
|
function j2(e2) {
|
|
3871
|
-
const { Document: t2 } =
|
|
4001
|
+
const { Document: t2 } = W2(e2);
|
|
3872
4002
|
return e2 instanceof t2;
|
|
3873
4003
|
}
|
|
3874
4004
|
function K2(e2) {
|
|
3875
|
-
return !
|
|
4005
|
+
return !I2(e2) && e2 instanceof W2(e2).HTMLElement;
|
|
4006
|
+
}
|
|
4007
|
+
function q2(e2) {
|
|
4008
|
+
return e2 instanceof W2(e2).SVGElement;
|
|
3876
4009
|
}
|
|
3877
4010
|
function U2(e2) {
|
|
3878
|
-
return e2
|
|
4011
|
+
return e2 ? I2(e2) ? e2.document : H(e2) ? j2(e2) ? e2 : K2(e2) || q2(e2) ? e2.ownerDocument : document : document : document;
|
|
3879
4012
|
}
|
|
3880
|
-
|
|
3881
|
-
|
|
4013
|
+
var X2 = F ? h : a;
|
|
4014
|
+
function Y2(e2) {
|
|
4015
|
+
const t2 = l(e2);
|
|
4016
|
+
return X2(() => {
|
|
4017
|
+
t2.current = e2;
|
|
4018
|
+
}), i(function() {
|
|
4019
|
+
for (var e3 = arguments.length, n2 = new Array(e3), r2 = 0;r2 < e3; r2++)
|
|
4020
|
+
n2[r2] = arguments[r2];
|
|
4021
|
+
return t2.current == null ? undefined : t2.current(...n2);
|
|
4022
|
+
}, []);
|
|
4023
|
+
}
|
|
4024
|
+
function V2(e2, t2) {
|
|
4025
|
+
t2 === undefined && (t2 = [e2]);
|
|
4026
|
+
const n2 = l(e2);
|
|
4027
|
+
return X2(() => {
|
|
4028
|
+
n2.current !== e2 && (n2.current = e2);
|
|
4029
|
+
}, t2), n2;
|
|
4030
|
+
}
|
|
4031
|
+
function J2(e2, t2) {
|
|
4032
|
+
const n2 = l();
|
|
4033
|
+
return p(() => {
|
|
4034
|
+
const t3 = e2(n2.current);
|
|
4035
|
+
return n2.current = t3, t3;
|
|
4036
|
+
}, [...t2]);
|
|
4037
|
+
}
|
|
4038
|
+
function G2(e2) {
|
|
4039
|
+
const t2 = Y2(e2), n2 = l(null), r2 = i((e3) => {
|
|
4040
|
+
e3 !== n2.current && (t2 == null || t2(e3, n2.current)), n2.current = e3;
|
|
4041
|
+
}, []);
|
|
4042
|
+
return [n2, r2];
|
|
4043
|
+
}
|
|
4044
|
+
function _2(e2) {
|
|
4045
|
+
const t2 = l();
|
|
4046
|
+
return a(() => {
|
|
4047
|
+
t2.current = e2;
|
|
4048
|
+
}, [e2]), t2.current;
|
|
3882
4049
|
}
|
|
3883
|
-
|
|
4050
|
+
var Q2 = {};
|
|
4051
|
+
function Z2(e2, t2) {
|
|
4052
|
+
return p(() => {
|
|
4053
|
+
if (t2)
|
|
4054
|
+
return t2;
|
|
4055
|
+
const n2 = Q2[e2] == null ? 0 : Q2[e2] + 1;
|
|
4056
|
+
return Q2[e2] = n2, e2 + "-" + n2;
|
|
4057
|
+
}, [e2, t2]);
|
|
4058
|
+
}
|
|
4059
|
+
function ee(e2) {
|
|
3884
4060
|
return function(t2) {
|
|
3885
4061
|
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
|
|
3886
4062
|
r2[o2 - 1] = arguments[o2];
|
|
3887
4063
|
return r2.reduce((t3, n3) => {
|
|
3888
4064
|
const r3 = Object.entries(n3);
|
|
3889
|
-
for (const [o3,
|
|
4065
|
+
for (const [o3, l2] of r3) {
|
|
3890
4066
|
const n4 = t3[o3];
|
|
3891
|
-
n4 != null && (t3[o3] = n4 + e2 *
|
|
4067
|
+
n4 != null && (t3[o3] = n4 + e2 * l2);
|
|
3892
4068
|
}
|
|
3893
4069
|
return t3;
|
|
3894
4070
|
}, { ...t2 });
|
|
3895
4071
|
};
|
|
3896
4072
|
}
|
|
3897
|
-
var
|
|
3898
|
-
var
|
|
3899
|
-
function
|
|
4073
|
+
var te2 = /* @__PURE__ */ ee(1);
|
|
4074
|
+
var ne2 = /* @__PURE__ */ ee(-1);
|
|
4075
|
+
function re2(e2) {
|
|
3900
4076
|
if (!e2)
|
|
3901
4077
|
return false;
|
|
3902
|
-
const { KeyboardEvent: t2 } =
|
|
4078
|
+
const { KeyboardEvent: t2 } = W2(e2.target);
|
|
3903
4079
|
return t2 && e2 instanceof t2;
|
|
3904
4080
|
}
|
|
3905
|
-
function
|
|
4081
|
+
function oe2(e2) {
|
|
3906
4082
|
if (function(e3) {
|
|
3907
4083
|
if (!e3)
|
|
3908
4084
|
return false;
|
|
3909
|
-
const { TouchEvent: t2 } =
|
|
4085
|
+
const { TouchEvent: t2 } = W2(e3.target);
|
|
3910
4086
|
return t2 && e3 instanceof t2;
|
|
3911
4087
|
}(e2)) {
|
|
3912
4088
|
if (e2.touches && e2.touches.length) {
|
|
@@ -3922,16 +4098,143 @@ function ie2(e2) {
|
|
|
3922
4098
|
return "clientX" in e3 && "clientY" in e3;
|
|
3923
4099
|
}(e2) ? { x: e2.clientX, y: e2.clientY } : null;
|
|
3924
4100
|
}
|
|
3925
|
-
var
|
|
4101
|
+
var le = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
|
|
4102
|
+
function ie2(e2) {
|
|
4103
|
+
return e2.matches(le) ? e2 : e2.querySelector(le);
|
|
4104
|
+
}
|
|
4105
|
+
var ae = { display: "none" };
|
|
4106
|
+
function se2(e2) {
|
|
4107
|
+
let { id: t2, value: n2 } = e2;
|
|
4108
|
+
return r.createElement("div", { id: t2, style: ae }, n2);
|
|
4109
|
+
}
|
|
4110
|
+
function ce2(e2) {
|
|
4111
|
+
let { id: t2, announcement: n2, ariaLiveType: o2 = "assertive" } = e2;
|
|
4112
|
+
return r.createElement("div", { id: t2, style: { position: "fixed", top: 0, left: 0, width: 1, height: 1, margin: -1, border: 0, padding: 0, overflow: "hidden", clip: "rect(0 0 0 0)", clipPath: "inset(100%)", whiteSpace: "nowrap" }, role: "status", "aria-live": o2, "aria-atomic": true }, n2);
|
|
4113
|
+
}
|
|
4114
|
+
var de2 = /* @__PURE__ */ s(null);
|
|
4115
|
+
var ue2 = { draggable: `
|
|
4116
|
+
To pick up a draggable item, press the space bar.
|
|
4117
|
+
While dragging, use the arrow keys to move the item.
|
|
4118
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
4119
|
+
` };
|
|
4120
|
+
var pe = { onDragStart(e2) {
|
|
4121
|
+
let { active: t2 } = e2;
|
|
4122
|
+
return "Picked up draggable item " + t2.id + ".";
|
|
4123
|
+
}, onDragOver(e2) {
|
|
4124
|
+
let { active: t2, over: n2 } = e2;
|
|
4125
|
+
return n2 ? "Draggable item " + t2.id + " was moved over droppable area " + n2.id + "." : "Draggable item " + t2.id + " is no longer over a droppable area.";
|
|
4126
|
+
}, onDragEnd(e2) {
|
|
4127
|
+
let { active: t2, over: n2 } = e2;
|
|
4128
|
+
return n2 ? "Draggable item " + t2.id + " was dropped over droppable area " + n2.id : "Draggable item " + t2.id + " was dropped.";
|
|
4129
|
+
}, onDragCancel(e2) {
|
|
4130
|
+
let { active: t2 } = e2;
|
|
4131
|
+
return "Dragging was cancelled. Draggable item " + t2.id + " was dropped.";
|
|
4132
|
+
} };
|
|
4133
|
+
function he2(e2) {
|
|
4134
|
+
let { announcements: t2 = pe, container: n2, hiddenTextDescribedById: l2, screenReaderInstructions: s2 = ue2 } = e2;
|
|
4135
|
+
const { announce: d2, announcement: u2 } = function() {
|
|
4136
|
+
const [e3, t3] = o("");
|
|
4137
|
+
return { announce: i((e4) => {
|
|
4138
|
+
e4 != null && t3(e4);
|
|
4139
|
+
}, []), announcement: e3 };
|
|
4140
|
+
}(), h2 = Z2("DndLiveRegion"), [g2, v2] = o(false);
|
|
4141
|
+
if (a(() => {
|
|
4142
|
+
v2(true);
|
|
4143
|
+
}, []), function(e3) {
|
|
4144
|
+
const t3 = c(de2);
|
|
4145
|
+
a(() => {
|
|
4146
|
+
if (!t3)
|
|
4147
|
+
throw new Error("useDndMonitor must be used within a children of <DndContext>");
|
|
4148
|
+
return t3(e3);
|
|
4149
|
+
}, [e3, t3]);
|
|
4150
|
+
}(p(() => ({ onDragStart(e3) {
|
|
4151
|
+
let { active: n3 } = e3;
|
|
4152
|
+
d2(t2.onDragStart({ active: n3 }));
|
|
4153
|
+
}, onDragMove(e3) {
|
|
4154
|
+
let { active: n3, over: r2 } = e3;
|
|
4155
|
+
t2.onDragMove && d2(t2.onDragMove({ active: n3, over: r2 }));
|
|
4156
|
+
}, onDragOver(e3) {
|
|
4157
|
+
let { active: n3, over: r2 } = e3;
|
|
4158
|
+
d2(t2.onDragOver({ active: n3, over: r2 }));
|
|
4159
|
+
}, onDragEnd(e3) {
|
|
4160
|
+
let { active: n3, over: r2 } = e3;
|
|
4161
|
+
d2(t2.onDragEnd({ active: n3, over: r2 }));
|
|
4162
|
+
}, onDragCancel(e3) {
|
|
4163
|
+
let { active: n3, over: r2 } = e3;
|
|
4164
|
+
d2(t2.onDragCancel({ active: n3, over: r2 }));
|
|
4165
|
+
} }), [d2, t2])), !g2)
|
|
4166
|
+
return null;
|
|
4167
|
+
const m = r.createElement(r.Fragment, null, r.createElement(se2, { id: l2, value: s2.draggable }), r.createElement(ce2, { id: h2, announcement: u2 }));
|
|
4168
|
+
return n2 ? w(m, n2) : m;
|
|
4169
|
+
}
|
|
3926
4170
|
var ge2;
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
4171
|
+
var ve2;
|
|
4172
|
+
function me() {}
|
|
4173
|
+
(ve2 = ge2 || (ge2 = {})).DragStart = "dragStart", ve2.DragMove = "dragMove", ve2.DragEnd = "dragEnd", ve2.DragCancel = "dragCancel", ve2.DragOver = "dragOver", ve2.RegisterDroppable = "registerDroppable", ve2.SetDroppableDisabled = "setDroppableDisabled", ve2.UnregisterDroppable = "unregisterDroppable";
|
|
4174
|
+
var fe2 = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
4175
|
+
function be2(e2, t2) {
|
|
4176
|
+
return Math.sqrt(Math.pow(e2.x - t2.x, 2) + Math.pow(e2.y - t2.y, 2));
|
|
4177
|
+
}
|
|
4178
|
+
function ye2(e2, t2) {
|
|
4179
|
+
let { data: { value: n2 } } = e2, { data: { value: r2 } } = t2;
|
|
4180
|
+
return n2 - r2;
|
|
4181
|
+
}
|
|
4182
|
+
function we2(e2, t2) {
|
|
4183
|
+
let { data: { value: n2 } } = e2, { data: { value: r2 } } = t2;
|
|
4184
|
+
return r2 - n2;
|
|
4185
|
+
}
|
|
4186
|
+
function xe2(e2, t2, n2) {
|
|
4187
|
+
return t2 === undefined && (t2 = e2.left), n2 === undefined && (n2 = e2.top), { x: t2 + 0.5 * e2.width, y: n2 + 0.5 * e2.height };
|
|
4188
|
+
}
|
|
4189
|
+
var Ce = (e2) => {
|
|
4190
|
+
let { collisionRect: t2, droppableRects: n2, droppableContainers: r2 } = e2;
|
|
4191
|
+
const o2 = xe2(t2, t2.left, t2.top), l2 = [];
|
|
4192
|
+
for (const i2 of r2) {
|
|
4193
|
+
const { id: e3 } = i2, t3 = n2.get(e3);
|
|
4194
|
+
if (t3) {
|
|
4195
|
+
const n3 = be2(xe2(t3), o2);
|
|
4196
|
+
l2.push({ id: e3, data: { droppableContainer: i2, value: n3 } });
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
return l2.sort(ye2);
|
|
4200
|
+
};
|
|
4201
|
+
function Ne2(e2, t2) {
|
|
4202
|
+
const n2 = Math.max(t2.top, e2.top), r2 = Math.max(t2.left, e2.left), o2 = Math.min(t2.left + t2.width, e2.left + e2.width), l2 = Math.min(t2.top + t2.height, e2.top + e2.height), i2 = o2 - r2, a2 = l2 - n2;
|
|
4203
|
+
if (r2 < o2 && n2 < l2) {
|
|
4204
|
+
const n3 = t2.width * t2.height, r3 = e2.width * e2.height, o3 = i2 * a2;
|
|
4205
|
+
return Number((o3 / (n3 + r3 - o3)).toFixed(4));
|
|
4206
|
+
}
|
|
4207
|
+
return 0;
|
|
4208
|
+
}
|
|
4209
|
+
var Se2 = (e2) => {
|
|
4210
|
+
let { collisionRect: t2, droppableRects: n2, droppableContainers: r2 } = e2;
|
|
4211
|
+
const o2 = [];
|
|
4212
|
+
for (const l2 of r2) {
|
|
4213
|
+
const { id: e3 } = l2, r3 = n2.get(e3);
|
|
4214
|
+
if (r3) {
|
|
4215
|
+
const n3 = Ne2(r3, t2);
|
|
4216
|
+
n3 > 0 && o2.push({ id: e3, data: { droppableContainer: l2, value: n3 } });
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
return o2.sort(we2);
|
|
4220
|
+
};
|
|
4221
|
+
function Ee2(e2, t2) {
|
|
4222
|
+
return e2 && t2 ? { x: e2.left - t2.left, y: e2.top - t2.top } : fe2;
|
|
4223
|
+
}
|
|
4224
|
+
function De2(e2) {
|
|
4225
|
+
return function(t2) {
|
|
4226
|
+
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
|
|
4227
|
+
r2[o2 - 1] = arguments[o2];
|
|
4228
|
+
return r2.reduce((t3, n3) => ({ ...t3, top: t3.top + e2 * n3.y, bottom: t3.bottom + e2 * n3.y, left: t3.left + e2 * n3.x, right: t3.right + e2 * n3.x }), { ...t2 });
|
|
4229
|
+
};
|
|
4230
|
+
}
|
|
4231
|
+
var Re = /* @__PURE__ */ De2(1);
|
|
4232
|
+
var ze2 = { ignoreTransform: false };
|
|
4233
|
+
function ke2(e2, t2) {
|
|
4234
|
+
t2 === undefined && (t2 = ze2);
|
|
3932
4235
|
let n2 = e2.getBoundingClientRect();
|
|
3933
4236
|
if (t2.ignoreTransform) {
|
|
3934
|
-
const { transform: t3, transformOrigin: r3 } =
|
|
4237
|
+
const { transform: t3, transformOrigin: r3 } = W2(e2).getComputedStyle(e2);
|
|
3935
4238
|
t3 && (n2 = function(e3, t4, n3) {
|
|
3936
4239
|
const r4 = function(e4) {
|
|
3937
4240
|
if (e4.startsWith("matrix3d(")) {
|
|
@@ -3946,17 +4249,17 @@ function Te2(e2, t2) {
|
|
|
3946
4249
|
}(t4);
|
|
3947
4250
|
if (!r4)
|
|
3948
4251
|
return e3;
|
|
3949
|
-
const { scaleX: o3, scaleY:
|
|
4252
|
+
const { scaleX: o3, scaleY: l3, x: i3, y: a3 } = r4, s3 = e3.left - i3 - (1 - o3) * parseFloat(n3), c2 = e3.top - a3 - (1 - l3) * parseFloat(n3.slice(n3.indexOf(" ") + 1)), d2 = o3 ? e3.width / o3 : e3.width, u2 = l3 ? e3.height / l3 : e3.height;
|
|
3950
4253
|
return { width: d2, height: u2, top: c2, right: s3 + d2, bottom: c2 + u2, left: s3 };
|
|
3951
4254
|
}(n2, t3, r3));
|
|
3952
4255
|
}
|
|
3953
|
-
const { top: r2, left: o2, width:
|
|
3954
|
-
return { top: r2, left: o2, width:
|
|
4256
|
+
const { top: r2, left: o2, width: l2, height: i2, bottom: a2, right: s2 } = n2;
|
|
4257
|
+
return { top: r2, left: o2, width: l2, height: i2, bottom: a2, right: s2 };
|
|
3955
4258
|
}
|
|
3956
|
-
function
|
|
3957
|
-
return
|
|
4259
|
+
function Le2(e2) {
|
|
4260
|
+
return ke2(e2, { ignoreTransform: true });
|
|
3958
4261
|
}
|
|
3959
|
-
function
|
|
4262
|
+
function Me2(e2, t2) {
|
|
3960
4263
|
const n2 = [];
|
|
3961
4264
|
return e2 ? function r(o2) {
|
|
3962
4265
|
if (t2 != null && n2.length >= t2)
|
|
@@ -3965,37 +4268,56 @@ function ke2(e2, t2) {
|
|
|
3965
4268
|
return n2;
|
|
3966
4269
|
if (j2(o2) && o2.scrollingElement != null && !n2.includes(o2.scrollingElement))
|
|
3967
4270
|
return n2.push(o2.scrollingElement), n2;
|
|
3968
|
-
if (!K2(o2) ||
|
|
4271
|
+
if (!K2(o2) || q2(o2))
|
|
3969
4272
|
return n2;
|
|
3970
4273
|
if (n2.includes(o2))
|
|
3971
4274
|
return n2;
|
|
3972
|
-
const
|
|
4275
|
+
const l2 = W2(e2).getComputedStyle(o2);
|
|
3973
4276
|
return o2 !== e2 && function(e3, t3) {
|
|
3974
|
-
t3 === undefined && (t3 =
|
|
4277
|
+
t3 === undefined && (t3 = W2(e3).getComputedStyle(e3));
|
|
3975
4278
|
const n3 = /(auto|scroll|overlay)/;
|
|
3976
4279
|
return ["overflow", "overflowX", "overflowY"].some((e4) => {
|
|
3977
4280
|
const r2 = t3[e4];
|
|
3978
4281
|
return typeof r2 == "string" && n3.test(r2);
|
|
3979
4282
|
});
|
|
3980
|
-
}(o2,
|
|
3981
|
-
return t3 === undefined && (t3 =
|
|
3982
|
-
}(o2,
|
|
4283
|
+
}(o2, l2) && n2.push(o2), function(e3, t3) {
|
|
4284
|
+
return t3 === undefined && (t3 = W2(e3).getComputedStyle(e3)), t3.position === "fixed";
|
|
4285
|
+
}(o2, l2) ? n2 : r(o2.parentNode);
|
|
3983
4286
|
}(e2) : n2;
|
|
3984
4287
|
}
|
|
3985
|
-
function
|
|
3986
|
-
const [t2] =
|
|
4288
|
+
function Pe2(e2) {
|
|
4289
|
+
const [t2] = Me2(e2, 1);
|
|
3987
4290
|
return t2 != null ? t2 : null;
|
|
3988
4291
|
}
|
|
4292
|
+
function Ae2(e2) {
|
|
4293
|
+
return F && e2 ? I2(e2) ? e2 : H(e2) ? j2(e2) || e2 === U2(e2).scrollingElement ? window : K2(e2) ? e2 : null : null : null;
|
|
4294
|
+
}
|
|
4295
|
+
function Te2(e2) {
|
|
4296
|
+
return I2(e2) ? e2.scrollX : e2.scrollLeft;
|
|
4297
|
+
}
|
|
4298
|
+
function $e2(e2) {
|
|
4299
|
+
return I2(e2) ? e2.scrollY : e2.scrollTop;
|
|
4300
|
+
}
|
|
4301
|
+
function Be2(e2) {
|
|
4302
|
+
return { x: Te2(e2), y: $e2(e2) };
|
|
4303
|
+
}
|
|
3989
4304
|
var Oe2;
|
|
3990
|
-
var
|
|
3991
|
-
function
|
|
3992
|
-
return !(!
|
|
4305
|
+
var Fe2;
|
|
4306
|
+
function Ie2(e2) {
|
|
4307
|
+
return !(!F || !e2) && e2 === document.scrollingElement;
|
|
3993
4308
|
}
|
|
3994
|
-
function
|
|
3995
|
-
const t2 = { x: 0, y: 0 }, n2 =
|
|
4309
|
+
function He2(e2) {
|
|
4310
|
+
const t2 = { x: 0, y: 0 }, n2 = Ie2(e2) ? { height: window.innerHeight, width: window.innerWidth } : { height: e2.clientHeight, width: e2.clientWidth }, r2 = { x: e2.scrollWidth - n2.width, y: e2.scrollHeight - n2.height };
|
|
3996
4311
|
return { isTop: e2.scrollTop <= t2.y, isLeft: e2.scrollLeft <= t2.x, isBottom: e2.scrollTop >= r2.y, isRight: e2.scrollLeft >= r2.x, maxScroll: r2, minScroll: t2 };
|
|
3997
4312
|
}
|
|
3998
|
-
(
|
|
4313
|
+
(Fe2 = Oe2 || (Oe2 = {}))[Fe2.Forward = 1] = "Forward", Fe2[Fe2.Backward = -1] = "Backward";
|
|
4314
|
+
var We2 = { x: 0.2, y: 0.2 };
|
|
4315
|
+
function je2(e2, t2, n2, r2, o2) {
|
|
4316
|
+
let { top: l2, left: i2, right: a2, bottom: s2 } = n2;
|
|
4317
|
+
r2 === undefined && (r2 = 10), o2 === undefined && (o2 = We2);
|
|
4318
|
+
const { isTop: c2, isBottom: d2, isLeft: u2, isRight: p2 } = He2(e2), h2 = { x: 0, y: 0 }, g2 = { x: 0, y: 0 }, v2 = t2.height * o2.y, m = t2.width * o2.x;
|
|
4319
|
+
return !c2 && l2 <= t2.top + v2 ? (h2.y = Oe2.Backward, g2.y = r2 * Math.abs((t2.top + v2 - l2) / v2)) : !d2 && s2 >= t2.bottom - v2 && (h2.y = Oe2.Forward, g2.y = r2 * Math.abs((t2.bottom - v2 - s2) / v2)), !p2 && a2 >= t2.right - m ? (h2.x = Oe2.Forward, g2.x = r2 * Math.abs((t2.right - m - a2) / m)) : !u2 && i2 <= t2.left + m && (h2.x = Oe2.Backward, g2.x = r2 * Math.abs((t2.left + m - i2) / m)), { direction: h2, speed: g2 };
|
|
4320
|
+
}
|
|
3999
4321
|
function Ke2(e2) {
|
|
4000
4322
|
if (e2 === document.scrollingElement) {
|
|
4001
4323
|
const { innerWidth: e3, innerHeight: t3 } = window;
|
|
@@ -4004,7 +4326,31 @@ function Ke2(e2) {
|
|
|
4004
4326
|
const { top: t2, left: n2, right: r2, bottom: o2 } = e2.getBoundingClientRect();
|
|
4005
4327
|
return { top: t2, left: n2, right: r2, bottom: o2, width: e2.clientWidth, height: e2.clientHeight };
|
|
4006
4328
|
}
|
|
4007
|
-
|
|
4329
|
+
function qe2(e2) {
|
|
4330
|
+
return e2.reduce((e3, t2) => te2(e3, Be2(t2)), fe2);
|
|
4331
|
+
}
|
|
4332
|
+
var Ue2 = [["x", ["left", "right"], function(e2) {
|
|
4333
|
+
return e2.reduce((e3, t2) => e3 + Te2(t2), 0);
|
|
4334
|
+
}], ["y", ["top", "bottom"], function(e2) {
|
|
4335
|
+
return e2.reduce((e3, t2) => e3 + $e2(t2), 0);
|
|
4336
|
+
}]];
|
|
4337
|
+
|
|
4338
|
+
class Xe2 {
|
|
4339
|
+
constructor(e2, t2) {
|
|
4340
|
+
this.rect = undefined, this.width = undefined, this.height = undefined, this.top = undefined, this.bottom = undefined, this.right = undefined, this.left = undefined;
|
|
4341
|
+
const n2 = Me2(t2), r2 = qe2(n2);
|
|
4342
|
+
this.rect = { ...e2 }, this.width = e2.width, this.height = e2.height;
|
|
4343
|
+
for (const [o2, l2, i2] of Ue2)
|
|
4344
|
+
for (const e3 of l2)
|
|
4345
|
+
Object.defineProperty(this, e3, { get: () => {
|
|
4346
|
+
const t3 = i2(n2), l3 = r2[o2] - t3;
|
|
4347
|
+
return this.rect[e3] + l3;
|
|
4348
|
+
}, enumerable: true });
|
|
4349
|
+
Object.defineProperty(this, "rect", { enumerable: false });
|
|
4350
|
+
}
|
|
4351
|
+
}
|
|
4352
|
+
|
|
4353
|
+
class Ye2 {
|
|
4008
4354
|
constructor(e2) {
|
|
4009
4355
|
this.target = undefined, this.listeners = [], this.removeAll = () => {
|
|
4010
4356
|
this.listeners.forEach((e3) => {
|
|
@@ -4018,84 +4364,84 @@ class Ve2 {
|
|
|
4018
4364
|
(r2 = this.target) == null || r2.addEventListener(e2, t2, n2), this.listeners.push([e2, t2, n2]);
|
|
4019
4365
|
}
|
|
4020
4366
|
}
|
|
4021
|
-
function
|
|
4367
|
+
function Ve2(e2, t2) {
|
|
4022
4368
|
const n2 = Math.abs(e2.x), r2 = Math.abs(e2.y);
|
|
4023
4369
|
return typeof t2 == "number" ? Math.sqrt(n2 ** 2 + r2 ** 2) > t2 : ("x" in t2) && ("y" in t2) ? n2 > t2.x && r2 > t2.y : ("x" in t2) ? n2 > t2.x : ("y" in t2) && r2 > t2.y;
|
|
4024
4370
|
}
|
|
4371
|
+
var Je2;
|
|
4025
4372
|
var Ge2;
|
|
4026
4373
|
var _e2;
|
|
4027
4374
|
var Qe2;
|
|
4028
|
-
|
|
4029
|
-
function et2(e2) {
|
|
4375
|
+
function Ze2(e2) {
|
|
4030
4376
|
e2.preventDefault();
|
|
4031
4377
|
}
|
|
4032
|
-
function
|
|
4378
|
+
function et2(e2) {
|
|
4033
4379
|
e2.stopPropagation();
|
|
4034
4380
|
}
|
|
4035
|
-
(
|
|
4036
|
-
var
|
|
4037
|
-
var
|
|
4381
|
+
(Ge2 = Je2 || (Je2 = {})).Click = "click", Ge2.DragStart = "dragstart", Ge2.Keydown = "keydown", Ge2.ContextMenu = "contextmenu", Ge2.Resize = "resize", Ge2.SelectionChange = "selectionchange", Ge2.VisibilityChange = "visibilitychange", (Qe2 = _e2 || (_e2 = {})).Space = "Space", Qe2.Down = "ArrowDown", Qe2.Right = "ArrowRight", Qe2.Left = "ArrowLeft", Qe2.Up = "ArrowUp", Qe2.Esc = "Escape", Qe2.Enter = "Enter", Qe2.Tab = "Tab";
|
|
4382
|
+
var tt2 = { start: [_e2.Space, _e2.Enter], cancel: [_e2.Esc], end: [_e2.Space, _e2.Enter, _e2.Tab] };
|
|
4383
|
+
var nt2 = (e2, t2) => {
|
|
4038
4384
|
let { currentCoordinates: n2 } = t2;
|
|
4039
4385
|
switch (e2.code) {
|
|
4040
|
-
case
|
|
4386
|
+
case _e2.Right:
|
|
4041
4387
|
return { ...n2, x: n2.x + 25 };
|
|
4042
|
-
case
|
|
4388
|
+
case _e2.Left:
|
|
4043
4389
|
return { ...n2, x: n2.x - 25 };
|
|
4044
|
-
case
|
|
4390
|
+
case _e2.Down:
|
|
4045
4391
|
return { ...n2, y: n2.y + 25 };
|
|
4046
|
-
case
|
|
4392
|
+
case _e2.Up:
|
|
4047
4393
|
return { ...n2, y: n2.y - 25 };
|
|
4048
4394
|
}
|
|
4049
4395
|
};
|
|
4050
4396
|
|
|
4051
|
-
class
|
|
4397
|
+
class rt2 {
|
|
4052
4398
|
constructor(e2) {
|
|
4053
4399
|
this.props = undefined, this.autoScrollEnabled = false, this.referenceCoordinates = undefined, this.listeners = undefined, this.windowListeners = undefined, this.props = e2;
|
|
4054
4400
|
const { event: { target: t2 } } = e2;
|
|
4055
|
-
this.props = e2, this.listeners = new
|
|
4401
|
+
this.props = e2, this.listeners = new Ye2(U2(t2)), this.windowListeners = new Ye2(W2(t2)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
4056
4402
|
}
|
|
4057
4403
|
attach() {
|
|
4058
|
-
this.handleStart(), this.windowListeners.add(
|
|
4404
|
+
this.handleStart(), this.windowListeners.add(Je2.Resize, this.handleCancel), this.windowListeners.add(Je2.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Je2.Keydown, this.handleKeyDown));
|
|
4059
4405
|
}
|
|
4060
4406
|
handleStart() {
|
|
4061
4407
|
const { activeNode: e2, onStart: t2 } = this.props, n2 = e2.node.current;
|
|
4062
4408
|
n2 && function(e3, t3) {
|
|
4063
|
-
if (t3 === undefined && (t3 =
|
|
4409
|
+
if (t3 === undefined && (t3 = ke2), !e3)
|
|
4064
4410
|
return;
|
|
4065
|
-
const { top: n3, left: r2, bottom: o2, right:
|
|
4066
|
-
|
|
4067
|
-
}(n2), t2(
|
|
4411
|
+
const { top: n3, left: r2, bottom: o2, right: l2 } = t3(e3);
|
|
4412
|
+
Pe2(e3) && (o2 <= 0 || l2 <= 0 || n3 >= window.innerHeight || r2 >= window.innerWidth) && e3.scrollIntoView({ block: "center", inline: "center" });
|
|
4413
|
+
}(n2), t2(fe2);
|
|
4068
4414
|
}
|
|
4069
4415
|
handleKeyDown(e2) {
|
|
4070
|
-
if (
|
|
4071
|
-
const { active: t2, context: n2, options: r2 } = this.props, { keyboardCodes: o2 =
|
|
4072
|
-
if (o2.end.includes(
|
|
4416
|
+
if (re2(e2)) {
|
|
4417
|
+
const { active: t2, context: n2, options: r2 } = this.props, { keyboardCodes: o2 = tt2, coordinateGetter: l2 = nt2, scrollBehavior: i2 = "smooth" } = r2, { code: a2 } = e2;
|
|
4418
|
+
if (o2.end.includes(a2))
|
|
4073
4419
|
return void this.handleEnd(e2);
|
|
4074
|
-
if (o2.cancel.includes(
|
|
4420
|
+
if (o2.cancel.includes(a2))
|
|
4075
4421
|
return void this.handleCancel(e2);
|
|
4076
|
-
const { collisionRect: s2 } = n2.current, c2 = s2 ? { x: s2.left, y: s2.top } :
|
|
4422
|
+
const { collisionRect: s2 } = n2.current, c2 = s2 ? { x: s2.left, y: s2.top } : fe2;
|
|
4077
4423
|
this.referenceCoordinates || (this.referenceCoordinates = c2);
|
|
4078
|
-
const d2 =
|
|
4424
|
+
const d2 = l2(e2, { active: t2, context: n2.current, currentCoordinates: c2 });
|
|
4079
4425
|
if (d2) {
|
|
4080
|
-
const t3 =
|
|
4426
|
+
const t3 = ne2(d2, c2), r3 = { x: 0, y: 0 }, { scrollableAncestors: o3 } = n2.current;
|
|
4081
4427
|
for (const n3 of o3) {
|
|
4082
|
-
const o4 = e2.code, { isTop:
|
|
4083
|
-
if (
|
|
4084
|
-
const e3 = n3.scrollLeft + t3.x,
|
|
4085
|
-
if (
|
|
4086
|
-
return void n3.scrollTo({ left: e3, behavior:
|
|
4087
|
-
r3.x =
|
|
4428
|
+
const o4 = e2.code, { isTop: l3, isRight: a3, isLeft: s3, isBottom: c3, maxScroll: u2, minScroll: p2 } = He2(n3), h2 = Ke2(n3), g2 = { x: Math.min(o4 === _e2.Right ? h2.right - h2.width / 2 : h2.right, Math.max(o4 === _e2.Right ? h2.left : h2.left + h2.width / 2, d2.x)), y: Math.min(o4 === _e2.Down ? h2.bottom - h2.height / 2 : h2.bottom, Math.max(o4 === _e2.Down ? h2.top : h2.top + h2.height / 2, d2.y)) }, v2 = o4 === _e2.Right && !a3 || o4 === _e2.Left && !s3, m = o4 === _e2.Down && !c3 || o4 === _e2.Up && !l3;
|
|
4429
|
+
if (v2 && g2.x !== d2.x) {
|
|
4430
|
+
const e3 = n3.scrollLeft + t3.x, l4 = o4 === _e2.Right && e3 <= u2.x || o4 === _e2.Left && e3 >= p2.x;
|
|
4431
|
+
if (l4 && !t3.y)
|
|
4432
|
+
return void n3.scrollTo({ left: e3, behavior: i2 });
|
|
4433
|
+
r3.x = l4 ? n3.scrollLeft - e3 : o4 === _e2.Right ? n3.scrollLeft - u2.x : n3.scrollLeft - p2.x, r3.x && n3.scrollBy({ left: -r3.x, behavior: i2 });
|
|
4088
4434
|
break;
|
|
4089
4435
|
}
|
|
4090
|
-
if (
|
|
4091
|
-
const e3 = n3.scrollTop + t3.y,
|
|
4092
|
-
if (
|
|
4093
|
-
return void n3.scrollTo({ top: e3, behavior:
|
|
4094
|
-
r3.y =
|
|
4436
|
+
if (m && g2.y !== d2.y) {
|
|
4437
|
+
const e3 = n3.scrollTop + t3.y, l4 = o4 === _e2.Down && e3 <= u2.y || o4 === _e2.Up && e3 >= p2.y;
|
|
4438
|
+
if (l4 && !t3.x)
|
|
4439
|
+
return void n3.scrollTo({ top: e3, behavior: i2 });
|
|
4440
|
+
r3.y = l4 ? n3.scrollTop - e3 : o4 === _e2.Down ? n3.scrollTop - u2.y : n3.scrollTop - p2.y, r3.y && n3.scrollBy({ top: -r3.y, behavior: i2 });
|
|
4095
4441
|
break;
|
|
4096
4442
|
}
|
|
4097
4443
|
}
|
|
4098
|
-
this.handleMove(e2, ne2(
|
|
4444
|
+
this.handleMove(e2, te2(ne2(d2, this.referenceCoordinates), r3));
|
|
4099
4445
|
}
|
|
4100
4446
|
}
|
|
4101
4447
|
}
|
|
@@ -4115,40 +4461,40 @@ class ot2 {
|
|
|
4115
4461
|
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
4116
4462
|
}
|
|
4117
4463
|
}
|
|
4118
|
-
function
|
|
4464
|
+
function ot2(e2) {
|
|
4119
4465
|
return Boolean(e2 && "distance" in e2);
|
|
4120
4466
|
}
|
|
4121
|
-
function
|
|
4467
|
+
function lt(e2) {
|
|
4122
4468
|
return Boolean(e2 && "delay" in e2);
|
|
4123
4469
|
}
|
|
4124
|
-
|
|
4125
|
-
let { keyboardCodes: r2 =
|
|
4126
|
-
const { code:
|
|
4127
|
-
if (r2.start.includes(
|
|
4128
|
-
const t3 =
|
|
4470
|
+
rt2.activators = [{ eventName: "onKeyDown", handler: (e2, t2, n2) => {
|
|
4471
|
+
let { keyboardCodes: r2 = tt2, onActivation: o2 } = t2, { active: l2 } = n2;
|
|
4472
|
+
const { code: i2 } = e2.nativeEvent;
|
|
4473
|
+
if (r2.start.includes(i2)) {
|
|
4474
|
+
const t3 = l2.activatorNode.current;
|
|
4129
4475
|
return (!t3 || e2.target === t3) && (e2.preventDefault(), o2 == null || o2({ event: e2.nativeEvent }), true);
|
|
4130
4476
|
}
|
|
4131
4477
|
return false;
|
|
4132
4478
|
} }];
|
|
4133
4479
|
|
|
4134
|
-
class
|
|
4480
|
+
class it2 {
|
|
4135
4481
|
constructor(e2, t2, n2) {
|
|
4136
4482
|
var r2;
|
|
4137
4483
|
n2 === undefined && (n2 = function(e3) {
|
|
4138
|
-
const { EventTarget: t3 } =
|
|
4139
|
-
return e3 instanceof t3 ? e3 :
|
|
4484
|
+
const { EventTarget: t3 } = W2(e3);
|
|
4485
|
+
return e3 instanceof t3 ? e3 : U2(e3);
|
|
4140
4486
|
}(e2.event.target)), this.props = undefined, this.events = undefined, this.autoScrollEnabled = true, this.document = undefined, this.activated = false, this.initialCoordinates = undefined, this.timeoutId = null, this.listeners = undefined, this.documentListeners = undefined, this.windowListeners = undefined, this.props = e2, this.events = t2;
|
|
4141
|
-
const { event: o2 } = e2, { target:
|
|
4142
|
-
this.props = e2, this.events = t2, this.document =
|
|
4487
|
+
const { event: o2 } = e2, { target: l2 } = o2;
|
|
4488
|
+
this.props = e2, this.events = t2, this.document = U2(l2), this.documentListeners = new Ye2(this.document), this.listeners = new Ye2(n2), this.windowListeners = new Ye2(W2(l2)), this.initialCoordinates = (r2 = oe2(o2)) != null ? r2 : fe2, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
|
|
4143
4489
|
}
|
|
4144
4490
|
attach() {
|
|
4145
4491
|
const { events: e2, props: { options: { activationConstraint: t2, bypassActivationConstraint: n2 } } } = this;
|
|
4146
|
-
if (this.listeners.add(e2.move.name, this.handleMove, { passive: false }), this.listeners.add(e2.end.name, this.handleEnd), e2.cancel && this.listeners.add(e2.cancel.name, this.handleCancel), this.windowListeners.add(
|
|
4492
|
+
if (this.listeners.add(e2.move.name, this.handleMove, { passive: false }), this.listeners.add(e2.end.name, this.handleEnd), e2.cancel && this.listeners.add(e2.cancel.name, this.handleCancel), this.windowListeners.add(Je2.Resize, this.handleCancel), this.windowListeners.add(Je2.DragStart, Ze2), this.windowListeners.add(Je2.VisibilityChange, this.handleCancel), this.windowListeners.add(Je2.ContextMenu, Ze2), this.documentListeners.add(Je2.Keydown, this.handleKeydown), t2) {
|
|
4147
4493
|
if (n2 != null && n2({ event: this.props.event, activeNode: this.props.activeNode, options: this.props.options }))
|
|
4148
4494
|
return this.handleStart();
|
|
4149
|
-
if (
|
|
4495
|
+
if (lt(t2))
|
|
4150
4496
|
return this.timeoutId = setTimeout(this.handleStart, t2.delay), void this.handlePending(t2);
|
|
4151
|
-
if (
|
|
4497
|
+
if (ot2(t2))
|
|
4152
4498
|
return void this.handlePending(t2);
|
|
4153
4499
|
}
|
|
4154
4500
|
this.handleStart();
|
|
@@ -4162,24 +4508,24 @@ class lt {
|
|
|
4162
4508
|
}
|
|
4163
4509
|
handleStart() {
|
|
4164
4510
|
const { initialCoordinates: e2 } = this, { onStart: t2 } = this.props;
|
|
4165
|
-
e2 && (this.activated = true, this.documentListeners.add(
|
|
4511
|
+
e2 && (this.activated = true, this.documentListeners.add(Je2.Click, et2, { capture: true }), this.removeTextSelection(), this.documentListeners.add(Je2.SelectionChange, this.removeTextSelection), t2(e2));
|
|
4166
4512
|
}
|
|
4167
4513
|
handleMove(e2) {
|
|
4168
4514
|
var t2;
|
|
4169
|
-
const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove:
|
|
4515
|
+
const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove: l2, options: { activationConstraint: i2 } } = o2;
|
|
4170
4516
|
if (!r2)
|
|
4171
4517
|
return;
|
|
4172
|
-
const
|
|
4173
|
-
if (!n2 &&
|
|
4174
|
-
if (
|
|
4175
|
-
if (
|
|
4518
|
+
const a2 = (t2 = oe2(e2)) != null ? t2 : fe2, s2 = ne2(r2, a2);
|
|
4519
|
+
if (!n2 && i2) {
|
|
4520
|
+
if (ot2(i2)) {
|
|
4521
|
+
if (i2.tolerance != null && Ve2(s2, i2.tolerance))
|
|
4176
4522
|
return this.handleCancel();
|
|
4177
|
-
if (
|
|
4523
|
+
if (Ve2(s2, i2.distance))
|
|
4178
4524
|
return this.handleStart();
|
|
4179
4525
|
}
|
|
4180
|
-
return
|
|
4526
|
+
return lt(i2) && Ve2(s2, i2.tolerance) ? this.handleCancel() : void this.handlePending(i2, s2);
|
|
4181
4527
|
}
|
|
4182
|
-
e2.cancelable && e2.preventDefault(),
|
|
4528
|
+
e2.cancelable && e2.preventDefault(), l2(a2);
|
|
4183
4529
|
}
|
|
4184
4530
|
handleEnd() {
|
|
4185
4531
|
const { onAbort: e2, onEnd: t2 } = this.props;
|
|
@@ -4190,49 +4536,100 @@ class lt {
|
|
|
4190
4536
|
this.detach(), this.activated || e2(this.props.active), t2();
|
|
4191
4537
|
}
|
|
4192
4538
|
handleKeydown(e2) {
|
|
4193
|
-
e2.code ===
|
|
4539
|
+
e2.code === _e2.Esc && this.handleCancel();
|
|
4194
4540
|
}
|
|
4195
4541
|
removeTextSelection() {
|
|
4196
4542
|
var e2;
|
|
4197
4543
|
(e2 = this.document.getSelection()) == null || e2.removeAllRanges();
|
|
4198
4544
|
}
|
|
4199
4545
|
}
|
|
4200
|
-
var
|
|
4546
|
+
var at2 = { cancel: { name: "pointercancel" }, move: { name: "pointermove" }, end: { name: "pointerup" } };
|
|
4201
4547
|
|
|
4202
|
-
class
|
|
4548
|
+
class st2 extends it2 {
|
|
4203
4549
|
constructor(e2) {
|
|
4204
|
-
const { event: t2 } = e2, n2 =
|
|
4205
|
-
super(e2,
|
|
4550
|
+
const { event: t2 } = e2, n2 = U2(t2.target);
|
|
4551
|
+
super(e2, at2, n2);
|
|
4206
4552
|
}
|
|
4207
4553
|
}
|
|
4208
|
-
|
|
4554
|
+
st2.activators = [{ eventName: "onPointerDown", handler: (e2, t2) => {
|
|
4209
4555
|
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4210
4556
|
return !(!n2.isPrimary || n2.button !== 0) && (r2 == null || r2({ event: n2 }), true);
|
|
4211
4557
|
} }];
|
|
4212
|
-
var
|
|
4558
|
+
var ct = { move: { name: "mousemove" }, end: { name: "mouseup" } };
|
|
4559
|
+
var dt;
|
|
4213
4560
|
var ut;
|
|
4214
|
-
|
|
4215
|
-
(
|
|
4216
|
-
(class extends lt {
|
|
4561
|
+
(ut = dt || (dt = {}))[ut.RightClick = 2] = "RightClick";
|
|
4562
|
+
(class extends it2 {
|
|
4217
4563
|
constructor(e2) {
|
|
4218
|
-
super(e2,
|
|
4564
|
+
super(e2, ct, U2(e2.event.target));
|
|
4219
4565
|
}
|
|
4220
4566
|
}).activators = [{ eventName: "onMouseDown", handler: (e2, t2) => {
|
|
4221
4567
|
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4222
|
-
return n2.button !==
|
|
4568
|
+
return n2.button !== dt.RightClick && (r2 == null || r2({ event: n2 }), true);
|
|
4223
4569
|
} }];
|
|
4224
|
-
var
|
|
4225
|
-
var
|
|
4226
|
-
var ft;
|
|
4570
|
+
var pt2 = { cancel: { name: "touchcancel" }, move: { name: "touchmove" }, end: { name: "touchend" } };
|
|
4571
|
+
var ht2;
|
|
4227
4572
|
var gt2;
|
|
4228
4573
|
var vt2;
|
|
4229
|
-
|
|
4574
|
+
var mt2;
|
|
4575
|
+
function ft(e2) {
|
|
4576
|
+
let { acceleration: t2, activator: n2 = ht2.Pointer, canScroll: r2, draggingRect: o2, enabled: s2, interval: c2 = 5, order: d2 = vt2.TreeOrder, pointerCoordinates: u2, scrollableAncestors: h2, scrollableAncestorRects: g2, delta: v2, threshold: m } = e2;
|
|
4577
|
+
const f = function(e3) {
|
|
4578
|
+
let { delta: t3, disabled: n3 } = e3;
|
|
4579
|
+
const r3 = _2(t3);
|
|
4580
|
+
return J2((e4) => {
|
|
4581
|
+
if (n3 || !r3 || !e4)
|
|
4582
|
+
return bt2;
|
|
4583
|
+
const o3 = { x: Math.sign(t3.x - r3.x), y: Math.sign(t3.y - r3.y) };
|
|
4584
|
+
return { x: { [Oe2.Backward]: e4.x[Oe2.Backward] || o3.x === -1, [Oe2.Forward]: e4.x[Oe2.Forward] || o3.x === 1 }, y: { [Oe2.Backward]: e4.y[Oe2.Backward] || o3.y === -1, [Oe2.Forward]: e4.y[Oe2.Forward] || o3.y === 1 } };
|
|
4585
|
+
}, [n3, t3, r3]);
|
|
4586
|
+
}({ delta: v2, disabled: !s2 }), [b, y2] = function() {
|
|
4587
|
+
const e3 = l(null);
|
|
4588
|
+
return [i((t3, n3) => {
|
|
4589
|
+
e3.current = setInterval(t3, n3);
|
|
4590
|
+
}, []), i(() => {
|
|
4591
|
+
e3.current !== null && (clearInterval(e3.current), e3.current = null);
|
|
4592
|
+
}, [])];
|
|
4593
|
+
}(), w2 = l({ x: 0, y: 0 }), x2 = l({ x: 0, y: 0 }), C2 = p(() => {
|
|
4594
|
+
switch (n2) {
|
|
4595
|
+
case ht2.Pointer:
|
|
4596
|
+
return u2 ? { top: u2.y, bottom: u2.y, left: u2.x, right: u2.x } : null;
|
|
4597
|
+
case ht2.DraggableRect:
|
|
4598
|
+
return o2;
|
|
4599
|
+
}
|
|
4600
|
+
}, [n2, o2, u2]), N2 = l(null), S = i(() => {
|
|
4601
|
+
const e3 = N2.current;
|
|
4602
|
+
if (!e3)
|
|
4603
|
+
return;
|
|
4604
|
+
const t3 = w2.current.x * x2.current.x, n3 = w2.current.y * x2.current.y;
|
|
4605
|
+
e3.scrollBy(t3, n3);
|
|
4606
|
+
}, []), E = p(() => d2 === vt2.TreeOrder ? [...h2].reverse() : h2, [d2, h2]);
|
|
4607
|
+
a(() => {
|
|
4608
|
+
if (s2 && h2.length && C2) {
|
|
4609
|
+
for (const e3 of E) {
|
|
4610
|
+
if ((r2 == null ? undefined : r2(e3)) === false)
|
|
4611
|
+
continue;
|
|
4612
|
+
const n3 = h2.indexOf(e3), o3 = g2[n3];
|
|
4613
|
+
if (!o3)
|
|
4614
|
+
continue;
|
|
4615
|
+
const { direction: l2, speed: i2 } = je2(e3, o3, C2, t2, m);
|
|
4616
|
+
for (const e4 of ["x", "y"])
|
|
4617
|
+
f[e4][l2[e4]] || (i2[e4] = 0, l2[e4] = 0);
|
|
4618
|
+
if (i2.x > 0 || i2.y > 0)
|
|
4619
|
+
return y2(), N2.current = e3, b(S, c2), w2.current = i2, void (x2.current = l2);
|
|
4620
|
+
}
|
|
4621
|
+
w2.current = { x: 0, y: 0 }, x2.current = { x: 0, y: 0 }, y2();
|
|
4622
|
+
} else
|
|
4623
|
+
y2();
|
|
4624
|
+
}, [t2, S, r2, y2, s2, c2, JSON.stringify(C2), JSON.stringify(f), b, h2, E, g2, JSON.stringify(m)]);
|
|
4625
|
+
}
|
|
4626
|
+
(class extends it2 {
|
|
4230
4627
|
constructor(e2) {
|
|
4231
|
-
super(e2,
|
|
4628
|
+
super(e2, pt2);
|
|
4232
4629
|
}
|
|
4233
4630
|
static setup() {
|
|
4234
|
-
return window.addEventListener(
|
|
4235
|
-
window.removeEventListener(
|
|
4631
|
+
return window.addEventListener(pt2.move.name, e2, { capture: false, passive: false }), function() {
|
|
4632
|
+
window.removeEventListener(pt2.move.name, e2);
|
|
4236
4633
|
};
|
|
4237
4634
|
function e2() {}
|
|
4238
4635
|
}
|
|
@@ -4240,20 +4637,562 @@ var vt2;
|
|
|
4240
4637
|
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4241
4638
|
const { touches: o2 } = n2;
|
|
4242
4639
|
return !(o2.length > 1) && (r2 == null || r2({ event: n2 }), true);
|
|
4243
|
-
} }], (
|
|
4244
|
-
var
|
|
4640
|
+
} }], (gt2 = ht2 || (ht2 = {}))[gt2.Pointer = 0] = "Pointer", gt2[gt2.DraggableRect = 1] = "DraggableRect", (mt2 = vt2 || (vt2 = {}))[mt2.TreeOrder = 0] = "TreeOrder", mt2[mt2.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
4641
|
+
var bt2 = { x: { [Oe2.Backward]: false, [Oe2.Forward]: false }, y: { [Oe2.Backward]: false, [Oe2.Forward]: false } };
|
|
4642
|
+
var yt2;
|
|
4245
4643
|
var wt2;
|
|
4246
4644
|
var xt2;
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4645
|
+
(wt2 = yt2 || (yt2 = {}))[wt2.Always = 0] = "Always", wt2[wt2.BeforeDragging = 1] = "BeforeDragging", wt2[wt2.WhileDragging = 2] = "WhileDragging", (xt2 || (xt2 = {})).Optimized = "optimized";
|
|
4646
|
+
var Ct2 = /* @__PURE__ */ new Map;
|
|
4647
|
+
function Nt2(e2, t2) {
|
|
4648
|
+
return J2((n2) => e2 ? n2 || (typeof t2 == "function" ? t2(e2) : e2) : null, [t2, e2]);
|
|
4649
|
+
}
|
|
4650
|
+
function St2(e2) {
|
|
4651
|
+
let { callback: t2, disabled: n2 } = e2;
|
|
4652
|
+
const r2 = Y2(t2), o2 = p(() => {
|
|
4653
|
+
if (n2 || typeof window == "undefined" || window.ResizeObserver === undefined)
|
|
4654
|
+
return;
|
|
4655
|
+
const { ResizeObserver: e3 } = window;
|
|
4656
|
+
return new e3(r2);
|
|
4657
|
+
}, [n2]);
|
|
4658
|
+
return a(() => () => o2 == null ? undefined : o2.disconnect(), [o2]), o2;
|
|
4659
|
+
}
|
|
4660
|
+
function Et2(e2) {
|
|
4661
|
+
return new Xe2(ke2(e2), e2);
|
|
4662
|
+
}
|
|
4663
|
+
function Dt2(e2, t2, n2) {
|
|
4664
|
+
t2 === undefined && (t2 = Et2);
|
|
4665
|
+
const [r2, l2] = o(null);
|
|
4666
|
+
function i2() {
|
|
4667
|
+
l2((r3) => {
|
|
4668
|
+
if (!e2)
|
|
4669
|
+
return null;
|
|
4670
|
+
var o2;
|
|
4671
|
+
if (e2.isConnected === false)
|
|
4672
|
+
return (o2 = r3 != null ? r3 : n2) != null ? o2 : null;
|
|
4673
|
+
const l3 = t2(e2);
|
|
4674
|
+
return JSON.stringify(r3) === JSON.stringify(l3) ? r3 : l3;
|
|
4675
|
+
});
|
|
4676
|
+
}
|
|
4677
|
+
const s2 = function(e3) {
|
|
4678
|
+
let { callback: t3, disabled: n3 } = e3;
|
|
4679
|
+
const r3 = Y2(t3), o2 = p(() => {
|
|
4680
|
+
if (n3 || typeof window == "undefined" || window.MutationObserver === undefined)
|
|
4681
|
+
return;
|
|
4682
|
+
const { MutationObserver: e4 } = window;
|
|
4683
|
+
return new e4(r3);
|
|
4684
|
+
}, [r3, n3]);
|
|
4685
|
+
return a(() => () => o2 == null ? undefined : o2.disconnect(), [o2]), o2;
|
|
4686
|
+
}({ callback(t3) {
|
|
4687
|
+
if (e2)
|
|
4688
|
+
for (const n3 of t3) {
|
|
4689
|
+
const { type: t4, target: r3 } = n3;
|
|
4690
|
+
if (t4 === "childList" && r3 instanceof HTMLElement && r3.contains(e2)) {
|
|
4691
|
+
i2();
|
|
4692
|
+
break;
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
} }), c2 = St2({ callback: i2 });
|
|
4696
|
+
return X2(() => {
|
|
4697
|
+
i2(), e2 ? (c2 == null || c2.observe(e2), s2 == null || s2.observe(document.body, { childList: true, subtree: true })) : (c2 == null || c2.disconnect(), s2 == null || s2.disconnect());
|
|
4698
|
+
}, [e2]), r2;
|
|
4699
|
+
}
|
|
4700
|
+
var Rt2 = [];
|
|
4701
|
+
function zt2(e2, t2) {
|
|
4702
|
+
t2 === undefined && (t2 = []);
|
|
4703
|
+
const n2 = l(null);
|
|
4704
|
+
return a(() => {
|
|
4705
|
+
n2.current = null;
|
|
4706
|
+
}, t2), a(() => {
|
|
4707
|
+
const t3 = e2 !== fe2;
|
|
4708
|
+
t3 && !n2.current && (n2.current = e2), !t3 && n2.current && (n2.current = null);
|
|
4709
|
+
}, [e2]), n2.current ? ne2(e2, n2.current) : fe2;
|
|
4710
|
+
}
|
|
4711
|
+
function kt2(e2) {
|
|
4712
|
+
return p(() => e2 ? function(e3) {
|
|
4713
|
+
const { innerWidth: t2, innerHeight: n2 } = e3;
|
|
4714
|
+
return { top: 0, left: 0, right: t2, bottom: n2, width: t2, height: n2 };
|
|
4715
|
+
}(e2) : null, [e2]);
|
|
4716
|
+
}
|
|
4717
|
+
var Lt2 = [];
|
|
4718
|
+
function Mt2(e2) {
|
|
4719
|
+
let { measure: t2 } = e2;
|
|
4720
|
+
const [n2, r2] = o(null), l2 = St2({ callback: i((e3) => {
|
|
4721
|
+
for (const { target: n3 } of e3)
|
|
4722
|
+
if (K2(n3)) {
|
|
4723
|
+
r2((e4) => {
|
|
4724
|
+
const r3 = t2(n3);
|
|
4725
|
+
return e4 ? { ...e4, width: r3.width, height: r3.height } : r3;
|
|
4726
|
+
});
|
|
4727
|
+
break;
|
|
4728
|
+
}
|
|
4729
|
+
}, [t2]) }), a2 = i((e3) => {
|
|
4730
|
+
const n3 = function(e4) {
|
|
4731
|
+
if (!e4)
|
|
4732
|
+
return null;
|
|
4733
|
+
if (e4.children.length > 1)
|
|
4734
|
+
return e4;
|
|
4735
|
+
const t3 = e4.children[0];
|
|
4736
|
+
return K2(t3) ? t3 : e4;
|
|
4737
|
+
}(e3);
|
|
4738
|
+
l2 == null || l2.disconnect(), n3 && (l2 == null || l2.observe(n3)), r2(n3 ? t2(n3) : null);
|
|
4739
|
+
}, [t2, l2]), [s2, c2] = G2(a2);
|
|
4740
|
+
return p(() => ({ nodeRef: s2, rect: n2, setRef: c2 }), [n2, s2, c2]);
|
|
4741
|
+
}
|
|
4742
|
+
var Pt2 = [{ sensor: st2, options: {} }, { sensor: rt2, options: {} }];
|
|
4743
|
+
var At2 = { current: {} };
|
|
4744
|
+
var Tt2 = { draggable: { measure: Le2 }, droppable: { measure: Le2, strategy: yt2.WhileDragging, frequency: xt2.Optimized }, dragOverlay: { measure: ke2 } };
|
|
4745
|
+
|
|
4746
|
+
class $t2 extends Map {
|
|
4747
|
+
get(e2) {
|
|
4748
|
+
var t2;
|
|
4749
|
+
return e2 != null && (t2 = super.get(e2)) != null ? t2 : undefined;
|
|
4750
|
+
}
|
|
4751
|
+
toArray() {
|
|
4752
|
+
return Array.from(this.values());
|
|
4753
|
+
}
|
|
4754
|
+
getEnabled() {
|
|
4755
|
+
return this.toArray().filter((e2) => {
|
|
4756
|
+
let { disabled: t2 } = e2;
|
|
4757
|
+
return !t2;
|
|
4758
|
+
});
|
|
4759
|
+
}
|
|
4760
|
+
getNodeFor(e2) {
|
|
4761
|
+
var t2, n2;
|
|
4762
|
+
return (t2 = (n2 = this.get(e2)) == null ? undefined : n2.node.current) != null ? t2 : undefined;
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
var Bt2 = { activatorEvent: null, active: null, activeNode: null, activeNodeRect: null, collisions: null, containerNodeRect: null, draggableNodes: /* @__PURE__ */ new Map, droppableRects: /* @__PURE__ */ new Map, droppableContainers: /* @__PURE__ */ new $t2, over: null, dragOverlay: { nodeRef: { current: null }, rect: null, setRef: me }, scrollableAncestors: [], scrollableAncestorRects: [], measuringConfiguration: Tt2, measureDroppableContainers: me, windowRect: null, measuringScheduled: false };
|
|
4766
|
+
var Ot2 = /* @__PURE__ */ s({ activatorEvent: null, activators: [], active: null, activeNodeRect: null, ariaDescribedById: { draggable: "" }, dispatch: me, draggableNodes: /* @__PURE__ */ new Map, over: null, measureDroppableContainers: me });
|
|
4767
|
+
var Ft2 = /* @__PURE__ */ s(Bt2);
|
|
4768
|
+
function It2() {
|
|
4769
|
+
return { draggable: { active: null, initialCoordinates: { x: 0, y: 0 }, nodes: /* @__PURE__ */ new Map, translate: { x: 0, y: 0 } }, droppable: { containers: new $t2 } };
|
|
4770
|
+
}
|
|
4771
|
+
function Ht2(e2, t2) {
|
|
4772
|
+
switch (t2.type) {
|
|
4773
|
+
case ge2.DragStart:
|
|
4774
|
+
return { ...e2, draggable: { ...e2.draggable, initialCoordinates: t2.initialCoordinates, active: t2.active } };
|
|
4775
|
+
case ge2.DragMove:
|
|
4776
|
+
return e2.draggable.active == null ? e2 : { ...e2, draggable: { ...e2.draggable, translate: { x: t2.coordinates.x - e2.draggable.initialCoordinates.x, y: t2.coordinates.y - e2.draggable.initialCoordinates.y } } };
|
|
4777
|
+
case ge2.DragEnd:
|
|
4778
|
+
case ge2.DragCancel:
|
|
4779
|
+
return { ...e2, draggable: { ...e2.draggable, active: null, initialCoordinates: { x: 0, y: 0 }, translate: { x: 0, y: 0 } } };
|
|
4780
|
+
case ge2.RegisterDroppable: {
|
|
4781
|
+
const { element: n2 } = t2, { id: r2 } = n2, o2 = new $t2(e2.droppable.containers);
|
|
4782
|
+
return o2.set(r2, n2), { ...e2, droppable: { ...e2.droppable, containers: o2 } };
|
|
4783
|
+
}
|
|
4784
|
+
case ge2.SetDroppableDisabled: {
|
|
4785
|
+
const { id: n2, key: r2, disabled: o2 } = t2, l2 = e2.droppable.containers.get(n2);
|
|
4786
|
+
if (!l2 || r2 !== l2.key)
|
|
4787
|
+
return e2;
|
|
4788
|
+
const i2 = new $t2(e2.droppable.containers);
|
|
4789
|
+
return i2.set(n2, { ...l2, disabled: o2 }), { ...e2, droppable: { ...e2.droppable, containers: i2 } };
|
|
4790
|
+
}
|
|
4791
|
+
case ge2.UnregisterDroppable: {
|
|
4792
|
+
const { id: n2, key: r2 } = t2, o2 = e2.droppable.containers.get(n2);
|
|
4793
|
+
if (!o2 || r2 !== o2.key)
|
|
4794
|
+
return e2;
|
|
4795
|
+
const l2 = new $t2(e2.droppable.containers);
|
|
4796
|
+
return l2.delete(n2), { ...e2, droppable: { ...e2.droppable, containers: l2 } };
|
|
4797
|
+
}
|
|
4798
|
+
default:
|
|
4799
|
+
return e2;
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
function Wt2(e2) {
|
|
4803
|
+
let { disabled: t2 } = e2;
|
|
4804
|
+
const { active: n2, activatorEvent: r2, draggableNodes: o2 } = c(Ot2), l2 = _2(r2), i2 = _2(n2 == null ? undefined : n2.id);
|
|
4805
|
+
return a(() => {
|
|
4806
|
+
if (!t2 && !r2 && l2 && i2 != null) {
|
|
4807
|
+
if (!re2(l2))
|
|
4808
|
+
return;
|
|
4809
|
+
if (document.activeElement === l2.target)
|
|
4810
|
+
return;
|
|
4811
|
+
const e3 = o2.get(i2);
|
|
4812
|
+
if (!e3)
|
|
4813
|
+
return;
|
|
4814
|
+
const { activatorNode: t3, node: n3 } = e3;
|
|
4815
|
+
if (!t3.current && !n3.current)
|
|
4816
|
+
return;
|
|
4817
|
+
requestAnimationFrame(() => {
|
|
4818
|
+
for (const e4 of [t3.current, n3.current]) {
|
|
4819
|
+
if (!e4)
|
|
4820
|
+
continue;
|
|
4821
|
+
const t4 = ie2(e4);
|
|
4822
|
+
if (t4) {
|
|
4823
|
+
t4.focus();
|
|
4824
|
+
break;
|
|
4825
|
+
}
|
|
4826
|
+
}
|
|
4827
|
+
});
|
|
4828
|
+
}
|
|
4829
|
+
}, [r2, t2, o2, i2, l2]), null;
|
|
4830
|
+
}
|
|
4831
|
+
var jt2 = /* @__PURE__ */ s({ ...fe2, scaleX: 1, scaleY: 1 });
|
|
4251
4832
|
var Kt;
|
|
4252
|
-
var
|
|
4253
|
-
(
|
|
4833
|
+
var qt2;
|
|
4834
|
+
(qt2 = Kt || (Kt = {}))[qt2.Uninitialized = 0] = "Uninitialized", qt2[qt2.Initializing = 1] = "Initializing", qt2[qt2.Initialized = 2] = "Initialized";
|
|
4835
|
+
var Ut2 = /* @__PURE__ */ g(function(e2) {
|
|
4836
|
+
var t2, n2, s2, c2;
|
|
4837
|
+
let { id: d2, accessibility: u2, autoScroll: h2 = true, children: g2, sensors: m = Pt2, collisionDetection: f = Se2, measuring: b, modifiers: w2, ...x2 } = e2;
|
|
4838
|
+
const C2 = v(Ht2, undefined, It2), [N2, S] = C2, [E, D3] = function() {
|
|
4839
|
+
const [e3] = o(() => /* @__PURE__ */ new Set), t3 = i((t4) => (e3.add(t4), () => e3.delete(t4)), [e3]);
|
|
4840
|
+
return [i((t4) => {
|
|
4841
|
+
let { type: n3, event: r2 } = t4;
|
|
4842
|
+
e3.forEach((e4) => {
|
|
4843
|
+
var t5;
|
|
4844
|
+
return (t5 = e4[n3]) == null ? undefined : t5.call(e4, r2);
|
|
4845
|
+
});
|
|
4846
|
+
}, [e3]), t3];
|
|
4847
|
+
}(), [R2, z2] = o(Kt.Uninitialized), k2 = R2 === Kt.Initialized, { draggable: { active: L3, nodes: M2, translate: P }, droppable: { containers: A2 } } = N2, T3 = L3 != null ? M2.get(L3) : null, $3 = l({ initial: null, translated: null }), B2 = p(() => {
|
|
4848
|
+
var e3;
|
|
4849
|
+
return L3 != null ? { id: L3, data: (e3 = T3 == null ? undefined : T3.data) != null ? e3 : At2, rect: $3 } : null;
|
|
4850
|
+
}, [L3, T3]), O = l(null), [I3, H2] = o(null), [j3, K3] = o(null), q3 = V2(x2, Object.values(x2)), U3 = Z2("DndDescribedBy", d2), Y3 = p(() => A2.getEnabled(), [A2]), G3 = p(() => ({ draggable: { ...Tt2.draggable, ..._3 == null ? undefined : _3.draggable }, droppable: { ...Tt2.droppable, ..._3 == null ? undefined : _3.droppable }, dragOverlay: { ...Tt2.dragOverlay, ..._3 == null ? undefined : _3.dragOverlay } }), [(_3 = b) == null ? undefined : _3.draggable, _3 == null ? undefined : _3.droppable, _3 == null ? undefined : _3.dragOverlay]);
|
|
4851
|
+
var _3;
|
|
4852
|
+
const { droppableRects: Q3, measureDroppableContainers: ee2, measuringScheduled: ne3 } = function(e3, t3) {
|
|
4853
|
+
let { dragging: n3, dependencies: r2, config: s3 } = t3;
|
|
4854
|
+
const [c3, d3] = o(null), { frequency: u3, measure: p2, strategy: h3 } = s3, g3 = l(e3), v2 = function() {
|
|
4855
|
+
switch (h3) {
|
|
4856
|
+
case yt2.Always:
|
|
4857
|
+
return false;
|
|
4858
|
+
case yt2.BeforeDragging:
|
|
4859
|
+
return n3;
|
|
4860
|
+
default:
|
|
4861
|
+
return !n3;
|
|
4862
|
+
}
|
|
4863
|
+
}(), m2 = V2(v2), f2 = i(function(e4) {
|
|
4864
|
+
e4 === undefined && (e4 = []), m2.current || d3((t4) => t4 === null ? e4 : t4.concat(e4.filter((e5) => !t4.includes(e5))));
|
|
4865
|
+
}, [m2]), b2 = l(null), y2 = J2((t4) => {
|
|
4866
|
+
if (v2 && !n3)
|
|
4867
|
+
return Ct2;
|
|
4868
|
+
if (!t4 || t4 === Ct2 || g3.current !== e3 || c3 != null) {
|
|
4869
|
+
const t5 = /* @__PURE__ */ new Map;
|
|
4870
|
+
for (let n4 of e3) {
|
|
4871
|
+
if (!n4)
|
|
4872
|
+
continue;
|
|
4873
|
+
if (c3 && c3.length > 0 && !c3.includes(n4.id) && n4.rect.current) {
|
|
4874
|
+
t5.set(n4.id, n4.rect.current);
|
|
4875
|
+
continue;
|
|
4876
|
+
}
|
|
4877
|
+
const e4 = n4.node.current, r3 = e4 ? new Xe2(p2(e4), e4) : null;
|
|
4878
|
+
n4.rect.current = r3, r3 && t5.set(n4.id, r3);
|
|
4879
|
+
}
|
|
4880
|
+
return t5;
|
|
4881
|
+
}
|
|
4882
|
+
return t4;
|
|
4883
|
+
}, [e3, c3, n3, v2, p2]);
|
|
4884
|
+
return a(() => {
|
|
4885
|
+
g3.current = e3;
|
|
4886
|
+
}, [e3]), a(() => {
|
|
4887
|
+
v2 || f2();
|
|
4888
|
+
}, [n3, v2]), a(() => {
|
|
4889
|
+
c3 && c3.length > 0 && d3(null);
|
|
4890
|
+
}, [JSON.stringify(c3)]), a(() => {
|
|
4891
|
+
v2 || typeof u3 != "number" || b2.current !== null || (b2.current = setTimeout(() => {
|
|
4892
|
+
f2(), b2.current = null;
|
|
4893
|
+
}, u3));
|
|
4894
|
+
}, [u3, v2, f2, ...r2]), { droppableRects: y2, measureDroppableContainers: f2, measuringScheduled: c3 != null };
|
|
4895
|
+
}(Y3, { dragging: k2, dependencies: [P.x, P.y], config: G3.droppable }), re3 = function(e3, t3) {
|
|
4896
|
+
const n3 = t3 != null ? e3.get(t3) : undefined, r2 = n3 ? n3.node.current : null;
|
|
4897
|
+
return J2((e4) => {
|
|
4898
|
+
var n4;
|
|
4899
|
+
return t3 == null ? null : (n4 = r2 != null ? r2 : e4) != null ? n4 : null;
|
|
4900
|
+
}, [r2, t3]);
|
|
4901
|
+
}(M2, L3), le2 = p(() => j3 ? oe2(j3) : null, [j3]), ie3 = function() {
|
|
4902
|
+
const e3 = (I3 == null ? undefined : I3.autoScrollEnabled) === false, t3 = typeof h2 == "object" ? h2.enabled === false : h2 === false, n3 = k2 && !e3 && !t3;
|
|
4903
|
+
if (typeof h2 == "object")
|
|
4904
|
+
return { ...h2, enabled: n3 };
|
|
4905
|
+
return { enabled: n3 };
|
|
4906
|
+
}(), ae2 = function(e3, t3) {
|
|
4907
|
+
return Nt2(e3, t3);
|
|
4908
|
+
}(re3, G3.draggable.measure);
|
|
4909
|
+
(function(e3) {
|
|
4910
|
+
let { activeNode: t3, measure: n3, initialRect: r2, config: o2 = true } = e3;
|
|
4911
|
+
const i2 = l(false), { x: a2, y: s3 } = typeof o2 == "boolean" ? { x: o2, y: o2 } : o2;
|
|
4912
|
+
X2(() => {
|
|
4913
|
+
if (!a2 && !s3 || !t3)
|
|
4914
|
+
return void (i2.current = false);
|
|
4915
|
+
if (i2.current || !r2)
|
|
4916
|
+
return;
|
|
4917
|
+
const e4 = t3 == null ? undefined : t3.node.current;
|
|
4918
|
+
if (!e4 || e4.isConnected === false)
|
|
4919
|
+
return;
|
|
4920
|
+
const o3 = Ee2(n3(e4), r2);
|
|
4921
|
+
if (a2 || (o3.x = 0), s3 || (o3.y = 0), i2.current = true, Math.abs(o3.x) > 0 || Math.abs(o3.y) > 0) {
|
|
4922
|
+
const t4 = Pe2(e4);
|
|
4923
|
+
t4 && t4.scrollBy({ top: o3.y, left: o3.x });
|
|
4924
|
+
}
|
|
4925
|
+
}, [t3, a2, s3, r2, n3]);
|
|
4926
|
+
})({ activeNode: L3 != null ? M2.get(L3) : null, config: ie3.layoutShiftCompensation, initialRect: ae2, measure: G3.draggable.measure });
|
|
4927
|
+
const se3 = Dt2(re3, G3.draggable.measure, ae2), ce3 = Dt2(re3 ? re3.parentElement : null), ue3 = l({ activatorEvent: null, active: null, activeNode: re3, collisionRect: null, collisions: null, droppableRects: Q3, draggableNodes: M2, draggingNode: null, draggingNodeRect: null, droppableContainers: A2, over: null, scrollableAncestors: [], scrollAdjustedTranslate: null }), pe2 = A2.getNodeFor((t2 = ue3.current.over) == null ? undefined : t2.id), ve3 = Mt2({ measure: G3.dragOverlay.measure }), me2 = (n2 = ve3.nodeRef.current) != null ? n2 : re3, be3 = k2 ? (s2 = ve3.rect) != null ? s2 : se3 : null, ye3 = Boolean(ve3.nodeRef.current && ve3.rect), we3 = Ee2(xe3 = ye3 ? null : se3, Nt2(xe3));
|
|
4928
|
+
var xe3;
|
|
4929
|
+
const Ce2 = kt2(me2 ? W2(me2) : null), Ne3 = function(e3) {
|
|
4930
|
+
const t3 = l(e3), n3 = J2((n4) => e3 ? n4 && n4 !== Rt2 && e3 && t3.current && e3.parentNode === t3.current.parentNode ? n4 : Me2(e3) : Rt2, [e3]);
|
|
4931
|
+
return a(() => {
|
|
4932
|
+
t3.current = e3;
|
|
4933
|
+
}, [e3]), n3;
|
|
4934
|
+
}(k2 ? pe2 != null ? pe2 : re3 : null), De3 = function(e3, t3) {
|
|
4935
|
+
t3 === undefined && (t3 = ke2);
|
|
4936
|
+
const [n3] = e3, r2 = kt2(n3 ? W2(n3) : null), [l2, i2] = o(Lt2);
|
|
4937
|
+
function a2() {
|
|
4938
|
+
i2(() => e3.length ? e3.map((e4) => Ie2(e4) ? r2 : new Xe2(t3(e4), e4)) : Lt2);
|
|
4939
|
+
}
|
|
4940
|
+
const s3 = St2({ callback: a2 });
|
|
4941
|
+
return X2(() => {
|
|
4942
|
+
s3 == null || s3.disconnect(), a2(), e3.forEach((e4) => s3 == null ? undefined : s3.observe(e4));
|
|
4943
|
+
}, [e3]), l2;
|
|
4944
|
+
}(Ne3), ze3 = function(e3, t3) {
|
|
4945
|
+
let { transform: n3, ...r2 } = t3;
|
|
4946
|
+
return e3 != null && e3.length ? e3.reduce((e4, t4) => t4({ transform: e4, ...r2 }), n3) : n3;
|
|
4947
|
+
}(w2, { transform: { x: P.x - we3.x, y: P.y - we3.y, scaleX: 1, scaleY: 1 }, activatorEvent: j3, active: B2, activeNodeRect: se3, containerNodeRect: ce3, draggingNodeRect: be3, over: ue3.current.over, overlayNodeRect: ve3.rect, scrollableAncestors: Ne3, scrollableAncestorRects: De3, windowRect: Ce2 }), Le3 = le2 ? te2(le2, P) : null, Te3 = function(e3) {
|
|
4948
|
+
const [t3, n3] = o(null), r2 = l(e3), s3 = i((e4) => {
|
|
4949
|
+
const t4 = Ae2(e4.target);
|
|
4950
|
+
t4 && n3((e5) => e5 ? (e5.set(t4, Be2(t4)), new Map(e5)) : null);
|
|
4951
|
+
}, []);
|
|
4952
|
+
return a(() => {
|
|
4953
|
+
const t4 = r2.current;
|
|
4954
|
+
if (e3 !== t4) {
|
|
4955
|
+
o2(t4);
|
|
4956
|
+
const l2 = e3.map((e4) => {
|
|
4957
|
+
const t5 = Ae2(e4);
|
|
4958
|
+
return t5 ? (t5.addEventListener("scroll", s3, { passive: true }), [t5, Be2(t5)]) : null;
|
|
4959
|
+
}).filter((e4) => e4 != null);
|
|
4960
|
+
n3(l2.length ? new Map(l2) : null), r2.current = e3;
|
|
4961
|
+
}
|
|
4962
|
+
return () => {
|
|
4963
|
+
o2(e3), o2(t4);
|
|
4964
|
+
};
|
|
4965
|
+
function o2(e4) {
|
|
4966
|
+
e4.forEach((e5) => {
|
|
4967
|
+
const t5 = Ae2(e5);
|
|
4968
|
+
t5 == null || t5.removeEventListener("scroll", s3);
|
|
4969
|
+
});
|
|
4970
|
+
}
|
|
4971
|
+
}, [s3, e3]), p(() => e3.length ? t3 ? Array.from(t3.values()).reduce((e4, t4) => te2(e4, t4), fe2) : qe2(e3) : fe2, [e3, t3]);
|
|
4972
|
+
}(Ne3), $e3 = zt2(Te3), Oe3 = zt2(Te3, [se3]), Fe3 = te2(ze3, $e3), He3 = be3 ? Re(be3, ze3) : null, We3 = B2 && He3 ? f({ active: B2, collisionRect: He3, droppableRects: Q3, droppableContainers: Y3, pointerCoordinates: Le3 }) : null, je3 = function(e3, t3) {
|
|
4973
|
+
if (!e3 || e3.length === 0)
|
|
4974
|
+
return null;
|
|
4975
|
+
const [n3] = e3;
|
|
4976
|
+
return n3[t3];
|
|
4977
|
+
}(We3, "id"), [Ke3, Ue3] = o(null), Ye3 = function(e3, t3, n3) {
|
|
4978
|
+
return { ...e3, scaleX: t3 && n3 ? t3.width / n3.width : 1, scaleY: t3 && n3 ? t3.height / n3.height : 1 };
|
|
4979
|
+
}(ye3 ? ze3 : te2(ze3, Oe3), (c2 = Ke3 == null ? undefined : Ke3.rect) != null ? c2 : null, se3), Ve3 = l(null), Je3 = i((e3, t3) => {
|
|
4980
|
+
let { sensor: n3, options: r2 } = t3;
|
|
4981
|
+
if (O.current == null)
|
|
4982
|
+
return;
|
|
4983
|
+
const o2 = M2.get(O.current);
|
|
4984
|
+
if (!o2)
|
|
4985
|
+
return;
|
|
4986
|
+
const l2 = e3.nativeEvent, i2 = new n3({ active: O.current, activeNode: o2, event: l2, options: r2, context: ue3, onAbort(e4) {
|
|
4987
|
+
if (!M2.get(e4))
|
|
4988
|
+
return;
|
|
4989
|
+
const { onDragAbort: t4 } = q3.current, n4 = { id: e4 };
|
|
4990
|
+
t4 == null || t4(n4), E({ type: "onDragAbort", event: n4 });
|
|
4991
|
+
}, onPending(e4, t4, n4, r3) {
|
|
4992
|
+
if (!M2.get(e4))
|
|
4993
|
+
return;
|
|
4994
|
+
const { onDragPending: o3 } = q3.current, l3 = { id: e4, constraint: t4, initialCoordinates: n4, offset: r3 };
|
|
4995
|
+
o3 == null || o3(l3), E({ type: "onDragPending", event: l3 });
|
|
4996
|
+
}, onStart(e4) {
|
|
4997
|
+
const t4 = O.current;
|
|
4998
|
+
if (t4 == null)
|
|
4999
|
+
return;
|
|
5000
|
+
const n4 = M2.get(t4);
|
|
5001
|
+
if (!n4)
|
|
5002
|
+
return;
|
|
5003
|
+
const { onDragStart: r3 } = q3.current, o3 = { activatorEvent: l2, active: { id: t4, data: n4.data, rect: $3 } };
|
|
5004
|
+
y(() => {
|
|
5005
|
+
r3 == null || r3(o3), z2(Kt.Initializing), S({ type: ge2.DragStart, initialCoordinates: e4, active: t4 }), E({ type: "onDragStart", event: o3 }), H2(Ve3.current), K3(l2);
|
|
5006
|
+
});
|
|
5007
|
+
}, onMove(e4) {
|
|
5008
|
+
S({ type: ge2.DragMove, coordinates: e4 });
|
|
5009
|
+
}, onEnd: a2(ge2.DragEnd), onCancel: a2(ge2.DragCancel) });
|
|
5010
|
+
function a2(e4) {
|
|
5011
|
+
return async function() {
|
|
5012
|
+
const { active: t4, collisions: n4, over: r3, scrollAdjustedTranslate: o3 } = ue3.current;
|
|
5013
|
+
let i3 = null;
|
|
5014
|
+
if (t4 && o3) {
|
|
5015
|
+
const { cancelDrop: a3 } = q3.current;
|
|
5016
|
+
if (i3 = { activatorEvent: l2, active: t4, collisions: n4, delta: o3, over: r3 }, e4 === ge2.DragEnd && typeof a3 == "function") {
|
|
5017
|
+
await Promise.resolve(a3(i3)) && (e4 = ge2.DragCancel);
|
|
5018
|
+
}
|
|
5019
|
+
}
|
|
5020
|
+
O.current = null, y(() => {
|
|
5021
|
+
S({ type: e4 }), z2(Kt.Uninitialized), Ue3(null), H2(null), K3(null), Ve3.current = null;
|
|
5022
|
+
const t5 = e4 === ge2.DragEnd ? "onDragEnd" : "onDragCancel";
|
|
5023
|
+
if (i3) {
|
|
5024
|
+
const e5 = q3.current[t5];
|
|
5025
|
+
e5 == null || e5(i3), E({ type: t5, event: i3 });
|
|
5026
|
+
}
|
|
5027
|
+
});
|
|
5028
|
+
};
|
|
5029
|
+
}
|
|
5030
|
+
Ve3.current = i2;
|
|
5031
|
+
}, [M2]), Ge3 = function(e3, t3) {
|
|
5032
|
+
return p(() => e3.reduce((e4, n3) => {
|
|
5033
|
+
const { sensor: r2 } = n3;
|
|
5034
|
+
return [...e4, ...r2.activators.map((e5) => ({ eventName: e5.eventName, handler: t3(e5.handler, n3) }))];
|
|
5035
|
+
}, []), [e3, t3]);
|
|
5036
|
+
}(m, i((e3, t3) => (n3, r2) => {
|
|
5037
|
+
const o2 = n3.nativeEvent, l2 = M2.get(r2);
|
|
5038
|
+
if (O.current !== null || !l2 || o2.dndKit || o2.defaultPrevented)
|
|
5039
|
+
return;
|
|
5040
|
+
const i2 = { active: l2 };
|
|
5041
|
+
e3(n3, t3.options, i2) === true && (o2.dndKit = { capturedBy: t3.sensor }, O.current = r2, Je3(n3, t3));
|
|
5042
|
+
}, [M2, Je3]));
|
|
5043
|
+
(function(e3) {
|
|
5044
|
+
a(() => {
|
|
5045
|
+
if (!F)
|
|
5046
|
+
return;
|
|
5047
|
+
const t3 = e3.map((e4) => {
|
|
5048
|
+
let { sensor: t4 } = e4;
|
|
5049
|
+
return t4.setup == null ? undefined : t4.setup();
|
|
5050
|
+
});
|
|
5051
|
+
return () => {
|
|
5052
|
+
for (const e4 of t3)
|
|
5053
|
+
e4 == null || e4();
|
|
5054
|
+
};
|
|
5055
|
+
}, e3.map((e4) => {
|
|
5056
|
+
let { sensor: t3 } = e4;
|
|
5057
|
+
return t3;
|
|
5058
|
+
}));
|
|
5059
|
+
})(m), X2(() => {
|
|
5060
|
+
se3 && R2 === Kt.Initializing && z2(Kt.Initialized);
|
|
5061
|
+
}, [se3, R2]), a(() => {
|
|
5062
|
+
const { onDragMove: e3 } = q3.current, { active: t3, activatorEvent: n3, collisions: r2, over: o2 } = ue3.current;
|
|
5063
|
+
if (!t3 || !n3)
|
|
5064
|
+
return;
|
|
5065
|
+
const l2 = { active: t3, activatorEvent: n3, collisions: r2, delta: { x: Fe3.x, y: Fe3.y }, over: o2 };
|
|
5066
|
+
y(() => {
|
|
5067
|
+
e3 == null || e3(l2), E({ type: "onDragMove", event: l2 });
|
|
5068
|
+
});
|
|
5069
|
+
}, [Fe3.x, Fe3.y]), a(() => {
|
|
5070
|
+
const { active: e3, activatorEvent: t3, collisions: n3, droppableContainers: r2, scrollAdjustedTranslate: o2 } = ue3.current;
|
|
5071
|
+
if (!e3 || O.current == null || !t3 || !o2)
|
|
5072
|
+
return;
|
|
5073
|
+
const { onDragOver: l2 } = q3.current, i2 = r2.get(je3), a2 = i2 && i2.rect.current ? { id: i2.id, rect: i2.rect.current, data: i2.data, disabled: i2.disabled } : null, s3 = { active: e3, activatorEvent: t3, collisions: n3, delta: { x: o2.x, y: o2.y }, over: a2 };
|
|
5074
|
+
y(() => {
|
|
5075
|
+
Ue3(a2), l2 == null || l2(s3), E({ type: "onDragOver", event: s3 });
|
|
5076
|
+
});
|
|
5077
|
+
}, [je3]), X2(() => {
|
|
5078
|
+
ue3.current = { activatorEvent: j3, active: B2, activeNode: re3, collisionRect: He3, collisions: We3, droppableRects: Q3, draggableNodes: M2, draggingNode: me2, draggingNodeRect: be3, droppableContainers: A2, over: Ke3, scrollableAncestors: Ne3, scrollAdjustedTranslate: Fe3 }, $3.current = { initial: be3, translated: He3 };
|
|
5079
|
+
}, [B2, re3, We3, He3, M2, me2, be3, Q3, A2, Ke3, Ne3, Fe3]), ft({ ...ie3, delta: P, draggingRect: He3, pointerCoordinates: Le3, scrollableAncestors: Ne3, scrollableAncestorRects: De3 });
|
|
5080
|
+
const _e3 = p(() => ({ active: B2, activeNode: re3, activeNodeRect: se3, activatorEvent: j3, collisions: We3, containerNodeRect: ce3, dragOverlay: ve3, draggableNodes: M2, droppableContainers: A2, droppableRects: Q3, over: Ke3, measureDroppableContainers: ee2, scrollableAncestors: Ne3, scrollableAncestorRects: De3, measuringConfiguration: G3, measuringScheduled: ne3, windowRect: Ce2 }), [B2, re3, se3, j3, We3, ce3, ve3, M2, A2, Q3, Ke3, ee2, Ne3, De3, G3, ne3, Ce2]), Qe3 = p(() => ({ activatorEvent: j3, activators: Ge3, active: B2, activeNodeRect: se3, ariaDescribedById: { draggable: U3 }, dispatch: S, draggableNodes: M2, over: Ke3, measureDroppableContainers: ee2 }), [j3, Ge3, B2, se3, S, U3, M2, Ke3, ee2]);
|
|
5081
|
+
return r.createElement(de2.Provider, { value: D3 }, r.createElement(Ot2.Provider, { value: Qe3 }, r.createElement(Ft2.Provider, { value: _e3 }, r.createElement(jt2.Provider, { value: Ye3 }, g2)), r.createElement(Wt2, { disabled: (u2 == null ? undefined : u2.restoreFocus) === false })), r.createElement(he2, { ...u2, hiddenTextDescribedById: U3 }));
|
|
5082
|
+
});
|
|
5083
|
+
var Xt2 = /* @__PURE__ */ s(null);
|
|
5084
|
+
var Yt2 = "button";
|
|
5085
|
+
function Vt2(e2) {
|
|
5086
|
+
let { id: t2, data: n2, disabled: r2 = false, attributes: o2 } = e2;
|
|
5087
|
+
const l2 = Z2("Draggable"), { activators: i2, activatorEvent: a2, active: s2, activeNodeRect: d2, ariaDescribedById: u2, draggableNodes: h2, over: g2 } = c(Ot2), { role: v2 = Yt2, roleDescription: m = "draggable", tabIndex: f = 0 } = o2 != null ? o2 : {}, b = (s2 == null ? undefined : s2.id) === t2, y2 = c(b ? jt2 : Xt2), [w2, x2] = G2(), [C2, N2] = G2(), S = function(e3, t3) {
|
|
5088
|
+
return p(() => e3.reduce((e4, n3) => {
|
|
5089
|
+
let { eventName: r3, handler: o3 } = n3;
|
|
5090
|
+
return e4[r3] = (e5) => {
|
|
5091
|
+
o3(e5, t3);
|
|
5092
|
+
}, e4;
|
|
5093
|
+
}, {}), [e3, t3]);
|
|
5094
|
+
}(i2, t2), E = V2(n2);
|
|
5095
|
+
X2(() => (h2.set(t2, { id: t2, key: l2, node: w2, activatorNode: C2, data: E }), () => {
|
|
5096
|
+
const e3 = h2.get(t2);
|
|
5097
|
+
e3 && e3.key === l2 && h2.delete(t2);
|
|
5098
|
+
}), [h2, t2]);
|
|
5099
|
+
return { active: s2, activatorEvent: a2, activeNodeRect: d2, attributes: p(() => ({ role: v2, tabIndex: f, "aria-disabled": r2, "aria-pressed": !(!b || v2 !== Yt2) || undefined, "aria-roledescription": m, "aria-describedby": u2.draggable }), [r2, v2, f, b, m, u2.draggable]), isDragging: b, listeners: r2 ? undefined : S, node: w2, over: g2, setNodeRef: x2, setActivatorNodeRef: N2, transform: y2 };
|
|
5100
|
+
}
|
|
5101
|
+
var Jt2 = { timeout: 25 };
|
|
5102
|
+
var Gt2 = ({ slotPosition: n2, isEditing: r2, isDragging: o2, children: s2 }) => {
|
|
5103
|
+
const { attributes: d2, listeners: u2, setNodeRef: p2, transform: h2 } = Vt2({ id: `slot-${n2}`, data: { slotPosition: n2 }, disabled: !r2 }), { setNodeRef: g2, isOver: v2 } = function(e2) {
|
|
5104
|
+
let { data: t2, disabled: n3 = false, id: r3, resizeObserverConfig: o3 } = e2;
|
|
5105
|
+
const s3 = Z2("Droppable"), { active: d3, dispatch: u3, over: p3, measureDroppableContainers: h3 } = c(Ot2), g3 = l({ disabled: n3 }), v3 = l(false), m2 = l(null), f2 = l(null), { disabled: b, updateMeasurementsFor: y2, timeout: w2 } = { ...Jt2, ...o3 }, x2 = V2(y2 != null ? y2 : r3), C2 = St2({ callback: i(() => {
|
|
5106
|
+
v3.current ? (f2.current != null && clearTimeout(f2.current), f2.current = setTimeout(() => {
|
|
5107
|
+
h3(Array.isArray(x2.current) ? x2.current : [x2.current]), f2.current = null;
|
|
5108
|
+
}, w2)) : v3.current = true;
|
|
5109
|
+
}, [w2]), disabled: b || !d3 }), N2 = i((e3, t3) => {
|
|
5110
|
+
C2 && (t3 && (C2.unobserve(t3), v3.current = false), e3 && C2.observe(e3));
|
|
5111
|
+
}, [C2]), [S, E] = G2(N2), D3 = V2(t2);
|
|
5112
|
+
return a(() => {
|
|
5113
|
+
C2 && S.current && (C2.disconnect(), v3.current = false, C2.observe(S.current));
|
|
5114
|
+
}, [S, C2]), a(() => (u3({ type: ge2.RegisterDroppable, element: { id: r3, key: s3, disabled: n3, node: S, rect: m2, data: D3 } }), () => u3({ type: ge2.UnregisterDroppable, key: s3, id: r3 })), [r3]), a(() => {
|
|
5115
|
+
n3 !== g3.current.disabled && (u3({ type: ge2.SetDroppableDisabled, id: r3, key: s3, disabled: n3 }), g3.current.disabled = n3);
|
|
5116
|
+
}, [r3, s3, n3, u3]), { active: d3, rect: m2, isOver: (p3 == null ? undefined : p3.id) === r3, node: S, over: p3, setNodeRef: E };
|
|
5117
|
+
}({ id: `drop-${n2}`, data: { slotPosition: n2 } }), m = { position: "relative", height: "100%", width: "100%", transform: h2 ? `translate3d(${h2.x}px, ${h2.y}px, 0)` : undefined }, f = i((e2) => {
|
|
5118
|
+
p2(e2), g2(e2);
|
|
5119
|
+
}, [p2, g2]);
|
|
5120
|
+
return t("div", { ref: f, style: m, className: `slot-with-overlay ${r2 ? "edit-mode" : ""} ${o2 ? "dragging" : ""} ${v2 ? "drag-over" : ""}`, children: [s2, r2 && /* @__PURE__ */ t("div", { className: "slot-edit-overlay", ...d2, ...u2, children: [
|
|
5121
|
+
/* @__PURE__ */ e("div", { className: "drag-indicator", children: "⋮⋮" }),
|
|
5122
|
+
/* @__PURE__ */ e("div", { className: "slot-position-label", children: n2.toUpperCase() })
|
|
5123
|
+
] })] });
|
|
5124
|
+
};
|
|
5125
|
+
var _t2 = d(({ isEditMode: n2, onLayoutChange: r2, panels: l2, layout: s2, ...c2 }, d2) => {
|
|
5126
|
+
const [u2, h2] = o(null), [g2, v2] = o({ x: 0, y: 0 }), m = function() {
|
|
5127
|
+
for (var e2 = arguments.length, t2 = new Array(e2), n3 = 0;n3 < e2; n3++)
|
|
5128
|
+
t2[n3] = arguments[n3];
|
|
5129
|
+
return p(() => [...t2].filter((e3) => e3 != null), [...t2]);
|
|
5130
|
+
}(p(() => ({ sensor: f, options: b != null ? b : {} }), [f = st2, b = { activationConstraint: { distance: 8 } }]));
|
|
5131
|
+
var f, b;
|
|
5132
|
+
const y2 = i((e2) => {
|
|
5133
|
+
const t2 = e2.active.id;
|
|
5134
|
+
if (t2.startsWith("slot-")) {
|
|
5135
|
+
const e3 = t2.replace("slot-", "");
|
|
5136
|
+
h2(e3), v2({ x: 0, y: 0 });
|
|
5137
|
+
}
|
|
5138
|
+
}, []), w2 = i((e2) => {
|
|
5139
|
+
const { delta: t2 } = e2;
|
|
5140
|
+
v2({ x: t2.x, y: t2.y });
|
|
5141
|
+
}, []), x2 = i((e2) => {
|
|
5142
|
+
const { active: t2, over: n3 } = e2;
|
|
5143
|
+
if (h2(null), v2({ x: 0, y: 0 }), !n3)
|
|
5144
|
+
return;
|
|
5145
|
+
const o2 = t2.id, l3 = n3.id, i2 = o2.replace("slot-", ""), a2 = l3.replace("drop-", "");
|
|
5146
|
+
if (i2 === a2)
|
|
5147
|
+
return;
|
|
5148
|
+
const c3 = { ...s2 }, d3 = c3[i2];
|
|
5149
|
+
c3[i2] = c3[a2], c3[a2] = d3, r2 && r2(c3);
|
|
5150
|
+
}, [s2, r2]);
|
|
5151
|
+
a(() => {
|
|
5152
|
+
if (!u2 || !n2)
|
|
5153
|
+
return;
|
|
5154
|
+
const e2 = document.querySelector(`[data-slot="${u2}"]`);
|
|
5155
|
+
return e2 && (e2.setAttribute("data-dragging", "true"), e2.style.setProperty("transform", `scale(0.95) translate(${g2.x}px, ${g2.y}px)`, "important"), e2.style.setProperty("z-index", "1000", "important"), e2.style.setProperty("transition", "none", "important"), e2.style.setProperty("opacity", "0.95", "important"), e2.style.setProperty("box-shadow", "0 12px 24px rgba(0, 0, 0, 0.25)", "important")), () => {
|
|
5156
|
+
e2 && (e2.removeAttribute("data-dragging"), e2.style.removeProperty("transform"), e2.style.removeProperty("z-index"), e2.style.removeProperty("transition"), e2.style.removeProperty("opacity"), e2.style.removeProperty("box-shadow"));
|
|
5157
|
+
};
|
|
5158
|
+
}, [u2, g2, n2]);
|
|
5159
|
+
return e(Ut2, { sensors: m, collisionDetection: Ce, onDragStart: y2, onDragMove: w2, onDragEnd: x2, children: /* @__PURE__ */ t("div", { className: "editable-panel-layout " + (n2 ? "edit-mode-active" : ""), children: [
|
|
5160
|
+
/* @__PURE__ */ e(T2, { ref: d2, ...c2, panels: l2, layout: s2, slotDataAttributes: { left: { "data-slot": "left", "data-edit-mode": n2 ? "true" : "false" }, middle: { "data-slot": "middle", "data-edit-mode": n2 ? "true" : "false" }, right: { "data-slot": "right", "data-edit-mode": n2 ? "true" : "false" } } }),
|
|
5161
|
+
n2 && /* @__PURE__ */ e(Qt, { layout: s2, activeSlot: u2, onDragStart: () => {}, onDragEnd: () => {} })
|
|
5162
|
+
] }) });
|
|
5163
|
+
});
|
|
5164
|
+
_t2.displayName = "EditableConfigurablePanelLayout";
|
|
5165
|
+
var Qt = ({ layout: t2, activeSlot: n2 }) => {
|
|
5166
|
+
const [l2, i2] = o(/* @__PURE__ */ new Map);
|
|
5167
|
+
return r.useEffect(() => {
|
|
5168
|
+
const e2 = () => {
|
|
5169
|
+
const e3 = /* @__PURE__ */ new Map;
|
|
5170
|
+
["left", "middle", "right"].forEach((t4) => {
|
|
5171
|
+
const n3 = document.querySelector(`[data-slot="${t4}"]`);
|
|
5172
|
+
if (n3) {
|
|
5173
|
+
const r2 = n3.getBoundingClientRect();
|
|
5174
|
+
e3.set(t4, r2);
|
|
5175
|
+
}
|
|
5176
|
+
}), i2(e3);
|
|
5177
|
+
};
|
|
5178
|
+
e2(), window.addEventListener("resize", e2);
|
|
5179
|
+
const t3 = setInterval(e2, 100);
|
|
5180
|
+
return () => {
|
|
5181
|
+
window.removeEventListener("resize", e2), clearInterval(t3);
|
|
5182
|
+
};
|
|
5183
|
+
}, [t2]), /* @__PURE__ */ e("div", { style: { pointerEvents: "none", position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 999 }, children: ["left", "middle", "right"].map((r2) => {
|
|
5184
|
+
if (!t2[r2])
|
|
5185
|
+
return null;
|
|
5186
|
+
const o2 = l2.get(r2);
|
|
5187
|
+
if (!o2)
|
|
5188
|
+
return null;
|
|
5189
|
+
const i3 = n2 === r2;
|
|
5190
|
+
return e("div", { style: { position: "fixed", top: o2.top, left: o2.left, width: o2.width, height: o2.height, pointerEvents: "auto" }, children: /* @__PURE__ */ e(Gt2, { slotPosition: r2, isEditing: true, isDragging: i3, children: /* @__PURE__ */ e("div", { style: { height: "100%" } }) }) }, r2);
|
|
5191
|
+
}) });
|
|
5192
|
+
};
|
|
4254
5193
|
|
|
4255
5194
|
// src/panels/TabbedTerminalPanel.tsx
|
|
4256
|
-
import { Terminal as TerminalIcon2, Lock as Lock2, Unlock as Unlock2, Box, Boxes } from "lucide-react";
|
|
5195
|
+
import { Terminal as TerminalIcon2, Lock as Lock2, Unlock as Unlock2, Box, Boxes, Paperclip } from "lucide-react";
|
|
4257
5196
|
import React3, {
|
|
4258
5197
|
useState as useState4,
|
|
4259
5198
|
useCallback as useCallback5,
|
|
@@ -4668,6 +5607,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4668
5607
|
const [sessionIds, setSessionIds] = useState4(new Map);
|
|
4669
5608
|
const [scrollPositions, setScrollPositions] = useState4(new Map);
|
|
4670
5609
|
const [activityStates, setActivityStates] = useState4(new Map);
|
|
5610
|
+
const [localCollapsedStates, setLocalCollapsedStates] = useState4(new Map);
|
|
4671
5611
|
const customTabsKey = React3.useMemo(() => {
|
|
4672
5612
|
const customTabs = initialTabs.filter((tab) => tab.contentType !== "terminal");
|
|
4673
5613
|
return JSON.stringify(customTabs);
|
|
@@ -4826,7 +5766,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4826
5766
|
setForeignTabs(foreignTabsList);
|
|
4827
5767
|
setSessionIds((prev) => {
|
|
4828
5768
|
const updated = new Map(prev);
|
|
4829
|
-
newSessionIds.forEach((
|
|
5769
|
+
newSessionIds.forEach((v2, k2) => updated.set(k2, v2));
|
|
4830
5770
|
return updated;
|
|
4831
5771
|
});
|
|
4832
5772
|
} catch (err) {
|
|
@@ -5079,7 +6019,8 @@ var TabbedTerminalPanelInner = ({
|
|
|
5079
6019
|
autoShowBlinds,
|
|
5080
6020
|
onActivityStateChange: handleActivityStateChange
|
|
5081
6021
|
}, `terminal-${tab.id}`);
|
|
5082
|
-
const
|
|
6022
|
+
const hasAssociation = !!association;
|
|
6023
|
+
const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx7("div", {
|
|
5083
6024
|
style: {
|
|
5084
6025
|
height: "100%",
|
|
5085
6026
|
display: "flex",
|
|
@@ -5087,23 +6028,28 @@ var TabbedTerminalPanelInner = ({
|
|
|
5087
6028
|
justifyContent: "center",
|
|
5088
6029
|
color: theme.colors.textMuted,
|
|
5089
6030
|
fontSize: "13px",
|
|
5090
|
-
backgroundColor: theme.colors.backgroundSecondary
|
|
5091
|
-
borderBottom: `1px solid ${theme.colors.border}`
|
|
6031
|
+
backgroundColor: theme.colors.backgroundSecondary
|
|
5092
6032
|
},
|
|
5093
6033
|
children: "Drag a tab here to associate it with this terminal"
|
|
5094
6034
|
});
|
|
5095
|
-
const headerConfig =
|
|
5096
|
-
|
|
5097
|
-
|
|
6035
|
+
const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx7(Paperclip, {
|
|
6036
|
+
size: 14
|
|
6037
|
+
}) };
|
|
6038
|
+
const isCollapsed = hasAssociation ? association.collapsed : localCollapsedStates.get(tab.id) ?? true;
|
|
6039
|
+
const handleCollapsedChange = hasAssociation ? (collapsed) => onAssociationCollapsedChange?.(tab.id, collapsed) : (collapsed) => {
|
|
6040
|
+
setLocalCollapsedStates((prev) => new Map(prev).set(tab.id, collapsed));
|
|
6041
|
+
};
|
|
6042
|
+
return /* @__PURE__ */ jsx7(D2, {
|
|
5098
6043
|
style: { height: "100%" },
|
|
5099
6044
|
primaryContent: terminalContent,
|
|
5100
6045
|
secondaryContent,
|
|
5101
6046
|
collapsedHeader: headerConfig,
|
|
5102
|
-
collapsed:
|
|
5103
|
-
onCollapsedChange:
|
|
6047
|
+
collapsed: isCollapsed,
|
|
6048
|
+
onCollapsedChange: handleCollapsedChange,
|
|
5104
6049
|
ratio: hasAssociation ? association.ratio : 0.15,
|
|
5105
6050
|
onRatioChange: hasAssociation ? (ratio) => onAssociationRatioChange?.(tab.id, ratio) : undefined,
|
|
5106
|
-
theme
|
|
6051
|
+
theme,
|
|
6052
|
+
hideHeader: !hasAssociation
|
|
5107
6053
|
});
|
|
5108
6054
|
}, [
|
|
5109
6055
|
getRefCallback,
|
|
@@ -5122,15 +6068,17 @@ var TabbedTerminalPanelInner = ({
|
|
|
5122
6068
|
getAssociatedHeader,
|
|
5123
6069
|
onAssociationCollapsedChange,
|
|
5124
6070
|
onAssociationRatioChange,
|
|
5125
|
-
theme
|
|
6071
|
+
theme,
|
|
6072
|
+
localCollapsedStates
|
|
5126
6073
|
]);
|
|
5127
6074
|
const handleTabDrop = useCallback5((draggedTabId, targetTabId) => {
|
|
5128
6075
|
const draggedTab = tabs.find((t2) => t2.id === draggedTabId);
|
|
5129
6076
|
const targetTab = tabs.find((t2) => t2.id === targetTabId);
|
|
5130
6077
|
if (targetTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
5131
6078
|
onTabAssociate?.(targetTabId, draggedTabId);
|
|
6079
|
+
setActiveTabId(targetTabId);
|
|
5132
6080
|
}
|
|
5133
|
-
}, [tabs, onTabAssociate]);
|
|
6081
|
+
}, [tabs, onTabAssociate, setActiveTabId]);
|
|
5134
6082
|
const canDropOnTab = useCallback5((draggedTabId, targetTabId) => {
|
|
5135
6083
|
const draggedTab = tabs.find((t2) => t2.id === draggedTabId);
|
|
5136
6084
|
const targetTab = tabs.find((t2) => t2.id === targetTabId);
|
|
@@ -5164,8 +6112,9 @@ var TabbedTerminalPanelInner = ({
|
|
|
5164
6112
|
const activeTab = tabs.find((t2) => t2.id === activeTabId);
|
|
5165
6113
|
if (activeTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
5166
6114
|
onTabAssociate?.(activeTabId, draggedTabId);
|
|
6115
|
+
setActiveTabId(activeTabId);
|
|
5167
6116
|
}
|
|
5168
|
-
}, [activeTabId, tabs, onTabAssociate]);
|
|
6117
|
+
}, [activeTabId, tabs, onTabAssociate, setActiveTabId]);
|
|
5169
6118
|
return /* @__PURE__ */ jsxs6("div", {
|
|
5170
6119
|
style: {
|
|
5171
6120
|
display: "flex",
|
|
@@ -5578,7 +6527,7 @@ var panels = [
|
|
|
5578
6527
|
metadata: {
|
|
5579
6528
|
id: "com.principal.terminal",
|
|
5580
6529
|
name: "Terminal",
|
|
5581
|
-
icon: "
|
|
6530
|
+
icon: "terminal",
|
|
5582
6531
|
version: "0.1.0",
|
|
5583
6532
|
author: "Principal",
|
|
5584
6533
|
description: "Integrated terminal emulator with industry theming",
|