@arcadeai/design-system 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/arcade-49z5mR1G.js +1541 -0
- package/dist/assets/icons/arcade.d.ts +3 -0
- package/dist/assets/icons/arcade.js +33 -0
- package/dist/assets/icons/google-docs.js +110 -120
- package/dist/assets/icons/index.d.ts +1 -0
- package/dist/assets/icons/index.js +124 -122
- package/dist/assets/icons/utils.d.ts +26 -0
- package/dist/assets/icons/utils.js +155 -138
- package/dist/components/index.js +188 -172
- package/dist/components/ui/atoms/accordion.js +1 -1
- package/dist/components/ui/atoms/alert.js +2 -2
- package/dist/components/ui/atoms/avatar.js +1 -1
- package/dist/components/ui/atoms/badge.js +2 -2
- package/dist/components/ui/atoms/breadcrumb.js +13 -15
- package/dist/components/ui/atoms/button.js +2 -2
- package/dist/components/ui/atoms/byoc-badge.js +2 -2
- package/dist/components/ui/atoms/card.js +1 -1
- package/dist/components/ui/atoms/chart.js +1 -1
- package/dist/components/ui/atoms/checkbox.d.ts +4 -0
- package/dist/components/ui/atoms/checkbox.js +268 -0
- package/dist/components/ui/atoms/command.js +2 -2
- package/dist/components/ui/atoms/dialog.js +8 -8
- package/dist/components/ui/atoms/dropdown-menu.js +2 -2
- package/dist/components/ui/atoms/form.d.ts +1 -1
- package/dist/components/ui/atoms/form.js +8 -7
- package/dist/components/ui/atoms/hover-card.js +2 -2
- package/dist/components/ui/atoms/index.d.ts +1 -0
- package/dist/components/ui/atoms/index.js +168 -165
- package/dist/components/ui/atoms/input.js +1 -1
- package/dist/components/ui/atoms/label.js +1 -1
- package/dist/components/ui/atoms/popover.js +2 -2
- package/dist/components/ui/atoms/pro-badge.js +2 -2
- package/dist/components/ui/atoms/progress.js +1 -1
- package/dist/components/ui/atoms/radio-group.js +1 -1
- package/dist/components/ui/atoms/resizable.js +24 -1527
- package/dist/components/ui/atoms/scroll-area.js +1 -1
- package/dist/components/ui/atoms/select.js +2 -2
- package/dist/components/ui/atoms/separator.js +1 -1
- package/dist/components/ui/atoms/sheet.js +2 -2
- package/dist/components/ui/atoms/sidebar.js +3 -3
- package/dist/components/ui/atoms/skeleton.js +1 -1
- package/dist/components/ui/atoms/slider.js +1 -1
- package/dist/components/ui/atoms/switch.js +1 -1
- package/dist/components/ui/atoms/table.js +1 -1
- package/dist/components/ui/atoms/tabs.js +1 -1
- package/dist/components/ui/atoms/textarea.js +1 -1
- package/dist/components/ui/atoms/toggle.js +2 -2
- package/dist/components/ui/atoms/tooltip.js +60 -60
- package/dist/components/ui/atoms/view-tools-control.d.ts +12 -0
- package/dist/components/ui/atoms/view-tools-control.js +53 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +188 -172
- package/dist/components/ui/molecules/empty-state.d.ts +5 -0
- package/dist/components/ui/molecules/empty-state.js +25 -0
- package/dist/components/ui/molecules/index.d.ts +6 -0
- package/dist/components/ui/molecules/index.js +13 -0
- package/dist/components/ui/molecules/requirement-badges.d.ts +29 -0
- package/dist/components/ui/molecules/requirement-badges.js +24 -0
- package/dist/components/ui/molecules/tool-card.d.ts +17 -0
- package/dist/components/ui/molecules/tool-card.js +127 -0
- package/dist/components/ui/molecules/toolkit-card.d.ts +24 -0
- package/dist/components/ui/molecules/toolkit-card.js +13 -0
- package/dist/components/ui/molecules/toolkit-picker-trigger.d.ts +8 -0
- package/dist/components/ui/molecules/toolkit-picker-trigger.js +96 -0
- package/dist/components/ui/molecules/toolkit-selection-summary.d.ts +10 -0
- package/dist/components/ui/molecules/toolkit-selection-summary.js +117 -0
- package/dist/components/ui/organisms/index.d.ts +1 -0
- package/dist/components/ui/organisms/index.js +4 -0
- package/dist/components/ui/organisms/toolkit-picker/components/footer-summary.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/components/footer-summary.js +36 -0
- package/dist/components/ui/organisms/toolkit-picker/components/mobile-filter-badges.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/components/mobile-filter-badges.js +96 -0
- package/dist/components/ui/organisms/toolkit-picker/components/search-input.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/components/search-input.js +36 -0
- package/dist/components/ui/organisms/toolkit-picker/components/select-button.d.ts +9 -0
- package/dist/components/ui/organisms/toolkit-picker/components/select-button.js +35 -0
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.d.ts +9 -0
- package/dist/components/ui/organisms/toolkit-picker/components/toolkit-card-with-selection.js +36 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-filter.test.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-filter.test.js +44 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-search.test.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-search.test.js +46 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-selection.test.d.ts +1 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker-selection.test.js +28 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.d.ts +40 -0
- package/dist/components/ui/organisms/toolkit-picker/hooks/use-toolkit-picker.js +267 -0
- package/dist/components/ui/organisms/toolkit-picker/index.d.ts +14 -0
- package/dist/components/ui/organisms/toolkit-picker/index.js +16 -0
- package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.d.ts +7 -0
- package/dist/components/ui/organisms/toolkit-picker/mocks/toolkit-collection.js +432 -0
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.d.ts +2 -0
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.js +395 -0
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.test.d.ts +0 -0
- package/dist/components/ui/organisms/toolkit-picker/toolkit-picker.test.js +12832 -0
- package/dist/components/ui/utils/memo.d.ts +2 -0
- package/dist/components/ui/utils/memo.js +25 -0
- package/dist/{index-CQhYMnjT.js → index-BDE30rcJ.js} +1 -1
- package/dist/{index-PlrlSrPo.js → index-DEJd-dpa.js} +1 -1
- package/dist/{index-BSWzylXR.js → index-Ez2mlmzx.js} +2 -2
- package/dist/lib/arcade/arcade.d.ts +100 -0
- package/dist/lib/arcade/arcade.js +5 -0
- package/dist/lib/arcade/arcade.test.d.ts +1 -0
- package/dist/lib/arcade/arcade.test.js +299 -0
- package/dist/lib/arcade/mocks.d.ts +2 -0
- package/dist/lib/arcade/mocks.js +547 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -2
- package/dist/magic-string.es-BQ9KnLz-.js +659 -0
- package/dist/main.js +188 -172
- package/dist/react-resizable-panels.browser-ZHjTH32c.js +1509 -0
- package/dist/react.esm-369wBsAv.js +35565 -0
- package/dist/toolkit-card-GhM_oj4G.js +304 -0
- package/dist/{utils-CRiPKpXj.js → utils-Db4QWi-E.js} +204 -189
- package/dist/vi.bdSIJ99Y-CZgZQPWH.js +11996 -0
- package/package.json +39 -30
|
@@ -1,1551 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { GripVerticalIcon as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const Re = An(null);
|
|
7
|
-
Re.displayName = "PanelGroupContext";
|
|
8
|
-
const A = {
|
|
9
|
-
group: "data-panel-group",
|
|
10
|
-
groupDirection: "data-panel-group-direction",
|
|
11
|
-
groupId: "data-panel-group-id",
|
|
12
|
-
panel: "data-panel",
|
|
13
|
-
panelCollapsible: "data-panel-collapsible",
|
|
14
|
-
panelId: "data-panel-id",
|
|
15
|
-
panelSize: "data-panel-size",
|
|
16
|
-
resizeHandle: "data-resize-handle",
|
|
17
|
-
resizeHandleActive: "data-resize-handle-active",
|
|
18
|
-
resizeHandleEnabled: "data-panel-resize-handle-enabled",
|
|
19
|
-
resizeHandleId: "data-panel-resize-handle-id",
|
|
20
|
-
resizeHandleState: "data-resize-handle-state"
|
|
21
|
-
}, Fe = 10, re = Dn, Oe = Ln.useId, Hn = typeof Oe == "function" ? Oe : () => null;
|
|
22
|
-
let Nn = 0;
|
|
23
|
-
function Ve(e = null) {
|
|
24
|
-
const n = Hn(), t = F(e || n || null);
|
|
25
|
-
return t.current === null && (t.current = "" + Nn++), e ?? t.current;
|
|
26
|
-
}
|
|
27
|
-
function on({
|
|
28
|
-
children: e,
|
|
29
|
-
className: n = "",
|
|
30
|
-
collapsedSize: t,
|
|
31
|
-
collapsible: r,
|
|
32
|
-
defaultSize: i,
|
|
33
|
-
forwardedRef: o,
|
|
34
|
-
id: l,
|
|
35
|
-
maxSize: a,
|
|
36
|
-
minSize: s,
|
|
37
|
-
onCollapse: m,
|
|
38
|
-
onExpand: P,
|
|
39
|
-
onResize: f,
|
|
40
|
-
order: u,
|
|
41
|
-
style: x,
|
|
42
|
-
tagName: h = "div",
|
|
43
|
-
...I
|
|
44
|
-
}) {
|
|
45
|
-
const w = nn(Re);
|
|
46
|
-
if (w === null)
|
|
47
|
-
throw Error("Panel components must be rendered within a PanelGroup container");
|
|
48
|
-
const {
|
|
49
|
-
collapsePanel: S,
|
|
50
|
-
expandPanel: R,
|
|
51
|
-
getPanelSize: M,
|
|
52
|
-
getPanelStyle: N,
|
|
53
|
-
groupId: q,
|
|
54
|
-
isPanelCollapsed: C,
|
|
55
|
-
reevaluatePanelConstraints: b,
|
|
56
|
-
registerPanel: K,
|
|
57
|
-
resizePanel: J,
|
|
58
|
-
unregisterPanel: V
|
|
59
|
-
} = w, _ = Ve(l), D = F({
|
|
60
|
-
callbacks: {
|
|
61
|
-
onCollapse: m,
|
|
62
|
-
onExpand: P,
|
|
63
|
-
onResize: f
|
|
64
|
-
},
|
|
65
|
-
constraints: {
|
|
66
|
-
collapsedSize: t,
|
|
67
|
-
collapsible: r,
|
|
68
|
-
defaultSize: i,
|
|
69
|
-
maxSize: a,
|
|
70
|
-
minSize: s
|
|
71
|
-
},
|
|
72
|
-
id: _,
|
|
73
|
-
idIsFromProps: l !== void 0,
|
|
74
|
-
order: u
|
|
75
|
-
});
|
|
76
|
-
F({
|
|
77
|
-
didLogMissingDefaultSizeWarning: !1
|
|
78
|
-
}), re(() => {
|
|
79
|
-
const {
|
|
80
|
-
callbacks: k,
|
|
81
|
-
constraints: $
|
|
82
|
-
} = D.current, G = {
|
|
83
|
-
...$
|
|
84
|
-
};
|
|
85
|
-
D.current.id = _, D.current.idIsFromProps = l !== void 0, D.current.order = u, k.onCollapse = m, k.onExpand = P, k.onResize = f, $.collapsedSize = t, $.collapsible = r, $.defaultSize = i, $.maxSize = a, $.minSize = s, (G.collapsedSize !== $.collapsedSize || G.collapsible !== $.collapsible || G.maxSize !== $.maxSize || G.minSize !== $.minSize) && b(D.current, G);
|
|
86
|
-
}), re(() => {
|
|
87
|
-
const k = D.current;
|
|
88
|
-
return K(k), () => {
|
|
89
|
-
V(k);
|
|
90
|
-
};
|
|
91
|
-
}, [u, _, K, V]), tn(o, () => ({
|
|
92
|
-
collapse: () => {
|
|
93
|
-
S(D.current);
|
|
94
|
-
},
|
|
95
|
-
expand: (k) => {
|
|
96
|
-
R(D.current, k);
|
|
97
|
-
},
|
|
98
|
-
getId() {
|
|
99
|
-
return _;
|
|
100
|
-
},
|
|
101
|
-
getSize() {
|
|
102
|
-
return M(D.current);
|
|
103
|
-
},
|
|
104
|
-
isCollapsed() {
|
|
105
|
-
return C(D.current);
|
|
106
|
-
},
|
|
107
|
-
isExpanded() {
|
|
108
|
-
return !C(D.current);
|
|
109
|
-
},
|
|
110
|
-
resize: (k) => {
|
|
111
|
-
J(D.current, k);
|
|
112
|
-
}
|
|
113
|
-
}), [S, R, M, C, _, J]);
|
|
114
|
-
const ee = N(D.current, i);
|
|
115
|
-
return de(h, {
|
|
116
|
-
...I,
|
|
117
|
-
children: e,
|
|
118
|
-
className: n,
|
|
119
|
-
id: _,
|
|
120
|
-
style: {
|
|
121
|
-
...ee,
|
|
122
|
-
...x
|
|
123
|
-
},
|
|
124
|
-
// CSS selectors
|
|
125
|
-
[A.groupId]: q,
|
|
126
|
-
[A.panel]: "",
|
|
127
|
-
[A.panelCollapsible]: r || void 0,
|
|
128
|
-
[A.panelId]: _,
|
|
129
|
-
[A.panelSize]: parseFloat("" + ee.flexGrow).toFixed(1)
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
const ln = en((e, n) => de(on, {
|
|
133
|
-
...e,
|
|
134
|
-
forwardedRef: n
|
|
135
|
-
}));
|
|
136
|
-
on.displayName = "Panel";
|
|
137
|
-
ln.displayName = "forwardRef(Panel)";
|
|
138
|
-
let Be = null, Ie = -1, Z = null;
|
|
139
|
-
function $n(e, n, t) {
|
|
140
|
-
const r = (n & dn) !== 0, i = (n & fn) !== 0, o = (n & pn) !== 0, l = (n & gn) !== 0;
|
|
141
|
-
if (n) {
|
|
142
|
-
if (r)
|
|
143
|
-
return o ? "se-resize" : l ? "ne-resize" : "e-resize";
|
|
144
|
-
if (i)
|
|
145
|
-
return o ? "sw-resize" : l ? "nw-resize" : "w-resize";
|
|
146
|
-
if (o)
|
|
147
|
-
return "s-resize";
|
|
148
|
-
if (l)
|
|
149
|
-
return "n-resize";
|
|
150
|
-
}
|
|
151
|
-
switch (e) {
|
|
152
|
-
case "horizontal":
|
|
153
|
-
return "ew-resize";
|
|
154
|
-
case "intersection":
|
|
155
|
-
return "move";
|
|
156
|
-
case "vertical":
|
|
157
|
-
return "ns-resize";
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function kn() {
|
|
161
|
-
Z !== null && (document.head.removeChild(Z), Be = null, Z = null, Ie = -1);
|
|
162
|
-
}
|
|
163
|
-
function $e(e, n, t) {
|
|
164
|
-
var r, i;
|
|
165
|
-
const o = $n(e, n);
|
|
166
|
-
if (Be !== o) {
|
|
167
|
-
if (Be = o, Z === null && (Z = document.createElement("style"), document.head.appendChild(Z)), Ie >= 0) {
|
|
168
|
-
var l;
|
|
169
|
-
(l = Z.sheet) === null || l === void 0 || l.removeRule(Ie);
|
|
170
|
-
}
|
|
171
|
-
Ie = (r = (i = Z.sheet) === null || i === void 0 ? void 0 : i.insertRule(`*{cursor: ${o} !important;}`)) !== null && r !== void 0 ? r : -1;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
function an(e) {
|
|
175
|
-
return e.type === "keydown";
|
|
176
|
-
}
|
|
177
|
-
function sn(e) {
|
|
178
|
-
return e.type.startsWith("pointer");
|
|
179
|
-
}
|
|
180
|
-
function un(e) {
|
|
181
|
-
return e.type.startsWith("mouse");
|
|
182
|
-
}
|
|
183
|
-
function Le(e) {
|
|
184
|
-
if (sn(e)) {
|
|
185
|
-
if (e.isPrimary)
|
|
186
|
-
return {
|
|
187
|
-
x: e.clientX,
|
|
188
|
-
y: e.clientY
|
|
189
|
-
};
|
|
190
|
-
} else if (un(e))
|
|
191
|
-
return {
|
|
192
|
-
x: e.clientX,
|
|
193
|
-
y: e.clientY
|
|
194
|
-
};
|
|
195
|
-
return {
|
|
196
|
-
x: 1 / 0,
|
|
197
|
-
y: 1 / 0
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
function _n() {
|
|
201
|
-
if (typeof matchMedia == "function")
|
|
202
|
-
return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
|
|
203
|
-
}
|
|
204
|
-
function Gn(e, n, t) {
|
|
205
|
-
return e.x < n.x + n.width && e.x + e.width > n.x && e.y < n.y + n.height && e.y + e.height > n.y;
|
|
206
|
-
}
|
|
207
|
-
function Tn(e, n) {
|
|
208
|
-
if (e === n) throw new Error("Cannot compare node with itself");
|
|
209
|
-
const t = {
|
|
210
|
-
a: je(e),
|
|
211
|
-
b: je(n)
|
|
212
|
-
};
|
|
213
|
-
let r;
|
|
214
|
-
for (; t.a.at(-1) === t.b.at(-1); )
|
|
215
|
-
e = t.a.pop(), n = t.b.pop(), r = e;
|
|
216
|
-
y(r, "Stacking order can only be calculated for elements with a common ancestor");
|
|
217
|
-
const i = {
|
|
218
|
-
a: Xe(qe(t.a)),
|
|
219
|
-
b: Xe(qe(t.b))
|
|
220
|
-
};
|
|
221
|
-
if (i.a === i.b) {
|
|
222
|
-
const o = r.childNodes, l = {
|
|
223
|
-
a: t.a.at(-1),
|
|
224
|
-
b: t.b.at(-1)
|
|
225
|
-
};
|
|
226
|
-
let a = o.length;
|
|
227
|
-
for (; a--; ) {
|
|
228
|
-
const s = o[a];
|
|
229
|
-
if (s === l.a) return 1;
|
|
230
|
-
if (s === l.b) return -1;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return Math.sign(i.a - i.b);
|
|
234
|
-
}
|
|
235
|
-
const Bn = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
|
|
236
|
-
function Fn(e) {
|
|
237
|
-
var n;
|
|
238
|
-
const t = getComputedStyle((n = cn(e)) !== null && n !== void 0 ? n : e).display;
|
|
239
|
-
return t === "flex" || t === "inline-flex";
|
|
240
|
-
}
|
|
241
|
-
function Vn(e) {
|
|
242
|
-
const n = getComputedStyle(e);
|
|
243
|
-
return !!(n.position === "fixed" || n.zIndex !== "auto" && (n.position !== "static" || Fn(e)) || +n.opacity < 1 || "transform" in n && n.transform !== "none" || "webkitTransform" in n && n.webkitTransform !== "none" || "mixBlendMode" in n && n.mixBlendMode !== "normal" || "filter" in n && n.filter !== "none" || "webkitFilter" in n && n.webkitFilter !== "none" || "isolation" in n && n.isolation === "isolate" || Bn.test(n.willChange) || n.webkitOverflowScrolling === "touch");
|
|
244
|
-
}
|
|
245
|
-
function qe(e) {
|
|
246
|
-
let n = e.length;
|
|
247
|
-
for (; n--; ) {
|
|
248
|
-
const t = e[n];
|
|
249
|
-
if (y(t, "Missing node"), Vn(t)) return t;
|
|
250
|
-
}
|
|
251
|
-
return null;
|
|
252
|
-
}
|
|
253
|
-
function Xe(e) {
|
|
254
|
-
return e && Number(getComputedStyle(e).zIndex) || 0;
|
|
255
|
-
}
|
|
256
|
-
function je(e) {
|
|
257
|
-
const n = [];
|
|
258
|
-
for (; e; )
|
|
259
|
-
n.push(e), e = cn(e);
|
|
260
|
-
return n;
|
|
261
|
-
}
|
|
262
|
-
function cn(e) {
|
|
263
|
-
const {
|
|
264
|
-
parentNode: n
|
|
265
|
-
} = e;
|
|
266
|
-
return n && n instanceof ShadowRoot ? n.host : n;
|
|
267
|
-
}
|
|
268
|
-
const dn = 1, fn = 2, pn = 4, gn = 8, Wn = _n() === "coarse";
|
|
269
|
-
let O = [], ce = !1, Q = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Map();
|
|
270
|
-
const Se = /* @__PURE__ */ new Set();
|
|
271
|
-
function Kn(e, n, t, r, i) {
|
|
272
|
-
var o;
|
|
273
|
-
const {
|
|
274
|
-
ownerDocument: l
|
|
275
|
-
} = n, a = {
|
|
276
|
-
direction: t,
|
|
277
|
-
element: n,
|
|
278
|
-
hitAreaMargins: r,
|
|
279
|
-
setResizeHandlerState: i
|
|
280
|
-
}, s = (o = Q.get(l)) !== null && o !== void 0 ? o : 0;
|
|
281
|
-
return Q.set(l, s + 1), Se.add(a), Ee(), function() {
|
|
282
|
-
var P;
|
|
283
|
-
Ae.delete(e), Se.delete(a);
|
|
284
|
-
const f = (P = Q.get(l)) !== null && P !== void 0 ? P : 1;
|
|
285
|
-
if (Q.set(l, f - 1), Ee(), f === 1 && Q.delete(l), O.includes(a)) {
|
|
286
|
-
const u = O.indexOf(a);
|
|
287
|
-
u >= 0 && O.splice(u, 1), De(), i("up", !0, null);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
function Un(e) {
|
|
292
|
-
const {
|
|
293
|
-
target: n
|
|
294
|
-
} = e, {
|
|
295
|
-
x: t,
|
|
296
|
-
y: r
|
|
297
|
-
} = Le(e);
|
|
298
|
-
ce = !0, We({
|
|
299
|
-
target: n,
|
|
300
|
-
x: t,
|
|
301
|
-
y: r
|
|
302
|
-
}), Ee(), O.length > 0 && (Ce("down", e), De(), e.preventDefault(), mn(n) || e.stopImmediatePropagation());
|
|
303
|
-
}
|
|
304
|
-
function ke(e) {
|
|
305
|
-
const {
|
|
306
|
-
x: n,
|
|
307
|
-
y: t
|
|
308
|
-
} = Le(e);
|
|
309
|
-
if (ce && e.buttons === 0 && (ce = !1, Ce("up", e)), !ce) {
|
|
310
|
-
const {
|
|
311
|
-
target: r
|
|
312
|
-
} = e;
|
|
313
|
-
We({
|
|
314
|
-
target: r,
|
|
315
|
-
x: n,
|
|
316
|
-
y: t
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
Ce("move", e), De(), O.length > 0 && e.preventDefault();
|
|
320
|
-
}
|
|
321
|
-
function _e(e) {
|
|
322
|
-
const {
|
|
323
|
-
target: n
|
|
324
|
-
} = e, {
|
|
325
|
-
x: t,
|
|
326
|
-
y: r
|
|
327
|
-
} = Le(e);
|
|
328
|
-
Ae.clear(), ce = !1, O.length > 0 && (e.preventDefault(), mn(n) || e.stopImmediatePropagation()), Ce("up", e), We({
|
|
329
|
-
target: n,
|
|
330
|
-
x: t,
|
|
331
|
-
y: r
|
|
332
|
-
}), De(), Ee();
|
|
333
|
-
}
|
|
334
|
-
function mn(e) {
|
|
335
|
-
let n = e;
|
|
336
|
-
for (; n; ) {
|
|
337
|
-
if (n.hasAttribute(A.resizeHandle))
|
|
338
|
-
return !0;
|
|
339
|
-
n = n.parentElement;
|
|
340
|
-
}
|
|
341
|
-
return !1;
|
|
342
|
-
}
|
|
343
|
-
function We({
|
|
344
|
-
target: e,
|
|
345
|
-
x: n,
|
|
346
|
-
y: t
|
|
347
|
-
}) {
|
|
348
|
-
O.splice(0);
|
|
349
|
-
let r = null;
|
|
350
|
-
(e instanceof HTMLElement || e instanceof SVGElement) && (r = e), Se.forEach((i) => {
|
|
351
|
-
const {
|
|
352
|
-
element: o,
|
|
353
|
-
hitAreaMargins: l
|
|
354
|
-
} = i, a = o.getBoundingClientRect(), {
|
|
355
|
-
bottom: s,
|
|
356
|
-
left: m,
|
|
357
|
-
right: P,
|
|
358
|
-
top: f
|
|
359
|
-
} = a, u = Wn ? l.coarse : l.fine;
|
|
360
|
-
if (n >= m - u && n <= P + u && t >= f - u && t <= s + u) {
|
|
361
|
-
if (r !== null && document.contains(r) && o !== r && !o.contains(r) && !r.contains(o) && // Calculating stacking order has a cost, so we should avoid it if possible
|
|
362
|
-
// That is why we only check potentially intersecting handles,
|
|
363
|
-
// and why we skip if the event target is within the handle's DOM
|
|
364
|
-
Tn(r, o) > 0) {
|
|
365
|
-
let h = r, I = !1;
|
|
366
|
-
for (; h && !h.contains(o); ) {
|
|
367
|
-
if (Gn(h.getBoundingClientRect(), a)) {
|
|
368
|
-
I = !0;
|
|
369
|
-
break;
|
|
370
|
-
}
|
|
371
|
-
h = h.parentElement;
|
|
372
|
-
}
|
|
373
|
-
if (I)
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
O.push(i);
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
function Ge(e, n) {
|
|
381
|
-
Ae.set(e, n);
|
|
382
|
-
}
|
|
383
|
-
function De() {
|
|
384
|
-
let e = !1, n = !1;
|
|
385
|
-
O.forEach((r) => {
|
|
386
|
-
const {
|
|
387
|
-
direction: i
|
|
388
|
-
} = r;
|
|
389
|
-
i === "horizontal" ? e = !0 : n = !0;
|
|
390
|
-
});
|
|
391
|
-
let t = 0;
|
|
392
|
-
Ae.forEach((r) => {
|
|
393
|
-
t |= r;
|
|
394
|
-
}), e && n ? $e("intersection", t) : e ? $e("horizontal", t) : n ? $e("vertical", t) : kn();
|
|
395
|
-
}
|
|
396
|
-
let Te;
|
|
397
|
-
function Ee() {
|
|
398
|
-
var e;
|
|
399
|
-
(e = Te) === null || e === void 0 || e.abort(), Te = new AbortController();
|
|
400
|
-
const n = {
|
|
401
|
-
capture: !0,
|
|
402
|
-
signal: Te.signal
|
|
403
|
-
};
|
|
404
|
-
Se.size && (ce ? (O.length > 0 && Q.forEach((t, r) => {
|
|
405
|
-
const {
|
|
406
|
-
body: i
|
|
407
|
-
} = r;
|
|
408
|
-
t > 0 && (i.addEventListener("contextmenu", _e, n), i.addEventListener("pointerleave", ke, n), i.addEventListener("pointermove", ke, n));
|
|
409
|
-
}), Q.forEach((t, r) => {
|
|
410
|
-
const {
|
|
411
|
-
body: i
|
|
412
|
-
} = r;
|
|
413
|
-
i.addEventListener("pointerup", _e, n), i.addEventListener("pointercancel", _e, n);
|
|
414
|
-
})) : Q.forEach((t, r) => {
|
|
415
|
-
const {
|
|
416
|
-
body: i
|
|
417
|
-
} = r;
|
|
418
|
-
t > 0 && (i.addEventListener("pointerdown", Un, n), i.addEventListener("pointermove", ke, n));
|
|
419
|
-
}));
|
|
420
|
-
}
|
|
421
|
-
function Ce(e, n) {
|
|
422
|
-
Se.forEach((t) => {
|
|
423
|
-
const {
|
|
424
|
-
setResizeHandlerState: r
|
|
425
|
-
} = t, i = O.includes(t);
|
|
426
|
-
r(e, i, n);
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
function On() {
|
|
430
|
-
const [e, n] = ue(0);
|
|
431
|
-
return B(() => n((t) => t + 1), []);
|
|
432
|
-
}
|
|
433
|
-
function y(e, n) {
|
|
434
|
-
if (!e)
|
|
435
|
-
throw console.error(n), Error(n);
|
|
436
|
-
}
|
|
437
|
-
function oe(e, n, t = Fe) {
|
|
438
|
-
return e.toFixed(t) === n.toFixed(t) ? 0 : e > n ? 1 : -1;
|
|
439
|
-
}
|
|
440
|
-
function Y(e, n, t = Fe) {
|
|
441
|
-
return oe(e, n, t) === 0;
|
|
442
|
-
}
|
|
443
|
-
function W(e, n, t) {
|
|
444
|
-
return oe(e, n, t) === 0;
|
|
445
|
-
}
|
|
446
|
-
function qn(e, n, t) {
|
|
447
|
-
if (e.length !== n.length)
|
|
448
|
-
return !1;
|
|
449
|
-
for (let r = 0; r < e.length; r++) {
|
|
450
|
-
const i = e[r], o = n[r];
|
|
451
|
-
if (!W(i, o, t))
|
|
452
|
-
return !1;
|
|
453
|
-
}
|
|
454
|
-
return !0;
|
|
455
|
-
}
|
|
456
|
-
function se({
|
|
457
|
-
panelConstraints: e,
|
|
458
|
-
panelIndex: n,
|
|
459
|
-
size: t
|
|
460
|
-
}) {
|
|
461
|
-
const r = e[n];
|
|
462
|
-
y(r != null, `Panel constraints not found for index ${n}`);
|
|
463
|
-
let {
|
|
464
|
-
collapsedSize: i = 0,
|
|
465
|
-
collapsible: o,
|
|
466
|
-
maxSize: l = 100,
|
|
467
|
-
minSize: a = 0
|
|
468
|
-
} = r;
|
|
469
|
-
if (oe(t, a) < 0)
|
|
470
|
-
if (o) {
|
|
471
|
-
const s = (i + a) / 2;
|
|
472
|
-
oe(t, s) < 0 ? t = i : t = a;
|
|
473
|
-
} else
|
|
474
|
-
t = a;
|
|
475
|
-
return t = Math.min(l, t), t = parseFloat(t.toFixed(Fe)), t;
|
|
476
|
-
}
|
|
477
|
-
function ye({
|
|
478
|
-
delta: e,
|
|
479
|
-
initialLayout: n,
|
|
480
|
-
panelConstraints: t,
|
|
481
|
-
pivotIndices: r,
|
|
482
|
-
prevLayout: i,
|
|
483
|
-
trigger: o
|
|
484
|
-
}) {
|
|
485
|
-
if (W(e, 0))
|
|
486
|
-
return n;
|
|
487
|
-
const l = [...n], [a, s] = r;
|
|
488
|
-
y(a != null, "Invalid first pivot index"), y(s != null, "Invalid second pivot index");
|
|
489
|
-
let m = 0;
|
|
490
|
-
if (o === "keyboard") {
|
|
491
|
-
{
|
|
492
|
-
const f = e < 0 ? s : a, u = t[f];
|
|
493
|
-
y(u, `Panel constraints not found for index ${f}`);
|
|
494
|
-
const {
|
|
495
|
-
collapsedSize: x = 0,
|
|
496
|
-
collapsible: h,
|
|
497
|
-
minSize: I = 0
|
|
498
|
-
} = u;
|
|
499
|
-
if (h) {
|
|
500
|
-
const w = n[f];
|
|
501
|
-
if (y(w != null, `Previous layout not found for panel index ${f}`), W(w, x)) {
|
|
502
|
-
const S = I - w;
|
|
503
|
-
oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
{
|
|
508
|
-
const f = e < 0 ? a : s, u = t[f];
|
|
509
|
-
y(u, `No panel constraints found for index ${f}`);
|
|
510
|
-
const {
|
|
511
|
-
collapsedSize: x = 0,
|
|
512
|
-
collapsible: h,
|
|
513
|
-
minSize: I = 0
|
|
514
|
-
} = u;
|
|
515
|
-
if (h) {
|
|
516
|
-
const w = n[f];
|
|
517
|
-
if (y(w != null, `Previous layout not found for panel index ${f}`), W(w, I)) {
|
|
518
|
-
const S = w - x;
|
|
519
|
-
oe(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
{
|
|
525
|
-
const f = e < 0 ? 1 : -1;
|
|
526
|
-
let u = e < 0 ? s : a, x = 0;
|
|
527
|
-
for (; ; ) {
|
|
528
|
-
const I = n[u];
|
|
529
|
-
y(I != null, `Previous layout not found for panel index ${u}`);
|
|
530
|
-
const S = se({
|
|
531
|
-
panelConstraints: t,
|
|
532
|
-
panelIndex: u,
|
|
533
|
-
size: 100
|
|
534
|
-
}) - I;
|
|
535
|
-
if (x += S, u += f, u < 0 || u >= t.length)
|
|
536
|
-
break;
|
|
537
|
-
}
|
|
538
|
-
const h = Math.min(Math.abs(e), Math.abs(x));
|
|
539
|
-
e = e < 0 ? 0 - h : h;
|
|
540
|
-
}
|
|
541
|
-
{
|
|
542
|
-
let u = e < 0 ? a : s;
|
|
543
|
-
for (; u >= 0 && u < t.length; ) {
|
|
544
|
-
const x = Math.abs(e) - Math.abs(m), h = n[u];
|
|
545
|
-
y(h != null, `Previous layout not found for panel index ${u}`);
|
|
546
|
-
const I = h - x, w = se({
|
|
547
|
-
panelConstraints: t,
|
|
548
|
-
panelIndex: u,
|
|
549
|
-
size: I
|
|
550
|
-
});
|
|
551
|
-
if (!W(h, w) && (m += h - w, l[u] = w, m.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3), void 0, {
|
|
552
|
-
numeric: !0
|
|
553
|
-
}) >= 0))
|
|
554
|
-
break;
|
|
555
|
-
e < 0 ? u-- : u++;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
if (qn(i, l))
|
|
559
|
-
return i;
|
|
560
|
-
{
|
|
561
|
-
const f = e < 0 ? s : a, u = n[f];
|
|
562
|
-
y(u != null, `Previous layout not found for panel index ${f}`);
|
|
563
|
-
const x = u + m, h = se({
|
|
564
|
-
panelConstraints: t,
|
|
565
|
-
panelIndex: f,
|
|
566
|
-
size: x
|
|
567
|
-
});
|
|
568
|
-
if (l[f] = h, !W(h, x)) {
|
|
569
|
-
let I = x - h, S = e < 0 ? s : a;
|
|
570
|
-
for (; S >= 0 && S < t.length; ) {
|
|
571
|
-
const R = l[S];
|
|
572
|
-
y(R != null, `Previous layout not found for panel index ${S}`);
|
|
573
|
-
const M = R + I, N = se({
|
|
574
|
-
panelConstraints: t,
|
|
575
|
-
panelIndex: S,
|
|
576
|
-
size: M
|
|
577
|
-
});
|
|
578
|
-
if (W(R, N) || (I -= N - R, l[S] = N), W(I, 0))
|
|
579
|
-
break;
|
|
580
|
-
e > 0 ? S-- : S++;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
const P = l.reduce((f, u) => u + f, 0);
|
|
585
|
-
return W(P, 100) ? l : i;
|
|
586
|
-
}
|
|
587
|
-
function Xn({
|
|
588
|
-
layout: e,
|
|
589
|
-
panelsArray: n,
|
|
590
|
-
pivotIndices: t
|
|
591
|
-
}) {
|
|
592
|
-
let r = 0, i = 100, o = 0, l = 0;
|
|
593
|
-
const a = t[0];
|
|
594
|
-
y(a != null, "No pivot index found"), n.forEach((f, u) => {
|
|
595
|
-
const {
|
|
596
|
-
constraints: x
|
|
597
|
-
} = f, {
|
|
598
|
-
maxSize: h = 100,
|
|
599
|
-
minSize: I = 0
|
|
600
|
-
} = x;
|
|
601
|
-
u === a ? (r = I, i = h) : (o += I, l += h);
|
|
602
|
-
});
|
|
603
|
-
const s = Math.min(i, 100 - o), m = Math.max(r, 100 - l), P = e[a];
|
|
604
|
-
return {
|
|
605
|
-
valueMax: s,
|
|
606
|
-
valueMin: m,
|
|
607
|
-
valueNow: P
|
|
608
|
-
};
|
|
609
|
-
}
|
|
610
|
-
function be(e, n = document) {
|
|
611
|
-
return Array.from(n.querySelectorAll(`[${A.resizeHandleId}][data-panel-group-id="${e}"]`));
|
|
612
|
-
}
|
|
613
|
-
function hn(e, n, t = document) {
|
|
614
|
-
const i = be(e, t).findIndex((o) => o.getAttribute(A.resizeHandleId) === n);
|
|
615
|
-
return i ?? null;
|
|
616
|
-
}
|
|
617
|
-
function zn(e, n, t) {
|
|
618
|
-
const r = hn(e, n, t);
|
|
619
|
-
return r != null ? [r, r + 1] : [-1, -1];
|
|
620
|
-
}
|
|
621
|
-
function jn(e) {
|
|
622
|
-
return e instanceof HTMLElement ? !0 : typeof e == "object" && e !== null && "tagName" in e && "getAttribute" in e;
|
|
623
|
-
}
|
|
624
|
-
function yn(e, n = document) {
|
|
625
|
-
if (jn(n) && n.dataset.panelGroupId == e)
|
|
626
|
-
return n;
|
|
627
|
-
const t = n.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);
|
|
628
|
-
return t || null;
|
|
629
|
-
}
|
|
630
|
-
function Me(e, n = document) {
|
|
631
|
-
const t = n.querySelector(`[${A.resizeHandleId}="${e}"]`);
|
|
632
|
-
return t || null;
|
|
633
|
-
}
|
|
634
|
-
function Jn(e, n, t, r = document) {
|
|
635
|
-
var i, o, l, a;
|
|
636
|
-
const s = Me(n, r), m = be(e, r), P = s ? m.indexOf(s) : -1, f = (i = (o = t[P]) === null || o === void 0 ? void 0 : o.id) !== null && i !== void 0 ? i : null, u = (l = (a = t[P + 1]) === null || a === void 0 ? void 0 : a.id) !== null && l !== void 0 ? l : null;
|
|
637
|
-
return [f, u];
|
|
638
|
-
}
|
|
639
|
-
function Yn({
|
|
640
|
-
committedValuesRef: e,
|
|
641
|
-
eagerValuesRef: n,
|
|
642
|
-
groupId: t,
|
|
643
|
-
layout: r,
|
|
644
|
-
panelDataArray: i,
|
|
645
|
-
panelGroupElement: o,
|
|
646
|
-
setLayout: l
|
|
647
|
-
}) {
|
|
648
|
-
F({
|
|
649
|
-
didWarnAboutMissingResizeHandle: !1
|
|
650
|
-
}), re(() => {
|
|
651
|
-
if (!o)
|
|
652
|
-
return;
|
|
653
|
-
const a = be(t, o);
|
|
654
|
-
for (let s = 0; s < i.length - 1; s++) {
|
|
655
|
-
const {
|
|
656
|
-
valueMax: m,
|
|
657
|
-
valueMin: P,
|
|
658
|
-
valueNow: f
|
|
659
|
-
} = Xn({
|
|
660
|
-
layout: r,
|
|
661
|
-
panelsArray: i,
|
|
662
|
-
pivotIndices: [s, s + 1]
|
|
663
|
-
}), u = a[s];
|
|
664
|
-
if (u != null) {
|
|
665
|
-
const x = i[s];
|
|
666
|
-
y(x, `No panel data found for index "${s}"`), u.setAttribute("aria-controls", x.id), u.setAttribute("aria-valuemax", "" + Math.round(m)), u.setAttribute("aria-valuemin", "" + Math.round(P)), u.setAttribute("aria-valuenow", f != null ? "" + Math.round(f) : "");
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
return () => {
|
|
670
|
-
a.forEach((s, m) => {
|
|
671
|
-
s.removeAttribute("aria-controls"), s.removeAttribute("aria-valuemax"), s.removeAttribute("aria-valuemin"), s.removeAttribute("aria-valuenow");
|
|
672
|
-
});
|
|
673
|
-
};
|
|
674
|
-
}, [t, r, i, o]), te(() => {
|
|
675
|
-
if (!o)
|
|
676
|
-
return;
|
|
677
|
-
const a = n.current;
|
|
678
|
-
y(a, "Eager values not found");
|
|
679
|
-
const {
|
|
680
|
-
panelDataArray: s
|
|
681
|
-
} = a, m = yn(t, o);
|
|
682
|
-
y(m != null, `No group found for id "${t}"`);
|
|
683
|
-
const P = be(t, o);
|
|
684
|
-
y(P, `No resize handles found for group id "${t}"`);
|
|
685
|
-
const f = P.map((u) => {
|
|
686
|
-
const x = u.getAttribute(A.resizeHandleId);
|
|
687
|
-
y(x, "Resize handle element has no handle id attribute");
|
|
688
|
-
const [h, I] = Jn(t, x, s, o);
|
|
689
|
-
if (h == null || I == null)
|
|
690
|
-
return () => {
|
|
691
|
-
};
|
|
692
|
-
const w = (S) => {
|
|
693
|
-
if (!S.defaultPrevented)
|
|
694
|
-
switch (S.key) {
|
|
695
|
-
case "Enter": {
|
|
696
|
-
S.preventDefault();
|
|
697
|
-
const R = s.findIndex((M) => M.id === h);
|
|
698
|
-
if (R >= 0) {
|
|
699
|
-
const M = s[R];
|
|
700
|
-
y(M, `No panel data found for index ${R}`);
|
|
701
|
-
const N = r[R], {
|
|
702
|
-
collapsedSize: q = 0,
|
|
703
|
-
collapsible: C,
|
|
704
|
-
minSize: b = 0
|
|
705
|
-
} = M.constraints;
|
|
706
|
-
if (N != null && C) {
|
|
707
|
-
const K = ye({
|
|
708
|
-
delta: W(N, q) ? b - q : q - N,
|
|
709
|
-
initialLayout: r,
|
|
710
|
-
panelConstraints: s.map((J) => J.constraints),
|
|
711
|
-
pivotIndices: zn(t, x, o),
|
|
712
|
-
prevLayout: r,
|
|
713
|
-
trigger: "keyboard"
|
|
714
|
-
});
|
|
715
|
-
r !== K && l(K);
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
break;
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
};
|
|
722
|
-
return u.addEventListener("keydown", w), () => {
|
|
723
|
-
u.removeEventListener("keydown", w);
|
|
724
|
-
};
|
|
725
|
-
});
|
|
726
|
-
return () => {
|
|
727
|
-
f.forEach((u) => u());
|
|
728
|
-
};
|
|
729
|
-
}, [o, e, n, t, r, i, l]);
|
|
730
|
-
}
|
|
731
|
-
function Je(e, n) {
|
|
732
|
-
if (e.length !== n.length)
|
|
733
|
-
return !1;
|
|
734
|
-
for (let t = 0; t < e.length; t++)
|
|
735
|
-
if (e[t] !== n[t])
|
|
736
|
-
return !1;
|
|
737
|
-
return !0;
|
|
738
|
-
}
|
|
739
|
-
function xn(e, n) {
|
|
740
|
-
const t = e === "horizontal", {
|
|
741
|
-
x: r,
|
|
742
|
-
y: i
|
|
743
|
-
} = Le(n);
|
|
744
|
-
return t ? r : i;
|
|
745
|
-
}
|
|
746
|
-
function Zn(e, n, t, r, i) {
|
|
747
|
-
const o = t === "horizontal", l = Me(n, i);
|
|
748
|
-
y(l, `No resize handle element found for id "${n}"`);
|
|
749
|
-
const a = l.getAttribute(A.groupId);
|
|
750
|
-
y(a, "Resize handle element has no group id attribute");
|
|
751
|
-
let {
|
|
752
|
-
initialCursorPosition: s
|
|
753
|
-
} = r;
|
|
754
|
-
const m = xn(t, e), P = yn(a, i);
|
|
755
|
-
y(P, `No group element found for id "${a}"`);
|
|
756
|
-
const f = P.getBoundingClientRect(), u = o ? f.width : f.height;
|
|
757
|
-
return (m - s) / u * 100;
|
|
758
|
-
}
|
|
759
|
-
function Qn(e, n, t, r, i, o) {
|
|
760
|
-
if (an(e)) {
|
|
761
|
-
const l = t === "horizontal";
|
|
762
|
-
let a = 0;
|
|
763
|
-
e.shiftKey ? a = 100 : i != null ? a = i : a = 10;
|
|
764
|
-
let s = 0;
|
|
765
|
-
switch (e.key) {
|
|
766
|
-
case "ArrowDown":
|
|
767
|
-
s = l ? 0 : a;
|
|
768
|
-
break;
|
|
769
|
-
case "ArrowLeft":
|
|
770
|
-
s = l ? -a : 0;
|
|
771
|
-
break;
|
|
772
|
-
case "ArrowRight":
|
|
773
|
-
s = l ? a : 0;
|
|
774
|
-
break;
|
|
775
|
-
case "ArrowUp":
|
|
776
|
-
s = l ? 0 : -a;
|
|
777
|
-
break;
|
|
778
|
-
case "End":
|
|
779
|
-
s = 100;
|
|
780
|
-
break;
|
|
781
|
-
case "Home":
|
|
782
|
-
s = -100;
|
|
783
|
-
break;
|
|
784
|
-
}
|
|
785
|
-
return s;
|
|
786
|
-
} else
|
|
787
|
-
return r == null ? 0 : Zn(e, n, t, r, o);
|
|
788
|
-
}
|
|
789
|
-
function et({
|
|
790
|
-
panelDataArray: e
|
|
791
|
-
}) {
|
|
792
|
-
const n = Array(e.length), t = e.map((o) => o.constraints);
|
|
793
|
-
let r = 0, i = 100;
|
|
794
|
-
for (let o = 0; o < e.length; o++) {
|
|
795
|
-
const l = t[o];
|
|
796
|
-
y(l, `Panel constraints not found for index ${o}`);
|
|
797
|
-
const {
|
|
798
|
-
defaultSize: a
|
|
799
|
-
} = l;
|
|
800
|
-
a != null && (r++, n[o] = a, i -= a);
|
|
801
|
-
}
|
|
802
|
-
for (let o = 0; o < e.length; o++) {
|
|
803
|
-
const l = t[o];
|
|
804
|
-
y(l, `Panel constraints not found for index ${o}`);
|
|
805
|
-
const {
|
|
806
|
-
defaultSize: a
|
|
807
|
-
} = l;
|
|
808
|
-
if (a != null)
|
|
809
|
-
continue;
|
|
810
|
-
const s = e.length - r, m = i / s;
|
|
811
|
-
r++, n[o] = m, i -= m;
|
|
812
|
-
}
|
|
813
|
-
return n;
|
|
814
|
-
}
|
|
815
|
-
function le(e, n, t) {
|
|
816
|
-
n.forEach((r, i) => {
|
|
817
|
-
const o = e[i];
|
|
818
|
-
y(o, `Panel data not found for index ${i}`);
|
|
819
|
-
const {
|
|
820
|
-
callbacks: l,
|
|
821
|
-
constraints: a,
|
|
822
|
-
id: s
|
|
823
|
-
} = o, {
|
|
824
|
-
collapsedSize: m = 0,
|
|
825
|
-
collapsible: P
|
|
826
|
-
} = a, f = t[s];
|
|
827
|
-
if (f == null || r !== f) {
|
|
828
|
-
t[s] = r;
|
|
829
|
-
const {
|
|
830
|
-
onCollapse: u,
|
|
831
|
-
onExpand: x,
|
|
832
|
-
onResize: h
|
|
833
|
-
} = l;
|
|
834
|
-
h && h(r, f), P && (u || x) && (x && (f == null || Y(f, m)) && !Y(r, m) && x(), u && (f == null || !Y(f, m)) && Y(r, m) && u());
|
|
835
|
-
}
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
function we(e, n) {
|
|
839
|
-
if (e.length !== n.length)
|
|
840
|
-
return !1;
|
|
841
|
-
for (let t = 0; t < e.length; t++)
|
|
842
|
-
if (e[t] != n[t])
|
|
843
|
-
return !1;
|
|
844
|
-
return !0;
|
|
845
|
-
}
|
|
846
|
-
function nt({
|
|
847
|
-
defaultSize: e,
|
|
848
|
-
dragState: n,
|
|
849
|
-
layout: t,
|
|
850
|
-
panelData: r,
|
|
851
|
-
panelIndex: i,
|
|
852
|
-
precision: o = 3
|
|
853
|
-
}) {
|
|
854
|
-
const l = t[i];
|
|
855
|
-
let a;
|
|
856
|
-
return l == null ? a = e != null ? e.toPrecision(o) : "1" : r.length === 1 ? a = "1" : a = l.toPrecision(o), {
|
|
857
|
-
flexBasis: 0,
|
|
858
|
-
flexGrow: a,
|
|
859
|
-
flexShrink: 1,
|
|
860
|
-
// Without this, Panel sizes may be unintentionally overridden by their content
|
|
861
|
-
overflow: "hidden",
|
|
862
|
-
// Disable pointer events inside of a panel during resize
|
|
863
|
-
// This avoid edge cases like nested iframes
|
|
864
|
-
pointerEvents: n !== null ? "none" : void 0
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
function tt(e, n = 10) {
|
|
868
|
-
let t = null;
|
|
869
|
-
return (...i) => {
|
|
870
|
-
t !== null && clearTimeout(t), t = setTimeout(() => {
|
|
871
|
-
e(...i);
|
|
872
|
-
}, n);
|
|
873
|
-
};
|
|
874
|
-
}
|
|
875
|
-
function Ye(e) {
|
|
876
|
-
try {
|
|
877
|
-
if (typeof localStorage < "u")
|
|
878
|
-
e.getItem = (n) => localStorage.getItem(n), e.setItem = (n, t) => {
|
|
879
|
-
localStorage.setItem(n, t);
|
|
880
|
-
};
|
|
881
|
-
else
|
|
882
|
-
throw new Error("localStorage not supported in this environment");
|
|
883
|
-
} catch (n) {
|
|
884
|
-
console.error(n), e.getItem = () => null, e.setItem = () => {
|
|
885
|
-
};
|
|
886
|
-
}
|
|
887
|
-
}
|
|
888
|
-
function vn(e) {
|
|
889
|
-
return `react-resizable-panels:${e}`;
|
|
890
|
-
}
|
|
891
|
-
function Sn(e) {
|
|
892
|
-
return e.map((n) => {
|
|
893
|
-
const {
|
|
894
|
-
constraints: t,
|
|
895
|
-
id: r,
|
|
896
|
-
idIsFromProps: i,
|
|
897
|
-
order: o
|
|
898
|
-
} = n;
|
|
899
|
-
return i ? r : o ? `${o}:${JSON.stringify(t)}` : JSON.stringify(t);
|
|
900
|
-
}).sort((n, t) => n.localeCompare(t)).join(",");
|
|
901
|
-
}
|
|
902
|
-
function bn(e, n) {
|
|
903
|
-
try {
|
|
904
|
-
const t = vn(e), r = n.getItem(t);
|
|
905
|
-
if (r) {
|
|
906
|
-
const i = JSON.parse(r);
|
|
907
|
-
if (typeof i == "object" && i != null)
|
|
908
|
-
return i;
|
|
909
|
-
}
|
|
910
|
-
} catch {
|
|
911
|
-
}
|
|
912
|
-
return null;
|
|
913
|
-
}
|
|
914
|
-
function rt(e, n, t) {
|
|
915
|
-
var r, i;
|
|
916
|
-
const o = (r = bn(e, t)) !== null && r !== void 0 ? r : {}, l = Sn(n);
|
|
917
|
-
return (i = o[l]) !== null && i !== void 0 ? i : null;
|
|
918
|
-
}
|
|
919
|
-
function ot(e, n, t, r, i) {
|
|
920
|
-
var o;
|
|
921
|
-
const l = vn(e), a = Sn(n), s = (o = bn(e, i)) !== null && o !== void 0 ? o : {};
|
|
922
|
-
s[a] = {
|
|
923
|
-
expandToSizes: Object.fromEntries(t.entries()),
|
|
924
|
-
layout: r
|
|
925
|
-
};
|
|
926
|
-
try {
|
|
927
|
-
i.setItem(l, JSON.stringify(s));
|
|
928
|
-
} catch (m) {
|
|
929
|
-
console.error(m);
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
function Ze({
|
|
933
|
-
layout: e,
|
|
934
|
-
panelConstraints: n
|
|
935
|
-
}) {
|
|
936
|
-
const t = [...e], r = t.reduce((o, l) => o + l, 0);
|
|
937
|
-
if (t.length !== n.length)
|
|
938
|
-
throw Error(`Invalid ${n.length} panel layout: ${t.map((o) => `${o}%`).join(", ")}`);
|
|
939
|
-
if (!W(r, 100) && t.length > 0)
|
|
940
|
-
for (let o = 0; o < n.length; o++) {
|
|
941
|
-
const l = t[o];
|
|
942
|
-
y(l != null, `No layout data found for index ${o}`);
|
|
943
|
-
const a = 100 / r * l;
|
|
944
|
-
t[o] = a;
|
|
945
|
-
}
|
|
946
|
-
let i = 0;
|
|
947
|
-
for (let o = 0; o < n.length; o++) {
|
|
948
|
-
const l = t[o];
|
|
949
|
-
y(l != null, `No layout data found for index ${o}`);
|
|
950
|
-
const a = se({
|
|
951
|
-
panelConstraints: n,
|
|
952
|
-
panelIndex: o,
|
|
953
|
-
size: l
|
|
954
|
-
});
|
|
955
|
-
l != a && (i += l - a, t[o] = a);
|
|
956
|
-
}
|
|
957
|
-
if (!W(i, 0))
|
|
958
|
-
for (let o = 0; o < n.length; o++) {
|
|
959
|
-
const l = t[o];
|
|
960
|
-
y(l != null, `No layout data found for index ${o}`);
|
|
961
|
-
const a = l + i, s = se({
|
|
962
|
-
panelConstraints: n,
|
|
963
|
-
panelIndex: o,
|
|
964
|
-
size: a
|
|
965
|
-
});
|
|
966
|
-
if (l !== s && (i -= s - l, t[o] = s, W(i, 0)))
|
|
967
|
-
break;
|
|
968
|
-
}
|
|
969
|
-
return t;
|
|
970
|
-
}
|
|
971
|
-
const it = 100, xe = {
|
|
972
|
-
getItem: (e) => (Ye(xe), xe.getItem(e)),
|
|
973
|
-
setItem: (e, n) => {
|
|
974
|
-
Ye(xe), xe.setItem(e, n);
|
|
975
|
-
}
|
|
976
|
-
}, Qe = {};
|
|
977
|
-
function Pn({
|
|
978
|
-
autoSaveId: e = null,
|
|
979
|
-
children: n,
|
|
980
|
-
className: t = "",
|
|
981
|
-
direction: r,
|
|
982
|
-
forwardedRef: i,
|
|
983
|
-
id: o = null,
|
|
984
|
-
onLayout: l = null,
|
|
985
|
-
keyboardResizeBy: a = null,
|
|
986
|
-
storage: s = xe,
|
|
987
|
-
style: m,
|
|
988
|
-
tagName: P = "div",
|
|
989
|
-
...f
|
|
990
|
-
}) {
|
|
991
|
-
const u = Ve(o), x = F(null), [h, I] = ue(null), [w, S] = ue([]), R = On(), M = F({}), N = F(/* @__PURE__ */ new Map()), q = F(0), C = F({
|
|
992
|
-
autoSaveId: e,
|
|
993
|
-
direction: r,
|
|
994
|
-
dragState: h,
|
|
995
|
-
id: u,
|
|
996
|
-
keyboardResizeBy: a,
|
|
997
|
-
onLayout: l,
|
|
998
|
-
storage: s
|
|
999
|
-
}), b = F({
|
|
1000
|
-
layout: w,
|
|
1001
|
-
panelDataArray: [],
|
|
1002
|
-
panelDataArrayChanged: !1
|
|
1003
|
-
});
|
|
1004
|
-
F({
|
|
1005
|
-
didLogIdAndOrderWarning: !1,
|
|
1006
|
-
didLogPanelConstraintsWarning: !1,
|
|
1007
|
-
prevPanelIds: []
|
|
1008
|
-
}), tn(i, () => ({
|
|
1009
|
-
getId: () => C.current.id,
|
|
1010
|
-
getLayout: () => {
|
|
1011
|
-
const {
|
|
1012
|
-
layout: c
|
|
1013
|
-
} = b.current;
|
|
1014
|
-
return c;
|
|
1015
|
-
},
|
|
1016
|
-
setLayout: (c) => {
|
|
1017
|
-
const {
|
|
1018
|
-
onLayout: g
|
|
1019
|
-
} = C.current, {
|
|
1020
|
-
layout: v,
|
|
1021
|
-
panelDataArray: p
|
|
1022
|
-
} = b.current, d = Ze({
|
|
1023
|
-
layout: c,
|
|
1024
|
-
panelConstraints: p.map((z) => z.constraints)
|
|
1025
|
-
});
|
|
1026
|
-
Je(v, d) || (S(d), b.current.layout = d, g && g(d), le(p, d, M.current));
|
|
1027
|
-
}
|
|
1028
|
-
}), []), re(() => {
|
|
1029
|
-
C.current.autoSaveId = e, C.current.direction = r, C.current.dragState = h, C.current.id = u, C.current.onLayout = l, C.current.storage = s;
|
|
1030
|
-
}), Yn({
|
|
1031
|
-
committedValuesRef: C,
|
|
1032
|
-
eagerValuesRef: b,
|
|
1033
|
-
groupId: u,
|
|
1034
|
-
layout: w,
|
|
1035
|
-
panelDataArray: b.current.panelDataArray,
|
|
1036
|
-
setLayout: S,
|
|
1037
|
-
panelGroupElement: x.current
|
|
1038
|
-
}), te(() => {
|
|
1039
|
-
const {
|
|
1040
|
-
panelDataArray: c
|
|
1041
|
-
} = b.current;
|
|
1042
|
-
if (e) {
|
|
1043
|
-
if (w.length === 0 || w.length !== c.length)
|
|
1044
|
-
return;
|
|
1045
|
-
let g = Qe[e];
|
|
1046
|
-
g == null && (g = tt(ot, it), Qe[e] = g);
|
|
1047
|
-
const v = [...c], p = new Map(N.current);
|
|
1048
|
-
g(e, v, p, w, s);
|
|
1049
|
-
}
|
|
1050
|
-
}, [e, w, s]), te(() => {
|
|
1051
|
-
});
|
|
1052
|
-
const K = B((c) => {
|
|
1053
|
-
const {
|
|
1054
|
-
onLayout: g
|
|
1055
|
-
} = C.current, {
|
|
1056
|
-
layout: v,
|
|
1057
|
-
panelDataArray: p
|
|
1058
|
-
} = b.current;
|
|
1059
|
-
if (c.constraints.collapsible) {
|
|
1060
|
-
const d = p.map((X) => X.constraints), {
|
|
1061
|
-
collapsedSize: z = 0,
|
|
1062
|
-
panelSize: E,
|
|
1063
|
-
pivotIndices: H
|
|
1064
|
-
} = ne(p, c, v);
|
|
1065
|
-
if (y(E != null, `Panel size not found for panel "${c.id}"`), !Y(E, z)) {
|
|
1066
|
-
N.current.set(c.id, E);
|
|
1067
|
-
const j = ae(p, c) === p.length - 1 ? E - z : z - E, L = ye({
|
|
1068
|
-
delta: j,
|
|
1069
|
-
initialLayout: v,
|
|
1070
|
-
panelConstraints: d,
|
|
1071
|
-
pivotIndices: H,
|
|
1072
|
-
prevLayout: v,
|
|
1073
|
-
trigger: "imperative-api"
|
|
1074
|
-
});
|
|
1075
|
-
we(v, L) || (S(L), b.current.layout = L, g && g(L), le(p, L, M.current));
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
}, []), J = B((c, g) => {
|
|
1079
|
-
const {
|
|
1080
|
-
onLayout: v
|
|
1081
|
-
} = C.current, {
|
|
1082
|
-
layout: p,
|
|
1083
|
-
panelDataArray: d
|
|
1084
|
-
} = b.current;
|
|
1085
|
-
if (c.constraints.collapsible) {
|
|
1086
|
-
const z = d.map((U) => U.constraints), {
|
|
1087
|
-
collapsedSize: E = 0,
|
|
1088
|
-
panelSize: H = 0,
|
|
1089
|
-
minSize: X = 0,
|
|
1090
|
-
pivotIndices: j
|
|
1091
|
-
} = ne(d, c, p), L = g ?? X;
|
|
1092
|
-
if (Y(H, E)) {
|
|
1093
|
-
const U = N.current.get(c.id), he = U != null && U >= L ? U : L, Ne = ae(d, c) === d.length - 1 ? H - he : he - H, T = ye({
|
|
1094
|
-
delta: Ne,
|
|
1095
|
-
initialLayout: p,
|
|
1096
|
-
panelConstraints: z,
|
|
1097
|
-
pivotIndices: j,
|
|
1098
|
-
prevLayout: p,
|
|
1099
|
-
trigger: "imperative-api"
|
|
1100
|
-
});
|
|
1101
|
-
we(p, T) || (S(T), b.current.layout = T, v && v(T), le(d, T, M.current));
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
}, []), V = B((c) => {
|
|
1105
|
-
const {
|
|
1106
|
-
layout: g,
|
|
1107
|
-
panelDataArray: v
|
|
1108
|
-
} = b.current, {
|
|
1109
|
-
panelSize: p
|
|
1110
|
-
} = ne(v, c, g);
|
|
1111
|
-
return y(p != null, `Panel size not found for panel "${c.id}"`), p;
|
|
1112
|
-
}, []), _ = B((c, g) => {
|
|
1113
|
-
const {
|
|
1114
|
-
panelDataArray: v
|
|
1115
|
-
} = b.current, p = ae(v, c);
|
|
1116
|
-
return nt({
|
|
1117
|
-
defaultSize: g,
|
|
1118
|
-
dragState: h,
|
|
1119
|
-
layout: w,
|
|
1120
|
-
panelData: v,
|
|
1121
|
-
panelIndex: p
|
|
1122
|
-
});
|
|
1123
|
-
}, [h, w]), D = B((c) => {
|
|
1124
|
-
const {
|
|
1125
|
-
layout: g,
|
|
1126
|
-
panelDataArray: v
|
|
1127
|
-
} = b.current, {
|
|
1128
|
-
collapsedSize: p = 0,
|
|
1129
|
-
collapsible: d,
|
|
1130
|
-
panelSize: z
|
|
1131
|
-
} = ne(v, c, g);
|
|
1132
|
-
return y(z != null, `Panel size not found for panel "${c.id}"`), d === !0 && Y(z, p);
|
|
1133
|
-
}, []), ee = B((c) => {
|
|
1134
|
-
const {
|
|
1135
|
-
layout: g,
|
|
1136
|
-
panelDataArray: v
|
|
1137
|
-
} = b.current, {
|
|
1138
|
-
collapsedSize: p = 0,
|
|
1139
|
-
collapsible: d,
|
|
1140
|
-
panelSize: z
|
|
1141
|
-
} = ne(v, c, g);
|
|
1142
|
-
return y(z != null, `Panel size not found for panel "${c.id}"`), !d || oe(z, p) > 0;
|
|
1143
|
-
}, []), k = B((c) => {
|
|
1144
|
-
const {
|
|
1145
|
-
panelDataArray: g
|
|
1146
|
-
} = b.current;
|
|
1147
|
-
g.push(c), g.sort((v, p) => {
|
|
1148
|
-
const d = v.order, z = p.order;
|
|
1149
|
-
return d == null && z == null ? 0 : d == null ? -1 : z == null ? 1 : d - z;
|
|
1150
|
-
}), b.current.panelDataArrayChanged = !0, R();
|
|
1151
|
-
}, [R]);
|
|
1152
|
-
re(() => {
|
|
1153
|
-
if (b.current.panelDataArrayChanged) {
|
|
1154
|
-
b.current.panelDataArrayChanged = !1;
|
|
1155
|
-
const {
|
|
1156
|
-
autoSaveId: c,
|
|
1157
|
-
onLayout: g,
|
|
1158
|
-
storage: v
|
|
1159
|
-
} = C.current, {
|
|
1160
|
-
layout: p,
|
|
1161
|
-
panelDataArray: d
|
|
1162
|
-
} = b.current;
|
|
1163
|
-
let z = null;
|
|
1164
|
-
if (c) {
|
|
1165
|
-
const H = rt(c, d, v);
|
|
1166
|
-
H && (N.current = new Map(Object.entries(H.expandToSizes)), z = H.layout);
|
|
1167
|
-
}
|
|
1168
|
-
z == null && (z = et({
|
|
1169
|
-
panelDataArray: d
|
|
1170
|
-
}));
|
|
1171
|
-
const E = Ze({
|
|
1172
|
-
layout: z,
|
|
1173
|
-
panelConstraints: d.map((H) => H.constraints)
|
|
1174
|
-
});
|
|
1175
|
-
Je(p, E) || (S(E), b.current.layout = E, g && g(E), le(d, E, M.current));
|
|
1176
|
-
}
|
|
1177
|
-
}), re(() => {
|
|
1178
|
-
const c = b.current;
|
|
1179
|
-
return () => {
|
|
1180
|
-
c.layout = [];
|
|
1181
|
-
};
|
|
1182
|
-
}, []);
|
|
1183
|
-
const $ = B((c) => {
|
|
1184
|
-
let g = !1;
|
|
1185
|
-
const v = x.current;
|
|
1186
|
-
return v && window.getComputedStyle(v, null).getPropertyValue("direction") === "rtl" && (g = !0), function(d) {
|
|
1187
|
-
d.preventDefault();
|
|
1188
|
-
const z = x.current;
|
|
1189
|
-
if (!z)
|
|
1190
|
-
return () => null;
|
|
1191
|
-
const {
|
|
1192
|
-
direction: E,
|
|
1193
|
-
dragState: H,
|
|
1194
|
-
id: X,
|
|
1195
|
-
keyboardResizeBy: j,
|
|
1196
|
-
onLayout: L
|
|
1197
|
-
} = C.current, {
|
|
1198
|
-
layout: U,
|
|
1199
|
-
panelDataArray: he
|
|
1200
|
-
} = b.current, {
|
|
1201
|
-
initialLayout: Pe
|
|
1202
|
-
} = H ?? {}, Ne = zn(X, c, z);
|
|
1203
|
-
let T = Qn(d, c, E, H, j, z);
|
|
1204
|
-
const Ke = E === "horizontal";
|
|
1205
|
-
Ke && g && (T = -T);
|
|
1206
|
-
const En = he.map((Cn) => Cn.constraints), ze = ye({
|
|
1207
|
-
delta: T,
|
|
1208
|
-
initialLayout: Pe ?? U,
|
|
1209
|
-
panelConstraints: En,
|
|
1210
|
-
pivotIndices: Ne,
|
|
1211
|
-
prevLayout: U,
|
|
1212
|
-
trigger: an(d) ? "keyboard" : "mouse-or-touch"
|
|
1213
|
-
}), Ue = !we(U, ze);
|
|
1214
|
-
(sn(d) || un(d)) && q.current != T && (q.current = T, !Ue && T !== 0 ? Ke ? Ge(c, T < 0 ? dn : fn) : Ge(c, T < 0 ? pn : gn) : Ge(c, 0)), Ue && (S(ze), b.current.layout = ze, L && L(ze), le(he, ze, M.current));
|
|
1215
|
-
};
|
|
1216
|
-
}, []), G = B((c, g) => {
|
|
1217
|
-
const {
|
|
1218
|
-
onLayout: v
|
|
1219
|
-
} = C.current, {
|
|
1220
|
-
layout: p,
|
|
1221
|
-
panelDataArray: d
|
|
1222
|
-
} = b.current, z = d.map((U) => U.constraints), {
|
|
1223
|
-
panelSize: E,
|
|
1224
|
-
pivotIndices: H
|
|
1225
|
-
} = ne(d, c, p);
|
|
1226
|
-
y(E != null, `Panel size not found for panel "${c.id}"`);
|
|
1227
|
-
const j = ae(d, c) === d.length - 1 ? E - g : g - E, L = ye({
|
|
1228
|
-
delta: j,
|
|
1229
|
-
initialLayout: p,
|
|
1230
|
-
panelConstraints: z,
|
|
1231
|
-
pivotIndices: H,
|
|
1232
|
-
prevLayout: p,
|
|
1233
|
-
trigger: "imperative-api"
|
|
1234
|
-
});
|
|
1235
|
-
we(p, L) || (S(L), b.current.layout = L, v && v(L), le(d, L, M.current));
|
|
1236
|
-
}, []), fe = B((c, g) => {
|
|
1237
|
-
const {
|
|
1238
|
-
layout: v,
|
|
1239
|
-
panelDataArray: p
|
|
1240
|
-
} = b.current, {
|
|
1241
|
-
collapsedSize: d = 0,
|
|
1242
|
-
collapsible: z
|
|
1243
|
-
} = g, {
|
|
1244
|
-
collapsedSize: E = 0,
|
|
1245
|
-
collapsible: H,
|
|
1246
|
-
maxSize: X = 100,
|
|
1247
|
-
minSize: j = 0
|
|
1248
|
-
} = c.constraints, {
|
|
1249
|
-
panelSize: L
|
|
1250
|
-
} = ne(p, c, v);
|
|
1251
|
-
L != null && (z && H && Y(L, d) ? Y(d, E) || G(c, E) : L < j ? G(c, j) : L > X && G(c, X));
|
|
1252
|
-
}, [G]), pe = B((c, g) => {
|
|
1253
|
-
const {
|
|
1254
|
-
direction: v
|
|
1255
|
-
} = C.current, {
|
|
1256
|
-
layout: p
|
|
1257
|
-
} = b.current;
|
|
1258
|
-
if (!x.current)
|
|
1259
|
-
return;
|
|
1260
|
-
const d = Me(c, x.current);
|
|
1261
|
-
y(d, `Drag handle element not found for id "${c}"`);
|
|
1262
|
-
const z = xn(v, g);
|
|
1263
|
-
I({
|
|
1264
|
-
dragHandleId: c,
|
|
1265
|
-
dragHandleRect: d.getBoundingClientRect(),
|
|
1266
|
-
initialCursorPosition: z,
|
|
1267
|
-
initialLayout: p
|
|
1268
|
-
});
|
|
1269
|
-
}, []), ge = B(() => {
|
|
1270
|
-
I(null);
|
|
1271
|
-
}, []), He = B((c) => {
|
|
1272
|
-
const {
|
|
1273
|
-
panelDataArray: g
|
|
1274
|
-
} = b.current, v = ae(g, c);
|
|
1275
|
-
v >= 0 && (g.splice(v, 1), delete M.current[c.id], b.current.panelDataArrayChanged = !0, R());
|
|
1276
|
-
}, [R]), ie = Mn(() => ({
|
|
1277
|
-
collapsePanel: K,
|
|
1278
|
-
direction: r,
|
|
1279
|
-
dragState: h,
|
|
1280
|
-
expandPanel: J,
|
|
1281
|
-
getPanelSize: V,
|
|
1282
|
-
getPanelStyle: _,
|
|
1283
|
-
groupId: u,
|
|
1284
|
-
isPanelCollapsed: D,
|
|
1285
|
-
isPanelExpanded: ee,
|
|
1286
|
-
reevaluatePanelConstraints: fe,
|
|
1287
|
-
registerPanel: k,
|
|
1288
|
-
registerResizeHandle: $,
|
|
1289
|
-
resizePanel: G,
|
|
1290
|
-
startDragging: pe,
|
|
1291
|
-
stopDragging: ge,
|
|
1292
|
-
unregisterPanel: He,
|
|
1293
|
-
panelGroupElement: x.current
|
|
1294
|
-
}), [K, h, r, J, V, _, u, D, ee, fe, k, $, G, pe, ge, He]), me = {
|
|
1295
|
-
display: "flex",
|
|
1296
|
-
flexDirection: r === "horizontal" ? "row" : "column",
|
|
1297
|
-
height: "100%",
|
|
1298
|
-
overflow: "hidden",
|
|
1299
|
-
width: "100%"
|
|
1300
|
-
};
|
|
1301
|
-
return de(Re.Provider, {
|
|
1302
|
-
value: ie
|
|
1303
|
-
}, de(P, {
|
|
1304
|
-
...f,
|
|
1305
|
-
children: n,
|
|
1306
|
-
className: t,
|
|
1307
|
-
id: o,
|
|
1308
|
-
ref: x,
|
|
1309
|
-
style: {
|
|
1310
|
-
...me,
|
|
1311
|
-
...m
|
|
1312
|
-
},
|
|
1313
|
-
// CSS selectors
|
|
1314
|
-
[A.group]: "",
|
|
1315
|
-
[A.groupDirection]: r,
|
|
1316
|
-
[A.groupId]: u
|
|
1317
|
-
}));
|
|
1318
|
-
}
|
|
1319
|
-
const wn = en((e, n) => de(Pn, {
|
|
1320
|
-
...e,
|
|
1321
|
-
forwardedRef: n
|
|
1322
|
-
}));
|
|
1323
|
-
Pn.displayName = "PanelGroup";
|
|
1324
|
-
wn.displayName = "forwardRef(PanelGroup)";
|
|
1325
|
-
function ae(e, n) {
|
|
1326
|
-
return e.findIndex((t) => t === n || t.id === n.id);
|
|
1327
|
-
}
|
|
1328
|
-
function ne(e, n, t) {
|
|
1329
|
-
const r = ae(e, n), o = r === e.length - 1 ? [r - 1, r] : [r, r + 1], l = t[r];
|
|
1330
|
-
return {
|
|
1331
|
-
...n.constraints,
|
|
1332
|
-
panelSize: l,
|
|
1333
|
-
pivotIndices: o
|
|
1334
|
-
};
|
|
1335
|
-
}
|
|
1336
|
-
function lt({
|
|
1337
|
-
disabled: e,
|
|
1338
|
-
handleId: n,
|
|
1339
|
-
resizeHandler: t,
|
|
1340
|
-
panelGroupElement: r
|
|
1341
|
-
}) {
|
|
1342
|
-
te(() => {
|
|
1343
|
-
if (e || t == null || r == null)
|
|
1344
|
-
return;
|
|
1345
|
-
const i = Me(n, r);
|
|
1346
|
-
if (i == null)
|
|
1347
|
-
return;
|
|
1348
|
-
const o = (l) => {
|
|
1349
|
-
if (!l.defaultPrevented)
|
|
1350
|
-
switch (l.key) {
|
|
1351
|
-
case "ArrowDown":
|
|
1352
|
-
case "ArrowLeft":
|
|
1353
|
-
case "ArrowRight":
|
|
1354
|
-
case "ArrowUp":
|
|
1355
|
-
case "End":
|
|
1356
|
-
case "Home": {
|
|
1357
|
-
l.preventDefault(), t(l);
|
|
1358
|
-
break;
|
|
1359
|
-
}
|
|
1360
|
-
case "F6": {
|
|
1361
|
-
l.preventDefault();
|
|
1362
|
-
const a = i.getAttribute(A.groupId);
|
|
1363
|
-
y(a, `No group element found for id "${a}"`);
|
|
1364
|
-
const s = be(a, r), m = hn(a, n, r);
|
|
1365
|
-
y(m !== null, `No resize element found for id "${n}"`);
|
|
1366
|
-
const P = l.shiftKey ? m > 0 ? m - 1 : s.length - 1 : m + 1 < s.length ? m + 1 : 0;
|
|
1367
|
-
s[P].focus();
|
|
1368
|
-
break;
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
};
|
|
1372
|
-
return i.addEventListener("keydown", o), () => {
|
|
1373
|
-
i.removeEventListener("keydown", o);
|
|
1374
|
-
};
|
|
1375
|
-
}, [r, e, n, t]);
|
|
1376
|
-
}
|
|
1377
|
-
function In({
|
|
1378
|
-
children: e = null,
|
|
1379
|
-
className: n = "",
|
|
1380
|
-
disabled: t = !1,
|
|
1381
|
-
hitAreaMargins: r,
|
|
1382
|
-
id: i,
|
|
1383
|
-
onBlur: o,
|
|
1384
|
-
onClick: l,
|
|
1385
|
-
onDragging: a,
|
|
1386
|
-
onFocus: s,
|
|
1387
|
-
onPointerDown: m,
|
|
1388
|
-
onPointerUp: P,
|
|
1389
|
-
style: f = {},
|
|
1390
|
-
tabIndex: u = 0,
|
|
1391
|
-
tagName: x = "div",
|
|
1392
|
-
...h
|
|
1393
|
-
}) {
|
|
1394
|
-
var I, w;
|
|
1395
|
-
const S = F(null), R = F({
|
|
1396
|
-
onClick: l,
|
|
1397
|
-
onDragging: a,
|
|
1398
|
-
onPointerDown: m,
|
|
1399
|
-
onPointerUp: P
|
|
1400
|
-
});
|
|
1401
|
-
te(() => {
|
|
1402
|
-
R.current.onClick = l, R.current.onDragging = a, R.current.onPointerDown = m, R.current.onPointerUp = P;
|
|
1403
|
-
});
|
|
1404
|
-
const M = nn(Re);
|
|
1405
|
-
if (M === null)
|
|
1406
|
-
throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
|
|
1407
|
-
const {
|
|
1408
|
-
direction: N,
|
|
1409
|
-
groupId: q,
|
|
1410
|
-
registerResizeHandle: C,
|
|
1411
|
-
startDragging: b,
|
|
1412
|
-
stopDragging: K,
|
|
1413
|
-
panelGroupElement: J
|
|
1414
|
-
} = M, V = Ve(i), [_, D] = ue("inactive"), [ee, k] = ue(!1), [$, G] = ue(null), fe = F({
|
|
1415
|
-
state: _
|
|
1416
|
-
});
|
|
1417
|
-
re(() => {
|
|
1418
|
-
fe.current.state = _;
|
|
1419
|
-
}), te(() => {
|
|
1420
|
-
if (t)
|
|
1421
|
-
G(null);
|
|
1422
|
-
else {
|
|
1423
|
-
const ie = C(V);
|
|
1424
|
-
G(() => ie);
|
|
1425
|
-
}
|
|
1426
|
-
}, [t, V, C]);
|
|
1427
|
-
const pe = (I = r?.coarse) !== null && I !== void 0 ? I : 15, ge = (w = r?.fine) !== null && w !== void 0 ? w : 5;
|
|
1428
|
-
return te(() => {
|
|
1429
|
-
if (t || $ == null)
|
|
1430
|
-
return;
|
|
1431
|
-
const ie = S.current;
|
|
1432
|
-
y(ie, "Element ref not attached");
|
|
1433
|
-
let me = !1;
|
|
1434
|
-
return Kn(V, ie, N, {
|
|
1435
|
-
coarse: pe,
|
|
1436
|
-
fine: ge
|
|
1437
|
-
}, (g, v, p) => {
|
|
1438
|
-
if (!v) {
|
|
1439
|
-
D("inactive");
|
|
1440
|
-
return;
|
|
1441
|
-
}
|
|
1442
|
-
switch (g) {
|
|
1443
|
-
case "down": {
|
|
1444
|
-
D("drag"), me = !1, y(p, 'Expected event to be defined for "down" action'), b(V, p);
|
|
1445
|
-
const {
|
|
1446
|
-
onDragging: d,
|
|
1447
|
-
onPointerDown: z
|
|
1448
|
-
} = R.current;
|
|
1449
|
-
d?.(!0), z?.();
|
|
1450
|
-
break;
|
|
1451
|
-
}
|
|
1452
|
-
case "move": {
|
|
1453
|
-
const {
|
|
1454
|
-
state: d
|
|
1455
|
-
} = fe.current;
|
|
1456
|
-
me = !0, d !== "drag" && D("hover"), y(p, 'Expected event to be defined for "move" action'), $(p);
|
|
1457
|
-
break;
|
|
1458
|
-
}
|
|
1459
|
-
case "up": {
|
|
1460
|
-
D("hover"), K();
|
|
1461
|
-
const {
|
|
1462
|
-
onClick: d,
|
|
1463
|
-
onDragging: z,
|
|
1464
|
-
onPointerUp: E
|
|
1465
|
-
} = R.current;
|
|
1466
|
-
z?.(!1), E?.(), me || d?.();
|
|
1467
|
-
break;
|
|
1468
|
-
}
|
|
1469
|
-
}
|
|
1470
|
-
});
|
|
1471
|
-
}, [pe, N, t, ge, C, V, $, b, K]), lt({
|
|
1472
|
-
disabled: t,
|
|
1473
|
-
handleId: V,
|
|
1474
|
-
resizeHandler: $,
|
|
1475
|
-
panelGroupElement: J
|
|
1476
|
-
}), de(x, {
|
|
1477
|
-
...h,
|
|
1478
|
-
children: e,
|
|
1479
|
-
className: n,
|
|
1480
|
-
id: i,
|
|
1481
|
-
onBlur: () => {
|
|
1482
|
-
k(!1), o?.();
|
|
1483
|
-
},
|
|
1484
|
-
onFocus: () => {
|
|
1485
|
-
k(!0), s?.();
|
|
1486
|
-
},
|
|
1487
|
-
ref: S,
|
|
1488
|
-
role: "separator",
|
|
1489
|
-
style: {
|
|
1490
|
-
...{
|
|
1491
|
-
touchAction: "none",
|
|
1492
|
-
userSelect: "none"
|
|
1493
|
-
},
|
|
1494
|
-
...f
|
|
1495
|
-
},
|
|
1496
|
-
tabIndex: u,
|
|
1497
|
-
// CSS selectors
|
|
1498
|
-
[A.groupDirection]: N,
|
|
1499
|
-
[A.groupId]: q,
|
|
1500
|
-
[A.resizeHandle]: "",
|
|
1501
|
-
[A.resizeHandleActive]: _ === "drag" ? "pointer" : ee ? "keyboard" : void 0,
|
|
1502
|
-
[A.resizeHandleEnabled]: !t,
|
|
1503
|
-
[A.resizeHandleId]: V,
|
|
1504
|
-
[A.resizeHandleState]: _
|
|
1505
|
-
});
|
|
1506
|
-
}
|
|
1507
|
-
In.displayName = "PanelResizeHandle";
|
|
1508
|
-
function dt({
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { GripVerticalIcon as i } from "lucide-react";
|
|
3
|
+
import { P as n, a as o, b as s } from "../../../react-resizable-panels.browser-ZHjTH32c.js";
|
|
4
|
+
import { c as t } from "../../../utils-Db4QWi-E.js";
|
|
5
|
+
function u({
|
|
1509
6
|
className: e,
|
|
1510
|
-
...
|
|
7
|
+
...r
|
|
1511
8
|
}) {
|
|
1512
|
-
return /* @__PURE__ */
|
|
1513
|
-
|
|
9
|
+
return /* @__PURE__ */ a(
|
|
10
|
+
n,
|
|
1514
11
|
{
|
|
1515
|
-
className:
|
|
12
|
+
className: t(
|
|
1516
13
|
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
1517
14
|
e
|
|
1518
15
|
),
|
|
1519
16
|
"data-slot": "resizable-panel-group",
|
|
1520
|
-
...
|
|
17
|
+
...r
|
|
1521
18
|
}
|
|
1522
19
|
);
|
|
1523
20
|
}
|
|
1524
|
-
function
|
|
21
|
+
function b({
|
|
1525
22
|
...e
|
|
1526
23
|
}) {
|
|
1527
|
-
return /* @__PURE__ */
|
|
24
|
+
return /* @__PURE__ */ a(o, { "data-slot": "resizable-panel", ...e });
|
|
1528
25
|
}
|
|
1529
|
-
function
|
|
26
|
+
function g({
|
|
1530
27
|
withHandle: e,
|
|
1531
|
-
className:
|
|
1532
|
-
...
|
|
28
|
+
className: r,
|
|
29
|
+
...l
|
|
1533
30
|
}) {
|
|
1534
|
-
return /* @__PURE__ */
|
|
1535
|
-
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
32
|
+
s,
|
|
1536
33
|
{
|
|
1537
|
-
className:
|
|
34
|
+
className: t(
|
|
1538
35
|
"after:-translate-x-1/2 data-[panel-group-direction=vertical]:after:-translate-y-1/2 relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
1539
|
-
|
|
36
|
+
r
|
|
1540
37
|
),
|
|
1541
38
|
"data-slot": "resizable-handle",
|
|
1542
|
-
...
|
|
1543
|
-
children: e && /* @__PURE__ */
|
|
39
|
+
...l,
|
|
40
|
+
children: e && /* @__PURE__ */ a("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border", children: /* @__PURE__ */ a(i, { className: "size-2.5" }) })
|
|
1544
41
|
}
|
|
1545
42
|
);
|
|
1546
43
|
}
|
|
1547
44
|
export {
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
45
|
+
g as ResizableHandle,
|
|
46
|
+
b as ResizablePanel,
|
|
47
|
+
u as ResizablePanelGroup
|
|
1551
48
|
};
|