@ynput/ayon-frontend-shared 0.3.49 → 0.3.51

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 (108) hide show
  1. package/dist/Slicer.cjs.js +1 -1
  2. package/dist/Slicer.es.js +13 -11
  3. package/dist/Slicer.es.js.map +1 -1
  4. package/dist/_virtual/index.cjs10.js +1 -1
  5. package/dist/_virtual/index.cjs11.js +1 -1
  6. package/dist/_virtual/index.cjs12.js +1 -1
  7. package/dist/_virtual/index.cjs5.js +1 -1
  8. package/dist/_virtual/index.cjs6.js +1 -1
  9. package/dist/_virtual/index.es10.js +3 -3
  10. package/dist/_virtual/index.es11.js +5 -5
  11. package/dist/_virtual/index.es12.js +5 -5
  12. package/dist/_virtual/index.es5.js +5 -2
  13. package/dist/_virtual/index.es5.js.map +1 -1
  14. package/dist/_virtual/index.es6.js +2 -5
  15. package/dist/_virtual/index.es6.js.map +1 -1
  16. package/dist/components.cjs.js +1 -1
  17. package/dist/components.es.js +112 -109
  18. package/dist/components.es.js.map +1 -1
  19. package/dist/node_modules/rehype/node_modules/unified/lib/index.cjs.js +1 -1
  20. package/dist/node_modules/rehype/node_modules/unified/lib/index.es.js +2 -2
  21. package/dist/node_modules/rehype/node_modules/vfile/lib/index.cjs.js +1 -1
  22. package/dist/node_modules/rehype/node_modules/vfile/lib/index.es.js +1 -1
  23. package/dist/node_modules/rehype-parse/lib/index.cjs.js +1 -1
  24. package/dist/node_modules/rehype-parse/lib/index.es.js +1 -1
  25. package/dist/node_modules/remove-accents/index.cjs.js +1 -1
  26. package/dist/node_modules/remove-accents/index.es.js +1 -1
  27. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
  28. package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
  29. package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
  30. package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
  31. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
  32. package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
  33. package/dist/shared/src/api/generated/graphql.cjs.js +1 -1
  34. package/dist/shared/src/api/generated/graphql.cjs.js.map +1 -1
  35. package/dist/shared/src/api/generated/graphql.es.js +1 -1
  36. package/dist/shared/src/api/generated/graphql.es.js.map +1 -1
  37. package/dist/shared/src/api/queries/columnStats/columnStats.cjs.js +1 -1
  38. package/dist/shared/src/api/queries/columnStats/columnStats.cjs.js.map +1 -1
  39. package/dist/shared/src/api/queries/columnStats/columnStats.es.js +56 -44
  40. package/dist/shared/src/api/queries/columnStats/columnStats.es.js.map +1 -1
  41. package/dist/shared/src/api/queries/columnStats/groupCounts.cjs.js +1 -1
  42. package/dist/shared/src/api/queries/columnStats/groupCounts.cjs.js.map +1 -1
  43. package/dist/shared/src/api/queries/columnStats/groupCounts.es.js +10 -8
  44. package/dist/shared/src/api/queries/columnStats/groupCounts.es.js.map +1 -1
  45. package/dist/shared/src/components/LinksManager/LinksManager.cjs.js.map +1 -1
  46. package/dist/shared/src/components/LinksManager/LinksManager.es.js.map +1 -1
  47. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js +1 -1
  48. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js.map +1 -1
  49. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js +220 -216
  50. package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js.map +1 -1
  51. package/dist/shared/src/containers/DetailsPanel/components/DetailsPanelMoreMenu/hooks/useMenuOptions.cjs.js +1 -1
  52. package/dist/shared/src/containers/DetailsPanel/components/DetailsPanelMoreMenu/hooks/useMenuOptions.cjs.js.map +1 -1
  53. package/dist/shared/src/containers/DetailsPanel/components/DetailsPanelMoreMenu/hooks/useMenuOptions.es.js +1 -1
  54. package/dist/shared/src/containers/DetailsPanel/components/DetailsPanelMoreMenu/hooks/useMenuOptions.es.js.map +1 -1
  55. package/dist/shared/src/containers/Feed/components/FeedSearchFilter.cjs.js +2 -2
  56. package/dist/shared/src/containers/Feed/components/FeedSearchFilter.cjs.js.map +1 -1
  57. package/dist/shared/src/containers/Feed/components/FeedSearchFilter.es.js +138 -127
  58. package/dist/shared/src/containers/Feed/components/FeedSearchFilter.es.js.map +1 -1
  59. package/dist/shared/src/containers/Feed/context/FeedContext.cjs.js.map +1 -1
  60. package/dist/shared/src/containers/Feed/context/FeedContext.es.js.map +1 -1
  61. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js +1 -1
  62. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js.map +1 -1
  63. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js +56 -55
  64. package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js.map +1 -1
  65. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js +1 -1
  66. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js.map +1 -1
  67. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js +249 -254
  68. package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js.map +1 -1
  69. package/dist/shared/src/containers/ProjectTreeTable/hooks/useGroupCounts.cjs.js.map +1 -1
  70. package/dist/shared/src/containers/ProjectTreeTable/hooks/useGroupCounts.es.js.map +1 -1
  71. package/dist/shared/src/containers/SimpleTable/SimpleTable.cjs.js +1 -1
  72. package/dist/shared/src/containers/SimpleTable/SimpleTable.cjs.js.map +1 -1
  73. package/dist/shared/src/containers/SimpleTable/SimpleTable.es.js +41 -40
  74. package/dist/shared/src/containers/SimpleTable/SimpleTable.es.js.map +1 -1
  75. package/dist/shared/src/containers/Slicer/components/Slicer.cjs.js +2 -2
  76. package/dist/shared/src/containers/Slicer/components/Slicer.cjs.js.map +1 -1
  77. package/dist/shared/src/containers/Slicer/components/Slicer.es.js +55 -47
  78. package/dist/shared/src/containers/Slicer/components/Slicer.es.js.map +1 -1
  79. package/dist/shared/src/containers/Slicer/hooks/useSlicerCounts.cjs.js +2 -0
  80. package/dist/shared/src/containers/Slicer/hooks/useSlicerCounts.cjs.js.map +1 -0
  81. package/dist/shared/src/containers/Slicer/hooks/useSlicerCounts.es.js +319 -0
  82. package/dist/shared/src/containers/Slicer/hooks/useSlicerCounts.es.js.map +1 -0
  83. package/dist/shared/src/containers/Slicer/hooks/useTableDataBySlice.cjs.js +1 -1
  84. package/dist/shared/src/containers/Slicer/hooks/useTableDataBySlice.cjs.js.map +1 -1
  85. package/dist/shared/src/containers/Slicer/hooks/useTableDataBySlice.es.js +118 -104
  86. package/dist/shared/src/containers/Slicer/hooks/useTableDataBySlice.es.js.map +1 -1
  87. package/dist/shared/src/context/DetailsPanelContext.cjs.js +1 -1
  88. package/dist/shared/src/context/DetailsPanelContext.cjs.js.map +1 -1
  89. package/dist/shared/src/context/DetailsPanelContext.es.js +57 -55
  90. package/dist/shared/src/context/DetailsPanelContext.es.js.map +1 -1
  91. package/dist/shared/src/util/confirmDelete.cjs.js +1 -1
  92. package/dist/shared/src/util/confirmDelete.cjs.js.map +1 -1
  93. package/dist/shared/src/util/confirmDelete.es.js +28 -24
  94. package/dist/shared/src/util/confirmDelete.es.js.map +1 -1
  95. package/dist/types/components/index.d.ts +1 -0
  96. package/dist/types/containers/Feed/components/FeedSearchFilter.d.ts +2 -2
  97. package/dist/types/containers/ProjectTreeTable/hooks/useGroupCounts.d.ts +2 -3
  98. package/dist/types/containers/ProjectTreeTable/types/overviewContext.d.ts +8 -0
  99. package/dist/types/containers/ProjectTreeTable/types/table.d.ts +0 -1
  100. package/dist/types/containers/SimpleTable/SimpleTable.types.d.ts +1 -0
  101. package/dist/types/containers/Slicer/components/Slicer.d.ts +2 -0
  102. package/dist/types/containers/Slicer/hooks/index.d.ts +1 -0
  103. package/dist/types/containers/Slicer/hooks/useSlicerCounts.d.ts +17 -0
  104. package/dist/types/containers/Slicer/hooks/useTableDataBySlice.d.ts +5 -1
  105. package/dist/types/util/confirmDelete.d.ts +3 -1
  106. package/dist/util.cjs.js +1 -1
  107. package/dist/util.es.js +77 -76
  108. package/package.json +1 -1
@@ -96,7 +96,7 @@ import "../../../api/queries/views/getViews.es.js";
96
96
  import "../../../api/queries/views/updateViews.es.js";
97
97
  import "../../../api/queries/watchers/getWatchers.es.js";
98
98
  import "../../../api/queries/uris/getUris.es.js";
99
- import { useMemo as n, useState as kt, useEffect as Tt } from "react";
99
+ import { useMemo as e, useState as kt, useEffect as Tt } from "react";
100
100
  import "../../../context/RemoteModulesContext.es.js";
101
101
  import "../../../../node_modules/@module-federation/runtime/dist/index.es.js";
102
102
  import "../../../../../_virtual/semver.es.js";
@@ -303,364 +303,359 @@ import "../../../context/DeleteEntitiesContext.es.js";
303
303
  import "custom-protocol-check";
304
304
  import { useGroupedPagination as li } from "../../../hooks/useGroupedPagination.es.js";
305
305
  import "../components/GroupSettingsFallback.es.js";
306
- const ui = 300, Vm = ({
307
- projectName: T,
308
- selectedFolders: a,
306
+ const ui = 300, Hm = ({
307
+ projectName: h,
308
+ selectedFolders: n,
309
309
  // comes from the slicer
310
- excludeSelectedFolders: g = !1,
311
- taskIds: h,
310
+ excludeSelectedFolders: l = !1,
311
+ taskIds: u,
312
312
  // specific task IDs from entity list slicer
313
- taskFilters: d,
314
- folderFilters: I,
315
- sorting: J,
316
- groupBy: k,
317
- taskGroups: O = [],
313
+ taskFilters: a,
314
+ folderFilters: k,
315
+ sorting: Y,
316
+ groupBy: g,
317
+ taskGroups: A = [],
318
318
  taskGroupsCount: yt,
319
- expanded: y,
320
- showHierarchy: f,
321
- isFlatFolderView: c = !1,
319
+ expanded: T,
320
+ showHierarchy: d,
321
+ isFlatFolderView: f = !1,
322
322
  attribFields: Lt,
323
323
  modules: vt,
324
- skipLinks: M,
325
- showComments: C = !1,
326
- isLoadingViews: L = !1,
327
- onCollapseAll: N,
328
- visibleEntityIds: _ = [],
329
- folderStatsArgs: K,
330
- taskStatsArgs: X,
324
+ skipLinks: S,
325
+ showComments: O = !1,
326
+ isLoadingViews: I = !1,
327
+ onCollapseAll: C,
328
+ visibleEntityIds: N = [],
329
+ folderStatsArgs: J,
330
+ taskStatsArgs: K,
331
331
  folderStatsUninitialized: St,
332
332
  taskStatsUninitialized: Et,
333
- dispatch: Z
333
+ dispatch: X
334
334
  }) => {
335
- const { isLoading: $ } = vt, {
336
- folders: u,
335
+ const { isLoading: Z } = vt, {
336
+ folders: c,
337
337
  isLoading: Mt,
338
338
  isUninitialized: Pt,
339
- getFolderById: j
340
- } = ni(), U = Object.entries(y).filter(([, t]) => t).filter(([t]) => !It(t)).map(([t]) => t), F = n(
339
+ getFolderById: $
340
+ } = ni(), M = Object.entries(T).filter(([, t]) => t).filter(([t]) => !It(t)).map(([t]) => t), _ = e(
341
341
  () => ci({
342
- expanded: y,
343
- expandedParentIds: U,
344
- selectedFolders: a,
345
- excludeSelectedFolders: g,
346
- getFolderById: j,
347
- showHierarchy: f
342
+ expanded: T,
343
+ expandedParentIds: M,
344
+ selectedFolders: n,
345
+ excludeSelectedFolders: l,
346
+ getFolderById: $,
347
+ showHierarchy: d
348
348
  }),
349
349
  [
350
- y,
351
- U,
352
- a,
353
- g,
354
- j,
355
- f
350
+ T,
351
+ M,
352
+ n,
353
+ l,
354
+ $,
355
+ d
356
356
  ]
357
- ), [w, Ut] = kt(_), W = n(
357
+ ), [j, Ut] = kt(N), F = e(
358
358
  () => mi((t) => Ut(t), ui),
359
359
  []
360
360
  );
361
- Tt(() => (W(_), () => W.cancel()), [_, W]);
362
- const H = n(() => {
363
- if (!f || c)
364
- return F;
365
- const t = new Set(w);
366
- return F.filter((r) => t.has(r));
367
- }, [F, f, c, w]), V = {
368
- projectName: T,
369
- parentIds: H,
370
- filter: d.filterString,
371
- folderFilter: I.filterString,
372
- search: d.search,
373
- showComments: C
361
+ Tt(() => (F(N), () => F.cancel()), [N, F]);
362
+ const w = e(() => {
363
+ if (!d || f)
364
+ return _;
365
+ const t = new Set(j);
366
+ return _.filter((o) => t.has(o));
367
+ }, [_, d, f, j]), H = {
368
+ projectName: h,
369
+ parentIds: w,
370
+ filter: a.filterString,
371
+ folderFilter: k.filterString,
372
+ search: a.search,
373
+ showComments: O
374
374
  }, {
375
- data: S = [],
376
- isFetching: tt,
375
+ data: L = [],
376
+ isFetching: V,
377
377
  error: R,
378
378
  isUninitialized: zt
379
- } = ri(V, {
380
- skip: L || !H.length || !f && !c
381
- }), it = !d.filterString && !I.filterString && !d.search && !I.search || !u.length || !f && !c, rt = {
382
- projectName: T,
379
+ } = ri(H, {
380
+ skip: I || !w.length || !d && !f
381
+ }), tt = !a.filterString && !k.filterString && !a.search && !k.search || !c.length || !d && !f, it = {
382
+ projectName: h,
383
383
  folderSearchRequest: {
384
- taskFilter: d.filter?.conditions?.length ? d.filter : void 0,
385
- folderFilter: I.filter?.conditions?.length ? I.filter : void 0,
386
- search: d.search
384
+ taskFilter: a.filter?.conditions?.length ? a.filter : void 0,
385
+ folderFilter: k.filter?.conditions?.length ? k.filter : void 0,
386
+ search: a.search
387
387
  }
388
388
  }, {
389
- data: z,
390
- isUninitialized: ot,
389
+ data: P,
390
+ isUninitialized: rt,
391
391
  isLoading: bt,
392
392
  isUninitialized: Gt,
393
393
  error: Qt
394
- } = oi(rt, {
395
- skip: L || it
396
- }), q = n(() => {
394
+ } = oi(it, {
395
+ skip: I || tt
396
+ }), W = e(() => {
397
397
  const t = /* @__PURE__ */ new Set();
398
- return u.forEach((r) => {
399
- if (!r.parentId) {
400
- t.add(r.id);
398
+ return c.forEach((o) => {
399
+ if (!o.parentId) {
400
+ t.add(o.id);
401
401
  return;
402
402
  }
403
- const s = r.parentId, o = g ? a.includes(s) : a.includes(r.id);
404
- (y[s] === !0 || o) && t.add(r.id);
403
+ const i = o.parentId, p = l ? n.includes(i) : n.includes(o.id);
404
+ (T[i] === !0 || p) && t.add(o.id);
405
405
  }), t;
406
406
  }, [
407
- u,
408
- z,
409
- it,
410
- y,
411
- a,
412
- g
413
- ]), pt = {
414
- projectName: T,
415
- entityIds: Array.from(q),
407
+ c,
408
+ P,
409
+ tt,
410
+ T,
411
+ n,
412
+ l
413
+ ]), ot = {
414
+ projectName: h,
415
+ entityIds: Array.from(W),
416
416
  entityType: "folder"
417
417
  }, {
418
- data: b = [],
418
+ data: U = [],
419
419
  isUninitialized: Dt,
420
- isFetching: st
421
- } = ht(pt, { skip: L || M }), v = n(() => {
422
- const t = /* @__PURE__ */ new Map(), r = a.map((i) => u.find((p) => p.id === i)?.path).filter(Boolean), s = (i) => {
423
- const p = i.path;
424
- return r.some(
425
- (m) => p === m || p.startsWith(m + "/")
426
- );
427
- }, o = (i) => ({
420
+ isFetching: pt
421
+ } = ht(ot, { skip: I || S }), y = e(() => {
422
+ const t = /* @__PURE__ */ new Map(), o = (i) => ({
428
423
  ...i,
429
424
  entityId: i.id,
430
425
  entityType: "folder",
431
- links: b?.find((m) => m.id === i.id)?.links || []
426
+ links: U?.find((r) => r.id === i.id)?.links || []
432
427
  });
433
- if (!ot && z && u.length) {
428
+ if (!rt && P && c.length) {
434
429
  const i = /* @__PURE__ */ new Set();
435
- for (const e of z)
436
- i.add(e);
430
+ for (const s of P)
431
+ i.add(s);
437
432
  const p = /* @__PURE__ */ new Map();
438
- for (const e of u)
439
- p.set(e.id, e);
440
- const m = (e) => {
441
- const l = p.get(e);
442
- l && l.parentId && (i.add(l.parentId), m(l.parentId));
433
+ for (const s of c)
434
+ p.set(s.id, s);
435
+ const r = (s) => {
436
+ const m = p.get(s);
437
+ m && m.parentId && (i.add(m.parentId), r(m.parentId));
443
438
  };
444
- if (!c) {
445
- const e = [...i];
446
- for (const l of e)
447
- m(l);
439
+ if (!f) {
440
+ const s = [...i];
441
+ for (const m of s)
442
+ r(m);
448
443
  }
449
- for (const e of u)
450
- (i.has(e.id) || s(e)) && t.set(e.id, o(e));
444
+ for (const s of c)
445
+ i.has(s.id) && t.set(s.id, o(s));
451
446
  } else
452
- for (const i of u)
447
+ for (const i of c)
453
448
  t.set(i.id, o(i));
454
- if (a.length) {
455
- const i = /* @__PURE__ */ new Map();
456
- return t.forEach((p, m) => {
457
- const e = p.path, l = r.includes(e);
458
- (r.some(
459
- (Vt) => e.startsWith(Vt + "/")
460
- ) || l && (!g || c)) && i.set(m, o(p));
461
- }), i;
449
+ if (n.length) {
450
+ const i = n.map((r) => c.find((s) => s.id === r)?.path).filter(Boolean), p = /* @__PURE__ */ new Map();
451
+ return t.forEach((r, s) => {
452
+ const m = r.path, x = i.includes(m);
453
+ (i.some(
454
+ (Vt) => m.startsWith(Vt + "/")
455
+ ) || x && (!l || f)) && p.set(s, o(r));
456
+ }), p;
462
457
  }
463
458
  return t;
464
459
  }, [
465
- u,
466
- z,
467
- ot,
468
- a,
469
- g,
470
- b,
471
- c
472
- ]), Bt = n(() => tt ? ai({
473
- expandedFoldersTasks: S,
474
- expandedParentIds: U,
475
- foldersMap: v
476
- }) : {}, [tt, S, U, v]), [mt, xt] = kt("");
460
+ c,
461
+ P,
462
+ rt,
463
+ n,
464
+ l,
465
+ U,
466
+ f
467
+ ]), Bt = e(() => V ? ai({
468
+ expandedFoldersTasks: L,
469
+ expandedParentIds: M,
470
+ foldersMap: y
471
+ }) : {}, [V, L, M, y]), [st, xt] = kt("");
477
472
  Tt(() => {
478
- mt && xt("");
479
- }, [J, mt]);
480
- const E = { ...J[0] }, G = E?.id === "name" && !f ? "path" : E?.id === "subType" ? "taskType" : E?.id, At = a.length ? Array.from(
481
- /* @__PURE__ */ new Set([...v.keys(), ...g ? a : []])
482
- ) : void 0, P = f && g && a.length ? a : void 0, et = {
483
- projectName: T,
484
- filter: d.filterString,
485
- folderFilter: I.filterString,
486
- search: d.search,
487
- folderIds: h?.length ? void 0 : P ?? (a.length ? a : void 0),
488
- taskIds: h?.length ? h : void 0,
489
- sortBy: G ? G.replace("_", ".") : void 0,
490
- desc: !!E?.desc,
491
- showComments: C,
492
- includeFolderChildren: !P
473
+ st && xt("");
474
+ }, [Y, st]);
475
+ const v = { ...Y[0] }, z = v?.id === "name" && !d ? "path" : v?.id === "subType" ? "taskType" : v?.id, At = n.length ? Array.from(
476
+ /* @__PURE__ */ new Set([...y.keys(), ...l ? n : []])
477
+ ) : void 0, E = d && l && n.length ? n : void 0, mt = {
478
+ projectName: h,
479
+ filter: a.filterString,
480
+ folderFilter: k.filterString,
481
+ search: a.search,
482
+ folderIds: u?.length ? void 0 : E ?? (n.length ? n : void 0),
483
+ taskIds: u?.length ? u : void 0,
484
+ sortBy: z ? z.replace("_", ".") : void 0,
485
+ desc: !!v?.desc,
486
+ showComments: O,
487
+ includeFolderChildren: !E
493
488
  }, {
494
- data: Y,
489
+ data: q,
495
490
  isLoading: Ot,
496
491
  error: Ct,
497
492
  fetchNextPage: Nt,
498
493
  hasNextPage: _t,
499
494
  isFetchingNextPage: Ft,
500
- isUninitialized: Wt
501
- } = pi(et, {
495
+ isUninitialized: Rt
496
+ } = pi(mt, {
502
497
  // Skip flat task list for flat folder view (tasks loaded on folder expand).
503
498
  // In hierarchy+slicer mode, run it to fetch tasks under selected-but-hidden folders.
504
499
  // Always run it when entity list provides specific task IDs.
505
- skip: L || (f && !P || c) && !h?.length,
500
+ skip: I || (d && !E || f) && !u?.length,
506
501
  initialPageParam: {
507
502
  cursor: "",
508
- desc: !!E?.desc
503
+ desc: !!v?.desc
509
504
  }
510
- }), Q = n(() => Y?.pages ? Y.pages.flatMap((t) => t.tasks || []) : [], [Y?.pages]), { pageCounts: nt, incrementPageCount: Rt } = li({
511
- groups: O
512
- }), at = ei(k, Lt), dt = n(() => Object.entries(y).filter(([, t]) => t).filter(([t]) => It(t)).map(([t]) => t.slice(di.length)), [y]), ft = n(() => k ? fi({
513
- groups: O,
505
+ }), b = e(() => q?.pages ? q.pages.flatMap((t) => t.tasks || []) : [], [q?.pages]), { pageCounts: et, incrementPageCount: Wt } = li({
506
+ groups: A
507
+ }), nt = ei(g, Lt), at = e(() => Object.entries(T).filter(([, t]) => t).filter(([t]) => It(t)).map(([t]) => t.slice(di.length)), [T]), dt = e(() => g ? fi({
508
+ groups: A,
514
509
  // @ts-expect-error: filter is the same
515
- filters: d.filter,
516
- groupBy: k,
517
- groupPageCounts: nt,
518
- dataType: at
519
- }).filter((r) => dt.includes(r.value)) : [], [
520
- k,
521
- O,
510
+ filters: a.filter,
511
+ groupBy: g,
512
+ groupPageCounts: et,
513
+ dataType: nt
514
+ }).filter((o) => at.includes(o.value)) : [], [
515
+ g,
516
+ A,
517
+ et,
522
518
  nt,
523
- at,
524
- d.filter,
525
- dt
526
- ]), ct = {
527
- projectName: T,
528
- groups: ft,
529
- sortBy: G ? G.replace("_", ".") : void 0,
530
- desc: !!E?.desc,
531
- search: d.search,
532
- folderFilter: I.filterString,
519
+ a.filter,
520
+ at
521
+ ]), ft = {
522
+ projectName: h,
523
+ groups: dt,
524
+ sortBy: z ? z.replace("_", ".") : void 0,
525
+ desc: !!v?.desc,
526
+ search: a.search,
527
+ folderFilter: k.filterString,
533
528
  folderIds: At,
534
529
  groupCount: yt,
535
- showComments: C
530
+ showComments: O
536
531
  }, {
537
- data: { tasks: lt = [] } = {},
532
+ data: { tasks: ct = [] } = {},
538
533
  isUninitialized: qt,
539
534
  error: Yt
540
- } = si(ct, {
541
- skip: L || !k || !ft.length || $
542
- }), D = n(() => h?.length ? Q : c ? S : f ? P ? [...S, ...Q] : S : k ? lt : Q, [
543
- h,
535
+ } = si(ft, {
536
+ skip: I || !g || !dt.length || Z
537
+ }), G = e(() => u?.length ? b : f ? L : d ? E ? [...L, ...b] : L : g ? ct : b, [
538
+ u,
539
+ d,
540
+ E,
544
541
  f,
545
- P,
546
- c,
547
- k,
548
- Q,
549
- S,
550
- lt
551
- ]), B = n(() => new Set(D.map((t) => t.id)), [D]), ut = {
552
- projectName: T,
553
- entityIds: Array.from(B),
542
+ g,
543
+ b,
544
+ L,
545
+ ct
546
+ ]), Q = e(() => new Set(G.map((t) => t.id)), [G]), lt = {
547
+ projectName: h,
548
+ entityIds: Array.from(Q),
554
549
  entityType: "task"
555
550
  }, {
556
- data: x = [],
551
+ data: D = [],
557
552
  isUninitialized: Jt,
558
- isFetching: gt
559
- } = ht(ut, {
560
- skip: L || B.size === 0 || M
561
- }), Kt = n(() => {
553
+ isFetching: ut
554
+ } = ht(lt, {
555
+ skip: I || Q.size === 0 || S
556
+ }), Kt = e(() => {
562
557
  const t = /* @__PURE__ */ new Set();
563
- if (st && !M) {
564
- const r = new Set(b.map((s) => s.id));
565
- for (const s of q)
566
- r.has(s) || t.add(s);
558
+ if (pt && !S) {
559
+ const o = new Set(U.map((i) => i.id));
560
+ for (const i of W)
561
+ o.has(i) || t.add(i);
567
562
  }
568
- if (gt && !M) {
569
- const r = new Set(x.map((s) => s.id));
570
- for (const s of B)
571
- r.has(s) || t.add(s);
563
+ if (ut && !S) {
564
+ const o = new Set(D.map((i) => i.id));
565
+ for (const i of Q)
566
+ o.has(i) || t.add(i);
572
567
  }
573
568
  return t;
574
569
  }, [
575
- st,
576
- gt,
577
- b,
578
- x,
579
- q,
580
- B,
581
- M
570
+ pt,
571
+ ut,
572
+ U,
573
+ D,
574
+ W,
575
+ Q,
576
+ S
582
577
  ]), Xt = (t) => {
583
- k ? t && Rt(t) : _t && Nt();
584
- }, { tasksMap: Zt, tasksByFolderMap: A } = n(() => {
585
- const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), s = (o) => ({
586
- ...o,
587
- entityId: o.id,
578
+ g ? t && Wt(t) : _t && Nt();
579
+ }, { tasksMap: Zt, tasksByFolderMap: B } = e(() => {
580
+ const t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = (p) => ({
581
+ ...p,
582
+ entityId: p.id,
588
583
  entityType: "task",
589
- links: x?.find((i) => i.id === o.id)?.links || []
584
+ links: D?.find((r) => r.id === p.id)?.links || []
590
585
  });
591
- for (const o of D) {
592
- const i = o.id, p = o.folderId;
593
- if (t.has(i)) {
594
- const m = t.get(i), e = s(o), l = {
586
+ for (const p of G) {
587
+ const r = p.id, s = p.folderId;
588
+ if (t.has(r)) {
589
+ const m = t.get(r), x = i(p), gt = {
595
590
  ...m,
596
- ...e,
597
- groups: [...m.groups || [], ...e.groups || []]
591
+ ...x,
592
+ groups: [...m.groups || [], ...x.groups || []]
598
593
  };
599
- t.set(i, l);
594
+ t.set(r, gt);
600
595
  } else
601
- t.set(i, s(o));
602
- if (r.has(p)) {
603
- const m = r.get(p);
604
- m.includes(i) || m.push(i);
596
+ t.set(r, i(p));
597
+ if (o.has(s)) {
598
+ const m = o.get(s);
599
+ m.includes(r) || m.push(r);
605
600
  } else
606
- r.set(p, [i]);
601
+ o.set(s, [r]);
607
602
  }
608
- return { tasksMap: t, tasksByFolderMap: r };
609
- }, [D, x]), $t = n(() => {
610
- if (!h?.length || !A.size) return v;
603
+ return { tasksMap: t, tasksByFolderMap: o };
604
+ }, [G, D]), $t = e(() => {
605
+ if (!u?.length || !B.size) return y;
611
606
  const t = /* @__PURE__ */ new Set();
612
- for (const o of A.keys())
613
- t.add(o);
614
- const r = (o) => {
615
- const i = v.get(o);
616
- if (i && i.parentId) {
617
- const p = i.parentId;
618
- t.has(p) || (t.add(p), r(p));
607
+ for (const p of B.keys())
608
+ t.add(p);
609
+ const o = (p) => {
610
+ const r = y.get(p);
611
+ if (r && r.parentId) {
612
+ const s = r.parentId;
613
+ t.has(s) || (t.add(s), o(s));
619
614
  }
620
615
  };
621
- for (const o of t)
622
- r(o);
623
- const s = /* @__PURE__ */ new Map();
624
- for (const [o, i] of v)
625
- t.has(o) && s.set(o, i);
626
- return s;
627
- }, [v, A, h]), jt = async (t = []) => {
628
- const r = t.length === 0, s = t.some((p) => p.topic.startsWith("entity.folder.")), o = t.some((p) => p.topic.startsWith("entity.task.")), i = [];
629
- (r || s) && !Pt && i.push({
616
+ for (const p of t)
617
+ o(p);
618
+ const i = /* @__PURE__ */ new Map();
619
+ for (const [p, r] of y)
620
+ t.has(p) && i.set(p, r);
621
+ return i;
622
+ }, [y, B, u]), jt = async (t = []) => {
623
+ const o = t.length === 0, i = t.some((s) => s.topic.startsWith("entity.folder.")), p = t.some((s) => s.topic.startsWith("entity.task.")), r = [];
624
+ (o || i) && !Pt && r.push({
630
625
  endpointName: "getFolderList",
631
- args: { projectName: T, attrib: !0 }
632
- }), (r || s || o) && !Gt && i.push({ endpointName: "getSearchFolders", args: rt }), (r || o) && !zt && i.push({
626
+ args: { projectName: h, attrib: !0 }
627
+ }), (o || i || p) && !Gt && r.push({ endpointName: "getSearchFolders", args: it }), (o || p) && !zt && r.push({
633
628
  endpointName: "getOverviewTasksByFolders",
634
- args: V
635
- }), (r || o) && !Wt && i.push({ endpointName: "getTasksListInfinite", args: et }), (r || o) && !qt && i.push({ endpointName: "getGroupedTasksList", args: ct }), (r || s) && !St && K && i.push({ endpointName: "GetFolderColumnStats", args: K }), (r || o) && !Et && X && i.push({ endpointName: "GetTaskColumnStats", args: X }), (r || s) && !Dt && i.push({ endpointName: "getEntityLinks", args: pt }), (r || o) && !Jt && i.push({ endpointName: "getEntityLinks", args: ut }), await Promise.all(
636
- i.map(
637
- ({ endpointName: p, args: m }) => Z(
638
- ti(p, m, {
629
+ args: H
630
+ }), (o || p) && !Rt && r.push({ endpointName: "getTasksListInfinite", args: mt }), (o || p) && !qt && r.push({ endpointName: "getGroupedTasksList", args: ft }), (o || i) && !St && J && r.push({ endpointName: "GetFolderColumnStats", args: J }), (o || p) && !Et && K && r.push({ endpointName: "GetTaskColumnStats", args: K }), (o || i) && !Dt && r.push({ endpointName: "getEntityLinks", args: ot }), (o || p) && !Jt && r.push({ endpointName: "getEntityLinks", args: lt }), await Promise.all(
631
+ r.map(
632
+ ({ endpointName: s, args: m }) => X(
633
+ ti(s, m, {
639
634
  refreshOtherActiveQueries: !1
640
635
  })
641
636
  ).unwrap()
642
637
  )
643
- ), i.map(
644
- ({ endpointName: p, args: m }) => Z(ii(p, m))
638
+ ), r.map(
639
+ ({ endpointName: s, args: m }) => X(ii(s, m))
645
640
  );
646
- }, wt = Ct || Qt || Yt, Ht = n(() => {
647
- if (R && N)
641
+ }, wt = Ct || Qt || Yt, Ht = e(() => {
642
+ if (R && C)
648
643
  return {
649
644
  label: "Collapse all folders",
650
645
  icon: "restart_alt",
651
- callback: N
646
+ callback: C
652
647
  };
653
- }, [R, N]);
648
+ }, [R, C]);
654
649
  return {
655
650
  foldersMap: $t,
656
651
  tasksMap: Zt,
657
- tasksByFolderMap: A,
652
+ tasksByFolderMap: B,
658
653
  error: wt,
659
654
  // @ts-expect-error: softError is a string
660
655
  softError: R?.error,
661
656
  // this is separate as we should still show the folders table so the user can make changes
662
657
  softErrorAction: Ht,
663
- isLoadingAll: L || Mt || Ot || bt || $,
658
+ isLoadingAll: I || Mt || Ot || bt || Z,
664
659
  // these all show a full loading state
665
660
  isLoadingMore: Ft,
666
661
  loadingTasks: Bt,
@@ -670,6 +665,6 @@ const ui = 300, Vm = ({
670
665
  };
671
666
  };
672
667
  export {
673
- Vm as useFetchOverviewData
668
+ Hm as useFetchOverviewData
674
669
  };
675
670
  //# sourceMappingURL=useFetchOverviewData.es.js.map