@ynput/ayon-frontend-shared 0.5.0 → 0.6.1

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.
Files changed (92) hide show
  1. package/dist/ContextMenu.es.js +34 -16
  2. package/dist/DetailsPanel.es.js +307 -311
  3. package/dist/Feed.es.js +179 -50
  4. package/dist/ListTable.es.js +99 -92
  5. package/dist/NewEntity.es.js +1256 -11
  6. package/dist/ProjectTreeTable.es.js +4459 -2959
  7. package/dist/SimpleTable.es.js +8 -7
  8. package/dist/Slicer.es.js +451 -147
  9. package/dist/Views.es.js +918 -310
  10. package/dist/api.es.js +331 -329
  11. package/dist/chunks/Actions.es.js +32 -27
  12. package/dist/chunks/ColumnDropIndicator.es.js +174 -328
  13. package/dist/chunks/ColumnDropIndicator.styled.es.js +281 -0
  14. package/dist/chunks/ColumnHeaderMenuUI.es.js +52 -0
  15. package/dist/chunks/ContextMenuContextInstance.es.js +12 -0
  16. package/dist/chunks/DeleteEntitiesConfirmDialog.es.js +229 -0
  17. package/dist/chunks/DeleteEntitiesContextInstance.es.js +827 -0
  18. package/dist/chunks/DetailsDialog.es.js +3 -3
  19. package/dist/chunks/EmptyPlaceholder.es.js +4 -4
  20. package/dist/chunks/EntityPath.es.js +74 -69
  21. package/dist/chunks/EntityPickerDialog.es.js +25 -21
  22. package/dist/chunks/EntityTooltip.es.js +29 -22
  23. package/dist/chunks/EntityUpdatesContext.es.js +38 -96
  24. package/dist/chunks/Feed.es.js +2321 -2668
  25. package/dist/chunks/FilterErrorActions.es.js +25 -229
  26. package/dist/chunks/Menu.es.js +21 -17
  27. package/dist/chunks/MenuContext.es.js +14 -256
  28. package/dist/chunks/MenuItem.es.js +34 -24
  29. package/dist/chunks/MetaWidget.es.js +2895 -4919
  30. package/dist/chunks/NewEntityContextInstance.es.js +11 -0
  31. package/dist/chunks/PlayableIcon.es.js +4215 -1179
  32. package/dist/chunks/ProjectContext.es.js +102 -66
  33. package/dist/chunks/RepresentationsList.es.js +4 -4
  34. package/dist/chunks/ReviewablesSelector.es.js +468 -460
  35. package/dist/chunks/SimpleForm.es.js +18 -18
  36. package/dist/chunks/SimpleTable.es.js +15 -13
  37. package/dist/chunks/Slicer.es.js +109 -98
  38. package/dist/chunks/TableSettingsFallback.es.js +22 -10
  39. package/dist/chunks/ThumbnailSimple.es.js +290 -52
  40. package/dist/chunks/VersionUploadContextInstance.es.js +12 -0
  41. package/dist/chunks/VideoPlayer.es.js +24 -28
  42. package/dist/chunks/Watchers.es.js +669 -644
  43. package/dist/chunks/entityDefinitions.es.js +2 -350
  44. package/dist/chunks/expandRelativeDates.es.js +27 -0
  45. package/dist/chunks/extractVersionFromFilename.es.js +28 -0
  46. package/dist/chunks/getBundleMode.es.js +1 -1
  47. package/dist/chunks/getUris.es.js +737 -710
  48. package/dist/chunks/queryFilterToClientFilter.es.js +11 -10
  49. package/dist/chunks/searchTerms.es.js +179 -174
  50. package/dist/chunks/useAttributeEnums.es.js +9 -9
  51. package/dist/chunks/useCreateContextMenu.es.js +66 -90
  52. package/dist/chunks/useDateRangeFilter.es.js +3 -3
  53. package/dist/chunks/useHierarchySelection.es.js +24 -0
  54. package/dist/chunks/useLoadModule.es.js +74 -0
  55. package/dist/chunks/useQueryArgumentChangeLoading.es.js +11 -0
  56. package/dist/chunks/versionUploadHelpers.es.js +16 -42
  57. package/dist/chunks/viewUpdateHelper.es.js +74 -57
  58. package/dist/components.es.js +1432 -1001
  59. package/dist/context.es.js +791 -78
  60. package/dist/hooks.es.js +95 -94
  61. package/dist/index.es.js +27 -26
  62. package/dist/types/Actions.d.ts +15 -15
  63. package/dist/types/ContextMenu.d.ts +19 -16
  64. package/dist/types/DetailsPanel.d.ts +110 -17
  65. package/dist/types/EntityPickerDialog.d.ts +15 -15
  66. package/dist/types/Feed.d.ts +19 -16
  67. package/dist/types/ListTable.d.ts +15 -15
  68. package/dist/types/NewEntity.d.ts +24 -18
  69. package/dist/types/ProjectTreeTable.d.ts +34 -123
  70. package/dist/types/RepresentationsList.d.ts +15 -15
  71. package/dist/types/SimpleTable.d.ts +19 -16
  72. package/dist/types/Slicer.d.ts +18 -15
  73. package/dist/types/Views.d.ts +19 -16
  74. package/dist/types/api.d.ts +515 -207
  75. package/dist/types/components.d.ts +84 -20
  76. package/dist/types/context.d.ts +108 -25
  77. package/dist/types/hooks.d.ts +15 -15
  78. package/dist/types/index.d.ts +15 -15
  79. package/dist/types/util.d.ts +20 -15
  80. package/dist/util.es.js +117 -105
  81. package/package.json +16 -4
  82. package/dist/chunks/DeleteEntitiesContext.es.js +0 -748
  83. package/dist/chunks/GlobalContext.es.js +0 -52
  84. package/dist/chunks/NewEntityContext.es.js +0 -1242
  85. package/dist/chunks/ProjectFoldersContext.es.js +0 -134
  86. package/dist/chunks/ProjectFoldersContextInstance.es.js +0 -7
  87. package/dist/chunks/VersionUploadContext.es.js +0 -232
  88. package/dist/chunks/ViewsContext.es.js +0 -878
  89. package/dist/chunks/mentionTypeOptions.es.js +0 -15
  90. package/dist/chunks/useColumnDragRestriction.es.js +0 -148
  91. package/dist/chunks/useLocalStorage.es.js +0 -355
  92. /package/dist/{useCreateContextMenu.css → ContextMenuContextInstance.css} +0 -0
package/dist/Slicer.es.js CHANGED
@@ -1,147 +1,450 @@
1
- import { S as Z, a as ee, b as te, c as se, d as re, e as oe, f as ie, g as ne, r as de, u as le, h as ce, i as ae, j as ue, k as pe } from "./chunks/Slicer.es.js";
2
- import { u as k } from "./chunks/entityDefinitions.es.js";
3
- import { S as Ie, a as Se, b as ye, c as he, d as Ee, e as me } from "./chunks/entityDefinitions.es.js";
4
- import { useMemo as h, useState as y, useEffect as P } from "react";
5
- import "./chunks/ProjectContext.es.js";
6
- import "./chunks/GlobalContext.es.js";
7
- import "./chunks/MetaWidget.es.js";
8
- import "lodash";
1
+ import { S as Ve, a as je, b as Ne, c as et, d as tt, e as st, f as nt, g as ot, r as rt, u as it, h as ct, i as lt, j as dt, k as at } from "./chunks/Slicer.es.js";
2
+ import { jsx as Se } from "react/jsx-runtime";
3
+ import { useState as A, useEffect as M, useRef as Y, useCallback as m, useMemo as L } from "react";
4
+ import { a as z, o as U, s as ce, q as ye } from "./chunks/DeleteEntitiesContextInstance.es.js";
5
+ import { S as he, c as pe, d as Ee } from "./chunks/MetaWidget.es.js";
6
+ import { e as ft, u as St } from "./chunks/MetaWidget.es.js";
7
+ import "@module-federation/enhanced/runtime";
8
+ import { az as B, aq as Ie } from "./chunks/searchTerms.es.js";
9
+ import "./chunks/getUris.es.js";
9
10
  import "primereact/confirmdialog";
11
+ import "lodash";
10
12
  import "react-toastify";
11
13
  import "uuid";
12
- import { ay as m, aq as _ } from "./chunks/searchTerms.es.js";
13
- import "./chunks/getUris.es.js";
14
- import { useDispatch as R } from "react-redux";
15
- import { u as F } from "./chunks/useLocalStorage.es.js";
16
- const B = ({
17
- sliceFilter: e,
18
- persistedHierarchySelection: t,
19
- filters: r,
20
- merge: d = !0
21
- }) => h(() => {
22
- const i = (n) => ({
14
+ import { u as le } from "./chunks/useLoadModule.es.js";
15
+ import "@ynput/ayon-react-components";
16
+ import "./chunks/ContextMenuContextInstance.es.js";
17
+ import "clsx";
18
+ import "react-dom";
19
+ import { useDispatch as ge } from "react-redux";
20
+ import "semver";
21
+ import { u as ht } from "./chunks/useHierarchySelection.es.js";
22
+ const me = () => {
23
+ const n = () => ({
24
+ formatStatuses: () => [],
25
+ formatTaskTypes: () => [],
26
+ formatTypes: () => [],
27
+ formatAssignees: () => [],
28
+ formatAttribute: () => [],
29
+ formatProductTypes: () => [],
30
+ formatAuthors: () => []
31
+ }), { powerLicense: e } = z(), [s, { isLoading: c }] = le({
32
+ addon: "powerpack",
33
+ remote: "slicer",
34
+ module: "useExtraSlices",
35
+ fallback: n,
36
+ skip: !e
37
+ // skip loading if powerpack license is not available
38
+ }), [l] = le({
39
+ addon: "powerpack",
40
+ remote: "slicer",
41
+ module: "SlicerDropdown",
42
+ fallback: he,
43
+ skip: !e
44
+ // skip loading if powerpack license is not available
45
+ });
46
+ return { useExtraSlices: s, isLoadingExtraSlices: c, SlicerDropdown: l };
47
+ }, we = ["slicer-selection-", "slicer-expanded-"], de = (n, e, s) => s === "hierarchy" ? `slicer-selection-hierarchy-${n}` : `slicer-selection-${n}-${e}-${s}`, ae = (n, e, s) => s === "hierarchy" ? `slicer-expanded-hierarchy-${n}` : `slicer-expanded-${n}-${e}-${s}`, Pe = ({
48
+ sliceTypes: n,
49
+ page: e,
50
+ projectName: s,
51
+ ...c
52
+ }) => {
53
+ const [l, f] = A(0);
54
+ M(() => {
55
+ const t = (a) => {
56
+ const u = a.detail?.key ?? ("key" in a ? a.key : void 0);
57
+ u && !we.some((I) => u.startsWith(I)) || f((I) => I + 1);
58
+ };
59
+ return window.addEventListener("session-storage", t), window.addEventListener("storage", t), () => {
60
+ window.removeEventListener("session-storage", t), window.removeEventListener("storage", t);
61
+ };
62
+ }, []);
63
+ const S = Y(/* @__PURE__ */ new Map()), d = m((t, a) => {
64
+ const u = typeof window > "u" ? null : sessionStorage.getItem(t), I = S.current.get(t);
65
+ if (I && I.raw === u) return I.value;
66
+ const _ = U(t, a);
67
+ return S.current.set(t, { raw: u, value: _ }), _;
68
+ }, []), o = n[0], y = m(
69
+ (t) => c.rowSelection !== void 0 && t === o ? c.rowSelection : d(de(s, e, t), {}),
70
+ // storageVersion invalidates memoized reads when any bucket changes
71
+ [c.rowSelection, o, s, e, d, l]
72
+ ), h = m(
73
+ (t, a) => {
74
+ if (c.setRowSelection && t === o) {
75
+ c.setRowSelection(a);
76
+ return;
77
+ }
78
+ const u = de(s, e, t), I = typeof a == "function" ? a(d(u, {})) : a;
79
+ ce(u, I);
80
+ },
81
+ [c.setRowSelection, o, s, e, d]
82
+ ), w = m(
83
+ (t) => c.expanded !== void 0 && t === o ? c.expanded : d(ae(s, e, t), {}),
84
+ [c.expanded, o, s, e, d, l]
85
+ ), i = m(
86
+ (t, a) => {
87
+ if (c.setExpanded && t === o) {
88
+ c.setExpanded(a);
89
+ return;
90
+ }
91
+ const u = ae(s, e, t), I = typeof a == "function" ? a(d(u, {})) : a;
92
+ ce(u, I);
93
+ },
94
+ [c.setExpanded, o, s, e, d]
95
+ ), P = y(o), E = m(
96
+ (t, a = o) => h(a, t),
97
+ [h, o]
98
+ ), T = w(o), x = m(
99
+ (t, a = o) => i(a, t),
100
+ [i, o]
101
+ );
102
+ return {
103
+ rowSelection: P,
104
+ setRowSelection: E,
105
+ expanded: T,
106
+ setExpanded: x,
107
+ getPanelSelection: y,
108
+ setPanelSelection: h,
109
+ getPanelExpanded: w,
110
+ setPanelExpanded: i
111
+ };
112
+ }, ue = ["overview", "products"], Ue = ({
113
+ children: n,
114
+ page: e,
115
+ projectName: s,
116
+ viewSettings: c,
117
+ isLoadingViews: l,
118
+ updateViewSettings: f,
119
+ onOpenViewer: S,
120
+ onAddToList: d,
121
+ ...o
122
+ }) => {
123
+ const [y, h] = ye(
124
+ `slicer-pinned-slice-${e}`,
125
+ null
126
+ ), { powerLicense: w } = z(), i = c, P = i?.sliceTypes, E = i?.sliceType, T = P?.length ? E && E !== P[0] ? [E, ...P.slice(1)] : P : [E ?? "hierarchy"], x = ue.includes(e) && !o.sliceType && !P?.length && T[0] !== "hierarchy" && y?.sliceType === "hierarchy" && Object.values(y.rowSelection || {}).some(Boolean), t = L(
127
+ () => [
128
+ ...new Set(
129
+ o.sliceType ? [o.sliceType] : x ? [...T, "hierarchy"] : T
130
+ )
131
+ ],
132
+ [o.sliceType, T.join("|"), x]
133
+ ), a = i?.collapsedSliceTypes, u = L(() => a ?? [], [a?.join("|")]), I = L(
134
+ () => t.map((r) => ({ id: r, sliceType: r })),
135
+ [t]
136
+ ), _ = I[0].sliceType, {
137
+ rowSelection: O,
138
+ setRowSelection: D,
139
+ expanded: G,
140
+ setExpanded: H,
141
+ getPanelSelection: W,
142
+ setPanelSelection: C,
143
+ getPanelExpanded: X,
144
+ setPanelExpanded: b
145
+ } = Pe({
146
+ sliceTypes: t,
147
+ page: e,
148
+ projectName: s,
149
+ ...o
150
+ }), J = m(
151
+ (r) => {
152
+ D(r);
153
+ },
154
+ [D]
155
+ ), k = m(
156
+ (r, g) => {
157
+ const p = () => {
158
+ };
159
+ f(
160
+ {
161
+ sliceTypes: r,
162
+ sliceType: r[0],
163
+ collapsedSliceTypes: (g ?? u).filter((R) => r.includes(R))
164
+ },
165
+ p,
166
+ p,
167
+ {}
168
+ );
169
+ },
170
+ [f, u]
171
+ ), Q = m(
172
+ (r) => {
173
+ const g = u.includes(r) ? u.filter((p) => p !== r) : [...u, r];
174
+ k(t, g);
175
+ },
176
+ [u, k, t]
177
+ ), F = `${s}-${e}`, Z = Y(/* @__PURE__ */ new Set());
178
+ M(() => {
179
+ !x || l || Z.current.has(F) || (Z.current.add(F), Object.keys(W("hierarchy")).length || (C("hierarchy", y.rowSelection), b("hierarchy", y.expanded)), k(t));
180
+ }, [x, l, F]);
181
+ const V = Y(/* @__PURE__ */ new Set());
182
+ M(() => {
183
+ if (V.current.has(F) || l || o.sliceType || o.rowSelection || o.setRowSelection || P?.length)
184
+ return;
185
+ V.current.add(F);
186
+ const r = `slicer-selection-${s}-${e}`, g = `slicer-expanded-${s}-${e}`, p = T[0];
187
+ if (p !== "hierarchy") {
188
+ const R = U(r, null);
189
+ if (R && Object.keys(R).length) {
190
+ C(
191
+ p,
192
+ (ie) => Object.keys(ie).length ? ie : R
193
+ );
194
+ const v = U(g, null);
195
+ v && b(p, v);
196
+ }
197
+ }
198
+ sessionStorage.removeItem(r), sessionStorage.removeItem(g);
199
+ }, [l, P, F]), M(() => {
200
+ ue.includes(e) && !o.sliceType && !l && y && !x && h(null);
201
+ }, [e, o.sliceType, l, y, x, h]);
202
+ const j = m(
203
+ (r, g) => {
204
+ if (w && t.slice(1).includes(r)) return;
205
+ o.onSliceTypeChange ? o.onSliceTypeChange(r, g) : k([r, ...t.slice(1).filter((v) => v !== r)]);
206
+ const p = (v) => o.setRowSelection ? o.setRowSelection(v) : D(v, r), R = (v) => o.setExpanded ? o.setExpanded(v) : H(v, r);
207
+ y && r === y.sliceType ? (p(y.rowSelection), R(y.expanded), h(null)) : r !== "hierarchy" && (p({}), R({})), g && h({
208
+ sliceType: _,
209
+ rowSelection: O,
210
+ expanded: G
211
+ });
212
+ },
213
+ [
214
+ k,
215
+ t,
216
+ O,
217
+ D,
218
+ y,
219
+ h,
220
+ G,
221
+ H,
222
+ o.setRowSelection,
223
+ o.setExpanded,
224
+ w
225
+ ]
226
+ ), K = m(
227
+ (r) => {
228
+ r !== "hierarchy" && (C(r, {}), b(r, {}));
229
+ },
230
+ [C, b]
231
+ ), N = m(
232
+ (r) => {
233
+ !r || t.includes(r) || (k([...t, r]), K(r));
234
+ },
235
+ [t, k, K]
236
+ ), ee = m(
237
+ (r) => {
238
+ if (t.length <= 1 || !t.includes(r)) return;
239
+ const g = t.filter((p) => p !== r);
240
+ k(g, g.length > 1 ? void 0 : []);
241
+ },
242
+ [t, k]
243
+ ), te = m(
244
+ (r, g) => {
245
+ !t.includes(r) || t.includes(g) || (k(
246
+ t.map((p) => p === r ? g : p),
247
+ u.map((p) => p === r ? g : p)
248
+ ), K(g));
249
+ },
250
+ [t, k, K, u]
251
+ ), se = m(
252
+ (r) => {
253
+ H(r);
254
+ },
255
+ [H]
256
+ ), { useExtraSlices: ne, isLoadingExtraSlices: oe, SlicerDropdown: re } = me(), fe = L(
257
+ () => ({
258
+ projectName: s,
259
+ page: e,
260
+ useExtraSlices: ne,
261
+ isLoadingExtraSlices: oe,
262
+ SlicerDropdown: re,
263
+ // SLICE TYPE
264
+ sliceType: _,
265
+ onSliceTypeChange: j,
266
+ // SLICE PANELS
267
+ slices: I,
268
+ addSlicePanel: N,
269
+ removeSlicePanel: ee,
270
+ setPanelSliceType: te,
271
+ getPanelSelection: W,
272
+ setPanelSelection: C,
273
+ getPanelExpanded: X,
274
+ setPanelExpanded: b,
275
+ collapsedPanels: u,
276
+ togglePanelCollapsed: Q,
277
+ // ROW SELECTION
278
+ rowSelection: O,
279
+ onRowSelectionChange: J,
280
+ // PINNED SLICE
281
+ pinnedSlice: y,
282
+ setPinnedSlice: h,
283
+ expanded: G,
284
+ onExpandedChange: se,
285
+ // loading state
286
+ isViewSyncPending: l,
287
+ onOpenViewer: S,
288
+ onAddToList: d
289
+ }),
290
+ [
291
+ e,
292
+ ne,
293
+ oe,
294
+ re,
295
+ _,
296
+ j,
297
+ I,
298
+ u,
299
+ Q,
300
+ N,
301
+ ee,
302
+ te,
303
+ W,
304
+ C,
305
+ X,
306
+ b,
307
+ O,
308
+ J,
309
+ y,
310
+ h,
311
+ G,
312
+ se,
313
+ l,
314
+ S,
315
+ d
316
+ ]
317
+ );
318
+ return /* @__PURE__ */ Se(pe.Provider, { value: fe, children: n });
319
+ }, ze = ({
320
+ sliceFilter: n,
321
+ persistedHierarchySelection: e,
322
+ filters: s,
323
+ merge: c = !0
324
+ }) => L(() => {
325
+ const f = (S) => ({
23
326
  id: "hierarchy",
24
327
  label: "Folder",
25
328
  type: "list_of_strings",
26
- values: Object.keys(n).filter((l) => n[l]).map((l) => ({ id: l, label: l })),
329
+ values: Object.keys(S).filter((d) => S[d]).map((d) => ({ id: d, label: d })),
27
330
  isCustom: !0,
28
331
  singleSelect: !0,
29
332
  fieldType: "folder",
30
333
  operator: "OR",
31
334
  isReadonly: !0
32
335
  });
33
- return e && t ? d ? [i(t), ...r] : [i(t)] : r;
34
- }, [e, t, r]), C = async (e, t, r) => {
35
- const d = new Set(e.folderIds), o = new Set(e.taskIds), i = new Set(e.versionIds), n = new Set(e.productIds), l = {}, a = {}, I = {}, p = [];
36
- return e.taskIds.length && p.push(
37
- r(
38
- m.endpoints.GetTasksList.initiate({
39
- projectName: t,
40
- taskIds: e.taskIds,
41
- first: e.taskIds.length
336
+ return n && e ? c ? [f(e), ...s] : [f(e)] : s;
337
+ }, [n, e, s]), xe = async (n, e, s) => {
338
+ const c = new Set(n.folderIds), l = new Set(n.taskIds), f = new Set(n.versionIds), S = new Set(n.productIds), d = {}, o = {}, y = {}, h = [];
339
+ return n.taskIds.length && h.push(
340
+ s(
341
+ B.endpoints.GetTasksList.initiate({
342
+ projectName: e,
343
+ taskIds: n.taskIds,
344
+ first: n.taskIds.length
42
345
  })
43
- ).unwrap().then((u) => {
44
- for (const s of u.tasks)
45
- s.folderId && (d.add(s.folderId), l[s.id] = s.folderId);
346
+ ).unwrap().then((w) => {
347
+ for (const i of w.tasks)
348
+ i.folderId && (c.add(i.folderId), d[i.id] = i.folderId);
46
349
  })
47
- ), e.versionIds.length && p.push(
48
- r(
49
- m.endpoints.GetVersions.initiate({
50
- projectName: t,
51
- versionIds: e.versionIds,
52
- first: e.versionIds.length
350
+ ), n.versionIds.length && h.push(
351
+ s(
352
+ B.endpoints.GetVersions.initiate({
353
+ projectName: e,
354
+ versionIds: n.versionIds,
355
+ first: n.versionIds.length
53
356
  })
54
- ).unwrap().then((u) => {
55
- for (const s of u.versions)
56
- s.task?.id && o.add(s.task.id), s.product?.id && n.add(s.product.id), s.product?.folder?.id && (d.add(s.product.folder.id), a[s.id] = s.product.folder.id, s.product?.id && (I[s.product.id] = s.product.folder.id));
357
+ ).unwrap().then((w) => {
358
+ for (const i of w.versions)
359
+ i.task?.id && l.add(i.task.id), i.product?.id && S.add(i.product.id), i.product?.folder?.id && (c.add(i.product.folder.id), o[i.id] = i.product.folder.id, i.product?.id && (y[i.product.id] = i.product.folder.id));
57
360
  })
58
- ), e.productIds.length && p.push(
59
- r(
60
- m.endpoints.GetProducts.initiate({
61
- projectName: t,
62
- productIds: e.productIds,
63
- first: e.productIds.length
361
+ ), n.productIds.length && h.push(
362
+ s(
363
+ B.endpoints.GetProducts.initiate({
364
+ projectName: e,
365
+ productIds: n.productIds,
366
+ first: n.productIds.length
64
367
  })
65
- ).unwrap().then((u) => {
66
- for (const s of u.products)
67
- s.folderId && (d.add(s.folderId), I[s.id] = s.folderId);
368
+ ).unwrap().then((w) => {
369
+ for (const i of w.products)
370
+ i.folderId && (c.add(i.folderId), y[i.id] = i.folderId);
68
371
  })
69
- ), await Promise.all(p), {
70
- folderIds: [...d],
71
- taskIds: [...o],
72
- versionIds: [...i],
73
- productIds: [...n],
74
- parentMaps: { taskFolderIds: l, versionFolderIds: a, productFolderIds: I }
372
+ ), await Promise.all(h), {
373
+ folderIds: [...c],
374
+ taskIds: [...l],
375
+ versionIds: [...f],
376
+ productIds: [...S],
377
+ parentMaps: { taskFolderIds: d, versionFolderIds: o, productFolderIds: y }
75
378
  };
76
- }, f = {
379
+ }, $ = {
77
380
  folderIds: [],
78
381
  taskIds: [],
79
382
  versionIds: [],
80
383
  productIds: []
81
- }, g = {
384
+ }, q = {
82
385
  taskFolderIds: {},
83
386
  versionFolderIds: {},
84
387
  productFolderIds: {}
85
- }, b = (e) => {
86
- const t = {
388
+ }, ke = (n) => {
389
+ const e = {
87
390
  folder: /* @__PURE__ */ new Set(),
88
391
  task: /* @__PURE__ */ new Set(),
89
392
  version: /* @__PURE__ */ new Set(),
90
393
  product: /* @__PURE__ */ new Set()
91
394
  };
92
- for (const { entityType: r, entityIds: d } of e) {
93
- const o = t[r];
94
- if (o)
95
- for (const i of d)
96
- o.add(i);
395
+ for (const { entityType: s, entityIds: c } of n) {
396
+ const l = e[s];
397
+ if (l)
398
+ for (const f of c)
399
+ l.add(f);
97
400
  }
98
401
  return {
99
- folderIds: [...t.folder],
100
- taskIds: [...t.task],
101
- versionIds: [...t.version],
102
- productIds: [...t.product]
402
+ folderIds: [...e.folder],
403
+ taskIds: [...e.task],
404
+ versionIds: [...e.version],
405
+ productIds: [...e.product]
103
406
  };
104
- }, J = ({
105
- slices: e,
106
- projectName: t
407
+ }, Xe = ({
408
+ slices: n,
409
+ projectName: e
107
410
  }) => {
108
- const r = R(), [d, o] = y(f), [i, n] = y(f), [l, a] = y(g), [I, p] = y(""), u = e.find((c) => c.sliceType === "entityList")?.rowSelection, s = h(
109
- () => Object.keys(u ?? {}).filter((c) => u?.[c] && !c.startsWith("folder-")).sort(),
110
- [u]
111
- ), S = s.length && t ? `${t}|${s}` : "";
112
- return P(() => {
113
- if (!S) {
114
- o(f), n(f), a(g), p("");
411
+ const s = ge(), [c, l] = A($), [f, S] = A($), [d, o] = A(q), [y, h] = A(""), w = n.find((E) => E.sliceType === "entityList")?.rowSelection, i = L(
412
+ () => Object.keys(w ?? {}).filter((E) => w?.[E] && !E.startsWith("folder-")).sort(),
413
+ [w]
414
+ ), P = i.length && e ? `${e}|${i}` : "";
415
+ return M(() => {
416
+ if (!P) {
417
+ l($), S($), o(q), h("");
115
418
  return;
116
419
  }
117
- let c = !1;
420
+ let E = !1;
118
421
  return (async () => {
119
422
  try {
120
- const E = await Promise.all(
121
- s.map(
122
- (T) => r(
123
- _.endpoints.getListEntities.initiate({ projectName: t, listId: T })
423
+ const x = await Promise.all(
424
+ i.map(
425
+ (I) => s(
426
+ Ie.endpoints.getListEntities.initiate({ projectName: e, listId: I })
124
427
  ).unwrap()
125
428
  )
126
- ), v = b(E);
127
- c || n(v);
128
- const { parentMaps: w, ...L } = await C(
129
- v,
429
+ ), t = ke(x);
430
+ E || S(t);
431
+ const { parentMaps: a, ...u } = await xe(
130
432
  t,
131
- r
433
+ e,
434
+ s
132
435
  );
133
- c || (o(L), a(w));
134
- } catch (E) {
135
- console.error("Error fetching entity list IDs:", E), c || (o(f), n(f), a(g));
436
+ E || (l(u), o(a));
437
+ } catch (x) {
438
+ console.error("Error fetching entity list IDs:", x), E || (l($), S($), o(q));
136
439
  } finally {
137
- c || p(S);
440
+ E || h(P);
138
441
  }
139
442
  })(), () => {
140
- c = !0;
443
+ E = !0;
141
444
  };
142
- }, [S, s, t, r]), { entityIds: d, rawEntityIds: i, parentMaps: l, isLoading: S !== I };
143
- }, M = ({ slice: e, attribFields: t }) => {
144
- const r = {
445
+ }, [P, i, e, s]), { entityIds: c, rawEntityIds: f, parentMaps: d, isLoading: P !== y };
446
+ }, ve = ({ slice: n, attribFields: e }) => {
447
+ const s = {
145
448
  assignees: "list_of_strings",
146
449
  status: "string",
147
450
  taskType: "string",
@@ -149,68 +452,69 @@ const B = ({
149
452
  author: "string",
150
453
  hierarchy: void 0,
151
454
  entityList: void 0,
152
- ...t.reduce((o, i) => (o["attrib." + i.name] = i.data.type, o), {})
455
+ ...e.reduce((l, f) => (l["attrib." + f.name] = f.data.type, l), {})
153
456
  };
154
457
  return (() => {
155
- if (!e) return null;
156
- const o = r[e?.sliceType], i = Object.entries(e.rowSelection).filter(([n, l]) => !!n && l).map(([n]) => ({
157
- id: n,
158
- label: n
458
+ if (!n) return null;
459
+ const l = s[n?.sliceType], f = Object.entries(n.rowSelection).filter(([S, d]) => !!S && d).map(([S]) => ({
460
+ id: S,
461
+ label: S
159
462
  }));
160
463
  return {
161
- id: e?.sliceType,
162
- label: e?.sliceType,
163
- type: o,
464
+ id: n?.sliceType,
465
+ label: n?.sliceType,
466
+ type: l,
164
467
  inverted: !1,
165
468
  operator: "OR",
166
- values: i
469
+ values: f
167
470
  };
168
471
  })();
169
- }, O = ({
170
- slices: e,
171
- attribFields: t
172
- }) => e.filter((r) => r.sliceType !== "hierarchy" && r.sliceType !== "entityList").map((r) => M({ slice: r, attribFields: t })).filter((r) => !!r), N = (e) => {
173
- const { slices: t, getPanelSelection: r } = k(), { powerLicense: d, isLoading: o } = F(), i = h(() => {
174
- const l = t.map((a) => ({
175
- sliceType: a.sliceType,
176
- rowSelection: r(a.id)
472
+ }, Te = ({
473
+ slices: n,
474
+ attribFields: e
475
+ }) => n.filter((s) => s.sliceType !== "hierarchy" && s.sliceType !== "entityList").map((s) => ve({ slice: s, attribFields: e })).filter((s) => !!s), Je = (n) => {
476
+ const { slices: e, getPanelSelection: s } = Ee(), { powerLicense: c, isLoading: l } = z(), f = L(() => {
477
+ const d = e.map((o) => ({
478
+ sliceType: o.sliceType,
479
+ rowSelection: s(o.id)
177
480
  }));
178
- return d ? l : l.slice(0, 1);
179
- }, [t, r, d]), n = h(
180
- () => O({ slices: i, attribFields: e }),
181
- [i, e]
481
+ return c ? d : d.slice(0, 1);
482
+ }, [e, s, c]), S = L(
483
+ () => Te({ slices: f, attribFields: n }),
484
+ [f, n]
182
485
  );
183
486
  return {
184
- sliceSelections: i,
185
- sliceFilters: n,
186
- isLicensePending: t.length > 1 && o
487
+ sliceSelections: f,
488
+ sliceFilters: S,
489
+ isLicensePending: e.length > 1 && l
187
490
  };
188
491
  };
189
492
  export {
190
- Z as SLICER_DEFAULT_PANEL_HEIGHT,
191
- ee as SLICER_MIN_PANEL_HEIGHT,
192
- Ie as SLICER_PAGES_CONFIG,
193
- te as SLICER_SPLITTER_PANEL_CONFIG,
194
- se as SLICER_SPLITTER_STATE_KEY,
195
- re as Slicer,
196
- Se as SlicerProvider,
197
- oe as buildListFolderRowId,
198
- ie as clampDraggedHeights,
199
- M as createFilterFromSlicer,
200
- O as createFiltersFromSlicer,
201
- ne as defaultSliceOptions,
202
- de as resolvePanelLayout,
203
- le as useEntityListsSlice,
204
- B as useFiltersWithHierarchy,
205
- ce as useHierarchyContextMenuItems,
206
- ye as useHierarchySelection,
207
- he as useOptionalSlicerContext,
208
- J as useSelectedEntityIds,
209
- k as useSlicerContext,
210
- ae as useSlicerCounts,
211
- ue as useSlicerPanelHeights,
212
- N as useSlicerPanelSelections,
213
- Ee as useSlicerRemotes,
214
- me as useSlicerRowSelection,
215
- pe as useSlicerSplitter
493
+ Ve as SLICER_DEFAULT_PANEL_HEIGHT,
494
+ je as SLICER_MIN_PANEL_HEIGHT,
495
+ ft as SLICER_PAGES_CONFIG,
496
+ Ne as SLICER_SPLITTER_PANEL_CONFIG,
497
+ et as SLICER_SPLITTER_STATE_KEY,
498
+ tt as Slicer,
499
+ pe as SlicerContext,
500
+ Ue as SlicerProvider,
501
+ st as buildListFolderRowId,
502
+ nt as clampDraggedHeights,
503
+ ve as createFilterFromSlicer,
504
+ Te as createFiltersFromSlicer,
505
+ ot as defaultSliceOptions,
506
+ rt as resolvePanelLayout,
507
+ it as useEntityListsSlice,
508
+ ze as useFiltersWithHierarchy,
509
+ ct as useHierarchyContextMenuItems,
510
+ ht as useHierarchySelection,
511
+ St as useOptionalSlicerContext,
512
+ Xe as useSelectedEntityIds,
513
+ Ee as useSlicerContext,
514
+ lt as useSlicerCounts,
515
+ dt as useSlicerPanelHeights,
516
+ Je as useSlicerPanelSelections,
517
+ me as useSlicerRemotes,
518
+ Pe as useSlicerRowSelection,
519
+ at as useSlicerSplitter
216
520
  };