@pstdio/ui 0.40.0 → 0.42.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/dist/{MermaidComponent-81jr28u4.js → MermaidComponent-D7vhkpka.js} +3 -3
- package/dist/{MermaidComponent-81jr28u4.js.map → MermaidComponent-D7vhkpka.js.map} +1 -1
- package/dist/alert-MQ47wy7f.js +388 -0
- package/dist/alert-MQ47wy7f.js.map +1 -0
- package/dist/chat-ui.d.ts +129 -23
- package/dist/chat-ui.js +2596 -1591
- package/dist/chat-ui.js.map +1 -1
- package/dist/{types-DWA3enV6.d.ts → collection-view-fields-D3cysHNT.d.ts} +87 -37
- package/dist/collection-view-grouping-D4nZk8-3.js +90 -0
- package/dist/collection-view-grouping-D4nZk8-3.js.map +1 -0
- package/dist/collection-view-search-CpjJy76w.js +1973 -0
- package/dist/collection-view-search-CpjJy76w.js.map +1 -0
- package/dist/collection-view.d.ts +4 -0
- package/dist/collection-view.js +2 -0
- package/dist/{data-table-stats-row-CpRe_xK2.js → data-table-stats-row-64magT2g.js} +2 -2
- package/dist/{data-table-stats-row-CpRe_xK2.js.map → data-table-stats-row-64magT2g.js.map} +1 -1
- package/dist/data-table.d.ts +29 -7
- package/dist/data-table.js +1043 -878
- package/dist/data-table.js.map +1 -1
- package/dist/diff-bubble-DewUd_2w.js +61 -0
- package/dist/diff-bubble-DewUd_2w.js.map +1 -0
- package/dist/{diff-drawer-45rpk3aq.js → diff-drawer-IYpQ-QQK.js} +264 -242
- package/dist/diff-drawer-IYpQ-QQK.js.map +1 -0
- package/dist/diff-viewer-C-0VAt9P.js +574 -0
- package/dist/diff-viewer-C-0VAt9P.js.map +1 -0
- package/dist/diff.d.ts +11 -0
- package/dist/diff.js +107 -98
- package/dist/diff.js.map +1 -1
- package/dist/display-sort-control-f3rbILsV.js +588 -0
- package/dist/display-sort-control-f3rbILsV.js.map +1 -0
- package/dist/drop-indicator-HjlBSIeV.js +27 -0
- package/dist/drop-indicator-HjlBSIeV.js.map +1 -0
- package/dist/edit-mode-data-table-DnMB2jiy.js +1449 -0
- package/dist/edit-mode-data-table-DnMB2jiy.js.map +1 -0
- package/dist/host-storage-BIo5azql.js +31 -0
- package/dist/host-storage-BIo5azql.js.map +1 -0
- package/dist/host-storage-J0089Hyk.d.ts +17 -0
- package/dist/{slider-hwHYe98I.js → icon-options-Tt6Wzhtv.js} +86 -201
- package/dist/icon-options-Tt6Wzhtv.js.map +1 -0
- package/dist/{index-Bfddrlz8.d.ts → index-B79hwNcB.d.ts} +66 -14
- package/dist/index-CKsd23jv.d.ts +80 -0
- package/dist/{index-CbtbcvKm.d.ts → index-DlmvvQ6x.d.ts} +1 -1
- package/dist/index-ICoad2I_.d.ts +282 -0
- package/dist/index.d.ts +63 -22
- package/dist/index.js +1149 -1054
- package/dist/index.js.map +1 -1
- package/dist/kanban-renderer.d.ts +3 -326
- package/dist/kanban-renderer.js +980 -596
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/list-row-Z4SHkseA.js +1195 -0
- package/dist/list-row-Z4SHkseA.js.map +1 -0
- package/dist/markdown-editor-Dd4mor7l.js +3236 -0
- package/dist/markdown-editor-Dd4mor7l.js.map +1 -0
- package/dist/{mermaid-renderer-DImi0fDp.js → mermaid-renderer-0PmNkOXI.js} +29 -29
- package/dist/mermaid-renderer-0PmNkOXI.js.map +1 -0
- package/dist/mermaid.js +1 -1
- package/dist/number-input-7K66wnSC.js +63 -0
- package/dist/number-input-7K66wnSC.js.map +1 -0
- package/dist/{param-editor-BQd4AOUP.js → param-editor-Dnix-fJo.js} +2 -2
- package/dist/{param-editor-BQd4AOUP.js.map → param-editor-Dnix-fJo.js.map} +1 -1
- package/dist/{param-editor-field-BJ_rLUnV.js → param-editor-field-B3vLST-B.js} +1436 -1427
- package/dist/param-editor-field-B3vLST-B.js.map +1 -0
- package/dist/param-editor.js +4 -3
- package/dist/prism-OG4H7Hu4.js +334 -0
- package/dist/prism-OG4H7Hu4.js.map +1 -0
- package/dist/queued-follow-up-Bj_vtMgd.js +208 -0
- package/dist/queued-follow-up-Bj_vtMgd.js.map +1 -0
- package/dist/{resource-badge-95WPVlZf.d.ts → resource-badge-nOWPqxFU.d.ts} +1 -0
- package/dist/rich-text-BgEnAHr2.js +1160 -0
- package/dist/rich-text-BgEnAHr2.js.map +1 -0
- package/dist/rich-text.d.ts +2 -2
- package/dist/rich-text.js +4 -2
- package/dist/style.css +1 -1
- package/dist/terminal.d.ts +5 -63
- package/dist/terminal.js +102 -122
- package/dist/terminal.js.map +1 -1
- package/dist/{theme-CbmSEbRF.js → theme-CMJdH59Z.js} +589 -265
- package/dist/theme-CMJdH59Z.js.map +1 -0
- package/dist/theme-kKuLN2jb.js +80 -0
- package/dist/theme-kKuLN2jb.js.map +1 -0
- package/dist/theme-preference-BV4cbJNB.js +115 -0
- package/dist/theme-preference-BV4cbJNB.js.map +1 -0
- package/dist/theme.js +3 -2
- package/dist/tree-list-jarhD31R.js +1652 -0
- package/dist/tree-list-jarhD31R.js.map +1 -0
- package/dist/use-virtualizer-uj43XjBp.js +10 -0
- package/dist/use-virtualizer-uj43XjBp.js.map +1 -0
- package/dist/{workspace-badge-Brm3Xr3m.d.ts → workspace-badge-BKtB805G.d.ts} +5 -1
- package/package.json +8 -4
- package/dist/diff-bubble-DZsarmSG.js +0 -61
- package/dist/diff-bubble-DZsarmSG.js.map +0 -1
- package/dist/diff-drawer-45rpk3aq.js.map +0 -1
- package/dist/diff-viewer-BP_mI6Wx.js +0 -558
- package/dist/diff-viewer-BP_mI6Wx.js.map +0 -1
- package/dist/list-row-uqD-q4gv.js +0 -1018
- package/dist/list-row-uqD-q4gv.js.map +0 -1
- package/dist/mermaid-renderer-DImi0fDp.js.map +0 -1
- package/dist/param-editor-field-BJ_rLUnV.js.map +0 -1
- package/dist/prism-BStPsJSB.js +0 -658
- package/dist/prism-BStPsJSB.js.map +0 -1
- package/dist/rich-text-VYAmEigU.js +0 -6979
- package/dist/rich-text-VYAmEigU.js.map +0 -1
- package/dist/slider-hwHYe98I.js.map +0 -1
- package/dist/theme-CbmSEbRF.js.map +0 -1
- package/dist/theme-preference-pzfuK5cH.js +0 -101
- package/dist/theme-preference-pzfuK5cH.js.map +0 -1
- package/dist/tree-list-BNZwjQZA.js +0 -1616
- package/dist/tree-list-BNZwjQZA.js.map +0 -1
|
@@ -1,1616 +0,0 @@
|
|
|
1
|
-
import { c as e, n as t, t as n } from "./list-row-uqD-q4gv.js";
|
|
2
|
-
import { Box as r, Flex as i, HStack as a, IconButton as o, Input as s, Menu as c, Stack as l, Text as u, useSlotRecipe as d } from "@chakra-ui/react";
|
|
3
|
-
import { c as f } from "react/compiler-runtime";
|
|
4
|
-
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
5
|
-
import { Fragment as g, createContext as _, useContext as v, useEffect as y, useId as b, useRef as x, useState as S } from "react";
|
|
6
|
-
import { ChevronRight as C } from "lucide-react";
|
|
7
|
-
import { useVirtualizer as w } from "@tanstack/react-virtual";
|
|
8
|
-
import { DndContext as T, MeasuringStrategy as E, PointerSensor as D, closestCenter as O, pointerWithin as k, useDndContext as A, useDndMonitor as j, useDroppable as M, useSensor as N, useSensors as P } from "@dnd-kit/core";
|
|
9
|
-
import { SortableContext as F, useSortable as I, verticalListSortingStrategy as L } from "@dnd-kit/sortable";
|
|
10
|
-
//#region src/components/layout/resizable-split-layout.geometry.ts
|
|
11
|
-
var R = 72, z = 160, B = 72, V = (e, t, n) => Math.min(Math.max(e, t), n), H = {
|
|
12
|
-
left: {
|
|
13
|
-
rootDirection: "row",
|
|
14
|
-
dimension: "width",
|
|
15
|
-
separatorOrientation: "vertical",
|
|
16
|
-
cursor: "col-resize",
|
|
17
|
-
pointerCoordinate: "clientX",
|
|
18
|
-
deltaDirection: 1,
|
|
19
|
-
panelFirst: !0
|
|
20
|
-
},
|
|
21
|
-
right: {
|
|
22
|
-
rootDirection: "row",
|
|
23
|
-
dimension: "width",
|
|
24
|
-
separatorOrientation: "vertical",
|
|
25
|
-
cursor: "col-resize",
|
|
26
|
-
pointerCoordinate: "clientX",
|
|
27
|
-
deltaDirection: -1,
|
|
28
|
-
panelFirst: !1
|
|
29
|
-
},
|
|
30
|
-
top: {
|
|
31
|
-
rootDirection: "column",
|
|
32
|
-
dimension: "height",
|
|
33
|
-
separatorOrientation: "horizontal",
|
|
34
|
-
cursor: "row-resize",
|
|
35
|
-
pointerCoordinate: "clientY",
|
|
36
|
-
deltaDirection: 1,
|
|
37
|
-
panelFirst: !0
|
|
38
|
-
},
|
|
39
|
-
bottom: {
|
|
40
|
-
rootDirection: "column",
|
|
41
|
-
dimension: "height",
|
|
42
|
-
separatorOrientation: "horizontal",
|
|
43
|
-
cursor: "row-resize",
|
|
44
|
-
pointerCoordinate: "clientY",
|
|
45
|
-
deltaDirection: -1,
|
|
46
|
-
panelFirst: !1
|
|
47
|
-
}
|
|
48
|
-
}, U = (e) => H[e], W = (e) => {
|
|
49
|
-
let t = e.rootSize > 0 ? e.rootSize : e.fallbackRootSize, n = Math.max(0, t - e.separatorSize - e.contentMinSize), r = e.maxSize ?? n, i = Math.max(0, Math.min(r, n));
|
|
50
|
-
return {
|
|
51
|
-
minSize: Math.min(e.minSize, i),
|
|
52
|
-
maxSize: i
|
|
53
|
-
};
|
|
54
|
-
}, G = (e, t) => e === "top" || e === "bottom" ? B : V(t / 2, R, z), ee = (e) => {
|
|
55
|
-
let t = U(e.side), n = e.startSize + e.pointerDelta * t.deltaDirection, r = e.collapsible && n <= G(e.side, e.minSize);
|
|
56
|
-
return {
|
|
57
|
-
rawSize: n,
|
|
58
|
-
size: r ? 0 : V(n, e.minSize, e.maxSize),
|
|
59
|
-
collapsed: r
|
|
60
|
-
};
|
|
61
|
-
}, te = 250, K = [
|
|
62
|
-
0,
|
|
63
|
-
1,
|
|
64
|
-
2
|
|
65
|
-
], ne = (e, t) => e ? {
|
|
66
|
-
w: t,
|
|
67
|
-
h: "full",
|
|
68
|
-
hitArea: {
|
|
69
|
-
top: 0,
|
|
70
|
-
bottom: 0,
|
|
71
|
-
insetInlineStart: "-1",
|
|
72
|
-
insetInlineEnd: "-1"
|
|
73
|
-
},
|
|
74
|
-
gripDirection: "column",
|
|
75
|
-
bar: {
|
|
76
|
-
top: "0",
|
|
77
|
-
bottom: "0",
|
|
78
|
-
insetInlineStart: "50%",
|
|
79
|
-
w: "0.5",
|
|
80
|
-
transform: "translateX(-50%)"
|
|
81
|
-
}
|
|
82
|
-
} : {
|
|
83
|
-
w: "full",
|
|
84
|
-
h: t,
|
|
85
|
-
hitArea: {
|
|
86
|
-
insetInline: 0,
|
|
87
|
-
top: "-1",
|
|
88
|
-
bottom: "-1"
|
|
89
|
-
},
|
|
90
|
-
gripDirection: "row",
|
|
91
|
-
bar: {
|
|
92
|
-
top: "50%",
|
|
93
|
-
insetInline: "0",
|
|
94
|
-
h: "0.5",
|
|
95
|
-
transform: "translateY(-50%)"
|
|
96
|
-
}
|
|
97
|
-
}, re = (e) => {
|
|
98
|
-
let t = f(4), { active: n, layout: r } = e, a = r.gripDirection, o = +!n, s;
|
|
99
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = K.map(ae), t[0] = s) : s = t[0];
|
|
100
|
-
let c;
|
|
101
|
-
return t[1] !== r.gripDirection || t[2] !== o ? (c = /* @__PURE__ */ m(i, {
|
|
102
|
-
"data-part": "grip",
|
|
103
|
-
direction: a,
|
|
104
|
-
gap: "3xs",
|
|
105
|
-
opacity: o,
|
|
106
|
-
transition: "opacity 120ms ease",
|
|
107
|
-
children: s
|
|
108
|
-
}), t[1] = r.gripDirection, t[2] = o, t[3] = c) : c = t[3], c;
|
|
109
|
-
}, ie = (e) => {
|
|
110
|
-
let t = f(3), { active: n, layout: i } = e, a = +!!n, o;
|
|
111
|
-
return t[0] !== i.bar || t[1] !== a ? (o = /* @__PURE__ */ m(r, {
|
|
112
|
-
"data-part": "bar",
|
|
113
|
-
position: "absolute",
|
|
114
|
-
borderRadius: "xs",
|
|
115
|
-
bg: "fg.info",
|
|
116
|
-
opacity: a,
|
|
117
|
-
transition: "opacity 120ms ease",
|
|
118
|
-
pointerEvents: "none",
|
|
119
|
-
...i.bar
|
|
120
|
-
}), t[0] = i.bar, t[1] = a, t[2] = o) : o = t[2], o;
|
|
121
|
-
}, q = (e) => {
|
|
122
|
-
let t = f(47), { css: n, axis: i, bounds: a, collapsed: o, collapsible: s, contentPanelId: c, dragging: l, resizablePanelId: u, resizeLabel: d, resolvedPanelSize: p, separator: g, separatorRef: _, onCollapse: v, onResizeKeyDown: b, onResizeStart: C } = e, w = g === "line", T = i.separatorOrientation === "vertical", E = w ? "1px" : "panel-gap", D;
|
|
123
|
-
t[0] !== T || t[1] !== E ? (D = ne(T, E), t[0] = T, t[1] = E, t[2] = D) : D = t[2];
|
|
124
|
-
let O = D, [k, A] = S(!1), j = x(0), M = k || l, N;
|
|
125
|
-
t[3] === o ? N = t[4] : (N = o ? {
|
|
126
|
-
"aria-hidden": !0,
|
|
127
|
-
tabIndex: -1
|
|
128
|
-
} : { tabIndex: 0 }, t[3] = o, t[4] = N);
|
|
129
|
-
let P = N, F, I;
|
|
130
|
-
t[5] === Symbol.for("react.memo_cache_sentinel") ? (F = () => () => window.clearTimeout(j.current), I = [], t[5] = F, t[6] = I) : (F = t[5], I = t[6]), y(F, I);
|
|
131
|
-
let L;
|
|
132
|
-
t[7] === Symbol.for("react.memo_cache_sentinel") ? (L = () => {
|
|
133
|
-
j.current = window.setTimeout(() => A(!0), te);
|
|
134
|
-
}, t[7] = L) : L = t[7];
|
|
135
|
-
let R = L, z;
|
|
136
|
-
t[8] === Symbol.for("react.memo_cache_sentinel") ? (z = () => {
|
|
137
|
-
window.clearTimeout(j.current), A(!1);
|
|
138
|
-
}, t[8] = z) : z = t[8];
|
|
139
|
-
let B = z, V = i.separatorOrientation, H = `${u} ${c}`, U;
|
|
140
|
-
t[9] !== a.minSize || t[10] !== s ? (U = s ? 0 : Math.round(a.minSize), t[9] = a.minSize, t[10] = s, t[11] = U) : U = t[11];
|
|
141
|
-
let W;
|
|
142
|
-
t[12] === a.maxSize ? W = t[13] : (W = Math.round(a.maxSize), t[12] = a.maxSize, t[13] = W);
|
|
143
|
-
let G;
|
|
144
|
-
t[14] === p ? G = t[15] : (G = Math.round(p), t[14] = p, t[15] = G);
|
|
145
|
-
let ee = w ? "border.subtle" : void 0, K;
|
|
146
|
-
t[16] === O.hitArea ? K = t[17] : (K = {
|
|
147
|
-
content: "\"\"",
|
|
148
|
-
position: "absolute",
|
|
149
|
-
...O.hitArea
|
|
150
|
-
}, t[16] = O.hitArea, t[17] = K);
|
|
151
|
-
let q;
|
|
152
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (q = {
|
|
153
|
-
"& [data-part=bar]": { opacity: 1 },
|
|
154
|
-
"& [data-part=grip]": { opacity: 0 }
|
|
155
|
-
}, t[18] = q) : q = t[18];
|
|
156
|
-
let ae = s ? v : void 0, oe;
|
|
157
|
-
t[19] !== M || t[20] !== O || t[21] !== w ? (oe = w ? null : /* @__PURE__ */ m(re, {
|
|
158
|
-
active: M,
|
|
159
|
-
layout: O
|
|
160
|
-
}), t[19] = M, t[20] = O, t[21] = w, t[22] = oe) : oe = t[22];
|
|
161
|
-
let se;
|
|
162
|
-
t[23] !== M || t[24] !== O ? (se = /* @__PURE__ */ m(ie, {
|
|
163
|
-
active: M,
|
|
164
|
-
layout: O
|
|
165
|
-
}), t[23] = M, t[24] = O, t[25] = se) : se = t[25];
|
|
166
|
-
let ce;
|
|
167
|
-
return t[26] !== i.cursor || t[27] !== i.separatorOrientation || t[28] !== o || t[29] !== n || t[30] !== O.h || t[31] !== O.w || t[32] !== b || t[33] !== C || t[34] !== d || t[35] !== _ || t[36] !== U || t[37] !== W || t[38] !== G || t[39] !== ee || t[40] !== K || t[41] !== ae || t[42] !== oe || t[43] !== se || t[44] !== H || t[45] !== P ? (ce = /* @__PURE__ */ h(r, {
|
|
168
|
-
css: n,
|
|
169
|
-
ref: _,
|
|
170
|
-
"data-collapsed": o,
|
|
171
|
-
role: "separator",
|
|
172
|
-
"aria-label": d,
|
|
173
|
-
"aria-orientation": V,
|
|
174
|
-
"aria-controls": H,
|
|
175
|
-
"aria-valuemin": U,
|
|
176
|
-
"aria-valuemax": W,
|
|
177
|
-
"aria-valuenow": G,
|
|
178
|
-
...P,
|
|
179
|
-
position: "relative",
|
|
180
|
-
zIndex: "docked",
|
|
181
|
-
alignItems: "center",
|
|
182
|
-
justifyContent: "center",
|
|
183
|
-
flexShrink: 0,
|
|
184
|
-
w: O.w,
|
|
185
|
-
h: O.h,
|
|
186
|
-
bg: ee,
|
|
187
|
-
cursor: i.cursor,
|
|
188
|
-
touchAction: "none",
|
|
189
|
-
outline: "none",
|
|
190
|
-
_before: K,
|
|
191
|
-
_focusVisible: q,
|
|
192
|
-
onPointerEnter: R,
|
|
193
|
-
onPointerLeave: B,
|
|
194
|
-
onPointerDown: C,
|
|
195
|
-
onDoubleClick: ae,
|
|
196
|
-
onKeyDown: b,
|
|
197
|
-
children: [oe, se]
|
|
198
|
-
}), t[26] = i.cursor, t[27] = i.separatorOrientation, t[28] = o, t[29] = n, t[30] = O.h, t[31] = O.w, t[32] = b, t[33] = C, t[34] = d, t[35] = _, t[36] = U, t[37] = W, t[38] = G, t[39] = ee, t[40] = K, t[41] = ae, t[42] = oe, t[43] = se, t[44] = H, t[45] = P, t[46] = ce) : ce = t[46], ce;
|
|
199
|
-
};
|
|
200
|
-
function ae(e) {
|
|
201
|
-
return /* @__PURE__ */ m(r, {
|
|
202
|
-
boxSize: "0.5",
|
|
203
|
-
borderRadius: "full",
|
|
204
|
-
bg: "border"
|
|
205
|
-
}, e);
|
|
206
|
-
}
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/components/layout/resizable-split-layout.panels.tsx
|
|
209
|
-
var oe = (e) => {
|
|
210
|
-
let t = f(36), { styles: n, axis: i, bounds: a, collapsed: o, collapsible: s, contentPanel: c, contentPanelId: l, contentPanelRef: u, resizablePanel: d, resizablePanelId: g, resizablePanelRef: _, dragging: v, resizeLabel: y, resolvedPanelSize: b, separator: x, separatorRef: S, onCollapse: C, onResizeKeyDown: w, onResizeStart: T } = e, E = o ? !0 : void 0, D;
|
|
211
|
-
t[0] !== o || t[1] !== d || t[2] !== g || t[3] !== _ || t[4] !== n.resizablePanel || t[5] !== E ? (D = /* @__PURE__ */ m(r, {
|
|
212
|
-
id: g,
|
|
213
|
-
ref: _,
|
|
214
|
-
css: n.resizablePanel,
|
|
215
|
-
"data-collapsed": o,
|
|
216
|
-
"aria-hidden": E,
|
|
217
|
-
children: d
|
|
218
|
-
}, "resizable-panel"), t[0] = o, t[1] = d, t[2] = g, t[3] = _, t[4] = n.resizablePanel, t[5] = E, t[6] = D) : D = t[6];
|
|
219
|
-
let O = D, k;
|
|
220
|
-
t[7] !== c || t[8] !== l || t[9] !== u || t[10] !== n.contentPanel ? (k = /* @__PURE__ */ m(r, {
|
|
221
|
-
id: l,
|
|
222
|
-
ref: u,
|
|
223
|
-
css: n.contentPanel,
|
|
224
|
-
children: c
|
|
225
|
-
}, "content-panel"), t[7] = c, t[8] = l, t[9] = u, t[10] = n.contentPanel, t[11] = k) : k = t[11];
|
|
226
|
-
let A = k, j;
|
|
227
|
-
t[12] !== i || t[13] !== a || t[14] !== o || t[15] !== s || t[16] !== l || t[17] !== v || t[18] !== C || t[19] !== w || t[20] !== T || t[21] !== g || t[22] !== y || t[23] !== b || t[24] !== x || t[25] !== S || t[26] !== n.separator ? (j = /* @__PURE__ */ m(q, {
|
|
228
|
-
css: n.separator,
|
|
229
|
-
axis: i,
|
|
230
|
-
bounds: a,
|
|
231
|
-
collapsed: o,
|
|
232
|
-
collapsible: s,
|
|
233
|
-
contentPanelId: l,
|
|
234
|
-
resizablePanelId: g,
|
|
235
|
-
dragging: v,
|
|
236
|
-
resizeLabel: y,
|
|
237
|
-
resolvedPanelSize: b,
|
|
238
|
-
separator: x,
|
|
239
|
-
separatorRef: S,
|
|
240
|
-
onCollapse: C,
|
|
241
|
-
onResizeKeyDown: w,
|
|
242
|
-
onResizeStart: T
|
|
243
|
-
}, "resize-handle"), t[12] = i, t[13] = a, t[14] = o, t[15] = s, t[16] = l, t[17] = v, t[18] = C, t[19] = w, t[20] = T, t[21] = g, t[22] = y, t[23] = b, t[24] = x, t[25] = S, t[26] = n.separator, t[27] = j) : j = t[27];
|
|
244
|
-
let M = j;
|
|
245
|
-
if (i.panelFirst) {
|
|
246
|
-
let e;
|
|
247
|
-
return t[28] !== A || t[29] !== O || t[30] !== M ? (e = /* @__PURE__ */ h(p, { children: [
|
|
248
|
-
O,
|
|
249
|
-
M,
|
|
250
|
-
A
|
|
251
|
-
] }), t[28] = A, t[29] = O, t[30] = M, t[31] = e) : e = t[31], e;
|
|
252
|
-
}
|
|
253
|
-
let N;
|
|
254
|
-
return t[32] !== A || t[33] !== O || t[34] !== M ? (N = /* @__PURE__ */ h(p, { children: [
|
|
255
|
-
A,
|
|
256
|
-
M,
|
|
257
|
-
O
|
|
258
|
-
] }), t[32] = A, t[33] = O, t[34] = M, t[35] = N) : N = t[35], N;
|
|
259
|
-
}, se = (e, t, n) => {
|
|
260
|
-
let r = f(6), i;
|
|
261
|
-
r[0] === Symbol.for("react.memo_cache_sentinel") ? (i = {
|
|
262
|
-
rootSize: 0,
|
|
263
|
-
separatorSize: 0
|
|
264
|
-
}, r[0] = i) : i = r[0];
|
|
265
|
-
let [a, o] = S(i), s, c;
|
|
266
|
-
return r[1] !== n || r[2] !== e || r[3] !== t ? (s = () => {
|
|
267
|
-
let r = e.current;
|
|
268
|
-
if (!r) return;
|
|
269
|
-
let i = () => {
|
|
270
|
-
o({
|
|
271
|
-
rootSize: r.getBoundingClientRect()[n],
|
|
272
|
-
separatorSize: t.current?.getBoundingClientRect()[n] ?? 0
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
if (i(), typeof ResizeObserver > "u") return;
|
|
276
|
-
let a = new ResizeObserver(i);
|
|
277
|
-
return a.observe(r), t.current && a.observe(t.current), () => {
|
|
278
|
-
a.disconnect();
|
|
279
|
-
};
|
|
280
|
-
}, c = [
|
|
281
|
-
e,
|
|
282
|
-
t,
|
|
283
|
-
n
|
|
284
|
-
], r[1] = n, r[2] = e, r[3] = t, r[4] = s, r[5] = c) : (s = r[4], c = r[5]), y(s, c), a;
|
|
285
|
-
}, ce = {
|
|
286
|
-
width: 1200,
|
|
287
|
-
height: 720
|
|
288
|
-
}, le = 24, ue = (e, t, n) => Math.min(Math.max(e, t), n), de = (e, t) => e?.getBoundingClientRect()[t] ?? 0, fe = (e) => {
|
|
289
|
-
let t = f(96), n, r, a, o, s, c, l, u, p, h, g, _, v, C, w;
|
|
290
|
-
t[0] === e ? (n = t[1], r = t[2], a = t[3], o = t[4], s = t[5], c = t[6], l = t[7], u = t[8], p = t[9], h = t[10], g = t[11], _ = t[12], v = t[13], C = t[14], w = t[15]) : ({resizablePanel: c, contentPanel: n, resizableSide: u, defaultSizePx: p, minSizePx: h, maxSizePx: a, contentMinSizePx: g, collapsed: r, collapsible: _, resizeLabel: v, separator: C, layout: w, onSizeChange: s, onCollapsedChange: o, ...l} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = a, t[4] = o, t[5] = s, t[6] = c, t[7] = l, t[8] = u, t[9] = p, t[10] = h, t[11] = g, t[12] = _, t[13] = v, t[14] = C, t[15] = w);
|
|
291
|
-
let T = u === void 0 ? "left" : u, E = p === void 0 ? 240 : p, D = h === void 0 ? 200 : h, O = g === void 0 ? 0 : g, k = _ === void 0 || _, A = v === void 0 ? "Resize panel" : v, j = C === void 0 ? "gap" : C, M = w === void 0 ? "split" : w, N;
|
|
292
|
-
t[16] === T ? N = t[17] : (N = U(T), t[16] = T, t[17] = N);
|
|
293
|
-
let P = N, F;
|
|
294
|
-
t[18] === Symbol.for("react.memo_cache_sentinel") ? (F = { key: "resizableSplitLayout" }, t[18] = F) : F = t[18];
|
|
295
|
-
let I = d(F), L = P.dimension === "width" ? "horizontal" : "vertical", R;
|
|
296
|
-
t[19] !== M || t[20] !== I || t[21] !== L ? (R = I({
|
|
297
|
-
orientation: L,
|
|
298
|
-
layout: M
|
|
299
|
-
}), t[19] = M, t[20] = I, t[21] = L, t[22] = R) : R = t[22];
|
|
300
|
-
let z = R, B = b(), V = x(null), H = x(null), G = x(null), te = x(null), K = x(pe), { rootSize: ne, separatorSize: re } = se(V, te, P.dimension), ie = x(E), [q, ae] = S(E), [fe, he] = S(!1), [ge, _e] = S(!1), J = r ?? fe, Y, ve;
|
|
301
|
-
t[23] !== P.dimension || t[24] !== J || t[25] !== O || t[26] !== a || t[27] !== D || t[28] !== q || t[29] !== ne || t[30] !== re ? (Y = W({
|
|
302
|
-
rootSize: ne,
|
|
303
|
-
fallbackRootSize: ce[P.dimension],
|
|
304
|
-
minSize: D,
|
|
305
|
-
maxSize: a,
|
|
306
|
-
contentMinSize: O,
|
|
307
|
-
separatorSize: re
|
|
308
|
-
}), ve = J ? 0 : ue(q, Y.minSize, Y.maxSize), t[23] = P.dimension, t[24] = J, t[25] = O, t[26] = a, t[27] = D, t[28] = q, t[29] = ne, t[30] = re, t[31] = Y, t[32] = ve) : (Y = t[31], ve = t[32]);
|
|
309
|
-
let ye = ve, be = `${B}-content`, X = `${B}-resizable`, xe = `${ye}px`, Se;
|
|
310
|
-
t[33] !== l.style || t[34] !== xe ? (Se = {
|
|
311
|
-
...l.style,
|
|
312
|
-
"--split-size": xe
|
|
313
|
-
}, t[33] = l.style, t[34] = xe, t[35] = Se) : Se = t[35];
|
|
314
|
-
let Ce = Se, we, Te;
|
|
315
|
-
t[36] === E ? (we = t[37], Te = t[38]) : (we = () => {
|
|
316
|
-
ie.current = E, ae(E);
|
|
317
|
-
}, Te = [E], t[36] = E, t[37] = we, t[38] = Te), y(we, Te);
|
|
318
|
-
let Ee, De;
|
|
319
|
-
t[39] === Symbol.for("react.memo_cache_sentinel") ? (Ee = () => () => K.current(), De = [], t[39] = Ee, t[40] = De) : (Ee = t[39], De = t[40]), y(Ee, De);
|
|
320
|
-
let Oe;
|
|
321
|
-
t[41] === Symbol.for("react.memo_cache_sentinel") ? (Oe = (e) => {
|
|
322
|
-
V.current?.style.setProperty("--split-size", `${e}px`);
|
|
323
|
-
}, t[41] = Oe) : Oe = t[41];
|
|
324
|
-
let ke = Oe, Ae;
|
|
325
|
-
t[42] !== P.dimension || t[43] !== O || t[44] !== a || t[45] !== D || t[46] !== s ? (Ae = (e) => {
|
|
326
|
-
let t = W({
|
|
327
|
-
rootSize: de(V.current, P.dimension),
|
|
328
|
-
fallbackRootSize: ce[P.dimension],
|
|
329
|
-
minSize: D,
|
|
330
|
-
maxSize: a,
|
|
331
|
-
contentMinSize: O,
|
|
332
|
-
separatorSize: de(te.current, P.dimension)
|
|
333
|
-
}), n = ue(e, t.minSize, t.maxSize);
|
|
334
|
-
ie.current = n, ae(n), ke(n), s?.(n);
|
|
335
|
-
}, t[42] = P.dimension, t[43] = O, t[44] = a, t[45] = D, t[46] = s, t[47] = Ae) : Ae = t[47];
|
|
336
|
-
let Z = Ae, je;
|
|
337
|
-
t[48] !== r || t[49] !== o ? (je = (e) => {
|
|
338
|
-
r === void 0 && he(e), o?.(e);
|
|
339
|
-
}, t[48] = r, t[49] = o, t[50] = je) : je = t[50];
|
|
340
|
-
let Q = je, Me;
|
|
341
|
-
t[51] !== P.cursor || t[52] !== P.dimension || t[53] !== P.pointerCoordinate || t[54] !== J || t[55] !== k || t[56] !== Z || t[57] !== O || t[58] !== a || t[59] !== D || t[60] !== T || t[61] !== Q ? (Me = (e) => {
|
|
342
|
-
if (e.button !== 0 || J && !k) return;
|
|
343
|
-
e.preventDefault(), K.current();
|
|
344
|
-
let t = e.currentTarget, n = W({
|
|
345
|
-
rootSize: de(V.current, P.dimension),
|
|
346
|
-
fallbackRootSize: ce[P.dimension],
|
|
347
|
-
minSize: D,
|
|
348
|
-
maxSize: a,
|
|
349
|
-
contentMinSize: O,
|
|
350
|
-
separatorSize: de(te.current, P.dimension)
|
|
351
|
-
}), r = e[P.pointerCoordinate], i = J ? 0 : de(H.current, P.dimension) || ie.current, o = document.body.style.cursor, s = document.body.style.userSelect, c = i === 0 ? 0 : ue(i, n.minSize, n.maxSize), l = J, u = 0, d = (e) => {
|
|
352
|
-
H.current && (H.current.style.pointerEvents = e), G.current && (G.current.style.pointerEvents = e);
|
|
353
|
-
}, f = () => {
|
|
354
|
-
u ||= window.requestAnimationFrame(() => {
|
|
355
|
-
u = 0, ke(c);
|
|
356
|
-
});
|
|
357
|
-
}, p = (e) => {
|
|
358
|
-
let t = ee({
|
|
359
|
-
side: T,
|
|
360
|
-
startSize: i,
|
|
361
|
-
pointerDelta: e[P.pointerCoordinate] - r,
|
|
362
|
-
minSize: n.minSize,
|
|
363
|
-
maxSize: n.maxSize,
|
|
364
|
-
collapsible: k
|
|
365
|
-
});
|
|
366
|
-
l = t.collapsed, c = t.size, f();
|
|
367
|
-
}, m = () => {
|
|
368
|
-
window.removeEventListener("pointermove", p), window.removeEventListener("pointerup", m), window.removeEventListener("pointercancel", m), window.removeEventListener("blur", m), document.body.style.cursor = o, document.body.style.userSelect = s, t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), d(""), _e(!1), u &&= (window.cancelAnimationFrame(u), 0), K.current = me, l ? (ke(0), Q(!0)) : (Q(!1), Z(c));
|
|
369
|
-
};
|
|
370
|
-
K.current = m, t.setPointerCapture(e.pointerId), document.body.style.cursor = P.cursor, document.body.style.userSelect = "none", d("none"), _e(!0), window.addEventListener("pointermove", p), window.addEventListener("pointerup", m, { once: !0 }), window.addEventListener("pointercancel", m, { once: !0 }), window.addEventListener("blur", m, { once: !0 });
|
|
371
|
-
}, t[51] = P.cursor, t[52] = P.dimension, t[53] = P.pointerCoordinate, t[54] = J, t[55] = k, t[56] = Z, t[57] = O, t[58] = a, t[59] = D, t[60] = T, t[61] = Q, t[62] = Me) : Me = t[62];
|
|
372
|
-
let Ne = Me, Pe;
|
|
373
|
-
t[63] !== k || t[64] !== Q ? (Pe = () => {
|
|
374
|
-
k && Q(!0);
|
|
375
|
-
}, t[63] = k, t[64] = Q, t[65] = Pe) : Pe = t[65];
|
|
376
|
-
let Fe = Pe, Ie;
|
|
377
|
-
t[66] !== P.deltaDirection || t[67] !== P.dimension || t[68] !== Y || t[69] !== J || t[70] !== k || t[71] !== Z || t[72] !== Q ? (Ie = (e) => {
|
|
378
|
-
let t = P.dimension === "width" ? "ArrowLeft" : "ArrowUp", n = P.dimension === "width" ? "ArrowRight" : "ArrowDown", r = ie.current;
|
|
379
|
-
J && (e.key === t || e.key === n || e.key === "End") ? (e.preventDefault(), Q(!1), Z(r)) : e.key === t ? (e.preventDefault(), Z(r - le * P.deltaDirection)) : e.key === n ? (e.preventDefault(), Z(r + le * P.deltaDirection)) : e.key === "Home" ? (e.preventDefault(), k ? Q(!0) : Z(Y.minSize)) : e.key === "End" && (e.preventDefault(), Z(Y.maxSize));
|
|
380
|
-
}, t[66] = P.deltaDirection, t[67] = P.dimension, t[68] = Y, t[69] = J, t[70] = k, t[71] = Z, t[72] = Q, t[73] = Ie) : Ie = t[73];
|
|
381
|
-
let Le = Ie, $;
|
|
382
|
-
t[74] !== P || t[75] !== Y || t[76] !== J || t[77] !== k || t[78] !== n || t[79] !== be || t[80] !== ge || t[81] !== Fe || t[82] !== Le || t[83] !== Ne || t[84] !== c || t[85] !== X || t[86] !== A || t[87] !== ye || t[88] !== j || t[89] !== z ? ($ = /* @__PURE__ */ m(oe, {
|
|
383
|
-
styles: z,
|
|
384
|
-
axis: P,
|
|
385
|
-
bounds: Y,
|
|
386
|
-
collapsed: J,
|
|
387
|
-
collapsible: k,
|
|
388
|
-
contentPanel: n,
|
|
389
|
-
contentPanelId: be,
|
|
390
|
-
contentPanelRef: G,
|
|
391
|
-
resizablePanel: c,
|
|
392
|
-
resizablePanelId: X,
|
|
393
|
-
resizablePanelRef: H,
|
|
394
|
-
dragging: ge,
|
|
395
|
-
resizeLabel: A,
|
|
396
|
-
resolvedPanelSize: ye,
|
|
397
|
-
separator: j,
|
|
398
|
-
separatorRef: te,
|
|
399
|
-
onCollapse: Fe,
|
|
400
|
-
onResizeKeyDown: Le,
|
|
401
|
-
onResizeStart: Ne
|
|
402
|
-
}), t[74] = P, t[75] = Y, t[76] = J, t[77] = k, t[78] = n, t[79] = be, t[80] = ge, t[81] = Fe, t[82] = Le, t[83] = Ne, t[84] = c, t[85] = X, t[86] = A, t[87] = ye, t[88] = j, t[89] = z, t[90] = $) : $ = t[90];
|
|
403
|
-
let Re;
|
|
404
|
-
return t[91] !== l || t[92] !== Ce || t[93] !== z.root || t[94] !== $ ? (Re = /* @__PURE__ */ m(i, {
|
|
405
|
-
ref: V,
|
|
406
|
-
css: z.root,
|
|
407
|
-
...l,
|
|
408
|
-
style: Ce,
|
|
409
|
-
children: $
|
|
410
|
-
}), t[91] = l, t[92] = Ce, t[93] = z.root, t[94] = $, t[95] = Re) : Re = t[95], Re;
|
|
411
|
-
};
|
|
412
|
-
function pe() {}
|
|
413
|
-
function me() {}
|
|
414
|
-
//#endregion
|
|
415
|
-
//#region src/components/tree-list/tree-list-background.tsx
|
|
416
|
-
var he = (t) => {
|
|
417
|
-
let n = f(8), { actions: i, children: a } = t, o;
|
|
418
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ m(r, {
|
|
419
|
-
position: "absolute",
|
|
420
|
-
inset: "0",
|
|
421
|
-
zIndex: 0,
|
|
422
|
-
"aria-hidden": !0,
|
|
423
|
-
"data-tree-list-background": "true"
|
|
424
|
-
}), n[0] = o) : o = n[0];
|
|
425
|
-
let s;
|
|
426
|
-
n[1] === i ? s = n[2] : (s = /* @__PURE__ */ m(e, {
|
|
427
|
-
actions: i,
|
|
428
|
-
closeOnSelect: !1,
|
|
429
|
-
children: o
|
|
430
|
-
}), n[1] = i, n[2] = s);
|
|
431
|
-
let c;
|
|
432
|
-
n[3] === a ? c = n[4] : (c = /* @__PURE__ */ m(r, {
|
|
433
|
-
position: "relative",
|
|
434
|
-
zIndex: 1,
|
|
435
|
-
w: "full",
|
|
436
|
-
minW: "0",
|
|
437
|
-
maxW: "full",
|
|
438
|
-
children: a
|
|
439
|
-
}), n[3] = a, n[4] = c);
|
|
440
|
-
let l;
|
|
441
|
-
return n[5] !== s || n[6] !== c ? (l = /* @__PURE__ */ h(r, {
|
|
442
|
-
position: "relative",
|
|
443
|
-
flex: "1 0 auto",
|
|
444
|
-
minH: "full",
|
|
445
|
-
w: "full",
|
|
446
|
-
minW: "0",
|
|
447
|
-
maxW: "full",
|
|
448
|
-
children: [s, c]
|
|
449
|
-
}), n[5] = s, n[6] = c, n[7] = l) : l = n[7], l;
|
|
450
|
-
}, ge = (e, t) => t.includes(e), _e = (e, t) => Array.isArray(t) ? t.includes(e) : t === e, J = (e) => e.isNavigable || e.navigationIntent !== void 0, Y = (e) => e.children ?? [], ve = (e) => Y(e).length > 0 || e.isContainer === !0, ye = (e) => {
|
|
451
|
-
let { rows: t, sectionId: n, nodes: r, expandedNodeIds: i, level: a, parentNodeId: o } = e;
|
|
452
|
-
for (let e of r) {
|
|
453
|
-
t.push({
|
|
454
|
-
kind: "node",
|
|
455
|
-
key: `${n}:${e.id}`,
|
|
456
|
-
sectionId: n,
|
|
457
|
-
node: e,
|
|
458
|
-
level: a,
|
|
459
|
-
parentNodeId: o
|
|
460
|
-
});
|
|
461
|
-
let r = Y(e);
|
|
462
|
-
r.length !== 0 && ge(e.id, i) && ye({
|
|
463
|
-
rows: t,
|
|
464
|
-
sectionId: n,
|
|
465
|
-
nodes: r,
|
|
466
|
-
expandedNodeIds: i,
|
|
467
|
-
level: a + 1,
|
|
468
|
-
parentNodeId: e.id
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
}, be = (e, t, n) => {
|
|
472
|
-
let r = [];
|
|
473
|
-
for (let i of e) {
|
|
474
|
-
let e = i.collapsible !== !1 && i.label !== void 0, a = !e || ge(i.id, t);
|
|
475
|
-
if (i.label && r.push({
|
|
476
|
-
kind: "section-header",
|
|
477
|
-
key: `header:${i.id}`,
|
|
478
|
-
sectionId: i.id,
|
|
479
|
-
section: i,
|
|
480
|
-
collapsible: e,
|
|
481
|
-
expanded: a
|
|
482
|
-
}), a) {
|
|
483
|
-
if (i.nodes.length === 0) {
|
|
484
|
-
i.emptyState && r.push({
|
|
485
|
-
kind: "section-empty",
|
|
486
|
-
key: `empty:${i.id}`,
|
|
487
|
-
sectionId: i.id,
|
|
488
|
-
emptyState: i.emptyState
|
|
489
|
-
});
|
|
490
|
-
continue;
|
|
491
|
-
}
|
|
492
|
-
ye({
|
|
493
|
-
rows: r,
|
|
494
|
-
sectionId: i.id,
|
|
495
|
-
nodes: i.nodes,
|
|
496
|
-
expandedNodeIds: n,
|
|
497
|
-
level: 0
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return r;
|
|
502
|
-
}, X = (e) => e.kind === "node" ? e.node.id : e.key, xe = (e) => e.kind === "node" ? e.node.disabled !== !0 : e.kind === "section-header" && e.collapsible, Se = (e) => e.filter(xe), Ce = (e, t, n) => {
|
|
503
|
-
let r = Se(n), i = new Set(r.map(X));
|
|
504
|
-
if (e && i.has(e)) return e;
|
|
505
|
-
let a = (Array.isArray(t) ? t : t ? [t] : []).find((e) => i.has(e));
|
|
506
|
-
if (a) return a;
|
|
507
|
-
let o = r[0];
|
|
508
|
-
return o ? X(o) : void 0;
|
|
509
|
-
}, we = (e) => {
|
|
510
|
-
let { row: t, focusableRows: n, currentIndex: r, key: i } = e;
|
|
511
|
-
if (i === "Enter" || i === " ") return {
|
|
512
|
-
type: "toggle-section",
|
|
513
|
-
sectionId: t.sectionId
|
|
514
|
-
};
|
|
515
|
-
if (i === "ArrowRight") {
|
|
516
|
-
if (!t.expanded) return {
|
|
517
|
-
type: "toggle-section",
|
|
518
|
-
sectionId: t.sectionId
|
|
519
|
-
};
|
|
520
|
-
let e = n[r + 1];
|
|
521
|
-
return e?.kind === "node" && e.sectionId === t.sectionId ? {
|
|
522
|
-
type: "focus",
|
|
523
|
-
rowId: e.node.id
|
|
524
|
-
} : null;
|
|
525
|
-
}
|
|
526
|
-
return i === "ArrowLeft" && t.expanded ? {
|
|
527
|
-
type: "toggle-section",
|
|
528
|
-
sectionId: t.sectionId
|
|
529
|
-
} : null;
|
|
530
|
-
}, Te = (e) => {
|
|
531
|
-
let { row: t, focusableRows: n, currentIndex: r, expandedNodeIds: i, key: a } = e, o = ge(t.node.id, i), s = ve(t.node);
|
|
532
|
-
if (a === "ArrowRight") {
|
|
533
|
-
if (!s) return null;
|
|
534
|
-
if (!o) return {
|
|
535
|
-
type: "toggle-node",
|
|
536
|
-
nodeId: t.node.id
|
|
537
|
-
};
|
|
538
|
-
let e = n[r + 1];
|
|
539
|
-
return e?.kind === "node" && e.parentNodeId === t.node.id ? {
|
|
540
|
-
type: "focus",
|
|
541
|
-
rowId: e.node.id
|
|
542
|
-
} : null;
|
|
543
|
-
}
|
|
544
|
-
if (a === "ArrowLeft") {
|
|
545
|
-
if (s && o) return {
|
|
546
|
-
type: "toggle-node",
|
|
547
|
-
nodeId: t.node.id
|
|
548
|
-
};
|
|
549
|
-
if (t.parentNodeId) return {
|
|
550
|
-
type: "focus",
|
|
551
|
-
rowId: t.parentNodeId
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
return null;
|
|
555
|
-
}, Ee = (e) => {
|
|
556
|
-
let { rows: t, focusedRowId: n, activeNodeId: r, expandedNodeIds: i, key: a } = e, o = Se(t);
|
|
557
|
-
if (o.length === 0) return null;
|
|
558
|
-
let s = Ce(n, r, t), c = Math.max(0, o.findIndex((e) => X(e) === s)), l = o[c];
|
|
559
|
-
if (!l) return null;
|
|
560
|
-
let u = (e) => {
|
|
561
|
-
let t = Math.min(Math.max(e, 0), o.length - 1);
|
|
562
|
-
return {
|
|
563
|
-
type: "focus",
|
|
564
|
-
rowId: X(o[t])
|
|
565
|
-
};
|
|
566
|
-
};
|
|
567
|
-
return a === "ArrowDown" ? u(c + 1) : a === "ArrowUp" ? u(c - 1) : a === "Home" ? u(0) : a === "End" ? u(o.length - 1) : l.kind === "section-header" ? we({
|
|
568
|
-
row: l,
|
|
569
|
-
focusableRows: o,
|
|
570
|
-
currentIndex: c,
|
|
571
|
-
key: a
|
|
572
|
-
}) : Te({
|
|
573
|
-
row: l,
|
|
574
|
-
focusableRows: o,
|
|
575
|
-
currentIndex: c,
|
|
576
|
-
expandedNodeIds: i,
|
|
577
|
-
key: a
|
|
578
|
-
});
|
|
579
|
-
}, De = "application/x-pstdio-tree-node", Oe = (e, t) => {
|
|
580
|
-
e.setData(De, t);
|
|
581
|
-
}, ke = (e) => e.getData(De) || void 0, Ae = (e) => {
|
|
582
|
-
let t = f(8), { children: n, onMoveNode: i } = e, a;
|
|
583
|
-
t[0] === i ? a = t[1] : (a = (e) => {
|
|
584
|
-
i && (e.preventDefault(), e.dataTransfer.dropEffect = "move");
|
|
585
|
-
}, t[0] = i, t[1] = a);
|
|
586
|
-
let o = a, s;
|
|
587
|
-
t[2] === i ? s = t[3] : (s = (e) => {
|
|
588
|
-
if (!i) return;
|
|
589
|
-
e.preventDefault();
|
|
590
|
-
let t = ke(e.dataTransfer);
|
|
591
|
-
t && i(t);
|
|
592
|
-
}, t[2] = i, t[3] = s);
|
|
593
|
-
let c = s, l;
|
|
594
|
-
return t[4] !== n || t[5] !== o || t[6] !== c ? (l = /* @__PURE__ */ m(r, {
|
|
595
|
-
p: "xs",
|
|
596
|
-
w: "full",
|
|
597
|
-
minW: "0",
|
|
598
|
-
maxW: "full",
|
|
599
|
-
minH: "full",
|
|
600
|
-
flex: "1 0 auto",
|
|
601
|
-
onDragOver: o,
|
|
602
|
-
onDrop: c,
|
|
603
|
-
children: n
|
|
604
|
-
}), t[4] = n, t[5] = o, t[6] = c, t[7] = l) : l = t[7], l;
|
|
605
|
-
}, Z = (e) => e <= 0 ? "sm" : `calc(var(--chakra-spacing-1) + ${e} * 12px)`, je = (e) => {
|
|
606
|
-
let { input: t, icon: n, level: a } = e, [o, c] = S(t.defaultValue ?? ""), [l, u] = S(), d = x(null), f = x(!1), p = async () => {
|
|
607
|
-
if (!f.current) {
|
|
608
|
-
f.current = !0, u(void 0);
|
|
609
|
-
try {
|
|
610
|
-
await t.onCommit(o.trim());
|
|
611
|
-
} catch (e) {
|
|
612
|
-
u(e instanceof Error ? e.message : "Could not create file."), queueMicrotask(() => d.current?.focus());
|
|
613
|
-
} finally {
|
|
614
|
-
f.current = !1;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
};
|
|
618
|
-
return /* @__PURE__ */ h(i, {
|
|
619
|
-
h: "1.75rem",
|
|
620
|
-
w: "full",
|
|
621
|
-
minW: "0",
|
|
622
|
-
alignItems: "center",
|
|
623
|
-
gap: "1",
|
|
624
|
-
pr: "sm",
|
|
625
|
-
pl: Z(a),
|
|
626
|
-
onMouseDown: (e) => e.stopPropagation(),
|
|
627
|
-
children: [n ? /* @__PURE__ */ m(r, {
|
|
628
|
-
boxSize: "16px",
|
|
629
|
-
color: "fg.muted",
|
|
630
|
-
flexShrink: 0,
|
|
631
|
-
display: "inline-flex",
|
|
632
|
-
alignItems: "center",
|
|
633
|
-
justifyContent: "center",
|
|
634
|
-
css: { "& > svg": {
|
|
635
|
-
width: "16px",
|
|
636
|
-
height: "16px"
|
|
637
|
-
} },
|
|
638
|
-
children: n
|
|
639
|
-
}) : null, /* @__PURE__ */ m(s, {
|
|
640
|
-
ref: d,
|
|
641
|
-
autoFocus: !0,
|
|
642
|
-
size: "xs",
|
|
643
|
-
value: o,
|
|
644
|
-
"aria-label": t.ariaLabel,
|
|
645
|
-
"aria-invalid": !!l || void 0,
|
|
646
|
-
placeholder: t.placeholder,
|
|
647
|
-
title: l,
|
|
648
|
-
onChange: (e) => c(e.currentTarget.value),
|
|
649
|
-
onBlur: () => {
|
|
650
|
-
f.current || t.onCancel?.();
|
|
651
|
-
},
|
|
652
|
-
onKeyDown: (e) => {
|
|
653
|
-
e.stopPropagation(), e.key === "Enter" && (e.preventDefault(), p()), e.key === "Escape" && !f.current && (e.preventDefault(), t.onCancel?.());
|
|
654
|
-
}
|
|
655
|
-
})]
|
|
656
|
-
});
|
|
657
|
-
}, Q = (e) => {
|
|
658
|
-
let t = f(69), { sectionId: r, node: i, level: a, expandedNodeIds: o, activeNodeId: s, rowVariant: c, nodeGap: u, linkComponent: d, tabIndex: p, onFocus: h, onNavigate: g, onToggleNode: _, onMoveNode: v } = e;
|
|
659
|
-
if (i.inlineInput) {
|
|
660
|
-
let e;
|
|
661
|
-
return t[0] !== a || t[1] !== i.icon || t[2] !== i.inlineInput ? (e = /* @__PURE__ */ m(je, {
|
|
662
|
-
input: i.inlineInput,
|
|
663
|
-
icon: i.icon,
|
|
664
|
-
level: a
|
|
665
|
-
}), t[0] = a, t[1] = i.icon, t[2] = i.inlineInput, t[3] = e) : e = t[3], e;
|
|
666
|
-
}
|
|
667
|
-
let y;
|
|
668
|
-
t[4] === i ? y = t[5] : (y = ve(i), t[4] = i, t[5] = y);
|
|
669
|
-
let b = y, x;
|
|
670
|
-
t[6] !== o || t[7] !== b || t[8] !== i.id ? (x = b && ge(i.id, o), t[6] = o, t[7] = b, t[8] = i.id, t[9] = x) : x = t[9];
|
|
671
|
-
let S = x, C;
|
|
672
|
-
t[10] !== s || t[11] !== i.id ? (C = _e(i.id, s), t[10] = s, t[11] = i.id, t[12] = C) : C = t[12];
|
|
673
|
-
let w = C, T = i.disabled === !0, E;
|
|
674
|
-
t[13] === i ? E = t[14] : (E = J(i), t[13] = i, t[14] = E);
|
|
675
|
-
let D = E, O = !!(d && i.href && D && !b && !T), k;
|
|
676
|
-
t[15] !== b || t[16] !== T || t[17] !== D || t[18] !== i || t[19] !== g || t[20] !== _ || t[21] !== r ? (k = () => {
|
|
677
|
-
if (!T) {
|
|
678
|
-
if (b) {
|
|
679
|
-
_?.(i.id);
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
if (D && g) {
|
|
683
|
-
g({
|
|
684
|
-
sectionId: r,
|
|
685
|
-
nodeId: i.id,
|
|
686
|
-
node: i,
|
|
687
|
-
intent: i.navigationIntent
|
|
688
|
-
});
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
i.onActivate?.();
|
|
692
|
-
}
|
|
693
|
-
}, t[15] = b, t[16] = T, t[17] = D, t[18] = i, t[19] = g, t[20] = _, t[21] = r, t[22] = k) : k = t[22];
|
|
694
|
-
let A = k, j;
|
|
695
|
-
t[23] === i.id ? j = t[24] : (j = (e) => {
|
|
696
|
-
Oe(e.dataTransfer, i.id), e.dataTransfer.effectAllowed = "move";
|
|
697
|
-
}, t[23] = i.id, t[24] = j);
|
|
698
|
-
let M = j, N;
|
|
699
|
-
t[25] !== i.canDrop || t[26] !== v ? (N = (e) => {
|
|
700
|
-
v && (e.stopPropagation(), i.canDrop && (e.preventDefault(), e.dataTransfer.dropEffect = "move"));
|
|
701
|
-
}, t[25] = i.canDrop, t[26] = v, t[27] = N) : N = t[27];
|
|
702
|
-
let P = N, F;
|
|
703
|
-
t[28] !== i.canDrop || t[29] !== i.id || t[30] !== v ? (F = (e) => {
|
|
704
|
-
if (!v || (e.stopPropagation(), !i.canDrop)) return;
|
|
705
|
-
e.preventDefault();
|
|
706
|
-
let t = ke(e.dataTransfer);
|
|
707
|
-
t && t !== i.id && v(t, i.id);
|
|
708
|
-
}, t[28] = i.canDrop, t[29] = i.id, t[30] = v, t[31] = F) : F = t[31];
|
|
709
|
-
let I = F, L;
|
|
710
|
-
t[32] !== i.actions || t[33] !== i.id || t[34] !== r ? (L = i.actions?.map((e) => ({
|
|
711
|
-
...e,
|
|
712
|
-
onAction: e.onAction ? (t) => e.onAction?.({
|
|
713
|
-
sectionId: r,
|
|
714
|
-
nodeId: i.id,
|
|
715
|
-
...t
|
|
716
|
-
}) : void 0
|
|
717
|
-
})), t[32] = i.actions, t[33] = i.id, t[34] = r, t[35] = L) : L = t[35];
|
|
718
|
-
let R, z;
|
|
719
|
-
if (t[36] !== i || t[37] !== L) {
|
|
720
|
-
let { inlineInput: e, rowVariant: n, ...r } = {
|
|
721
|
-
...i,
|
|
722
|
-
actions: L
|
|
723
|
-
};
|
|
724
|
-
z = n, R = r, t[36] = i, t[37] = L, t[38] = R, t[39] = z;
|
|
725
|
-
} else R = t[38], z = t[39];
|
|
726
|
-
let B = z ?? c, V = a + 1, H = b ? S : void 0, U;
|
|
727
|
-
t[40] !== i.id || t[41] !== _ ? (U = () => _?.(i.id), t[40] = i.id, t[41] = _, t[42] = U) : U = t[42];
|
|
728
|
-
let W;
|
|
729
|
-
t[43] !== S || t[44] !== A || t[45] !== b || t[46] !== w || t[47] !== a || t[48] !== R || t[49] !== i.id || t[50] !== h || t[51] !== V || t[52] !== H || t[53] !== U || t[54] !== B || t[55] !== p ? (W = {
|
|
730
|
-
...R,
|
|
731
|
-
depth: a,
|
|
732
|
-
variant: B,
|
|
733
|
-
isSelected: w,
|
|
734
|
-
isExpanded: S,
|
|
735
|
-
showExpandToggle: b,
|
|
736
|
-
tabIndex: p,
|
|
737
|
-
"data-tree-list-focus-id": i.id,
|
|
738
|
-
"aria-level": V,
|
|
739
|
-
"aria-expanded": H,
|
|
740
|
-
"data-tree-list-node-id": i.id,
|
|
741
|
-
onFocus: h,
|
|
742
|
-
onActivate: A,
|
|
743
|
-
onToggleExpand: U
|
|
744
|
-
}, t[43] = S, t[44] = A, t[45] = b, t[46] = w, t[47] = a, t[48] = R, t[49] = i.id, t[50] = h, t[51] = V, t[52] = H, t[53] = U, t[54] = B, t[55] = p, t[56] = W) : W = t[56];
|
|
745
|
-
let G = W, ee;
|
|
746
|
-
t[57] !== d || t[58] !== O || t[59] !== i.href || t[60] !== G ? (ee = O && d && i.href ? /* @__PURE__ */ m(d, {
|
|
747
|
-
to: i.href,
|
|
748
|
-
children: /* @__PURE__ */ m(n, {
|
|
749
|
-
...G,
|
|
750
|
-
asChild: !0
|
|
751
|
-
})
|
|
752
|
-
}) : /* @__PURE__ */ m(n, { ...G }), t[57] = d, t[58] = O, t[59] = i.href, t[60] = G, t[61] = ee) : ee = t[61];
|
|
753
|
-
let te = ee, K = !!(v && i.canDrag), ne = i.canDrag ? M : void 0, re = v ? P : void 0, ie = v ? I : void 0, q;
|
|
754
|
-
return t[62] !== u || t[63] !== te || t[64] !== K || t[65] !== ne || t[66] !== re || t[67] !== ie ? (q = /* @__PURE__ */ m(l, {
|
|
755
|
-
gap: u,
|
|
756
|
-
w: "full",
|
|
757
|
-
minW: "0",
|
|
758
|
-
maxW: "full",
|
|
759
|
-
draggable: K,
|
|
760
|
-
onDragStart: ne,
|
|
761
|
-
onDragOver: re,
|
|
762
|
-
onDrop: ie,
|
|
763
|
-
children: te
|
|
764
|
-
}), t[62] = u, t[63] = te, t[64] = K, t[65] = ne, t[66] = re, t[67] = ie, t[68] = q) : q = t[68], q;
|
|
765
|
-
}, Me = (e) => {
|
|
766
|
-
let n = f(9), { sectionId: r, actions: i } = e;
|
|
767
|
-
if (i.length === 0) return null;
|
|
768
|
-
let s, l;
|
|
769
|
-
n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = {
|
|
770
|
-
opacity: "1",
|
|
771
|
-
pointerEvents: "auto"
|
|
772
|
-
}, l = {
|
|
773
|
-
opacity: "1",
|
|
774
|
-
pointerEvents: "auto"
|
|
775
|
-
}, n[0] = s, n[1] = l) : (s = n[0], l = n[1]);
|
|
776
|
-
let u;
|
|
777
|
-
if (n[2] !== i || n[3] !== r) {
|
|
778
|
-
let e;
|
|
779
|
-
n[5] === r ? e = n[6] : (e = (e) => e.menuItems && e.menuItems.length >= 8 ? /* @__PURE__ */ m(t, { action: e }, e.id) : e.menuItems && e.menuItems.length > 0 ? /* @__PURE__ */ h(c.Root, { children: [/* @__PURE__ */ m(c.Trigger, {
|
|
780
|
-
asChild: !0,
|
|
781
|
-
children: /* @__PURE__ */ m(o, {
|
|
782
|
-
variant: "ghost",
|
|
783
|
-
size: "2xs",
|
|
784
|
-
"aria-label": e.label,
|
|
785
|
-
children: e.icon
|
|
786
|
-
})
|
|
787
|
-
}), /* @__PURE__ */ m(c.Positioner, { children: /* @__PURE__ */ m(c.Content, {
|
|
788
|
-
minW: "160px",
|
|
789
|
-
bg: "bg",
|
|
790
|
-
children: e.menuItems.map(Fe)
|
|
791
|
-
}) })] }, e.id) : /* @__PURE__ */ m(o, {
|
|
792
|
-
variant: "ghost",
|
|
793
|
-
size: "2xs",
|
|
794
|
-
"aria-label": e.label,
|
|
795
|
-
onClick: (t) => {
|
|
796
|
-
t.stopPropagation(), e.onAction?.({ sectionId: r });
|
|
797
|
-
},
|
|
798
|
-
children: e.icon
|
|
799
|
-
}, e.id), n[5] = r, n[6] = e), u = i.map(e), n[2] = i, n[3] = r, n[4] = u;
|
|
800
|
-
} else u = n[4];
|
|
801
|
-
let d;
|
|
802
|
-
return n[7] === u ? d = n[8] : (d = /* @__PURE__ */ m(a, {
|
|
803
|
-
gap: "0",
|
|
804
|
-
opacity: "0",
|
|
805
|
-
pointerEvents: "none",
|
|
806
|
-
_groupHover: s,
|
|
807
|
-
_groupFocusWithin: l,
|
|
808
|
-
transition: "opacity 120ms ease",
|
|
809
|
-
onClick: Pe,
|
|
810
|
-
children: u
|
|
811
|
-
}), n[7] = u, n[8] = d), d;
|
|
812
|
-
}, Ne = (e) => {
|
|
813
|
-
let t = f(32), { section: n, collapsible: i, expanded: o, focusId: s, tabIndex: c, onFocus: l, onToggle: d, onContextMenu: p } = e, g = i ? "pointer" : "default", _ = i ? c : void 0, v = i ? s : void 0, y = i ? o : void 0, b;
|
|
814
|
-
t[0] === i ? b = t[1] : (b = i ? { bg: "bg.hover" } : void 0, t[0] = i, t[1] = b);
|
|
815
|
-
let x;
|
|
816
|
-
t[2] === i ? x = t[3] : (x = i ? { bg: "bg.hover" } : void 0, t[2] = i, t[3] = x);
|
|
817
|
-
let S = i ? l : void 0, w = i ? d : void 0, T;
|
|
818
|
-
t[4] !== p || t[5] !== n.id ? (T = p ? (e) => {
|
|
819
|
-
e.preventDefault(), p(e, n.id);
|
|
820
|
-
} : void 0, t[4] = p, t[5] = n.id, t[6] = T) : T = t[6];
|
|
821
|
-
let E;
|
|
822
|
-
t[7] === n.label ? E = t[8] : (E = /* @__PURE__ */ m(u, {
|
|
823
|
-
textStyle: "label/XS",
|
|
824
|
-
textTransform: "uppercase",
|
|
825
|
-
color: "fg.muted",
|
|
826
|
-
letterSpacing: "0.08em",
|
|
827
|
-
truncate: !0,
|
|
828
|
-
children: n.label
|
|
829
|
-
}), t[7] = n.label, t[8] = E);
|
|
830
|
-
let D;
|
|
831
|
-
t[9] !== i || t[10] !== o ? (D = i ? /* @__PURE__ */ m(r, {
|
|
832
|
-
color: "fg.muted",
|
|
833
|
-
flexShrink: 0,
|
|
834
|
-
children: /* @__PURE__ */ m(C, {
|
|
835
|
-
size: 14,
|
|
836
|
-
style: {
|
|
837
|
-
transform: o ? "rotate(90deg)" : "rotate(0deg)",
|
|
838
|
-
transition: "120ms"
|
|
839
|
-
}
|
|
840
|
-
})
|
|
841
|
-
}) : null, t[9] = i, t[10] = o, t[11] = D) : D = t[11];
|
|
842
|
-
let O;
|
|
843
|
-
t[12] !== D || t[13] !== E ? (O = /* @__PURE__ */ h(a, {
|
|
844
|
-
gap: "1",
|
|
845
|
-
flex: "1",
|
|
846
|
-
minW: "0",
|
|
847
|
-
children: [E, D]
|
|
848
|
-
}), t[12] = D, t[13] = E, t[14] = O) : O = t[14];
|
|
849
|
-
let k;
|
|
850
|
-
t[15] === n.actions ? k = t[16] : (k = n.actions ?? [], t[15] = n.actions, t[16] = k);
|
|
851
|
-
let A;
|
|
852
|
-
t[17] !== n.id || t[18] !== k ? (A = /* @__PURE__ */ m(Me, {
|
|
853
|
-
sectionId: n.id,
|
|
854
|
-
actions: k
|
|
855
|
-
}), t[17] = n.id, t[18] = k, t[19] = A) : A = t[19];
|
|
856
|
-
let j;
|
|
857
|
-
return t[20] !== g || t[21] !== _ || t[22] !== O || t[23] !== A || t[24] !== v || t[25] !== y || t[26] !== b || t[27] !== x || t[28] !== S || t[29] !== w || t[30] !== T ? (j = /* @__PURE__ */ h(a, {
|
|
858
|
-
className: "group",
|
|
859
|
-
justify: "space-between",
|
|
860
|
-
align: "center",
|
|
861
|
-
w: "full",
|
|
862
|
-
minW: "0",
|
|
863
|
-
maxW: "full",
|
|
864
|
-
px: "sm",
|
|
865
|
-
py: "2xs",
|
|
866
|
-
height: "7",
|
|
867
|
-
cursor: g,
|
|
868
|
-
tabIndex: _,
|
|
869
|
-
"data-tree-list-focus-id": v,
|
|
870
|
-
"aria-expanded": y,
|
|
871
|
-
_hover: b,
|
|
872
|
-
_focusVisible: x,
|
|
873
|
-
onFocus: S,
|
|
874
|
-
onClick: w,
|
|
875
|
-
onContextMenu: T,
|
|
876
|
-
children: [O, A]
|
|
877
|
-
}), t[20] = g, t[21] = _, t[22] = O, t[23] = A, t[24] = v, t[25] = y, t[26] = b, t[27] = x, t[28] = S, t[29] = w, t[30] = T, t[31] = j) : j = t[31], j;
|
|
878
|
-
};
|
|
879
|
-
function Pe(e) {
|
|
880
|
-
return e.stopPropagation();
|
|
881
|
-
}
|
|
882
|
-
function Fe(e) {
|
|
883
|
-
return /* @__PURE__ */ m(c.Item, {
|
|
884
|
-
value: e.id,
|
|
885
|
-
disabled: e.disabled,
|
|
886
|
-
onClick: () => e.onAction?.(),
|
|
887
|
-
children: e.label
|
|
888
|
-
}, e.id);
|
|
889
|
-
}
|
|
890
|
-
//#endregion
|
|
891
|
-
//#region src/components/tree-list/tree-list-reorder.ts
|
|
892
|
-
var Ie = "section:", Le = (e) => `${Ie}${e}`, $ = (e) => e.startsWith(Ie), Re = (e) => e.slice(8), ze = "after-section:", Be = (e) => `${ze}${e}`, Ve = (e) => e.startsWith(ze), He = (e) => e.slice(14), Ue = (e) => {
|
|
893
|
-
if ($(e)) return Re(e);
|
|
894
|
-
if (Ve(e)) return He(e);
|
|
895
|
-
}, We = (e, t) => {
|
|
896
|
-
for (let n of e) {
|
|
897
|
-
let e = n.nodes.findIndex((e) => e.id === t);
|
|
898
|
-
if (e >= 0) return {
|
|
899
|
-
section: n,
|
|
900
|
-
index: e,
|
|
901
|
-
node: n.nodes[e]
|
|
902
|
-
};
|
|
903
|
-
}
|
|
904
|
-
}, Ge = (e, t) => t?.(e) ?? !0, Ke = (e, t, n, r) => {
|
|
905
|
-
if (t === n) return !0;
|
|
906
|
-
let i = Ue(n);
|
|
907
|
-
if ($(t)) {
|
|
908
|
-
if (i === void 0) return !1;
|
|
909
|
-
let n = e.find((e) => e.id === Re(t)), a = e.find((e) => e.id === i);
|
|
910
|
-
return !n || !a || n.canReorder === !1 || a.canReorder === !1 ? !1 : Ge({
|
|
911
|
-
source: {
|
|
912
|
-
kind: "section",
|
|
913
|
-
sectionId: n.id,
|
|
914
|
-
id: n.id,
|
|
915
|
-
moveScope: n.moveScope
|
|
916
|
-
},
|
|
917
|
-
destination: {
|
|
918
|
-
kind: "section",
|
|
919
|
-
sectionId: a.id,
|
|
920
|
-
id: a.id,
|
|
921
|
-
moveScope: a.moveScope
|
|
922
|
-
}
|
|
923
|
-
}, r);
|
|
924
|
-
}
|
|
925
|
-
let a = We(e, t);
|
|
926
|
-
if (!a || a.node.canReorder === !1) return !1;
|
|
927
|
-
let o = i === void 0 ? void 0 : e.find((e) => e.id === i), s = i === void 0 ? We(e, n) : void 0, c = o ?? s?.section;
|
|
928
|
-
return !c || c.canReorder === !1 || s?.node.canReorder === !1 ? !1 : Ge({
|
|
929
|
-
source: {
|
|
930
|
-
kind: "node",
|
|
931
|
-
sectionId: a.section.id,
|
|
932
|
-
id: a.node.id,
|
|
933
|
-
moveScope: a.node.moveScope ?? a.section.moveScope
|
|
934
|
-
},
|
|
935
|
-
destination: s ? {
|
|
936
|
-
kind: "node",
|
|
937
|
-
sectionId: c.id,
|
|
938
|
-
id: s.node.id,
|
|
939
|
-
moveScope: s.node.moveScope ?? c.moveScope
|
|
940
|
-
} : {
|
|
941
|
-
kind: "section",
|
|
942
|
-
sectionId: c.id,
|
|
943
|
-
id: c.id,
|
|
944
|
-
moveScope: c.moveScope
|
|
945
|
-
}
|
|
946
|
-
}, r);
|
|
947
|
-
}, qe = {
|
|
948
|
-
modifiers: [({ transform: e }) => ({
|
|
949
|
-
...e,
|
|
950
|
-
x: 0
|
|
951
|
-
})],
|
|
952
|
-
autoScroll: { threshold: {
|
|
953
|
-
x: 0,
|
|
954
|
-
y: .2
|
|
955
|
-
} },
|
|
956
|
-
measuring: { droppable: { strategy: E.Always } }
|
|
957
|
-
}, Je = (e, t, n, r) => {
|
|
958
|
-
if (e === t) return null;
|
|
959
|
-
let i = n ? "before" : "after";
|
|
960
|
-
return Ve(t) ? {
|
|
961
|
-
kind: "section",
|
|
962
|
-
id: He(t),
|
|
963
|
-
edge: "after",
|
|
964
|
-
nextSectionId: r
|
|
965
|
-
} : $(t) ? {
|
|
966
|
-
kind: "section",
|
|
967
|
-
id: Re(t),
|
|
968
|
-
edge: $(e) ? i : "inside"
|
|
969
|
-
} : $(e) ? null : {
|
|
970
|
-
kind: "node",
|
|
971
|
-
id: t,
|
|
972
|
-
edge: i
|
|
973
|
-
};
|
|
974
|
-
}, Ye = (e, t, n, r) => {
|
|
975
|
-
let i = Re(t);
|
|
976
|
-
if (n.kind !== "section" || n.edge === "inside" || n.id === i || !Ke(e, t, Le(n.id), r)) return null;
|
|
977
|
-
let a = e.map((e) => e.id), o = a.filter((e) => e !== i);
|
|
978
|
-
return o.splice(o.indexOf(n.id) + +(n.edge === "after"), 0, i), o.every((e, t) => e === a[t]) ? null : {
|
|
979
|
-
kind: "section",
|
|
980
|
-
nextSectionIds: o
|
|
981
|
-
};
|
|
982
|
-
}, Xe = (e, t, n, r) => {
|
|
983
|
-
if (n.kind === "node") {
|
|
984
|
-
let t = We(e, n.id);
|
|
985
|
-
return t ? {
|
|
986
|
-
sectionId: t.section.id,
|
|
987
|
-
index: t.index + +(n.edge === "after")
|
|
988
|
-
} : null;
|
|
989
|
-
}
|
|
990
|
-
let i = e.find((e) => e.id === n.id);
|
|
991
|
-
if (!i) return null;
|
|
992
|
-
if (n.edge === "inside" || !i.label) return {
|
|
993
|
-
sectionId: i.id,
|
|
994
|
-
index: i.nodes.length
|
|
995
|
-
};
|
|
996
|
-
let a = e.find((e) => e.id === n.nextSectionId);
|
|
997
|
-
return a && !a.label && a.canReorder !== !1 && Ke(e, t, Le(a.id), r) ? {
|
|
998
|
-
sectionId: a.id,
|
|
999
|
-
index: 0
|
|
1000
|
-
} : void 0;
|
|
1001
|
-
}, Ze = (e, t, n, r, i) => {
|
|
1002
|
-
if ($(t)) return Ye(e, t, n, r);
|
|
1003
|
-
let a = We(e, t);
|
|
1004
|
-
if (!a || a.node.canReorder === !1 || !Ke(e, t, n.kind === "node" ? n.id : Be(n.id), r)) return null;
|
|
1005
|
-
let o = Xe(e, t, n, r);
|
|
1006
|
-
if (o === null) return null;
|
|
1007
|
-
let s = a.section.nodes.map((e) => e.id).filter((e) => e !== t);
|
|
1008
|
-
if (!o) {
|
|
1009
|
-
if (!i || n.kind !== "section") return null;
|
|
1010
|
-
let r = e.map((e) => e.id);
|
|
1011
|
-
return r.splice(r.indexOf(n.id) + 1, 0, i), {
|
|
1012
|
-
kind: "node",
|
|
1013
|
-
orders: {
|
|
1014
|
-
[a.section.id]: s,
|
|
1015
|
-
[i]: [t]
|
|
1016
|
-
},
|
|
1017
|
-
looseSection: {
|
|
1018
|
-
id: i,
|
|
1019
|
-
afterSectionId: n.id,
|
|
1020
|
-
nextSectionIds: r
|
|
1021
|
-
}
|
|
1022
|
-
};
|
|
1023
|
-
}
|
|
1024
|
-
if (o.sectionId === a.section.id) {
|
|
1025
|
-
let e = o.index - +(a.index < o.index);
|
|
1026
|
-
return e === a.index ? null : (s.splice(e, 0, t), {
|
|
1027
|
-
kind: "node",
|
|
1028
|
-
orders: { [a.section.id]: s }
|
|
1029
|
-
});
|
|
1030
|
-
}
|
|
1031
|
-
let c = e.find((e) => e.id === o.sectionId)?.nodes.map((e) => e.id) ?? [];
|
|
1032
|
-
return c.splice(o.index, 0, t), {
|
|
1033
|
-
kind: "node",
|
|
1034
|
-
orders: {
|
|
1035
|
-
[a.section.id]: s,
|
|
1036
|
-
[o.sectionId]: c
|
|
1037
|
-
}
|
|
1038
|
-
};
|
|
1039
|
-
}, Qe = (e) => $(e) ? 2 : +!!Ve(e), $e = (e, t) => (n) => {
|
|
1040
|
-
let r = String(n.active.id), i = (n) => Ke(e, r, String(n.id), t), a = n.pointerCoordinates && {
|
|
1041
|
-
x: n.collisionRect.left + n.collisionRect.width / 2,
|
|
1042
|
-
y: n.pointerCoordinates.y
|
|
1043
|
-
}, o = a ? k({
|
|
1044
|
-
...n,
|
|
1045
|
-
pointerCoordinates: a
|
|
1046
|
-
}).filter(i) : [];
|
|
1047
|
-
return o.length === 0 ? O(n).filter(i) : o.sort((e, t) => Qe(String(e.id)) - Qe(String(t.id)));
|
|
1048
|
-
}, et = (e, t) => (e instanceof MouseEvent ? e.clientY : 0) + t, tt = (e, t, n) => t ? Je(e, String(t.id), n < t.rect.top + t.rect.height / 2, t.data.current?.nextSectionId) : null, nt = () => `tree-list-loose:${crypto.randomUUID()}`, rt = (e) => (t) => {
|
|
1049
|
-
let n = String(t.active.id), r = tt(n, t.over, et(t.activatorEvent, t.delta.y));
|
|
1050
|
-
if (!r) return;
|
|
1051
|
-
let i = Ze(e.sections, n, r, e.canMove, nt());
|
|
1052
|
-
if (!i) return;
|
|
1053
|
-
if (i.kind === "section") {
|
|
1054
|
-
e.onReorderSections?.(i.nextSectionIds, Re(n), r.id);
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
let a = i.looseSection;
|
|
1058
|
-
a && e.onReorderSections?.(a.nextSectionIds, a.id, a.afterSectionId);
|
|
1059
|
-
for (let [t, n] of Object.entries(i.orders)) e.onReorderNodes?.(t, n);
|
|
1060
|
-
}, it = _(!1), at = (e) => {
|
|
1061
|
-
let t = f(16), { sections: n, canMove: r, onReorderSections: i, onReorderNodes: a, children: o } = e, s;
|
|
1062
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (s = { activationConstraint: { distance: 4 } }, t[0] = s) : s = t[0];
|
|
1063
|
-
let c = P(N(D, s)), l;
|
|
1064
|
-
t[1] !== r || t[2] !== n ? (l = $e(n, r), t[1] = r, t[2] = n, t[3] = l) : l = t[3];
|
|
1065
|
-
let u = l, d;
|
|
1066
|
-
t[4] !== r || t[5] !== a || t[6] !== i || t[7] !== n ? (d = rt({
|
|
1067
|
-
sections: n,
|
|
1068
|
-
canMove: r,
|
|
1069
|
-
onReorderSections: i,
|
|
1070
|
-
onReorderNodes: a
|
|
1071
|
-
}), t[4] = r, t[5] = a, t[6] = i, t[7] = n, t[8] = d) : d = t[8];
|
|
1072
|
-
let p = d, h;
|
|
1073
|
-
t[9] === o ? h = t[10] : (h = /* @__PURE__ */ m(it.Provider, {
|
|
1074
|
-
value: !0,
|
|
1075
|
-
children: o
|
|
1076
|
-
}), t[9] = o, t[10] = h);
|
|
1077
|
-
let g;
|
|
1078
|
-
return t[11] !== u || t[12] !== p || t[13] !== c || t[14] !== h ? (g = /* @__PURE__ */ m(T, {
|
|
1079
|
-
sensors: c,
|
|
1080
|
-
collisionDetection: u,
|
|
1081
|
-
onDragEnd: p,
|
|
1082
|
-
...qe,
|
|
1083
|
-
children: h
|
|
1084
|
-
}), t[11] = u, t[12] = p, t[13] = c, t[14] = h, t[15] = g) : g = t[15], g;
|
|
1085
|
-
}, ot = (e) => e?.label ? e.id : void 0, st = (e, t) => {
|
|
1086
|
-
if (!t) return null;
|
|
1087
|
-
if (t.kind === "node") {
|
|
1088
|
-
let n = We(e, t.id);
|
|
1089
|
-
return n ? {
|
|
1090
|
-
lineId: t.id,
|
|
1091
|
-
edge: t.edge,
|
|
1092
|
-
groupId: ot(n.section)
|
|
1093
|
-
} : null;
|
|
1094
|
-
}
|
|
1095
|
-
let n = e.find((e) => e.id === t.id);
|
|
1096
|
-
if (!n) return null;
|
|
1097
|
-
if (t.edge === "inside") {
|
|
1098
|
-
let e = n.nodes.at(-1);
|
|
1099
|
-
return {
|
|
1100
|
-
lineId: e ? e.id : Le(n.id),
|
|
1101
|
-
edge: "after",
|
|
1102
|
-
groupId: ot(n)
|
|
1103
|
-
};
|
|
1104
|
-
}
|
|
1105
|
-
return t.edge === "after" ? {
|
|
1106
|
-
lineId: Be(n.id),
|
|
1107
|
-
edge: "middle"
|
|
1108
|
-
} : {
|
|
1109
|
-
lineId: Le(n.id),
|
|
1110
|
-
edge: "before"
|
|
1111
|
-
};
|
|
1112
|
-
}, ct = {
|
|
1113
|
-
before: {
|
|
1114
|
-
top: "0",
|
|
1115
|
-
transform: "translateY(-50%)"
|
|
1116
|
-
},
|
|
1117
|
-
after: {
|
|
1118
|
-
bottom: "0",
|
|
1119
|
-
transform: "translateY(50%)"
|
|
1120
|
-
},
|
|
1121
|
-
middle: {
|
|
1122
|
-
top: "50%",
|
|
1123
|
-
transform: "translateY(-50%)"
|
|
1124
|
-
}
|
|
1125
|
-
}, lt = (e) => {
|
|
1126
|
-
let t = f(3), { edge: n } = e, i = ct[n], a;
|
|
1127
|
-
return t[0] !== n || t[1] !== i ? (a = /* @__PURE__ */ m(r, {
|
|
1128
|
-
"aria-hidden": !0,
|
|
1129
|
-
"data-tree-list-drop-indicator": n,
|
|
1130
|
-
position: "absolute",
|
|
1131
|
-
insetX: "0",
|
|
1132
|
-
zIndex: "1",
|
|
1133
|
-
h: "drop-indicator",
|
|
1134
|
-
borderRadius: "2xs",
|
|
1135
|
-
bg: "bg.accent-primary.default",
|
|
1136
|
-
pointerEvents: "none",
|
|
1137
|
-
...i
|
|
1138
|
-
}), t[0] = n, t[1] = i, t[2] = a) : a = t[2], a;
|
|
1139
|
-
}, ut = (e) => {
|
|
1140
|
-
let { id: t, disabled: n, indicator: i, handle: a, liftedBg: o, highlighted: s, children: c } = e, l = I({
|
|
1141
|
-
id: t,
|
|
1142
|
-
disabled: n
|
|
1143
|
-
}), u = i?.lineId === t ? i.edge : void 0, d = l.isDragging ? o : void 0;
|
|
1144
|
-
return /* @__PURE__ */ h(r, {
|
|
1145
|
-
ref: l.setNodeRef,
|
|
1146
|
-
position: "relative",
|
|
1147
|
-
w: "full",
|
|
1148
|
-
minW: "0",
|
|
1149
|
-
borderRadius: "xs",
|
|
1150
|
-
opacity: l.isDragging ? .5 : 1,
|
|
1151
|
-
bg: s ? "bg.accent-subtle" : d,
|
|
1152
|
-
"data-tree-list-drop-group": s ? "" : void 0,
|
|
1153
|
-
onPointerDownCapture: a === "self" ? (e) => l.listeners?.onPointerDown?.(e) : void 0,
|
|
1154
|
-
children: [c(l.listeners), u ? /* @__PURE__ */ m(lt, { edge: u }) : null]
|
|
1155
|
-
});
|
|
1156
|
-
}, dt = (e) => {
|
|
1157
|
-
let { sectionId: t, nextSectionId: n, gap: i, indicator: a } = e, o = Be(t), s = M({
|
|
1158
|
-
id: o,
|
|
1159
|
-
data: { nextSectionId: n }
|
|
1160
|
-
});
|
|
1161
|
-
return /* @__PURE__ */ m(r, {
|
|
1162
|
-
ref: s.setNodeRef,
|
|
1163
|
-
position: "relative",
|
|
1164
|
-
w: "full",
|
|
1165
|
-
pt: i,
|
|
1166
|
-
flexShrink: 0,
|
|
1167
|
-
children: a?.lineId === o ? /* @__PURE__ */ m(lt, { edge: "middle" }) : null
|
|
1168
|
-
});
|
|
1169
|
-
}, ft = (e) => {
|
|
1170
|
-
let t = f(28), { section: n, sectionRows: i, expandedNodeIds: a, activeNodeId: o, rowVariant: s, nodeGap: c, linkComponent: u, onNavigate: d, onToggleSection: g, onToggleNode: _, onSectionContextMenu: v, indicator: y, dragging: b } = e, x;
|
|
1171
|
-
t[0] === i ? x = t[1] : (x = i.find(_t), t[0] = i, t[1] = x);
|
|
1172
|
-
let S = x, C, w;
|
|
1173
|
-
t[2] === i ? (C = t[3], w = t[4]) : (C = i.filter(vt), w = C.filter(yt).map(bt), t[2] = i, t[3] = C, t[4] = w);
|
|
1174
|
-
let T = w, E;
|
|
1175
|
-
t[5] === n.id ? E = t[6] : (E = Le(n.id), t[5] = n.id, t[6] = E);
|
|
1176
|
-
let D = n.canReorder === !1, O = y?.groupId === n.id, k;
|
|
1177
|
-
t[7] !== o || t[8] !== b || t[9] !== a || t[10] !== S || t[11] !== y || t[12] !== u || t[13] !== c || t[14] !== C || t[15] !== d || t[16] !== v || t[17] !== _ || t[18] !== g || t[19] !== s || t[20] !== T ? (k = (e) => /* @__PURE__ */ h(p, { children: [
|
|
1178
|
-
S && S.kind === "section-header" ? /* @__PURE__ */ m(r, {
|
|
1179
|
-
onPointerDownCapture: (t) => e?.onPointerDown?.(t),
|
|
1180
|
-
children: /* @__PURE__ */ m(Ne, {
|
|
1181
|
-
section: S.section,
|
|
1182
|
-
collapsible: S.collapsible,
|
|
1183
|
-
expanded: S.expanded,
|
|
1184
|
-
focusId: S.key,
|
|
1185
|
-
tabIndex: -1,
|
|
1186
|
-
onFocus: xt,
|
|
1187
|
-
onToggle: () => g?.(S.sectionId),
|
|
1188
|
-
onContextMenu: v
|
|
1189
|
-
})
|
|
1190
|
-
}) : null,
|
|
1191
|
-
b && !S && C.length === 0 ? /* @__PURE__ */ m(r, {
|
|
1192
|
-
h: "tree-empty-drop-zone",
|
|
1193
|
-
"data-tree-list-empty-drop-zone": ""
|
|
1194
|
-
}) : null,
|
|
1195
|
-
/* @__PURE__ */ m(F, {
|
|
1196
|
-
items: T,
|
|
1197
|
-
strategy: L,
|
|
1198
|
-
children: /* @__PURE__ */ m(l, {
|
|
1199
|
-
gap: c,
|
|
1200
|
-
w: "full",
|
|
1201
|
-
minW: "0",
|
|
1202
|
-
children: C.map((e) => e.kind === "node" ? /* @__PURE__ */ m(mt, {
|
|
1203
|
-
row: e,
|
|
1204
|
-
expandedNodeIds: a,
|
|
1205
|
-
activeNodeId: o,
|
|
1206
|
-
rowVariant: s,
|
|
1207
|
-
nodeGap: c,
|
|
1208
|
-
linkComponent: u,
|
|
1209
|
-
onNavigate: d,
|
|
1210
|
-
onToggleNode: _,
|
|
1211
|
-
indicator: y
|
|
1212
|
-
}, e.key) : null)
|
|
1213
|
-
})
|
|
1214
|
-
})
|
|
1215
|
-
] }), t[7] = o, t[8] = b, t[9] = a, t[10] = S, t[11] = y, t[12] = u, t[13] = c, t[14] = C, t[15] = d, t[16] = v, t[17] = _, t[18] = g, t[19] = s, t[20] = T, t[21] = k) : k = t[21];
|
|
1216
|
-
let A;
|
|
1217
|
-
return t[22] !== y || t[23] !== E || t[24] !== D || t[25] !== O || t[26] !== k ? (A = /* @__PURE__ */ m(ut, {
|
|
1218
|
-
id: E,
|
|
1219
|
-
disabled: D,
|
|
1220
|
-
indicator: y,
|
|
1221
|
-
handle: "child",
|
|
1222
|
-
highlighted: O,
|
|
1223
|
-
children: k
|
|
1224
|
-
}), t[22] = y, t[23] = E, t[24] = D, t[25] = O, t[26] = k, t[27] = A) : A = t[27], A;
|
|
1225
|
-
}, pt = (e) => /* @__PURE__ */ m(Q, {
|
|
1226
|
-
sectionId: e.sectionId,
|
|
1227
|
-
node: e.node,
|
|
1228
|
-
level: e.level,
|
|
1229
|
-
expandedNodeIds: e.expandedNodeIds,
|
|
1230
|
-
activeNodeId: e.activeNodeId,
|
|
1231
|
-
rowVariant: e.rowVariant,
|
|
1232
|
-
nodeGap: e.nodeGap,
|
|
1233
|
-
linkComponent: e.linkComponent,
|
|
1234
|
-
onNavigate: e.onNavigate,
|
|
1235
|
-
onToggleNode: e.onToggleNode
|
|
1236
|
-
}), mt = (e) => {
|
|
1237
|
-
let t = f(15), n, r, i, a;
|
|
1238
|
-
if (t[0] !== e) {
|
|
1239
|
-
a = Symbol.for("react.early_return_sentinel");
|
|
1240
|
-
bb0: if ({row: i, indicator: n, ...r} = e, i.level > 0) {
|
|
1241
|
-
a = pt({
|
|
1242
|
-
node: i.node,
|
|
1243
|
-
sectionId: i.sectionId,
|
|
1244
|
-
level: i.level,
|
|
1245
|
-
...r
|
|
1246
|
-
});
|
|
1247
|
-
break bb0;
|
|
1248
|
-
}
|
|
1249
|
-
t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a;
|
|
1250
|
-
} else n = t[1], r = t[2], i = t[3], a = t[4];
|
|
1251
|
-
if (a !== Symbol.for("react.early_return_sentinel")) return a;
|
|
1252
|
-
let o = i.node.canReorder === !1, s;
|
|
1253
|
-
t[5] !== r || t[6] !== i.level || t[7] !== i.node || t[8] !== i.sectionId ? (s = () => pt({
|
|
1254
|
-
node: i.node,
|
|
1255
|
-
sectionId: i.sectionId,
|
|
1256
|
-
level: i.level,
|
|
1257
|
-
...r
|
|
1258
|
-
}), t[5] = r, t[6] = i.level, t[7] = i.node, t[8] = i.sectionId, t[9] = s) : s = t[9];
|
|
1259
|
-
let c;
|
|
1260
|
-
return t[10] !== n || t[11] !== i.node.id || t[12] !== o || t[13] !== s ? (c = /* @__PURE__ */ m(ut, {
|
|
1261
|
-
id: i.node.id,
|
|
1262
|
-
disabled: o,
|
|
1263
|
-
indicator: n,
|
|
1264
|
-
handle: "self",
|
|
1265
|
-
liftedBg: "bg.hover",
|
|
1266
|
-
children: s
|
|
1267
|
-
}), t[10] = n, t[11] = i.node.id, t[12] = o, t[13] = s, t[14] = c) : c = t[14], c;
|
|
1268
|
-
}, ht = (e) => {
|
|
1269
|
-
let t = f(42), n, r, i, a, o;
|
|
1270
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({sections: o, expandedSectionIds: r, expandedNodeIds: n, sectionGap: a, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o);
|
|
1271
|
-
let { active: s, over: c } = A(), [u, d] = S(null), p;
|
|
1272
|
-
t[6] === Symbol.for("react.memo_cache_sentinel") ? (p = {
|
|
1273
|
-
onDragMove: (e) => d(et(e.activatorEvent, e.delta.y)),
|
|
1274
|
-
onDragEnd: () => d(null),
|
|
1275
|
-
onDragCancel: () => d(null)
|
|
1276
|
-
}, t[6] = p) : p = t[6], j(p);
|
|
1277
|
-
let _;
|
|
1278
|
-
if (t[7] !== s || t[8] !== c || t[9] !== u || t[10] !== o) {
|
|
1279
|
-
let e = s && u !== null ? tt(String(s.id), c, u) : null;
|
|
1280
|
-
_ = st(o, e), t[7] = s, t[8] = c, t[9] = u, t[10] = o, t[11] = _;
|
|
1281
|
-
} else _ = t[11];
|
|
1282
|
-
let v = _, y, b, x, C, w, T, E, D, O;
|
|
1283
|
-
if (t[12] !== s || t[13] !== n || t[14] !== r || t[15] !== v || t[16] !== i || t[17] !== a || t[18] !== o) {
|
|
1284
|
-
let e = be(o, r, n);
|
|
1285
|
-
b = F, t[28] === o ? D = t[29] : (D = o.map(St), t[28] = o, t[29] = D), O = L, y = l, x = "0", C = "full", w = "0", T = "full", E = o.map((t, r) => /* @__PURE__ */ h(g, { children: [/* @__PURE__ */ m(ft, {
|
|
1286
|
-
section: t,
|
|
1287
|
-
sectionRows: e.filter((e) => e.sectionId === t.id),
|
|
1288
|
-
expandedNodeIds: n,
|
|
1289
|
-
rowVariant: i.rowVariant ?? "tree",
|
|
1290
|
-
nodeGap: i.nodeGap,
|
|
1291
|
-
activeNodeId: i.activeNodeId,
|
|
1292
|
-
linkComponent: i.linkComponent,
|
|
1293
|
-
onNavigate: i.onNavigate,
|
|
1294
|
-
onToggleSection: i.onToggleSection,
|
|
1295
|
-
onToggleNode: i.onToggleNode,
|
|
1296
|
-
onSectionContextMenu: i.onSectionContextMenu,
|
|
1297
|
-
indicator: v,
|
|
1298
|
-
dragging: !!s
|
|
1299
|
-
}), /* @__PURE__ */ m(dt, {
|
|
1300
|
-
sectionId: t.id,
|
|
1301
|
-
nextSectionId: o[r + 1]?.id,
|
|
1302
|
-
gap: a,
|
|
1303
|
-
indicator: v
|
|
1304
|
-
})] }, t.id)), t[12] = s, t[13] = n, t[14] = r, t[15] = v, t[16] = i, t[17] = a, t[18] = o, t[19] = y, t[20] = b, t[21] = x, t[22] = C, t[23] = w, t[24] = T, t[25] = E, t[26] = D, t[27] = O;
|
|
1305
|
-
} else y = t[19], b = t[20], x = t[21], C = t[22], w = t[23], T = t[24], E = t[25], D = t[26], O = t[27];
|
|
1306
|
-
let k;
|
|
1307
|
-
t[30] !== y || t[31] !== x || t[32] !== C || t[33] !== w || t[34] !== T || t[35] !== E ? (k = /* @__PURE__ */ m(y, {
|
|
1308
|
-
gap: x,
|
|
1309
|
-
w: C,
|
|
1310
|
-
minW: w,
|
|
1311
|
-
maxW: T,
|
|
1312
|
-
children: E
|
|
1313
|
-
}), t[30] = y, t[31] = x, t[32] = C, t[33] = w, t[34] = T, t[35] = E, t[36] = k) : k = t[36];
|
|
1314
|
-
let M;
|
|
1315
|
-
return t[37] !== b || t[38] !== D || t[39] !== O || t[40] !== k ? (M = /* @__PURE__ */ m(b, {
|
|
1316
|
-
items: D,
|
|
1317
|
-
strategy: O,
|
|
1318
|
-
children: k
|
|
1319
|
-
}), t[37] = b, t[38] = D, t[39] = O, t[40] = k, t[41] = M) : M = t[41], M;
|
|
1320
|
-
}, gt = (e) => {
|
|
1321
|
-
let t = f(33), { sections: n, expandedSectionIds: r, expandedNodeIds: i, activeNodeId: a, rowVariant: o, sectionGap: s, nodeGap: c, linkComponent: l, onNavigate: u, onToggleSection: d, onToggleNode: p, onSectionContextMenu: h, onReorderSections: g, onReorderNodes: _, canMove: y } = e, b;
|
|
1322
|
-
t[0] === r ? b = t[1] : (b = r === void 0 ? [] : r, t[0] = r, t[1] = b);
|
|
1323
|
-
let x = b, S;
|
|
1324
|
-
t[2] === i ? S = t[3] : (S = i === void 0 ? [] : i, t[2] = i, t[3] = S);
|
|
1325
|
-
let C = S, w = o === void 0 ? "tree" : o, E = s === void 0 ? "0" : s, O = c === void 0 ? "0" : c, k;
|
|
1326
|
-
t[4] === Symbol.for("react.memo_cache_sentinel") ? (k = { activationConstraint: { distance: 4 } }, t[4] = k) : k = t[4];
|
|
1327
|
-
let A = P(N(D, k)), j = v(it), M;
|
|
1328
|
-
t[5] !== y || t[6] !== n ? (M = $e(n, y), t[5] = y, t[6] = n, t[7] = M) : M = t[7];
|
|
1329
|
-
let F = M, I;
|
|
1330
|
-
t[8] === g ? I = t[9] : (I = (e) => g?.(e), t[8] = g, t[9] = I);
|
|
1331
|
-
let L;
|
|
1332
|
-
t[10] !== y || t[11] !== _ || t[12] !== n || t[13] !== I ? (L = rt({
|
|
1333
|
-
sections: n,
|
|
1334
|
-
canMove: y,
|
|
1335
|
-
onReorderSections: I,
|
|
1336
|
-
onReorderNodes: _
|
|
1337
|
-
}), t[10] = y, t[11] = _, t[12] = n, t[13] = I, t[14] = L) : L = t[14];
|
|
1338
|
-
let R = L, z;
|
|
1339
|
-
t[15] !== a || t[16] !== C || t[17] !== x || t[18] !== l || t[19] !== O || t[20] !== u || t[21] !== h || t[22] !== p || t[23] !== d || t[24] !== w || t[25] !== E || t[26] !== n ? (z = /* @__PURE__ */ m(ht, {
|
|
1340
|
-
sections: n,
|
|
1341
|
-
expandedSectionIds: x,
|
|
1342
|
-
expandedNodeIds: C,
|
|
1343
|
-
activeNodeId: a,
|
|
1344
|
-
rowVariant: w,
|
|
1345
|
-
sectionGap: E,
|
|
1346
|
-
nodeGap: O,
|
|
1347
|
-
linkComponent: l,
|
|
1348
|
-
onNavigate: u,
|
|
1349
|
-
onToggleSection: d,
|
|
1350
|
-
onToggleNode: p,
|
|
1351
|
-
onSectionContextMenu: h
|
|
1352
|
-
}), t[15] = a, t[16] = C, t[17] = x, t[18] = l, t[19] = O, t[20] = u, t[21] = h, t[22] = p, t[23] = d, t[24] = w, t[25] = E, t[26] = n, t[27] = z) : z = t[27];
|
|
1353
|
-
let B = z;
|
|
1354
|
-
if (j) return B;
|
|
1355
|
-
let V;
|
|
1356
|
-
return t[28] !== F || t[29] !== B || t[30] !== R || t[31] !== A ? (V = /* @__PURE__ */ m(T, {
|
|
1357
|
-
sensors: A,
|
|
1358
|
-
collisionDetection: F,
|
|
1359
|
-
onDragEnd: R,
|
|
1360
|
-
...qe,
|
|
1361
|
-
children: B
|
|
1362
|
-
}), t[28] = F, t[29] = B, t[30] = R, t[31] = A, t[32] = V) : V = t[32], V;
|
|
1363
|
-
};
|
|
1364
|
-
function _t(e) {
|
|
1365
|
-
return e.kind === "section-header";
|
|
1366
|
-
}
|
|
1367
|
-
function vt(e) {
|
|
1368
|
-
return e.kind === "node";
|
|
1369
|
-
}
|
|
1370
|
-
function yt(e) {
|
|
1371
|
-
return e.kind === "node" && e.level === 0;
|
|
1372
|
-
}
|
|
1373
|
-
function bt(e) {
|
|
1374
|
-
return e.kind === "node" ? e.node.id : "";
|
|
1375
|
-
}
|
|
1376
|
-
function xt() {}
|
|
1377
|
-
function St(e) {
|
|
1378
|
-
return Le(e.id);
|
|
1379
|
-
}
|
|
1380
|
-
//#endregion
|
|
1381
|
-
//#region src/components/tree-list/use-tree-list-keyboard-navigation.ts
|
|
1382
|
-
var Ct = (e, t) => e ? [...e.querySelectorAll("[data-tree-list-focus-id]")].find((e) => e.dataset.treeListFocusId === t) ?? null : null, wt = (e, t) => {
|
|
1383
|
-
if (e && t instanceof HTMLElement && e.contains(t)) return t.closest("[data-tree-list-focus-id]")?.dataset.treeListFocusId;
|
|
1384
|
-
}, Tt = (e) => e instanceof HTMLElement ? e.isContentEditable ? !0 : [
|
|
1385
|
-
"INPUT",
|
|
1386
|
-
"TEXTAREA",
|
|
1387
|
-
"SELECT"
|
|
1388
|
-
].includes(e.tagName) : !1, Et = (e, t) => e.findIndex((e) => xe(e) && X(e) === t), Dt = (e) => {
|
|
1389
|
-
let t = f(28), { rows: n, activeNodeId: r, expandedNodeIds: i, onToggleNode: a, onToggleSection: o, scrollToRow: s } = e, c = x(null), [l, u] = S(), [d, p] = S(), m;
|
|
1390
|
-
t[0] !== r || t[1] !== l || t[2] !== n ? (m = Ce(l, r, n), t[0] = r, t[1] = l, t[2] = n, t[3] = m) : m = t[3];
|
|
1391
|
-
let h = m, g;
|
|
1392
|
-
t[4] === n ? g = t[5] : (g = Se(n).map(X).join("\0"), t[4] = n, t[5] = g);
|
|
1393
|
-
let _ = g, v, b;
|
|
1394
|
-
t[6] !== _ || t[7] !== l ? (v = () => {
|
|
1395
|
-
l && (_.split("\0").includes(l) || u(void 0));
|
|
1396
|
-
}, b = [l, _], t[6] = _, t[7] = l, t[8] = v, t[9] = b) : (v = t[8], b = t[9]), y(v, b);
|
|
1397
|
-
let C, w;
|
|
1398
|
-
t[10] === d ? (C = t[11], w = t[12]) : (C = () => {
|
|
1399
|
-
if (!d) return;
|
|
1400
|
-
let e = requestAnimationFrame(() => {
|
|
1401
|
-
requestAnimationFrame(() => {
|
|
1402
|
-
let e = Ct(c.current, d);
|
|
1403
|
-
e && (e.focus(), p(void 0));
|
|
1404
|
-
});
|
|
1405
|
-
});
|
|
1406
|
-
return () => cancelAnimationFrame(e);
|
|
1407
|
-
}, w = [d], t[10] = d, t[11] = C, t[12] = w), y(C, w);
|
|
1408
|
-
let T;
|
|
1409
|
-
t[13] !== n || t[14] !== s ? (T = (e) => {
|
|
1410
|
-
u(e);
|
|
1411
|
-
let t = Ct(c.current, e);
|
|
1412
|
-
if (t) {
|
|
1413
|
-
t.focus();
|
|
1414
|
-
return;
|
|
1415
|
-
}
|
|
1416
|
-
let r = Et(n, e);
|
|
1417
|
-
r !== -1 && (s?.(r), p(e));
|
|
1418
|
-
}, t[13] = n, t[14] = s, t[15] = T) : T = t[15];
|
|
1419
|
-
let E = T, D;
|
|
1420
|
-
t[16] !== r || t[17] !== i || t[18] !== E || t[19] !== h || t[20] !== a || t[21] !== o || t[22] !== n ? (D = (e) => {
|
|
1421
|
-
if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey || Tt(e.target)) return;
|
|
1422
|
-
let t = Ee({
|
|
1423
|
-
rows: n,
|
|
1424
|
-
focusedRowId: wt(c.current, e.target) ?? h,
|
|
1425
|
-
activeNodeId: r,
|
|
1426
|
-
expandedNodeIds: i,
|
|
1427
|
-
key: e.key
|
|
1428
|
-
});
|
|
1429
|
-
if (t) {
|
|
1430
|
-
if (e.preventDefault(), t.type === "toggle-node") {
|
|
1431
|
-
a?.(t.nodeId);
|
|
1432
|
-
return;
|
|
1433
|
-
}
|
|
1434
|
-
if (t.type === "toggle-section") {
|
|
1435
|
-
o?.(t.sectionId);
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
E(t.rowId);
|
|
1439
|
-
}
|
|
1440
|
-
}, t[16] = r, t[17] = i, t[18] = E, t[19] = h, t[20] = a, t[21] = o, t[22] = n, t[23] = D) : D = t[23];
|
|
1441
|
-
let O = D, k;
|
|
1442
|
-
t[24] === Symbol.for("react.memo_cache_sentinel") ? (k = (e) => u(e), t[24] = k) : k = t[24];
|
|
1443
|
-
let A;
|
|
1444
|
-
return t[25] !== h || t[26] !== O ? (A = {
|
|
1445
|
-
focusRowId: h,
|
|
1446
|
-
rootRef: c,
|
|
1447
|
-
handleKeyDown: O,
|
|
1448
|
-
onRowFocus: k
|
|
1449
|
-
}, t[25] = h, t[26] = O, t[27] = A) : A = t[27], A;
|
|
1450
|
-
}, Ot = 32, kt = 4, At = (e) => {
|
|
1451
|
-
let { row: t, expandedNodeIds: n, activeNodeId: r, focusRowId: i, rowVariant: a, nodeGap: o, linkComponent: s, onRowFocus: c, onNavigate: l, onToggleSection: u, onToggleNode: d, onSectionContextMenu: f, onMoveNode: p } = e;
|
|
1452
|
-
return t.kind === "section-header" ? /* @__PURE__ */ m(Ne, {
|
|
1453
|
-
section: t.section,
|
|
1454
|
-
collapsible: t.collapsible,
|
|
1455
|
-
expanded: t.expanded,
|
|
1456
|
-
focusId: t.key,
|
|
1457
|
-
tabIndex: t.key === i ? 0 : -1,
|
|
1458
|
-
onFocus: () => c(t.key),
|
|
1459
|
-
onToggle: () => u?.(t.sectionId),
|
|
1460
|
-
onContextMenu: f
|
|
1461
|
-
}) : t.kind === "section-empty" ? t.emptyState ?? null : /* @__PURE__ */ m(Q, {
|
|
1462
|
-
sectionId: t.sectionId,
|
|
1463
|
-
node: t.node,
|
|
1464
|
-
level: t.level,
|
|
1465
|
-
expandedNodeIds: n,
|
|
1466
|
-
activeNodeId: r,
|
|
1467
|
-
rowVariant: a,
|
|
1468
|
-
nodeGap: o,
|
|
1469
|
-
linkComponent: s,
|
|
1470
|
-
tabIndex: t.node.id === i ? 0 : -1,
|
|
1471
|
-
onFocus: () => c(t.node.id),
|
|
1472
|
-
onNavigate: l,
|
|
1473
|
-
onToggleNode: d,
|
|
1474
|
-
onMoveNode: p
|
|
1475
|
-
});
|
|
1476
|
-
}, jt = (e) => {
|
|
1477
|
-
let { rows: t, expandedNodeIds: n = [], activeNodeId: i, rowVariant: a = "tree", nodeGap: o = "0", linkComponent: s, onNavigate: c, onToggleSection: l, onToggleNode: u, onSectionContextMenu: d, onMoveNode: f, scrollRef: p } = e, h = w({
|
|
1478
|
-
count: t.length,
|
|
1479
|
-
getScrollElement: () => p.current,
|
|
1480
|
-
estimateSize: () => Ot,
|
|
1481
|
-
overscan: kt,
|
|
1482
|
-
getItemKey: (e) => t[e]?.key ?? e
|
|
1483
|
-
}), g = Dt({
|
|
1484
|
-
rows: t,
|
|
1485
|
-
activeNodeId: i,
|
|
1486
|
-
expandedNodeIds: n,
|
|
1487
|
-
onToggleNode: u,
|
|
1488
|
-
onToggleSection: l,
|
|
1489
|
-
scrollToRow: (e) => h.scrollToIndex(e, { align: "auto" })
|
|
1490
|
-
});
|
|
1491
|
-
return /* @__PURE__ */ m(r, {
|
|
1492
|
-
ref: g.rootRef,
|
|
1493
|
-
role: "listbox",
|
|
1494
|
-
w: "full",
|
|
1495
|
-
minW: "0",
|
|
1496
|
-
maxW: "full",
|
|
1497
|
-
position: "relative",
|
|
1498
|
-
style: { height: h.getTotalSize() },
|
|
1499
|
-
onKeyDown: g.handleKeyDown,
|
|
1500
|
-
children: h.getVirtualItems().map((e) => {
|
|
1501
|
-
let p = t[e.index];
|
|
1502
|
-
return p ? /* @__PURE__ */ m(r, {
|
|
1503
|
-
ref: h.measureElement,
|
|
1504
|
-
"data-index": e.index,
|
|
1505
|
-
"data-tree-list-row": p.kind,
|
|
1506
|
-
position: "absolute",
|
|
1507
|
-
top: "0",
|
|
1508
|
-
left: "0",
|
|
1509
|
-
w: "full",
|
|
1510
|
-
pb: e.index === t.length - 1 ? "0" : o,
|
|
1511
|
-
style: { transform: `translateY(${e.start}px)` },
|
|
1512
|
-
children: At({
|
|
1513
|
-
row: p,
|
|
1514
|
-
expandedNodeIds: n,
|
|
1515
|
-
activeNodeId: i,
|
|
1516
|
-
focusRowId: g.focusRowId,
|
|
1517
|
-
rowVariant: a,
|
|
1518
|
-
nodeGap: o,
|
|
1519
|
-
linkComponent: s,
|
|
1520
|
-
onRowFocus: g.onRowFocus,
|
|
1521
|
-
onNavigate: c,
|
|
1522
|
-
onToggleSection: l,
|
|
1523
|
-
onToggleNode: u,
|
|
1524
|
-
onSectionContextMenu: d,
|
|
1525
|
-
onMoveNode: f
|
|
1526
|
-
})
|
|
1527
|
-
}, e.key) : null;
|
|
1528
|
-
})
|
|
1529
|
-
});
|
|
1530
|
-
}, Mt = (e) => {
|
|
1531
|
-
let { sections: t, expandedSectionIds: n = [], expandedNodeIds: i = [], activeNodeId: a, rowVariant: o = "tree", sectionGap: s = "0", nodeGap: c = "0", linkComponent: u, onNavigate: d, onToggleSection: f, onToggleNode: p, onSectionContextMenu: h, onMoveNode: g, virtualize: _, scrollRef: v } = e, y = be(t, n, i), b = Dt({
|
|
1532
|
-
rows: y,
|
|
1533
|
-
activeNodeId: a,
|
|
1534
|
-
expandedNodeIds: i,
|
|
1535
|
-
onToggleNode: p,
|
|
1536
|
-
onToggleSection: f
|
|
1537
|
-
});
|
|
1538
|
-
return _ && v ? /* @__PURE__ */ m(jt, {
|
|
1539
|
-
...e,
|
|
1540
|
-
rows: y,
|
|
1541
|
-
scrollRef: v
|
|
1542
|
-
}) : /* @__PURE__ */ m(l, {
|
|
1543
|
-
ref: b.rootRef,
|
|
1544
|
-
role: "listbox",
|
|
1545
|
-
gap: s,
|
|
1546
|
-
w: "full",
|
|
1547
|
-
minW: "0",
|
|
1548
|
-
maxW: "full",
|
|
1549
|
-
overflowX: "hidden",
|
|
1550
|
-
onKeyDown: b.handleKeyDown,
|
|
1551
|
-
children: t.map((e) => {
|
|
1552
|
-
let t = y.filter((t) => t.sectionId === e.id);
|
|
1553
|
-
return /* @__PURE__ */ m(l, {
|
|
1554
|
-
gap: c,
|
|
1555
|
-
w: "full",
|
|
1556
|
-
minW: "0",
|
|
1557
|
-
maxW: "full",
|
|
1558
|
-
"data-testid": `tree-list-section-${e.id}`,
|
|
1559
|
-
children: t.map((e) => /* @__PURE__ */ m(r, {
|
|
1560
|
-
w: "full",
|
|
1561
|
-
minW: "0",
|
|
1562
|
-
children: At({
|
|
1563
|
-
row: e,
|
|
1564
|
-
expandedNodeIds: i,
|
|
1565
|
-
activeNodeId: a,
|
|
1566
|
-
focusRowId: b.focusRowId,
|
|
1567
|
-
rowVariant: o,
|
|
1568
|
-
nodeGap: c,
|
|
1569
|
-
linkComponent: u,
|
|
1570
|
-
onRowFocus: b.onRowFocus,
|
|
1571
|
-
onNavigate: d,
|
|
1572
|
-
onToggleSection: f,
|
|
1573
|
-
onToggleNode: p,
|
|
1574
|
-
onSectionContextMenu: h,
|
|
1575
|
-
onMoveNode: g
|
|
1576
|
-
})
|
|
1577
|
-
}, e.key))
|
|
1578
|
-
}, e.id);
|
|
1579
|
-
})
|
|
1580
|
-
});
|
|
1581
|
-
}, Nt = (e) => {
|
|
1582
|
-
let t = f(8), n;
|
|
1583
|
-
t[0] === e ? n = t[1] : (n = e.draggable ? /* @__PURE__ */ m(gt, {
|
|
1584
|
-
sections: e.sections,
|
|
1585
|
-
expandedSectionIds: e.expandedSectionIds,
|
|
1586
|
-
expandedNodeIds: e.expandedNodeIds,
|
|
1587
|
-
activeNodeId: e.activeNodeId,
|
|
1588
|
-
rowVariant: e.rowVariant,
|
|
1589
|
-
sectionGap: e.sectionGap,
|
|
1590
|
-
nodeGap: e.nodeGap,
|
|
1591
|
-
linkComponent: e.linkComponent,
|
|
1592
|
-
onNavigate: e.onNavigate,
|
|
1593
|
-
onToggleSection: e.onToggleSection,
|
|
1594
|
-
onToggleNode: e.onToggleNode,
|
|
1595
|
-
onSectionContextMenu: e.onSectionContextMenu,
|
|
1596
|
-
onReorderSections: e.onReorderSections,
|
|
1597
|
-
onReorderNodes: e.onReorderNodes,
|
|
1598
|
-
canMove: e.canMove
|
|
1599
|
-
}) : /* @__PURE__ */ m(Mt, { ...e }), t[0] = e, t[1] = n);
|
|
1600
|
-
let r = n, i;
|
|
1601
|
-
t[2] !== r || t[3] !== e.onMoveNode ? (i = /* @__PURE__ */ m(Ae, {
|
|
1602
|
-
onMoveNode: e.onMoveNode,
|
|
1603
|
-
children: r
|
|
1604
|
-
}), t[2] = r, t[3] = e.onMoveNode, t[4] = i) : i = t[4];
|
|
1605
|
-
let a = i;
|
|
1606
|
-
if (!e.backgroundContextActions || e.backgroundContextActions.length === 0) return a;
|
|
1607
|
-
let o;
|
|
1608
|
-
return t[5] !== a || t[6] !== e.backgroundContextActions ? (o = /* @__PURE__ */ m(he, {
|
|
1609
|
-
actions: e.backgroundContextActions,
|
|
1610
|
-
children: a
|
|
1611
|
-
}), t[5] = a, t[6] = e.backgroundContextActions, t[7] = o) : o = t[7], o;
|
|
1612
|
-
};
|
|
1613
|
-
//#endregion
|
|
1614
|
-
export { at as n, fe as r, Nt as t };
|
|
1615
|
-
|
|
1616
|
-
//# sourceMappingURL=tree-list-BNZwjQZA.js.map
|