@industry-theme/xterm-terminal-panel 0.5.14 → 0.5.16
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.css +0 -1930
- package/dist/index.js +100 -2443
- package/dist/src/components/TabBar/TabButton.d.ts.map +1 -1
- package/dist/src/panels/TabbedTerminalPanel.d.ts.map +1 -1
- package/package.json +6 -5
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,
|
|
@@ -1878,2383 +1900,8 @@ var TerminalPanel = ({
|
|
|
1878
1900
|
};
|
|
1879
1901
|
// src/panels/TabbedTerminalPanel.tsx
|
|
1880
1902
|
import { useTheme as useTheme6 } from "@principal-ade/industry-theme";
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
import { jsx as e, jsxs as t, Fragment as n } from "react/jsx-runtime";
|
|
1884
|
-
import r, { useState as o, useRef as i, useCallback as a, useEffect as l, createContext as s, useContext as c, forwardRef as d, useImperativeHandle as u, useMemo as p, useLayoutEffect as h, memo as m, useReducer as f } from "react";
|
|
1885
|
-
|
|
1886
|
-
// node_modules/react-resizable-panels/dist/react-resizable-panels.js
|
|
1887
|
-
import { jsx as ie } from "react/jsx-runtime";
|
|
1888
|
-
import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
|
|
1889
|
-
"use client";
|
|
1890
|
-
function gt(e, t) {
|
|
1891
|
-
const n = getComputedStyle(e), o = parseFloat(n.fontSize);
|
|
1892
|
-
return t * o;
|
|
1893
|
-
}
|
|
1894
|
-
function St(e, t) {
|
|
1895
|
-
const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
|
|
1896
|
-
return t * o;
|
|
1897
|
-
}
|
|
1898
|
-
function yt(e) {
|
|
1899
|
-
return e / 100 * window.innerHeight;
|
|
1900
|
-
}
|
|
1901
|
-
function vt(e) {
|
|
1902
|
-
return e / 100 * window.innerWidth;
|
|
1903
|
-
}
|
|
1904
|
-
function zt(e) {
|
|
1905
|
-
switch (typeof e) {
|
|
1906
|
-
case "number":
|
|
1907
|
-
return [e, "px"];
|
|
1908
|
-
case "string": {
|
|
1909
|
-
const t = parseFloat(e);
|
|
1910
|
-
return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
|
|
1911
|
-
}
|
|
1912
|
-
}
|
|
1913
|
-
}
|
|
1914
|
-
function te({
|
|
1915
|
-
groupSize: e,
|
|
1916
|
-
panelElement: t,
|
|
1917
|
-
styleProp: n
|
|
1918
|
-
}) {
|
|
1919
|
-
let o;
|
|
1920
|
-
const [i, s] = zt(n);
|
|
1921
|
-
switch (s) {
|
|
1922
|
-
case "%": {
|
|
1923
|
-
o = i / 100 * e;
|
|
1924
|
-
break;
|
|
1925
|
-
}
|
|
1926
|
-
case "px": {
|
|
1927
|
-
o = i;
|
|
1928
|
-
break;
|
|
1929
|
-
}
|
|
1930
|
-
case "rem": {
|
|
1931
|
-
o = St(t, i);
|
|
1932
|
-
break;
|
|
1933
|
-
}
|
|
1934
|
-
case "em": {
|
|
1935
|
-
o = gt(t, i);
|
|
1936
|
-
break;
|
|
1937
|
-
}
|
|
1938
|
-
case "vh": {
|
|
1939
|
-
o = yt(i);
|
|
1940
|
-
break;
|
|
1941
|
-
}
|
|
1942
|
-
case "vw": {
|
|
1943
|
-
o = vt(i);
|
|
1944
|
-
break;
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
return o;
|
|
1948
|
-
}
|
|
1949
|
-
function D(e) {
|
|
1950
|
-
return parseFloat(e.toFixed(3));
|
|
1951
|
-
}
|
|
1952
|
-
function Q({
|
|
1953
|
-
group: e
|
|
1954
|
-
}) {
|
|
1955
|
-
const { orientation: t, panels: n } = e;
|
|
1956
|
-
return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
|
|
1957
|
-
}
|
|
1958
|
-
function ge(e) {
|
|
1959
|
-
const { panels: t } = e, n = Q({ group: e });
|
|
1960
|
-
return n === 0 ? t.map((o) => ({
|
|
1961
|
-
groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
|
|
1962
|
-
collapsedSize: 0,
|
|
1963
|
-
collapsible: o.panelConstraints.collapsible === true,
|
|
1964
|
-
defaultSize: undefined,
|
|
1965
|
-
disabled: o.panelConstraints.disabled,
|
|
1966
|
-
minSize: 0,
|
|
1967
|
-
maxSize: 100,
|
|
1968
|
-
panelId: o.id
|
|
1969
|
-
})) : t.map((o) => {
|
|
1970
|
-
const { element: i, panelConstraints: s } = o;
|
|
1971
|
-
let l = 0;
|
|
1972
|
-
if (s.collapsedSize !== undefined) {
|
|
1973
|
-
const c = te({
|
|
1974
|
-
groupSize: n,
|
|
1975
|
-
panelElement: i,
|
|
1976
|
-
styleProp: s.collapsedSize
|
|
1977
|
-
});
|
|
1978
|
-
l = D(c / n * 100);
|
|
1979
|
-
}
|
|
1980
|
-
let r;
|
|
1981
|
-
if (s.defaultSize !== undefined) {
|
|
1982
|
-
const c = te({
|
|
1983
|
-
groupSize: n,
|
|
1984
|
-
panelElement: i,
|
|
1985
|
-
styleProp: s.defaultSize
|
|
1986
|
-
});
|
|
1987
|
-
r = D(c / n * 100);
|
|
1988
|
-
}
|
|
1989
|
-
let a = 0;
|
|
1990
|
-
if (s.minSize !== undefined) {
|
|
1991
|
-
const c = te({
|
|
1992
|
-
groupSize: n,
|
|
1993
|
-
panelElement: i,
|
|
1994
|
-
styleProp: s.minSize
|
|
1995
|
-
});
|
|
1996
|
-
a = D(c / n * 100);
|
|
1997
|
-
}
|
|
1998
|
-
let u = 100;
|
|
1999
|
-
if (s.maxSize !== undefined) {
|
|
2000
|
-
const c = te({
|
|
2001
|
-
groupSize: n,
|
|
2002
|
-
panelElement: i,
|
|
2003
|
-
styleProp: s.maxSize
|
|
2004
|
-
});
|
|
2005
|
-
u = D(c / n * 100);
|
|
2006
|
-
}
|
|
2007
|
-
return {
|
|
2008
|
-
groupResizeBehavior: s.groupResizeBehavior,
|
|
2009
|
-
collapsedSize: l,
|
|
2010
|
-
collapsible: s.collapsible === true,
|
|
2011
|
-
defaultSize: r,
|
|
2012
|
-
disabled: s.disabled,
|
|
2013
|
-
minSize: a,
|
|
2014
|
-
maxSize: u,
|
|
2015
|
-
panelId: o.id
|
|
2016
|
-
};
|
|
2017
|
-
});
|
|
2018
|
-
}
|
|
2019
|
-
function L(e, t = "Assertion error") {
|
|
2020
|
-
if (!e)
|
|
2021
|
-
throw Error(t);
|
|
2022
|
-
}
|
|
2023
|
-
function Se(e, t) {
|
|
2024
|
-
return Array.from(t).sort(e === "horizontal" ? bt : xt);
|
|
2025
|
-
}
|
|
2026
|
-
function bt(e, t) {
|
|
2027
|
-
const n = e.element.offsetLeft - t.element.offsetLeft;
|
|
2028
|
-
return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
|
|
2029
|
-
}
|
|
2030
|
-
function xt(e, t) {
|
|
2031
|
-
const n = e.element.offsetTop - t.element.offsetTop;
|
|
2032
|
-
return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
|
|
2033
|
-
}
|
|
2034
|
-
function Xe(e) {
|
|
2035
|
-
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
|
|
2036
|
-
}
|
|
2037
|
-
function qe(e, t) {
|
|
2038
|
-
return {
|
|
2039
|
-
x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(Math.abs(e.x - t.left), Math.abs(e.x - t.right)),
|
|
2040
|
-
y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(Math.abs(e.y - t.top), Math.abs(e.y - t.bottom))
|
|
2041
|
-
};
|
|
2042
|
-
}
|
|
2043
|
-
function wt({
|
|
2044
|
-
orientation: e,
|
|
2045
|
-
rects: t,
|
|
2046
|
-
targetRect: n
|
|
2047
|
-
}) {
|
|
2048
|
-
const o = {
|
|
2049
|
-
x: n.x + n.width / 2,
|
|
2050
|
-
y: n.y + n.height / 2
|
|
2051
|
-
};
|
|
2052
|
-
let i, s = Number.MAX_VALUE;
|
|
2053
|
-
for (const l of t) {
|
|
2054
|
-
const { x: r, y: a } = qe(o, l), u = e === "horizontal" ? r : a;
|
|
2055
|
-
u < s && (s = u, i = l);
|
|
2056
|
-
}
|
|
2057
|
-
return L(i, "No rect found"), i;
|
|
2058
|
-
}
|
|
2059
|
-
var ue;
|
|
2060
|
-
function Pt() {
|
|
2061
|
-
return ue === undefined && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = false), ue;
|
|
2062
|
-
}
|
|
2063
|
-
function Ye(e) {
|
|
2064
|
-
const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(n, Array.from(t.children).filter(Xe).map((x) => ({ element: x }))).map(({ element: x }) => x), l = [];
|
|
2065
|
-
let r = false, a = false, u = -1, c = -1, m = 0, d, v = [];
|
|
2066
|
-
{
|
|
2067
|
-
let x = -1;
|
|
2068
|
-
for (const f of s)
|
|
2069
|
-
f.hasAttribute("data-panel") && (x++, f.ariaDisabled === null && (m++, u === -1 && (u = x), c = x));
|
|
2070
|
-
}
|
|
2071
|
-
if (m > 1) {
|
|
2072
|
-
let x = -1;
|
|
2073
|
-
for (const f of s)
|
|
2074
|
-
if (f.hasAttribute("data-panel")) {
|
|
2075
|
-
x++;
|
|
2076
|
-
const h = o.find((g) => g.element === f);
|
|
2077
|
-
if (h) {
|
|
2078
|
-
if (d) {
|
|
2079
|
-
const g = d.element.getBoundingClientRect(), y = f.getBoundingClientRect();
|
|
2080
|
-
let z;
|
|
2081
|
-
if (a) {
|
|
2082
|
-
const S = n === "horizontal" ? new DOMRect(g.right, g.top, 0, g.height) : new DOMRect(g.left, g.bottom, g.width, 0), p = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
|
|
2083
|
-
switch (v.length) {
|
|
2084
|
-
case 0: {
|
|
2085
|
-
z = [
|
|
2086
|
-
S,
|
|
2087
|
-
p
|
|
2088
|
-
];
|
|
2089
|
-
break;
|
|
2090
|
-
}
|
|
2091
|
-
case 1: {
|
|
2092
|
-
const P = v[0], R = wt({
|
|
2093
|
-
orientation: n,
|
|
2094
|
-
rects: [g, y],
|
|
2095
|
-
targetRect: P.element.getBoundingClientRect()
|
|
2096
|
-
});
|
|
2097
|
-
z = [
|
|
2098
|
-
P,
|
|
2099
|
-
R === g ? p : S
|
|
2100
|
-
];
|
|
2101
|
-
break;
|
|
2102
|
-
}
|
|
2103
|
-
default: {
|
|
2104
|
-
z = v;
|
|
2105
|
-
break;
|
|
2106
|
-
}
|
|
2107
|
-
}
|
|
2108
|
-
} else
|
|
2109
|
-
v.length ? z = v : z = [
|
|
2110
|
-
n === "horizontal" ? new DOMRect(g.right, y.top, y.left - g.right, y.height) : new DOMRect(y.left, g.bottom, y.width, y.top - g.bottom)
|
|
2111
|
-
];
|
|
2112
|
-
for (const S of z) {
|
|
2113
|
-
let p = "width" in S ? S : S.element.getBoundingClientRect();
|
|
2114
|
-
const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
|
|
2115
|
-
if (p.width < P) {
|
|
2116
|
-
const C = P - p.width;
|
|
2117
|
-
p = new DOMRect(p.x - C / 2, p.y, p.width + C, p.height);
|
|
2118
|
-
}
|
|
2119
|
-
if (p.height < P) {
|
|
2120
|
-
const C = P - p.height;
|
|
2121
|
-
p = new DOMRect(p.x, p.y - C / 2, p.width, p.height + C);
|
|
2122
|
-
}
|
|
2123
|
-
const R = x <= u || x > c;
|
|
2124
|
-
!r && !R && l.push({
|
|
2125
|
-
group: e,
|
|
2126
|
-
groupSize: Q({ group: e }),
|
|
2127
|
-
panels: [d, h],
|
|
2128
|
-
separator: "width" in S ? undefined : S,
|
|
2129
|
-
rect: p
|
|
2130
|
-
}), r = false;
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
a = false, d = h, v = [];
|
|
2134
|
-
}
|
|
2135
|
-
} else if (f.hasAttribute("data-separator")) {
|
|
2136
|
-
f.ariaDisabled !== null && (r = true);
|
|
2137
|
-
const h = i.find((g) => g.element === f);
|
|
2138
|
-
h ? v.push(h) : (d = undefined, v = []);
|
|
2139
|
-
} else
|
|
2140
|
-
a = true;
|
|
2141
|
-
}
|
|
2142
|
-
return l;
|
|
2143
|
-
}
|
|
2144
|
-
|
|
2145
|
-
class Je {
|
|
2146
|
-
#e = {};
|
|
2147
|
-
addListener(t, n) {
|
|
2148
|
-
const o = this.#e[t];
|
|
2149
|
-
return o === undefined ? this.#e[t] = [n] : o.includes(n) || o.push(n), () => {
|
|
2150
|
-
this.removeListener(t, n);
|
|
2151
|
-
};
|
|
2152
|
-
}
|
|
2153
|
-
emit(t, n) {
|
|
2154
|
-
const o = this.#e[t];
|
|
2155
|
-
if (o !== undefined)
|
|
2156
|
-
if (o.length === 1)
|
|
2157
|
-
o[0].call(null, n);
|
|
2158
|
-
else {
|
|
2159
|
-
let i = false, s = null;
|
|
2160
|
-
const l = Array.from(o);
|
|
2161
|
-
for (let r = 0;r < l.length; r++) {
|
|
2162
|
-
const a = l[r];
|
|
2163
|
-
try {
|
|
2164
|
-
a.call(null, n);
|
|
2165
|
-
} catch (u) {
|
|
2166
|
-
s === null && (i = true, s = u);
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
if (i)
|
|
2170
|
-
throw s;
|
|
2171
|
-
}
|
|
2172
|
-
}
|
|
2173
|
-
removeAllListeners() {
|
|
2174
|
-
this.#e = {};
|
|
2175
|
-
}
|
|
2176
|
-
removeListener(t, n) {
|
|
2177
|
-
const o = this.#e[t];
|
|
2178
|
-
if (o !== undefined) {
|
|
2179
|
-
const i = o.indexOf(n);
|
|
2180
|
-
i >= 0 && o.splice(i, 1);
|
|
2181
|
-
}
|
|
2182
|
-
}
|
|
2183
|
-
}
|
|
2184
|
-
var A = /* @__PURE__ */ new Map;
|
|
2185
|
-
var Ze = new Je;
|
|
2186
|
-
function Lt(e) {
|
|
2187
|
-
A = new Map(A), A.delete(e);
|
|
2188
|
-
}
|
|
2189
|
-
function Me(e, t) {
|
|
2190
|
-
for (const [n] of A)
|
|
2191
|
-
if (n.id === e)
|
|
2192
|
-
return n;
|
|
2193
|
-
}
|
|
2194
|
-
function $(e, t) {
|
|
2195
|
-
for (const [n, o] of A)
|
|
2196
|
-
if (n.id === e)
|
|
2197
|
-
return o;
|
|
2198
|
-
if (t)
|
|
2199
|
-
throw Error(`Could not find data for Group with id ${e}`);
|
|
2200
|
-
}
|
|
2201
|
-
function U() {
|
|
2202
|
-
return A;
|
|
2203
|
-
}
|
|
2204
|
-
function ye(e, t) {
|
|
2205
|
-
return Ze.addListener("groupChange", (n) => {
|
|
2206
|
-
n.group.id === e && t(n);
|
|
2207
|
-
});
|
|
2208
|
-
}
|
|
2209
|
-
function _(e, t) {
|
|
2210
|
-
const n = A.get(e);
|
|
2211
|
-
A = new Map(A), A.set(e, t), Ze.emit("groupChange", {
|
|
2212
|
-
group: e,
|
|
2213
|
-
prev: n,
|
|
2214
|
-
next: t
|
|
2215
|
-
});
|
|
2216
|
-
}
|
|
2217
|
-
function Ct(e, t, n) {
|
|
2218
|
-
let o, i = {
|
|
2219
|
-
x: 1 / 0,
|
|
2220
|
-
y: 1 / 0
|
|
2221
|
-
};
|
|
2222
|
-
for (const s of t) {
|
|
2223
|
-
const l = qe(n, s.rect);
|
|
2224
|
-
switch (e) {
|
|
2225
|
-
case "horizontal": {
|
|
2226
|
-
l.x <= i.x && (o = s, i = l);
|
|
2227
|
-
break;
|
|
2228
|
-
}
|
|
2229
|
-
case "vertical": {
|
|
2230
|
-
l.y <= i.y && (o = s, i = l);
|
|
2231
|
-
break;
|
|
2232
|
-
}
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
return o ? {
|
|
2236
|
-
distance: i,
|
|
2237
|
-
hitRegion: o
|
|
2238
|
-
} : undefined;
|
|
2239
|
-
}
|
|
2240
|
-
function Rt(e) {
|
|
2241
|
-
return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
|
|
2242
|
-
}
|
|
2243
|
-
function Mt(e, t) {
|
|
2244
|
-
if (e === t)
|
|
2245
|
-
throw new Error("Cannot compare node with itself");
|
|
2246
|
-
const n = {
|
|
2247
|
-
a: ke(e),
|
|
2248
|
-
b: ke(t)
|
|
2249
|
-
};
|
|
2250
|
-
let o;
|
|
2251
|
-
for (;n.a.at(-1) === n.b.at(-1); )
|
|
2252
|
-
o = n.a.pop(), n.b.pop();
|
|
2253
|
-
L(o, "Stacking order can only be calculated for elements with a common ancestor");
|
|
2254
|
-
const i = {
|
|
2255
|
-
a: Ie(Ee(n.a)),
|
|
2256
|
-
b: Ie(Ee(n.b))
|
|
2257
|
-
};
|
|
2258
|
-
if (i.a === i.b) {
|
|
2259
|
-
const s = o.childNodes, l = {
|
|
2260
|
-
a: n.a.at(-1),
|
|
2261
|
-
b: n.b.at(-1)
|
|
2262
|
-
};
|
|
2263
|
-
let r = s.length;
|
|
2264
|
-
for (;r--; ) {
|
|
2265
|
-
const a = s[r];
|
|
2266
|
-
if (a === l.a)
|
|
2267
|
-
return 1;
|
|
2268
|
-
if (a === l.b)
|
|
2269
|
-
return -1;
|
|
2270
|
-
}
|
|
2271
|
-
}
|
|
2272
|
-
return Math.sign(i.a - i.b);
|
|
2273
|
-
}
|
|
2274
|
-
var Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
2275
|
-
function It(e) {
|
|
2276
|
-
const t = getComputedStyle(Qe(e) ?? e).display;
|
|
2277
|
-
return t === "flex" || t === "inline-flex";
|
|
2278
|
-
}
|
|
2279
|
-
function kt(e) {
|
|
2280
|
-
const t = getComputedStyle(e);
|
|
2281
|
-
return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || It(e)) || +t.opacity < 1 || ("transform" in t) && t.transform !== "none" || ("webkitTransform" in t) && t.webkitTransform !== "none" || ("mixBlendMode" in t) && t.mixBlendMode !== "normal" || ("filter" in t) && t.filter !== "none" || ("webkitFilter" in t) && t.webkitFilter !== "none" || ("isolation" in t) && t.isolation === "isolate" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
|
|
2282
|
-
}
|
|
2283
|
-
function Ee(e) {
|
|
2284
|
-
let t = e.length;
|
|
2285
|
-
for (;t--; ) {
|
|
2286
|
-
const n = e[t];
|
|
2287
|
-
if (L(n, "Missing node"), kt(n))
|
|
2288
|
-
return n;
|
|
2289
|
-
}
|
|
2290
|
-
return null;
|
|
2291
|
-
}
|
|
2292
|
-
function Ie(e) {
|
|
2293
|
-
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
2294
|
-
}
|
|
2295
|
-
function ke(e) {
|
|
2296
|
-
const t = [];
|
|
2297
|
-
for (;e; )
|
|
2298
|
-
t.push(e), e = Qe(e);
|
|
2299
|
-
return t;
|
|
2300
|
-
}
|
|
2301
|
-
function Qe(e) {
|
|
2302
|
-
const { parentNode: t } = e;
|
|
2303
|
-
return Rt(t) ? t.host : t;
|
|
2304
|
-
}
|
|
2305
|
-
function Dt(e, t) {
|
|
2306
|
-
return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
|
|
2307
|
-
}
|
|
2308
|
-
function Tt({
|
|
2309
|
-
groupElement: e,
|
|
2310
|
-
hitRegion: t,
|
|
2311
|
-
pointerEventTarget: n
|
|
2312
|
-
}) {
|
|
2313
|
-
if (!Xe(n) || n.contains(e) || e.contains(n))
|
|
2314
|
-
return true;
|
|
2315
|
-
if (Mt(n, e) > 0) {
|
|
2316
|
-
let o = n;
|
|
2317
|
-
for (;o; ) {
|
|
2318
|
-
if (o.contains(e))
|
|
2319
|
-
return true;
|
|
2320
|
-
if (Dt(o.getBoundingClientRect(), t))
|
|
2321
|
-
return false;
|
|
2322
|
-
o = o.parentElement;
|
|
2323
|
-
}
|
|
2324
|
-
}
|
|
2325
|
-
return true;
|
|
2326
|
-
}
|
|
2327
|
-
function ve(e, t) {
|
|
2328
|
-
const n = [];
|
|
2329
|
-
return t.forEach((o, i) => {
|
|
2330
|
-
if (i.disabled)
|
|
2331
|
-
return;
|
|
2332
|
-
const s = Ye(i), l = Ct(i.orientation, s, {
|
|
2333
|
-
x: e.clientX,
|
|
2334
|
-
y: e.clientY
|
|
2335
|
-
});
|
|
2336
|
-
l && l.distance.x <= 0 && l.distance.y <= 0 && Tt({
|
|
2337
|
-
groupElement: i.element,
|
|
2338
|
-
hitRegion: l.hitRegion.rect,
|
|
2339
|
-
pointerEventTarget: e.target
|
|
2340
|
-
}) && n.push(l.hitRegion);
|
|
2341
|
-
}), n;
|
|
2342
|
-
}
|
|
2343
|
-
function Ot(e, t) {
|
|
2344
|
-
if (e.length !== t.length)
|
|
2345
|
-
return false;
|
|
2346
|
-
for (let n = 0;n < e.length; n++)
|
|
2347
|
-
if (e[n] != t[n])
|
|
2348
|
-
return false;
|
|
2349
|
-
return true;
|
|
2350
|
-
}
|
|
2351
|
-
function I(e, t, n = 0) {
|
|
2352
|
-
return Math.abs(D(e) - D(t)) <= n;
|
|
2353
|
-
}
|
|
2354
|
-
function G(e, t) {
|
|
2355
|
-
return I(e, t) ? 0 : e > t ? 1 : -1;
|
|
2356
|
-
}
|
|
2357
|
-
function Y({
|
|
2358
|
-
overrideDisabledPanels: e,
|
|
2359
|
-
panelConstraints: t,
|
|
2360
|
-
prevSize: n,
|
|
2361
|
-
size: o
|
|
2362
|
-
}) {
|
|
2363
|
-
const {
|
|
2364
|
-
collapsedSize: i = 0,
|
|
2365
|
-
collapsible: s,
|
|
2366
|
-
disabled: l,
|
|
2367
|
-
maxSize: r = 100,
|
|
2368
|
-
minSize: a = 0
|
|
2369
|
-
} = t;
|
|
2370
|
-
if (l && !e)
|
|
2371
|
-
return n;
|
|
2372
|
-
if (G(o, a) < 0)
|
|
2373
|
-
if (s) {
|
|
2374
|
-
const u = (i + a) / 2;
|
|
2375
|
-
G(o, u) < 0 ? o = i : o = a;
|
|
2376
|
-
} else
|
|
2377
|
-
o = a;
|
|
2378
|
-
return o = Math.min(r, o), o = D(o), o;
|
|
2379
|
-
}
|
|
2380
|
-
function se({
|
|
2381
|
-
delta: e,
|
|
2382
|
-
initialLayout: t,
|
|
2383
|
-
panelConstraints: n,
|
|
2384
|
-
pivotIndices: o,
|
|
2385
|
-
prevLayout: i,
|
|
2386
|
-
trigger: s
|
|
2387
|
-
}) {
|
|
2388
|
-
if (I(e, 0))
|
|
2389
|
-
return t;
|
|
2390
|
-
const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, m] = o;
|
|
2391
|
-
L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
|
|
2392
|
-
let d = 0;
|
|
2393
|
-
switch (s) {
|
|
2394
|
-
case "keyboard": {
|
|
2395
|
-
{
|
|
2396
|
-
const f = e < 0 ? m : c, h = n[f];
|
|
2397
|
-
L(h, `Panel constraints not found for index ${f}`);
|
|
2398
|
-
const {
|
|
2399
|
-
collapsedSize: g = 0,
|
|
2400
|
-
collapsible: y,
|
|
2401
|
-
minSize: z = 0
|
|
2402
|
-
} = h;
|
|
2403
|
-
if (y) {
|
|
2404
|
-
const S = r[f];
|
|
2405
|
-
if (L(S != null, `Previous layout not found for panel index ${f}`), I(S, g)) {
|
|
2406
|
-
const p = z - S;
|
|
2407
|
-
G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
}
|
|
2411
|
-
{
|
|
2412
|
-
const f = e < 0 ? c : m, h = n[f];
|
|
2413
|
-
L(h, `No panel constraints found for index ${f}`);
|
|
2414
|
-
const {
|
|
2415
|
-
collapsedSize: g = 0,
|
|
2416
|
-
collapsible: y,
|
|
2417
|
-
minSize: z = 0
|
|
2418
|
-
} = h;
|
|
2419
|
-
if (y) {
|
|
2420
|
-
const S = r[f];
|
|
2421
|
-
if (L(S != null, `Previous layout not found for panel index ${f}`), I(S, z)) {
|
|
2422
|
-
const p = S - g;
|
|
2423
|
-
G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
|
|
2424
|
-
}
|
|
2425
|
-
}
|
|
2426
|
-
}
|
|
2427
|
-
break;
|
|
2428
|
-
}
|
|
2429
|
-
default: {
|
|
2430
|
-
const f = e < 0 ? m : c, h = n[f];
|
|
2431
|
-
L(h, `Panel constraints not found for index ${f}`);
|
|
2432
|
-
const g = r[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
|
|
2433
|
-
if (y && G(g, S) < 0)
|
|
2434
|
-
if (e > 0) {
|
|
2435
|
-
const p = S - z, P = p / 2, R = g + e;
|
|
2436
|
-
G(R, S) < 0 && (e = G(e, P) <= 0 ? 0 : p);
|
|
2437
|
-
} else {
|
|
2438
|
-
const p = S - z, P = 100 - p / 2, R = g - e;
|
|
2439
|
-
G(R, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -p);
|
|
2440
|
-
}
|
|
2441
|
-
break;
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
{
|
|
2445
|
-
const f = e < 0 ? 1 : -1;
|
|
2446
|
-
let h = e < 0 ? m : c, g = 0;
|
|
2447
|
-
for (;; ) {
|
|
2448
|
-
const z = r[h];
|
|
2449
|
-
L(z != null, `Previous layout not found for panel index ${h}`);
|
|
2450
|
-
const p = Y({
|
|
2451
|
-
overrideDisabledPanels: l,
|
|
2452
|
-
panelConstraints: n[h],
|
|
2453
|
-
prevSize: z,
|
|
2454
|
-
size: 100
|
|
2455
|
-
}) - z;
|
|
2456
|
-
if (g += p, h += f, h < 0 || h >= n.length)
|
|
2457
|
-
break;
|
|
2458
|
-
}
|
|
2459
|
-
const y = Math.min(Math.abs(e), Math.abs(g));
|
|
2460
|
-
e = e < 0 ? 0 - y : y;
|
|
2461
|
-
}
|
|
2462
|
-
{
|
|
2463
|
-
let h = e < 0 ? c : m;
|
|
2464
|
-
for (;h >= 0 && h < n.length; ) {
|
|
2465
|
-
const g = Math.abs(e) - Math.abs(d), y = r[h];
|
|
2466
|
-
L(y != null, `Previous layout not found for panel index ${h}`);
|
|
2467
|
-
const z = y - g, S = Y({
|
|
2468
|
-
overrideDisabledPanels: l,
|
|
2469
|
-
panelConstraints: n[h],
|
|
2470
|
-
prevSize: y,
|
|
2471
|
-
size: z
|
|
2472
|
-
});
|
|
2473
|
-
if (!I(y, S) && (d += y - S, u[h] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), undefined, {
|
|
2474
|
-
numeric: true
|
|
2475
|
-
}) >= 0))
|
|
2476
|
-
break;
|
|
2477
|
-
e < 0 ? h-- : h++;
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
if (Ot(a, u))
|
|
2481
|
-
return i;
|
|
2482
|
-
{
|
|
2483
|
-
const f = e < 0 ? m : c, h = r[f];
|
|
2484
|
-
L(h != null, `Previous layout not found for panel index ${f}`);
|
|
2485
|
-
const g = h + d, y = Y({
|
|
2486
|
-
overrideDisabledPanels: l,
|
|
2487
|
-
panelConstraints: n[f],
|
|
2488
|
-
prevSize: h,
|
|
2489
|
-
size: g
|
|
2490
|
-
});
|
|
2491
|
-
if (u[f] = y, !I(y, g)) {
|
|
2492
|
-
let z = g - y, p = e < 0 ? m : c;
|
|
2493
|
-
for (;p >= 0 && p < n.length; ) {
|
|
2494
|
-
const P = u[p];
|
|
2495
|
-
L(P != null, `Previous layout not found for panel index ${p}`);
|
|
2496
|
-
const R = P + z, C = Y({
|
|
2497
|
-
overrideDisabledPanels: l,
|
|
2498
|
-
panelConstraints: n[p],
|
|
2499
|
-
prevSize: P,
|
|
2500
|
-
size: R
|
|
2501
|
-
});
|
|
2502
|
-
if (I(P, C) || (z -= C - P, u[p] = C), I(z, 0))
|
|
2503
|
-
break;
|
|
2504
|
-
e > 0 ? p-- : p++;
|
|
2505
|
-
}
|
|
2506
|
-
}
|
|
2507
|
-
}
|
|
2508
|
-
const v = Object.values(u).reduce((f, h) => h + f, 0);
|
|
2509
|
-
if (!I(v, 100, 0.1))
|
|
2510
|
-
return i;
|
|
2511
|
-
const x = Object.keys(i);
|
|
2512
|
-
return u.reduce((f, h, g) => (f[x[g]] = h, f), {});
|
|
2513
|
-
}
|
|
2514
|
-
function j(e, t) {
|
|
2515
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
2516
|
-
return false;
|
|
2517
|
-
for (const n in e)
|
|
2518
|
-
if (t[n] === undefined || G(e[n], t[n]) !== 0)
|
|
2519
|
-
return false;
|
|
2520
|
-
return true;
|
|
2521
|
-
}
|
|
2522
|
-
function B({
|
|
2523
|
-
layout: e,
|
|
2524
|
-
panelConstraints: t
|
|
2525
|
-
}) {
|
|
2526
|
-
const n = Object.values(e), o = [...n], i = o.reduce((r, a) => r + a, 0);
|
|
2527
|
-
if (o.length !== t.length)
|
|
2528
|
-
throw Error(`Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`);
|
|
2529
|
-
if (!I(i, 100) && o.length > 0)
|
|
2530
|
-
for (let r = 0;r < t.length; r++) {
|
|
2531
|
-
const a = o[r];
|
|
2532
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2533
|
-
const u = 100 / i * a;
|
|
2534
|
-
o[r] = u;
|
|
2535
|
-
}
|
|
2536
|
-
let s = 0;
|
|
2537
|
-
for (let r = 0;r < t.length; r++) {
|
|
2538
|
-
const a = n[r];
|
|
2539
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2540
|
-
const u = o[r];
|
|
2541
|
-
L(u != null, `No layout data found for index ${r}`);
|
|
2542
|
-
const c = Y({
|
|
2543
|
-
overrideDisabledPanels: true,
|
|
2544
|
-
panelConstraints: t[r],
|
|
2545
|
-
prevSize: a,
|
|
2546
|
-
size: u
|
|
2547
|
-
});
|
|
2548
|
-
u != c && (s += u - c, o[r] = c);
|
|
2549
|
-
}
|
|
2550
|
-
if (!I(s, 0))
|
|
2551
|
-
for (let r = 0;r < t.length; r++) {
|
|
2552
|
-
const a = o[r];
|
|
2553
|
-
L(a != null, `No layout data found for index ${r}`);
|
|
2554
|
-
const u = a + s, c = Y({
|
|
2555
|
-
overrideDisabledPanels: true,
|
|
2556
|
-
panelConstraints: t[r],
|
|
2557
|
-
prevSize: a,
|
|
2558
|
-
size: u
|
|
2559
|
-
});
|
|
2560
|
-
if (a !== c && (s -= c - a, o[r] = c, I(s, 0)))
|
|
2561
|
-
break;
|
|
2562
|
-
}
|
|
2563
|
-
const l = Object.keys(e);
|
|
2564
|
-
return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
|
|
2565
|
-
}
|
|
2566
|
-
function et({
|
|
2567
|
-
groupId: e,
|
|
2568
|
-
panelId: t
|
|
2569
|
-
}) {
|
|
2570
|
-
const n = () => {
|
|
2571
|
-
const r = U();
|
|
2572
|
-
for (const [
|
|
2573
|
-
a,
|
|
2574
|
-
{
|
|
2575
|
-
defaultLayoutDeferred: u,
|
|
2576
|
-
derivedPanelConstraints: c,
|
|
2577
|
-
layout: m,
|
|
2578
|
-
groupSize: d,
|
|
2579
|
-
separatorToPanels: v
|
|
2580
|
-
}
|
|
2581
|
-
] of r)
|
|
2582
|
-
if (a.id === e)
|
|
2583
|
-
return {
|
|
2584
|
-
defaultLayoutDeferred: u,
|
|
2585
|
-
derivedPanelConstraints: c,
|
|
2586
|
-
group: a,
|
|
2587
|
-
groupSize: d,
|
|
2588
|
-
layout: m,
|
|
2589
|
-
separatorToPanels: v
|
|
2590
|
-
};
|
|
2591
|
-
throw Error(`Group ${e} not found`);
|
|
2592
|
-
}, o = () => {
|
|
2593
|
-
const r = n().derivedPanelConstraints.find((a) => a.panelId === t);
|
|
2594
|
-
if (r !== undefined)
|
|
2595
|
-
return r;
|
|
2596
|
-
throw Error(`Panel constraints not found for Panel ${t}`);
|
|
2597
|
-
}, i = () => {
|
|
2598
|
-
const r = n().group.panels.find((a) => a.id === t);
|
|
2599
|
-
if (r !== undefined)
|
|
2600
|
-
return r;
|
|
2601
|
-
throw Error(`Layout not found for Panel ${t}`);
|
|
2602
|
-
}, s = () => {
|
|
2603
|
-
const r = n().layout[t];
|
|
2604
|
-
if (r !== undefined)
|
|
2605
|
-
return r;
|
|
2606
|
-
throw Error(`Layout not found for Panel ${t}`);
|
|
2607
|
-
}, l = (r) => {
|
|
2608
|
-
const a = s();
|
|
2609
|
-
if (r === a)
|
|
2610
|
-
return;
|
|
2611
|
-
const {
|
|
2612
|
-
defaultLayoutDeferred: u,
|
|
2613
|
-
derivedPanelConstraints: c,
|
|
2614
|
-
group: m,
|
|
2615
|
-
groupSize: d,
|
|
2616
|
-
layout: v,
|
|
2617
|
-
separatorToPanels: x
|
|
2618
|
-
} = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = se({
|
|
2619
|
-
delta: h ? a - r : r - a,
|
|
2620
|
-
initialLayout: v,
|
|
2621
|
-
panelConstraints: c,
|
|
2622
|
-
pivotIndices: h ? [f - 1, f] : [f, f + 1],
|
|
2623
|
-
prevLayout: v,
|
|
2624
|
-
trigger: "imperative-api"
|
|
2625
|
-
}), y = B({
|
|
2626
|
-
layout: g,
|
|
2627
|
-
panelConstraints: c
|
|
2628
|
-
});
|
|
2629
|
-
j(v, y) || _(m, {
|
|
2630
|
-
defaultLayoutDeferred: u,
|
|
2631
|
-
derivedPanelConstraints: c,
|
|
2632
|
-
groupSize: d,
|
|
2633
|
-
layout: y,
|
|
2634
|
-
separatorToPanels: x
|
|
2635
|
-
});
|
|
2636
|
-
};
|
|
2637
|
-
return {
|
|
2638
|
-
collapse: () => {
|
|
2639
|
-
const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
|
|
2640
|
-
r && c !== a && (u.expandToSize = c, l(a));
|
|
2641
|
-
},
|
|
2642
|
-
expand: () => {
|
|
2643
|
-
const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = s();
|
|
2644
|
-
if (r && m === a) {
|
|
2645
|
-
let d = c.expandToSize ?? u;
|
|
2646
|
-
d === 0 && (d = 1), l(d);
|
|
2647
|
-
}
|
|
2648
|
-
},
|
|
2649
|
-
getSize: () => {
|
|
2650
|
-
const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
|
|
2651
|
-
return {
|
|
2652
|
-
asPercentage: a,
|
|
2653
|
-
inPixels: c
|
|
2654
|
-
};
|
|
2655
|
-
},
|
|
2656
|
-
isCollapsed: () => {
|
|
2657
|
-
const { collapsible: r, collapsedSize: a } = o(), u = s();
|
|
2658
|
-
return r && I(a, u);
|
|
2659
|
-
},
|
|
2660
|
-
resize: (r) => {
|
|
2661
|
-
const { group: a } = n(), { element: u } = i(), c = Q({ group: a }), m = te({
|
|
2662
|
-
groupSize: c,
|
|
2663
|
-
panelElement: u,
|
|
2664
|
-
styleProp: r
|
|
2665
|
-
}), d = D(m / c * 100);
|
|
2666
|
-
l(d);
|
|
2667
|
-
}
|
|
2668
|
-
};
|
|
2669
|
-
}
|
|
2670
|
-
function De(e) {
|
|
2671
|
-
if (e.defaultPrevented)
|
|
2672
|
-
return;
|
|
2673
|
-
const t = U();
|
|
2674
|
-
ve(e, t).forEach((o) => {
|
|
2675
|
-
if (o.separator) {
|
|
2676
|
-
const i = o.panels.find((s) => s.panelConstraints.defaultSize !== undefined);
|
|
2677
|
-
if (i) {
|
|
2678
|
-
const s = i.panelConstraints.defaultSize, l = et({
|
|
2679
|
-
groupId: o.group.id,
|
|
2680
|
-
panelId: i.id
|
|
2681
|
-
});
|
|
2682
|
-
l && s !== undefined && (l.resize(s), e.preventDefault());
|
|
2683
|
-
}
|
|
2684
|
-
}
|
|
2685
|
-
});
|
|
2686
|
-
}
|
|
2687
|
-
function fe(e) {
|
|
2688
|
-
const t = U();
|
|
2689
|
-
for (const [n] of t)
|
|
2690
|
-
if (n.separators.some((o) => o.element === e))
|
|
2691
|
-
return n;
|
|
2692
|
-
throw Error("Could not find parent Group for separator element");
|
|
2693
|
-
}
|
|
2694
|
-
function tt({
|
|
2695
|
-
groupId: e
|
|
2696
|
-
}) {
|
|
2697
|
-
const t = () => {
|
|
2698
|
-
const n = U();
|
|
2699
|
-
for (const [o, i] of n)
|
|
2700
|
-
if (o.id === e)
|
|
2701
|
-
return { group: o, ...i };
|
|
2702
|
-
throw Error(`Could not find Group with id "${e}"`);
|
|
2703
|
-
};
|
|
2704
|
-
return {
|
|
2705
|
-
getLayout() {
|
|
2706
|
-
const { defaultLayoutDeferred: n, layout: o } = t();
|
|
2707
|
-
return n ? {} : o;
|
|
2708
|
-
},
|
|
2709
|
-
setLayout(n) {
|
|
2710
|
-
const {
|
|
2711
|
-
defaultLayoutDeferred: o,
|
|
2712
|
-
derivedPanelConstraints: i,
|
|
2713
|
-
group: s,
|
|
2714
|
-
groupSize: l,
|
|
2715
|
-
layout: r,
|
|
2716
|
-
separatorToPanels: a
|
|
2717
|
-
} = t(), u = B({
|
|
2718
|
-
layout: n,
|
|
2719
|
-
panelConstraints: i
|
|
2720
|
-
});
|
|
2721
|
-
return o ? r : (j(r, u) || _(s, {
|
|
2722
|
-
defaultLayoutDeferred: o,
|
|
2723
|
-
derivedPanelConstraints: i,
|
|
2724
|
-
groupSize: l,
|
|
2725
|
-
layout: u,
|
|
2726
|
-
separatorToPanels: a
|
|
2727
|
-
}), u);
|
|
2728
|
-
}
|
|
2729
|
-
};
|
|
2730
|
-
}
|
|
2731
|
-
function V(e, t) {
|
|
2732
|
-
const n = fe(e), o = $(n.id, true), i = n.separators.find((m) => m.element === e);
|
|
2733
|
-
L(i, "Matching separator not found");
|
|
2734
|
-
const s = o.separatorToPanels.get(i);
|
|
2735
|
-
L(s, "Matching panels not found");
|
|
2736
|
-
const l = s.map((m) => n.panels.indexOf(m)), a = tt({ groupId: n.id }).getLayout(), u = se({
|
|
2737
|
-
delta: t,
|
|
2738
|
-
initialLayout: a,
|
|
2739
|
-
panelConstraints: o.derivedPanelConstraints,
|
|
2740
|
-
pivotIndices: l,
|
|
2741
|
-
prevLayout: a,
|
|
2742
|
-
trigger: "keyboard"
|
|
2743
|
-
}), c = B({
|
|
2744
|
-
layout: u,
|
|
2745
|
-
panelConstraints: o.derivedPanelConstraints
|
|
2746
|
-
});
|
|
2747
|
-
j(a, c) || _(n, {
|
|
2748
|
-
defaultLayoutDeferred: o.defaultLayoutDeferred,
|
|
2749
|
-
derivedPanelConstraints: o.derivedPanelConstraints,
|
|
2750
|
-
groupSize: o.groupSize,
|
|
2751
|
-
layout: c,
|
|
2752
|
-
separatorToPanels: o.separatorToPanels
|
|
2753
|
-
});
|
|
2754
|
-
}
|
|
2755
|
-
function Te(e) {
|
|
2756
|
-
if (e.defaultPrevented)
|
|
2757
|
-
return;
|
|
2758
|
-
const t = e.currentTarget, n = fe(t);
|
|
2759
|
-
if (!n.disabled)
|
|
2760
|
-
switch (e.key) {
|
|
2761
|
-
case "ArrowDown": {
|
|
2762
|
-
e.preventDefault(), n.orientation === "vertical" && V(t, 5);
|
|
2763
|
-
break;
|
|
2764
|
-
}
|
|
2765
|
-
case "ArrowLeft": {
|
|
2766
|
-
e.preventDefault(), n.orientation === "horizontal" && V(t, -5);
|
|
2767
|
-
break;
|
|
2768
|
-
}
|
|
2769
|
-
case "ArrowRight": {
|
|
2770
|
-
e.preventDefault(), n.orientation === "horizontal" && V(t, 5);
|
|
2771
|
-
break;
|
|
2772
|
-
}
|
|
2773
|
-
case "ArrowUp": {
|
|
2774
|
-
e.preventDefault(), n.orientation === "vertical" && V(t, -5);
|
|
2775
|
-
break;
|
|
2776
|
-
}
|
|
2777
|
-
case "End": {
|
|
2778
|
-
e.preventDefault(), V(t, 100);
|
|
2779
|
-
break;
|
|
2780
|
-
}
|
|
2781
|
-
case "Enter": {
|
|
2782
|
-
e.preventDefault();
|
|
2783
|
-
const o = fe(t), i = $(o.id, true), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find((d) => d.element === t);
|
|
2784
|
-
L(a, "Matching separator not found");
|
|
2785
|
-
const u = r.get(a);
|
|
2786
|
-
L(u, "Matching panels not found");
|
|
2787
|
-
const c = u[0], m = s.find((d) => d.panelId === c.id);
|
|
2788
|
-
if (L(m, "Panel metadata not found"), m.collapsible) {
|
|
2789
|
-
const d = l[c.id], v = m.collapsedSize === d ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
|
|
2790
|
-
V(t, v - d);
|
|
2791
|
-
}
|
|
2792
|
-
break;
|
|
2793
|
-
}
|
|
2794
|
-
case "F6": {
|
|
2795
|
-
e.preventDefault();
|
|
2796
|
-
const i = fe(t).separators.map((a) => a.element), s = Array.from(i).findIndex((a) => a === e.currentTarget);
|
|
2797
|
-
L(s !== null, "Index not found");
|
|
2798
|
-
const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
|
|
2799
|
-
i[l].focus({
|
|
2800
|
-
preventScroll: true
|
|
2801
|
-
});
|
|
2802
|
-
break;
|
|
2803
|
-
}
|
|
2804
|
-
case "Home": {
|
|
2805
|
-
e.preventDefault(), V(t, -100);
|
|
2806
|
-
break;
|
|
2807
|
-
}
|
|
2808
|
-
}
|
|
2809
|
-
}
|
|
2810
|
-
var J = {
|
|
2811
|
-
cursorFlags: 0,
|
|
2812
|
-
state: "inactive"
|
|
2813
|
-
};
|
|
2814
|
-
var ze = new Je;
|
|
2815
|
-
function W() {
|
|
2816
|
-
return J;
|
|
2817
|
-
}
|
|
2818
|
-
function Gt(e) {
|
|
2819
|
-
return ze.addListener("change", e);
|
|
2820
|
-
}
|
|
2821
|
-
function At(e) {
|
|
2822
|
-
const t = J, n = { ...J };
|
|
2823
|
-
n.cursorFlags = e, J = n, ze.emit("change", {
|
|
2824
|
-
prev: t,
|
|
2825
|
-
next: n
|
|
2826
|
-
});
|
|
2827
|
-
}
|
|
2828
|
-
function Z(e) {
|
|
2829
|
-
const t = J;
|
|
2830
|
-
J = e, ze.emit("change", {
|
|
2831
|
-
prev: t,
|
|
2832
|
-
next: e
|
|
2833
|
-
});
|
|
2834
|
-
}
|
|
2835
|
-
function Oe(e) {
|
|
2836
|
-
if (e.defaultPrevented)
|
|
2837
|
-
return;
|
|
2838
|
-
if (e.pointerType === "mouse" && e.button > 0)
|
|
2839
|
-
return;
|
|
2840
|
-
const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map;
|
|
2841
|
-
let i = false;
|
|
2842
|
-
n.forEach((s) => {
|
|
2843
|
-
s.separator && (i || (i = true, s.separator.element.focus({
|
|
2844
|
-
preventScroll: true
|
|
2845
|
-
})));
|
|
2846
|
-
const l = t.get(s.group);
|
|
2847
|
-
l && o.set(s.group, l.layout);
|
|
2848
|
-
}), Z({
|
|
2849
|
-
cursorFlags: 0,
|
|
2850
|
-
hitRegions: n,
|
|
2851
|
-
initialLayoutMap: o,
|
|
2852
|
-
pointerDownAtPoint: { x: e.clientX, y: e.clientY },
|
|
2853
|
-
state: "active"
|
|
2854
|
-
}), n.length && e.preventDefault();
|
|
2855
|
-
}
|
|
2856
|
-
var Nt = (e) => e;
|
|
2857
|
-
var he = () => {};
|
|
2858
|
-
var nt = 1;
|
|
2859
|
-
var ot = 2;
|
|
2860
|
-
var it = 4;
|
|
2861
|
-
var rt = 8;
|
|
2862
|
-
var Ge = 3;
|
|
2863
|
-
var Ae = 12;
|
|
2864
|
-
var ce;
|
|
2865
|
-
function Ne() {
|
|
2866
|
-
return ce === undefined && (ce = false, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = true)), ce;
|
|
2867
|
-
}
|
|
2868
|
-
function _t({
|
|
2869
|
-
cursorFlags: e,
|
|
2870
|
-
groups: t,
|
|
2871
|
-
state: n
|
|
2872
|
-
}) {
|
|
2873
|
-
let o = 0, i = 0;
|
|
2874
|
-
switch (n) {
|
|
2875
|
-
case "active":
|
|
2876
|
-
case "hover":
|
|
2877
|
-
t.forEach((s) => {
|
|
2878
|
-
if (!s.mutableState.disableCursor)
|
|
2879
|
-
switch (s.orientation) {
|
|
2880
|
-
case "horizontal": {
|
|
2881
|
-
o++;
|
|
2882
|
-
break;
|
|
2883
|
-
}
|
|
2884
|
-
case "vertical": {
|
|
2885
|
-
i++;
|
|
2886
|
-
break;
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
});
|
|
2890
|
-
}
|
|
2891
|
-
if (!(o === 0 && i === 0)) {
|
|
2892
|
-
switch (n) {
|
|
2893
|
-
case "active": {
|
|
2894
|
-
if (e && Ne()) {
|
|
2895
|
-
const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
|
|
2896
|
-
if (s)
|
|
2897
|
-
return r ? "se-resize" : a ? "ne-resize" : "e-resize";
|
|
2898
|
-
if (l)
|
|
2899
|
-
return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
|
|
2900
|
-
if (r)
|
|
2901
|
-
return "s-resize";
|
|
2902
|
-
if (a)
|
|
2903
|
-
return "n-resize";
|
|
2904
|
-
}
|
|
2905
|
-
break;
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
return Ne() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
|
|
2909
|
-
}
|
|
2910
|
-
}
|
|
2911
|
-
var _e = /* @__PURE__ */ new WeakMap;
|
|
2912
|
-
function be(e) {
|
|
2913
|
-
if (e.defaultView === null || e.defaultView === undefined)
|
|
2914
|
-
return;
|
|
2915
|
-
let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
|
|
2916
|
-
n === undefined && (n = new e.defaultView.CSSStyleSheet, e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
|
|
2917
|
-
const o = W();
|
|
2918
|
-
switch (o.state) {
|
|
2919
|
-
case "active":
|
|
2920
|
-
case "hover": {
|
|
2921
|
-
const i = _t({
|
|
2922
|
-
cursorFlags: o.cursorFlags,
|
|
2923
|
-
groups: o.hitRegions.map((l) => l.group),
|
|
2924
|
-
state: o.state
|
|
2925
|
-
}), s = `*, *:hover {cursor: ${i} !important; }`;
|
|
2926
|
-
if (t === s)
|
|
2927
|
-
return;
|
|
2928
|
-
t = s, i ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
|
|
2929
|
-
break;
|
|
2930
|
-
}
|
|
2931
|
-
case "inactive": {
|
|
2932
|
-
t = undefined, n.cssRules.length === 1 && n.deleteRule(0);
|
|
2933
|
-
break;
|
|
2934
|
-
}
|
|
2935
|
-
}
|
|
2936
|
-
_e.set(e, {
|
|
2937
|
-
prevStyle: t,
|
|
2938
|
-
styleSheet: n
|
|
2939
|
-
});
|
|
2940
|
-
}
|
|
2941
|
-
function st({
|
|
2942
|
-
document: e,
|
|
2943
|
-
event: t,
|
|
2944
|
-
hitRegions: n,
|
|
2945
|
-
initialLayoutMap: o,
|
|
2946
|
-
mountedGroups: i,
|
|
2947
|
-
pointerDownAtPoint: s,
|
|
2948
|
-
prevCursorFlags: l
|
|
2949
|
-
}) {
|
|
2950
|
-
let r = 0;
|
|
2951
|
-
n.forEach((u) => {
|
|
2952
|
-
const { group: c, groupSize: m } = u, { orientation: d, panels: v } = c, { disableCursor: x } = c.mutableState;
|
|
2953
|
-
let f = 0;
|
|
2954
|
-
s ? d === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : d === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
|
|
2955
|
-
const h = o.get(c), g = i.get(c);
|
|
2956
|
-
if (!h || !g)
|
|
2957
|
-
return;
|
|
2958
|
-
const {
|
|
2959
|
-
defaultLayoutDeferred: y,
|
|
2960
|
-
derivedPanelConstraints: z,
|
|
2961
|
-
groupSize: S,
|
|
2962
|
-
layout: p,
|
|
2963
|
-
separatorToPanels: P
|
|
2964
|
-
} = g;
|
|
2965
|
-
if (z && p && P) {
|
|
2966
|
-
const R = se({
|
|
2967
|
-
delta: f,
|
|
2968
|
-
initialLayout: h,
|
|
2969
|
-
panelConstraints: z,
|
|
2970
|
-
pivotIndices: u.panels.map((C) => v.indexOf(C)),
|
|
2971
|
-
prevLayout: p,
|
|
2972
|
-
trigger: "mouse-or-touch"
|
|
2973
|
-
});
|
|
2974
|
-
if (j(R, p)) {
|
|
2975
|
-
if (f !== 0 && !x)
|
|
2976
|
-
switch (d) {
|
|
2977
|
-
case "horizontal": {
|
|
2978
|
-
r |= f < 0 ? nt : ot;
|
|
2979
|
-
break;
|
|
2980
|
-
}
|
|
2981
|
-
case "vertical": {
|
|
2982
|
-
r |= f < 0 ? it : rt;
|
|
2983
|
-
break;
|
|
2984
|
-
}
|
|
2985
|
-
}
|
|
2986
|
-
} else
|
|
2987
|
-
_(u.group, {
|
|
2988
|
-
defaultLayoutDeferred: y,
|
|
2989
|
-
derivedPanelConstraints: z,
|
|
2990
|
-
groupSize: S,
|
|
2991
|
-
layout: R,
|
|
2992
|
-
separatorToPanels: P
|
|
2993
|
-
});
|
|
2994
|
-
}
|
|
2995
|
-
});
|
|
2996
|
-
let a = 0;
|
|
2997
|
-
t.movementX === 0 ? a |= l & Ge : a |= r & Ge, t.movementY === 0 ? a |= l & Ae : a |= r & Ae, At(a), be(e);
|
|
2998
|
-
}
|
|
2999
|
-
function Fe(e) {
|
|
3000
|
-
const t = U(), n = W();
|
|
3001
|
-
switch (n.state) {
|
|
3002
|
-
case "active":
|
|
3003
|
-
st({
|
|
3004
|
-
document: e.currentTarget,
|
|
3005
|
-
event: e,
|
|
3006
|
-
hitRegions: n.hitRegions,
|
|
3007
|
-
initialLayoutMap: n.initialLayoutMap,
|
|
3008
|
-
mountedGroups: t,
|
|
3009
|
-
prevCursorFlags: n.cursorFlags
|
|
3010
|
-
});
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
function $e(e) {
|
|
3014
|
-
if (e.defaultPrevented)
|
|
3015
|
-
return;
|
|
3016
|
-
const t = W(), n = U();
|
|
3017
|
-
switch (t.state) {
|
|
3018
|
-
case "active": {
|
|
3019
|
-
if (e.buttons === 0) {
|
|
3020
|
-
Z({
|
|
3021
|
-
cursorFlags: 0,
|
|
3022
|
-
state: "inactive"
|
|
3023
|
-
}), t.hitRegions.forEach((o) => {
|
|
3024
|
-
const i = $(o.group.id, true);
|
|
3025
|
-
_(o.group, i);
|
|
3026
|
-
});
|
|
3027
|
-
return;
|
|
3028
|
-
}
|
|
3029
|
-
st({
|
|
3030
|
-
document: e.currentTarget,
|
|
3031
|
-
event: e,
|
|
3032
|
-
hitRegions: t.hitRegions,
|
|
3033
|
-
initialLayoutMap: t.initialLayoutMap,
|
|
3034
|
-
mountedGroups: n,
|
|
3035
|
-
pointerDownAtPoint: t.pointerDownAtPoint,
|
|
3036
|
-
prevCursorFlags: t.cursorFlags
|
|
3037
|
-
});
|
|
3038
|
-
break;
|
|
3039
|
-
}
|
|
3040
|
-
default: {
|
|
3041
|
-
const o = ve(e, n);
|
|
3042
|
-
o.length === 0 ? t.state !== "inactive" && Z({
|
|
3043
|
-
cursorFlags: 0,
|
|
3044
|
-
state: "inactive"
|
|
3045
|
-
}) : Z({
|
|
3046
|
-
cursorFlags: 0,
|
|
3047
|
-
hitRegions: o,
|
|
3048
|
-
state: "hover"
|
|
3049
|
-
}), be(e.currentTarget);
|
|
3050
|
-
break;
|
|
3051
|
-
}
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
function He(e) {
|
|
3055
|
-
if (e.relatedTarget instanceof HTMLIFrameElement)
|
|
3056
|
-
switch (W().state) {
|
|
3057
|
-
case "hover":
|
|
3058
|
-
Z({
|
|
3059
|
-
cursorFlags: 0,
|
|
3060
|
-
state: "inactive"
|
|
3061
|
-
});
|
|
3062
|
-
}
|
|
3063
|
-
}
|
|
3064
|
-
function Ve(e) {
|
|
3065
|
-
if (e.defaultPrevented)
|
|
3066
|
-
return;
|
|
3067
|
-
if (e.pointerType === "mouse" && e.button > 0)
|
|
3068
|
-
return;
|
|
3069
|
-
const t = W();
|
|
3070
|
-
switch (t.state) {
|
|
3071
|
-
case "active":
|
|
3072
|
-
Z({
|
|
3073
|
-
cursorFlags: 0,
|
|
3074
|
-
state: "inactive"
|
|
3075
|
-
}), t.hitRegions.length > 0 && (be(e.currentTarget), t.hitRegions.forEach((n) => {
|
|
3076
|
-
const o = $(n.group.id, true);
|
|
3077
|
-
_(n.group, o);
|
|
3078
|
-
}), e.preventDefault());
|
|
3079
|
-
}
|
|
3080
|
-
}
|
|
3081
|
-
function je(e) {
|
|
3082
|
-
let t = 0, n = 0;
|
|
3083
|
-
const o = {};
|
|
3084
|
-
for (const s of e)
|
|
3085
|
-
if (s.defaultSize !== undefined) {
|
|
3086
|
-
t++;
|
|
3087
|
-
const l = D(s.defaultSize);
|
|
3088
|
-
n += l, o[s.panelId] = l;
|
|
3089
|
-
} else
|
|
3090
|
-
o[s.panelId] = undefined;
|
|
3091
|
-
const i = e.length - t;
|
|
3092
|
-
if (i !== 0) {
|
|
3093
|
-
const s = D((100 - n) / i);
|
|
3094
|
-
for (const l of e)
|
|
3095
|
-
l.defaultSize === undefined && (o[l.panelId] = s);
|
|
3096
|
-
}
|
|
3097
|
-
return o;
|
|
3098
|
-
}
|
|
3099
|
-
function Ft(e, t, n) {
|
|
3100
|
-
if (!n[0])
|
|
3101
|
-
return;
|
|
3102
|
-
const i = e.panels.find((u) => u.element === t);
|
|
3103
|
-
if (!i || !i.onResize)
|
|
3104
|
-
return;
|
|
3105
|
-
const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
|
|
3106
|
-
asPercentage: D(l / s * 100),
|
|
3107
|
-
inPixels: l
|
|
3108
|
-
};
|
|
3109
|
-
i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
|
|
3110
|
-
}
|
|
3111
|
-
function $t(e, t) {
|
|
3112
|
-
if (Object.keys(e).length !== Object.keys(t).length)
|
|
3113
|
-
return false;
|
|
3114
|
-
for (const o in e)
|
|
3115
|
-
if (e[o] !== t[o])
|
|
3116
|
-
return false;
|
|
3117
|
-
return true;
|
|
3118
|
-
}
|
|
3119
|
-
function Ht({
|
|
3120
|
-
group: e,
|
|
3121
|
-
nextGroupSize: t,
|
|
3122
|
-
prevGroupSize: n,
|
|
3123
|
-
prevLayout: o
|
|
3124
|
-
}) {
|
|
3125
|
-
if (n <= 0 || t <= 0 || n === t)
|
|
3126
|
-
return o;
|
|
3127
|
-
let i = 0, s = 0, l = false;
|
|
3128
|
-
const r = /* @__PURE__ */ new Map, a = [];
|
|
3129
|
-
for (const m of e.panels) {
|
|
3130
|
-
const d = o[m.id] ?? 0;
|
|
3131
|
-
switch (m.panelConstraints.groupResizeBehavior) {
|
|
3132
|
-
case "preserve-pixel-size": {
|
|
3133
|
-
l = true;
|
|
3134
|
-
const v = d / 100 * n, x = D(v / t * 100);
|
|
3135
|
-
r.set(m.id, x), i += x;
|
|
3136
|
-
break;
|
|
3137
|
-
}
|
|
3138
|
-
case "preserve-relative-size":
|
|
3139
|
-
default: {
|
|
3140
|
-
a.push(m.id), s += d;
|
|
3141
|
-
break;
|
|
3142
|
-
}
|
|
3143
|
-
}
|
|
3144
|
-
}
|
|
3145
|
-
if (!l || a.length === 0)
|
|
3146
|
-
return o;
|
|
3147
|
-
const u = 100 - i, c = { ...o };
|
|
3148
|
-
if (r.forEach((m, d) => {
|
|
3149
|
-
c[d] = m;
|
|
3150
|
-
}), s > 0)
|
|
3151
|
-
for (const m of a) {
|
|
3152
|
-
const d = o[m] ?? 0;
|
|
3153
|
-
c[m] = D(d / s * u);
|
|
3154
|
-
}
|
|
3155
|
-
else {
|
|
3156
|
-
const m = D(u / a.length);
|
|
3157
|
-
for (const d of a)
|
|
3158
|
-
c[d] = m;
|
|
3159
|
-
}
|
|
3160
|
-
return c;
|
|
3161
|
-
}
|
|
3162
|
-
function Vt(e, t) {
|
|
3163
|
-
const n = e.map((i) => i.id), o = Object.keys(t);
|
|
3164
|
-
if (n.length !== o.length)
|
|
3165
|
-
return false;
|
|
3166
|
-
for (const i of n)
|
|
3167
|
-
if (!o.includes(i))
|
|
3168
|
-
return false;
|
|
3169
|
-
return true;
|
|
3170
|
-
}
|
|
3171
|
-
var q = /* @__PURE__ */ new Map;
|
|
3172
|
-
function jt(e) {
|
|
3173
|
-
let t = true;
|
|
3174
|
-
L(e.element.ownerDocument.defaultView, "Cannot register an unmounted Group");
|
|
3175
|
-
const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set, i = /* @__PURE__ */ new Set, s = new n((f) => {
|
|
3176
|
-
for (const h of f) {
|
|
3177
|
-
const { borderBoxSize: g, target: y } = h;
|
|
3178
|
-
if (y === e.element) {
|
|
3179
|
-
if (t) {
|
|
3180
|
-
const z = Q({ group: e });
|
|
3181
|
-
if (z === 0)
|
|
3182
|
-
return;
|
|
3183
|
-
const S = $(e.id);
|
|
3184
|
-
if (!S)
|
|
3185
|
-
return;
|
|
3186
|
-
const p = ge(e), P = S.defaultLayoutDeferred ? je(p) : S.layout, R = Ht({
|
|
3187
|
-
group: e,
|
|
3188
|
-
nextGroupSize: z,
|
|
3189
|
-
prevGroupSize: S.groupSize,
|
|
3190
|
-
prevLayout: P
|
|
3191
|
-
}), C = B({
|
|
3192
|
-
layout: R,
|
|
3193
|
-
panelConstraints: p
|
|
3194
|
-
});
|
|
3195
|
-
if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(S.derivedPanelConstraints, p) && S.groupSize === z)
|
|
3196
|
-
return;
|
|
3197
|
-
_(e, {
|
|
3198
|
-
defaultLayoutDeferred: false,
|
|
3199
|
-
derivedPanelConstraints: p,
|
|
3200
|
-
groupSize: z,
|
|
3201
|
-
layout: C,
|
|
3202
|
-
separatorToPanels: S.separatorToPanels
|
|
3203
|
-
});
|
|
3204
|
-
}
|
|
3205
|
-
} else
|
|
3206
|
-
Ft(e, y, g);
|
|
3207
|
-
}
|
|
3208
|
-
});
|
|
3209
|
-
s.observe(e.element), e.panels.forEach((f) => {
|
|
3210
|
-
L(!o.has(f.id), `Panel ids must be unique; id "${f.id}" was used more than once`), o.add(f.id), f.onResize && s.observe(f.element);
|
|
3211
|
-
});
|
|
3212
|
-
const l = Q({ group: e }), r = ge(e), a = e.panels.map(({ id: f }) => f).join(",");
|
|
3213
|
-
let u = e.mutableState.defaultLayout;
|
|
3214
|
-
u && (Vt(e.panels, u) || (u = undefined));
|
|
3215
|
-
const c = e.mutableState.layouts[a] ?? u ?? je(r), m = B({
|
|
3216
|
-
layout: c,
|
|
3217
|
-
panelConstraints: r
|
|
3218
|
-
}), d = e.element.ownerDocument;
|
|
3219
|
-
q.set(d, (q.get(d) ?? 0) + 1);
|
|
3220
|
-
const v = /* @__PURE__ */ new Map;
|
|
3221
|
-
return Ye(e).forEach((f) => {
|
|
3222
|
-
f.separator && v.set(f.separator, f.panels);
|
|
3223
|
-
}), _(e, {
|
|
3224
|
-
defaultLayoutDeferred: l === 0,
|
|
3225
|
-
derivedPanelConstraints: r,
|
|
3226
|
-
groupSize: l,
|
|
3227
|
-
layout: m,
|
|
3228
|
-
separatorToPanels: v
|
|
3229
|
-
}), e.separators.forEach((f) => {
|
|
3230
|
-
L(!i.has(f.id), `Separator ids must be unique; id "${f.id}" was used more than once`), i.add(f.id), f.element.addEventListener("keydown", Te);
|
|
3231
|
-
}), q.get(d) === 1 && (d.addEventListener("dblclick", De, true), d.addEventListener("pointerdown", Oe, true), d.addEventListener("pointerleave", Fe), d.addEventListener("pointermove", $e), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, true)), function() {
|
|
3232
|
-
t = false, q.set(d, Math.max(0, (q.get(d) ?? 0) - 1)), Lt(e), e.separators.forEach((h) => {
|
|
3233
|
-
h.element.removeEventListener("keydown", Te);
|
|
3234
|
-
}), q.get(d) || (d.removeEventListener("dblclick", De, true), d.removeEventListener("pointerdown", Oe, true), d.removeEventListener("pointerleave", Fe), d.removeEventListener("pointermove", $e), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, true)), s.disconnect();
|
|
3235
|
-
};
|
|
3236
|
-
}
|
|
3237
|
-
function Bt() {
|
|
3238
|
-
const [e, t] = re({}), n = ne(() => t({}), []);
|
|
3239
|
-
return [e, n];
|
|
3240
|
-
}
|
|
3241
|
-
function xe(e) {
|
|
3242
|
-
const t = pt();
|
|
3243
|
-
return `${e ?? t}`;
|
|
3244
|
-
}
|
|
3245
|
-
var K = typeof window < "u" ? Be : de;
|
|
3246
|
-
function oe(e) {
|
|
3247
|
-
const t = T(e);
|
|
3248
|
-
return K(() => {
|
|
3249
|
-
t.current = e;
|
|
3250
|
-
}, [e]), ne((...n) => t.current?.(...n), [t]);
|
|
3251
|
-
}
|
|
3252
|
-
function we(...e) {
|
|
3253
|
-
return oe((t) => {
|
|
3254
|
-
e.forEach((n) => {
|
|
3255
|
-
if (n)
|
|
3256
|
-
switch (typeof n) {
|
|
3257
|
-
case "function": {
|
|
3258
|
-
n(t);
|
|
3259
|
-
break;
|
|
3260
|
-
}
|
|
3261
|
-
case "object": {
|
|
3262
|
-
n.current = t;
|
|
3263
|
-
break;
|
|
3264
|
-
}
|
|
3265
|
-
}
|
|
3266
|
-
});
|
|
3267
|
-
});
|
|
3268
|
-
}
|
|
3269
|
-
function Pe(e) {
|
|
3270
|
-
const t = T({ ...e });
|
|
3271
|
-
return K(() => {
|
|
3272
|
-
for (const n in e)
|
|
3273
|
-
t.current[n] = e[n];
|
|
3274
|
-
}, [e]), t.current;
|
|
3275
|
-
}
|
|
3276
|
-
var at = ht(null);
|
|
3277
|
-
function Wt(e, t) {
|
|
3278
|
-
const n = T({
|
|
3279
|
-
getLayout: () => ({}),
|
|
3280
|
-
setLayout: Nt
|
|
3281
|
-
});
|
|
3282
|
-
We(t, () => n.current, []), K(() => {
|
|
3283
|
-
Object.assign(n.current, tt({ groupId: e }));
|
|
3284
|
-
});
|
|
3285
|
-
}
|
|
3286
|
-
function Ut({
|
|
3287
|
-
children: e,
|
|
3288
|
-
className: t,
|
|
3289
|
-
defaultLayout: n,
|
|
3290
|
-
disableCursor: o,
|
|
3291
|
-
disabled: i,
|
|
3292
|
-
elementRef: s,
|
|
3293
|
-
groupRef: l,
|
|
3294
|
-
id: r,
|
|
3295
|
-
onLayoutChange: a,
|
|
3296
|
-
onLayoutChanged: u,
|
|
3297
|
-
orientation: c = "horizontal",
|
|
3298
|
-
resizeTargetMinimumSize: m = {
|
|
3299
|
-
coarse: 20,
|
|
3300
|
-
fine: 10
|
|
3301
|
-
},
|
|
3302
|
-
style: d,
|
|
3303
|
-
...v
|
|
3304
|
-
}) {
|
|
3305
|
-
const x = T({
|
|
3306
|
-
onLayoutChange: {},
|
|
3307
|
-
onLayoutChanged: {}
|
|
3308
|
-
}), f = oe((b) => {
|
|
3309
|
-
j(x.current.onLayoutChange, b) || (x.current.onLayoutChange = b, a?.(b));
|
|
3310
|
-
}), h = oe((b) => {
|
|
3311
|
-
j(x.current.onLayoutChanged, b) || (x.current.onLayoutChanged = b, u?.(b));
|
|
3312
|
-
}), g = xe(r), y = T(null), [z, S] = Bt(), p = T({
|
|
3313
|
-
lastExpandedPanelSizes: {},
|
|
3314
|
-
layouts: {},
|
|
3315
|
-
panels: [],
|
|
3316
|
-
resizeTargetMinimumSize: m,
|
|
3317
|
-
separators: []
|
|
3318
|
-
}), P = we(y, s);
|
|
3319
|
-
Wt(g, l);
|
|
3320
|
-
const R = oe((b, w) => {
|
|
3321
|
-
const E = W(), M = Me(b), k = $(b);
|
|
3322
|
-
if (k) {
|
|
3323
|
-
let O = false;
|
|
3324
|
-
switch (E.state) {
|
|
3325
|
-
case "active": {
|
|
3326
|
-
O = E.hitRegions.some((H) => H.group === M);
|
|
3327
|
-
break;
|
|
3328
|
-
}
|
|
3329
|
-
}
|
|
3330
|
-
return {
|
|
3331
|
-
flexGrow: k.layout[w] ?? 1,
|
|
3332
|
-
pointerEvents: O ? "none" : undefined
|
|
3333
|
-
};
|
|
3334
|
-
}
|
|
3335
|
-
return {
|
|
3336
|
-
flexGrow: n?.[w] ?? 1
|
|
3337
|
-
};
|
|
3338
|
-
}), C = Pe({
|
|
3339
|
-
defaultLayout: n,
|
|
3340
|
-
disableCursor: o
|
|
3341
|
-
}), X2 = Ue(() => ({
|
|
3342
|
-
get disableCursor() {
|
|
3343
|
-
return !!C.disableCursor;
|
|
3344
|
-
},
|
|
3345
|
-
getPanelStyles: R,
|
|
3346
|
-
id: g,
|
|
3347
|
-
orientation: c,
|
|
3348
|
-
registerPanel: (b) => {
|
|
3349
|
-
const w = p.current;
|
|
3350
|
-
return w.panels = Se(c, [
|
|
3351
|
-
...w.panels,
|
|
3352
|
-
b
|
|
3353
|
-
]), S(), () => {
|
|
3354
|
-
w.panels = w.panels.filter((E) => E !== b), S();
|
|
3355
|
-
};
|
|
3356
|
-
},
|
|
3357
|
-
registerSeparator: (b) => {
|
|
3358
|
-
const w = p.current;
|
|
3359
|
-
return w.separators = Se(c, [
|
|
3360
|
-
...w.separators,
|
|
3361
|
-
b
|
|
3362
|
-
]), S(), () => {
|
|
3363
|
-
w.separators = w.separators.filter((E) => E !== b), S();
|
|
3364
|
-
};
|
|
3365
|
-
},
|
|
3366
|
-
togglePanelDisabled: (b, w) => {
|
|
3367
|
-
const M = p.current.panels.find((H) => H.id === b);
|
|
3368
|
-
M && (M.panelConstraints.disabled = w);
|
|
3369
|
-
const k = Me(g), O = $(g);
|
|
3370
|
-
k && O && _(k, {
|
|
3371
|
-
...O,
|
|
3372
|
-
derivedPanelConstraints: ge(k)
|
|
3373
|
-
});
|
|
3374
|
-
},
|
|
3375
|
-
toggleSeparatorDisabled: (b, w) => {
|
|
3376
|
-
const M = p.current.separators.find((k) => k.id === b);
|
|
3377
|
-
M && (M.disabled = w);
|
|
3378
|
-
}
|
|
3379
|
-
}), [R, g, S, c, C]), F = T(null);
|
|
3380
|
-
return K(() => {
|
|
3381
|
-
const b = y.current;
|
|
3382
|
-
if (b === null)
|
|
3383
|
-
return;
|
|
3384
|
-
const w = p.current;
|
|
3385
|
-
let E;
|
|
3386
|
-
if (C.defaultLayout !== undefined && Object.keys(C.defaultLayout).length === w.panels.length) {
|
|
3387
|
-
E = {};
|
|
3388
|
-
for (const ee of w.panels) {
|
|
3389
|
-
const ae = C.defaultLayout[ee.id];
|
|
3390
|
-
ae !== undefined && (E[ee.id] = ae);
|
|
3391
|
-
}
|
|
3392
|
-
}
|
|
3393
|
-
const M = {
|
|
3394
|
-
disabled: !!i,
|
|
3395
|
-
element: b,
|
|
3396
|
-
id: g,
|
|
3397
|
-
mutableState: {
|
|
3398
|
-
defaultLayout: E,
|
|
3399
|
-
disableCursor: !!C.disableCursor,
|
|
3400
|
-
expandedPanelSizes: p.current.lastExpandedPanelSizes,
|
|
3401
|
-
layouts: p.current.layouts
|
|
3402
|
-
},
|
|
3403
|
-
orientation: c,
|
|
3404
|
-
panels: w.panels,
|
|
3405
|
-
resizeTargetMinimumSize: w.resizeTargetMinimumSize,
|
|
3406
|
-
separators: w.separators
|
|
3407
|
-
};
|
|
3408
|
-
F.current = M;
|
|
3409
|
-
const k = jt(M), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(M.id, true);
|
|
3410
|
-
!O && H.length > 0 && (f(Ce), h(Ce));
|
|
3411
|
-
const lt = ye(g, (ee) => {
|
|
3412
|
-
const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: le } = ee.next;
|
|
3413
|
-
if (ae || Re.length === 0)
|
|
3414
|
-
return;
|
|
3415
|
-
const ut = M.panels.map(({ id: N }) => N).join(",");
|
|
3416
|
-
M.mutableState.layouts[ut] = le, Re.forEach((N) => {
|
|
3417
|
-
if (N.collapsible) {
|
|
3418
|
-
const { layout: pe } = ee.prev ?? {};
|
|
3419
|
-
if (pe) {
|
|
3420
|
-
const ft = I(N.collapsedSize, le[N.panelId]), dt = I(N.collapsedSize, pe[N.panelId]);
|
|
3421
|
-
ft && !dt && (M.mutableState.expandedPanelSizes[N.panelId] = pe[N.panelId]);
|
|
3422
|
-
}
|
|
3423
|
-
}
|
|
3424
|
-
});
|
|
3425
|
-
const ct = W().state !== "active";
|
|
3426
|
-
f(le), ct && h(le);
|
|
3427
|
-
});
|
|
3428
|
-
return () => {
|
|
3429
|
-
F.current = null, k(), lt();
|
|
3430
|
-
};
|
|
3431
|
-
}, [
|
|
3432
|
-
i,
|
|
3433
|
-
g,
|
|
3434
|
-
h,
|
|
3435
|
-
f,
|
|
3436
|
-
c,
|
|
3437
|
-
z,
|
|
3438
|
-
C
|
|
3439
|
-
]), de(() => {
|
|
3440
|
-
const b = F.current;
|
|
3441
|
-
b && (b.mutableState.defaultLayout = n, b.mutableState.disableCursor = !!o);
|
|
3442
|
-
}), /* @__PURE__ */ ie(at.Provider, { value: X2, children: /* @__PURE__ */ ie("div", {
|
|
3443
|
-
...v,
|
|
3444
|
-
className: t,
|
|
3445
|
-
"data-group": true,
|
|
3446
|
-
"data-testid": g,
|
|
3447
|
-
id: g,
|
|
3448
|
-
ref: P,
|
|
3449
|
-
style: {
|
|
3450
|
-
height: "100%",
|
|
3451
|
-
width: "100%",
|
|
3452
|
-
overflow: "hidden",
|
|
3453
|
-
...d,
|
|
3454
|
-
display: "flex",
|
|
3455
|
-
flexDirection: c === "horizontal" ? "row" : "column",
|
|
3456
|
-
flexWrap: "nowrap",
|
|
3457
|
-
touchAction: c === "horizontal" ? "pan-y" : "pan-x"
|
|
3458
|
-
},
|
|
3459
|
-
children: e
|
|
3460
|
-
}) });
|
|
3461
|
-
}
|
|
3462
|
-
Ut.displayName = "Group";
|
|
3463
|
-
function Le() {
|
|
3464
|
-
const e = mt(at);
|
|
3465
|
-
return L(e, "Group Context not found; did you render a Panel or Separator outside of a Group?"), e;
|
|
3466
|
-
}
|
|
3467
|
-
function Xt(e, t) {
|
|
3468
|
-
const { id: n } = Le(), o = T({
|
|
3469
|
-
collapse: he,
|
|
3470
|
-
expand: he,
|
|
3471
|
-
getSize: () => ({
|
|
3472
|
-
asPercentage: 0,
|
|
3473
|
-
inPixels: 0
|
|
3474
|
-
}),
|
|
3475
|
-
isCollapsed: () => false,
|
|
3476
|
-
resize: he
|
|
3477
|
-
});
|
|
3478
|
-
We(t, () => o.current, []), K(() => {
|
|
3479
|
-
Object.assign(o.current, et({ groupId: n, panelId: e }));
|
|
3480
|
-
});
|
|
3481
|
-
}
|
|
3482
|
-
function qt({
|
|
3483
|
-
children: e,
|
|
3484
|
-
className: t,
|
|
3485
|
-
collapsedSize: n = "0%",
|
|
3486
|
-
collapsible: o = false,
|
|
3487
|
-
defaultSize: i,
|
|
3488
|
-
disabled: s,
|
|
3489
|
-
elementRef: l,
|
|
3490
|
-
groupResizeBehavior: r = "preserve-relative-size",
|
|
3491
|
-
id: a,
|
|
3492
|
-
maxSize: u = "100%",
|
|
3493
|
-
minSize: c = "0%",
|
|
3494
|
-
onResize: m,
|
|
3495
|
-
panelRef: d,
|
|
3496
|
-
style: v,
|
|
3497
|
-
...x
|
|
3498
|
-
}) {
|
|
3499
|
-
const f = !!a, h = xe(a), g = Pe({
|
|
3500
|
-
disabled: s
|
|
3501
|
-
}), y = T(null), z = we(y, l), {
|
|
3502
|
-
getPanelStyles: S,
|
|
3503
|
-
id: p,
|
|
3504
|
-
orientation: P,
|
|
3505
|
-
registerPanel: R,
|
|
3506
|
-
togglePanelDisabled: C
|
|
3507
|
-
} = Le(), X2 = m !== null, F = oe((w, E, M) => {
|
|
3508
|
-
m?.(w, a, M);
|
|
3509
|
-
});
|
|
3510
|
-
K(() => {
|
|
3511
|
-
const w = y.current;
|
|
3512
|
-
if (w !== null) {
|
|
3513
|
-
const E = {
|
|
3514
|
-
element: w,
|
|
3515
|
-
id: h,
|
|
3516
|
-
idIsStable: f,
|
|
3517
|
-
mutableValues: {
|
|
3518
|
-
expandToSize: undefined,
|
|
3519
|
-
prevSize: undefined
|
|
3520
|
-
},
|
|
3521
|
-
onResize: X2 ? F : undefined,
|
|
3522
|
-
panelConstraints: {
|
|
3523
|
-
groupResizeBehavior: r,
|
|
3524
|
-
collapsedSize: n,
|
|
3525
|
-
collapsible: o,
|
|
3526
|
-
defaultSize: i,
|
|
3527
|
-
disabled: g.disabled,
|
|
3528
|
-
maxSize: u,
|
|
3529
|
-
minSize: c
|
|
3530
|
-
}
|
|
3531
|
-
};
|
|
3532
|
-
return R(E);
|
|
3533
|
-
}
|
|
3534
|
-
}, [
|
|
3535
|
-
r,
|
|
3536
|
-
n,
|
|
3537
|
-
o,
|
|
3538
|
-
i,
|
|
3539
|
-
X2,
|
|
3540
|
-
h,
|
|
3541
|
-
f,
|
|
3542
|
-
u,
|
|
3543
|
-
c,
|
|
3544
|
-
F,
|
|
3545
|
-
R,
|
|
3546
|
-
g
|
|
3547
|
-
]), de(() => {
|
|
3548
|
-
C(h, !!s);
|
|
3549
|
-
}, [s, h, C]), Xt(h, d);
|
|
3550
|
-
const b = Ke((w) => ye(p, w), () => JSON.stringify(S(p, h)), () => JSON.stringify(S(p, h)));
|
|
3551
|
-
return /* @__PURE__ */ ie("div", {
|
|
3552
|
-
...x,
|
|
3553
|
-
"aria-disabled": s || undefined,
|
|
3554
|
-
"data-panel": true,
|
|
3555
|
-
"data-testid": h,
|
|
3556
|
-
id: h,
|
|
3557
|
-
ref: z,
|
|
3558
|
-
style: {
|
|
3559
|
-
...Yt,
|
|
3560
|
-
display: "flex",
|
|
3561
|
-
flexBasis: 0,
|
|
3562
|
-
flexShrink: 1,
|
|
3563
|
-
overflow: "visible",
|
|
3564
|
-
...JSON.parse(b)
|
|
3565
|
-
},
|
|
3566
|
-
children: /* @__PURE__ */ ie("div", {
|
|
3567
|
-
className: t,
|
|
3568
|
-
style: {
|
|
3569
|
-
maxHeight: "100%",
|
|
3570
|
-
maxWidth: "100%",
|
|
3571
|
-
flexGrow: 1,
|
|
3572
|
-
overflow: "auto",
|
|
3573
|
-
...v,
|
|
3574
|
-
touchAction: P === "horizontal" ? "pan-y" : "pan-x"
|
|
3575
|
-
},
|
|
3576
|
-
children: e
|
|
3577
|
-
})
|
|
3578
|
-
});
|
|
3579
|
-
}
|
|
3580
|
-
qt.displayName = "Panel";
|
|
3581
|
-
var Yt = {
|
|
3582
|
-
minHeight: 0,
|
|
3583
|
-
maxHeight: "100%",
|
|
3584
|
-
height: "auto",
|
|
3585
|
-
minWidth: 0,
|
|
3586
|
-
maxWidth: "100%",
|
|
3587
|
-
width: "auto",
|
|
3588
|
-
border: "none",
|
|
3589
|
-
borderWidth: 0,
|
|
3590
|
-
padding: 0,
|
|
3591
|
-
margin: 0
|
|
3592
|
-
};
|
|
3593
|
-
function Jt({
|
|
3594
|
-
layout: e,
|
|
3595
|
-
panelConstraints: t,
|
|
3596
|
-
panelId: n,
|
|
3597
|
-
panelIndex: o
|
|
3598
|
-
}) {
|
|
3599
|
-
let i, s;
|
|
3600
|
-
const l = e[n], r = t.find((a) => a.panelId === n);
|
|
3601
|
-
if (r) {
|
|
3602
|
-
const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
|
|
3603
|
-
s = B({
|
|
3604
|
-
layout: se({
|
|
3605
|
-
delta: u - l,
|
|
3606
|
-
initialLayout: e,
|
|
3607
|
-
panelConstraints: t,
|
|
3608
|
-
pivotIndices: c,
|
|
3609
|
-
prevLayout: e
|
|
3610
|
-
}),
|
|
3611
|
-
panelConstraints: t
|
|
3612
|
-
})[n], i = B({
|
|
3613
|
-
layout: se({
|
|
3614
|
-
delta: a - l,
|
|
3615
|
-
initialLayout: e,
|
|
3616
|
-
panelConstraints: t,
|
|
3617
|
-
pivotIndices: c,
|
|
3618
|
-
prevLayout: e
|
|
3619
|
-
}),
|
|
3620
|
-
panelConstraints: t
|
|
3621
|
-
})[n];
|
|
3622
|
-
}
|
|
3623
|
-
return {
|
|
3624
|
-
valueControls: n,
|
|
3625
|
-
valueMax: i,
|
|
3626
|
-
valueMin: s,
|
|
3627
|
-
valueNow: l
|
|
3628
|
-
};
|
|
3629
|
-
}
|
|
3630
|
-
function Zt({
|
|
3631
|
-
children: e,
|
|
3632
|
-
className: t,
|
|
3633
|
-
disabled: n,
|
|
3634
|
-
elementRef: o,
|
|
3635
|
-
id: i,
|
|
3636
|
-
style: s,
|
|
3637
|
-
...l
|
|
3638
|
-
}) {
|
|
3639
|
-
const r = xe(i), a = Pe({
|
|
3640
|
-
disabled: n
|
|
3641
|
-
}), [u, c] = re({}), [m, d] = re("inactive"), v = T(null), x = we(v, o), {
|
|
3642
|
-
disableCursor: f,
|
|
3643
|
-
id: h,
|
|
3644
|
-
orientation: g,
|
|
3645
|
-
registerSeparator: y,
|
|
3646
|
-
toggleSeparatorDisabled: z
|
|
3647
|
-
} = Le(), S = g === "horizontal" ? "vertical" : "horizontal";
|
|
3648
|
-
K(() => {
|
|
3649
|
-
const P = v.current;
|
|
3650
|
-
if (P !== null) {
|
|
3651
|
-
const R = {
|
|
3652
|
-
disabled: a.disabled,
|
|
3653
|
-
element: P,
|
|
3654
|
-
id: r
|
|
3655
|
-
}, C = y(R), X2 = Gt((b) => {
|
|
3656
|
-
d(b.next.state !== "inactive" && b.next.hitRegions.some((w) => w.separator === R) ? b.next.state : "inactive");
|
|
3657
|
-
}), F = ye(h, (b) => {
|
|
3658
|
-
const { derivedPanelConstraints: w, layout: E, separatorToPanels: M } = b.next, k = M.get(R);
|
|
3659
|
-
if (k) {
|
|
3660
|
-
const O = k[0], H = k.indexOf(O);
|
|
3661
|
-
c(Jt({
|
|
3662
|
-
layout: E,
|
|
3663
|
-
panelConstraints: w,
|
|
3664
|
-
panelId: O.id,
|
|
3665
|
-
panelIndex: H
|
|
3666
|
-
}));
|
|
3667
|
-
}
|
|
3668
|
-
});
|
|
3669
|
-
return () => {
|
|
3670
|
-
X2(), F(), C();
|
|
3671
|
-
};
|
|
3672
|
-
}
|
|
3673
|
-
}, [h, r, y, a]), de(() => {
|
|
3674
|
-
z(r, !!n);
|
|
3675
|
-
}, [n, r, z]);
|
|
3676
|
-
let p;
|
|
3677
|
-
return n && !f && (p = "not-allowed"), /* @__PURE__ */ ie("div", {
|
|
3678
|
-
...l,
|
|
3679
|
-
"aria-controls": u.valueControls,
|
|
3680
|
-
"aria-disabled": n || undefined,
|
|
3681
|
-
"aria-orientation": S,
|
|
3682
|
-
"aria-valuemax": u.valueMax,
|
|
3683
|
-
"aria-valuemin": u.valueMin,
|
|
3684
|
-
"aria-valuenow": u.valueNow,
|
|
3685
|
-
children: e,
|
|
3686
|
-
className: t,
|
|
3687
|
-
"data-separator": n ? "disabled" : m,
|
|
3688
|
-
"data-testid": r,
|
|
3689
|
-
id: r,
|
|
3690
|
-
ref: x,
|
|
3691
|
-
role: "separator",
|
|
3692
|
-
style: {
|
|
3693
|
-
flexBasis: "auto",
|
|
3694
|
-
cursor: p,
|
|
3695
|
-
...s,
|
|
3696
|
-
flexGrow: 0,
|
|
3697
|
-
flexShrink: 0,
|
|
3698
|
-
touchAction: "none"
|
|
3699
|
-
},
|
|
3700
|
-
tabIndex: n ? undefined : 0
|
|
3701
|
-
});
|
|
3702
|
-
}
|
|
3703
|
-
Zt.displayName = "Separator";
|
|
3704
|
-
|
|
3705
|
-
// node_modules/@principal-ade/panels/dist/index.esm.js
|
|
3706
|
-
import { flushSync as y, unstable_batchedUpdates as w, createPortal as x } from "react-dom";
|
|
3707
|
-
import { useTheme as C } from "@principal-ade/industry-theme";
|
|
3708
|
-
function S(e2) {
|
|
3709
|
-
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" };
|
|
3710
|
-
}
|
|
3711
|
-
var z = ({ primaryContent: t2, secondaryContent: n2, collapsedHeader: r2, collapsed: o2 = true, onCollapsedChange: i2, ratio: a2 = 0.3, onRatioChange: l2, maxRatio: s2 = 0.8, collapsedHeight: c2 = 28, theme: d2, className: u2 = "", style: p2, animationDuration: h2 = 200, onCollapseStart: m2, onCollapseComplete: f2, onExpandStart: g, onExpandComplete: v }) => {
|
|
3712
|
-
const b = S(d2);
|
|
3713
|
-
return n2 ? /* @__PURE__ */ e(D2, { primaryContent: t2, secondaryContent: n2, collapsedHeader: r2 ?? { title: "Content" }, collapsed: o2, onCollapsedChange: i2 ?? (() => {}), ratio: a2, onRatioChange: l2 ?? (() => {}), maxRatio: s2, collapsedHeight: c2, theme: d2, className: u2, style: p2, animationDuration: h2, onCollapseStart: m2, onCollapseComplete: f2, onExpandStart: g, onExpandComplete: v }) : /* @__PURE__ */ e("div", { className: `collapsible-split-pane ${u2}`, style: { ...b, ...p2 }, children: /* @__PURE__ */ e("div", { className: "csp-primary-content-full", children: t2 }) });
|
|
3714
|
-
};
|
|
3715
|
-
var D2 = ({ primaryContent: n2, secondaryContent: r2, collapsedHeader: s2, collapsed: c2, onCollapsedChange: d2, ratio: u2, onRatioChange: p2, maxRatio: h2 = 0.8, collapsedHeight: m2 = 28, theme: f2, className: y2 = "", style: w2, animationDuration: x2 = 200, onCollapseStart: C2, onCollapseComplete: R, onExpandStart: N, onExpandComplete: E }) => {
|
|
3716
|
-
const [z2, D3] = o(false), [M, T2] = o(false), A2 = i(null), k = i(undefined), L2 = i(undefined), $2 = i(u2), P = i(false), F = i(c2), B2 = (e2) => 100 * e2;
|
|
3717
|
-
l(() => {
|
|
3718
|
-
F.current = c2;
|
|
3719
|
-
}, [c2]), l(() => {
|
|
3720
|
-
!c2 && u2 > 0 && ($2.current = u2);
|
|
3721
|
-
}, [c2, u2]);
|
|
3722
|
-
const O = a((e2, t2, n3) => {
|
|
3723
|
-
if (!A2.current)
|
|
3724
|
-
return;
|
|
3725
|
-
k.current && cancelAnimationFrame(k.current), L2.current = performance.now();
|
|
3726
|
-
const r3 = (o2) => {
|
|
3727
|
-
if (!L2.current || !A2.current)
|
|
3728
|
-
return;
|
|
3729
|
-
const i2 = o2 - L2.current, a2 = Math.min(i2 / x2, 1), l2 = a2 < 0.5 ? 4 * a2 * a2 * a2 : 1 - Math.pow(-2 * a2 + 2, 3) / 2, s3 = e2 + (t2 - e2) * l2;
|
|
3730
|
-
A2.current.resize(`${s3}%`), a2 < 1 ? k.current = requestAnimationFrame(r3) : (A2.current.resize(`${t2}%`), n3 && n3(), P.current = false, D3(false));
|
|
3731
|
-
};
|
|
3732
|
-
k.current = requestAnimationFrame(r3);
|
|
3733
|
-
}, [x2]), I2 = a(() => {
|
|
3734
|
-
if (z2 || M || !A2.current)
|
|
3735
|
-
return;
|
|
3736
|
-
u2 > 0 && ($2.current = u2), P.current = true, D3(true), C2?.();
|
|
3737
|
-
const e2 = B2(u2);
|
|
3738
|
-
O(e2, 0, () => {
|
|
3739
|
-
F.current = true, d2(true), R?.();
|
|
3740
|
-
});
|
|
3741
|
-
}, [z2, M, u2, O, d2, C2, R]), q2 = a(() => {
|
|
3742
|
-
if (z2 || M || !A2.current)
|
|
3743
|
-
return;
|
|
3744
|
-
P.current = true, D3(true), N?.();
|
|
3745
|
-
const e2 = $2.current || u2 || 0.3, t2 = B2(e2);
|
|
3746
|
-
O(0, t2, () => {
|
|
3747
|
-
F.current = false, d2(false), p2(e2), E?.();
|
|
3748
|
-
});
|
|
3749
|
-
}, [z2, M, u2, O, d2, p2, N, E]), W2 = a(() => {
|
|
3750
|
-
c2 ? q2() : I2();
|
|
3751
|
-
}, [c2, I2, q2]), H = a((e2) => {
|
|
3752
|
-
if (P.current)
|
|
3753
|
-
return;
|
|
3754
|
-
const t2 = e2.asPercentage / 100;
|
|
3755
|
-
t2 <= 0.01 && !F.current ? ($2.current = 0.4, F.current = true, d2(true)) : t2 > 0.01 && F.current && (F.current = false, d2(false)), F.current || p2(t2);
|
|
3756
|
-
}, [p2, d2]), j2 = a(() => {
|
|
3757
|
-
z2 || T2(true);
|
|
3758
|
-
}, [z2]), K2 = a(() => {
|
|
3759
|
-
T2(false);
|
|
3760
|
-
}, []);
|
|
3761
|
-
l(() => {
|
|
3762
|
-
if (c2 && !z2 && A2.current) {
|
|
3763
|
-
A2.current.getSize().asPercentage > 0 && I2();
|
|
3764
|
-
} else if (!c2 && !z2 && A2.current) {
|
|
3765
|
-
A2.current.getSize().asPercentage === 0 && q2();
|
|
3766
|
-
}
|
|
3767
|
-
}, [c2]), l(() => () => {
|
|
3768
|
-
k.current && cancelAnimationFrame(k.current);
|
|
3769
|
-
}, []);
|
|
3770
|
-
const U2 = S(f2), X2 = ["csp-secondary-panel", z2 && !M ? "csp-animating" : "", c2 ? "csp-collapsed" : ""].filter(Boolean).join(" ");
|
|
3771
|
-
return t("div", { className: `collapsible-split-pane ${y2}`, style: { ...U2, ...w2 }, children: [
|
|
3772
|
-
/* @__PURE__ */ t("div", { className: "csp-header " + (c2 ? "csp-header-collapsed" : ""), style: { height: m2, backgroundColor: f2.colors.backgroundSecondary, borderBottom: `1px solid ${f2.colors.border}` }, onClick: c2 ? W2 : undefined, role: c2 ? "button" : undefined, tabIndex: c2 ? 0 : undefined, onKeyDown: c2 ? (e2) => {
|
|
3773
|
-
e2.key !== "Enter" && e2.key !== " " || (e2.preventDefault(), W2());
|
|
3774
|
-
} : undefined, "aria-expanded": !c2, "aria-label": c2 ? `Expand ${s2.title}` : s2.title, children: [
|
|
3775
|
-
s2.icon && /* @__PURE__ */ e("span", { className: "csp-header-icon", style: { color: f2.colors.textSecondary }, children: s2.icon }),
|
|
3776
|
-
/* @__PURE__ */ e("span", { className: "csp-header-title", style: { color: f2.colors.text, fontFamily: f2.fonts.body, fontSize: f2.fontSizes[1], fontWeight: f2.fontWeights.medium }, children: s2.title }),
|
|
3777
|
-
/* @__PURE__ */ e("button", { className: "csp-header-toggle", style: { color: f2.colors.textSecondary }, onClick: (e2) => {
|
|
3778
|
-
e2.stopPropagation(), W2();
|
|
3779
|
-
}, "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" }) }) })
|
|
3780
|
-
] }),
|
|
3781
|
-
/* @__PURE__ */ e("div", { className: "csp-content-area", children: /* @__PURE__ */ t(Ut, { orientation: "vertical", onLayoutChange: j2, onLayoutChanged: K2, children: [
|
|
3782
|
-
/* @__PURE__ */ e(qt, { panelRef: A2, defaultSize: c2 ? "0%" : `${B2(u2)}%`, minSize: "0%", maxSize: `${B2(h2)}%`, onResize: H, className: X2, children: /* @__PURE__ */ e("div", { className: "csp-secondary-body", children: r2 }) }),
|
|
3783
|
-
/* @__PURE__ */ e(Zt, { className: "csp-resize-handle", children: /* @__PURE__ */ e("div", { className: "csp-resize-handle-bar" }) }),
|
|
3784
|
-
/* @__PURE__ */ e(qt, { className: "csp-primary-panel", minSize: "20%", children: /* @__PURE__ */ e("div", { className: "csp-panel-content", children: n2 }) })
|
|
3785
|
-
] }) })
|
|
3786
|
-
] });
|
|
3787
|
-
};
|
|
3788
|
-
var A2 = s(null);
|
|
3789
|
-
var F = d(({ panels: o2, className: a2 = "", style: s2, theme: c2, minPanelWidth: d2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m2, preventKeyboardScroll: f2 = true, disableSwipe: g = false }, v) => {
|
|
3790
|
-
const b = i(null), y2 = i(false), w2 = i(null), x2 = S(c2);
|
|
3791
|
-
u(v, () => ({ scrollToPanel: (e2) => {
|
|
3792
|
-
if (!b.current)
|
|
3793
|
-
return;
|
|
3794
|
-
const t2 = b.current, n2 = t2.children[e2];
|
|
3795
|
-
if (n2) {
|
|
3796
|
-
y2.current = true, w2.current && clearTimeout(w2.current);
|
|
3797
|
-
const e3 = n2.offsetLeft;
|
|
3798
|
-
t2.scrollTo({ left: e3, behavior: "smooth" }), w2.current = setTimeout(() => {
|
|
3799
|
-
y2.current = false;
|
|
3800
|
-
}, 500);
|
|
3801
|
-
}
|
|
3802
|
-
}, getCurrentPanel: () => {
|
|
3803
|
-
if (!b.current || b.current.children.length === 0)
|
|
3804
|
-
return 0;
|
|
3805
|
-
const e2 = b.current, t2 = e2.getBoundingClientRect().left;
|
|
3806
|
-
let n2 = 0, r2 = 1 / 0;
|
|
3807
|
-
for (let o3 = 0;o3 < e2.children.length; o3++) {
|
|
3808
|
-
const i2 = e2.children[o3].getBoundingClientRect(), a3 = Math.abs(i2.left - t2);
|
|
3809
|
-
a3 < r2 && (r2 = a3, n2 = o3);
|
|
3810
|
-
}
|
|
3811
|
-
return n2;
|
|
3812
|
-
} }));
|
|
3813
|
-
l(() => {
|
|
3814
|
-
if (!f2 || !b.current)
|
|
3815
|
-
return;
|
|
3816
|
-
const e2 = b.current, t2 = (e3) => {
|
|
3817
|
-
const t3 = e3.target;
|
|
3818
|
-
if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
|
|
3819
|
-
return;
|
|
3820
|
-
[" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e3.key) && e3.preventDefault();
|
|
3821
|
-
};
|
|
3822
|
-
return e2.addEventListener("keydown", t2), () => {
|
|
3823
|
-
e2.removeEventListener("keydown", t2);
|
|
3824
|
-
};
|
|
3825
|
-
}, [f2]), l(() => () => {
|
|
3826
|
-
w2.current && clearTimeout(w2.current);
|
|
3827
|
-
}, []);
|
|
3828
|
-
const C2 = o2.length, R = 2 * d2;
|
|
3829
|
-
let N;
|
|
3830
|
-
N = C2 === 1 || C2 === 2 ? "100%" : `max(${d2}px, ${100 * p2}%)`;
|
|
3831
|
-
const E = r.useId().replace(/:/g, "_");
|
|
3832
|
-
return t(n, { children: [
|
|
3833
|
-
C2 === 2 && /* @__PURE__ */ e("style", { children: `
|
|
3834
|
-
.snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3835
|
-
width: 100%;
|
|
3836
|
-
}
|
|
3837
|
-
@container (min-width: ${R}px) {
|
|
3838
|
-
.snap-carousel-container[data-carousel-id="${E}"][data-panel-count="2"] .snap-carousel-panel {
|
|
3839
|
-
width: 50%;
|
|
3840
|
-
}
|
|
3841
|
-
}
|
|
3842
|
-
` }),
|
|
3843
|
-
/* @__PURE__ */ e("div", { ref: b, className: `snap-carousel-container ${g ? "swipe-disabled" : ""} ${a2}`, 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": N, "--snap-carousel-panel-count": C2, "--snap-carousel-two-panel-threshold": `${R}px` }, onScroll: (e2) => {
|
|
3844
|
-
if (!m2 || !b.current || b.current.children.length === 0)
|
|
3845
|
-
return;
|
|
3846
|
-
if (y2.current)
|
|
3847
|
-
return;
|
|
3848
|
-
const t2 = b.current, n2 = t2.getBoundingClientRect().left;
|
|
3849
|
-
let r2 = 0, o3 = 1 / 0;
|
|
3850
|
-
for (let i2 = 0;i2 < t2.children.length; i2++) {
|
|
3851
|
-
const e3 = t2.children[i2].getBoundingClientRect(), a3 = Math.abs(e3.left - n2);
|
|
3852
|
-
a3 < o3 && (o3 = a3, r2 = i2);
|
|
3853
|
-
}
|
|
3854
|
-
m2(r2);
|
|
3855
|
-
}, "data-panel-count": C2, "data-carousel-id": E, children: o2.map((t2, n2) => /* @__PURE__ */ e("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
3856
|
-
] });
|
|
3857
|
-
});
|
|
3858
|
-
F.displayName = "SnapCarousel";
|
|
3859
|
-
var I2 = typeof window != "undefined" && window.document !== undefined && window.document.createElement !== undefined;
|
|
3860
|
-
function q2(e2) {
|
|
3861
|
-
const t2 = Object.prototype.toString.call(e2);
|
|
3862
|
-
return t2 === "[object Window]" || t2 === "[object global]";
|
|
3863
|
-
}
|
|
3864
|
-
function W2(e2) {
|
|
3865
|
-
return "nodeType" in e2;
|
|
3866
|
-
}
|
|
3867
|
-
function H(e2) {
|
|
3868
|
-
var t2, n2;
|
|
3869
|
-
return e2 ? q2(e2) ? e2 : W2(e2) && (t2 = (n2 = e2.ownerDocument) == null ? undefined : n2.defaultView) != null ? t2 : window : window;
|
|
3870
|
-
}
|
|
3871
|
-
function j2(e2) {
|
|
3872
|
-
const { Document: t2 } = H(e2);
|
|
3873
|
-
return e2 instanceof t2;
|
|
3874
|
-
}
|
|
3875
|
-
function K2(e2) {
|
|
3876
|
-
return !q2(e2) && e2 instanceof H(e2).HTMLElement;
|
|
3877
|
-
}
|
|
3878
|
-
function U2(e2) {
|
|
3879
|
-
return e2 instanceof H(e2).SVGElement;
|
|
3880
|
-
}
|
|
3881
|
-
function X2(e2) {
|
|
3882
|
-
return e2 ? q2(e2) ? e2.document : W2(e2) ? j2(e2) ? e2 : K2(e2) || U2(e2) ? e2.ownerDocument : document : document : document;
|
|
3883
|
-
}
|
|
3884
|
-
function te2(e2) {
|
|
3885
|
-
return function(t2) {
|
|
3886
|
-
for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1;o2 < n2; o2++)
|
|
3887
|
-
r2[o2 - 1] = arguments[o2];
|
|
3888
|
-
return r2.reduce((t3, n3) => {
|
|
3889
|
-
const r3 = Object.entries(n3);
|
|
3890
|
-
for (const [o3, i2] of r3) {
|
|
3891
|
-
const n4 = t3[o3];
|
|
3892
|
-
n4 != null && (t3[o3] = n4 + e2 * i2);
|
|
3893
|
-
}
|
|
3894
|
-
return t3;
|
|
3895
|
-
}, { ...t2 });
|
|
3896
|
-
};
|
|
3897
|
-
}
|
|
3898
|
-
var ne2 = /* @__PURE__ */ te2(1);
|
|
3899
|
-
var re2 = /* @__PURE__ */ te2(-1);
|
|
3900
|
-
function oe2(e2) {
|
|
3901
|
-
if (!e2)
|
|
3902
|
-
return false;
|
|
3903
|
-
const { KeyboardEvent: t2 } = H(e2.target);
|
|
3904
|
-
return t2 && e2 instanceof t2;
|
|
3905
|
-
}
|
|
3906
|
-
function ie2(e2) {
|
|
3907
|
-
if (function(e3) {
|
|
3908
|
-
if (!e3)
|
|
3909
|
-
return false;
|
|
3910
|
-
const { TouchEvent: t2 } = H(e3.target);
|
|
3911
|
-
return t2 && e3 instanceof t2;
|
|
3912
|
-
}(e2)) {
|
|
3913
|
-
if (e2.touches && e2.touches.length) {
|
|
3914
|
-
const { clientX: t2, clientY: n2 } = e2.touches[0];
|
|
3915
|
-
return { x: t2, y: n2 };
|
|
3916
|
-
}
|
|
3917
|
-
if (e2.changedTouches && e2.changedTouches.length) {
|
|
3918
|
-
const { clientX: t2, clientY: n2 } = e2.changedTouches[0];
|
|
3919
|
-
return { x: t2, y: n2 };
|
|
3920
|
-
}
|
|
3921
|
-
}
|
|
3922
|
-
return function(e3) {
|
|
3923
|
-
return "clientX" in e3 && "clientY" in e3;
|
|
3924
|
-
}(e2) ? { x: e2.clientX, y: e2.clientY } : null;
|
|
3925
|
-
}
|
|
3926
|
-
var fe2;
|
|
3927
|
-
var ge2;
|
|
3928
|
-
(ge2 = fe2 || (fe2 = {})).DragStart = "dragStart", ge2.DragMove = "dragMove", ge2.DragEnd = "dragEnd", ge2.DragCancel = "dragCancel", ge2.DragOver = "dragOver", ge2.RegisterDroppable = "registerDroppable", ge2.SetDroppableDisabled = "setDroppableDisabled", ge2.UnregisterDroppable = "unregisterDroppable";
|
|
3929
|
-
var be2 = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
3930
|
-
var Me2 = { ignoreTransform: false };
|
|
3931
|
-
function Te2(e2, t2) {
|
|
3932
|
-
t2 === undefined && (t2 = Me2);
|
|
3933
|
-
let n2 = e2.getBoundingClientRect();
|
|
3934
|
-
if (t2.ignoreTransform) {
|
|
3935
|
-
const { transform: t3, transformOrigin: r3 } = H(e2).getComputedStyle(e2);
|
|
3936
|
-
t3 && (n2 = function(e3, t4, n3) {
|
|
3937
|
-
const r4 = function(e4) {
|
|
3938
|
-
if (e4.startsWith("matrix3d(")) {
|
|
3939
|
-
const t5 = e4.slice(9, -1).split(/, /);
|
|
3940
|
-
return { x: +t5[12], y: +t5[13], scaleX: +t5[0], scaleY: +t5[5] };
|
|
3941
|
-
}
|
|
3942
|
-
if (e4.startsWith("matrix(")) {
|
|
3943
|
-
const t5 = e4.slice(7, -1).split(/, /);
|
|
3944
|
-
return { x: +t5[4], y: +t5[5], scaleX: +t5[0], scaleY: +t5[3] };
|
|
3945
|
-
}
|
|
3946
|
-
return null;
|
|
3947
|
-
}(t4);
|
|
3948
|
-
if (!r4)
|
|
3949
|
-
return e3;
|
|
3950
|
-
const { scaleX: o3, scaleY: i3, x: a3, y: l3 } = r4, s3 = e3.left - a3 - (1 - o3) * parseFloat(n3), c2 = e3.top - l3 - (1 - i3) * parseFloat(n3.slice(n3.indexOf(" ") + 1)), d2 = o3 ? e3.width / o3 : e3.width, u2 = i3 ? e3.height / i3 : e3.height;
|
|
3951
|
-
return { width: d2, height: u2, top: c2, right: s3 + d2, bottom: c2 + u2, left: s3 };
|
|
3952
|
-
}(n2, t3, r3));
|
|
3953
|
-
}
|
|
3954
|
-
const { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 } = n2;
|
|
3955
|
-
return { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 };
|
|
3956
|
-
}
|
|
3957
|
-
function Ae2(e2) {
|
|
3958
|
-
return Te2(e2, { ignoreTransform: true });
|
|
3959
|
-
}
|
|
3960
|
-
function ke2(e2, t2) {
|
|
3961
|
-
const n2 = [];
|
|
3962
|
-
return e2 ? function r(o2) {
|
|
3963
|
-
if (t2 != null && n2.length >= t2)
|
|
3964
|
-
return n2;
|
|
3965
|
-
if (!o2)
|
|
3966
|
-
return n2;
|
|
3967
|
-
if (j2(o2) && o2.scrollingElement != null && !n2.includes(o2.scrollingElement))
|
|
3968
|
-
return n2.push(o2.scrollingElement), n2;
|
|
3969
|
-
if (!K2(o2) || U2(o2))
|
|
3970
|
-
return n2;
|
|
3971
|
-
if (n2.includes(o2))
|
|
3972
|
-
return n2;
|
|
3973
|
-
const i2 = H(e2).getComputedStyle(o2);
|
|
3974
|
-
return o2 !== e2 && function(e3, t3) {
|
|
3975
|
-
t3 === undefined && (t3 = H(e3).getComputedStyle(e3));
|
|
3976
|
-
const n3 = /(auto|scroll|overlay)/;
|
|
3977
|
-
return ["overflow", "overflowX", "overflowY"].some((e4) => {
|
|
3978
|
-
const r2 = t3[e4];
|
|
3979
|
-
return typeof r2 == "string" && n3.test(r2);
|
|
3980
|
-
});
|
|
3981
|
-
}(o2, i2) && n2.push(o2), function(e3, t3) {
|
|
3982
|
-
return t3 === undefined && (t3 = H(e3).getComputedStyle(e3)), t3.position === "fixed";
|
|
3983
|
-
}(o2, i2) ? n2 : r(o2.parentNode);
|
|
3984
|
-
}(e2) : n2;
|
|
3985
|
-
}
|
|
3986
|
-
function Le2(e2) {
|
|
3987
|
-
const [t2] = ke2(e2, 1);
|
|
3988
|
-
return t2 != null ? t2 : null;
|
|
3989
|
-
}
|
|
3990
|
-
var Oe2;
|
|
3991
|
-
var Ie2;
|
|
3992
|
-
function qe2(e2) {
|
|
3993
|
-
return !(!I2 || !e2) && e2 === document.scrollingElement;
|
|
3994
|
-
}
|
|
3995
|
-
function We2(e2) {
|
|
3996
|
-
const t2 = { x: 0, y: 0 }, n2 = qe2(e2) ? { height: window.innerHeight, width: window.innerWidth } : { height: e2.clientHeight, width: e2.clientWidth }, r2 = { x: e2.scrollWidth - n2.width, y: e2.scrollHeight - n2.height };
|
|
3997
|
-
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 };
|
|
3998
|
-
}
|
|
3999
|
-
(Ie2 = Oe2 || (Oe2 = {}))[Ie2.Forward = 1] = "Forward", Ie2[Ie2.Backward = -1] = "Backward";
|
|
4000
|
-
function Ke2(e2) {
|
|
4001
|
-
if (e2 === document.scrollingElement) {
|
|
4002
|
-
const { innerWidth: e3, innerHeight: t3 } = window;
|
|
4003
|
-
return { top: 0, left: 0, right: e3, bottom: t3, width: e3, height: t3 };
|
|
4004
|
-
}
|
|
4005
|
-
const { top: t2, left: n2, right: r2, bottom: o2 } = e2.getBoundingClientRect();
|
|
4006
|
-
return { top: t2, left: n2, right: r2, bottom: o2, width: e2.clientWidth, height: e2.clientHeight };
|
|
4007
|
-
}
|
|
4008
|
-
class Ve2 {
|
|
4009
|
-
constructor(e2) {
|
|
4010
|
-
this.target = undefined, this.listeners = [], this.removeAll = () => {
|
|
4011
|
-
this.listeners.forEach((e3) => {
|
|
4012
|
-
var t2;
|
|
4013
|
-
return (t2 = this.target) == null ? undefined : t2.removeEventListener(...e3);
|
|
4014
|
-
});
|
|
4015
|
-
}, this.target = e2;
|
|
4016
|
-
}
|
|
4017
|
-
add(e2, t2, n2) {
|
|
4018
|
-
var r2;
|
|
4019
|
-
(r2 = this.target) == null || r2.addEventListener(e2, t2, n2), this.listeners.push([e2, t2, n2]);
|
|
4020
|
-
}
|
|
4021
|
-
}
|
|
4022
|
-
function Je2(e2, t2) {
|
|
4023
|
-
const n2 = Math.abs(e2.x), r2 = Math.abs(e2.y);
|
|
4024
|
-
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;
|
|
4025
|
-
}
|
|
4026
|
-
var Ge2;
|
|
4027
|
-
var _e2;
|
|
4028
|
-
var Qe2;
|
|
4029
|
-
var Ze2;
|
|
4030
|
-
function et2(e2) {
|
|
4031
|
-
e2.preventDefault();
|
|
4032
|
-
}
|
|
4033
|
-
function tt2(e2) {
|
|
4034
|
-
e2.stopPropagation();
|
|
4035
|
-
}
|
|
4036
|
-
(_e2 = Ge2 || (Ge2 = {})).Click = "click", _e2.DragStart = "dragstart", _e2.Keydown = "keydown", _e2.ContextMenu = "contextmenu", _e2.Resize = "resize", _e2.SelectionChange = "selectionchange", _e2.VisibilityChange = "visibilitychange", (Ze2 = Qe2 || (Qe2 = {})).Space = "Space", Ze2.Down = "ArrowDown", Ze2.Right = "ArrowRight", Ze2.Left = "ArrowLeft", Ze2.Up = "ArrowUp", Ze2.Esc = "Escape", Ze2.Enter = "Enter", Ze2.Tab = "Tab";
|
|
4037
|
-
var nt2 = { start: [Qe2.Space, Qe2.Enter], cancel: [Qe2.Esc], end: [Qe2.Space, Qe2.Enter, Qe2.Tab] };
|
|
4038
|
-
var rt2 = (e2, t2) => {
|
|
4039
|
-
let { currentCoordinates: n2 } = t2;
|
|
4040
|
-
switch (e2.code) {
|
|
4041
|
-
case Qe2.Right:
|
|
4042
|
-
return { ...n2, x: n2.x + 25 };
|
|
4043
|
-
case Qe2.Left:
|
|
4044
|
-
return { ...n2, x: n2.x - 25 };
|
|
4045
|
-
case Qe2.Down:
|
|
4046
|
-
return { ...n2, y: n2.y + 25 };
|
|
4047
|
-
case Qe2.Up:
|
|
4048
|
-
return { ...n2, y: n2.y - 25 };
|
|
4049
|
-
}
|
|
4050
|
-
};
|
|
4051
|
-
|
|
4052
|
-
class ot2 {
|
|
4053
|
-
constructor(e2) {
|
|
4054
|
-
this.props = undefined, this.autoScrollEnabled = false, this.referenceCoordinates = undefined, this.listeners = undefined, this.windowListeners = undefined, this.props = e2;
|
|
4055
|
-
const { event: { target: t2 } } = e2;
|
|
4056
|
-
this.props = e2, this.listeners = new Ve2(X2(t2)), this.windowListeners = new Ve2(H(t2)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
|
|
4057
|
-
}
|
|
4058
|
-
attach() {
|
|
4059
|
-
this.handleStart(), this.windowListeners.add(Ge2.Resize, this.handleCancel), this.windowListeners.add(Ge2.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Ge2.Keydown, this.handleKeyDown));
|
|
4060
|
-
}
|
|
4061
|
-
handleStart() {
|
|
4062
|
-
const { activeNode: e2, onStart: t2 } = this.props, n2 = e2.node.current;
|
|
4063
|
-
n2 && function(e3, t3) {
|
|
4064
|
-
if (t3 === undefined && (t3 = Te2), !e3)
|
|
4065
|
-
return;
|
|
4066
|
-
const { top: n3, left: r2, bottom: o2, right: i2 } = t3(e3);
|
|
4067
|
-
Le2(e3) && (o2 <= 0 || i2 <= 0 || n3 >= window.innerHeight || r2 >= window.innerWidth) && e3.scrollIntoView({ block: "center", inline: "center" });
|
|
4068
|
-
}(n2), t2(be2);
|
|
4069
|
-
}
|
|
4070
|
-
handleKeyDown(e2) {
|
|
4071
|
-
if (oe2(e2)) {
|
|
4072
|
-
const { active: t2, context: n2, options: r2 } = this.props, { keyboardCodes: o2 = nt2, coordinateGetter: i2 = rt2, scrollBehavior: a2 = "smooth" } = r2, { code: l2 } = e2;
|
|
4073
|
-
if (o2.end.includes(l2))
|
|
4074
|
-
return void this.handleEnd(e2);
|
|
4075
|
-
if (o2.cancel.includes(l2))
|
|
4076
|
-
return void this.handleCancel(e2);
|
|
4077
|
-
const { collisionRect: s2 } = n2.current, c2 = s2 ? { x: s2.left, y: s2.top } : be2;
|
|
4078
|
-
this.referenceCoordinates || (this.referenceCoordinates = c2);
|
|
4079
|
-
const d2 = i2(e2, { active: t2, context: n2.current, currentCoordinates: c2 });
|
|
4080
|
-
if (d2) {
|
|
4081
|
-
const t3 = re2(d2, c2), r3 = { x: 0, y: 0 }, { scrollableAncestors: o3 } = n2.current;
|
|
4082
|
-
for (const n3 of o3) {
|
|
4083
|
-
const o4 = e2.code, { isTop: i3, isRight: l3, isLeft: s3, isBottom: c3, maxScroll: u2, minScroll: p2 } = We2(n3), h2 = Ke2(n3), m2 = { x: Math.min(o4 === Qe2.Right ? h2.right - h2.width / 2 : h2.right, Math.max(o4 === Qe2.Right ? h2.left : h2.left + h2.width / 2, d2.x)), y: Math.min(o4 === Qe2.Down ? h2.bottom - h2.height / 2 : h2.bottom, Math.max(o4 === Qe2.Down ? h2.top : h2.top + h2.height / 2, d2.y)) }, f2 = o4 === Qe2.Right && !l3 || o4 === Qe2.Left && !s3, g = o4 === Qe2.Down && !c3 || o4 === Qe2.Up && !i3;
|
|
4084
|
-
if (f2 && m2.x !== d2.x) {
|
|
4085
|
-
const e3 = n3.scrollLeft + t3.x, i4 = o4 === Qe2.Right && e3 <= u2.x || o4 === Qe2.Left && e3 >= p2.x;
|
|
4086
|
-
if (i4 && !t3.y)
|
|
4087
|
-
return void n3.scrollTo({ left: e3, behavior: a2 });
|
|
4088
|
-
r3.x = i4 ? n3.scrollLeft - e3 : o4 === Qe2.Right ? n3.scrollLeft - u2.x : n3.scrollLeft - p2.x, r3.x && n3.scrollBy({ left: -r3.x, behavior: a2 });
|
|
4089
|
-
break;
|
|
4090
|
-
}
|
|
4091
|
-
if (g && m2.y !== d2.y) {
|
|
4092
|
-
const e3 = n3.scrollTop + t3.y, i4 = o4 === Qe2.Down && e3 <= u2.y || o4 === Qe2.Up && e3 >= p2.y;
|
|
4093
|
-
if (i4 && !t3.x)
|
|
4094
|
-
return void n3.scrollTo({ top: e3, behavior: a2 });
|
|
4095
|
-
r3.y = i4 ? n3.scrollTop - e3 : o4 === Qe2.Down ? n3.scrollTop - u2.y : n3.scrollTop - p2.y, r3.y && n3.scrollBy({ top: -r3.y, behavior: a2 });
|
|
4096
|
-
break;
|
|
4097
|
-
}
|
|
4098
|
-
}
|
|
4099
|
-
this.handleMove(e2, ne2(re2(d2, this.referenceCoordinates), r3));
|
|
4100
|
-
}
|
|
4101
|
-
}
|
|
4102
|
-
}
|
|
4103
|
-
handleMove(e2, t2) {
|
|
4104
|
-
const { onMove: n2 } = this.props;
|
|
4105
|
-
e2.preventDefault(), n2(t2);
|
|
4106
|
-
}
|
|
4107
|
-
handleEnd(e2) {
|
|
4108
|
-
const { onEnd: t2 } = this.props;
|
|
4109
|
-
e2.preventDefault(), this.detach(), t2();
|
|
4110
|
-
}
|
|
4111
|
-
handleCancel(e2) {
|
|
4112
|
-
const { onCancel: t2 } = this.props;
|
|
4113
|
-
e2.preventDefault(), this.detach(), t2();
|
|
4114
|
-
}
|
|
4115
|
-
detach() {
|
|
4116
|
-
this.listeners.removeAll(), this.windowListeners.removeAll();
|
|
4117
|
-
}
|
|
4118
|
-
}
|
|
4119
|
-
function it2(e2) {
|
|
4120
|
-
return Boolean(e2 && "distance" in e2);
|
|
4121
|
-
}
|
|
4122
|
-
function at2(e2) {
|
|
4123
|
-
return Boolean(e2 && "delay" in e2);
|
|
4124
|
-
}
|
|
4125
|
-
ot2.activators = [{ eventName: "onKeyDown", handler: (e2, t2, n2) => {
|
|
4126
|
-
let { keyboardCodes: r2 = nt2, onActivation: o2 } = t2, { active: i2 } = n2;
|
|
4127
|
-
const { code: a2 } = e2.nativeEvent;
|
|
4128
|
-
if (r2.start.includes(a2)) {
|
|
4129
|
-
const t3 = i2.activatorNode.current;
|
|
4130
|
-
return (!t3 || e2.target === t3) && (e2.preventDefault(), o2 == null || o2({ event: e2.nativeEvent }), true);
|
|
4131
|
-
}
|
|
4132
|
-
return false;
|
|
4133
|
-
} }];
|
|
4134
|
-
|
|
4135
|
-
class lt {
|
|
4136
|
-
constructor(e2, t2, n2) {
|
|
4137
|
-
var r2;
|
|
4138
|
-
n2 === undefined && (n2 = function(e3) {
|
|
4139
|
-
const { EventTarget: t3 } = H(e3);
|
|
4140
|
-
return e3 instanceof t3 ? e3 : X2(e3);
|
|
4141
|
-
}(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;
|
|
4142
|
-
const { event: o2 } = e2, { target: i2 } = o2;
|
|
4143
|
-
this.props = e2, this.events = t2, this.document = X2(i2), this.documentListeners = new Ve2(this.document), this.listeners = new Ve2(n2), this.windowListeners = new Ve2(H(i2)), this.initialCoordinates = (r2 = ie2(o2)) != null ? r2 : be2, 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();
|
|
4144
|
-
}
|
|
4145
|
-
attach() {
|
|
4146
|
-
const { events: e2, props: { options: { activationConstraint: t2, bypassActivationConstraint: n2 } } } = this;
|
|
4147
|
-
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(Ge2.Resize, this.handleCancel), this.windowListeners.add(Ge2.DragStart, et2), this.windowListeners.add(Ge2.VisibilityChange, this.handleCancel), this.windowListeners.add(Ge2.ContextMenu, et2), this.documentListeners.add(Ge2.Keydown, this.handleKeydown), t2) {
|
|
4148
|
-
if (n2 != null && n2({ event: this.props.event, activeNode: this.props.activeNode, options: this.props.options }))
|
|
4149
|
-
return this.handleStart();
|
|
4150
|
-
if (at2(t2))
|
|
4151
|
-
return this.timeoutId = setTimeout(this.handleStart, t2.delay), void this.handlePending(t2);
|
|
4152
|
-
if (it2(t2))
|
|
4153
|
-
return void this.handlePending(t2);
|
|
4154
|
-
}
|
|
4155
|
-
this.handleStart();
|
|
4156
|
-
}
|
|
4157
|
-
detach() {
|
|
4158
|
-
this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
|
|
4159
|
-
}
|
|
4160
|
-
handlePending(e2, t2) {
|
|
4161
|
-
const { active: n2, onPending: r2 } = this.props;
|
|
4162
|
-
r2(n2, e2, this.initialCoordinates, t2);
|
|
4163
|
-
}
|
|
4164
|
-
handleStart() {
|
|
4165
|
-
const { initialCoordinates: e2 } = this, { onStart: t2 } = this.props;
|
|
4166
|
-
e2 && (this.activated = true, this.documentListeners.add(Ge2.Click, tt2, { capture: true }), this.removeTextSelection(), this.documentListeners.add(Ge2.SelectionChange, this.removeTextSelection), t2(e2));
|
|
4167
|
-
}
|
|
4168
|
-
handleMove(e2) {
|
|
4169
|
-
var t2;
|
|
4170
|
-
const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove: i2, options: { activationConstraint: a2 } } = o2;
|
|
4171
|
-
if (!r2)
|
|
4172
|
-
return;
|
|
4173
|
-
const l2 = (t2 = ie2(e2)) != null ? t2 : be2, s2 = re2(r2, l2);
|
|
4174
|
-
if (!n2 && a2) {
|
|
4175
|
-
if (it2(a2)) {
|
|
4176
|
-
if (a2.tolerance != null && Je2(s2, a2.tolerance))
|
|
4177
|
-
return this.handleCancel();
|
|
4178
|
-
if (Je2(s2, a2.distance))
|
|
4179
|
-
return this.handleStart();
|
|
4180
|
-
}
|
|
4181
|
-
return at2(a2) && Je2(s2, a2.tolerance) ? this.handleCancel() : void this.handlePending(a2, s2);
|
|
4182
|
-
}
|
|
4183
|
-
e2.cancelable && e2.preventDefault(), i2(l2);
|
|
4184
|
-
}
|
|
4185
|
-
handleEnd() {
|
|
4186
|
-
const { onAbort: e2, onEnd: t2 } = this.props;
|
|
4187
|
-
this.detach(), this.activated || e2(this.props.active), t2();
|
|
4188
|
-
}
|
|
4189
|
-
handleCancel() {
|
|
4190
|
-
const { onAbort: e2, onCancel: t2 } = this.props;
|
|
4191
|
-
this.detach(), this.activated || e2(this.props.active), t2();
|
|
4192
|
-
}
|
|
4193
|
-
handleKeydown(e2) {
|
|
4194
|
-
e2.code === Qe2.Esc && this.handleCancel();
|
|
4195
|
-
}
|
|
4196
|
-
removeTextSelection() {
|
|
4197
|
-
var e2;
|
|
4198
|
-
(e2 = this.document.getSelection()) == null || e2.removeAllRanges();
|
|
4199
|
-
}
|
|
4200
|
-
}
|
|
4201
|
-
var st2 = { cancel: { name: "pointercancel" }, move: { name: "pointermove" }, end: { name: "pointerup" } };
|
|
4202
|
-
|
|
4203
|
-
class ct extends lt {
|
|
4204
|
-
constructor(e2) {
|
|
4205
|
-
const { event: t2 } = e2, n2 = X2(t2.target);
|
|
4206
|
-
super(e2, st2, n2);
|
|
4207
|
-
}
|
|
4208
|
-
}
|
|
4209
|
-
ct.activators = [{ eventName: "onPointerDown", handler: (e2, t2) => {
|
|
4210
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4211
|
-
return !(!n2.isPrimary || n2.button !== 0) && (r2 == null || r2({ event: n2 }), true);
|
|
4212
|
-
} }];
|
|
4213
|
-
var dt = { move: { name: "mousemove" }, end: { name: "mouseup" } };
|
|
4214
|
-
var ut;
|
|
4215
|
-
var pt2;
|
|
4216
|
-
(pt2 = ut || (ut = {}))[pt2.RightClick = 2] = "RightClick";
|
|
4217
|
-
(class extends lt {
|
|
4218
|
-
constructor(e2) {
|
|
4219
|
-
super(e2, dt, X2(e2.event.target));
|
|
4220
|
-
}
|
|
4221
|
-
}).activators = [{ eventName: "onMouseDown", handler: (e2, t2) => {
|
|
4222
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4223
|
-
return n2.button !== ut.RightClick && (r2 == null || r2({ event: n2 }), true);
|
|
4224
|
-
} }];
|
|
4225
|
-
var ht2 = { cancel: { name: "touchcancel" }, move: { name: "touchmove" }, end: { name: "touchend" } };
|
|
4226
|
-
var mt2;
|
|
4227
|
-
var ft;
|
|
4228
|
-
var gt2;
|
|
4229
|
-
var vt2;
|
|
4230
|
-
(class extends lt {
|
|
4231
|
-
constructor(e2) {
|
|
4232
|
-
super(e2, ht2);
|
|
4233
|
-
}
|
|
4234
|
-
static setup() {
|
|
4235
|
-
return window.addEventListener(ht2.move.name, e2, { capture: false, passive: false }), function() {
|
|
4236
|
-
window.removeEventListener(ht2.move.name, e2);
|
|
4237
|
-
};
|
|
4238
|
-
function e2() {}
|
|
4239
|
-
}
|
|
4240
|
-
}).activators = [{ eventName: "onTouchStart", handler: (e2, t2) => {
|
|
4241
|
-
let { nativeEvent: n2 } = e2, { onActivation: r2 } = t2;
|
|
4242
|
-
const { touches: o2 } = n2;
|
|
4243
|
-
return !(o2.length > 1) && (r2 == null || r2({ event: n2 }), true);
|
|
4244
|
-
} }], (ft = mt2 || (mt2 = {}))[ft.Pointer = 0] = "Pointer", ft[ft.DraggableRect = 1] = "DraggableRect", (vt2 = gt2 || (gt2 = {}))[vt2.TreeOrder = 0] = "TreeOrder", vt2[vt2.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
4245
|
-
var yt2 = { x: { [Oe2.Backward]: false, [Oe2.Forward]: false }, y: { [Oe2.Backward]: false, [Oe2.Forward]: false } };
|
|
4246
|
-
var wt2;
|
|
4247
|
-
var xt2;
|
|
4248
|
-
var Ct2;
|
|
4249
|
-
(xt2 = wt2 || (wt2 = {}))[xt2.Always = 0] = "Always", xt2[xt2.BeforeDragging = 1] = "BeforeDragging", xt2[xt2.WhileDragging = 2] = "WhileDragging", (Ct2 || (Ct2 = {})).Optimized = "optimized";
|
|
4250
|
-
var Pt2 = { draggable: { measure: Ae2 }, droppable: { measure: Ae2, strategy: wt2.WhileDragging, frequency: Ct2.Optimized }, dragOverlay: { measure: Te2 } };
|
|
4251
|
-
var jt2 = /* @__PURE__ */ s({ ...be2, scaleX: 1, scaleY: 1 });
|
|
4252
|
-
var Kt;
|
|
4253
|
-
var Ut2;
|
|
4254
|
-
(Ut2 = Kt || (Kt = {}))[Ut2.Uninitialized = 0] = "Uninitialized", Ut2[Ut2.Initializing = 1] = "Initializing", Ut2[Ut2.Initialized = 2] = "Initialized";
|
|
4255
|
-
|
|
4256
|
-
// src/panels/TabbedTerminalPanel.tsx
|
|
4257
|
-
import { Terminal as TerminalIcon2, Lock as Lock2, Unlock as Unlock2, Box, Boxes } from "lucide-react";
|
|
1903
|
+
import { CollapsibleSplitPane } from "@principal-ade/panels";
|
|
1904
|
+
import { Terminal as TerminalIcon2, Lock as Lock2, Unlock as Unlock2, Box, Boxes, Paperclip } from "lucide-react";
|
|
4258
1905
|
import React3, {
|
|
4259
1906
|
useState as useState4,
|
|
4260
1907
|
useCallback as useCallback5,
|
|
@@ -4265,7 +1912,7 @@ import { jsx as jsx7, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-run
|
|
|
4265
1912
|
var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs6("div", {
|
|
4266
1913
|
style: { display: "flex", gap: 1, alignItems: "center", height: 12 },
|
|
4267
1914
|
children: [
|
|
4268
|
-
[0, 1, 2, 3, 4].map((
|
|
1915
|
+
[0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx7("div", {
|
|
4269
1916
|
style: {
|
|
4270
1917
|
width: 2,
|
|
4271
1918
|
height: 10,
|
|
@@ -4273,9 +1920,9 @@ var ActivityIndicator = ({ color, isAnimating }) => /* @__PURE__ */ jsxs6("div",
|
|
|
4273
1920
|
borderRadius: 1,
|
|
4274
1921
|
transformOrigin: "center",
|
|
4275
1922
|
transform: isAnimating ? undefined : "scaleY(0.4)",
|
|
4276
|
-
animation: isAnimating ? `waveSine 1.2s ease-in-out ${
|
|
1923
|
+
animation: isAnimating ? `waveSine 1.2s ease-in-out ${i * 0.1}s infinite` : "none"
|
|
4277
1924
|
}
|
|
4278
|
-
},
|
|
1925
|
+
}, i)),
|
|
4279
1926
|
/* @__PURE__ */ jsx7("style", {
|
|
4280
1927
|
children: `
|
|
4281
1928
|
@keyframes waveSine {
|
|
@@ -4669,6 +2316,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4669
2316
|
const [sessionIds, setSessionIds] = useState4(new Map);
|
|
4670
2317
|
const [scrollPositions, setScrollPositions] = useState4(new Map);
|
|
4671
2318
|
const [activityStates, setActivityStates] = useState4(new Map);
|
|
2319
|
+
const [localCollapsedStates, setLocalCollapsedStates] = useState4(new Map);
|
|
4672
2320
|
const customTabsKey = React3.useMemo(() => {
|
|
4673
2321
|
const customTabs = initialTabs.filter((tab) => tab.contentType !== "terminal");
|
|
4674
2322
|
return JSON.stringify(customTabs);
|
|
@@ -4683,7 +2331,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4683
2331
|
];
|
|
4684
2332
|
const prevCustomTabs = prevTabs.filter((tab) => tab.contentType !== "terminal");
|
|
4685
2333
|
const customTabsChanged = prevCustomTabs.length !== customTabsFromProp.length || !customTabsFromProp.every((tab) => {
|
|
4686
|
-
const prev = prevCustomTabs.find((
|
|
2334
|
+
const prev = prevCustomTabs.find((p) => p.id === tab.id);
|
|
4687
2335
|
if (!prev)
|
|
4688
2336
|
return false;
|
|
4689
2337
|
return JSON.stringify(tab) === JSON.stringify(prev);
|
|
@@ -4720,7 +2368,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4720
2368
|
...tab,
|
|
4721
2369
|
label: tab.contentType === "terminal" ? getOwnedTabLabel(index, tab.directory) : tab.label
|
|
4722
2370
|
}));
|
|
4723
|
-
const sortedForeignTabs = [...foreignTabs].sort((
|
|
2371
|
+
const sortedForeignTabs = [...foreignTabs].sort((a, b) => a.label.localeCompare(b.label));
|
|
4724
2372
|
return [...labeledOwnedTabs, ...sortedForeignTabs];
|
|
4725
2373
|
}, [ownedTabs, foreignTabs, getOwnedTabLabel]);
|
|
4726
2374
|
const genericTabs = React3.useMemo(() => {
|
|
@@ -4836,7 +2484,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4836
2484
|
}, [terminalContext, actions]);
|
|
4837
2485
|
const clearForeignTabs = useCallback5(() => {
|
|
4838
2486
|
setForeignTabs((prevForeign) => {
|
|
4839
|
-
const foreignTabIds = new Set(prevForeign.map((
|
|
2487
|
+
const foreignTabIds = new Set(prevForeign.map((t) => t.id));
|
|
4840
2488
|
setSessionIds((prev) => {
|
|
4841
2489
|
const updated = new Map(prev);
|
|
4842
2490
|
foreignTabIds.forEach((id) => updated.delete(id));
|
|
@@ -4938,7 +2586,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4938
2586
|
return newMap;
|
|
4939
2587
|
});
|
|
4940
2588
|
const findNextActiveTab = (allTabs) => {
|
|
4941
|
-
const remaining = allTabs.filter((
|
|
2589
|
+
const remaining = allTabs.filter((t) => t.id !== tabId);
|
|
4942
2590
|
if (activeTabId === tabId && remaining.length > 0) {
|
|
4943
2591
|
const newActive = remaining[remaining.length - 1];
|
|
4944
2592
|
return newActive.id;
|
|
@@ -4947,7 +2595,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4947
2595
|
};
|
|
4948
2596
|
if (isForeign) {
|
|
4949
2597
|
setForeignTabs((prevTabs) => {
|
|
4950
|
-
const newTabs = prevTabs.filter((
|
|
2598
|
+
const newTabs = prevTabs.filter((t) => t.id !== tabId);
|
|
4951
2599
|
const nextActiveId = findNextActiveTab([...ownedTabs, ...newTabs]);
|
|
4952
2600
|
if (nextActiveId !== activeTabId) {
|
|
4953
2601
|
setActiveTabId(nextActiveId);
|
|
@@ -4956,7 +2604,7 @@ var TabbedTerminalPanelInner = ({
|
|
|
4956
2604
|
});
|
|
4957
2605
|
} else {
|
|
4958
2606
|
setOwnedTabs((prevTabs) => {
|
|
4959
|
-
const newTabs = prevTabs.filter((
|
|
2607
|
+
const newTabs = prevTabs.filter((t) => t.id !== tabId);
|
|
4960
2608
|
const nextActiveId = findNextActiveTab([...newTabs, ...foreignTabs]);
|
|
4961
2609
|
if (nextActiveId !== activeTabId) {
|
|
4962
2610
|
setActiveTabId(nextActiveId);
|
|
@@ -5012,8 +2660,8 @@ var TabbedTerminalPanelInner = ({
|
|
|
5012
2660
|
return /* @__PURE__ */ jsxs6(Fragment2, {
|
|
5013
2661
|
children: [
|
|
5014
2662
|
/* @__PURE__ */ jsx7("button", {
|
|
5015
|
-
onClick: (
|
|
5016
|
-
|
|
2663
|
+
onClick: (e) => {
|
|
2664
|
+
e.stopPropagation();
|
|
5017
2665
|
handleToggleScrollLock();
|
|
5018
2666
|
},
|
|
5019
2667
|
style: {
|
|
@@ -5029,11 +2677,11 @@ var TabbedTerminalPanelInner = ({
|
|
|
5029
2677
|
color: scrollPosition.isScrollLocked ? theme.colors.success : theme.colors.warning,
|
|
5030
2678
|
padding: 0
|
|
5031
2679
|
},
|
|
5032
|
-
onMouseEnter: (
|
|
5033
|
-
|
|
2680
|
+
onMouseEnter: (e) => {
|
|
2681
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
5034
2682
|
},
|
|
5035
|
-
onMouseLeave: (
|
|
5036
|
-
|
|
2683
|
+
onMouseLeave: (e) => {
|
|
2684
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
5037
2685
|
},
|
|
5038
2686
|
title: scrollPosition.isScrollLocked ? "Scroll locked" : "Scroll unlocked",
|
|
5039
2687
|
children: scrollPosition.isScrollLocked ? /* @__PURE__ */ jsx7(Lock2, {
|
|
@@ -5080,7 +2728,8 @@ var TabbedTerminalPanelInner = ({
|
|
|
5080
2728
|
autoShowBlinds,
|
|
5081
2729
|
onActivityStateChange: handleActivityStateChange
|
|
5082
2730
|
}, `terminal-${tab.id}`);
|
|
5083
|
-
const
|
|
2731
|
+
const hasAssociation = !!association;
|
|
2732
|
+
const secondaryContent = hasAssociation && renderAssociatedContent ? renderAssociatedContent(association.associatedTabId, isActive) : /* @__PURE__ */ jsx7("div", {
|
|
5084
2733
|
style: {
|
|
5085
2734
|
height: "100%",
|
|
5086
2735
|
display: "flex",
|
|
@@ -5088,23 +2737,28 @@ var TabbedTerminalPanelInner = ({
|
|
|
5088
2737
|
justifyContent: "center",
|
|
5089
2738
|
color: theme.colors.textMuted,
|
|
5090
2739
|
fontSize: "13px",
|
|
5091
|
-
backgroundColor: theme.colors.backgroundSecondary
|
|
5092
|
-
borderBottom: `1px solid ${theme.colors.border}`
|
|
2740
|
+
backgroundColor: theme.colors.backgroundSecondary
|
|
5093
2741
|
},
|
|
5094
2742
|
children: "Drag a tab here to associate it with this terminal"
|
|
5095
2743
|
});
|
|
5096
|
-
const headerConfig =
|
|
5097
|
-
|
|
5098
|
-
|
|
2744
|
+
const headerConfig = hasAssociation && getAssociatedHeader ? getAssociatedHeader(association.associatedTabId) : { title: "Drop zone", icon: /* @__PURE__ */ jsx7(Paperclip, {
|
|
2745
|
+
size: 14
|
|
2746
|
+
}) };
|
|
2747
|
+
const isCollapsed = hasAssociation ? association.collapsed : localCollapsedStates.get(tab.id) ?? true;
|
|
2748
|
+
const handleCollapsedChange = hasAssociation ? (collapsed) => onAssociationCollapsedChange?.(tab.id, collapsed) : (collapsed) => {
|
|
2749
|
+
setLocalCollapsedStates((prev) => new Map(prev).set(tab.id, collapsed));
|
|
2750
|
+
};
|
|
2751
|
+
return /* @__PURE__ */ jsx7(CollapsibleSplitPane, {
|
|
5099
2752
|
style: { height: "100%" },
|
|
5100
2753
|
primaryContent: terminalContent,
|
|
5101
2754
|
secondaryContent,
|
|
5102
2755
|
collapsedHeader: headerConfig,
|
|
5103
|
-
collapsed:
|
|
5104
|
-
onCollapsedChange:
|
|
2756
|
+
collapsed: isCollapsed,
|
|
2757
|
+
onCollapsedChange: handleCollapsedChange,
|
|
5105
2758
|
ratio: hasAssociation ? association.ratio : 0.15,
|
|
5106
2759
|
onRatioChange: hasAssociation ? (ratio) => onAssociationRatioChange?.(tab.id, ratio) : undefined,
|
|
5107
|
-
theme
|
|
2760
|
+
theme,
|
|
2761
|
+
hideHeader: !hasAssociation
|
|
5108
2762
|
});
|
|
5109
2763
|
}, [
|
|
5110
2764
|
getRefCallback,
|
|
@@ -5123,50 +2777,53 @@ var TabbedTerminalPanelInner = ({
|
|
|
5123
2777
|
getAssociatedHeader,
|
|
5124
2778
|
onAssociationCollapsedChange,
|
|
5125
2779
|
onAssociationRatioChange,
|
|
5126
|
-
theme
|
|
2780
|
+
theme,
|
|
2781
|
+
localCollapsedStates
|
|
5127
2782
|
]);
|
|
5128
2783
|
const handleTabDrop = useCallback5((draggedTabId, targetTabId) => {
|
|
5129
|
-
const draggedTab = tabs.find((
|
|
5130
|
-
const targetTab = tabs.find((
|
|
2784
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2785
|
+
const targetTab = tabs.find((t) => t.id === targetTabId);
|
|
5131
2786
|
if (targetTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
5132
2787
|
onTabAssociate?.(targetTabId, draggedTabId);
|
|
2788
|
+
setActiveTabId(targetTabId);
|
|
5133
2789
|
}
|
|
5134
|
-
}, [tabs, onTabAssociate]);
|
|
2790
|
+
}, [tabs, onTabAssociate, setActiveTabId]);
|
|
5135
2791
|
const canDropOnTab = useCallback5((draggedTabId, targetTabId) => {
|
|
5136
|
-
const draggedTab = tabs.find((
|
|
5137
|
-
const targetTab = tabs.find((
|
|
2792
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2793
|
+
const targetTab = tabs.find((t) => t.id === targetTabId);
|
|
5138
2794
|
return targetTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal";
|
|
5139
2795
|
}, [tabs]);
|
|
5140
2796
|
const [isDragOverContent, setIsDragOverContent] = useState4(false);
|
|
5141
|
-
const handleContentDragEnter = useCallback5((
|
|
5142
|
-
|
|
2797
|
+
const handleContentDragEnter = useCallback5((e) => {
|
|
2798
|
+
e.preventDefault();
|
|
5143
2799
|
if (activeTabId) {
|
|
5144
|
-
const activeTab = tabs.find((
|
|
2800
|
+
const activeTab = tabs.find((t) => t.id === activeTabId);
|
|
5145
2801
|
if (activeTab?.contentType === "terminal") {
|
|
5146
2802
|
setIsDragOverContent(true);
|
|
5147
2803
|
}
|
|
5148
2804
|
}
|
|
5149
2805
|
}, [activeTabId, tabs]);
|
|
5150
|
-
const handleContentDragLeave = useCallback5((
|
|
5151
|
-
const relatedTarget =
|
|
5152
|
-
if (!
|
|
2806
|
+
const handleContentDragLeave = useCallback5((e) => {
|
|
2807
|
+
const relatedTarget = e.relatedTarget;
|
|
2808
|
+
if (!e.currentTarget.contains(relatedTarget)) {
|
|
5153
2809
|
setIsDragOverContent(false);
|
|
5154
2810
|
}
|
|
5155
2811
|
}, []);
|
|
5156
|
-
const handleContentDrop = useCallback5((
|
|
5157
|
-
|
|
5158
|
-
|
|
2812
|
+
const handleContentDrop = useCallback5((e) => {
|
|
2813
|
+
e.preventDefault();
|
|
2814
|
+
e.stopPropagation();
|
|
5159
2815
|
setIsDragOverContent(false);
|
|
5160
|
-
const draggedTabId =
|
|
2816
|
+
const draggedTabId = e.dataTransfer.getData("application/x-tab-association");
|
|
5161
2817
|
if (!draggedTabId || !activeTabId) {
|
|
5162
2818
|
return;
|
|
5163
2819
|
}
|
|
5164
|
-
const draggedTab = tabs.find((
|
|
5165
|
-
const activeTab = tabs.find((
|
|
2820
|
+
const draggedTab = tabs.find((t) => t.id === draggedTabId);
|
|
2821
|
+
const activeTab = tabs.find((t) => t.id === activeTabId);
|
|
5166
2822
|
if (activeTab?.contentType === "terminal" && draggedTab?.contentType !== "terminal") {
|
|
5167
2823
|
onTabAssociate?.(activeTabId, draggedTabId);
|
|
2824
|
+
setActiveTabId(activeTabId);
|
|
5168
2825
|
}
|
|
5169
|
-
}, [activeTabId, tabs, onTabAssociate]);
|
|
2826
|
+
}, [activeTabId, tabs, onTabAssociate, setActiveTabId]);
|
|
5170
2827
|
return /* @__PURE__ */ jsxs6("div", {
|
|
5171
2828
|
style: {
|
|
5172
2829
|
display: "flex",
|
|
@@ -5197,14 +2854,14 @@ var TabbedTerminalPanelInner = ({
|
|
|
5197
2854
|
cursor: "pointer",
|
|
5198
2855
|
color: showAllTerminals ? theme.colors.primary : theme.colors.textSecondary
|
|
5199
2856
|
},
|
|
5200
|
-
onMouseEnter: (
|
|
2857
|
+
onMouseEnter: (e) => {
|
|
5201
2858
|
if (!showAllTerminals) {
|
|
5202
|
-
|
|
2859
|
+
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
5203
2860
|
}
|
|
5204
2861
|
},
|
|
5205
|
-
onMouseLeave: (
|
|
2862
|
+
onMouseLeave: (e) => {
|
|
5206
2863
|
if (!showAllTerminals) {
|
|
5207
|
-
|
|
2864
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
5208
2865
|
}
|
|
5209
2866
|
},
|
|
5210
2867
|
title: showAllTerminals ? "Showing all terminals (click to filter by context)" : "Show all terminals",
|
|
@@ -5235,39 +2892,39 @@ var TabbedTerminalPanelInner = ({
|
|
|
5235
2892
|
outline: isDragOverContent ? `3px dashed ${theme.colors.primary}` : "none",
|
|
5236
2893
|
outlineOffset: "-3px"
|
|
5237
2894
|
},
|
|
5238
|
-
onDragEnterCapture: (
|
|
2895
|
+
onDragEnterCapture: (e) => {
|
|
5239
2896
|
if (!enableTabAssociationDrag)
|
|
5240
2897
|
return;
|
|
5241
|
-
if (!
|
|
2898
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
5242
2899
|
return;
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
handleContentDragEnter(
|
|
2900
|
+
e.preventDefault();
|
|
2901
|
+
e.stopPropagation();
|
|
2902
|
+
handleContentDragEnter(e);
|
|
5246
2903
|
},
|
|
5247
|
-
onDragOverCapture: (
|
|
2904
|
+
onDragOverCapture: (e) => {
|
|
5248
2905
|
if (!enableTabAssociationDrag)
|
|
5249
2906
|
return;
|
|
5250
|
-
if (!
|
|
2907
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
5251
2908
|
return;
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
2909
|
+
e.preventDefault();
|
|
2910
|
+
e.stopPropagation();
|
|
2911
|
+
e.dataTransfer.dropEffect = "move";
|
|
5255
2912
|
},
|
|
5256
|
-
onDragLeaveCapture: (
|
|
2913
|
+
onDragLeaveCapture: (e) => {
|
|
5257
2914
|
if (!enableTabAssociationDrag)
|
|
5258
2915
|
return;
|
|
5259
|
-
if (!
|
|
2916
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
5260
2917
|
return;
|
|
5261
|
-
handleContentDragLeave(
|
|
2918
|
+
handleContentDragLeave(e);
|
|
5262
2919
|
},
|
|
5263
|
-
onDropCapture: (
|
|
2920
|
+
onDropCapture: (e) => {
|
|
5264
2921
|
if (!enableTabAssociationDrag)
|
|
5265
2922
|
return;
|
|
5266
|
-
if (!
|
|
2923
|
+
if (!e.dataTransfer.types.includes("application/x-tab-association"))
|
|
5267
2924
|
return;
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
handleContentDrop(
|
|
2925
|
+
e.preventDefault();
|
|
2926
|
+
e.stopPropagation();
|
|
2927
|
+
handleContentDrop(e);
|
|
5271
2928
|
},
|
|
5272
2929
|
children: [
|
|
5273
2930
|
tabs.map((tab) => {
|
|
@@ -5579,7 +3236,7 @@ var panels = [
|
|
|
5579
3236
|
metadata: {
|
|
5580
3237
|
id: "com.principal.terminal",
|
|
5581
3238
|
name: "Terminal",
|
|
5582
|
-
icon: "
|
|
3239
|
+
icon: "terminal",
|
|
5583
3240
|
version: "0.1.0",
|
|
5584
3241
|
author: "Principal",
|
|
5585
3242
|
description: "Integrated terminal emulator with industry theming",
|