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