@ynput/ayon-frontend-shared 0.4.7 → 0.6.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/DetailsPanel.es.js +684 -649
- package/dist/Feed.es.js +22 -22
- package/dist/ListTable.es.js +78 -67
- package/dist/ProjectTreeTable.es.js +2185 -2132
- package/dist/Slicer.es.js +152 -120
- package/dist/Views.es.js +1 -1
- package/dist/api.es.js +332 -329
- package/dist/chunks/Actions.es.js +7 -7
- package/dist/chunks/ColumnDropIndicator.es.js +127 -241
- package/dist/chunks/DeleteEntitiesContext.es.js +109 -109
- package/dist/chunks/DetailsDialog.es.js +3 -3
- package/dist/chunks/DetailsPanelContext.es.js +155 -0
- package/dist/chunks/EntityPath.es.js +40 -40
- package/dist/chunks/EntityPickerDialog.es.js +1 -1
- package/dist/chunks/EntityTooltip.es.js +3 -3
- package/dist/chunks/EntityUpdatesContext.es.js +1 -1
- package/dist/chunks/Feed.es.js +2208 -2611
- package/dist/chunks/FilterErrorActions.es.js +5 -5
- package/dist/chunks/GlobalContext.es.js +21 -21
- package/dist/chunks/InfoMessage.es.js +146 -0
- package/dist/chunks/Menu.es.js +6 -6
- package/dist/chunks/MenuContext.es.js +51 -240
- package/dist/chunks/MenuItem.es.js +1 -1
- package/dist/chunks/MetaWidget.es.js +3211 -3761
- package/dist/chunks/NewEntityContext.es.js +539 -544
- package/dist/chunks/PlayableIcon.es.js +4261 -1163
- package/dist/chunks/ProjectContext.es.js +2 -2
- package/dist/chunks/ProjectFoldersContext.es.js +84 -76
- package/dist/chunks/RepresentationsList.es.js +3 -3
- package/dist/chunks/ReviewablesSelector.es.js +396 -384
- package/dist/chunks/SimpleForm.es.js +9 -9
- package/dist/chunks/SimpleTable.es.js +286 -283
- package/dist/chunks/Slicer.es.js +1129 -689
- package/dist/chunks/TableSettingsFallback.es.js +6 -6
- package/dist/chunks/ThumbnailSimple.es.js +410 -61
- package/dist/chunks/VersionUploadContext.es.js +30 -30
- package/dist/chunks/ViewsContext.es.js +97 -97
- package/dist/chunks/Watchers.es.js +628 -598
- package/dist/chunks/entityDefinitions.es.js +276 -134
- package/dist/chunks/expandRelativeDates.es.js +27 -0
- package/dist/chunks/getBundleMode.es.js +16 -61
- package/dist/chunks/getUris.es.js +329 -322
- package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
- package/dist/chunks/searchTerms.es.js +186 -173
- package/dist/chunks/uriUtils.es.js +48 -0
- package/dist/chunks/useAttributeEnums.es.js +69 -61
- package/dist/chunks/useColumnDragRestriction.es.js +37 -27
- package/dist/chunks/useDateRangeFilter.es.js +3 -3
- package/dist/chunks/useLocalStorage.es.js +8 -8
- package/dist/chunks/useSessionStorage.es.js +61 -0
- package/dist/chunks/viewUpdateHelper.es.js +8 -8
- package/dist/components.es.js +199 -194
- package/dist/context.es.js +60 -58
- package/dist/hooks.es.js +108 -101
- package/dist/index.es.js +20 -14
- package/dist/types/Actions.d.ts +16 -16
- package/dist/types/ContextMenu.d.ts +16 -16
- package/dist/types/DetailsPanel.d.ts +22 -16
- package/dist/types/EntityPickerDialog.d.ts +16 -16
- package/dist/types/Feed.d.ts +16 -16
- package/dist/types/ListTable.d.ts +16 -16
- package/dist/types/NewEntity.d.ts +16 -16
- package/dist/types/ProjectTreeTable.d.ts +48 -22
- package/dist/types/RepresentationsList.d.ts +19 -16
- package/dist/types/SimpleTable.d.ts +17 -16
- package/dist/types/Slicer.d.ts +119 -34
- package/dist/types/Views.d.ts +17 -17
- package/dist/types/api.d.ts +404 -95
- package/dist/types/components.d.ts +86 -25
- package/dist/types/context.d.ts +60 -17
- package/dist/types/hooks.d.ts +16 -16
- package/dist/types/index.d.ts +16 -16
- package/dist/types/util.d.ts +16 -16
- package/dist/util.es.js +108 -97
- package/package.json +26 -13
- package/dist/chunks/mentionTypeOptions.es.js +0 -15
- package/dist/chunks/useSlicerSplitter.es.js +0 -18
package/dist/chunks/Slicer.es.js
CHANGED
|
@@ -1,214 +1,449 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as E, jsxs as G, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as U, useCallback as A, useMemo as O, useContext as Ye, useEffect as se, forwardRef as Je, useRef as ye, useId as Xe, useImperativeHandle as Ze, useLayoutEffect as Te } from "react";
|
|
3
|
+
import { Splitter as et, SplitterPanel as tt } from "primereact/splitter";
|
|
4
|
+
import V from "styled-components";
|
|
5
|
+
import { u as xe, n as me } from "./entityDefinitions.es.js";
|
|
6
|
+
import { u as ze } from "./useSessionStorage.es.js";
|
|
7
|
+
import { a as Ce } from "./useLocalStorage.es.js";
|
|
8
|
+
import { u as we } from "./ProjectFoldersContext.es.js";
|
|
9
|
+
import { E as nt, u as st } from "./EntityPickerDialog.es.js";
|
|
10
|
+
import { toast as De } from "react-toastify";
|
|
11
|
+
import { be as Re, bq as ot, bg as Ue, bo as at } from "./searchTerms.es.js";
|
|
12
|
+
import { dl as Ve, cF as it, bS as rt, by as lt } from "./getUris.es.js";
|
|
7
13
|
import "primereact/confirmdialog";
|
|
8
|
-
import {
|
|
9
|
-
import { b as se, n as W } from "./entityDefinitions.es.js";
|
|
10
|
-
import { u as Ue } from "./GlobalContext.es.js";
|
|
11
|
-
import { P as Ve, U as he, h as $e } from "./MetaWidget.es.js";
|
|
14
|
+
import { g as ct, P as dt, U as He } from "./MetaWidget.es.js";
|
|
12
15
|
import "lodash";
|
|
13
|
-
import { toast as ce } from "react-toastify";
|
|
14
16
|
import "uuid";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { g as
|
|
20
|
-
import {
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { u as
|
|
17
|
+
import { b as he, H as ut, a as pt, d as ft, S as mt } from "./SimpleTable.es.js";
|
|
18
|
+
import { a as ue } from "./ProjectContext.es.js";
|
|
19
|
+
import { u as ht } from "./GlobalContext.es.js";
|
|
20
|
+
import { u as gt, a as yt } from "./useAttributeEnums.es.js";
|
|
21
|
+
import { g as ge } from "./getEntityTypeIcon.es.js";
|
|
22
|
+
import { b as bt, s as St } from "./buildHierarchicalTableRows.es.js";
|
|
23
|
+
import { g as Tt } from "./parseHtmlToPlainTextWithLinks.es.js";
|
|
24
|
+
import { InputText as vt, Button as It, Icon as xt } from "@ynput/ayon-react-components";
|
|
25
|
+
import W from "clsx";
|
|
26
|
+
import { u as Ct } from "./NewEntityContext.es.js";
|
|
27
|
+
import { a as wt, K as Lt } from "./platform.es.js";
|
|
28
|
+
import { u as Et } from "./DetailsPanelContext.es.js";
|
|
29
|
+
import { g as kt } from "./DeleteEntitiesContext.es.js";
|
|
30
|
+
import { u as Dt } from "./VersionUploadContext.es.js";
|
|
31
|
+
import { u as Rt, b as Pt, F as Pe } from "./EntityUpdatesContext.es.js";
|
|
29
32
|
import "./MenuItem.es.js";
|
|
30
33
|
import "@module-federation/enhanced/runtime";
|
|
31
34
|
import "semver";
|
|
35
|
+
import { u as Mt } from "./MenuContext.es.js";
|
|
32
36
|
import "react-dom";
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
37
|
+
const _t = 180, Be = 100, Ge = 34, At = (e, t = [], a = Be) => e.map((r) => t.includes(r) ? Ge : a), Ot = (e, t, a, r) => {
|
|
38
|
+
const d = e.reduce((p, g) => p + g, 0), l = r.filter(Boolean).length;
|
|
39
|
+
if (!l || d === a) return e;
|
|
40
|
+
if (d < a) {
|
|
41
|
+
const p = (a - d) / l;
|
|
42
|
+
return e.map((g, L) => r[L] ? g + p : g);
|
|
43
|
+
}
|
|
44
|
+
const f = e.map((p, g) => r[g] ? p - t[g] : 0), S = f.reduce((p, g) => p + g, 0);
|
|
45
|
+
if (!S) return e;
|
|
46
|
+
const m = d - a;
|
|
47
|
+
return e.map((p, g) => p - m * (f[g] / S));
|
|
48
|
+
}, Nt = (e, t, a = [], r = 0, d = _t) => {
|
|
49
|
+
if (!t.length)
|
|
50
|
+
return { heights: [], mins: [], sizes: [], minSize: 2, height: r };
|
|
51
|
+
const l = t.filter((h) => !a.includes(h)).length, f = (t.length - l) * Ge, S = r && l ? Math.min(
|
|
52
|
+
d,
|
|
53
|
+
Math.max(
|
|
54
|
+
Be,
|
|
55
|
+
Math.floor((r - f) / l)
|
|
56
|
+
)
|
|
57
|
+
) : d, m = At(t, a), p = t.map(
|
|
58
|
+
(h, i) => a.includes(h) ? m[i] : Math.max(e[h] ?? S, m[i])
|
|
59
|
+
), g = t.map((h) => !a.includes(h)), L = m.reduce((h, i) => h + i, 0), u = g.some(Boolean) ? Math.max(r, L) : L, b = Ot(p, m, u, g);
|
|
60
|
+
return {
|
|
61
|
+
heights: b,
|
|
62
|
+
mins: m,
|
|
63
|
+
sizes: b.map((h) => h / u * 100),
|
|
64
|
+
// primereact must allow the drag past the min; clampDraggedHeights puts it back
|
|
65
|
+
minSize: 2,
|
|
66
|
+
height: u
|
|
67
|
+
};
|
|
68
|
+
}, Ft = (e, t, a) => {
|
|
69
|
+
const r = e.map((m, p) => Math.max(m / 100 * t, a[p])), d = Math.max(
|
|
70
|
+
t,
|
|
71
|
+
a.reduce((m, p) => m + p, 0)
|
|
72
|
+
), l = r.reduce((m, p) => m + p, 0) - d;
|
|
73
|
+
if (l <= 0) return r;
|
|
74
|
+
const f = r.map((m, p) => m - a[p]), S = f.reduce((m, p) => m + p, 0);
|
|
75
|
+
return S ? r.map((m, p) => m - l * (f[p] / S)) : r;
|
|
76
|
+
}, jt = "slicer-splitter", Me = {
|
|
77
|
+
minSize: 2,
|
|
78
|
+
size: 12
|
|
79
|
+
}, Xn = () => {
|
|
80
|
+
const [e, t] = ze(jt, [
|
|
81
|
+
Me.size,
|
|
82
|
+
100 - Me.size
|
|
83
|
+
]);
|
|
84
|
+
return [e, (r) => {
|
|
85
|
+
t(r.sizes);
|
|
86
|
+
}];
|
|
87
|
+
}, $t = (e, t, a = [], r = 0) => {
|
|
88
|
+
const [d, l] = ze(
|
|
89
|
+
`slicer-panel-heights-${e}`,
|
|
90
|
+
{}
|
|
91
|
+
), [f, S] = U(0), m = Array.isArray(d) ? {} : d, {
|
|
92
|
+
sizes: p,
|
|
93
|
+
mins: g,
|
|
94
|
+
minSize: L,
|
|
95
|
+
height: u,
|
|
96
|
+
heights: b
|
|
97
|
+
} = Nt(m, t, a, r), h = (i) => {
|
|
98
|
+
const c = Ft(i.sizes, u, g);
|
|
99
|
+
l({
|
|
100
|
+
...m,
|
|
101
|
+
...Object.fromEntries(
|
|
102
|
+
t.map((o, y) => [o, c[y]]).filter(([o]) => !a.includes(o))
|
|
103
|
+
)
|
|
104
|
+
}), c.some(
|
|
105
|
+
(o, y) => Math.abs(o - i.sizes[y] / 100 * u) > 1
|
|
106
|
+
) && S((o) => o + 1);
|
|
107
|
+
};
|
|
108
|
+
return {
|
|
109
|
+
sizes: p,
|
|
110
|
+
minSize: L,
|
|
111
|
+
height: u,
|
|
112
|
+
panelHeights: b,
|
|
113
|
+
layoutKey: `${t.join("|")}#${a.join("|")}#${f}`,
|
|
114
|
+
handleResizeEnd: h
|
|
115
|
+
};
|
|
116
|
+
}, zt = ({
|
|
117
|
+
projectName: e,
|
|
118
|
+
movingEntities: t,
|
|
119
|
+
onClose: a,
|
|
120
|
+
onMoveComplete: r
|
|
121
|
+
}) => {
|
|
122
|
+
const [d] = Ve(), l = ct(), { folders: f } = we(), S = l?.tableData || [], m = A(
|
|
123
|
+
(h) => l?.getEntityById(h) || f.find((i) => i.id === h),
|
|
124
|
+
[f, l]
|
|
125
|
+
), p = A(
|
|
126
|
+
async (h) => {
|
|
127
|
+
if (!t || h.length === 0) return;
|
|
128
|
+
const i = h[0];
|
|
129
|
+
try {
|
|
130
|
+
const c = t.entities.map(
|
|
131
|
+
(y, n) => ({
|
|
132
|
+
id: `move-${y.entityId}-${Date.now()}-${n}`,
|
|
133
|
+
type: "update",
|
|
134
|
+
entityType: y.entityType,
|
|
135
|
+
entityId: y.entityId,
|
|
136
|
+
data: y.entityType === "folder" ? { parentId: i } : { folderId: i }
|
|
137
|
+
})
|
|
138
|
+
), o = (await d({
|
|
139
|
+
projectName: e,
|
|
140
|
+
operationsRequestModel: {
|
|
141
|
+
operations: c
|
|
142
|
+
}
|
|
143
|
+
}).unwrap())?.operations?.filter((y) => y.success === !1) || [];
|
|
144
|
+
if (o.length > 0) {
|
|
145
|
+
const y = o.map((n) => n.detail).join(", ");
|
|
146
|
+
throw new Error(y || "Some move operations failed");
|
|
147
|
+
}
|
|
148
|
+
r?.(i);
|
|
149
|
+
} catch (c) {
|
|
150
|
+
let s = Re(c) || "Failed to move entities";
|
|
151
|
+
if (s.includes("already exists"))
|
|
152
|
+
if (t.entities.length > 1)
|
|
153
|
+
s = "Cannot move some entities - one or more entities with the same name already exist in the target location";
|
|
154
|
+
else if (t.entities[0].entityType === "task") {
|
|
155
|
+
const y = s.match(/name '.*?, (.+?)' already exists/);
|
|
156
|
+
s = `Cannot move "${y ? y[1] : "this task"}" - a task with this name already exists in the target folder`;
|
|
157
|
+
} else {
|
|
158
|
+
const y = s.match(/name '.*?, (.+?)' already exists/);
|
|
159
|
+
s = `Cannot move "${y ? y[1] : "this folder"}" - a folder with this name already exists in the target location`;
|
|
160
|
+
}
|
|
161
|
+
De.error(s);
|
|
162
|
+
} finally {
|
|
163
|
+
a();
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
[t, e, d, a, r]
|
|
167
|
+
), g = A(async () => {
|
|
168
|
+
if (t)
|
|
169
|
+
try {
|
|
170
|
+
const h = t.entities.map(
|
|
171
|
+
(s, o) => ({
|
|
172
|
+
id: `move-to-root-${s.entityId}-${Date.now()}-${o}`,
|
|
173
|
+
type: "update",
|
|
174
|
+
entityType: s.entityType,
|
|
175
|
+
entityId: s.entityId,
|
|
176
|
+
data: s.entityType === "folder" ? { parentId: null } : { folderId: null }
|
|
177
|
+
})
|
|
178
|
+
), c = (await d({
|
|
179
|
+
projectName: e,
|
|
180
|
+
operationsRequestModel: {
|
|
181
|
+
operations: h
|
|
182
|
+
}
|
|
183
|
+
}).unwrap())?.operations?.filter((s) => s.success === !1) || [];
|
|
184
|
+
if (c.length > 0) {
|
|
185
|
+
const s = c.map((o) => o.detail).join(", ");
|
|
186
|
+
throw new Error(s || "Some move operations failed");
|
|
187
|
+
}
|
|
188
|
+
} catch (h) {
|
|
189
|
+
let i = Re(h) || "Failed to move entities to root";
|
|
190
|
+
De.error(i);
|
|
191
|
+
} finally {
|
|
192
|
+
a();
|
|
193
|
+
}
|
|
194
|
+
}, [t, e, d, a]), L = A(() => {
|
|
195
|
+
if (!t) return [];
|
|
196
|
+
const h = [];
|
|
197
|
+
return t.entities.forEach((i) => {
|
|
198
|
+
h.push(i.entityId);
|
|
199
|
+
}), f.forEach((i) => {
|
|
200
|
+
t.entities.some((s) => {
|
|
201
|
+
const o = m(s.entityId);
|
|
202
|
+
return o?.name ? S.filter((n) => s.entityType === "folder" ? n.entityType === "folder" && n.parentId === i.id : s.entityType === "task" ? n.entityType === "task" && n.folderId === i.id : !1).some(
|
|
203
|
+
(n) => n.name === o.name && n.entityId !== s.entityId
|
|
204
|
+
) : !1;
|
|
205
|
+
}) && h.push(i.id);
|
|
206
|
+
}), [...new Set(h)];
|
|
207
|
+
}, [t, f, S, m]), u = A(
|
|
208
|
+
(h) => {
|
|
209
|
+
if (!t) return;
|
|
210
|
+
if (t.entities.some(
|
|
211
|
+
(y) => y.entityType === "folder" && y.entityId === h
|
|
212
|
+
))
|
|
213
|
+
return "Cannot move folder to itself";
|
|
214
|
+
if (t.entities.some(
|
|
215
|
+
(y) => y.currentParentId === h
|
|
216
|
+
))
|
|
217
|
+
return "Cannot move to the same location";
|
|
218
|
+
const s = f.find((y) => y.id === h);
|
|
219
|
+
if (s) {
|
|
220
|
+
const y = t.entities.find((n) => {
|
|
221
|
+
const I = m(n.entityId);
|
|
222
|
+
return I?.name ? S.filter((v) => n.entityType === "folder" ? v.entityType === "folder" && v.parentId === s.id : n.entityType === "task" ? v.entityType === "task" && v.folderId === s.id : !1).some(
|
|
223
|
+
(v) => v.name === I.name && v.entityId !== n.entityId
|
|
224
|
+
) : !1;
|
|
225
|
+
});
|
|
226
|
+
if (y)
|
|
227
|
+
return `Cannot move "${m(y.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
|
|
228
|
+
}
|
|
229
|
+
return t.entities.some(
|
|
230
|
+
(y) => y.entityType === "folder"
|
|
231
|
+
) ? "Cannot move folder to its child" : "Cannot move to this location";
|
|
232
|
+
},
|
|
233
|
+
[t, f, S, m]
|
|
234
|
+
), b = O(() => t?.entities.every((h) => h.entityType === "folder") || !1, [t]);
|
|
235
|
+
return {
|
|
236
|
+
handleMoveSubmit: p,
|
|
237
|
+
handleMoveToRoot: g,
|
|
238
|
+
getDisabledFolderIds: L,
|
|
239
|
+
getDisabledMessage: u,
|
|
240
|
+
canMoveToRoot: b
|
|
241
|
+
};
|
|
242
|
+
}, Ut = ({
|
|
243
|
+
projectName: e,
|
|
244
|
+
movingEntities: t,
|
|
245
|
+
onClose: a,
|
|
246
|
+
onMoveComplete: r
|
|
247
|
+
}) => {
|
|
248
|
+
const { handleMoveSubmit: d, handleMoveToRoot: l, getDisabledFolderIds: f, getDisabledMessage: S } = zt({
|
|
249
|
+
projectName: e,
|
|
250
|
+
movingEntities: t ?? null,
|
|
251
|
+
onClose: a,
|
|
252
|
+
onMoveComplete: r
|
|
253
|
+
});
|
|
254
|
+
return t?.entities.length ? /* @__PURE__ */ E(
|
|
255
|
+
nt,
|
|
256
|
+
{
|
|
257
|
+
projectName: e,
|
|
258
|
+
entityType: "folder",
|
|
259
|
+
onSubmit: d,
|
|
260
|
+
onClose: a,
|
|
261
|
+
showMoveToRoot: t.entities.every(
|
|
262
|
+
(m) => m.entityType === "folder"
|
|
263
|
+
),
|
|
264
|
+
onMoveToRoot: l,
|
|
265
|
+
disabledIds: f(),
|
|
266
|
+
getDisabledMessage: S
|
|
267
|
+
}
|
|
268
|
+
) : null;
|
|
269
|
+
}, Vt = ({ projectName: e, useExtraSlices: t }) => {
|
|
270
|
+
const [a, { isLoading: r, isFetching: d }] = it(), { formatAssignees: l } = t();
|
|
36
271
|
return {
|
|
37
272
|
getData: async () => {
|
|
38
|
-
const
|
|
39
|
-
return
|
|
273
|
+
const S = await a({ projectName: e || "" }, !0).unwrap();
|
|
274
|
+
return l(S);
|
|
40
275
|
},
|
|
41
|
-
isLoading:
|
|
276
|
+
isLoading: r || d
|
|
42
277
|
};
|
|
43
|
-
},
|
|
44
|
-
const { isLoading:
|
|
45
|
-
return { project: d, getStatuses: async () =>
|
|
46
|
-
(
|
|
47
|
-
) : void 0, isLoading:
|
|
48
|
-
},
|
|
278
|
+
}, Ht = ({ scopes: e, useExtraSlices: t }) => {
|
|
279
|
+
const { isLoading: a, productTypes: r, ...d } = ue(), { formatStatuses: l, formatTaskTypes: f, formatProductTypes: S, formatTypes: m, formatAttribute: p } = t();
|
|
280
|
+
return { project: d, getStatuses: async () => l(d, e), getTypes: async () => m(d), getTaskTypes: async () => f(d), getProductTypes: async () => S(r), getAttribute: async (i) => p ? p(i).map(
|
|
281
|
+
(c) => ot(c.icon ?? void 0) ? { ...c, icon: void 0, img: c.icon, imgShape: "circle" } : c
|
|
282
|
+
) : void 0, isLoading: a };
|
|
283
|
+
}, Bt = ({ entityTypes: e, request: t }) => {
|
|
49
284
|
const {
|
|
50
|
-
attributes:
|
|
51
|
-
isLoading: { siteInfo:
|
|
52
|
-
} =
|
|
53
|
-
return { attributes:
|
|
54
|
-
(
|
|
55
|
-
), isLoading:
|
|
56
|
-
},
|
|
57
|
-
if (
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
return new Date(
|
|
61
|
-
}),
|
|
62
|
-
const { projectName:
|
|
63
|
-
data:
|
|
285
|
+
attributes: a,
|
|
286
|
+
isLoading: { siteInfo: r }
|
|
287
|
+
} = ht(), d = Ye(dt), l = d?.attribFields?.length ? d.attribFields : a, { projectName: f } = ue();
|
|
288
|
+
return { attributes: gt(l, { projectName: f, request: t ?? [] }).filter((p) => Ue(p.data)).filter((p) => e.some((g) => p.scope?.includes(g))).map(
|
|
289
|
+
(p) => p.data.enum?.some((g) => g.hidden) ? { ...p, data: { ...p.data, enum: at(p.data.enum) } } : p
|
|
290
|
+
), isLoading: r };
|
|
291
|
+
}, Gt = "snippet_folder", de = "folder", Kt = (e) => `${de}-${e}`, _e = (e) => e.entityListType === "review-session" ? "subscriptions" : ge(e.entityType), ve = (e) => [...e].sort((t, a) => {
|
|
292
|
+
if (t.active && !a.active) return -1;
|
|
293
|
+
if (!t.active && a.active) return 1;
|
|
294
|
+
const r = new Date(t.createdAt || 0);
|
|
295
|
+
return new Date(a.createdAt || 0).getTime() - r.getTime();
|
|
296
|
+
}), Wt = (e = !0) => {
|
|
297
|
+
const { projectName: t } = ue(), { powerLicense: a } = Ce(), {
|
|
298
|
+
data: r,
|
|
64
299
|
isLoading: d,
|
|
65
|
-
isFetching:
|
|
66
|
-
} =
|
|
67
|
-
{ projectName:
|
|
300
|
+
isFetching: l
|
|
301
|
+
} = rt(
|
|
302
|
+
{ projectName: t || "" },
|
|
68
303
|
{
|
|
69
304
|
initialPageParam: { cursor: "" },
|
|
70
|
-
skip: !
|
|
305
|
+
skip: !t || !e
|
|
71
306
|
}
|
|
72
|
-
), { data:
|
|
73
|
-
{ projectName:
|
|
74
|
-
{ skip: !
|
|
75
|
-
),
|
|
76
|
-
if (!
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
for (const
|
|
81
|
-
|
|
82
|
-
id:
|
|
83
|
-
folder:
|
|
307
|
+
), { data: f = [], isLoading: S } = lt(
|
|
308
|
+
{ projectName: t || "" },
|
|
309
|
+
{ skip: !t || !a || !e }
|
|
310
|
+
), m = O(() => {
|
|
311
|
+
if (!r?.pages) return [];
|
|
312
|
+
const L = r.pages.flatMap((u) => u.lists);
|
|
313
|
+
if (a && f.length > 0) {
|
|
314
|
+
const u = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Set();
|
|
315
|
+
for (const n of f)
|
|
316
|
+
u.set(n.id, {
|
|
317
|
+
id: n.id,
|
|
318
|
+
folder: n,
|
|
84
319
|
children: /* @__PURE__ */ new Map(),
|
|
85
320
|
items: [],
|
|
86
321
|
hasAnyItems: !1
|
|
87
|
-
}),
|
|
88
|
-
for (const
|
|
89
|
-
if (
|
|
90
|
-
const
|
|
91
|
-
|
|
322
|
+
}), n.parentId || b.add(n.id);
|
|
323
|
+
for (const n of f)
|
|
324
|
+
if (n.parentId && u.has(n.parentId)) {
|
|
325
|
+
const I = u.get(n.parentId), T = u.get(n.id);
|
|
326
|
+
I.children.set(n.id, T);
|
|
92
327
|
}
|
|
93
|
-
const
|
|
94
|
-
for (const
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
328
|
+
const h = [];
|
|
329
|
+
for (const n of L) {
|
|
330
|
+
const I = n.entityListFolderId;
|
|
331
|
+
if (I && u.has(I)) {
|
|
332
|
+
const T = u.get(I);
|
|
333
|
+
T.items.push(n), T.hasAnyItems = !0;
|
|
99
334
|
} else
|
|
100
|
-
|
|
335
|
+
h.push(n);
|
|
101
336
|
}
|
|
102
|
-
for (const
|
|
103
|
-
if (
|
|
104
|
-
let
|
|
105
|
-
for (;
|
|
106
|
-
const
|
|
107
|
-
if (
|
|
108
|
-
|
|
337
|
+
for (const n of u.values())
|
|
338
|
+
if (n.hasAnyItems) {
|
|
339
|
+
let I = n.folder;
|
|
340
|
+
for (; I.parentId; ) {
|
|
341
|
+
const T = u.get(I.parentId);
|
|
342
|
+
if (T)
|
|
343
|
+
T.hasAnyItems = !0, I = T.folder;
|
|
109
344
|
else
|
|
110
345
|
break;
|
|
111
346
|
}
|
|
112
347
|
}
|
|
113
|
-
const
|
|
114
|
-
id:
|
|
115
|
-
name:
|
|
116
|
-
label:
|
|
117
|
-
...
|
|
118
|
-
icon:
|
|
348
|
+
const i = (n, I, T = []) => ({
|
|
349
|
+
id: n.id,
|
|
350
|
+
name: n.label,
|
|
351
|
+
label: n.label,
|
|
352
|
+
...T.length > 0 && { parents: T },
|
|
353
|
+
icon: _e(n),
|
|
119
354
|
subRows: [],
|
|
120
355
|
data: {
|
|
121
|
-
id:
|
|
122
|
-
name:
|
|
123
|
-
label:
|
|
124
|
-
entityType:
|
|
125
|
-
listId:
|
|
356
|
+
id: n.id,
|
|
357
|
+
name: n.label,
|
|
358
|
+
label: n.label,
|
|
359
|
+
entityType: n.entityType,
|
|
360
|
+
listId: n.id
|
|
126
361
|
}
|
|
127
|
-
}),
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
}),
|
|
131
|
-
const
|
|
132
|
-
for (const
|
|
133
|
-
|
|
134
|
-
return
|
|
135
|
-
}, o =
|
|
136
|
-
folderNodes:
|
|
137
|
-
rootFolderIds:
|
|
362
|
+
}), c = (n) => n.sort((I, T) => {
|
|
363
|
+
const v = f.findIndex((H) => H.id === I.id), k = f.findIndex((H) => H.id === T.id);
|
|
364
|
+
return v === -1 && k === -1 ? I.folder.label.localeCompare(T.folder.label) : v === -1 ? 1 : k === -1 ? -1 : v - k;
|
|
365
|
+
}), s = (n) => {
|
|
366
|
+
const I = n.items.map((T) => T.id);
|
|
367
|
+
for (const T of n.children.values())
|
|
368
|
+
I.push(...s(T));
|
|
369
|
+
return I;
|
|
370
|
+
}, o = bt({
|
|
371
|
+
folderNodes: u,
|
|
372
|
+
rootFolderIds: b,
|
|
138
373
|
showEmptyFolders: !1,
|
|
139
|
-
buildFolderRowId:
|
|
140
|
-
createItemRow:
|
|
141
|
-
sortFolderNodes:
|
|
142
|
-
sortItems:
|
|
143
|
-
getFolderLabel: (
|
|
144
|
-
getFolderIcon: (
|
|
145
|
-
getFolderColor: (
|
|
146
|
-
getItemCount: (
|
|
374
|
+
buildFolderRowId: Kt,
|
|
375
|
+
createItemRow: i,
|
|
376
|
+
sortFolderNodes: c,
|
|
377
|
+
sortItems: ve,
|
|
378
|
+
getFolderLabel: (n) => n.label,
|
|
379
|
+
getFolderIcon: (n) => n.data?.icon || Gt,
|
|
380
|
+
getFolderColor: (n) => n.data?.color,
|
|
381
|
+
getItemCount: (n) => n.items.length + Array.from(n.children.values()).reduce((I, T) => I + T.items.length, 0)
|
|
147
382
|
});
|
|
148
|
-
for (const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
|
|
383
|
+
for (const n of o) {
|
|
384
|
+
if (n.id.startsWith(de + "-")) {
|
|
385
|
+
const T = n.id.substring((de + "-").length), v = u.get(T);
|
|
386
|
+
v && (n.data = { ...n.data, childListIds: s(v) });
|
|
152
387
|
}
|
|
153
|
-
const
|
|
154
|
-
for (;
|
|
155
|
-
const
|
|
156
|
-
if (
|
|
157
|
-
const
|
|
158
|
-
|
|
388
|
+
const I = [...n.subRows || []];
|
|
389
|
+
for (; I.length > 0; ) {
|
|
390
|
+
const T = I.shift();
|
|
391
|
+
if (T.id.startsWith(de + "-")) {
|
|
392
|
+
const v = T.id.substring((de + "-").length), k = u.get(v);
|
|
393
|
+
k && (T.data = { ...T.data, childListIds: s(k) });
|
|
159
394
|
}
|
|
160
|
-
|
|
395
|
+
T.subRows && I.push(...T.subRows);
|
|
161
396
|
}
|
|
162
397
|
}
|
|
163
|
-
const
|
|
164
|
-
return [...o, ...
|
|
398
|
+
const y = ve(h).map((n) => i(n));
|
|
399
|
+
return [...o, ...y];
|
|
165
400
|
}
|
|
166
|
-
return
|
|
167
|
-
id:
|
|
168
|
-
name:
|
|
169
|
-
label:
|
|
170
|
-
icon:
|
|
401
|
+
return ve(L).map((u) => ({
|
|
402
|
+
id: u.id,
|
|
403
|
+
name: u.label,
|
|
404
|
+
label: u.label,
|
|
405
|
+
icon: _e(u),
|
|
171
406
|
subRows: [],
|
|
172
407
|
data: {
|
|
173
|
-
id:
|
|
174
|
-
name:
|
|
175
|
-
label:
|
|
176
|
-
entityType:
|
|
177
|
-
listId:
|
|
408
|
+
id: u.id,
|
|
409
|
+
name: u.label,
|
|
410
|
+
label: u.label,
|
|
411
|
+
entityType: u.entityType,
|
|
412
|
+
listId: u.id
|
|
178
413
|
}
|
|
179
414
|
}));
|
|
180
|
-
}, [
|
|
415
|
+
}, [r, a, f]), p = a && f.length > 0;
|
|
181
416
|
return {
|
|
182
|
-
getData:
|
|
183
|
-
isLoading: d ||
|
|
184
|
-
isExpandable:
|
|
417
|
+
getData: A(async () => m, [m]),
|
|
418
|
+
isLoading: d || l || S,
|
|
419
|
+
isExpandable: p
|
|
185
420
|
};
|
|
186
|
-
},
|
|
187
|
-
const
|
|
421
|
+
}, qt = (e, t, a, r) => e.id === "noValue" ? t.get(He)?.count ?? (r ? 0 : void 0) : e.id === "hasValue" ? r ? a : void 0 : t.get(e.id)?.count ?? (e.name ? t.get(e.name)?.count : void 0) ?? (r ? 0 : void 0), Ke = (e, t, a, r) => t ? e.map((d) => {
|
|
422
|
+
const l = qt(d, t, a, r);
|
|
188
423
|
return {
|
|
189
424
|
...d,
|
|
190
|
-
badge:
|
|
191
|
-
subRows: d.subRows?.length ?
|
|
425
|
+
badge: l != null ? String(l) : d.badge,
|
|
426
|
+
subRows: d.subRows?.length ? Ke(d.subRows, t, a, r) : d.subRows
|
|
192
427
|
};
|
|
193
|
-
}) :
|
|
428
|
+
}) : e, Qt = (e) => ({
|
|
194
429
|
id: "noValue",
|
|
195
430
|
name: "noValue",
|
|
196
|
-
label: `No ${
|
|
431
|
+
label: `No ${e}`,
|
|
197
432
|
icon: "unpublished",
|
|
198
433
|
subRows: [],
|
|
199
434
|
data: {
|
|
200
435
|
id: "noValue"
|
|
201
436
|
}
|
|
202
|
-
}),
|
|
437
|
+
}), Yt = (e) => ({
|
|
203
438
|
id: "hasValue",
|
|
204
439
|
name: "hasValue",
|
|
205
|
-
label: `Some ${
|
|
440
|
+
label: `Some ${e}`,
|
|
206
441
|
icon: "check",
|
|
207
442
|
subRows: [],
|
|
208
443
|
data: {
|
|
209
444
|
id: "hasValue"
|
|
210
445
|
}
|
|
211
|
-
}),
|
|
446
|
+
}), Ae = [
|
|
212
447
|
{
|
|
213
448
|
label: "Hierarchy",
|
|
214
449
|
value: "hierarchy",
|
|
@@ -227,17 +462,17 @@ const st = ({ projectName: a, useExtraSlices: n }) => {
|
|
|
227
462
|
{
|
|
228
463
|
label: "Task Type",
|
|
229
464
|
value: "taskType",
|
|
230
|
-
icon:
|
|
465
|
+
icon: ge("task")
|
|
231
466
|
},
|
|
232
467
|
{
|
|
233
468
|
label: "Folder Type",
|
|
234
469
|
value: "folderType",
|
|
235
|
-
icon:
|
|
470
|
+
icon: ge("folder")
|
|
236
471
|
},
|
|
237
472
|
{
|
|
238
473
|
label: "Product Type",
|
|
239
474
|
value: "productType",
|
|
240
|
-
icon:
|
|
475
|
+
icon: ge("product")
|
|
241
476
|
},
|
|
242
477
|
{
|
|
243
478
|
label: "Author",
|
|
@@ -249,366 +484,387 @@ const st = ({ projectName: a, useExtraSlices: n }) => {
|
|
|
249
484
|
value: "entityList",
|
|
250
485
|
icon: "list_alt"
|
|
251
486
|
}
|
|
252
|
-
],
|
|
253
|
-
sliceFields:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
487
|
+
], Jt = ({
|
|
488
|
+
sliceFields: e,
|
|
489
|
+
usedSliceTypes: t = [],
|
|
490
|
+
entityTypes: a = [],
|
|
491
|
+
counts: r,
|
|
492
|
+
filled: d = 0,
|
|
493
|
+
countsComplete: l = !1,
|
|
494
|
+
sliceType: f,
|
|
495
|
+
onSliceTypeChange: S
|
|
258
496
|
}) => {
|
|
259
|
-
const {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
497
|
+
const {
|
|
498
|
+
sliceType: m,
|
|
499
|
+
onSliceTypeChange: p,
|
|
500
|
+
useExtraSlices: g,
|
|
501
|
+
isLoadingExtraSlices: L
|
|
502
|
+
} = xe(), u = f ?? m, b = S ?? p, { projectName: h } = ue(), { formatAttribute: i } = g(), c = e.filter((C) => Ae.some((R) => R.value === C.value)).map((C) => ({
|
|
503
|
+
...Ae.find((_) => _.value === C.value),
|
|
504
|
+
...C
|
|
505
|
+
})), s = e.some((C) => C.value === "attributes"), o = u?.startsWith("attrib.") ? u.slice(7) : void 0, y = O(
|
|
506
|
+
() => o ? [o] : [],
|
|
507
|
+
[o]
|
|
508
|
+
), { attributes: n, isLoading: I } = Bt({
|
|
509
|
+
entityTypes: a,
|
|
510
|
+
request: y
|
|
268
511
|
});
|
|
269
|
-
|
|
270
|
-
(
|
|
271
|
-
label:
|
|
272
|
-
value: "attrib." +
|
|
273
|
-
icon:
|
|
512
|
+
s && typeof i == "function" && n.forEach(
|
|
513
|
+
(C) => c.push({
|
|
514
|
+
label: C.data.title || C.name,
|
|
515
|
+
value: "attrib." + C.name,
|
|
516
|
+
icon: Tt(C.name, C.data.type, Ue(C.data))
|
|
274
517
|
})
|
|
275
518
|
);
|
|
276
|
-
const [
|
|
277
|
-
project:
|
|
278
|
-
getStatuses:
|
|
279
|
-
getTypes:
|
|
280
|
-
getTaskTypes:
|
|
281
|
-
getProductTypes:
|
|
282
|
-
getAttribute:
|
|
283
|
-
isLoading:
|
|
284
|
-
} =
|
|
285
|
-
data:
|
|
286
|
-
getData:
|
|
287
|
-
isFetching:
|
|
288
|
-
} =
|
|
289
|
-
projectName:
|
|
290
|
-
folderTypes:
|
|
519
|
+
const [T, v] = U(!1), H = !!n.find((C) => C.name === o)?.enumIsLoading, {
|
|
520
|
+
project: oe,
|
|
521
|
+
getStatuses: ae,
|
|
522
|
+
getTypes: q,
|
|
523
|
+
getTaskTypes: ie,
|
|
524
|
+
getProductTypes: Z,
|
|
525
|
+
getAttribute: ee,
|
|
526
|
+
isLoading: B
|
|
527
|
+
} = Ht({ scopes: a, useExtraSlices: g }), {
|
|
528
|
+
data: te,
|
|
529
|
+
getData: Q,
|
|
530
|
+
isFetching: Y
|
|
531
|
+
} = st({
|
|
532
|
+
projectName: h || "",
|
|
533
|
+
folderTypes: oe?.folderTypes || [],
|
|
291
534
|
includeColors: !0
|
|
292
|
-
}), { getData:
|
|
293
|
-
projectName:
|
|
294
|
-
useExtraSlices:
|
|
535
|
+
}), { getData: x, isLoading: D } = Vt({
|
|
536
|
+
projectName: h,
|
|
537
|
+
useExtraSlices: g
|
|
295
538
|
}), {
|
|
296
|
-
getData:
|
|
297
|
-
isLoading:
|
|
298
|
-
isExpandable:
|
|
299
|
-
} =
|
|
539
|
+
getData: P,
|
|
540
|
+
isLoading: K,
|
|
541
|
+
isExpandable: re
|
|
542
|
+
} = Wt(u === "entityList"), j = Y || B || D || L && u !== "hierarchy" || K && u === "entityList" || I || H, N = {
|
|
300
543
|
hierarchy: {
|
|
301
|
-
getData:
|
|
302
|
-
isLoading:
|
|
544
|
+
getData: Q,
|
|
545
|
+
isLoading: Y,
|
|
303
546
|
isExpandable: !0
|
|
304
547
|
},
|
|
305
548
|
assignees: {
|
|
306
|
-
getData:
|
|
307
|
-
isLoading:
|
|
549
|
+
getData: x,
|
|
550
|
+
isLoading: D,
|
|
308
551
|
isExpandable: !1,
|
|
309
552
|
noValue: !0,
|
|
310
553
|
hasValue: !0
|
|
311
554
|
},
|
|
312
555
|
author: {
|
|
313
|
-
getData:
|
|
314
|
-
isLoading:
|
|
556
|
+
getData: x,
|
|
557
|
+
isLoading: D,
|
|
315
558
|
isExpandable: !1
|
|
316
559
|
},
|
|
317
560
|
status: {
|
|
318
|
-
getData:
|
|
319
|
-
isLoading:
|
|
561
|
+
getData: ae,
|
|
562
|
+
isLoading: B,
|
|
320
563
|
isExpandable: !1
|
|
321
564
|
},
|
|
322
565
|
type: {
|
|
323
|
-
getData:
|
|
324
|
-
isLoading:
|
|
566
|
+
getData: q,
|
|
567
|
+
isLoading: B,
|
|
325
568
|
isExpandable: !0
|
|
326
569
|
},
|
|
327
570
|
taskType: {
|
|
328
|
-
getData:
|
|
329
|
-
isLoading:
|
|
571
|
+
getData: ie,
|
|
572
|
+
isLoading: B,
|
|
330
573
|
isExpandable: !1
|
|
331
574
|
},
|
|
332
575
|
productType: {
|
|
333
|
-
getData:
|
|
576
|
+
getData: Z,
|
|
334
577
|
isLoading: !1,
|
|
335
578
|
isExpandable: !1
|
|
336
579
|
},
|
|
337
580
|
entityList: {
|
|
338
|
-
getData:
|
|
339
|
-
isLoading:
|
|
340
|
-
isExpandable:
|
|
581
|
+
getData: P,
|
|
582
|
+
isLoading: K,
|
|
583
|
+
isExpandable: re
|
|
341
584
|
}
|
|
342
585
|
};
|
|
343
|
-
for (const
|
|
344
|
-
|
|
345
|
-
getData: () =>
|
|
346
|
-
isLoading:
|
|
586
|
+
for (const C of n)
|
|
587
|
+
N["attrib." + C.name] = {
|
|
588
|
+
getData: () => ee(C),
|
|
589
|
+
isLoading: I || !!C.enumIsLoading,
|
|
347
590
|
isExpandable: !1,
|
|
348
591
|
isAttribute: !0
|
|
349
592
|
};
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
593
|
+
const pe = { data: [], isExpandable: !1 }, [le, fe] = U(pe), $ = N[u], ne = c.find(
|
|
594
|
+
(C) => N[C.value] && !t.includes(C.value)
|
|
595
|
+
)?.value;
|
|
596
|
+
se(() => {
|
|
597
|
+
j || $ || !ne || b(ne, !1);
|
|
598
|
+
}, [j, $, ne]);
|
|
599
|
+
const z = (C, R) => {
|
|
600
|
+
const _ = N[C];
|
|
601
|
+
if (!_) {
|
|
602
|
+
console.warn(`Slice type ${C} not found`);
|
|
354
603
|
return;
|
|
355
604
|
}
|
|
356
|
-
(
|
|
605
|
+
(_.isAttribute && s || e.some((ce) => ce.value === C)) && b(C, R);
|
|
357
606
|
};
|
|
358
|
-
|
|
359
|
-
if (
|
|
607
|
+
se(() => {
|
|
608
|
+
if (j) return;
|
|
360
609
|
(async () => {
|
|
361
610
|
try {
|
|
362
611
|
if (!$) return;
|
|
363
|
-
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
612
|
+
v(!0);
|
|
613
|
+
const R = await $.getData();
|
|
614
|
+
if (R === void 0)
|
|
366
615
|
throw window.alert(
|
|
367
616
|
"Slice options failed to load. This likely means the PowerFeatures addon is out of date. Please update to the latest version."
|
|
368
|
-
),
|
|
369
|
-
$.hasValue &&
|
|
370
|
-
data:
|
|
617
|
+
), b(ne ?? "hierarchy", !1), new Error("Slice data is undefined");
|
|
618
|
+
$.hasValue && R.unshift(Yt(u)), $.noValue && R.unshift(Qt(u)), fe({
|
|
619
|
+
data: R,
|
|
371
620
|
isExpandable: $.isExpandable
|
|
372
621
|
});
|
|
373
|
-
} catch (
|
|
374
|
-
console.error("Error fetching slice data:",
|
|
622
|
+
} catch (R) {
|
|
623
|
+
console.error("Error fetching slice data:", R), fe(pe);
|
|
375
624
|
} finally {
|
|
376
|
-
|
|
625
|
+
v(!1);
|
|
377
626
|
}
|
|
378
627
|
})();
|
|
379
|
-
}, [
|
|
380
|
-
const
|
|
381
|
-
() =>
|
|
382
|
-
[
|
|
383
|
-
),
|
|
384
|
-
const
|
|
385
|
-
for (;
|
|
386
|
-
const
|
|
387
|
-
if (
|
|
388
|
-
for (const
|
|
389
|
-
|
|
628
|
+
}, [u, h, j, u === "hierarchy" ? te : null]);
|
|
629
|
+
const F = O(
|
|
630
|
+
() => Ke(le.data, r, d, l),
|
|
631
|
+
[le.data, r, d, l]
|
|
632
|
+
), Le = O(() => {
|
|
633
|
+
const C = /* @__PURE__ */ new Map(), R = [...F];
|
|
634
|
+
for (; R.length > 0; ) {
|
|
635
|
+
const _ = R.shift();
|
|
636
|
+
if (_ && (C.set(_.id, _), _.subRows && _.subRows.length > 0))
|
|
637
|
+
for (const ce of _.subRows)
|
|
638
|
+
R.push(ce);
|
|
390
639
|
}
|
|
391
|
-
return
|
|
392
|
-
}, [
|
|
640
|
+
return C;
|
|
641
|
+
}, [F]);
|
|
393
642
|
return {
|
|
394
|
-
sliceOptions:
|
|
395
|
-
table: { ...
|
|
396
|
-
sliceMap:
|
|
397
|
-
isLoading:
|
|
398
|
-
sliceType:
|
|
399
|
-
handleSliceTypeChange:
|
|
643
|
+
sliceOptions: c,
|
|
644
|
+
table: { ...le, data: F },
|
|
645
|
+
sliceMap: Le,
|
|
646
|
+
isLoading: N[u] && N[u].isLoading || T || j,
|
|
647
|
+
sliceType: u,
|
|
648
|
+
handleSliceTypeChange: z
|
|
400
649
|
};
|
|
401
|
-
},
|
|
402
|
-
const
|
|
650
|
+
}, Xt = /* @__PURE__ */ new Map(), Zt = (e, t, a, r) => {
|
|
651
|
+
const d = O(() => ({ id: t, desc: !1 }), [t]), l = O(
|
|
652
|
+
() => (a ?? []).filter((h) => h !== t).map((h) => ({ id: h, desc: !1 })),
|
|
653
|
+
[a, t]
|
|
654
|
+
), f = !!r || !e, S = e?.entity === "version" ? { entity: "version", groupBy: d, extraGroupBys: l, args: e.args, skip: f } : {
|
|
403
655
|
entity: "task",
|
|
404
|
-
groupBy:
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
656
|
+
groupBy: d,
|
|
657
|
+
extraGroupBys: l,
|
|
658
|
+
args: e?.args ?? { projectName: "" },
|
|
659
|
+
skip: f
|
|
660
|
+
}, { counts: m, total: p, complete: g } = yt(S), L = m?.get(He)?.count ?? 0, u = Math.max(p - L, 0);
|
|
408
661
|
return {
|
|
409
|
-
counts:
|
|
410
|
-
total:
|
|
411
|
-
filled:
|
|
412
|
-
complete: !
|
|
662
|
+
counts: f ? void 0 : m ?? (g ? Xt : void 0),
|
|
663
|
+
total: p,
|
|
664
|
+
filled: u,
|
|
665
|
+
complete: !f && g
|
|
413
666
|
};
|
|
414
|
-
},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
667
|
+
}, en = V.div`
|
|
668
|
+
display: flex;
|
|
669
|
+
align-items: center;
|
|
670
|
+
|
|
671
|
+
&.open {
|
|
672
|
+
flex: 1;
|
|
673
|
+
min-width: 0;
|
|
674
|
+
}
|
|
675
|
+
`, tn = V(vt)`
|
|
676
|
+
flex: 1;
|
|
677
|
+
min-width: 0;
|
|
420
678
|
height: 28px;
|
|
421
679
|
min-height: 28px;
|
|
422
|
-
`,
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
680
|
+
`, nn = ({ open: e, value: t, subject: a, onChange: r }) => {
|
|
681
|
+
const d = () => r(e ? void 0 : ""), l = (f) => {
|
|
682
|
+
f.key === "Escape" && r(void 0);
|
|
683
|
+
};
|
|
684
|
+
return /* @__PURE__ */ G(en, { className: W({ open: e }), children: [
|
|
685
|
+
e && /* @__PURE__ */ E(
|
|
686
|
+
tn,
|
|
427
687
|
{
|
|
428
|
-
value:
|
|
429
|
-
onChange: (
|
|
688
|
+
value: t,
|
|
689
|
+
onChange: (f) => r(f.target.value),
|
|
430
690
|
placeholder: "Search",
|
|
431
691
|
autoFocus: !0,
|
|
432
|
-
onKeyDown:
|
|
433
|
-
u.key === "Escape" && (l(!1), n(""));
|
|
434
|
-
}
|
|
692
|
+
onKeyDown: l
|
|
435
693
|
}
|
|
436
694
|
),
|
|
437
|
-
/* @__PURE__ */
|
|
438
|
-
|
|
695
|
+
/* @__PURE__ */ E(
|
|
696
|
+
he,
|
|
439
697
|
{
|
|
440
|
-
icon:
|
|
441
|
-
onClick:
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
className: ie({ open: i }),
|
|
445
|
-
"data-tooltip": i ? "Close search" : "Search folders"
|
|
698
|
+
icon: e ? "close" : "search",
|
|
699
|
+
onClick: d,
|
|
700
|
+
className: W({ open: e }),
|
|
701
|
+
"data-tooltip": e ? "Close search" : `Search ${a}`
|
|
446
702
|
}
|
|
447
703
|
)
|
|
448
704
|
] });
|
|
449
|
-
},
|
|
450
|
-
|
|
451
|
-
},
|
|
452
|
-
const { onOpenNew: d } =
|
|
453
|
-
(
|
|
454
|
-
[
|
|
455
|
-
),
|
|
705
|
+
}, Ie = (e, t) => {
|
|
706
|
+
e.toggleExpanded(t), e.subRows?.forEach((a) => Ie(a, t));
|
|
707
|
+
}, Oe = (e) => e.map((t) => t.id).filter(Boolean), sn = (e, t, a, r) => {
|
|
708
|
+
const { onOpenNew: d } = Ct(), { projectName: l } = ue(), { setEntities: f } = Et(), S = Dt(), [m] = Ve(), { deleteEntities: p } = kt(), [g, L] = U(null), u = A(
|
|
709
|
+
(c, s) => s.map((o) => t?.get(o) || (o === c.id ? c : void 0)).filter((o) => !!o),
|
|
710
|
+
[t]
|
|
711
|
+
), b = O(
|
|
456
712
|
() => ({
|
|
457
|
-
onShowDetails: (
|
|
458
|
-
|
|
713
|
+
onShowDetails: (c, s = [c.id]) => {
|
|
714
|
+
f({
|
|
459
715
|
entityType: "folder",
|
|
460
|
-
entities:
|
|
716
|
+
entities: s.map((o) => ({ id: o, projectName: l }))
|
|
461
717
|
});
|
|
462
718
|
},
|
|
463
|
-
onAddToList:
|
|
464
|
-
onMove: (
|
|
465
|
-
|
|
466
|
-
entities:
|
|
467
|
-
entityId:
|
|
468
|
-
entityType:
|
|
469
|
-
currentParentId:
|
|
719
|
+
onAddToList: e,
|
|
720
|
+
onMove: (c) => {
|
|
721
|
+
r?.({
|
|
722
|
+
entities: c.map((s) => ({
|
|
723
|
+
entityId: s.id,
|
|
724
|
+
entityType: s.data?.entityType === "task" ? "task" : "folder",
|
|
725
|
+
currentParentId: s.parentId || s.data?.parentId
|
|
470
726
|
}))
|
|
471
727
|
});
|
|
472
728
|
},
|
|
473
|
-
onRename: (
|
|
474
|
-
onOpenViewer: (
|
|
475
|
-
onUploadVersion: (
|
|
476
|
-
const
|
|
477
|
-
o &&
|
|
729
|
+
onRename: (c) => L(c),
|
|
730
|
+
onOpenViewer: (c) => a?.(c, l),
|
|
731
|
+
onUploadVersion: (c) => {
|
|
732
|
+
const s = c.data?.entityType === "task", o = s ? c.parentId || c.data?.parentId : c.id;
|
|
733
|
+
o && S?.onOpenVersionUpload({
|
|
478
734
|
folderId: o,
|
|
479
|
-
taskId:
|
|
735
|
+
taskId: s ? c.id : void 0
|
|
480
736
|
});
|
|
481
737
|
},
|
|
482
|
-
onDelete: (
|
|
483
|
-
const
|
|
484
|
-
const
|
|
738
|
+
onDelete: (c) => {
|
|
739
|
+
const s = c.map((o) => {
|
|
740
|
+
const y = o.data?.entityType === "task" ? "task" : "folder", n = o.parentId || o.data?.parentId;
|
|
485
741
|
return {
|
|
486
742
|
id: o.id,
|
|
487
|
-
entityType:
|
|
743
|
+
entityType: y,
|
|
488
744
|
name: o.name,
|
|
489
745
|
label: o.label,
|
|
490
|
-
projectName:
|
|
491
|
-
folderId:
|
|
492
|
-
parentId:
|
|
746
|
+
projectName: l,
|
|
747
|
+
folderId: y === "task" ? n : void 0,
|
|
748
|
+
parentId: y === "folder" ? n : void 0
|
|
493
749
|
};
|
|
494
750
|
});
|
|
495
|
-
|
|
751
|
+
p(s);
|
|
496
752
|
}
|
|
497
753
|
}),
|
|
498
754
|
[
|
|
755
|
+
e,
|
|
499
756
|
a,
|
|
500
|
-
i,
|
|
501
|
-
l,
|
|
502
757
|
r,
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
758
|
+
l,
|
|
759
|
+
f,
|
|
760
|
+
p,
|
|
761
|
+
S
|
|
506
762
|
]
|
|
507
|
-
),
|
|
508
|
-
(
|
|
509
|
-
|
|
510
|
-
projectName:
|
|
763
|
+
), h = A(
|
|
764
|
+
(c) => {
|
|
765
|
+
g && (m({
|
|
766
|
+
projectName: l,
|
|
511
767
|
operationsRequestModel: {
|
|
512
768
|
operations: [
|
|
513
769
|
{
|
|
514
770
|
type: "update",
|
|
515
|
-
entityType:
|
|
516
|
-
entityId:
|
|
517
|
-
data: { label:
|
|
771
|
+
entityType: g.data?.entityType === "task" ? "task" : "folder",
|
|
772
|
+
entityId: g.id,
|
|
773
|
+
data: { label: c }
|
|
518
774
|
}
|
|
519
775
|
]
|
|
520
776
|
}
|
|
521
|
-
}),
|
|
777
|
+
}), L(null));
|
|
522
778
|
},
|
|
523
|
-
[
|
|
779
|
+
[l, g, m]
|
|
524
780
|
);
|
|
525
781
|
return {
|
|
526
|
-
rowContextMenuBuilders:
|
|
782
|
+
rowContextMenuBuilders: O(
|
|
527
783
|
() => [
|
|
528
|
-
(
|
|
784
|
+
(c, { row: s, selectedRows: o }) => ({
|
|
529
785
|
label: "Show details",
|
|
530
786
|
icon: "dock_to_left",
|
|
531
|
-
shortcut:
|
|
532
|
-
command: () =>
|
|
787
|
+
shortcut: wt("click", [Lt.Alt]),
|
|
788
|
+
command: () => b.onShowDetails(s.original, o)
|
|
533
789
|
}),
|
|
534
|
-
(
|
|
790
|
+
(c, { row: s }) => ({
|
|
535
791
|
label: "Rename label",
|
|
536
792
|
icon: "titlecase",
|
|
537
793
|
shortcut: "R",
|
|
538
|
-
command: () =>
|
|
794
|
+
command: () => b.onRename(s.original)
|
|
539
795
|
}),
|
|
540
|
-
(
|
|
796
|
+
(c, { row: s }) => ({
|
|
541
797
|
label: "Open in viewer",
|
|
542
798
|
icon: "play_circle",
|
|
543
|
-
command: () =>
|
|
544
|
-
hidden: !
|
|
799
|
+
command: () => b.onOpenViewer(s.original),
|
|
800
|
+
hidden: !a
|
|
545
801
|
}),
|
|
546
|
-
(
|
|
802
|
+
(c, { selectedTableRows: s }) => ({
|
|
547
803
|
label: "Expand all children",
|
|
548
804
|
icon: "expand_all",
|
|
549
|
-
command: () =>
|
|
550
|
-
hidden: !
|
|
805
|
+
command: () => s.filter((o) => o.getCanExpand() && !o.getIsExpanded()).forEach((o) => Ie(o, !0)),
|
|
806
|
+
hidden: !s.some(
|
|
551
807
|
(o) => o.getCanExpand() && !o.getIsExpanded()
|
|
552
808
|
)
|
|
553
809
|
}),
|
|
554
|
-
(
|
|
810
|
+
(c, { selectedTableRows: s }) => ({
|
|
555
811
|
label: "Collapse all children",
|
|
556
812
|
icon: "collapse_all",
|
|
557
|
-
command: () =>
|
|
558
|
-
hidden: !
|
|
813
|
+
command: () => s.filter((o) => o.getCanExpand() && o.getIsExpanded()).forEach((o) => Ie(o, !1)),
|
|
814
|
+
hidden: !s.some(
|
|
559
815
|
(o) => o.getCanExpand() && o.getIsExpanded()
|
|
560
816
|
)
|
|
561
817
|
}),
|
|
562
|
-
(
|
|
563
|
-
const
|
|
564
|
-
return
|
|
818
|
+
(c, { row: s, selectedRows: o }) => {
|
|
819
|
+
const y = b.onAddToList?.(s.original, o);
|
|
820
|
+
return y ? Array.isArray(y) ? y : [y] : void 0;
|
|
565
821
|
},
|
|
566
|
-
(
|
|
822
|
+
(c, { row: s }) => ({
|
|
567
823
|
label: "Upload version",
|
|
568
824
|
icon: "upload",
|
|
569
|
-
command: () =>
|
|
825
|
+
command: () => b.onUploadVersion(s.original)
|
|
570
826
|
}),
|
|
571
|
-
(
|
|
827
|
+
(c, { row: s, selectedRows: o }) => ({
|
|
572
828
|
label: "Move",
|
|
573
829
|
icon: "drive_file_move",
|
|
574
|
-
command: () =>
|
|
575
|
-
hidden: !
|
|
830
|
+
command: () => b.onMove(u(s.original, o)),
|
|
831
|
+
hidden: !r
|
|
576
832
|
}),
|
|
577
|
-
(
|
|
578
|
-
label:
|
|
579
|
-
icon:
|
|
833
|
+
(c, { row: s, selectedRows: o }) => ({
|
|
834
|
+
label: me.folder.createLabel,
|
|
835
|
+
icon: me.folder.icon,
|
|
580
836
|
command: () => d?.("folder", {
|
|
581
|
-
parentFolderIds:
|
|
582
|
-
|
|
837
|
+
parentFolderIds: Oe(
|
|
838
|
+
u(s.original, o)
|
|
583
839
|
)
|
|
584
840
|
})
|
|
585
841
|
}),
|
|
586
|
-
(
|
|
587
|
-
label:
|
|
588
|
-
icon:
|
|
842
|
+
(c, { row: s, selectedRows: o }) => ({
|
|
843
|
+
label: me.task.createLabel,
|
|
844
|
+
icon: me.task.icon,
|
|
589
845
|
command: () => d?.("task", {
|
|
590
|
-
parentFolderIds:
|
|
591
|
-
|
|
846
|
+
parentFolderIds: Oe(
|
|
847
|
+
u(s.original, o)
|
|
592
848
|
)
|
|
593
849
|
})
|
|
594
850
|
}),
|
|
595
|
-
(
|
|
851
|
+
(c, { row: s, selectedRows: o }) => ({
|
|
596
852
|
label: "Delete",
|
|
597
853
|
icon: "delete",
|
|
598
854
|
danger: !0,
|
|
599
|
-
command: () =>
|
|
855
|
+
command: () => b.onDelete(u(s.original, o))
|
|
600
856
|
})
|
|
601
857
|
],
|
|
602
|
-
[
|
|
858
|
+
[b, u, d]
|
|
603
859
|
),
|
|
604
|
-
onOptionClick:
|
|
605
|
-
onRename:
|
|
606
|
-
renamingRow:
|
|
607
|
-
renameInitialValue:
|
|
608
|
-
onSubmitRename:
|
|
609
|
-
onCancelRename: () =>
|
|
860
|
+
onOptionClick: b.onShowDetails,
|
|
861
|
+
onRename: b.onRename,
|
|
862
|
+
renamingRow: g,
|
|
863
|
+
renameInitialValue: g?.label || g?.name || "",
|
|
864
|
+
onSubmitRename: h,
|
|
865
|
+
onCancelRename: () => L(null)
|
|
610
866
|
};
|
|
611
|
-
},
|
|
867
|
+
}, on = V(It)`
|
|
612
868
|
/* put above the menu so it's still clickable */
|
|
613
869
|
/* NOTE: this will need fixing as this also puts it above dialogs */
|
|
614
870
|
/* z-index: 1001; */
|
|
@@ -639,7 +895,7 @@ const st = ({ projectName: a, useExtraSlices: n }) => {
|
|
|
639
895
|
}
|
|
640
896
|
}
|
|
641
897
|
`;
|
|
642
|
-
|
|
898
|
+
V.div`
|
|
643
899
|
display: flex;
|
|
644
900
|
flex-direction: column;
|
|
645
901
|
gap: var(--base-gap-large);
|
|
@@ -661,361 +917,545 @@ K.div`
|
|
|
661
917
|
font-weight: 600;
|
|
662
918
|
}
|
|
663
919
|
`;
|
|
664
|
-
const
|
|
665
|
-
const
|
|
666
|
-
return
|
|
667
|
-
},
|
|
668
|
-
const
|
|
669
|
-
return
|
|
670
|
-
const [, d,
|
|
671
|
-
if (!d || !
|
|
672
|
-
const
|
|
920
|
+
const an = (e, t, a) => {
|
|
921
|
+
const r = `${t}${a === 1 ? "" : "s"}`;
|
|
922
|
+
return e === "created" ? `new ${r}` : e === "deleted" ? `${r} deleted` : `${a} ${r} ${e.replaceAll("_", " ")}`;
|
|
923
|
+
}, rn = (e) => {
|
|
924
|
+
const t = /* @__PURE__ */ new Map();
|
|
925
|
+
return e.forEach((r) => {
|
|
926
|
+
const [, d, l] = r.topic.split(".");
|
|
927
|
+
if (!d || !l) return;
|
|
928
|
+
const f = `${d}.${l}`, S = t.get(f) || {
|
|
673
929
|
entityType: d,
|
|
674
|
-
updateType:
|
|
930
|
+
updateType: l,
|
|
675
931
|
ids: /* @__PURE__ */ new Set()
|
|
676
932
|
};
|
|
677
|
-
|
|
678
|
-
}), `${Array.from(
|
|
679
|
-
({ entityType:
|
|
933
|
+
S.ids.add(r.entityId || String(r.id)), t.set(f, S);
|
|
934
|
+
}), `${Array.from(t.values()).map(
|
|
935
|
+
({ entityType: r, updateType: d, ids: l }) => an(d, r, l.size)
|
|
680
936
|
).join(", ")} since last sync`;
|
|
681
|
-
},
|
|
682
|
-
({ projectNames:
|
|
683
|
-
const [
|
|
684
|
-
|
|
685
|
-
const
|
|
686
|
-
|
|
687
|
-
}, []),
|
|
688
|
-
const
|
|
689
|
-
|
|
937
|
+
}, ln = Je(
|
|
938
|
+
({ projectNames: e, topics: t, onSync: a, shouldSyncOnUpdate: r, hideWhenNoUpdates: d = !1, ...l }, f) => {
|
|
939
|
+
const [S, m] = U(!1), [p, g] = Rt(), { setMenuOpen: L } = Mt(), u = ye(null), b = ye(), h = Xe();
|
|
940
|
+
se(() => () => {
|
|
941
|
+
const v = b.current;
|
|
942
|
+
b.current = void 0, v !== void 0 && clearTimeout(v);
|
|
943
|
+
}, []), Ze(f, () => u.current, []);
|
|
944
|
+
const i = async () => {
|
|
945
|
+
m(!0);
|
|
690
946
|
try {
|
|
691
|
-
await
|
|
947
|
+
await a?.(c);
|
|
692
948
|
} finally {
|
|
693
|
-
|
|
949
|
+
m(!1);
|
|
694
950
|
}
|
|
695
|
-
}, { updates:
|
|
696
|
-
projectNames:
|
|
697
|
-
topics:
|
|
698
|
-
isSyncing:
|
|
699
|
-
shouldSyncOnUpdate:
|
|
951
|
+
}, { updates: c, hasUpdates: s } = Pt({
|
|
952
|
+
projectNames: e,
|
|
953
|
+
topics: t,
|
|
954
|
+
isSyncing: S,
|
|
955
|
+
shouldSyncOnUpdate: r
|
|
700
956
|
});
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
|
|
957
|
+
if (se(() => {
|
|
958
|
+
const v = (k) => {
|
|
959
|
+
k.repeat || !k.shiftKey || k.ctrlKey || k.metaKey || k.key.toLowerCase() !== "r" || St(k) || (k.preventDefault(), k.stopPropagation(), i());
|
|
704
960
|
};
|
|
705
|
-
return window.addEventListener("keydown",
|
|
706
|
-
}, [
|
|
707
|
-
const o =
|
|
708
|
-
Object.values(
|
|
709
|
-
const
|
|
710
|
-
|
|
961
|
+
return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
|
|
962
|
+
}, [i]), d && !s) return null;
|
|
963
|
+
const o = rn(c), y = Object.values(p).some(Boolean);
|
|
964
|
+
Object.values(p).every(Boolean);
|
|
965
|
+
const n = () => {
|
|
966
|
+
b.current && clearTimeout(b.current);
|
|
711
967
|
};
|
|
712
|
-
return /* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
|
|
968
|
+
return /* @__PURE__ */ G($e, { children: [
|
|
969
|
+
/* @__PURE__ */ E(
|
|
970
|
+
on,
|
|
715
971
|
{
|
|
716
|
-
...
|
|
972
|
+
...l,
|
|
717
973
|
icon: "sync",
|
|
718
|
-
ref:
|
|
719
|
-
onClick:
|
|
974
|
+
ref: u,
|
|
975
|
+
onClick: i,
|
|
720
976
|
onMouseEnter: () => {
|
|
721
|
-
|
|
977
|
+
n(), L(h);
|
|
722
978
|
},
|
|
723
979
|
onMouseLeave: () => {
|
|
724
|
-
|
|
980
|
+
n(), b.current = setTimeout(() => L(!1), 100);
|
|
725
981
|
},
|
|
726
|
-
className:
|
|
727
|
-
syncing:
|
|
728
|
-
"has-updates":
|
|
729
|
-
"auto-sync":
|
|
982
|
+
className: W(l.className, {
|
|
983
|
+
syncing: S,
|
|
984
|
+
"has-updates": s,
|
|
985
|
+
"auto-sync": y && !Pe
|
|
730
986
|
}),
|
|
731
987
|
"data-shortcut": "Shift+R",
|
|
732
|
-
"data-tooltip":
|
|
733
|
-
variant:
|
|
988
|
+
"data-tooltip": s ? o : "Refresh data",
|
|
989
|
+
variant: s ? "filled" : "surface"
|
|
734
990
|
}
|
|
735
991
|
),
|
|
736
|
-
!
|
|
992
|
+
!Pe
|
|
737
993
|
] });
|
|
738
994
|
}
|
|
739
|
-
),
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
const c = t.match(/name '.*?, (.+?)' already exists/);
|
|
779
|
-
t = `Cannot move "${c ? c[1] : "this task"}" - a task with this name already exists in the target folder`;
|
|
780
|
-
} else {
|
|
781
|
-
const c = t.match(/name '.*?, (.+?)' already exists/);
|
|
782
|
-
t = `Cannot move "${c ? c[1] : "this folder"}" - a folder with this name already exists in the target location`;
|
|
783
|
-
}
|
|
784
|
-
ce.error(t);
|
|
785
|
-
} finally {
|
|
786
|
-
i();
|
|
787
|
-
}
|
|
788
|
-
},
|
|
789
|
-
[n, a, d, i, l]
|
|
790
|
-
), S = M(async () => {
|
|
791
|
-
if (n)
|
|
792
|
-
try {
|
|
793
|
-
const g = n.entities.map(
|
|
794
|
-
(t, o) => ({
|
|
795
|
-
id: `move-to-root-${t.entityId}-${Date.now()}-${o}`,
|
|
796
|
-
type: "update",
|
|
797
|
-
entityType: t.entityType,
|
|
798
|
-
entityId: t.entityId,
|
|
799
|
-
data: t.entityType === "folder" ? { parentId: null } : { folderId: null }
|
|
800
|
-
})
|
|
801
|
-
), s = (await d({
|
|
802
|
-
projectName: a,
|
|
803
|
-
operationsRequestModel: {
|
|
804
|
-
operations: g
|
|
805
|
-
}
|
|
806
|
-
}).unwrap())?.operations?.filter((t) => t.success === !1) || [];
|
|
807
|
-
if (s.length > 0) {
|
|
808
|
-
const t = s.map((o) => o.detail).join(", ");
|
|
809
|
-
throw new Error(t || "Some move operations failed");
|
|
810
|
-
}
|
|
811
|
-
} catch (g) {
|
|
812
|
-
let h = de(g) || "Failed to move entities to root";
|
|
813
|
-
ce.error(h);
|
|
814
|
-
} finally {
|
|
815
|
-
i();
|
|
816
|
-
}
|
|
817
|
-
}, [n, a, d, i]), w = M(() => {
|
|
818
|
-
if (!n) return [];
|
|
819
|
-
const g = [];
|
|
820
|
-
return n.entities.forEach((h) => {
|
|
821
|
-
g.push(h.entityId);
|
|
822
|
-
}), u.forEach((h) => {
|
|
823
|
-
n.entities.some((t) => {
|
|
824
|
-
const o = v(t.entityId);
|
|
825
|
-
return o?.name ? y.filter((e) => t.entityType === "folder" ? e.entityType === "folder" && e.parentId === h.id : t.entityType === "task" ? e.entityType === "task" && e.folderId === h.id : !1).some(
|
|
826
|
-
(e) => e.name === o.name && e.entityId !== t.entityId
|
|
827
|
-
) : !1;
|
|
828
|
-
}) && g.push(h.id);
|
|
829
|
-
}), [...new Set(g)];
|
|
830
|
-
}, [n, u, y, v]), p = M(
|
|
831
|
-
(g) => {
|
|
832
|
-
if (!n) return;
|
|
833
|
-
if (n.entities.some(
|
|
834
|
-
(c) => c.entityType === "folder" && c.entityId === g
|
|
835
|
-
))
|
|
836
|
-
return "Cannot move folder to itself";
|
|
837
|
-
if (n.entities.some(
|
|
838
|
-
(c) => c.currentParentId === g
|
|
839
|
-
))
|
|
840
|
-
return "Cannot move to the same location";
|
|
841
|
-
const t = u.find((c) => c.id === g);
|
|
842
|
-
if (t) {
|
|
843
|
-
const c = n.entities.find((e) => {
|
|
844
|
-
const m = v(e.entityId);
|
|
845
|
-
return m?.name ? y.filter((x) => e.entityType === "folder" ? x.entityType === "folder" && x.parentId === t.id : e.entityType === "task" ? x.entityType === "task" && x.folderId === t.id : !1).some(
|
|
846
|
-
(x) => x.name === m.name && x.entityId !== e.entityId
|
|
847
|
-
) : !1;
|
|
848
|
-
});
|
|
849
|
-
if (c)
|
|
850
|
-
return `Cannot move "${v(c.entityId)?.name || "Entity"}" - an entity with the same name already exists in this folder`;
|
|
851
|
-
}
|
|
852
|
-
return n.entities.some(
|
|
853
|
-
(c) => c.entityType === "folder"
|
|
854
|
-
) ? "Cannot move folder to its child" : "Cannot move to this location";
|
|
855
|
-
},
|
|
856
|
-
[n, u, y, v]
|
|
857
|
-
), I = _(() => n?.entities.every((g) => g.entityType === "folder") || !1, [n]);
|
|
858
|
-
return {
|
|
859
|
-
handleMoveSubmit: b,
|
|
860
|
-
handleMoveToRoot: S,
|
|
861
|
-
getDisabledFolderIds: w,
|
|
862
|
-
getDisabledMessage: p,
|
|
863
|
-
canMoveToRoot: I
|
|
864
|
-
};
|
|
865
|
-
}, Ct = ({
|
|
866
|
-
projectName: a,
|
|
867
|
-
movingEntities: n,
|
|
868
|
-
onClose: i,
|
|
869
|
-
onMoveComplete: l
|
|
870
|
-
}) => {
|
|
871
|
-
const { handleMoveSubmit: d, handleMoveToRoot: r, getDisabledFolderIds: u, getDisabledMessage: y } = Lt({
|
|
872
|
-
projectName: a,
|
|
873
|
-
movingEntities: n ?? null,
|
|
874
|
-
onClose: i,
|
|
875
|
-
onMoveComplete: l
|
|
876
|
-
});
|
|
877
|
-
return n?.entities.length ? /* @__PURE__ */ R(
|
|
878
|
-
Oe,
|
|
879
|
-
{
|
|
880
|
-
projectName: a,
|
|
881
|
-
entityType: "folder",
|
|
882
|
-
onSubmit: d,
|
|
883
|
-
onClose: i,
|
|
884
|
-
showMoveToRoot: n.entities.every(
|
|
885
|
-
(v) => v.entityType === "folder"
|
|
886
|
-
),
|
|
887
|
-
onMoveToRoot: r,
|
|
888
|
-
disabledIds: u(),
|
|
889
|
-
getDisabledMessage: y
|
|
995
|
+
), Ne = V.div`
|
|
996
|
+
display: flex;
|
|
997
|
+
align-items: center;
|
|
998
|
+
gap: var(--base-gap-small);
|
|
999
|
+
overflow: hidden;
|
|
1000
|
+
flex: 1;
|
|
1001
|
+
min-width: 0;
|
|
1002
|
+
color: var(--md-sys-color-outline);
|
|
1003
|
+
`, cn = V.span`
|
|
1004
|
+
display: flex;
|
|
1005
|
+
align-items: center;
|
|
1006
|
+
gap: 2px;
|
|
1007
|
+
white-space: nowrap;
|
|
1008
|
+
flex-shrink: 0;
|
|
1009
|
+
|
|
1010
|
+
img {
|
|
1011
|
+
width: 18px;
|
|
1012
|
+
height: 18px;
|
|
1013
|
+
border-radius: 50%;
|
|
1014
|
+
object-fit: cover;
|
|
1015
|
+
}
|
|
1016
|
+
`, dn = ({ rowSelection: e, sliceMap: t }) => {
|
|
1017
|
+
const a = ye(null), [r, d] = U(0);
|
|
1018
|
+
Te(() => {
|
|
1019
|
+
const i = a.current;
|
|
1020
|
+
if (!i) return;
|
|
1021
|
+
const c = new ResizeObserver(([s]) => d(s.contentRect.width));
|
|
1022
|
+
return c.observe(i), () => c.disconnect();
|
|
1023
|
+
}, []);
|
|
1024
|
+
const l = Object.keys(e).filter((i) => e[i]).map((i) => t.get(i)).filter((i) => !!i), f = (i) => !!i.icon || !!i.img || !!i.startContent, [S, m] = U(!0), p = l.length > 1 || !S, [g, L] = U(l.length), u = l.map((i) => i.id).join("|");
|
|
1025
|
+
if (Te(() => {
|
|
1026
|
+
m(!0), L(l.length);
|
|
1027
|
+
}, [r, u]), Te(() => {
|
|
1028
|
+
const i = a.current;
|
|
1029
|
+
if (!i || !l.length) return;
|
|
1030
|
+
const c = Array.from(i.querySelectorAll("[data-chip]")), s = i.querySelector("[data-overflow]")?.offsetWidth ?? 22, o = (v, k) => v.offsetLeft - i.offsetLeft + v.offsetWidth <= k;
|
|
1031
|
+
if (l.length === 1) {
|
|
1032
|
+
S && c[0] && !o(c[0], i.clientWidth) && f(l[0]) && m(!1);
|
|
1033
|
+
return;
|
|
890
1034
|
}
|
|
891
|
-
|
|
892
|
-
|
|
1035
|
+
const y = c[c.length - 1];
|
|
1036
|
+
if (y && o(y, i.clientWidth)) return;
|
|
1037
|
+
const n = i.clientWidth - s, I = c.filter((v) => o(v, n)).length, T = Math.max(1, I);
|
|
1038
|
+
T !== g && L(T);
|
|
1039
|
+
}), !l.length) return /* @__PURE__ */ E(Ne, { ref: a });
|
|
1040
|
+
const b = l.slice(0, g), h = l.length - b.length;
|
|
1041
|
+
return /* @__PURE__ */ G(Ne, { ref: a, children: [
|
|
1042
|
+
b.map((i) => /* @__PURE__ */ G(
|
|
1043
|
+
cn,
|
|
1044
|
+
{
|
|
1045
|
+
"data-chip": !0,
|
|
1046
|
+
title: i.label || i.name,
|
|
1047
|
+
"aria-label": i.label || i.name,
|
|
1048
|
+
children: [
|
|
1049
|
+
i.startContent ?? (i.img ? /* @__PURE__ */ E("img", { src: i.img, alt: "" }) : i.icon && /* @__PURE__ */ E(xt, { icon: i.icon, style: { color: i.iconColor } })),
|
|
1050
|
+
!(p && f(i)) && /* @__PURE__ */ E("span", { children: i.label || i.name })
|
|
1051
|
+
]
|
|
1052
|
+
},
|
|
1053
|
+
i.id
|
|
1054
|
+
)),
|
|
1055
|
+
h > 0 && /* @__PURE__ */ G("span", { "data-overflow": !0, children: [
|
|
1056
|
+
"+",
|
|
1057
|
+
h
|
|
1058
|
+
] })
|
|
1059
|
+
] });
|
|
1060
|
+
}, un = V.div`
|
|
893
1061
|
height: 28px;
|
|
894
1062
|
border-radius: 4px;
|
|
895
1063
|
background: var(--md-sys-color-surface-container);
|
|
896
1064
|
width: 100px;
|
|
897
|
-
`,
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
1065
|
+
`, pn = V.div`
|
|
1066
|
+
display: flex;
|
|
1067
|
+
align-items: center;
|
|
1068
|
+
gap: var(--base-gap-small);
|
|
1069
|
+
margin-left: auto;
|
|
1070
|
+
flex-shrink: 0;
|
|
1071
|
+
|
|
1072
|
+
// the open search box takes the whole header rather than sitting on top of the buttons
|
|
1073
|
+
&.searching {
|
|
1074
|
+
flex: 1;
|
|
1075
|
+
min-width: 0;
|
|
1076
|
+
}
|
|
1077
|
+
`, fn = V(ut)`
|
|
1078
|
+
.slicer-dropdown {
|
|
1079
|
+
flex: 0 1 auto;
|
|
1080
|
+
min-width: 48px;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
&.collapsed {
|
|
1084
|
+
cursor: pointer;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
.collapse-toggle .icon {
|
|
1088
|
+
transition: transform 0.15s;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.collapse-toggle.collapsed .icon {
|
|
1092
|
+
transform: rotate(-90deg);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.power-feature .icon {
|
|
1096
|
+
color: var(--md-sys-color-tertiary);
|
|
1097
|
+
}
|
|
1098
|
+
`, mn = V.div`
|
|
1099
|
+
display: flex;
|
|
1100
|
+
align-items: center;
|
|
1101
|
+
gap: var(--base-gap-small);
|
|
1102
|
+
min-width: 0;
|
|
1103
|
+
flex: 0 1 auto;
|
|
1104
|
+
padding: 0 4px;
|
|
1105
|
+
|
|
1106
|
+
span {
|
|
1107
|
+
overflow: hidden;
|
|
1108
|
+
text-overflow: ellipsis;
|
|
1109
|
+
white-space: nowrap;
|
|
1110
|
+
}
|
|
1111
|
+
`, Fe = "__splitSlicer__", je = ({
|
|
1112
|
+
panel: e,
|
|
1113
|
+
visibleSlices: t,
|
|
1114
|
+
sliceFields: a,
|
|
1115
|
+
entityTypes: r = ["task"],
|
|
1116
|
+
pinnedSliceType: d,
|
|
901
1117
|
countsSource: l,
|
|
902
|
-
onAddToList:
|
|
1118
|
+
onAddToList: f,
|
|
1119
|
+
openMoveDialog: S,
|
|
1120
|
+
splitEnabled: m,
|
|
1121
|
+
canCollapse: p,
|
|
1122
|
+
isPrimary: g,
|
|
1123
|
+
search: L,
|
|
1124
|
+
onSearchChange: u
|
|
903
1125
|
}) => {
|
|
904
|
-
const
|
|
905
|
-
SlicerDropdown:
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1126
|
+
const {
|
|
1127
|
+
SlicerDropdown: b,
|
|
1128
|
+
addSlicePanel: h,
|
|
1129
|
+
removeSlicePanel: i,
|
|
1130
|
+
collapsedPanels: c,
|
|
1131
|
+
togglePanelCollapsed: s,
|
|
1132
|
+
setPanelSliceType: o,
|
|
1133
|
+
getPanelSelection: y,
|
|
1134
|
+
setPanelSelection: n,
|
|
1135
|
+
getPanelExpanded: I,
|
|
1136
|
+
setPanelExpanded: T,
|
|
1137
|
+
onSliceTypeChange: v,
|
|
1138
|
+
isViewSyncPending: k,
|
|
1139
|
+
onOpenViewer: H,
|
|
1140
|
+
onAddToList: oe
|
|
1141
|
+
} = xe(), { refetch: ae } = we(), { powerLicense: q, setPowerpackDialog: ie } = Ce(), Z = y(e.id), ee = I(e.id), B = (w) => {
|
|
1142
|
+
n(e.id, w);
|
|
1143
|
+
}, te = A(
|
|
1144
|
+
(w) => T(e.id, w),
|
|
1145
|
+
[T, e.id]
|
|
1146
|
+
), Q = O(
|
|
1147
|
+
() => typeof l == "function" ? l(e.sliceType) : l,
|
|
1148
|
+
[l, e.sliceType]
|
|
1149
|
+
), Y = O(() => {
|
|
1150
|
+
const w = t.map((X) => X.sliceType);
|
|
1151
|
+
if (typeof l != "function") return w;
|
|
1152
|
+
const M = (X) => JSON.stringify([X?.entity, X?.args]), Qe = M(Q);
|
|
1153
|
+
return w.filter((X) => X === e.sliceType || M(l(X)) === Qe);
|
|
1154
|
+
}, [l, Q, t, e.sliceType]), { counts: x, filled: D, complete: P } = Zt(
|
|
1155
|
+
Q,
|
|
1156
|
+
e.sliceType,
|
|
1157
|
+
Y
|
|
1158
|
+
), K = A(
|
|
1159
|
+
(w, M) => {
|
|
1160
|
+
g ? v(w, M) : o(e.id, w);
|
|
927
1161
|
},
|
|
928
|
-
[
|
|
929
|
-
),
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1162
|
+
[g, v, o, e.id]
|
|
1163
|
+
), re = O(
|
|
1164
|
+
() => t.filter((w) => w.id !== e.id).map((w) => w.sliceType),
|
|
1165
|
+
[t, e.id]
|
|
1166
|
+
), {
|
|
1167
|
+
sliceOptions: j,
|
|
1168
|
+
sliceType: N,
|
|
1169
|
+
handleSliceTypeChange: pe,
|
|
1170
|
+
table: { data: le, isExpandable: fe },
|
|
1171
|
+
sliceMap: $,
|
|
1172
|
+
isLoading: ne
|
|
1173
|
+
} = Jt({
|
|
937
1174
|
sliceFields: a,
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1175
|
+
usedSliceTypes: re,
|
|
1176
|
+
entityTypes: r,
|
|
1177
|
+
counts: x,
|
|
1178
|
+
filled: D,
|
|
1179
|
+
countsComplete: P,
|
|
1180
|
+
sliceType: e.sliceType,
|
|
1181
|
+
onSliceTypeChange: K
|
|
1182
|
+
}), z = N === "hierarchy", F = !!p && c.includes(e.id), C = j.find((w) => w.value === N)?.label || N, R = L !== void 0, _ = L ?? "", ce = z ? "Folders" : C, J = sn(
|
|
1183
|
+
f || oe,
|
|
1184
|
+
$,
|
|
1185
|
+
H,
|
|
1186
|
+
S
|
|
1187
|
+
), We = z ? J.rowContextMenuBuilders : [], Ee = O(
|
|
1188
|
+
() => j.map((w) => w.value).filter((w) => !t.some((M) => M.sliceType === w)),
|
|
1189
|
+
[j, t]
|
|
1190
|
+
), be = !!m && Ee.length > 0, Se = O(() => {
|
|
1191
|
+
const w = j.map(
|
|
1192
|
+
(M) => re.includes(M.value) ? { ...M, disabled: !0, disabledMessage: "Already used by another panel" } : M
|
|
1193
|
+
);
|
|
1194
|
+
return be && w.push({ label: "Split slicer", value: Fe, icon: "splitscreen_add" }), w;
|
|
1195
|
+
}, [j, re, be]), ke = () => {
|
|
1196
|
+
if (!q) return ie("slicer");
|
|
1197
|
+
h(Ee[0]);
|
|
1198
|
+
}, qe = (w) => {
|
|
1199
|
+
const M = String(w[0]);
|
|
1200
|
+
if (M === Fe) {
|
|
1201
|
+
ke();
|
|
1202
|
+
return;
|
|
1203
|
+
}
|
|
1204
|
+
pe(M, !!g && d === N);
|
|
949
1205
|
};
|
|
950
|
-
return /* @__PURE__ */
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
|
|
953
|
-
y,
|
|
954
|
-
{
|
|
955
|
-
options: F || [],
|
|
956
|
-
value: [E],
|
|
957
|
-
sliceTypes: a.map((L) => L.value),
|
|
958
|
-
onChange: (L) => X(L[0], i === E),
|
|
959
|
-
className: ie("slicer-dropdown", { "single-option": F.length === 1 }),
|
|
960
|
-
disableOpen: F.length === 1
|
|
961
|
-
}
|
|
962
|
-
),
|
|
963
|
-
/* @__PURE__ */ R(It, { value: r, onChange: u }),
|
|
964
|
-
/* @__PURE__ */ R(
|
|
965
|
-
wt,
|
|
966
|
-
{
|
|
967
|
-
topics: ["entity.folder.created"],
|
|
968
|
-
onSync: async () => {
|
|
969
|
-
await x();
|
|
970
|
-
},
|
|
971
|
-
hideWhenNoUpdates: !0
|
|
972
|
-
}
|
|
973
|
-
)
|
|
974
|
-
] }),
|
|
975
|
-
/* @__PURE__ */ R(
|
|
976
|
-
Re,
|
|
1206
|
+
return /* @__PURE__ */ G(pt, { children: [
|
|
1207
|
+
/* @__PURE__ */ G(
|
|
1208
|
+
fn,
|
|
977
1209
|
{
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1210
|
+
className: W({ collapsed: F }),
|
|
1211
|
+
onClick: F ? () => s(e.id) : void 0,
|
|
1212
|
+
children: [
|
|
1213
|
+
p && /* @__PURE__ */ E(
|
|
1214
|
+
he,
|
|
1215
|
+
{
|
|
1216
|
+
icon: "expand_more",
|
|
1217
|
+
className: W("collapse-toggle", { collapsed: F }),
|
|
1218
|
+
"data-tooltip": F ? "Expand panel" : "Collapse panel",
|
|
1219
|
+
"data-tooltip-delay": 0,
|
|
1220
|
+
onClick: () => s(e.id)
|
|
1221
|
+
}
|
|
1222
|
+
),
|
|
1223
|
+
F ? (
|
|
1224
|
+
// the dropdown cannot be used from a collapsed panel, but the dimension it
|
|
1225
|
+
// shows has to read the same as the dropdown does when open
|
|
1226
|
+
/* @__PURE__ */ E(mn, { children: /* @__PURE__ */ E("span", { children: C }) })
|
|
1227
|
+
) : k ? /* @__PURE__ */ E(un, {}) : !R && /* @__PURE__ */ E(
|
|
1228
|
+
b,
|
|
1229
|
+
{
|
|
1230
|
+
options: Se,
|
|
1231
|
+
value: [N],
|
|
1232
|
+
sliceTypes: a.map((w) => w.value),
|
|
1233
|
+
onChange: (w) => qe(w),
|
|
1234
|
+
className: W("slicer-dropdown", { "single-option": Se.length === 1 }),
|
|
1235
|
+
disableOpen: Se.length === 1
|
|
1236
|
+
}
|
|
1237
|
+
),
|
|
1238
|
+
F && /* @__PURE__ */ E(dn, { rowSelection: Z, sliceMap: $ }),
|
|
1239
|
+
/* @__PURE__ */ G(
|
|
1240
|
+
pn,
|
|
1241
|
+
{
|
|
1242
|
+
className: W({ searching: R }),
|
|
1243
|
+
onClick: (w) => w.stopPropagation(),
|
|
1244
|
+
children: [
|
|
1245
|
+
!F && /* @__PURE__ */ E(
|
|
1246
|
+
nn,
|
|
1247
|
+
{
|
|
1248
|
+
open: R,
|
|
1249
|
+
value: _,
|
|
1250
|
+
subject: ce,
|
|
1251
|
+
onChange: u
|
|
1252
|
+
}
|
|
1253
|
+
),
|
|
1254
|
+
z && /* @__PURE__ */ E(
|
|
1255
|
+
ln,
|
|
1256
|
+
{
|
|
1257
|
+
topics: ["entity.folder.created"],
|
|
1258
|
+
onSync: async () => {
|
|
1259
|
+
await ae();
|
|
1260
|
+
},
|
|
1261
|
+
hideWhenNoUpdates: !0
|
|
1262
|
+
}
|
|
1263
|
+
),
|
|
1264
|
+
be && g && !R && /* @__PURE__ */ E(
|
|
1265
|
+
he,
|
|
1266
|
+
{
|
|
1267
|
+
icon: "splitscreen_add",
|
|
1268
|
+
className: W({ "power-feature": !q }),
|
|
1269
|
+
"data-tooltip": q ? "Split slicer" : "Power feature - Slicer",
|
|
1270
|
+
"data-tooltip-delay": 0,
|
|
1271
|
+
onClick: ke
|
|
1272
|
+
}
|
|
1273
|
+
),
|
|
1274
|
+
!g && !R && /* @__PURE__ */ E(
|
|
1275
|
+
he,
|
|
1276
|
+
{
|
|
1277
|
+
icon: "close",
|
|
1278
|
+
"data-tooltip": "Remove panel",
|
|
1279
|
+
"data-tooltip-delay": 0,
|
|
1280
|
+
onClick: () => i(e.id)
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
]
|
|
1284
|
+
}
|
|
1285
|
+
)
|
|
1286
|
+
]
|
|
1287
|
+
}
|
|
1288
|
+
),
|
|
1289
|
+
!F && /* @__PURE__ */ E(
|
|
1290
|
+
ft,
|
|
1291
|
+
{
|
|
1292
|
+
rowSelection: Z,
|
|
1293
|
+
onRowSelectionChange: B,
|
|
1294
|
+
expanded: ee,
|
|
1295
|
+
setExpanded: te,
|
|
1296
|
+
data: $,
|
|
1297
|
+
children: /* @__PURE__ */ E(
|
|
1298
|
+
mt,
|
|
985
1299
|
{
|
|
986
|
-
data:
|
|
987
|
-
isExpandable:
|
|
988
|
-
isLoading:
|
|
989
|
-
forceUpdateTable:
|
|
990
|
-
globalFilter:
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1300
|
+
data: le,
|
|
1301
|
+
isExpandable: fe,
|
|
1302
|
+
isLoading: ne || k,
|
|
1303
|
+
forceUpdateTable: N,
|
|
1304
|
+
globalFilter: _,
|
|
1305
|
+
rowIdPrefix: `slicer-${e.id}`,
|
|
1306
|
+
onRename: z ? (w, M) => J.onRename(M.original) : void 0,
|
|
1307
|
+
renamingId: z ? J.renamingRow?.id : null,
|
|
1308
|
+
renameInitialValue: z ? J.renameInitialValue : void 0,
|
|
1309
|
+
onSubmitRename: z ? (w, M) => J.onSubmitRename(M) : void 0,
|
|
1310
|
+
onCancelRename: z ? J.onCancelRename : void 0,
|
|
1311
|
+
onRowOptionClick: z ? J.onOptionClick : void 0,
|
|
1312
|
+
rowContextMenuBuilders: We
|
|
998
1313
|
}
|
|
999
1314
|
)
|
|
1000
1315
|
}
|
|
1001
|
-
)
|
|
1002
|
-
|
|
1003
|
-
|
|
1316
|
+
)
|
|
1317
|
+
] });
|
|
1318
|
+
}, hn = V.div`
|
|
1319
|
+
height: 100%;
|
|
1320
|
+
width: 100%;
|
|
1321
|
+
overflow-y: auto;
|
|
1322
|
+
overflow-x: hidden;
|
|
1323
|
+
|
|
1324
|
+
${({ $deadGutters: e }) => e.map(
|
|
1325
|
+
(t) => `
|
|
1326
|
+
& > .p-splitter > :nth-child(${t * 2 + 2}) {
|
|
1327
|
+
pointer-events: none;
|
|
1328
|
+
cursor: default;
|
|
1329
|
+
}
|
|
1330
|
+
`
|
|
1331
|
+
).join("")}
|
|
1332
|
+
`, Zn = ({
|
|
1333
|
+
sliceFields: e = [],
|
|
1334
|
+
entityTypes: t = ["task"],
|
|
1335
|
+
pinnedSliceType: a,
|
|
1336
|
+
countsSource: r,
|
|
1337
|
+
onAddToList: d,
|
|
1338
|
+
enableSplit: l
|
|
1339
|
+
}) => {
|
|
1340
|
+
const { slices: f, page: S, setPanelExpanded: m, projectName: p, collapsedPanels: g } = xe(), { powerLicense: L } = Ce(), u = !!l, b = u && L ? f : f.slice(0, 1), [h, i] = U(null), c = A((x) => {
|
|
1341
|
+
i("entities" in x ? x : { entities: [x] });
|
|
1342
|
+
}, []), s = A(() => {
|
|
1343
|
+
i(null);
|
|
1344
|
+
}, []), { getParentFolderIds: o } = we(), y = A(
|
|
1345
|
+
(x) => {
|
|
1346
|
+
const D = [x, ...o(x)];
|
|
1347
|
+
m(
|
|
1348
|
+
"hierarchy",
|
|
1349
|
+
(P) => typeof P == "boolean" ? P || Object.fromEntries(D.map((K) => [K, !0])) : {
|
|
1350
|
+
...P,
|
|
1351
|
+
...Object.fromEntries(D.map((K) => [K, !0]))
|
|
1352
|
+
}
|
|
1353
|
+
);
|
|
1354
|
+
},
|
|
1355
|
+
[o, m]
|
|
1356
|
+
), n = ye(null), [I, T] = U(0);
|
|
1357
|
+
se(() => {
|
|
1358
|
+
const x = n.current;
|
|
1359
|
+
if (!x) return;
|
|
1360
|
+
const D = new ResizeObserver(([P]) => T(P.contentRect.height));
|
|
1361
|
+
return D.observe(x), () => D.disconnect();
|
|
1362
|
+
}, [b.length]);
|
|
1363
|
+
const v = b.map((x) => x.id), k = b.length > 1, {
|
|
1364
|
+
sizes: H,
|
|
1365
|
+
minSize: oe,
|
|
1366
|
+
height: ae,
|
|
1367
|
+
layoutKey: q,
|
|
1368
|
+
handleResizeEnd: ie
|
|
1369
|
+
} = $t(S, v, k ? g : [], I), Z = v.slice(0, -1).map(
|
|
1370
|
+
(x, D) => k && (g.includes(x) || g.includes(v[D + 1])) ? D : -1
|
|
1371
|
+
).filter((x) => x >= 0), [ee, B] = U({}), te = A(
|
|
1372
|
+
(x, D) => B((P) => ({ ...P, [x]: D })),
|
|
1373
|
+
[]
|
|
1374
|
+
), Q = v.join("|");
|
|
1375
|
+
se(() => {
|
|
1376
|
+
B((x) => {
|
|
1377
|
+
const D = Object.keys(x).filter((P) => v.includes(P));
|
|
1378
|
+
return D.length === Object.keys(x).length ? x : Object.fromEntries(D.map((P) => [P, x[P]]));
|
|
1379
|
+
});
|
|
1380
|
+
}, [Q]);
|
|
1381
|
+
const Y = {
|
|
1382
|
+
visibleSlices: b,
|
|
1383
|
+
canCollapse: k,
|
|
1384
|
+
sliceFields: e,
|
|
1385
|
+
entityTypes: t,
|
|
1386
|
+
pinnedSliceType: a,
|
|
1387
|
+
countsSource: r,
|
|
1388
|
+
onAddToList: d,
|
|
1389
|
+
openMoveDialog: c,
|
|
1390
|
+
splitEnabled: u
|
|
1391
|
+
};
|
|
1392
|
+
return /* @__PURE__ */ G($e, { children: [
|
|
1393
|
+
b.length === 1 ? /* @__PURE__ */ E(
|
|
1394
|
+
je,
|
|
1395
|
+
{
|
|
1396
|
+
panel: b[0],
|
|
1397
|
+
isPrimary: !0,
|
|
1398
|
+
search: ee[b[0].id],
|
|
1399
|
+
onSearchChange: (x) => te(b[0].id, x),
|
|
1400
|
+
...Y
|
|
1401
|
+
}
|
|
1402
|
+
) : /* @__PURE__ */ E(hn, { ref: n, $deadGutters: Z, children: /* @__PURE__ */ E(
|
|
1403
|
+
et,
|
|
1404
|
+
{
|
|
1405
|
+
layout: "vertical",
|
|
1406
|
+
onResizeEnd: ie,
|
|
1407
|
+
style: {
|
|
1408
|
+
width: "100%",
|
|
1409
|
+
height: ae,
|
|
1410
|
+
overflow: "hidden"
|
|
1411
|
+
},
|
|
1412
|
+
children: b.map((x, D) => /* @__PURE__ */ E(
|
|
1413
|
+
tt,
|
|
1414
|
+
{
|
|
1415
|
+
size: H[D],
|
|
1416
|
+
minSize: oe,
|
|
1417
|
+
style: { overflow: "hidden" },
|
|
1418
|
+
children: /* @__PURE__ */ E(
|
|
1419
|
+
je,
|
|
1420
|
+
{
|
|
1421
|
+
panel: x,
|
|
1422
|
+
isPrimary: D === 0,
|
|
1423
|
+
search: ee[x.id],
|
|
1424
|
+
onSearchChange: (P) => te(x.id, P),
|
|
1425
|
+
...Y
|
|
1426
|
+
}
|
|
1427
|
+
)
|
|
1428
|
+
},
|
|
1429
|
+
x.id
|
|
1430
|
+
))
|
|
1431
|
+
},
|
|
1432
|
+
q
|
|
1433
|
+
) }),
|
|
1434
|
+
/* @__PURE__ */ E(
|
|
1435
|
+
Ut,
|
|
1004
1436
|
{
|
|
1005
|
-
projectName:
|
|
1006
|
-
movingEntities:
|
|
1007
|
-
onClose:
|
|
1008
|
-
onMoveComplete:
|
|
1437
|
+
projectName: p,
|
|
1438
|
+
movingEntities: h,
|
|
1439
|
+
onClose: s,
|
|
1440
|
+
onMoveComplete: y
|
|
1009
1441
|
}
|
|
1010
1442
|
)
|
|
1011
1443
|
] });
|
|
1012
1444
|
};
|
|
1013
1445
|
export {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1446
|
+
_t as S,
|
|
1447
|
+
Be as a,
|
|
1448
|
+
Me as b,
|
|
1449
|
+
jt as c,
|
|
1450
|
+
Zn as d,
|
|
1451
|
+
Kt as e,
|
|
1452
|
+
Ft as f,
|
|
1453
|
+
Ae as g,
|
|
1454
|
+
sn as h,
|
|
1455
|
+
Zt as i,
|
|
1456
|
+
$t as j,
|
|
1457
|
+
Xn as k,
|
|
1458
|
+
ln as l,
|
|
1459
|
+
Nt as r,
|
|
1460
|
+
Wt as u
|
|
1021
1461
|
};
|