@synnaxlabs/pluto 0.27.0 → 0.28.2
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/{Animated-CqT7-gZp.js → Animated-C6We8oGt.js} +2 -2
- package/dist/{Animated-CZ63NC05.cjs → Animated-CPJOHwpl.cjs} +1 -1
- package/dist/{Keyboard-BIXxwSvF.cjs → Keyboard-Dw9MQvaJ.cjs} +1 -1
- package/dist/{Keyboard-fZbH7UAB.js → Keyboard-fQ7JpUW9.js} +2 -2
- package/dist/{LinePlot-Cc3CIgai.js → LinePlot-CS2iDNHW.js} +1839 -1840
- package/dist/{LinePlot-C6UR06-e.cjs → LinePlot-DNgFi7SV.cjs} +9 -9
- package/dist/{Link-BDA_zOS7.js → Link-2gkxmnh_.js} +1 -1
- package/dist/{Link-CYHWDE13.cjs → Link-hLjXIZ1T.cjs} +1 -1
- package/dist/List-B60FZ4Be.js +22 -0
- package/dist/List-Ce67Og-K.cjs +1 -0
- package/dist/Pack-BNnq0Pnk.cjs +1 -0
- package/dist/Pack-CcDPYCmE.js +132 -0
- package/dist/{Toggle-DBbZoe_A.cjs → Toggle-GfklnU2t.cjs} +39 -39
- package/dist/{Toggle-0_fgC0fe.js → Toggle-Q3wJPeGh.js} +6752 -6724
- package/dist/{Video-Breqk8IV.js → Video-CA6Au-LV.js} +1 -1
- package/dist/{Video-yUL4iEVD.cjs → Video-Ch_mMn__.cjs} +1 -1
- package/dist/aggregator-C5NNOlCt.cjs +57 -0
- package/dist/{aggregator-BQAqJzjZ.js → aggregator-J7DZKy5x.js} +2445 -2233
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/{css-Dic6npsA.js → css-BHfxGWOW.js} +1 -1
- package/dist/{css-B7TifAVb.cjs → css-C4GOlJsi.cjs} +1 -1
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +5 -5
- package/dist/{external-BWE1zUh9.js → external-2nFcIpzY.js} +11 -11
- package/dist/external-5YOxaVIG.js +259 -0
- package/dist/external-B0OT9sXv.js +127 -0
- package/dist/{external-DrJrhKqG.cjs → external-BCVvWczs.cjs} +1 -1
- package/dist/{external-o0TYQr9r.cjs → external-BRvjJOyT.cjs} +1 -1
- package/dist/external-BS_kvhV-.cjs +1 -0
- package/dist/{external-DR0u7Ium.cjs → external-BU8-3fqq.cjs} +1 -1
- package/dist/external-C1Pb6QsR.cjs +1 -0
- package/dist/{external-CVzm1emB.js → external-C6Z7BnOm.js} +4 -4
- package/dist/{external-69Ao7j7k.js → external-C6mP_Zl1.js} +10 -10
- package/dist/{external-DddErJ4X.cjs → external-CRCXQIg6.cjs} +1 -1
- package/dist/{external-BjLjce7d.js → external-CVJXZvQB.js} +2 -2
- package/dist/{external-By-puR46.js → external-C_sBb_mC.js} +3 -3
- package/dist/{external-C3c1BoRE.cjs → external-Cly1pTAH.cjs} +1 -1
- package/dist/{external-B4OSNdH_.cjs → external-CqxHdgvr.cjs} +1 -1
- package/dist/{external-DH3sAQ0c.js → external-Cv1PHg1z.js} +1 -1
- package/dist/{external-DA_ZnqPs.js → external-CvQxCzBO.js} +110 -107
- package/dist/{external-CNTzwgmW.js → external-CvWOg3Wh.js} +6 -6
- package/dist/{external-mBw4Opva.cjs → external-DLWdjzgl.cjs} +1 -1
- package/dist/{external-CpUUO6Ja.cjs → external-DfXrhUoK.cjs} +1 -1
- package/dist/{external-CPUf0VYV.js → external-QN9xgtCT.js} +2 -2
- package/dist/{external-DeMvP0U_.js → external-UQ_KRv4U.js} +5 -5
- package/dist/external-Xze9tWIL.cjs +1 -0
- package/dist/{external-CHYxZzhb.cjs → external-bcUzt2-X.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3541 -3440
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/aether/main.d.ts.map +1 -1
- package/dist/src/alamos/aether/alamos.d.ts +4 -4
- package/dist/src/align/Pack.d.ts +2 -0
- package/dist/src/align/Pack.d.ts.map +1 -1
- package/dist/src/align/Space.d.ts +2 -0
- package/dist/src/align/Space.d.ts.map +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +31 -0
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -0
- package/dist/src/breadcrumb/index.d.ts +2 -0
- package/dist/src/breadcrumb/index.d.ts.map +1 -0
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/css/css.d.ts +1 -0
- package/dist/src/css/css.d.ts.map +1 -1
- package/dist/src/dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/form/Field.d.ts +5 -1
- package/dist/src/form/Field.d.ts.map +1 -1
- package/dist/src/form/Form.d.ts +17 -6
- package/dist/src/form/Form.d.ts.map +1 -1
- package/dist/src/header/Header.d.ts +0 -4
- package/dist/src/header/Header.d.ts.map +1 -1
- package/dist/src/icon/Icon.d.ts +3 -0
- package/dist/src/icon/Icon.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/DateTime.d.ts +2 -1
- package/dist/src/input/DateTime.d.ts.map +1 -1
- package/dist/src/input/Numeric.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts +0 -3
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/input/types.d.ts +3 -1
- package/dist/src/input/types.d.ts.map +1 -1
- package/dist/src/list/Core.d.ts +1 -1
- package/dist/src/list/Core.d.ts.map +1 -1
- package/dist/src/list/Search.d.ts.map +1 -1
- package/dist/src/mosaic/tree.d.ts.map +1 -1
- package/dist/src/observe/use.d.ts.map +1 -1
- package/dist/src/ranger/TimeRangeChip.d.ts +2 -1
- package/dist/src/ranger/TimeRangeChip.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +3 -2
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/List.d.ts.map +1 -1
- package/dist/src/synnax/Provider.d.ts +1 -0
- package/dist/src/synnax/Provider.d.ts.map +1 -1
- package/dist/src/synnax/aether/provider.d.ts +45 -0
- package/dist/src/synnax/aether/provider.d.ts.map +1 -1
- package/dist/src/tag/Tag.d.ts +1 -1
- package/dist/src/tag/Tag.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts +2 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/text/core/types.d.ts +2 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +148 -147
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/tree/Tree.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/Diagram.d.ts +12 -12
- package/dist/src/vis/lineplot/Axis.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/LinePlot.d.ts +8 -8
- package/dist/src/vis/lineplot/range/aether/provider.d.ts +4 -4
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-Bq69s424.cjs → units-CKv8dczK.cjs} +1 -1
- package/dist/{units-BynnjwvA.js → units-t-SdMRna.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +7 -7
- package/dist/List-DS2DLWjR.js +0 -22
- package/dist/List-qhbpsD-f.cjs +0 -1
- package/dist/Pack--3w90epp.cjs +0 -1
- package/dist/Pack-B7_4Xpi5.js +0 -125
- package/dist/aggregator-Bs9fTewE.cjs +0 -51
- package/dist/external-3Q2dzLIL.cjs +0 -1
- package/dist/external-BUFyYRiR.js +0 -129
- package/dist/external-BnJhvG1t.cjs +0 -1
- package/dist/external-CAS1RuN6.cjs +0 -1
- package/dist/external-vJteyGA3.js +0 -241
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { y as re, A as H, e as se, n as ae } from "./aggregator-J7DZKy5x.js";
|
|
2
2
|
import { j as N } from "./jsx-runtime-B6kdoens.js";
|
|
3
|
-
import { v as
|
|
4
|
-
import { memo as
|
|
5
|
-
import { L as
|
|
6
|
-
import { A as
|
|
7
|
-
import { C as u } from "./css-
|
|
8
|
-
import "./Pack-
|
|
9
|
-
import { L as _e } from "./List-
|
|
10
|
-
const
|
|
11
|
-
t && e.sort((n, s) =>
|
|
3
|
+
import { v as le, w as oe, e as ie, n as ce, q as de, C as fe, M as ue, x as he, y as pe, z as me, B as ge, A as X, E as xe, F as ye, G as Ce, H as Ee } from "./Toggle-Q3wJPeGh.js";
|
|
4
|
+
import { memo as Ne, useState as be, useCallback as b, useMemo as ve } from "react";
|
|
5
|
+
import { L as Te } from "./Link-2gkxmnh_.js";
|
|
6
|
+
import { A as Se } from "./Animated-C6We8oGt.js";
|
|
7
|
+
import { C as u } from "./css-BHfxGWOW.js";
|
|
8
|
+
import "./Pack-CcDPYCmE.js";
|
|
9
|
+
import { L as _e } from "./List-B60FZ4Be.js";
|
|
10
|
+
const Y = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
11
|
+
t && e.sort((n, s) => re.stringsWithNumbers(n.name, s.name));
|
|
12
12
|
let r = !1;
|
|
13
13
|
for (let n = 0; n < e.length; n++) {
|
|
14
14
|
const s = e[n];
|
|
@@ -21,18 +21,18 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
21
21
|
depth: r = 0,
|
|
22
22
|
sort: n = !0
|
|
23
23
|
}) => {
|
|
24
|
-
r === 0 && n && (e = e.sort((a,
|
|
24
|
+
r === 0 && n && (e = e.sort((a, o) => a.name.localeCompare(o.name)));
|
|
25
25
|
const s = [];
|
|
26
|
-
return e.forEach((a,
|
|
27
|
-
const i =
|
|
28
|
-
s.push({ ...a, depth: r, expanded: i, index:
|
|
26
|
+
return e.forEach((a, o) => {
|
|
27
|
+
const i = Y(a, t);
|
|
28
|
+
s.push({ ...a, depth: r, expanded: i, index: o }), i && a.children != null && (a.children = k(a.children, n), s.push(
|
|
29
29
|
...G({ nodes: a.children, expanded: t, depth: r + 1, sort: n })
|
|
30
30
|
));
|
|
31
31
|
}), s;
|
|
32
|
-
},
|
|
32
|
+
}, we = ({ tree: e, destination: t, keys: r }) => (r = H(r), r.forEach((n) => {
|
|
33
33
|
const s = v({ tree: e, key: n });
|
|
34
|
-
s != null && (
|
|
35
|
-
}), e),
|
|
34
|
+
s != null && (q({ tree: e, keys: n }), V({ tree: e, destination: t, additions: s }));
|
|
35
|
+
}), e), q = ({ tree: e, keys: t }) => {
|
|
36
36
|
t = H(t);
|
|
37
37
|
const r = e.map((n) => n.key);
|
|
38
38
|
return t.forEach((n) => {
|
|
@@ -40,11 +40,11 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
40
40
|
const s = r.indexOf(n);
|
|
41
41
|
if (s !== -1) e.splice(s, 1);
|
|
42
42
|
else {
|
|
43
|
-
const
|
|
44
|
-
|
|
43
|
+
const o = $({ tree: e, key: n });
|
|
44
|
+
o != null && (o.children = (a = o.children) == null ? void 0 : a.filter((i) => i.key !== n));
|
|
45
45
|
}
|
|
46
46
|
}), e;
|
|
47
|
-
},
|
|
47
|
+
}, V = ({ tree: e, destination: t, additions: r }) => {
|
|
48
48
|
r = H(r);
|
|
49
49
|
const n = v({ tree: e, key: t });
|
|
50
50
|
if (n == null) throw new Error(`Could not find node with key ${t}`);
|
|
@@ -54,13 +54,13 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
54
54
|
...r,
|
|
55
55
|
...n.children.filter((a) => !s.includes(a.key))
|
|
56
56
|
], e;
|
|
57
|
-
},
|
|
57
|
+
}, Ie = ({
|
|
58
58
|
tree: e,
|
|
59
59
|
key: t,
|
|
60
60
|
updater: r,
|
|
61
61
|
throwOnMissing: n = !0
|
|
62
62
|
}) => {
|
|
63
|
-
var
|
|
63
|
+
var o, i;
|
|
64
64
|
const s = v({ tree: e, key: t });
|
|
65
65
|
if (s == null) {
|
|
66
66
|
if (n) throw new Error(`Could not find node with key ${t}`);
|
|
@@ -68,16 +68,16 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
68
68
|
}
|
|
69
69
|
const a = $({ tree: e, key: t });
|
|
70
70
|
if (a != null) {
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const l = (o = a.children) == null ? void 0 : o.findIndex((x) => x.key === t);
|
|
72
|
+
l != null && l !== -1 && ((i = a.children) == null || i.splice(l, 1, r(s)));
|
|
73
73
|
} else
|
|
74
74
|
e.splice(
|
|
75
|
-
e.findIndex((
|
|
75
|
+
e.findIndex((l) => l.key === t),
|
|
76
76
|
1,
|
|
77
77
|
r(s)
|
|
78
78
|
);
|
|
79
79
|
return e;
|
|
80
|
-
},
|
|
80
|
+
}, Le = ({
|
|
81
81
|
tree: e,
|
|
82
82
|
parent: t,
|
|
83
83
|
updater: r,
|
|
@@ -106,7 +106,7 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
return null;
|
|
109
|
-
},
|
|
109
|
+
}, je = ({ tree: e, keys: t }) => {
|
|
110
110
|
const r = [];
|
|
111
111
|
for (const n of t) {
|
|
112
112
|
const s = v({ tree: e, key: n });
|
|
@@ -121,54 +121,54 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
121
121
|
if (n != null) return n;
|
|
122
122
|
}
|
|
123
123
|
return null;
|
|
124
|
-
},
|
|
124
|
+
}, J = (e) => e.map((t) => ({ ...t, children: J(t.children ?? []) })), Q = (...e) => {
|
|
125
125
|
const t = [];
|
|
126
126
|
return e.forEach((r) => {
|
|
127
|
-
t.push(r), r.children != null && t.push(...
|
|
127
|
+
t.push(r), r.children != null && t.push(...Q(...r.children));
|
|
128
128
|
}), t;
|
|
129
|
-
},
|
|
129
|
+
}, M = "tree-item", Pe = [["Shift"]], Re = (e) => {
|
|
130
130
|
const {
|
|
131
131
|
onExpand: t,
|
|
132
132
|
nodes: r,
|
|
133
133
|
initialExpanded: n = [],
|
|
134
134
|
sort: s = !0,
|
|
135
135
|
selected: a,
|
|
136
|
-
onSelectedChange:
|
|
137
|
-
} = e ?? {}, [i,
|
|
136
|
+
onSelectedChange: o
|
|
137
|
+
} = e ?? {}, [i, l, x] = he(n), [c, T] = se({
|
|
138
138
|
initial: [],
|
|
139
139
|
value: a,
|
|
140
|
-
onChange:
|
|
141
|
-
}),
|
|
140
|
+
onChange: o
|
|
141
|
+
}), S = ve(() => G({ nodes: r, expanded: i, sort: s }), [r, i, s]), _ = pe(S), L = me({ triggers: Pe }), R = b(
|
|
142
142
|
(f, { clicked: d }) => {
|
|
143
143
|
T(f);
|
|
144
|
-
const g =
|
|
145
|
-
if ((g == null ? void 0 : g.hasChildren) === !1 || d == null ||
|
|
144
|
+
const g = _.current.find((E) => E.key === d);
|
|
145
|
+
if ((g == null ? void 0 : g.hasChildren) === !1 || d == null || L.current.held) return;
|
|
146
146
|
const y = x.current, I = y.some((E) => E === d) ? "contract" : "expand";
|
|
147
147
|
let C = y;
|
|
148
|
-
I === "contract" ? C = y.filter((E) => E !== d) : C = [...y, d],
|
|
148
|
+
I === "contract" ? C = y.filter((E) => E !== d) : C = [...y, d], l(C), t == null || t({ current: C, action: I, clicked: d });
|
|
149
149
|
},
|
|
150
|
-
[t,
|
|
150
|
+
[t, _, l, T]
|
|
151
151
|
), h = b(
|
|
152
152
|
(f) => {
|
|
153
|
-
|
|
153
|
+
l((d) => ae([...d, f])), t == null || t({ current: i, action: "expand", clicked: f });
|
|
154
154
|
},
|
|
155
|
-
[
|
|
156
|
-
),
|
|
155
|
+
[l]
|
|
156
|
+
), j = b(
|
|
157
157
|
(f) => {
|
|
158
|
-
|
|
158
|
+
l((d) => d.filter((g) => g !== f)), t == null || t({ current: i, action: "contract", clicked: f });
|
|
159
159
|
},
|
|
160
|
-
[
|
|
161
|
-
), w = b(() =>
|
|
160
|
+
[l]
|
|
161
|
+
), w = b(() => l([]), [l]);
|
|
162
162
|
return {
|
|
163
163
|
onSelect: R,
|
|
164
164
|
selected: c,
|
|
165
165
|
expanded: i,
|
|
166
|
-
contract:
|
|
166
|
+
contract: j,
|
|
167
167
|
expand: h,
|
|
168
|
-
nodes:
|
|
168
|
+
nodes: S,
|
|
169
169
|
clearExpanded: w
|
|
170
170
|
};
|
|
171
|
-
}, K =
|
|
171
|
+
}, K = Ne(
|
|
172
172
|
({
|
|
173
173
|
entry: e,
|
|
174
174
|
selected: t,
|
|
@@ -176,79 +176,82 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
176
176
|
onDrop: n,
|
|
177
177
|
onRename: s,
|
|
178
178
|
onSuccessfulDrop: a,
|
|
179
|
-
onDoubleClick:
|
|
179
|
+
onDoubleClick: o,
|
|
180
180
|
loading: i = !1,
|
|
181
|
-
useMargin:
|
|
181
|
+
useMargin: l = !0,
|
|
182
182
|
translate: x
|
|
183
183
|
}) => {
|
|
184
184
|
const {
|
|
185
185
|
key: c,
|
|
186
186
|
hasChildren: T = !1,
|
|
187
|
-
allowRename:
|
|
188
|
-
children:
|
|
189
|
-
icon:
|
|
187
|
+
allowRename: S = !1,
|
|
188
|
+
children: _,
|
|
189
|
+
icon: L,
|
|
190
190
|
name: R,
|
|
191
191
|
depth: h,
|
|
192
|
-
expanded:
|
|
192
|
+
expanded: j,
|
|
193
193
|
href: w,
|
|
194
194
|
haulItems: f = []
|
|
195
|
-
} = e, { getSelected: d } =
|
|
195
|
+
} = e, { getSelected: d } = le(), { getSourceData: g } = oe(), y = T || _ != null && _.length > 0, I = [];
|
|
196
196
|
y && I.push(
|
|
197
|
-
/* @__PURE__ */ N.jsx(
|
|
198
|
-
),
|
|
197
|
+
/* @__PURE__ */ N.jsx(Se, { enabled: j, enabledLoc: "bottom", disabledLoc: "right" })
|
|
198
|
+
), L != null && I.push(L);
|
|
199
199
|
const C = [];
|
|
200
|
-
i && C.push(/* @__PURE__ */ N.jsx(
|
|
201
|
-
const [E, A] =
|
|
200
|
+
i && C.push(/* @__PURE__ */ N.jsx(ie.Loading, { className: u.B("loading-indicator") }));
|
|
201
|
+
const [E, A] = be(!1), { startDrag: U, ...Z } = ce({
|
|
202
202
|
type: "Tree.Item",
|
|
203
203
|
key: c,
|
|
204
|
-
canDrop: b(({ items: p, source:
|
|
204
|
+
canDrop: b(({ items: p, source: O }) => {
|
|
205
205
|
const m = p.map((P) => P.key);
|
|
206
|
-
return A(!1),
|
|
206
|
+
return A(!1), O.type === "Tree.Item" && !m.includes(c);
|
|
207
207
|
}, []),
|
|
208
208
|
onDrop: b((p) => (n == null ? void 0 : n(c, p)) ?? [], [c, n]),
|
|
209
209
|
onDragOver: b(() => A(!0), [])
|
|
210
|
-
}),
|
|
211
|
-
const p = d(),
|
|
210
|
+
}), D = () => {
|
|
211
|
+
const p = d(), O = g().filter(
|
|
212
212
|
(m) => p.includes(m.key)
|
|
213
213
|
);
|
|
214
214
|
if (p.includes(c)) {
|
|
215
|
-
const m =
|
|
216
|
-
{ type:
|
|
217
|
-
...(
|
|
218
|
-
...
|
|
219
|
-
data: { ...
|
|
215
|
+
const m = O.map(({ key: P, haulItems: B, depth: F }) => [
|
|
216
|
+
{ type: M, key: P, data: { depth: F } },
|
|
217
|
+
...(B == null ? void 0 : B.map((W) => ({
|
|
218
|
+
...W,
|
|
219
|
+
data: { ...W.data, depth: F }
|
|
220
220
|
}))) ?? []
|
|
221
221
|
]).flat();
|
|
222
222
|
return U(m, (P) => a == null ? void 0 : a(c, P));
|
|
223
223
|
}
|
|
224
224
|
U(
|
|
225
225
|
[
|
|
226
|
-
{ type:
|
|
226
|
+
{ type: M, key: c, data: { depth: h } },
|
|
227
227
|
...f.map((m) => ({ ...m, data: { ...m.data, depth: h } }))
|
|
228
228
|
],
|
|
229
229
|
(m) => a == null ? void 0 : a(c, m)
|
|
230
230
|
);
|
|
231
|
-
},
|
|
231
|
+
}, ee = l ? "marginLeft" : "paddingLeft";
|
|
232
|
+
let z = h * 2 + 1;
|
|
233
|
+
y && l && (z -= 1);
|
|
234
|
+
const te = {
|
|
232
235
|
id: c,
|
|
233
236
|
variant: "text",
|
|
234
237
|
draggable: f.length > 0,
|
|
235
238
|
className: u(
|
|
236
239
|
u.BE("list", "item"),
|
|
237
|
-
|
|
240
|
+
de,
|
|
238
241
|
E && u.M("dragging-over"),
|
|
239
|
-
t &&
|
|
242
|
+
t && fe,
|
|
240
243
|
u.selected(t),
|
|
241
244
|
y && u.M("has-children"),
|
|
242
245
|
u.BM("depth", h.toString())
|
|
243
246
|
),
|
|
244
247
|
onDragLeave: () => A(!1),
|
|
245
|
-
onDragStart:
|
|
248
|
+
onDragStart: D,
|
|
246
249
|
onClick: () => r == null ? void 0 : r(c),
|
|
247
250
|
style: {
|
|
248
251
|
border: "none",
|
|
249
252
|
position: x != null ? "absolute" : "relative",
|
|
250
253
|
transform: `translateY(${x}px)`,
|
|
251
|
-
[
|
|
254
|
+
[ee]: `${z}rem`,
|
|
252
255
|
// @ts-expect-error - CSS variable
|
|
253
256
|
"--pluto-tree-indicator-offset": `${h * 1.5 + (h === 0 ? 0 : 0.5)}rem`
|
|
254
257
|
},
|
|
@@ -256,48 +259,48 @@ const X = (e, t) => t.includes(e.key), k = (e, t) => {
|
|
|
256
259
|
iconSpacing: "small",
|
|
257
260
|
noWrap: !0,
|
|
258
261
|
endIcon: C,
|
|
259
|
-
onDoubleClick: (p) =>
|
|
262
|
+
onDoubleClick: (p) => o == null ? void 0 : o(c, p),
|
|
260
263
|
href: w,
|
|
261
|
-
...
|
|
262
|
-
},
|
|
263
|
-
return /* @__PURE__ */ N.jsx(
|
|
264
|
-
|
|
264
|
+
...Z
|
|
265
|
+
}, ne = w != null ? Te : ge;
|
|
266
|
+
return /* @__PURE__ */ N.jsx(ne, { className: u.BE("list", "item"), ...te, children: /* @__PURE__ */ N.jsx(
|
|
267
|
+
ue,
|
|
265
268
|
{
|
|
266
269
|
id: `text-${c}`,
|
|
267
270
|
level: "p",
|
|
268
271
|
allowDoubleClick: !1,
|
|
269
272
|
value: R,
|
|
270
|
-
disabled: !
|
|
273
|
+
disabled: !S,
|
|
271
274
|
onChange: (p) => s == null ? void 0 : s(c, p)
|
|
272
275
|
}
|
|
273
276
|
) });
|
|
274
277
|
}
|
|
275
278
|
);
|
|
276
279
|
K.displayName = "Tree.Item";
|
|
277
|
-
const
|
|
280
|
+
const $e = Ee(K), Ae = ({
|
|
278
281
|
nodes: e,
|
|
279
282
|
selected: t = [],
|
|
280
283
|
onSelect: r,
|
|
281
284
|
onDrop: n,
|
|
282
285
|
onRename: s,
|
|
283
286
|
onSuccessfulDrop: a,
|
|
284
|
-
onDoubleClick:
|
|
287
|
+
onDoubleClick: o,
|
|
285
288
|
className: i,
|
|
286
|
-
children:
|
|
289
|
+
children: l = $e,
|
|
287
290
|
itemHeight: x = 27,
|
|
288
291
|
useMargin: c = !1,
|
|
289
292
|
showRules: T = !1,
|
|
290
|
-
virtual:
|
|
291
|
-
clearExpanded:
|
|
292
|
-
expand:
|
|
293
|
+
virtual: S = !0,
|
|
294
|
+
clearExpanded: _,
|
|
295
|
+
expand: L,
|
|
293
296
|
contract: R,
|
|
294
297
|
emptyContent: h,
|
|
295
|
-
loading:
|
|
298
|
+
loading: j,
|
|
296
299
|
...w
|
|
297
300
|
}) => {
|
|
298
|
-
const f =
|
|
301
|
+
const f = S ? X.Virtual : X;
|
|
299
302
|
return /* @__PURE__ */ N.jsx(_e, { data: e, emptyContent: h, children: /* @__PURE__ */ N.jsx(
|
|
300
|
-
|
|
303
|
+
xe,
|
|
301
304
|
{
|
|
302
305
|
value: t,
|
|
303
306
|
onChange: r,
|
|
@@ -309,42 +312,42 @@ const Re = Ce(K), $e = ({
|
|
|
309
312
|
itemHeight: x,
|
|
310
313
|
className: u(i, u.B("tree"), T && u.M("rules")),
|
|
311
314
|
...w,
|
|
312
|
-
children: ({ key: d, ...g }) =>
|
|
315
|
+
children: ({ key: d, ...g }) => l({
|
|
313
316
|
...g,
|
|
314
317
|
key: d,
|
|
315
|
-
loading:
|
|
318
|
+
loading: j === d,
|
|
316
319
|
useMargin: c,
|
|
317
320
|
onDrop: n,
|
|
318
321
|
onRename: s,
|
|
319
322
|
onSuccessfulDrop: a,
|
|
320
|
-
onDoubleClick:
|
|
323
|
+
onDoubleClick: o
|
|
321
324
|
})
|
|
322
325
|
}
|
|
323
326
|
)
|
|
324
327
|
}
|
|
325
328
|
) });
|
|
326
|
-
},
|
|
329
|
+
}, Oe = (e, t) => ye(`text-${e}`, t), Be = (e) => Ce(`text-${e}`), Xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
327
330
|
__proto__: null,
|
|
328
331
|
DefaultItem: K,
|
|
329
|
-
HAUL_TYPE:
|
|
330
|
-
Tree:
|
|
331
|
-
asyncRename:
|
|
332
|
-
deepCopy:
|
|
332
|
+
HAUL_TYPE: M,
|
|
333
|
+
Tree: Ae,
|
|
334
|
+
asyncRename: Be,
|
|
335
|
+
deepCopy: J,
|
|
333
336
|
findNode: v,
|
|
334
337
|
findNodeParent: $,
|
|
335
|
-
findNodes:
|
|
338
|
+
findNodes: je,
|
|
336
339
|
flatten: G,
|
|
337
|
-
getDescendants:
|
|
338
|
-
moveNode:
|
|
339
|
-
removeNode:
|
|
340
|
-
setNode:
|
|
341
|
-
shouldExpand:
|
|
340
|
+
getDescendants: Q,
|
|
341
|
+
moveNode: we,
|
|
342
|
+
removeNode: q,
|
|
343
|
+
setNode: V,
|
|
344
|
+
shouldExpand: Y,
|
|
342
345
|
sortAndSplice: k,
|
|
343
|
-
startRenaming:
|
|
344
|
-
updateNode:
|
|
345
|
-
updateNodeChildren:
|
|
346
|
-
use:
|
|
346
|
+
startRenaming: Oe,
|
|
347
|
+
updateNode: Ie,
|
|
348
|
+
updateNodeChildren: Le,
|
|
349
|
+
use: Re
|
|
347
350
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
348
351
|
export {
|
|
349
|
-
|
|
352
|
+
Xe as e
|
|
350
353
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { y as
|
|
2
|
+
import { y as S, I as _, e as k, W as M, f as L, Q as O } from "./Toggle-Q3wJPeGh.js";
|
|
3
3
|
import { createContext as R, useCallback as v, useContext as Z } from "react";
|
|
4
|
-
import { S as P, P as z } from "./Pack-
|
|
5
|
-
import { C as c, g as A } from "./css-
|
|
6
|
-
import { j as Q, C as q } from "./aggregator-
|
|
4
|
+
import { S as P, P as z } from "./Pack-CcDPYCmE.js";
|
|
5
|
+
import { C as c, g as A } from "./css-BHfxGWOW.js";
|
|
6
|
+
import { j as Q, C as q } from "./aggregator-J7DZKy5x.js";
|
|
7
7
|
import { z as p } from "zod";
|
|
8
8
|
const F = (l = "", s = []) => {
|
|
9
9
|
var n;
|
|
@@ -24,7 +24,7 @@ const F = (l = "", s = []) => {
|
|
|
24
24
|
initial: n ?? ((u = l[0]) == null ? void 0 : u.tabKey) ?? "",
|
|
25
25
|
value: n,
|
|
26
26
|
onChange: t
|
|
27
|
-
}), a =
|
|
27
|
+
}), a = S(n ?? e), i = v(
|
|
28
28
|
(d) => {
|
|
29
29
|
r(d), a.current == null && (t == null || t(d));
|
|
30
30
|
},
|
|
@@ -231,7 +231,7 @@ const F = (l = "", s = []) => {
|
|
|
231
231
|
icon: t,
|
|
232
232
|
editable: e = !0,
|
|
233
233
|
...r
|
|
234
|
-
}) => l == null || !e ? t != null ? /* @__PURE__ */ o.jsx(
|
|
234
|
+
}) => l == null || !e ? t != null ? /* @__PURE__ */ o.jsx(M, { startIcon: t, noWrap: !0, ...r, children: s }) : /* @__PURE__ */ o.jsx(L, { noWrap: !0, ...r, children: s }) : /* @__PURE__ */ o.jsx(
|
|
235
235
|
O,
|
|
236
236
|
{
|
|
237
237
|
onChange: (a) => l(n, a),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("./jsx-runtime-Cek9Ww4S.cjs"),d=require("./Toggle-
|
|
1
|
+
"use strict";const o=require("./jsx-runtime-Cek9Ww4S.cjs"),d=require("./Toggle-GfklnU2t.cjs"),S=require("react"),g=require("./Pack-BNnq0Pnk.cjs"),u=require("./css-C4GOlJsi.cjs"),z=require("./aggregator-C5NNOlCt.cjs"),m=require("zod"),T=(l="",s=[])=>{var t;if(s.length!==0)return s.find(n=>n.tabKey===l)!=null?l:(t=s[s.length-1])==null?void 0:t.tabKey},q=(l,s,t)=>{if(s=s.trim(),s.length===0)return t;const n=t.find(e=>e.tabKey===l);return n==null||n.name===s?t:t.map(e=>e.tabKey===l?{...e,name:s}:e)},y=({tabs:l,content:s,selected:t,onSelect:n})=>{var a;const[e,r]=z.usePurePassthrough({initial:t??((a=l[0])==null?void 0:a.tabKey)??"",value:t,onChange:n}),c=d.useSyncedRef(t??e),i=S.useCallback(x=>{r(x),c.current==null&&(n==null||n(x))},[e,n]);return{tabs:l,selected:e,content:s,onSelect:i}},k=S.createContext({tabs:[]}),B=()=>S.useContext(k),N=({id:l,content:s,children:t,onSelect:n,selected:e,selectedAltColor:r,closable:c,tabs:i,onClose:a,onDragStart:x,onDragEnd:h,onCreate:C,onRename:E,emptyContent:R,className:b,onDragOver:p,onDrop:v,size:j="medium",direction:P="y",...M})=>o.jsxRuntimeExports.jsx(g.Space,{id:l,empty:!0,className:u.CSS(u.CSS.B("tabs"),b),onDragOver:p,onDrop:v,direction:P,...M,children:o.jsxRuntimeExports.jsxs(k.Provider,{value:{tabs:i,emptyContent:R,selected:e,closable:c,content:t??s,onSelect:n,onClose:a,onDragStart:x,onDragEnd:h,onRename:E,onCreate:C,onDrop:v},children:[o.jsxRuntimeExports.jsx(w,{size:j,direction:u.g.swap(P),altColor:r}),o.jsxRuntimeExports.jsx(_,{})]})}),Z=k.Provider,_=()=>{const{tabs:l,selected:s,content:t,emptyContent:n,onSelect:e}=B();let r=null;const c=l.find(i=>i.tabKey===s);return s==null||c==null?n??null:(t!=null?typeof t=="function"?r=t(c):r=t:c.content!=null&&(r=c.content),o.jsxRuntimeExports.jsx("div",{className:u.CSS.B("tabs-content"),onClick:()=>e==null?void 0:e(s),children:r}))},f="tabs-selector",w=({className:l,altColor:s=!1,size:t="medium",direction:n="x",...e})=>{const{tabs:r,selected:c,onSelect:i,onClose:a,closable:x,onDragEnd:h,onDragStart:C,onDrop:E,onRename:R,onCreate:b}=B();return o.jsxRuntimeExports.jsxs(g.Space,{className:u.CSS(u.CSS.B(f),u.CSS.size(t),l),align:"center",justify:"spaceBetween",onDrop:E,empty:!0,direction:n,...e,children:[o.jsxRuntimeExports.jsx(g.Space,{direction:n,className:u.CSS.BE(f,"tabs"),empty:!0,children:r.map(p=>o.jsxRuntimeExports.jsx(L,{selected:c,altColor:s,onSelect:i,onClose:a,onDragStart:C,onDragEnd:h,onRename:R,closable:p.closable??x,size:t,...p},p.tabKey))}),b!=null&&o.jsxRuntimeExports.jsx(g.Space,{className:u.CSS.BE(f,"actions"),children:o.jsxRuntimeExports.jsx(d.Icon,{size:t,sharp:!0,onClick:b,children:o.jsxRuntimeExports.jsx(d.St.Add,{})})})]})},L=({selected:l,altColor:s=!1,onSelect:t,onClose:n,tabKey:e,name:r,onDragStart:c,onDragEnd:i,onRename:a,closable:x=!0,icon:h,size:C,editable:E=!0})=>{const R=S.useCallback(j=>c==null?void 0:c(j,{tabKey:e,name:r}),[c,e,r]),b=S.useCallback(j=>i==null?void 0:i(j,{tabKey:e,name:r}),[i,e,r]),p=S.useCallback(j=>{j.stopPropagation(),n==null||n(e)},[n,e]),v=S.useCallback(()=>t==null?void 0:t(e),[t,e]);return o.jsxRuntimeExports.jsxs(g.Pack,{size:C,id:e,className:u.CSS(u.CSS.BE(f,"btn"),a==null&&u.CSS.BEM(f,"btn","uneditable"),u.CSS.selected(l===e),u.CSS.altColor(s),x&&n!=null&&u.CSS.BEM(f,"btn","closable")),draggable:!0,direction:"x",justify:"center",align:"center",onClick:v,onDragStart:R,onDragEnd:b,bordered:!1,rounded:!1,children:[o.jsxRuntimeExports.jsx(O,{name:r,tabKey:e,onRename:a,icon:h,editable:E,level:z.ComponentSizeLevels[C]}),x&&n!=null&&o.jsxRuntimeExports.jsx(d.Icon,{onClick:p,children:o.jsxRuntimeExports.jsx(d.St.Close,{"aria-label":"pluto-tabs__close"})})]})},O=({onRename:l,name:s,tabKey:t,icon:n,editable:e=!0,...r})=>l==null||!e?n!=null?o.jsxRuntimeExports.jsx(d.WithIcon,{startIcon:n,noWrap:!0,...r,children:s}):o.jsxRuntimeExports.jsx(d.Text,{noWrap:!0,...r,children:s}):o.jsxRuntimeExports.jsx(d.Editable,{onChange:c=>l(t,c),value:s,noWrap:!0,...r}),I=m.z.object({tabKey:m.z.string(),name:m.z.string(),closable:m.z.boolean().optional(),icon:m.z.unknown().optional(),editable:m.z.boolean().optional()}),W=I.extend({content:m.z.unknown().optional()}),A=Object.freeze(Object.defineProperty({__proto__:null,Content:_,Provider:Z,Selector:w,Tabs:N,TabsContext:k,rename:q,resetSelection:T,specZ:I,tabZ:W,useStatic:y,useTabsContext:B},Symbol.toStringTag,{value:"Module"}));exports.Tabs=N;exports.external=A;exports.rename=q;exports.resetSelection=T;exports.tabZ=W;exports.useStatic=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("./Toggle-
|
|
1
|
+
"use strict";const t=require("./Toggle-GfklnU2t.cjs"),C=require("./jsx-runtime-Cek9Ww4S.cjs"),v=require("./Link-hLjXIZ1T.cjs"),x=require("./css-C4GOlJsi.cjs"),u=require("react"),a=u.createContext({onClick:()=>{},selected:""}),E=()=>u.useContext(a),O=({children:i,onChange:e,level:c,iconSpacing:o,value:r=""})=>{const n=u.useCallback(s=>{typeof e=="function"?e(s):e&&s in e&&e[s](s)},[e]),l=u.useMemo(()=>({onClick:n,selected:r,level:c,iconSpacing:o}),[r,n,c,o]);return C.jsxRuntimeExports.jsx(a.Provider,{value:l,children:i})},R=()=>C.jsxRuntimeExports.jsx(t.Divider,{direction:"x",padded:!0}),m=(i,e)=>c=>{const{itemKey:o,className:r,onClick:n,size:l,...s}={...e,...c},{onClick:S,selected:j,level:p,iconSpacing:M}=E(),_=k=>{S(o),n==null||n(k)},I=j===o;return C.jsxRuntimeExports.jsx(i,{level:p,...s,onClick:_,variant:"text",className:x.CSS(x.CSS.B("menu-item"),x.CSS.selected(I),r),size:l??M})},d=m(t.Button,{noWrap:!0}),f=m(t.Icon),L=m(v.Link,{noWrap:!0}),T=d;T.Icon=f;T.Link=L;const N=Object.freeze(Object.defineProperty({__proto__:null,CONTEXT_SELECTED:t.CONTEXT_SELECTED,CONTEXT_TARGET:t.CONTEXT_TARGET,ContextMenu:t.ContextMenu,CoreItem:d,Divider:R,Item:T,Menu:O,MenuContext:a,useContextMenu:t.useContextMenu,useMenuContext:E},Symbol.toStringTag,{value:"Module"}));exports.external=N;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as e, a as t, b as a, t as r } from "./aggregator-
|
|
2
|
-
import { P as s, S as o, t as S, u, a as i, b as n, c as m } from "./Toggle-
|
|
1
|
+
import { S as e, a as t, b as a, t as r } from "./aggregator-J7DZKy5x.js";
|
|
2
|
+
import { P as s, S as o, t as S, u, a as i, b as n, c as m } from "./Toggle-Q3wJPeGh.js";
|
|
3
3
|
const p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
4
4
|
__proto__: null,
|
|
5
5
|
Provider: s,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { w as he, au as Ae, ak as Oe, K as ke, av as Le, A as Re,
|
|
1
|
+
import { w as he, au as Ae, ak as Oe, K as ke, av as Le, A as Re, i as Ce, J as je, aw as ve, ax as $e, E as Ne, ay as Fe, az as Te, aA as Pe, aB as De, aC as Ke, L as We, aD as ze, aE as He, v as Ve, aF as Be, aG as Ge, aH as Ue } from "./Toggle-Q3wJPeGh.js";
|
|
2
2
|
import { j as Ye } from "./jsx-runtime-B6kdoens.js";
|
|
3
3
|
import { useCallback as Je } from "react";
|
|
4
|
-
import { k as Qe, j as Xe } from "./aggregator-
|
|
5
|
-
import "./css-
|
|
6
|
-
import "./Pack-
|
|
7
|
-
import { L as Ze } from "./List-
|
|
4
|
+
import { k as Qe, j as Xe } from "./aggregator-J7DZKy5x.js";
|
|
5
|
+
import "./css-BHfxGWOW.js";
|
|
6
|
+
import "./Pack-CcDPYCmE.js";
|
|
7
|
+
import { L as Ze } from "./List-B60FZ4Be.js";
|
|
8
8
|
const K = Symbol(), le = Symbol(), J = Symbol();
|
|
9
9
|
let qe = (t, e) => new Proxy(t, e);
|
|
10
10
|
const W = Object.getPrototypeOf, te = /* @__PURE__ */ new WeakMap(), Q = (t) => t && (te.has(t) ? te.get(t) : W(t) === Object.prototype || W(t) === Array.prototype), se = (t) => typeof t == "object" && t !== null, re = /* @__PURE__ */ new WeakMap(), ue = (t) => t[J] || t, fe = (t, e, s) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const k=require("./aggregator-C5NNOlCt.cjs"),R=require("./jsx-runtime-Cek9Ww4S.cjs"),d=require("./Toggle-GfklnU2t.cjs"),x=require("react"),re=require("./Link-hLjXIZ1T.cjs"),se=require("./Animated-CPJOHwpl.cjs"),h=require("./css-C4GOlJsi.cjs");require("./Pack-BNnq0Pnk.cjs");const le=require("./List-Ce67Og-K.cjs"),z=(e,t)=>t.includes(e.key),H=(e,t)=>{t&&e.sort((n,s)=>k.y.stringsWithNumbers(n.name,s.name));let r=!1;for(let n=0;n<e.length;n++){const s=e[n];s.forcePosition!=null&&n!==s.forcePosition&&(r=!0,e.splice(n,1),e.splice(s.forcePosition,0,s))}return r?H(e,!1):e},K=({nodes:e,expanded:t,depth:r=0,sort:n=!0})=>{r===0&&n&&(e=e.sort((l,i)=>l.name.localeCompare(i.name)));const s=[];return e.forEach((l,i)=>{const o=z(l,t);s.push({...l,depth:r,expanded:o,index:i}),o&&l.children!=null&&(l.children=H(l.children,n),s.push(...K({nodes:l.children,expanded:t,depth:r+1,sort:n})))}),s},ae=({tree:e,destination:t,keys:r})=>(r=k.A(r),r.forEach(n=>{const s=j({tree:e,key:n});s!=null&&(F({tree:e,keys:n}),V({tree:e,destination:t,additions:s}))}),e),F=({tree:e,keys:t})=>{t=k.A(t);const r=e.map(n=>n.key);return t.forEach(n=>{var l;const s=r.indexOf(n);if(s!==-1)e.splice(s,1);else{const i=q({tree:e,key:n});i!=null&&(i.children=(l=i.children)==null?void 0:l.filter(o=>o.key!==n))}}),e},V=({tree:e,destination:t,additions:r})=>{r=k.A(r);const n=j({tree:e,key:t});if(n==null)throw new Error(`Could not find node with key ${t}`);n.children==null&&(n.children=[]);const s=r.map(l=>l.key);return n.children=[...r,...n.children.filter(l=>!s.includes(l.key))],e},ie=({tree:e,key:t,updater:r,throwOnMissing:n=!0})=>{var i,o;const s=j({tree:e,key:t});if(s==null){if(n)throw new Error(`Could not find node with key ${t}`);return e}const l=q({tree:e,key:t});if(l!=null){const a=(i=l.children)==null?void 0:i.findIndex(S=>S.key===t);a!=null&&a!==-1&&((o=l.children)==null||o.splice(a,1,r(s)))}else e.splice(e.findIndex(a=>a.key===t),1,r(s));return e},oe=({tree:e,parent:t,updater:r,throwOnMissing:n=!0})=>{const s=j({tree:e,key:t});if(s==null){if(n)throw new Error(`Could not find node with key ${t}`);return e}return s.children=r(s.children??[]),e},j=({tree:e,key:t,depth:r=0})=>{for(let n=0;n<e.length;n++){const s=e[n];if(s.key===t){const l=s;return l.depth=r,l.position=n,l}if(s.children!=null){const l=j({tree:s.children,key:t,depth:r+1});if(l!=null)return l}}return null},ce=({tree:e,keys:t})=>{const r=[];for(const n of t){const s=j({tree:e,key:n});s!=null&&r.push(s)}return r},q=({tree:e,key:t})=>{for(const r of e)if(r.children!=null){if(r.children.some(s=>s.key===t))return r;const n=q({tree:r.children,key:t});if(n!=null)return n}return null},J=e=>e.map(t=>({...t,children:J(t.children??[])})),Q=(...e)=>{const t=[];return e.forEach(r=>{t.push(r),r.children!=null&&t.push(...Q(...r.children))}),t},M="tree-item",de=[["Shift"]],ue=e=>{const{onExpand:t,nodes:r,initialExpanded:n=[],sort:s=!0,selected:l,onSelectedChange:i}=e??{},[o,a,S]=d.useCombinedStateAndRef(n),[c,N]=k.usePassthrough({initial:[],value:l,onChange:i}),T=x.useMemo(()=>K({nodes:r,expanded:o,sort:s}),[r,o,s]),v=d.useSyncedRef(T),w=d.useHeldRef({triggers:de}),P=x.useCallback((f,{clicked:u})=>{N(f);const C=v.current.find(b=>b.key===u);if((C==null?void 0:C.hasChildren)===!1||u==null||w.current.held)return;const E=S.current,I=E.some(b=>b===u)?"contract":"expand";let y=E;I==="contract"?y=E.filter(b=>b!==u):y=[...E,u],a(y),t==null||t({current:y,action:I,clicked:u})},[t,v,a,N]),p=x.useCallback(f=>{a(u=>k.n([...u,f])),t==null||t({current:o,action:"expand",clicked:f})},[a]),L=x.useCallback(f=>{a(u=>u.filter(C=>C!==f)),t==null||t({current:o,action:"contract",clicked:f})},[a]),_=x.useCallback(()=>a([]),[a]);return{onSelect:P,selected:c,expanded:o,contract:L,expand:p,nodes:T,clearExpanded:_}},G=x.memo(({entry:e,selected:t,onSelect:r,onDrop:n,onRename:s,onSuccessfulDrop:l,onDoubleClick:i,loading:o=!1,useMargin:a=!0,translate:S})=>{const{key:c,hasChildren:N=!1,allowRename:T=!1,children:v,icon:w,name:P,depth:p,expanded:L,href:_,haulItems:f=[]}=e,{getSelected:u}=d.useSelectionUtils(),{getSourceData:C}=d.useDataUtilContext(),E=N||v!=null&&v.length>0,I=[];E&&I.push(R.jsxRuntimeExports.jsx(se.Animated,{enabled:L,enabledLoc:"bottom",disabledLoc:"right"})),w!=null&&I.push(w);const y=[];o&&y.push(R.jsxRuntimeExports.jsx(d.St.Loading,{className:h.CSS.B("loading-indicator")}));const[b,O]=x.useState(!1),{startDrag:U,...Z}=d.useDragAndDrop({type:"Tree.Item",key:c,canDrop:x.useCallback(({items:m,source:$})=>{const g=m.map(A=>A.key);return O(!1),$.type==="Tree.Item"&&!g.includes(c)},[]),onDrop:x.useCallback(m=>(n==null?void 0:n(c,m))??[],[c,n]),onDragOver:x.useCallback(()=>O(!0),[])}),D=()=>{const m=u(),$=C().filter(g=>m.includes(g.key));if(m.includes(c)){const g=$.map(({key:A,haulItems:B,depth:X})=>[{type:M,key:A,data:{depth:X}},...(B==null?void 0:B.map(Y=>({...Y,data:{...Y.data,depth:X}})))??[]]).flat();return U(g,A=>l==null?void 0:l(c,A))}U([{type:M,key:c,data:{depth:p}},...f.map(g=>({...g,data:{...g.data,depth:p}}))],g=>l==null?void 0:l(c,g))},ee=a?"marginLeft":"paddingLeft";let W=p*2+1;E&&a&&(W-=1);const te={id:c,variant:"text",draggable:f.length>0,className:h.CSS(h.CSS.BE("list","item"),d.CONTEXT_TARGET,b&&h.CSS.M("dragging-over"),t&&d.CONTEXT_SELECTED,h.CSS.selected(t),E&&h.CSS.M("has-children"),h.CSS.BM("depth",p.toString())),onDragLeave:()=>O(!1),onDragStart:D,onClick:()=>r==null?void 0:r(c),style:{border:"none",position:S!=null?"absolute":"relative",transform:`translateY(${S}px)`,[ee]:`${W}rem`,"--pluto-tree-indicator-offset":`${p*1.5+(p===0?0:.5)}rem`},startIcon:I,iconSpacing:"small",noWrap:!0,endIcon:y,onDoubleClick:m=>i==null?void 0:i(c,m),href:_,...Z},ne=_!=null?re.Link:d.Button;return R.jsxRuntimeExports.jsx(ne,{className:h.CSS.BE("list","item"),...te,children:R.jsxRuntimeExports.jsx(d.MaybeEditable,{id:`text-${c}`,level:"p",allowDoubleClick:!1,value:P,disabled:!T,onChange:m=>s==null?void 0:s(c,m)})})});G.displayName="Tree.Item";const fe=d.componentRenderProp(G),he=({nodes:e,selected:t=[],onSelect:r,onDrop:n,onRename:s,onSuccessfulDrop:l,onDoubleClick:i,className:o,children:a=fe,itemHeight:S=27,useMargin:c=!1,showRules:N=!1,virtual:T=!0,clearExpanded:v,expand:w,contract:P,emptyContent:p,loading:L,..._})=>{const f=T?d.Core.Virtual:d.Core;return R.jsxRuntimeExports.jsx(le.List,{data:e,emptyContent:p,children:R.jsxRuntimeExports.jsx(d.Selector,{value:t,onChange:r,allowMultiple:!0,replaceOnSingle:!0,children:R.jsxRuntimeExports.jsx(f,{itemHeight:S,className:h.CSS(o,h.CSS.B("tree"),N&&h.CSS.M("rules")),..._,children:({key:u,...C})=>a({...C,key:u,loading:L===u,useMargin:c,onDrop:n,onRename:s,onSuccessfulDrop:l,onDoubleClick:i})})})})},pe=(e,t)=>d.edit(`text-${e}`,t),me=e=>d.asyncEdit(`text-${e}`),ge=Object.freeze(Object.defineProperty({__proto__:null,DefaultItem:G,HAUL_TYPE:M,Tree:he,asyncRename:me,deepCopy:J,findNode:j,findNodeParent:q,findNodes:ce,flatten:K,getDescendants:Q,moveNode:ae,removeNode:F,setNode:V,shouldExpand:z,sortAndSplice:H,startRenaming:pe,updateNode:ie,updateNodeChildren:oe,use:ue},Symbol.toStringTag,{value:"Module"}));exports.external=ge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./Toggle-
|
|
1
|
+
"use strict";const e=require("./Toggle-GfklnU2t.cjs"),o=require("./jsx-runtime-Cek9Ww4S.cjs"),i=require("react");require("./aggregator-C5NNOlCt.cjs");const c=require("./css-C4GOlJsi.cjs");require("./Pack-BNnq0Pnk.cjs");const R=require("./Keyboard-Dw9MQvaJ.cjs"),S=t=>{const{listen:r}=e.useContext$1(),[l,a]=i.useState([]);return i.useEffect(()=>r(({next:[s]})=>a(s??[])),[r,a]),o.jsxRuntimeExports.jsx(e.Text,{...t,children:l.join(" ")})},y={Control:()=>o.jsxRuntimeExports.jsx(e.Symbols.Meta,{},"control"),Alt:()=>o.jsxRuntimeExports.jsx(e.Symbols.Alt,{},"alt"),Shift:()=>o.jsxRuntimeExports.jsx(e.St.Keyboard.Shift,{},"shift"),MouseLeft:"Left Click",MouseRight:"Right Click",MouseMiddle:"Middle Click",Enter:()=>o.jsxRuntimeExports.jsx(e.St.Keyboard.Return,{},"enter")},x=t=>{const r=y[t];return r!=null?typeof r=="function"?r():r:t},C=t=>t.map(r=>x(r)),f=({className:t,style:r,trigger:l,children:a,...s})=>o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{children:l.map(n=>o.jsxRuntimeExports.jsx(R.Keyboard,{...s,children:x(n)},n))}),E=({onDrag:t,triggers:r=[["MouseLeft"],["MouseRight"]],bound:l,loose:a=!1})=>{const s=i.useRef(null),n=i.useRef(c.q.ZERO),m=i.useCallback(u=>{const d=c.q.construct(u);if(s.current===null)return;const{triggers:g}=s.current;t({box:c.To.construct(n.current,d),cursor:d,triggers:g,stage:"during"})},[t]),M=i.useCallback(u=>{const{stage:d,cursor:g}=u;d==="start"?(t({box:c.To.construct(g),...u}),window.addEventListener("mousemove",m),s.current=u,n.current=g):d==="end"&&s.current!=null&&(t({box:c.To.construct(n.current,g),...u}),window.removeEventListener("mousemove",m),s.current=null,n.current=c.q.ZERO)},[t]);e.use$2({triggers:r,callback:M,region:l,loose:a})},b=Object.freeze(Object.defineProperty({__proto__:null,ALPHANUMERIC_KEYS:e.ALPHANUMERIC_KEYS,ALPHANUMERIC_KEYS_SET:e.ALPHANUMERIC_KEYS_SET,KEYS:e.KEYS,MOUSE_KEYS:e.MOUSE_KEYS,Provider:e.Provider$1,Status:S,Text:f,compareModeConfigs:e.compareModeConfigs,determineMode:e.determineMode,diff:e.diff,eventKey:e.eventKey,filter:e.filter,flattenConfig:e.flattenConfig,keyZ:e.keyZ,keyboardKey:e.keyboardKey,match:e.match,matchCallback:e.matchCallback,mouseKey:e.mouseKey,mouseKeyZ:e.mouseKeyZ,purge:e.purge,purgeMouse:e.purgeMouse,toSymbols:C,triggerZ:e.triggerZ,use:e.use$2,useContext:e.useContext$1,useDrag:E,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:e.useHeld,useHeldRef:e.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.Text=f;exports.external=b;exports.useDrag=E;
|
package/dist/header.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./external-Cly1pTAH.cjs");exports.Header=e.external;
|
package/dist/header.js
CHANGED